rukou.js 4.63 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
define(['zepto', 'medtap'], function($, medtap) {
	var detail = {
		emrId: medtap.getRequest('emrId'),
		init: function() {
			detail.bindEve();
			detail.getEmrDetail();
		},
		bindEve: function() {
			$('.tab_item').unbind().bind('click', function() {
				$(this).addClass('tabOn');
				$(this).siblings('.tab_item').removeClass('tabOn');
				if ($('.basic').hasClass('tabOn')) {
					$('.basicInfo').show();
					$('.treatwayInfo').hide();
				} else if ($('.treatway').hasClass('tabOn')) {
					$('.basicInfo').hide();
					$('.treatwayInfo').show();
				}
			})
		},
		getEmrDetail: function() {
			medtap.jzz(1);
			$.ajax({
				url: 'https://testdevgw.medtap.cn/user/patientEMR/getPatientEMRInfo',
				type: 'post',
				async: false,
				contentType: 'application/json',
				headers: medtap.getHeaders(),
				data: JSON.stringify({
					emrId: detail.emrId
				}),
				success: function(res) {
					medtap.jzz(0);
					if (res.success == true) {
						var info = res.content.emr;
						//基本信息
						var sex = '';
						var diseaseDiagnosis = '';
						$('#username').val(info.patientName);
hanpeng committed
40
						document.title = info.patientName;
41 42 43 44 45 46 47 48 49 50 51 52 53 54
						if (info.sex == 'M') {
							sex = '男';
						} else {
							sex = '女';
						}
						$('#sex').val(sex).attr('sendkey', info.sex);
						$('#birth').val(info.birthday);
						if (info.diseaseDiagnosis == 'lung') {
							diseaseDiagnosis = '肺癌';
							$('#disease').val(diseaseDiagnosis).attr('sendkey', 'lung');
						} else {
							diseaseDiagnosis = '其他';
							$('#disease').val(diseaseDiagnosis).attr('sendkey', ' ');
						}
hanpeng committed
55 56 57 58 59 60
						
						if(info.hasOwnProperty('pathologyTypeItem')){
							$('#pathology').val(info.pathologyTypeItem.value).attr('sendkey', info.pathologyTypeItem.child);
						}else{
							$('#pathology').val(info.pathologyTypeName);
						}
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
						$('#height').val(info.hasOwnProperty('height') ? info.height : '');
						$('#stages').val(info.hasOwnProperty('tumorStageItem') ? info.tumorStageItem.value : '');
						$('#stages_TNM').val(info.hasOwnProperty('tnmStage') ? info.tnmStage : '');
						$('#transfer').val(info.hasOwnProperty('transferNidusItem') ? info.transferNidusItem.value : '');
						if (info.hasOwnProperty('smokingFlg') && info.smokingFlg == true) {
							$('#somke').val(info.smokingYear + '年' + info.smokingDailyNum + '支/天');
						} else if (info.hasOwnProperty('smokingFlg') && info.smokingFlg == false) {
							$('#somke').val('无');
						}
						$('#ECOG').val(info.hasOwnProperty('ecogGradeItem') ? info.ecogGradeItem.value : '');
						$('#idCard').val(info.hasOwnProperty('patientHospitalIdNum') ? info.patientHospitalIdNum : '');
						$('#location').val(info.hasOwnProperty('areaItem') ? info.areaItem.fullName : '');
						//治疗信息
						//$('.hasPoint').text(info.hasOwnProperty('targetedMutationsItem') ? info.targetedMutationsItem.value : "");
						if (info.hasOwnProperty('targetedMutationsItem') && info.targetedMutationsItem.length != 0) {
							var strTargetedMutations = [];
							for (var i = 0; i < info.targetedMutationsItem.length; i++) {
								strTargetedMutations.push(info.targetedMutationsItem[i].value);

							}
							strTargetedMutations.join(',')
							$('.hasPoint').text(strTargetedMutations).css('color', '#333');
						} else {
							$('.hasPoint').text('无');
						}
						if (info.hasOwnProperty('acceptingCureItem') && info.acceptingCureItem.length != 0) {
							var strAccepting = [];
							for (var i = 0; i < info.acceptingCureItem.length; i++) {
								strAccepting.push(info.acceptingCureItem[i].value);
							}
							strAccepting.join(',');
							$('.treating').text(strAccepting).css('color', '#333');
						} else {
							$('.treating').text('无');
						}
						if (info.hasOwnProperty('acceptedCureItem') && info.acceptedCureItem.length != 0) {
							var strAccepted = [];
							for (var i = 0; i < info.acceptedCureItem.length; i++) {
								strAccepted.push(info.acceptedCureItem[i].value);
							}
							strAccepted.join(',');
							$('.treated').text(strAccepted);
						} else {
							$('.treated').text('无');
						}
						//图片
						/* var picUrl = */
						if (info.hasOwnProperty('curePicList') && info.curePicList.length != 0) {
							var picUrl = '';
							for (var i = 0; i < info.curePicList.length; i++) {
								picUrl += '<img src="' + info.curePicList[i] + '" >';
								'<div class="image_files_item">' +
								'<img src="' + info.curePicList[i] + '" class="image_files_img" imgkey="' + info.curePicList[i] + '">' +
									'<img src="images/post_delete_btn@2x.png" class="image_del" >' +
									'</div>';
							}
							$('#ImgUp').html(picUrl);
						}
					}
				}
			})
		}
	}
	detail.init();
})