瀏覽代碼

merge from 'origin'

zhangxc 5 年之前
父節點
當前提交
a213a7ef11
共有 4 個文件被更改,包括 12 次插入97 次删除
  1. 6 1
      src/config/index.js
  2. 2 1
      src/store/async-actions/fetchModules.js
  3. 3 95
      src/store/async-actions/treat.js
  4. 1 0
      src/utils/utils.js

+ 6 - 1
src/config/index.js

@@ -39,5 +39,10 @@ export default {
     textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字
     slideTime:400,      //右侧指标推送展开/收起动画时间
     recoverTagNum:3,    //可回退标签的个数
-    regPreAndAft:/[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+$|^[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+/g  //搜索去掉前后的标点
+    regPreAndAft:/[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+$|^[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+/g,  //搜索去掉前后的标点
+    ruleTypeMap:{     //大数据推送参数featureType对应
+      '22':'1,2',
+      '11':'3',
+      '8':'4,5'
+    }
 };

+ 2 - 1
src/store/async-actions/fetchModules.js

@@ -245,7 +245,8 @@ export function getAssessData(disId,disName){
       disType:1,
       diag:disName,
       diseaseName:disName,
-      featureType:11,
+      featureType:'11',
+      ruleType:config.ruleTypeMap['11'],
       lis:emrData.lis,
       sex:emrData.sex,
       age:emrData.age,

+ 3 - 95
src/store/async-actions/treat.js

@@ -10,106 +10,13 @@ import {MODI_LOADING} from '@store/types/homePage.js';
 import { SHOW_TREAT} from '@store/types/treat.js';
 import Notify from '@commonComp/Notify';
 import {getChronic} from '@store/async-actions/homePage.js';
+import config from "@config/index";
+
 const api={
     pushTreatment:'/push/pushTreatment',
     getConceptDetail:'/conceptDetail/getConceptDetail'
 }
 
-// export const addDiagnostic = (item) => {
-//         return (dispatch, getState) => {
-//             const state = getState();
-//             let url = api.pushTreatment;
-//             const emrData = getEMRParams();
-//             const diagnosticList = state.diagnosticList.diagnosticList;
-//             let diag = '';
-//             if(diagnosticList) {
-//                 for (let i = 0; i < diagnosticList.length; i++ ) {
-//                     if(i ===0 ) {
-//                         diag = diag + diagnosticList[i].name;
-//                     } else {
-//                         diag = diag + ',' + diagnosticList[i].name;
-//                     }
-
-//                 }
-//             }
-//             if (item.type === 1) {
-//                 diag = diag + ',' + item.name
-//             } else {
-//                 diag = diag + ',' + item.name
-//             }
-//             const params = {
-//                 "age": emrData.age,
-//                 "featureType": "8",
-//                 "diag": diag,
-//                 "diseaseName":  item.name,
-//                 "lis": emrData.lis,
-//                 "other": emrData.other,
-//                 "pacs": emrData.pacs,
-//                 "sex": emrData.sex,
-//                 "symptom": emrData.current + emrData.main,
-//                 "vital": emrData.vital,
-//                 "patientId": emrData.patientId,
-//                 "hosCode": emrData.hosCode,
-//                 "adverseReactions": "string",
-//                 "scaleName": "string",
-//             };
-//             //判断是否走慢病系统
-//             const isChronic = state.diagnosticList.chronicMagItem ||state.mainSuit.chronicDesease;
-//             // const isChronic = true
-//             if (isChronic) {
-//                 let chronicList = JSON.parse(storageLocal.get('chronic'));
-//                 if(!chronicList){
-//                     getChronic().then(() =>{
-//                     chronicList = JSON.parse(storageLocal.get('chronic'));
-//                         for(let i=0; i<chronicList.length; i++){
-//                             if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){ //判断某个病是否为慢病
-//                                 params.disType = 1
-//                             }
-//                         }
-//                         hasTreatment(dispatch, state,item,url,params)
-
-//                     });
-//                 } else {
-//                     for(let i=0; i<chronicList.length; i++){
-//                         if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
-//                             params.disType = 1
-//                         }
-//                     }
-//                     hasTreatment(dispatch, state, item,url,params)
-//                 }
-//             } else {
-//                 hasTreatment(dispatch, state, item,url,params)
-//             }
-            
-            
-//         }
-
-// }
-
-// //判断是否存在治疗方案
-// function hasTreatment(dispatch, state,item,url, params) {
-//     const itemTreat = JSON.parse(JSON.stringify(item))
-//     json(url, params).then((data) =>{
-//         if (data.data.data) {
-//             itemTreat.treat = data.data.data
-//             dispatch({
-//                 type: ADD_TREAT,
-//                 item: itemTreat
-//             })
-//         } else {
-//             item.treat = null
-//             dispatch({
-//                 type: ADD_TREAT,
-//                 item: itemTreat
-//             })
-//         }
-        
-
-//     }).catch((e) =>{
-//         console.log(e)
-//     })
-// }
-
 export const getTreatResult = (item) =>{
     return (dispatch, getState) => {
         dispatch({
@@ -136,6 +43,7 @@ export const getTreatResult = (item) =>{
         const params = {
             "age": emrData.age,
             "featureType": "8",
+            "ruleType":config.ruleTypeMap["8"],
             "diag": diag,
             "diseaseName":  item.name,
             "lis": emrData.lis,

+ 1 - 0
src/utils/utils.js

@@ -218,6 +218,7 @@ export async function getBigPush(type,symData,save){
     "age": emrData.age,
     "hosCode": emrData.hosCode,
     "featureType": type,  //类型1:症状,4:查体,5:化验,6:辅检,7:诊断
+    "ruleType":config.ruleTypeMap[type],
     "diag": emrData.dis,
     "lis": emrData.lis,
     "other": emrData.other,