|
@@ -19,7 +19,6 @@ export const addDiagnostic = (item) => {
|
|
|
const state = getState();
|
|
|
let url = api.pushTreatment;
|
|
|
const emrData = getEMRParams();
|
|
|
- console.log('emrData', emrData)
|
|
|
const diagnosticList = state.diagnosticList.diagnosticList;
|
|
|
let diag = '';
|
|
|
if(diagnosticList) {
|
|
@@ -62,7 +61,7 @@ export const addDiagnostic = (item) => {
|
|
|
getChronic().then(() =>{
|
|
|
chronicList = JSON.parse(storageLocal.get('chronic'));
|
|
|
for(let i=0; i<chronicList.length; i++){
|
|
|
- if(chronicList[i].id==item.id&&chronicList[i].name==item.name){ //判断某个病是否为慢病
|
|
|
+ if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){ //判断某个病是否为慢病
|
|
|
params.disType = 1
|
|
|
}
|
|
|
}
|
|
@@ -71,7 +70,7 @@ export const addDiagnostic = (item) => {
|
|
|
});
|
|
|
} else {
|
|
|
for(let i=0; i<chronicList.length; i++){
|
|
|
- if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
|
|
|
+ if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
|
|
|
params.disType = 1
|
|
|
}
|
|
|
}
|
|
@@ -170,7 +169,7 @@ export const getTreatResult = (item) =>{
|
|
|
getChronic().then(() =>{
|
|
|
chronicList = JSON.parse(storageLocal.get('chronic'));
|
|
|
for(let i=0; i<chronicList.length; i++){
|
|
|
- if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
|
|
|
+ if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
|
|
|
params.disType = 1
|
|
|
}
|
|
|
}
|
|
@@ -179,7 +178,7 @@ export const getTreatResult = (item) =>{
|
|
|
});
|
|
|
} else {
|
|
|
for(let i=0; i<chronicList.length; i++){
|
|
|
- if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
|
|
|
+ if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
|
|
|
params.disType = 1
|
|
|
}
|
|
|
}
|
|
@@ -217,10 +216,10 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
|
|
|
const allAdversReactionList = state.treat.allAdversReactionList
|
|
|
if(allAdversReactionList) {
|
|
|
for(let i = 0; i < allAdversReactionList.length; i++) {
|
|
|
- if(item.id == allAdversReactionList[i].id) { //判断是否存过不良反应
|
|
|
+ if(item.conceptId == allAdversReactionList[i].conceptId) { //判断是否存过不良反应
|
|
|
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) {
|
|
|
+ if(adverseReactions[j].conceptId == allAdversReactionList[i].adversReactionList[z].conceptId) {
|
|
|
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) {
|
|
@@ -241,7 +240,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
|
|
|
if(isChronic) {
|
|
|
let chronicList = JSON.parse(storageLocal.get('chronic'));
|
|
|
for(let i=0; i<chronicList.length; i++){
|
|
|
- if(chronicList[i].id==item.id&&chronicList[i].name==item.name){ //判断某个病是否为慢病
|
|
|
+ if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){ //判断某个病是否为慢病
|
|
|
followUp = '2周';
|
|
|
}
|
|
|
}
|
|
@@ -251,7 +250,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
|
|
|
const followUpList = state.treat.followUpList
|
|
|
if(followUpList) { //判断之前有没有保存过的回访时间,如果有替换掉
|
|
|
for(let i = 0; i < followUpList.length; i++) {
|
|
|
- if(item.id == followUpList[i].id) {
|
|
|
+ if(item.conceptId == followUpList[i].conceptId) {
|
|
|
followUp = followUpList[i].followUp
|
|
|
}
|
|
|
}
|
|
@@ -287,7 +286,7 @@ export const saveAllAdverseReactions = (item) => {
|
|
|
dispatch({
|
|
|
type: SET_ALL_ADVERSE_REACTIONS,
|
|
|
adversReactionList: {
|
|
|
- 'id': item.id,
|
|
|
+ 'conceptId': item.conceptId,
|
|
|
'adversReactionList': adversReactionList
|
|
|
}
|
|
|
})
|
|
@@ -303,7 +302,7 @@ export const setAllFollowUp = (item) => {
|
|
|
dispatch({
|
|
|
type: SET_ALL_FOLLOW_UP,
|
|
|
followUp: {
|
|
|
- 'id': item.id,
|
|
|
+ 'conceptId': item.conceptId,
|
|
|
'followUp': followUp
|
|
|
}
|
|
|
})
|
|
@@ -313,27 +312,26 @@ export const setAllFollowUp = (item) => {
|
|
|
export const getInstroduce = (item, type, position)=>{
|
|
|
|
|
|
return (dispatch, getState) =>{
|
|
|
- const url = '/conceptDetail/getConceptDetail';
|
|
|
const params = {
|
|
|
name: item.name,
|
|
|
type: item.type,
|
|
|
position: item.position
|
|
|
}
|
|
|
- json(url, params)
|
|
|
+ json(api.getConceptDetail, params)
|
|
|
.then((data)=>{
|
|
|
- if(data.data.data) {
|
|
|
+ if(data.data.code == '0') {
|
|
|
dispatch({
|
|
|
type: SET_DRUG_INFO,
|
|
|
instroduce: data.data.data.introduceDetailList,
|
|
|
- name: type ==8 ?item.medicitionName : type == 10 ? item.tagName : '',
|
|
|
- tagType: type
|
|
|
+ name: item.name,
|
|
|
+ tagType: item.type
|
|
|
})
|
|
|
} else {
|
|
|
dispatch({
|
|
|
type: SET_DRUG_INFO,
|
|
|
instroduce: [],
|
|
|
- name: type ==8 ?item.medicitionName : type == 10 ? item.tagName : '',
|
|
|
- tagType: type
|
|
|
+ name: item.name,
|
|
|
+ tagType: item.type
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -345,51 +343,51 @@ export const getInstroduce = (item, type, position)=>{
|
|
|
|
|
|
}
|
|
|
|
|
|
-export const getInstroduceMore = (drugIdList) =>{
|
|
|
- return (dispatch, getState) =>{
|
|
|
- let drugInfoList = [];
|
|
|
- for (let i = 0; i < drugIdList.drugIdList.length; i++ ) {
|
|
|
- const url = '/conceptDetail/getConceptDetail';
|
|
|
- const params = {
|
|
|
- questionId: drugIdList.drugIdList[i],
|
|
|
- type: 8,
|
|
|
- position: 5
|
|
|
- }
|
|
|
- json(url, params)
|
|
|
- .then((data)=>{
|
|
|
- if(data.data.data) {
|
|
|
- drugInfoList.push(data.data.data)
|
|
|
- dispatch({
|
|
|
- type: SET_DRUG_INFO_LIST,
|
|
|
- drugInfoList: drugInfoList,
|
|
|
- })
|
|
|
- } else {
|
|
|
- drugInfoList.push([])
|
|
|
- dispatch({
|
|
|
- type: SET_DRUG_INFO_LIST,
|
|
|
- drugInfoList: drugInfoList,
|
|
|
- })
|
|
|
- }
|
|
|
+// export const getInstroduceMore = (drugIdList) =>{
|
|
|
+// return (dispatch, getState) =>{
|
|
|
+// let drugInfoList = [];
|
|
|
+// for (let i = 0; i < drugIdList.drugIdList.length; i++ ) {
|
|
|
+// const url = '/conceptDetail/getConceptDetail';
|
|
|
+// const params = {
|
|
|
+// questionId: drugIdList.drugIdList[i],
|
|
|
+// type: 8,
|
|
|
+// position: 5
|
|
|
+// }
|
|
|
+// json(url, params)
|
|
|
+// .then((data)=>{
|
|
|
+// if(data.data.data) {
|
|
|
+// drugInfoList.push(data.data.data)
|
|
|
+// dispatch({
|
|
|
+// type: SET_DRUG_INFO_LIST,
|
|
|
+// drugInfoList: drugInfoList,
|
|
|
+// })
|
|
|
+// } else {
|
|
|
+// drugInfoList.push([])
|
|
|
+// dispatch({
|
|
|
+// type: SET_DRUG_INFO_LIST,
|
|
|
+// drugInfoList: drugInfoList,
|
|
|
+// })
|
|
|
+// }
|
|
|
|
|
|
- }).catch((e) => {
|
|
|
- console.log(e)
|
|
|
- })
|
|
|
+// }).catch((e) => {
|
|
|
+// console.log(e)
|
|
|
+// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
+// }
|
|
|
|
|
|
|
|
|
- }
|
|
|
-}
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
//一般治疗添加到医嘱
|
|
|
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) {
|
|
|
+ if(state.treat.treatItem.conceptId === state.diagnosticList.diagnosticList[0].conceptId && state.treat.isFirstMainDiag) {
|
|
|
dispatch({
|
|
|
type: IS_FIRST_MAIN_DIAG
|
|
|
})
|