|
@@ -2,7 +2,7 @@ import { json } from "@utils/ajax";
|
|
|
import { SET_TREAT } from '@store/types/diagnosticList';
|
|
|
import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR} from '@store/types/diagnosticList';
|
|
|
import { SET_COMMONTREATMENT } from '@store/types/pushMessage'
|
|
|
-import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST, IS_FIRST_MAIN_DIAG, SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS } from '@store/types/treat';
|
|
|
+import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST, IS_FIRST_MAIN_DIAG, SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS, SET_FOLLOW_UP, DEL_FOLLOW_UP, SET_ALL_FOLLOW_UP } from '@store/types/treat';
|
|
|
import {storageLocal,getEMRParams} from '@utils/tools';
|
|
|
import { isAddMainSuit } from '@store/async-actions/diagnosticList';
|
|
|
|
|
@@ -80,6 +80,7 @@ export const addDiagnostic = (item) => {
|
|
|
|
|
|
}
|
|
|
|
|
|
+//判断是否存在治疗方案
|
|
|
function hasTreatment(dispatch, state,item,url, params) {
|
|
|
json(url, params).then((data) =>{
|
|
|
if (data.data.data) {
|
|
@@ -185,6 +186,7 @@ export const getTreatResult = (item) =>{
|
|
|
|
|
|
}
|
|
|
|
|
|
+//获取治疗方案
|
|
|
function getTreatment(item, dispatch, state,url,params) {
|
|
|
json(url, params).then((data) =>{
|
|
|
let treat;
|
|
@@ -192,12 +194,12 @@ function getTreatment(item, dispatch, state,url,params) {
|
|
|
treat = data.data.data.treat || {}
|
|
|
}
|
|
|
if(treat) {
|
|
|
- let adverseReactions = treat.adverseReactions
|
|
|
+ let { treatment, commonTreatment, surgeryTreatment, adverseReactions, followUp} = treat
|
|
|
dispatch({
|
|
|
type: SET_TREATMENT,
|
|
|
- treatment: treat.treatment,
|
|
|
- generalTreat: treat.commonTreatment,
|
|
|
- surgeryTreat: treat.surgeryTreatment,
|
|
|
+ treatment: treatment,
|
|
|
+ generalTreat: commonTreatment,
|
|
|
+ surgeryTreat: surgeryTreatment,
|
|
|
})
|
|
|
if (adverseReactions) { //如何之前存过不良反应,则替换成之前的不良反应
|
|
|
const allAdversReactionList = state.treat.allAdversReactionList
|
|
@@ -207,7 +209,6 @@ function getTreatment(item, dispatch, state,url,params) {
|
|
|
for (let j = 0; j < adverseReactions.length; j++) { //判断不良反应是否有相同的不良反应,如果有,替换
|
|
|
for(let z = 0; z < allAdversReactionList[i].adversReactionList.length; z++) {
|
|
|
if(adverseReactions[j].id == allAdversReactionList[i].adversReactionList[z].id) {
|
|
|
-
|
|
|
adverseReactions[j] = allAdversReactionList[i].adversReactionList[z]
|
|
|
}
|
|
|
}
|
|
@@ -219,10 +220,33 @@ function getTreatment(item, dispatch, state,url,params) {
|
|
|
} else {
|
|
|
adverseReactions = []
|
|
|
}
|
|
|
+ followUp = '2周';
|
|
|
+ if(followUp) {
|
|
|
+ const followUpList = state.treat.followUpList
|
|
|
+ if(followUpList) { //判断之前有没有报存过的回访时间,如果有替换掉
|
|
|
+ for(let i = 0; i < followUpList.length; i++) {
|
|
|
+ if(item.id == followUpList[i].id) {
|
|
|
+ followUp = followUpList[i].followUp
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dispatch({
|
|
|
+ type: SET_FOLLOW_UP,
|
|
|
+ // followUp: treat.followUp,
|
|
|
+ followUp: followUp,
|
|
|
+ hasFollowUp: true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ dispatch({
|
|
|
+ type: DEL_FOLLOW_UP,
|
|
|
+ delItem: item,
|
|
|
+ })
|
|
|
+ }
|
|
|
dispatch({
|
|
|
type: SET_ADVERSE_REACTIONS,
|
|
|
adversReactionList: adverseReactions
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}).catch((e) =>{
|
|
@@ -230,6 +254,7 @@ function getTreatment(item, dispatch, state,url,params) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+//保存全部不良反应
|
|
|
export const saveAllAdverseReactions = (item) => {
|
|
|
return (dispatch, getState) => {
|
|
|
const state = getState()
|
|
@@ -244,6 +269,22 @@ export const saveAllAdverseReactions = (item) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+//保存全部诊断的回访时间
|
|
|
+export const setAllFollowUp = (item) => {
|
|
|
+ return (dispatch, getState) => {
|
|
|
+ const state = getState()
|
|
|
+ const followUp = state.treat.followUp
|
|
|
+ dispatch({
|
|
|
+ type: SET_ALL_FOLLOW_UP,
|
|
|
+ followUp: {
|
|
|
+ 'id': item.id,
|
|
|
+ 'followUp': followUp
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
export const getInstroduce = (item)=>{
|
|
|
|
|
|
return (dispatch, getState) =>{
|
|
@@ -320,6 +361,7 @@ export const getInstroduceMore = (drugIdList) =>{
|
|
|
export const commonTreatAddToAdvice = () => {
|
|
|
return (dispatch, getState) => {
|
|
|
const state = getState();
|
|
|
+ const followUp = state.treat.followUp
|
|
|
if(state.treat.treatItem.id === state.diagnosticList.diagnosticList[0].id && state.treat.isFirstMainDiag) {
|
|
|
dispatch({
|
|
|
type: IS_FIRST_MAIN_DIAG
|