index.jsx 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. import React, { Component } from "react";
  2. import style from "./index.less";
  3. import possibleImg from "../../common/images/possible.png";
  4. import doubtImg from "../../common/images/doubt.png";
  5. import recommendImg from "../../common/images/recommend.png";
  6. import tipsImg from "../../common/images/tips.png";
  7. import vigilantImg from "../../common/images/vigilant.png";
  8. import likelyImg from "../../common/images/likely.png";
  9. import DetailsModal from './DetailsModal';
  10. import PushDiag from "./PushDiag";
  11. import MRAnalyse from './MRAnalyse';
  12. import DiagnosticItem from "@containers/DiagnosticItem";
  13. import store from "@store";
  14. import {addLabel} from '@store/actions/inspect';
  15. import {addAssistLabel} from '@store/actions/assistCheck';
  16. import {windowEventHandler,getCurrentDate,getWindowInnerHeight,didPushParamChange} from '@utils/tools'
  17. import {ConfirmModal} from '@commonComp';
  18. import ChronicInfo from '@containers/ChronicInfo';//慢病推送模块
  19. import RecommendInspect from './RecommendInspect';
  20. import TipsMsg from './TipsMsg'
  21. import dataLis from '@components/EmergencyProcedure/emergency';
  22. import EmergencyProcedure from '@components/EmergencyProcedure';
  23. import {getMRAnalyse} from '@store/async-actions/pushMessage';
  24. class PushItems extends Component {
  25. constructor(props) {
  26. super(props);
  27. this.state = {
  28. moreAssay: false,
  29. moreCheck: false,
  30. show:true,
  31. showAssess:false, //评估弹窗
  32. };
  33. this.showMore = this.showMore.bind(this);
  34. this.closeMore = this.closeMore.bind(this);
  35. this.billing = this.billing.bind(this);
  36. this.changeAssay = this.changeAssay.bind(this);
  37. this.changeCheck = this.changeCheck.bind(this);
  38. this.showTips = this.showTips.bind(this);
  39. this.hideTips = this.hideTips.bind(this);
  40. this.$cont = React.createRef();
  41. this.setDataIdx = this.setDataIdx.bind(this)
  42. }
  43. showMore(type) {
  44. this.setState({ [type]: true });
  45. }
  46. closeMore(type) {
  47. this.setState({ [type]: false });
  48. }
  49. showAssessFn(){
  50. this.setState({
  51. showAssess:!this.state.showAssess
  52. });
  53. }
  54. billing() {
  55. const { assay, check } = this.props.pushMessage;
  56. const {EMRScrollCont} = this.props;
  57. const checkedAssay = assay.filter(item => item.checked);
  58. const checkedCheck = check.filter(item => item.checked);
  59. this.props.billing(checkedAssay, checkedCheck);
  60. let obj = { //添加化验
  61. details: [],
  62. name: '',
  63. questionId: '',
  64. showType: 1,
  65. uniqueName:''
  66. }
  67. let obj1 = { //添加辅检
  68. name: '',
  69. questionId: '',
  70. showType: 1,
  71. time:getCurrentDate(1),
  72. value:''
  73. }
  74. if(checkedAssay.length > 0){
  75. let assayArr = [],tmpDetail=[]
  76. for(let i = 0;i < checkedAssay.length;i++){
  77. let tmpObj = JSON.parse(JSON.stringify(obj));
  78. if (checkedAssay[i].controlType == 0) {
  79. tmpDetail = checkedAssay[i].questionMapping
  80. }else if(checkedAssay[i].controlType == 1 || checkedAssay[i].controlType == 6){
  81. tmpDetail.push(checkedAssay[i])
  82. }
  83. tmpObj.questionId = checkedAssay[i].id
  84. tmpObj.name = checkedAssay[i].name
  85. tmpObj.details = tmpDetail
  86. tmpObj.uniqueName = checkedAssay[i].uniqueName||''
  87. assayArr.push(tmpObj)
  88. }
  89. store.dispatch(addLabel(assayArr))
  90. }
  91. if(checkedCheck.length > 0){
  92. let checkArr = []
  93. for(let i = 0;i < checkedCheck.length;i++){
  94. let tmpObj = JSON.parse(JSON.stringify(obj1));
  95. tmpObj.questionId = checkedCheck[i].id
  96. tmpObj.name = checkedCheck[i].name
  97. checkArr.push(tmpObj)
  98. }
  99. store.dispatch(addAssistLabel(checkArr))
  100. }
  101. if(checkedAssay.length > 0 ||checkedCheck.length > 0) {
  102. store.dispatch(getMRAnalyse())
  103. }
  104. //滚动到底部
  105. setTimeout(function(){
  106. EMRScrollCont&&EMRScrollCont.scrollBottom();
  107. },100);
  108. /*if(checkedAssay.length > 0){
  109. document.getElementById("inspectResultData").scrollIntoView(true)
  110. }else{
  111. if(checkedCheck.length > 0){
  112. document.getElementById("assistResultData").scrollIntoView(true)
  113. }else{
  114. return;
  115. }
  116. }*/
  117. }
  118. changeAssay(item) {
  119. this.props.changeAssay(item);
  120. }
  121. changeCheck(item) {
  122. this.props.changeCheck(item);
  123. }
  124. showTips() {
  125. const { getTipsDetails, showTipsDetailsModal, clickDiag } = this.props;
  126. getTipsDetails && getTipsDetails({name: clickDiag.name, type: clickDiag.type,position:0,showName:clickDiag.showName });
  127. //showTipsDetailsModal && showTipsDetailsModal()
  128. }
  129. hideTips() {
  130. const { hideTipsDetailsModal } = this.props;
  131. hideTipsDetailsModal && hideTipsDetailsModal()
  132. }
  133. componentDidMount() {
  134. const height = getWindowInnerHeight() - 190;
  135. this.$cont.current.style.height = height + "px";
  136. windowEventHandler('resize', ()=>{
  137. if(this.$cont.current){
  138. const height = getWindowInnerHeight() - 190;
  139. this.$cont.current.style.height = height + "px";
  140. }
  141. });
  142. }
  143. setDataIdx(index){
  144. this.props.setDataIdx&&this.props.setDataIdx(index)
  145. }
  146. render() {
  147. const {
  148. vigilant,
  149. determine,
  150. doubt,
  151. possible,
  152. likely,
  153. assay,
  154. check,
  155. tips,
  156. showTipsDetails,
  157. tipsDetails,
  158. tmpFlg,
  159. showPartName,
  160. showAllName,
  161. MRAnalyseResult
  162. } = this.props.pushMessage;
  163. const { tipsDiscalimer,chronicPushItems,wholeIndexs,setPushEmergencyIdx,sysConfig,windowHeight,hideAllDrop,getInfomation} = this.props;
  164. const {
  165. billing,
  166. changeCheck,
  167. changeAssay,
  168. showTips
  169. } = this;
  170. const vigilants = vigilant.map((item, index) => {
  171. return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item} type='disSelect'/></div>;
  172. });
  173. return (
  174. <div className={style["push-content-wrapper"]}>
  175. <div className={style["push-content"]} ref={this.$cont}>
  176. <div style = {{width: '410px'}}>
  177. {vigilant && vigilant.length > 0 && (
  178. <div className={style["vigilant"]}>
  179. <div className={style["title"]}>
  180. <img src={vigilantImg} />
  181. 警惕
  182. </div>
  183. <div className={style["vigilantContent"]}>{vigilants}</div>
  184. </div>
  185. )}
  186. {/* 不展示确诊 */}
  187. {/* {determine && determine.length>0 && <PushDiag titleBg='#FAEBEC' icon={possibleImg} title='确诊' diagList={determine} maxShowNum={28}/>} */}
  188. {doubt && doubt.length > 0 && (
  189. <PushDiag
  190. titleBg="#FAEBEC"
  191. icon={doubtImg}
  192. title="初步诊断"
  193. diagList={doubt}
  194. />
  195. )}
  196. {possible && possible.length > 0 && (
  197. <PushDiag
  198. titleBg="#FAEBEC"
  199. icon={possibleImg}
  200. title="可能诊断"
  201. diagList={possible}
  202. />
  203. )}
  204. {likely && likely.length > 0 && (
  205. <PushDiag
  206. titleBg="#FAEBEC"
  207. icon={likelyImg}
  208. title="鉴别诊断"
  209. diagList={likely}
  210. />
  211. )}
  212. <div className={style["diagnose"]}>
  213. {vigilant.length === 0 &&
  214. determine.length === 0 &&
  215. doubt.length === 0 &&
  216. possible.length === 0 &&
  217. (!likely || likely&&likely.length ===0) &&
  218. (
  219. <div className={style["doubt"]}>
  220. <h1>
  221. <img src={doubtImg} />
  222. 初步诊断
  223. </h1>
  224. <div className={style["no-push"]}>无</div>
  225. </div>
  226. )}
  227. </div>
  228. <div className={style["recommend"]}>
  229. <h1>
  230. <img src={recommendImg} />
  231. 推荐检验检查
  232. <div className={style["billing"]}
  233. style={assay.length === 0 && check.length === 0 ? {color: 'gray', border: '1px solid gray', cursor:'auto'} : ''}
  234. onClick={assay.length === 0 && check.length === 0 ? '' : billing}>
  235. 开单
  236. </div>
  237. </h1>
  238. <div className={style["contentBox"]}>
  239. {assay.length === 0 && check.length === 0 ? (
  240. <span>无</span>
  241. ) : (<ul>
  242. <RecommendInspect
  243. title = '化验'
  244. list = {assay}
  245. changeFlag = {changeAssay}
  246. border = "true"
  247. type = {12}
  248. getInfomation = {getInfomation}
  249. >
  250. </RecommendInspect>
  251. <RecommendInspect
  252. title = '检查'
  253. list = {check}
  254. type = {6}
  255. changeFlag = {changeCheck}
  256. getInfomation = {getInfomation}
  257. >
  258. </RecommendInspect>
  259. </ul>)}
  260. </div>
  261. </div>
  262. {/*{chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems}></ChronicInfo>:''}*/}
  263. {<ChronicInfo
  264. patDom={this.$cont}
  265. data={chronicPushItems}></ChronicInfo>}
  266. {MRAnalyseResult.length > 0 && <MRAnalyse
  267. MRAnalyseResult = {MRAnalyseResult}
  268. >
  269. </MRAnalyse>}
  270. <TipsMsg
  271. patDom={this.$cont}
  272. tmpFlg = {tmpFlg}
  273. tipsImg = {tipsImg}
  274. tips = {tips}
  275. showTips = {showTips}
  276. tipsDiscalimer = {tipsDiscalimer}
  277. showPartName = {showPartName}
  278. ></TipsMsg>
  279. </div>
  280. {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data &&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '2')&&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '2').description}}></div>}
  281. </div>
  282. {showTipsDetails && <DetailsModal
  283. showTipsDetails = {showTipsDetails}
  284. hideTips = {this.hideTips}
  285. showAllName = {showAllName}
  286. tipsDetails = {tipsDetails}/>}
  287. {
  288. (setPushEmergencyIdx+'')&&(sysConfig.emergency_show==1)&&<EmergencyProcedure hideAllDrop={hideAllDrop} windowHeight={windowHeight} data={dataLis[setPushEmergencyIdx]} idx={setPushEmergencyIdx} setDataIdx={this.setDataIdx}></EmergencyProcedure>
  289. }
  290. </div>
  291. );
  292. }
  293. }
  294. export default PushItems;