|
@@ -9,107 +9,14 @@ import { SAVE_FOLLOW_UP } from "@store/types/pushMessage";
|
|
|
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,10 +43,12 @@ export const getTreatResult = (item) =>{
|
|
|
const params = {
|
|
|
"age": emrData.age,
|
|
|
"featureType": "8",
|
|
|
+ "ruleType":config.ruleTypeMap["8"],
|
|
|
"diag": diag,
|
|
|
"diseaseName": item.name,
|
|
|
"lis": emrData.lis,
|
|
|
"other": emrData.other,
|
|
|
+ "pasts": emrData.other,
|
|
|
"pacs": emrData.pacs,
|
|
|
"sex": emrData.sex,
|
|
|
"symptom": emrData.current + emrData.main,
|
|
@@ -148,17 +57,56 @@ export const getTreatResult = (item) =>{
|
|
|
"hosCode": emrData.hosCode
|
|
|
};
|
|
|
// const params = {
|
|
|
- // "age": 20,
|
|
|
- // "diag": ",糖尿病",
|
|
|
- // "disType": 1,
|
|
|
- // "diseaseId":21773,
|
|
|
- // "featureType": "8",
|
|
|
- // "lis": [
|
|
|
-
|
|
|
- // ],
|
|
|
- // "sex": 3,
|
|
|
- // "symptom": "恶心,呕吐",
|
|
|
- // "vital": ""
|
|
|
+ // "disType":"1",
|
|
|
+ // "age":28,
|
|
|
+ // "diag":"2型糖尿病性肾病,1型糖尿病,糖尿病肾病",
|
|
|
+ // "diseaseName":"2型糖尿病",
|
|
|
+ // "featureType":"8",
|
|
|
+ // "hosCode":"A001",
|
|
|
+ // "lis":[
|
|
|
+ // {
|
|
|
+ // "name":"糖化血红蛋白测定",
|
|
|
+ // "detailName":"糖化血红蛋白(HbA1c)",
|
|
|
+ // "uniqueName":"糖化血红蛋白测定--糖化血红蛋白(HbA1c)",
|
|
|
+ // "source":"0",
|
|
|
+ // "minValue":4,
|
|
|
+ // "otherValue":"",
|
|
|
+ // "maxValue":6,
|
|
|
+ // "units":"%",
|
|
|
+ // "value":"5"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "name":"空腹葡萄糖测定",
|
|
|
+ // "detailName":"葡萄糖(GLU)",
|
|
|
+ // "uniqueName":"空腹葡萄糖测定--葡萄糖(GLU)",
|
|
|
+ // "source":"0",
|
|
|
+ // "minValue":3.9,
|
|
|
+ // "otherValue":"",
|
|
|
+ // "maxValue":6.1,
|
|
|
+ // "units":"mmol/L",
|
|
|
+ // "value":"5"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "name":"肝功能测定",
|
|
|
+ // "detailName":"谷丙转氨酶(ALT)",
|
|
|
+ // "uniqueName":"肝功能测定--谷丙转氨酶(ALT)",
|
|
|
+ // "source":"0",
|
|
|
+ // "minValue":5,
|
|
|
+ // "otherValue":"",
|
|
|
+ // "maxValue":40,
|
|
|
+ // "units":"U/L",
|
|
|
+ // "value":"180"
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
+ // "lisOrder":"",
|
|
|
+ // "lisString":"",
|
|
|
+ // "other":"",
|
|
|
+ // "otherOrder":"",
|
|
|
+ // "pacs":"",
|
|
|
+ // "pacsOrder":"",
|
|
|
+ // "sex":1,
|
|
|
+ // "symptom":"患者患有2型糖尿病近来出现泡沫尿",
|
|
|
+ // "vital":"体温40℃"
|
|
|
// }
|
|
|
const isChronic = state.diagnosticList.chronicMagItem ||state.mainSuit.chronicDesease;
|
|
|
// const isChronic = true
|
|
@@ -203,35 +151,35 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
|
|
|
treat = data.data.data || {}
|
|
|
}
|
|
|
if(treat) {
|
|
|
- let { treatment, commonTreatment, surgeryTreatment, drugHistory, adverseReactions, followUp} = treat
|
|
|
+ let { treatmentPlan, commonTreatment, surgeryTreatment, drugHistory, adverseEvent, followUp} = treat
|
|
|
if(!(commonTreatment || surgeryTreatment ||
|
|
|
- ( treatment &&treatment.length >0 ||
|
|
|
+ ( treatmentPlan &&treatmentPlan.length >0 ||
|
|
|
drugHistory&&drugHistory.length >0 ||
|
|
|
- adverseReactions&&adverseReactions.length >0 ||
|
|
|
- !!followUp ||treatment&&treatment.length >0))) {
|
|
|
+ adverseEvent&&adverseEvent.length >0 ||
|
|
|
+ !!followUp ||treatmentPlan&&treatmentPlan.length >0))) {
|
|
|
Notify.info('暂无数据');
|
|
|
return
|
|
|
}
|
|
|
dispatch({type: SHOW_TREAT})
|
|
|
dispatch({
|
|
|
type: SET_TREATMENT,
|
|
|
- treatment: treatment,
|
|
|
+ treatment: treatmentPlan,
|
|
|
generalTreat: commonTreatment,
|
|
|
surgeryTreat: surgeryTreatment,
|
|
|
drugHistory: drugHistory,
|
|
|
})
|
|
|
- if (adverseReactions) { //如何之前存过不良反应,则替换成之前的不良反应
|
|
|
+ if (adverseEvent) { //如何之前存过不良反应,则替换成之前的不良反应
|
|
|
const allAdversReactionList = state.treat.allAdversReactionList
|
|
|
if(allAdversReactionList) {
|
|
|
for(let i = 0; i < allAdversReactionList.length; i++) {
|
|
|
if(item.conceptId == allAdversReactionList[i].conceptId) { //判断是否存过不良反应
|
|
|
- for (let j = 0; j < adverseReactions.length; j++) { //判断不良反应是否有相同的不良反应,如果有,替换
|
|
|
+ for (let j = 0; j < adverseEvent.length; j++) { //判断不良反应是否有相同的不良反应,如果有,替换
|
|
|
for(let z = 0; z < allAdversReactionList[i].adversReactionList.length; z++) {
|
|
|
- if(adverseReactions[j].conceptId == allAdversReactionList[i].adversReactionList[z].conceptId && adverseReactions[j].name == allAdversReactionList[i].adversReactionList[z].name) {
|
|
|
+ if(adverseEvent[j].conceptId == allAdversReactionList[i].adversReactionList[z].conceptId && adverseEvent[j].name == allAdversReactionList[i].adversReactionList[z].name) {
|
|
|
for(let x = 0; x < allAdversReactionList[i].adversReactionList[z].details.length; x++) {
|
|
|
- for(let y = 0; y < adverseReactions[j].details.length; y++) {//判断每一项是否选择过
|
|
|
- if(allAdversReactionList[i].adversReactionList[z].details[x].name == adverseReactions[j].details[y].name && allAdversReactionList[i].adversReactionList[z].details[x].select) {
|
|
|
- adverseReactions[j].details[y].select = allAdversReactionList[i].adversReactionList[z].details[x].select
|
|
|
+ for(let y = 0; y < adverseEvent[j].details.length; y++) {//判断每一项是否选择过
|
|
|
+ if(allAdversReactionList[i].adversReactionList[z].details[x].name == adverseEvent[j].details[y].name && allAdversReactionList[i].adversReactionList[z].details[x].select) {
|
|
|
+ adverseEvent[j].details[y].select = allAdversReactionList[i].adversReactionList[z].details[x].select
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -243,7 +191,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- adverseReactions = []
|
|
|
+ adverseEvent = []
|
|
|
}
|
|
|
if(isChronic) {
|
|
|
let chronicList = JSON.parse(storageLocal.get('chronic'));
|
|
@@ -277,7 +225,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
|
|
|
}
|
|
|
dispatch({
|
|
|
type: SET_ADVERSE_REACTIONS,
|
|
|
- adversReactionList: adverseReactions
|
|
|
+ adversReactionList: adverseEvent
|
|
|
})
|
|
|
} else {
|
|
|
Notify.info('暂无数据');
|