csx před 3 roky
rodič
revize
95cfa692a5

+ 5 - 5
controllers/his_api_controller.go Zobrazit soubor

529
 	//prescriptions, _ := service.GetHisPrescription(admin.CurrentOrgId, patient_id, his_patient_id, recordDateTime)
529
 	//prescriptions, _ := service.GetHisPrescription(admin.CurrentOrgId, patient_id, his_patient_id, recordDateTime)
530
 	//monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
530
 	//monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
531
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
531
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
532
-	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
532
+	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type, his_patient_id)
533
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
533
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
534
 
534
 
535
 	order, _ := service.GetHisOrder(admin.CurrentOrgId, number, patient_id)
535
 	order, _ := service.GetHisOrder(admin.CurrentOrgId, number, patient_id)
1156
 
1156
 
1157
 	role, _ := service.GetAdminUserInfoByID(adminInfo.CurrentOrgId, doctor_id)
1157
 	role, _ := service.GetAdminUserInfoByID(adminInfo.CurrentOrgId, doctor_id)
1158
 
1158
 
1159
-	info, _ := service.FindPatientPrescriptionInfo(adminInfo.CurrentOrgId, patient_id, recordDateTime, p_type)
1159
+	info, _ := service.FindPatientPrescriptionInfo(adminInfo.CurrentOrgId, patient_id, recordDateTime, p_type, his_patient_id)
1160
 	var hpInfo models.HisPrescriptionInfo
1160
 	var hpInfo models.HisPrescriptionInfo
1161
 	if info.ID == 0 {
1161
 	if info.ID == 0 {
1162
 		var randNum int
1162
 		var randNum int
3844
 	//}
3844
 	//}
3845
 
3845
 
3846
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
3846
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
3847
-	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
3847
+	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type, his_patient_id)
3848
 
3848
 
3849
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
3849
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
3850
 
3850
 
5438
 	}
5438
 	}
5439
 
5439
 
5440
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
5440
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
5441
-	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5441
+	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type, his_patient_id)
5442
 
5442
 
5443
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5443
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5444
 
5444
 
5495
 
5495
 
5496
 	monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
5496
 	monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
5497
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
5497
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
5498
-	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5498
+	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type, his_patient_id)
5499
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5499
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5500
 
5500
 
5501
 	order, _ := service.GetHisOrder(admin.CurrentOrgId, number, patient_id)
5501
 	order, _ := service.GetHisOrder(admin.CurrentOrgId, number, patient_id)

+ 1 - 1
controllers/his_hospital_api_controller.go Zobrazit soubor

198
 		monthPrescriptions, _ = service.GetChargeMonthHisPrescriptionFour(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
198
 		monthPrescriptions, _ = service.GetChargeMonthHisPrescriptionFour(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
199
 	}
199
 	}
200
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
200
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
201
-	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
201
+	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
202
 	order, _ := service.GetNewHisOrder(admin.CurrentOrgId, his_patient_info.Number, patient_id)
202
 	order, _ := service.GetNewHisOrder(admin.CurrentOrgId, his_patient_info.Number, patient_id)
203
 	doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
203
 	doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
204
 	//获取所有科室信息
204
 	//获取所有科室信息

+ 2 - 2
controllers/new_mobile_api_controllers/mobile_his_api_controller.go Zobrazit soubor

100
 	prescriptions, _ := service.GetHisPrescription(admin.Org.Id, patient_id, recordDateTime, 2)
100
 	prescriptions, _ := service.GetHisPrescription(admin.Org.Id, patient_id, recordDateTime, 2)
101
 	monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.Org.Id, patient_id, startRecordDateTime, endRecordDateTime, 2)
101
 	monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.Org.Id, patient_id, startRecordDateTime, endRecordDateTime, 2)
102
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.Org.Id, patient_id, recordDateTime)
102
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.Org.Id, patient_id, recordDateTime)
103
-	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.Org.Id, patient_id, recordDateTime, 2)
103
+	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfoTwo(admin.Org.Id, patient_id, recordDateTime, 2)
104
 	order, _ := service.GetHisOrder(admin.Org.Id, number, patient_id)
104
 	order, _ := service.GetHisOrder(admin.Org.Id, number, patient_id)
105
 	all_prescriptions, _ := service.GetCallHisPrescriptions(startRecordDateTime, endRecordDateTime, admin.Org.Id, patient_id, 2)
105
 	all_prescriptions, _ := service.GetCallHisPrescriptions(startRecordDateTime, endRecordDateTime, admin.Org.Id, patient_id, 2)
106
 	adminUserInfo, _ := service.GetAdminUserInfoByID(admin.Org.Id, admin.AdminUser.Id)
106
 	adminUserInfo, _ := service.GetAdminUserInfoByID(admin.Org.Id, admin.AdminUser.Id)
527
 
527
 
528
 	}
528
 	}
529
 
529
 
530
-	info, _ := service.FindPatientPrescriptionInfo(adminInfo.Org.Id, patient_id, recordDateTime, 2)
530
+	info, _ := service.FindPatientPrescriptionInfoTwo(adminInfo.Org.Id, patient_id, recordDateTime, 2)
531
 	var hpInfo models.HisPrescriptionInfo
531
 	var hpInfo models.HisPrescriptionInfo
532
 	if info.ID == 0 {
532
 	if info.ID == 0 {
533
 		var randNum int
533
 		var randNum int

+ 8 - 2
service/his_service.go Zobrazit soubor

810
 	return
810
 	return
811
 }
811
 }
812
 
812
 
813
-func FindPatientPrescriptionInfo(org_id int64, patient_id int64, record_date int64, p_type int64) (info models.HisPrescriptionInfo, err error) {
814
-	err = readDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ? AND p_type = ? ", org_id, record_date, patient_id, p_type).First(&info).Error
813
+func FindPatientPrescriptionInfo(org_id int64, patient_id int64, record_date int64, p_type int64, his_patient_id int64) (info models.HisPrescriptionInfo, err error) {
814
+	err = readDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ? AND p_type = ? AND his_patient_id = ? ", org_id, record_date, patient_id, p_type, his_patient_id).First(&info).Error
815
+	return
816
+
817
+}
818
+
819
+func FindPatientPrescriptionInfoTwo(org_id int64, patient_id int64, record_date int64, p_type int64) (info models.HisPrescriptionInfo, err error) {
820
+	err = readDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ? AND p_type = ?  ", org_id, record_date, patient_id).First(&info).Error
815
 	return
821
 	return
816
 
822
 
817
 }
823
 }