Browse Source

Merge branch 'master' of huhongkun/PC-application into master

huhongkun 6 years ago
parent
commit
1cc09e6dc5
3 changed files with 202 additions and 24 deletions
  1. 12 8
      api/recover_api.js
  2. 189 15
      app/recover/html/new_recover.html
  3. 1 1
      app/recover/html/select-disease.html

+ 12 - 8
api/recover_api.js

@ -80,14 +80,18 @@
		findDiagnosisInformationByPatient: function(data) {
			return httpRequest.get("doctor/specialist/diagnosisInformation/findDiagnosisInformationByPatient", {data: data})
		},
		// 最后一条数据,用来推算时间
		getBodyRecoredLast: function(data) {
			return httpRequest.get('doctor/health_index/last', {data: data});
		},
		// 获取体征数据doctor/health_index/chart
		getHealthIndex: function(data) {
			return httpRequest.post("doctor/health_index/chart", {data: data})
		},
		//诊疗信息
		diagnosisQuery:function(data){
			return httpRequest.get("doctor/archives/event",{data:data})
		},
		//诊疗信息的附属信息
		diagnosisSubsidiary:function(data){
			return httpRequest.get("doctor/archives/event/healthData",{data:data})
		},
		//保存诊疗信息接口
		preservationInfo:function(data){
			return httpRequest.post("doctor/specialist/diagnosisInformation/createDiagnosisInformation",{data:data})
		}
	}
    exports.recoverAPI = recoverAPI;
})(window)

+ 189 - 15
app/recover/html/new_recover.html

@ -3,6 +3,7 @@
	<head>
		<meta charset="UTF-8">
		<title>新建计划</title>
		<link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
		<link rel="stylesheet" type="text/css" href="../../../css/cross.ui.css" />
		<link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
@ -53,16 +54,41 @@
		        		<li class="pt10"><span class="c-999">全科医生:</span>{{patiInfo.ssDoctorName || patiInfo.jtDoctorName}}</li>
		        		<li class="pt10"><span class="c-999">健&ensp;管&ensp;师:</span>{{patiInfo.ssDoctorHealthName || patiInfo.jtDoctorHealthName}}</li>
		        	</ul>
		        	<!--<h4 class="h30 m0 c-f14 c-border-b">诊疗信息</h4>
		        	<ul class="c-333 m0 p0 pb20">
		        		<li class="pt10"><span class="c-999">诊疗医院:</span>男</li>
		        		<li class="pt10"><span class="c-999">入院科室:</span>男</li>
		        		<li class="pt10"><span class="c-999">主治医师:</span>男</li>
		        		<li class="pt10"><span class="c-999">入院诊断:</span>男</li>
		        		<li class="pt10"><span class="c-999">出院诊断:</span>男</li>
		        	<h4 class="h30 m0 c-f14 c-border-b">诊疗信息</h4>
		        	<ul class="c-333 m0 p0 pb20" >
	        			<div class="input-group" >
	        				<label style="transform: translateY(50%); color: #999999;font-weight: normal;">就诊事件:</label>
							<div class="input-group-btn" style="width: 80%; transform: translateY(50%);top: -5px;">
								<button style="width:223px;padding: 0; text-overflow: ellipsis; overflow: hidden;" v-bind:disabled="edit" type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
									{{diagnosisInfo[indexOrder].orgName}}
									<span class="caret" style="position: absolute; top: 50%; right: 20px; margin-top: -2px;"></span>
								</button>
								<ul class="dropdown-menu" style="min-width: 206px;" >
									<li class="c-f14 c-border-b" style="text-align: center; padding: 2px;cursor:pointer;" v-for="(v, i) in diagnosisInfo" @click="orderHospital(i)" v-html="v.orgName"></li>
								</ul>
							</div>
						</div>
		        		<li class="pt10"style="display: flex;">
		        			<label class="c-999" style="font-weight: normal;">入院科室:</label>
		        			<input class="form-control" v-bind:disabled="edit" v-bind:placeholder="nodata == true? '请输入': subsidiaryInfo.data.department" style=" text-align: center; height: 22px; border-radius: 3px; width: 80%;">
		        		</li>
		        		<li class="pt10"style="display: flex;">
		        			<label class="c-999" style="font-weight: normal;">主治医师:</label>
		        			<input class="form-control" v-bind:disabled="edit" v-bind:placeholder="nodata == true? '请输入': subsidiaryInfo.data.attendingDoctor" style="text-align: center; height: 22px; border-radius: 3px; width: 80%;">
		        		</li>
		        		<li class="pt10"style="display: flex;">
		        			<label class="c-999" style="font-weight: normal;">入院诊断:</label>
		        			<input class="form-control" v-bind:disabled="edit" v-bind:placeholder="nodata == true? '请输入': subsidiaryInfo.data.admissionDiagnosis" style="text-align: center; height: 22px; border-radius: 3px; width: 80%;">
		        		</li>
		        		<li class="pt10"style="display: flex;">
		        			<label class="c-999" style="font-weight: normal;">出院诊断:</label>
		        			<input class="form-control" v-bind:disabled="edit" v-bind:placeholder="nodata == true? '请输入': subsidiaryInfo.data.dischargeDiagnosis" style="text-align: center; height: 22px; border-radius: 3px; width: 80%;">
		        		</li>
		        	</ul>
		        	<h4 class="h30 m0 c-f14 c-border-b">出院小结</h4>
		        	<p class="m0 pt10 c-333">依旧本次判断,对新消息进行出院诊断做出以下结论:忧郁啥啥事等等等问题</p>-->
		        	<h4 class="h30 m0 c-f14 c-border-b c-999">医嘱小结</h4>
		        	<!--<p class="m0 pt10 c-333">依旧本次判断,对新消息进行出院诊断做出以下结论:忧郁啥啥事等等等问题</p>-->
		        	<textarea v-bind:disabled="edit" class="tipText m0 pt10 c-333 mt10" style="width: 100%; border:1px solid #e1e1e1; resize:none;text-indent:28px" v-html="subsidiaryInfo.data.dischargeOrder"></textarea>
		        	<button type="button" class="btn btn-default fr" style="width: 60px; background: #12B7F5; border-radius: 0px ;border: 0px ;" @click="editdiagnosis()" v-html="edit == true? '编辑':'保存'"></button>
	        	</div>
	        </div>
	        <div class="fl c-h100 w-100-300">
