|
@@ -7,7 +7,7 @@ import {clearAssistData,addAssistLabel} from '@store/actions/assistCheck';
|
|
|
import {clearAllLabel,addLabel} from '@store/actions/inspect';
|
|
|
import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
|
|
|
import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS,BILLING_ADVICE,PUSHCHANGE} from '@store/types/pushMessage';
|
|
|
-import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
|
|
|
+import {ISREAD, SETREADDITEMS,SET_SELECTED_AREA} from "../store/types/homePage";
|
|
|
import {CLEAR_FIRST_MAIN_DIAG, CLEAR_ALL_TREAT} from "../store/types/treat";
|
|
|
import {tabChange} from '@store/actions/tabTemplate';
|
|
|
import {CLEAR_ASSESS_RESULT_VALUE} from '@types/assessResult';
|
|
@@ -16,6 +16,7 @@ import config from '@config/index';
|
|
|
import up from '@images/up.png';
|
|
|
import down from '@images/down.png';
|
|
|
import $ from 'jquery';
|
|
|
+import {CLEAR_SEARCH_PARAM} from "../store/types/print";
|
|
|
|
|
|
|
|
|
/***
|
|
@@ -166,7 +167,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{ //回读清
|
|
|
store.dispatch(clearAssistData([],'',[]));
|
|
|
store.dispatch(clearAllLabel([],[],''));
|
|
|
//右侧搜索条件清空
|
|
|
- $("#clearTemplateSearch,#clearMedicalInfoSearch,#medicalInfoFilter:first-child").click();
|
|
|
+ store.dispatch({
|
|
|
+ type: CLEAR_SEARCH_PARAM,
|
|
|
+ data: Math.random()
|
|
|
+ });
|
|
|
//tab跳回辅助信息
|
|
|
store.dispatch(tabChange('0'));
|
|
|
store.dispatch({
|
|
@@ -652,25 +656,72 @@ function handleEnter(event){
|
|
|
if(event.keyCode==13){return false;}
|
|
|
}
|
|
|
//获取病例输入的内容
|
|
|
+// function getEMRParams(){
|
|
|
+// const state = store.getState();
|
|
|
+// const {message} = state.patInfo;
|
|
|
+// const {mainSuit,currentIll,otherHistory,checkBody,inspect,assistCheck,diagnosticList} = state;
|
|
|
+// //console.log('message', message)
|
|
|
+// const main = filterDataArr(mainSuit.saveText)||'',
|
|
|
+// current=filterDataArr(currentIll.saveText)||'',
|
|
|
+// other = filterDataArr(otherHistory.saveText)||'',
|
|
|
+// vital = filterDataArr(checkBody.saveText)||'',
|
|
|
+// lis = inspect.pushItem, //化验推送所需数据
|
|
|
+// pacs = assistCheck.dataString||'',
|
|
|
+// dis=diagnosticList.diagnosticStrNoType||'',
|
|
|
+// advice = '',
|
|
|
+// diseaeId = [];
|
|
|
+// const age = message.patientAge;
|
|
|
+// const sex = message.sex;
|
|
|
+// const patientId = message.patientId //病人id,取上次用药
|
|
|
+// const hosCode = message.hospitalCode
|
|
|
+// return {main,current,other,vital,lis,pacs,dis,advice,diseaeId,sex,age, patientId, hosCode};
|
|
|
+// };
|
|
|
function getEMRParams(){
|
|
|
const state = store.getState();
|
|
|
const {message} = state.patInfo;
|
|
|
const {mainSuit,currentIll,otherHistory,checkBody,inspect,assistCheck,diagnosticList} = state;
|
|
|
//console.log('message', message)
|
|
|
- const main = filterDataArr(mainSuit.saveText)||'',
|
|
|
- current=filterDataArr(currentIll.saveText)||'',
|
|
|
- other = filterDataArr(otherHistory.saveText)||'',
|
|
|
- vital = filterDataArr(checkBody.saveText)||'',
|
|
|
- lis = inspect.pushItem, //化验推送所需数据
|
|
|
- pacs = assistCheck.dataString||'',
|
|
|
- dis=diagnosticList.diagnosticStrNoType||'',
|
|
|
- advice = '',
|
|
|
- diseaeId = [];
|
|
|
- const age = message.patientAge;
|
|
|
- const sex = message.sex;
|
|
|
- const patientId = message.patientId //病人id,取上次用药
|
|
|
- const hosCode = message.hospitalCode
|
|
|
- return {main,current,other,vital,lis,pacs,dis,advice,diseaeId,sex,age, patientId, hosCode};
|
|
|
+
|
|
|
+ const diag = []
|
|
|
+ for(let i = 0; i < diagnosticList.diagnosticList.length; i++) {
|
|
|
+ diag.push({"dateValue": "","name": "","uniqueName": diagnosticList.diagnosticList[i].name})
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ "hosCode": message.hospitalCode,
|
|
|
+ "ruleType": "string",
|
|
|
+ "age": message.patientAge,
|
|
|
+ "sex": message.sex,
|
|
|
+ "chief": filterDataArr(mainSuit.saveText)||'',
|
|
|
+ "symptom": filterDataArr(currentIll.saveText)||'',
|
|
|
+ "vital": filterDataArr(checkBody.saveText)||'',
|
|
|
+ "pasts": filterDataArr(otherHistory.saveText)||'',
|
|
|
+ "infectious": "",
|
|
|
+ "operation": "",
|
|
|
+ "allergy": "",
|
|
|
+ "vaccination": "",
|
|
|
+ "personal": "",
|
|
|
+ "marital": "",
|
|
|
+ "family": "",
|
|
|
+ "menstrual": "",
|
|
|
+ "other": filterDataArr(otherHistory.saveText)||'',
|
|
|
+ "lisString": "",
|
|
|
+ "pacsString": "",
|
|
|
+ "diagString": "",
|
|
|
+ "drugString": "",
|
|
|
+ "lis": inspect.pushItem,
|
|
|
+ "pacs": assistCheck.dataArr||'',
|
|
|
+ "diag": diag,
|
|
|
+ "lisOrder": [],
|
|
|
+ "pacsOrder": [],
|
|
|
+ "diagOrder": [],
|
|
|
+ "drugOrder": [],
|
|
|
+ "operationOrder": [],
|
|
|
+ "otherOrder": [],
|
|
|
+ "patientId": message.patientId,
|
|
|
+ "drug": [],
|
|
|
+ "marriage": ""
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
};
|
|
|
|
|
|
function didPushParamChange(){
|
|
@@ -1219,10 +1270,12 @@ function getStringPlus(dataList){
|
|
|
let strPlus = '';
|
|
|
dataList && dataList.map((item)=>{
|
|
|
if(item.detailName){
|
|
|
- let strTmp = item.name + ',' + item.detailName + ',' + (item.otherValue ? item.otherValue : (item.value + item.units)) +';'
|
|
|
+ let strTmp = item.name + ','+ item.detailName + ',' + (item.otherValue ? item.otherValue : (item.value + item.units)) +';'
|
|
|
+ // let strTmp = item.name + ','+(item.inpValue?(item.inpValue+','):'') + item.detailName + ',' + (item.otherValue ? item.otherValue : (item.value + item.units)) +';'
|
|
|
strPlus += strTmp;
|
|
|
}else{
|
|
|
- let strTmp = item.name+';'
|
|
|
+ // let strTmp = item.name+ (item.inpValue?(','+item.inpValue):';')
|
|
|
+ let strTmp = item.name+ ';'
|
|
|
strPlus += strTmp;
|
|
|
}
|
|
|
})
|
|
@@ -1248,7 +1301,7 @@ function getPushList(data1,data2){ //推送数据
|
|
|
tmpObj.source = '1';//数据来源
|
|
|
tmpObj.maxValue = part.max || '';
|
|
|
tmpObj.minValue = part.min || '';
|
|
|
- tmpObj.time = part.time ||now;
|
|
|
+ tmpObj.dateValue = part.time ||now;
|
|
|
tmpObj.units = part.unit || '';//单位
|
|
|
tmpObj.value = (part.value-0) === (part.value-0) ? part.value:'';//值
|
|
|
tmpObj.otherValue = (part.value-0) === (part.value-0) ?'':part.value; //阴性阳性
|
|
@@ -1266,7 +1319,7 @@ function getPushList(data1,data2){ //推送数据
|
|
|
tmpObj.source = '0'; //数据来源
|
|
|
tmpObj.maxValue = val.maxValue ? val.maxValue : '';
|
|
|
tmpObj.minValue = val.minValue ? val.minValue : '';
|
|
|
- tmpObj.time = val.time || now;
|
|
|
+ tmpObj.dateValue = val.time || now;
|
|
|
tmpObj.units = val.labelSuffix || '';
|
|
|
tmpObj.value = (val.value-0) === (val.value-0) ? val.value:'';
|
|
|
tmpObj.otherValue = (val.value-0) === (val.value-0) ?'':val.value;
|
|
@@ -1304,6 +1357,7 @@ function getPushLists(data1,data2){ //推送数据
|
|
|
if(val.value != undefined && val.value != ''){
|
|
|
let tmpObj = {};
|
|
|
tmpObj.name = item.name || '';
|
|
|
+ tmpObj.inpValue = item.inpValue || '';//套餐名
|
|
|
tmpObj.detailName = val.name || '';
|
|
|
tmpObj.uniqueName = val.uniqueName || '';//公表名称
|
|
|
tmpObj.source = '0'; //数据来源
|
|
@@ -1318,6 +1372,7 @@ function getPushLists(data1,data2){ //推送数据
|
|
|
}else{
|
|
|
let tmpObj = {};
|
|
|
tmpObj.name = item.name;
|
|
|
+ tmpObj.inpValue = item.inpValue;
|
|
|
tmpArr2.push(tmpObj);
|
|
|
}
|
|
|
})
|
|
@@ -1325,8 +1380,8 @@ function getPushLists(data1,data2){ //推送数据
|
|
|
return totalTmpArr;
|
|
|
}
|
|
|
|
|
|
-function getAllString(checkedListImport,assistLabel){
|
|
|
- let tmpImportLis = [],tmpString='';
|
|
|
+function getAllString(checkedListImport,assistLabel,flg){
|
|
|
+ let tmpImportLis = [],tmpString='',tmpArr=[];
|
|
|
for(let i = 0;i < checkedListImport.length;i++){
|
|
|
for(let j = 0;j < checkedListImport[i].length;j++){
|
|
|
tmpImportLis.push(checkedListImport[i][j])
|
|
@@ -1335,9 +1390,21 @@ function getAllString(checkedListImport,assistLabel){
|
|
|
let tempArr = tmpImportLis.concat(assistLabel)
|
|
|
for (let i = 0; i < tempArr.length; i++) {
|
|
|
let tmpVal = tempArr[i].value ? tempArr[i].value.trim() : tempArr[i].value;
|
|
|
+ let obj = {
|
|
|
+ "dateValue": tempArr[i].time,
|
|
|
+ "name": "",
|
|
|
+ "uniqueName": tempArr[i].name,
|
|
|
+ "desc": tempArr[i].imagingDiagnose,
|
|
|
+ "result": tempArr[i].imagingDiagnose,
|
|
|
+ }
|
|
|
+ tmpArr.push(obj)
|
|
|
tmpString += (tempArr[i].name + (tmpVal ? (':' + tmpVal) + ', ' : ': ') + (tempArr[i].time ? '报告日期:' + tempArr[i].time : '') + '^;')
|
|
|
}
|
|
|
- return tmpString;
|
|
|
+ if(flg){
|
|
|
+ return tmpArr;
|
|
|
+ }else{
|
|
|
+ return tmpString;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 模板中处理tagType==4的数据
|
|
@@ -1443,7 +1510,7 @@ const setFontColorSize = (flg,pacs) => {
|
|
|
}else if(pacs == 6){
|
|
|
classStr = `largeFontSize selectColor`
|
|
|
}else if(pacs == 7){
|
|
|
- classStr = `largeFontSize fontWeight`
|
|
|
+ classStr = `largeFontSize fontWeight selectColor`
|
|
|
}else{
|
|
|
classStr = `largeFontSize`
|
|
|
}
|
|
@@ -1457,7 +1524,7 @@ const setFontColorSize = (flg,pacs) => {
|
|
|
if(pacs == 6){
|
|
|
classStr = `simpleFontSize selectColor`
|
|
|
}else if(pacs == 7){
|
|
|
- classStr = `simpleFontSize fontWeight`
|
|
|
+ classStr = `simpleFontSize fontWeight selectColor`
|
|
|
}else{
|
|
|
classStr = `simpleFontSize`
|
|
|
}
|
|
@@ -1490,7 +1557,11 @@ const setFontColorSize = (flg,pacs) => {
|
|
|
}
|
|
|
}else{//都是标准的
|
|
|
if(flg == 2){
|
|
|
- classStr = `simpleFontSize`
|
|
|
+ if(pacs == 7){
|
|
|
+ classStr = `simpleFontSize fontWeight`
|
|
|
+ }else{
|
|
|
+ classStr = `simpleFontSize`
|
|
|
+ }
|
|
|
}else if(pacs == 7){
|
|
|
classStr = `simpleFontSize fontWeight`
|
|
|
}else if(flg == 1){
|
|
@@ -1503,25 +1574,43 @@ const setFontColorSize = (flg,pacs) => {
|
|
|
// }, 0);
|
|
|
}
|
|
|
|
|
|
-//获取查体体征和已选中的标签
|
|
|
+//获取生命体征或非生命体征标签
|
|
|
+function getLifeLabels(arr,flag){ //flag=true获取非生命体征
|
|
|
+ const newArr = arr.filter((it)=>{
|
|
|
+ return flag?+it.specFlag!==4:+it.specFlag===4;
|
|
|
+ });
|
|
|
+ return newArr;
|
|
|
+}
|
|
|
+
|
|
|
+//获取已选中的标签
|
|
|
function getValuedLabels(arr){
|
|
|
const newArr = arr.filter((it)=>{
|
|
|
if(it.tagType=='3'){ //血压类型
|
|
|
- if(it.questionMapping.findIndex((i)=>i.value!==undefined)!==-1||+it.specFlag===4){
|
|
|
+ if(+it.specFlag!==4&&it.questionMapping.findIndex((i)=>i.value!==undefined)!==-1){
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
- return it.value||+it.specFlag===4;
|
|
|
+ return +it.specFlag!==4&&it.value;
|
|
|
});
|
|
|
return newArr;
|
|
|
}
|
|
|
|
|
|
//对象数组去重
|
|
|
function removeRepeat(arr1,arr2){ //arr1被完全保留的数组
|
|
|
- const arr = arr2.reduce(function(newArr,item){
|
|
|
+ const arr = arr2.reduce(function(newArr,item,inx){
|
|
|
const it = newArr.findIndex((i)=>i.id===item.id);
|
|
|
- if(it===-1){
|
|
|
+ const firstInx = arr2.findIndex((i)=>i.id===item.id);
|
|
|
+ //旧体征标签比新体征标签多出的标签,已填值的保留,未填值的舍弃
|
|
|
+ if(it!==-1){
|
|
|
+ //多个相同标签,保留已填值的
|
|
|
+ if(firstInx!==inx&&(item.value!==undefined||(item.tagType=='3'&&item.questionMapping.findIndex((i)=>i.value!==undefined)!==-1))){ //重复的已填值标签
|
|
|
+ newArr.splice(inx-firstInx+it,0,item);
|
|
|
+ }
|
|
|
+ if(firstInx===inx){
|
|
|
+ newArr.splice(it,1,item);
|
|
|
+ }
|
|
|
+ }else if(item.value!==undefined||(it.tagType=='3'&&it.questionMapping.findIndex((i)=>i.value!==undefined)!==-1)){
|
|
|
newArr.push(item);
|
|
|
}
|
|
|
return newArr;
|
|
@@ -1529,6 +1618,37 @@ function removeRepeat(arr1,arr2){ //arr1被完全保留的数组
|
|
|
return arr;
|
|
|
}
|
|
|
|
|
|
+function handleMouseUp(param){
|
|
|
+ const {select_start,i,boxMark}= param;
|
|
|
+ if(select_start!==undefined){
|
|
|
+ store.dispatch({
|
|
|
+ type:SET_SELECTED_AREA,
|
|
|
+ data:{i,boxMark,dir:'end'}
|
|
|
+ });
|
|
|
+ window.getSelection().empty();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//判断不同科室内容是否相同
|
|
|
+function checkDeptContent(jsonStr,tmpLis){
|
|
|
+ for(let i = 0;i <tmpLis.length;i++){
|
|
|
+ let dataStr = tmpLis[i].preview;
|
|
|
+ if(
|
|
|
+ filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) &&
|
|
|
+ filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) &&
|
|
|
+ filterDataArr(JSON.parse(jsonStr.other)) == filterDataArr(eval('('+JSON.parse(dataStr).other+')')) &&
|
|
|
+ filterDataArr(JSON.parse(jsonStr.vital)) == filterDataArr(eval('('+JSON.parse(dataStr).vital+')')) &&
|
|
|
+ jsonStr.lis == JSON.parse(dataStr).lis &&
|
|
|
+ jsonStr.pacs == JSON.parse(dataStr).pacs &&
|
|
|
+ jsonStr.diag == JSON.parse(dataStr).diag &&
|
|
|
+ jsonStr.advice == JSON.parse(dataStr).advice
|
|
|
+ ){
|
|
|
+ // Notify.info('该模板已保存');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
module.exports = {
|
|
|
getIds,
|
|
|
getWindowInnerWidth,
|
|
@@ -1582,6 +1702,9 @@ module.exports = {
|
|
|
setFontColorSize,
|
|
|
moveEnd,
|
|
|
setFontColorSize,
|
|
|
+ getLifeLabels,
|
|
|
getValuedLabels,
|
|
|
- removeRepeat
|
|
|
+ removeRepeat,
|
|
|
+ handleMouseUp,
|
|
|
+ checkDeptContent
|
|
|
};
|