|
@@ -3,9 +3,10 @@ import {SET} from '@types/checkBody.js';
|
|
|
import {fullfillText,_fullfillText} from '@common/js/func';
|
|
|
import {SETDATA} from '@store/types/otherHistory';
|
|
|
import store from '@store';
|
|
|
-import {getEMRParams} from '@utils/tools.js';
|
|
|
+import {getEMRParams,didPushParamChange} from '@utils/tools.js';
|
|
|
import {Notify} from '@commonComp';
|
|
|
-import {SETOTHERHISTORY} from "../types/homePage";
|
|
|
+import {billing} from '@store/async-actions/pushMessage';
|
|
|
+import {SETOTHERHISTORY,ISREAD} from "../types/homePage";
|
|
|
import config from "@config/index";
|
|
|
|
|
|
const api={
|
|
@@ -169,6 +170,43 @@ export function getInitData(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//其他史模板填充-先取最近记录,无则用模板
|
|
|
+export function setOtherHisModule(){
|
|
|
+ return (dispatch, getStore) => {
|
|
|
+ const state = getStore();
|
|
|
+ const initData = state.homePage.initData;
|
|
|
+ const mode = state.typeConfig.typeConfig;
|
|
|
+ const model = JSON.parse(JSON.stringify(initData.otherHisModel)); //查体模板
|
|
|
+ const arr = JSON.parse(JSON.stringify(initData.otherHis || null)); //最近其他史数据
|
|
|
+ const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave || null)); //最近其他史saveText
|
|
|
+ const selects = JSON.parse(JSON.stringify(initData.otherSelecteds || null)); //其他史杂音类选中项
|
|
|
+ const isHis = initData.otherIsHis; //是否是历史数据
|
|
|
+ const onlyOneText = arr && arr.length == 1 && arr[0].tagType == 8 && !(arr[0].name || arr[0].value); //是否只有一个自由文本标签
|
|
|
+ const listObj = isHis && (mode == 1 || (!onlyOneText && mode == 0)) ? {
|
|
|
+ newArr: arr,
|
|
|
+ saveText: arrSave || []
|
|
|
+ } : fullfillText(model);
|
|
|
+ dispatch({
|
|
|
+ type: SETDATA,
|
|
|
+ data: listObj.newArr,
|
|
|
+ selecteds: selects,
|
|
|
+ period: initData.period,
|
|
|
+ save: listObj.saveText,
|
|
|
+ isEmpty: false
|
|
|
+ });
|
|
|
+ dispatch({
|
|
|
+ type: ISREAD
|
|
|
+ });
|
|
|
+
|
|
|
+ //右侧推送
|
|
|
+ setTimeout(function () { //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
|
|
|
+ if (didPushParamChange()) { //操作后内容有变化才推送
|
|
|
+ dispatch(billing());
|
|
|
+ }
|
|
|
+ }, 500);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//保存切换模式
|
|
|
export function saveMode(mode){
|
|
|
return (dispatch,getStore)=>{
|