|
@@ -8,107 +8,107 @@ import { isAddMainSuit } from '@store/async-actions/diagnosticList';
|
|
import { SAVE_FOLLOW_UP } from "@store/types/pushMessage";
|
|
import { SAVE_FOLLOW_UP } from "@store/types/pushMessage";
|
|
import {MODI_LOADING} from '@store/types/homePage.js';
|
|
import {MODI_LOADING} from '@store/types/homePage.js';
|
|
import { SHOW_TREAT} from '@store/types/treat.js';
|
|
import { SHOW_TREAT} from '@store/types/treat.js';
|
|
|
|
+import Notify from '@commonComp/Notify';
|
|
|
|
|
|
const api={
|
|
const api={
|
|
pushTreatment:'/push/pushTreatment',
|
|
pushTreatment:'/push/pushTreatment',
|
|
getConceptDetail:'/conceptDetail/getConceptDetail'
|
|
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;
|
|
|
|
- }
|
|
|
|
|
|
+// 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)
|
|
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// 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)
|
|
|
|
- }
|
|
|
|
|
|
+// });
|
|
|
|
+// } 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
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+// //判断是否存在治疗方案
|
|
|
|
+// 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
|
|
|
|
+// })
|
|
|
|
+// }
|
|
|
|
|
|
- dispatch(isAddMainSuit())
|
|
|
|
|
|
|
|
- }).catch((e) =>{
|
|
|
|
- console.log(e)
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
|
|
+// }).catch((e) =>{
|
|
|
|
+// console.log(e)
|
|
|
|
+// })
|
|
|
|
+// }
|
|
|
|
|
|
export const getTreatResult = (item) =>{
|
|
export const getTreatResult = (item) =>{
|
|
return (dispatch, getState) => {
|
|
return (dispatch, getState) => {
|
|
@@ -196,14 +196,23 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
|
|
json(url, params).then((data) =>{
|
|
json(url, params).then((data) =>{
|
|
if(data.data.code == '0') {
|
|
if(data.data.code == '0') {
|
|
// dispatch({type:MODI_LOADING,flag:false});
|
|
// dispatch({type:MODI_LOADING,flag:false});
|
|
- dispatch({type:SHOW_LOADING,flag:false});
|
|
|
|
- dispatch({type: SHOW_TREAT})
|
|
|
|
|
|
+ // dispatch({type:SHOW_LOADING,flag:false});
|
|
|
|
+
|
|
let treat;
|
|
let treat;
|
|
if(data.data.data) {
|
|
if(data.data.data) {
|
|
treat = data.data.data || {}
|
|
treat = data.data.data || {}
|
|
}
|
|
}
|
|
if(treat) {
|
|
if(treat) {
|
|
let { treatment, commonTreatment, surgeryTreatment, drugHistory, adverseReactions, followUp} = treat
|
|
let { treatment, commonTreatment, surgeryTreatment, drugHistory, adverseReactions, followUp} = treat
|
|
|
|
+ if(!(commonTreatment || surgeryTreatment ||
|
|
|
|
+ ( treatment &&treatment.length >0 ||
|
|
|
|
+ drugHistory&&drugHistory.length >0 ||
|
|
|
|
+ adverseReactions&&adverseReactions.length >0 ||
|
|
|
|
+ !!followUp ||treatment&&treatment.length >0))) {
|
|
|
|
+ Notify.info('提示信息未维护');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ dispatch({type: SHOW_TREAT})
|
|
dispatch({
|
|
dispatch({
|
|
type: SET_TREATMENT,
|
|
type: SET_TREATMENT,
|
|
treatment: treatment,
|
|
treatment: treatment,
|
|
@@ -270,7 +279,11 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
|
|
type: SET_ADVERSE_REACTIONS,
|
|
type: SET_ADVERSE_REACTIONS,
|
|
adversReactionList: adverseReactions
|
|
adversReactionList: adverseReactions
|
|
})
|
|
})
|
|
|
|
+ } else {
|
|
|
|
+ Notify.info('提示信息未维护');
|
|
}
|
|
}
|
|
|
|
+ }else {
|
|
|
|
+ Notify.info('提示信息未维护');
|
|
}
|
|
}
|
|
}).catch((e) =>{
|
|
}).catch((e) =>{
|
|
console.log(e)
|
|
console.log(e)
|