瀏覽代碼

一般治疗添加到医嘱(未完成)

zhangxc 6 年之前
父節點
當前提交
bd59ead0c2

+ 11 - 19
src/components/Advice/index.jsx

@@ -38,21 +38,7 @@ class Advice extends Component{
     const {advice} = this.props.pushMessage;
     let billing = ''
 
-    // advice.assay.forEach((item, index) => {
-    //   if(index === advice.assay.length - 1){
-    //     billing = billing + (index + 1) + ':' + item + ';'
-    //   }else{
-    //     billing = billing + (index + 1) + ':' + item + ','
-    //   }
-    // })
-
-    // advice.check.forEach((item, index) => {
-    //   if(index === advice.check.length - 1){
-    //     billing = billing + (index + 1) + ':' + item + ';'
-    //   }else{
-    //     billing = billing + (index + 1) + ':' + item + ','
-    //   }
-    // })
+    
 
     let scheme = advice.scheme && advice.scheme.map((item, index) => {
       return <p>{item.treatment.map((it,ii) =>{
@@ -70,15 +56,21 @@ class Advice extends Component{
 
     return  <div className={`${'mainsuit-box'} ${style['main-suit']}`}>
       <ItemBox title='医嘱' editable={false} border={true} marginTop="10px">
-        <div className={style['billing']}>
+        {/* <div className={style['billing']}>
           {advice.assay && advice.assay.length > 0 || advice.check && advice.check.length > 0 ? <h1>开单项目</h1> : ''}
             {advice.assay && <span className={style['treat-input']}> {advice.assay}</span>}
             {advice.check && <span className={style['treat-input']}> {advice.check}</span>}
-          {/* {billing} */}
-        </div>
-        <div className={style['scheme']}>
+        </div> */}
+        {advice.commontreatment && advice.commontreatment.length > 0 &&<div className={style['billing']} contentEditable={true} style = {{outline: 'none'}}>
+          {advice.commontreatment && advice.commontreatment.length > 0 && <h1>一般治疗</h1>}
+            {advice.commontreatment && <span  className={style['treat-input']}  >{advice.commontreatment} </span>}
+        </div>}
+        {advice.scheme && advice.scheme.length > 0 &&<div contentEditable='false' className={style['scheme']}>
           {advice.scheme && advice.scheme.length > 0  && <h1>治疗方案</h1>}
           {scheme}
+        </div>}
+        <div contentEditable={true} style = {{outline: 'none'}}>
+          
         </div>
       </ItemBox>
     </div>

+ 3 - 2
src/components/DiagnosticList/index.jsx

@@ -62,7 +62,8 @@ class DiagnosticList extends Component {
             delItem: item,
         })
     }
-    showTreat(item) {
+    showTreat(item, index) {
+        item.treatIndex = index
         const  { showTreat, getTreatResult } = this.props;
         getTreatResult && getTreatResult(item);
         showTreat && showTreat();
@@ -92,7 +93,7 @@ class DiagnosticList extends Component {
                                     {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
                                     <span className={style['treat']}
                                           style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'1px solid #3B9ED0' : '1px solid gray'}}
-                                          onClick={() =>{hasTreat && this.showTreat(item)}}>
+                                          onClick={() =>{hasTreat && this.showTreat(item, index)}}>
                                           治疗方案
                                     </span>
                                     <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item)}}/>

+ 2 - 2
src/components/Treat/GeneralTreat/index.jsx

@@ -9,10 +9,10 @@ class GeneralTreat extends Component {
     render() {
         const { icon, titleStyle,titleBg, filter, title, generalTreat } = this.props
         return(
-            generalTreat && generalTreat.length > 0 && <div className={style['general-wrapper']}>
+            generalTreat.content && generalTreat.content.length > 0 && <div className={style['general-wrapper']}>
                 <div className={style['general-title-box']} style={titleStyle}></div>
                 <div className={style['general-title']} ><img className={style['general-icon']} src={icon}/>{title}</div>
-                <div className={style['general-item']} dangerouslySetInnerHTML={{__html: generalTreat}}>
+                <div className={style['general-item']} dangerouslySetInnerHTML={{__html: generalTreat.content}}>
                 </div>
 
             </div>

+ 2 - 1
src/containers/Treat.js

@@ -2,7 +2,7 @@ import React from 'react';
 import { connect } from 'react-redux';
 import Treat from '@components/Treat';
 import { SELECT_DRUG, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO } from '@store/types/treat.js';
-import { getInstroduce, getRecommendBasic, getInstroduceMore } from '@store/async-actions/treat';
+import { getInstroduce, getRecommendBasic, getInstroduceMore, commonTreatAddToAdvice } from '@store/async-actions/treat';
 import { ADD_SCHEME } from '@store/types/pushMessage.js'
 import { showDrugInfo } from '../store/actions/treat';
 
@@ -71,6 +71,7 @@ function mapDispatchToProps(dispatch) {
                 title: title,
                 treatment: treatment
             })
+            dispatch(commonTreatAddToAdvice())
         },
         //查询多条药品说明数据(添加数据用)
         setDrugInfoMore:(drugIdList) => {

+ 7 - 0
src/store/actions/pushMessage.js

@@ -229,4 +229,11 @@ export const hideTipsDetails = (state, action) => {
 	const res = Object.assign({}, state);
 	res.showTipsDetails = false;
 	return res;
+}
+
+//一般治疗添加到医嘱
+export const setCommontreatment = (state, action) => {
+	const res = JSON.parse(JSON.stringify(state));
+	res.advice.commontreatment = action.commontreatment;
+	return res;
 }

+ 6 - 0
src/store/actions/treat.js

@@ -99,3 +99,9 @@ export const setDrugInfoList = (state, action) => {
     return res
 }
 
+//是否第一次主诊断
+export const isFirstMainDiag = (state, action) => {
+    const res = Object.assign({}, state);
+    res.isFirstMainDiag = false;
+    return res;
+}

+ 20 - 1
src/store/async-actions/treat.js

@@ -1,7 +1,8 @@
 import { json } from "@utils/ajax";
 import { SET_TREAT } from '@store/types/diagnosticList';
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR} from '@store/types/diagnosticList';
-import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST } from '@store/types/treat';
+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 } from '@store/types/treat';
 import {storageLocal,getEMRParams} from '@utils/tools';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 
@@ -288,6 +289,24 @@ export const  getInstroduceMore = (drugIdList) =>{
     }
 }
 
+//一般治疗添加到医嘱
+export const commonTreatAddToAdvice = () => {
+    return (dispatch, getState) => {
+        const state = getState();
+        if(state.treat.treatItem.treatIndex === 0 && state.treat.isFirstMainDiag) {
+            dispatch({
+                type: IS_FIRST_MAIN_DIAG
+            })
+            dispatch({
+                type: SET_COMMONTREATMENT,
+                commontreatment: state.treat.treatItem.treat.commonTreatment.text
+            })
+        } else {
+            return
+        }
+    }
+}
+
 //其他推荐推荐依据不用展示
 // export const getRecommendBasic = (item)=>{
     

+ 6 - 2
src/store/reducers/pushMessage.js

@@ -1,5 +1,5 @@
-import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS } from '../types/pushMessage';
-import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails } from '../actions/pushMessage';
+import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT, IS_FIRST_MAIN_DIAG } from '../types/pushMessage';
+import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails, setCommontreatment, isFirstMainDiag } from '../actions/pushMessage';
 
 const initState = {
   vigilant: [],
@@ -46,6 +46,10 @@ export default function(state = initState, action) {
       return showTipsDetails(state, action);
     case HIDE_TIPS_DETAILS:
       return hideTipsDetails(state, action);
+    case SET_COMMONTREATMENT:
+      return setCommontreatment(state, action);
+    case IS_FIRST_MAIN_DIAG:
+      return isFirstMainDiag(state, action);
     default:
       return state;
   }

+ 6 - 3
src/store/reducers/treat.js

@@ -1,8 +1,9 @@
-import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST } from '../types/treat'
-import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList } from '../actions/treat'
+import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST,IS_FIRST_MAIN_DIAG } from '../types/treat'
+import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList, isFirstMainDiag } from '../actions/treat'
 const initState = {
     show: false, //治疗方案显示隐藏
     showDrugInfo: false, //药品信息显示隐藏
+    isFirstMainDiag: true, //是否为第一次主诊断开单
     generalTreat: '',
     surgeryTreat: '',
     treatment: [],
@@ -196,7 +197,9 @@ export default function(state=initState, action){
         case CLEAR_DRUG_INFO:
             return clearDrugInfo(state, action);
         case SET_DRUG_INFO_LIST:
-        return setDrugInfoList(state, action);
+            return setDrugInfoList(state, action);
+        case IS_FIRST_MAIN_DIAG: 
+            return isFirstMainDiag(state, action)
         default:
             return state
     }

+ 1 - 0
src/store/types/pushMessage.js

@@ -13,5 +13,6 @@ export const SET_CHANGE_ADVICE_CHECK = 'SET_CHANGE_ADVICE_CHECK';   //改变医
 export const CLEAR_ALL_PUSH_MESSAGE = 'CLEAR_ALL_PUSH_MESSAGE';   //清除所有推送信息
 export const SHOW_TIPS_DETAILS = 'SHOW_TIPS_DETAILS'; //显示提示详情页
 export const HIDE_TIPS_DETAILS = 'HIDE_TIPS_DETAILS'; //显示提示详情页
+export const SET_COMMONTREATMENT = 'SET_COMMONTREATMENT'
 
 

+ 2 - 0
src/store/types/treat.js

@@ -13,3 +13,5 @@ export const SET_TREATMENT = 'SET_TREATMENT' //设置治疗方案
 export const SET_RECOMMEND_BASIC = 'SET_RECOMMEND_BASIC'//设置其他推荐推荐依据
 export const SET_TREAT_INFO = 'SET_TREAT_INFO' //设置治疗方案信息(name,id等)
 export const SET_DRUG_INFO_LIST = 'SET_DRUG_INFO_LIST' //查询多个药品说明书(添加数据时查看药品说明用)
+export const IS_FIRST_MAIN_DIAG = 'IS_FIRST_MAIN_DIAG' //是否为主诊断第一次开单
+