@ -245,7 +271,7 @@
					icon: 6
				})
			}
			recoverVue = new Vue({
			top.recoverVue = new Vue({
                el: "#app",
                data: {
                	pickerOptions1: {
@ -283,7 +309,15 @@
                	selectProjectDetail: null,
                	searchKey: null,
                	havePlan: false,
                	frequencyList: []
                	frequencyList: [],
                	diagnosisInfo:"",
                	indexOrder:0,
                	profileRes:[],
                	nodata:false,
                	subsidiaryInfo:{},
                	edit:true,
                	selectDiseaseIndex:'',
                	isPlanId :''
                },
                mounted: function() {
                	this.selectFrequencys()
@ -294,9 +328,148 @@
                		this.pati = {patient: httpData.patient}
                		this.getPatientInfo()
                		this.findTemplateList()
                		this.diagnosisQuery()
                	}
                },
                methods: {
                	//获取诊疗信息
                	diagnosisQuery:function(){
                		var vm = this;
                		loadding = layer.load(0, {shade: false});
                		params = {
                			patient: this.pati.patient,
							type: '2',
							page: 1,
							pageSize: 50,
							lastTime: ''
                		}
                		recoverAPI.diagnosisQuery(params).then(function(res){
                			layer.close(loadding)
                			if (res.status == 200) {
                				if(res.data.length == 0){
                					vm.diagnosisInfo = [{orgName:'无'}]
                					console.log(vm.diagnosisInfo)
                					debugger
                					vm.nodata = true
                				}else{
                					vm.diagnosisInfo = res.data;
                				}
                				vm.orderHospital(0)
                			}else{
//              				vm.diagnosisInfo = [{orgName:'无'}]
//              				vm.orderHospital(0)
                				showErrorMessage(res.msg);
                			}
                		})
                	},
                	//按照医院查询诊疗信息
                	orderHospital:function(index){
                		var vm = this;
                		vm.indexOrder = index
                		loadding = layer.load(0, {shade: false});
                		var sec_params = {
                			patient: vm.pati.patient,
							event:vm.diagnosisInfo[index].id || "",
//							patient:"3b26a7905e034c36a5ba8e65bdc0dc7f",
//							event:"26eec2df-caa9-4b7e-9993-0ad7ae8d0a15",
							catalog:'0213',
							serial:"1"
		                	}
                		recoverAPI.diagnosisSubsidiary(sec_params).then(function(res){
        					layer.close(loadding)
        					vm.subsidiaryInfo = vm.selectXmlDom(res,'0213')
        					console.log(vm.subsidiaryInfo)
                		})
                	},
                	//获取xml数据
					selectXmlDom: function (profileRes,tempalteCode) {
						var vm = this;
						if(profileRes.status == 200){
							var $dom = $(profileRes.data.replace(/<\?xml .*\?>/,'')),
								version = $dom.find(">version").length?$dom.find(">version").attr("code"):$dom.attr('version');
							$.trim(version) || (function () {
								version = $dom.find(">ClinicalDocument").length? '2.0.0.1' : '';
							})();
							if($.trim(version)) {
								var verNum = version.split('.')[0];
									var  jsonData = {}
									// xml 转 json
									if((typeof profileRes.data=='string')&&profileRes.data.constructor==String) {
										// 去除携带的脚本内容
										profileRes.data = profileRes.data.replace(/<script[^>]*?>[\s\S]*?<\/script>/ig,'');
//										console.log(profileRes.data.replace(/<\?xml .*\?>/,''))
										jsonData = vm.handleData(profileRes.data.replace(/<\?xml .*\?>/,''));
									}
							}
						}else{
							showErrorMessage(profileRes.msg)
							jsonData = {data:{}}
						}
						return jsonData;
					},
					handleData :function (xmlStr) {
						var $xmlDom = $(xmlStr),
							$nodes = {
							
							} ;
						var resultData = []; 
						return {
							data:{
								"department": $xmlDom.find('component section entry inDept').text(),//科室
								"dednumber": $xmlDom.find('component section entry bed').text(),//床号
								"HospitalizationNumber": "",//住院号
								"name": $xmlDom.find('recordTarget patient name').text(),//姓名
								"sex": $xmlDom.find('recordTarget patient sex').text(),//性别
								"nation": $xmlDom.find('recordTarget nation').text(),//民族
								"marriage": $xmlDom.find('recordTarget marriage').text(),//婚姻
								"admissionTime": $xmlDom.find('component section entry inTime').attr('value'),//入院时间
								"dischargeTime": $xmlDom.find('component section entry outTime').attr('value'),//出院时间
								"lengthStay": $xmlDom.find('component section entry inHospitalDay').text(),//住院天数
								"admissionStatus": $xmlDom.find('component section entry inCondition').text(),//入院情况
								"admissionDiagnosis": $xmlDom.find('component section entry inDiagnosis').text(),//入院诊断
								"dischargeDiagnosis": $xmlDom.find('component section entry outDiagnosis').text(),//出院诊断
								"DiagnosisProcess": $xmlDom.find('component section entry remedialCourse').text(),//诊疗经过
								"dischargeStatus": $xmlDom.find('component section entry outCondition').text(),//出院情况
								"dischargeOrder": $xmlDom.find('component section entry outOrder').text(),//出院医嘱
								"treatmentOutcome": $xmlDom.find('component section entry remedialResult').text(),//治疗结果
								"residentPhysician": $xmlDom.find('residentDoctor name').text(),//住院医师
								"attendingDoctor": $xmlDom.find('inChargeDoctor name').text(),//主治医师
								"time": $xmlDom.find('inChargeDoctor time').attr('value')//时间
							}
						}
					},
					//编辑诊疗
					editdiagnosis:function(){
						var  vm = this;
						if(vm.isPlanId){
							vm.edit = !vm.edit;
							if(vm.edit == true){
								var thr_parems ={
									patient:vm.pati.patient,
									patientName:vm.pati.patientName,
									planId:vm.isPlanId,
									hospitalName:$('.input-group-btn button').text().trim(),
									department:vm.subsidiaryInfo.data.department|| "",
									attendingDoctorName:vm.subsidiaryInfo.data.attendingDoctor ||"",
									admittingDiagnosis:vm.subsidiaryInfo.data.admissionDiagnosis || "",
									dischargeDiagnosis:vm.subsidiaryInfo.data.dischargeDiagnosis|| "",
									advice:vm.subsidiaryInfo.data.dischargeOrder ||"",
									dischargeTime:vm.subsidiaryInfo.data.dischargeTime || ""
								}
								loadding = layer.load(0, {shade: false});
								recoverAPI.preservationInfo(thr_parems).then(function(res){
		        					layer.close(loadding)
		        					if (res.status == 200) {
		                				showSuccessMessage('保存成功')
	            					}else{
	                					showErrorMessage(res.msg);
	                				}
	                			})
							}
						}else{
                			showWarningMessage("请先生成计划")
						}
					},
                	// 获取频次列表
                	selectFrequencys: function() {
                		var vm = this,
@ -628,7 +801,7 @@
                	// 添加模板
                	addMuban: function(oId) {
                		var vm = this
                		selectDiseaseIndex = layer.open({
                		vm.selectDiseaseIndex = layer.open({
							type: 2,
							area: ['400px', '500px'],
							shade: 0.5,
@ -855,10 +1028,11 @@
						recoverAPI.createRehabilitationPlan(params).then(function(res) {
							layer.close(loadding)
							if(res.status == 200) {
								vm.isPlanId = res.data
								showSuccessMessage("康复计划配置成功!")
								setTimeout(function() {
									window.location.href = "../../rehabilitation/html/health_control.html"
								}, 1000)
//								setTimeout(function() {
//									window.location.href = "../../rehabilitation/html/health_control.html"
//								}, 1000)
							} else {
								showErrorMessage(res.msg || "同康复计划项目创建时间重复!");
								vm.templateDetail = $.map(vm.templateDetail, function(o, index) {

+ 1 - 1
app/recover/html/select-disease.html

@ -76,7 +76,7 @@
                			return false;
                		}
                		top.recoverVue.newPlan(this.diseaseArr[this.selectIndex], httpData.templateId)
                		top.layer.close(top.selectDiseaseIndex)
                		top.layer.close(top.recoverVue.selectDiseaseIndex)
                	},
                	findTeamDiseaseRelation: function() {
                		var vm = this,