csx před 3 roky
rodič
revize
95cfa692a5

+ 5 - 5
controllers/his_api_controller.go Zobrazit soubor

@@ -529,7 +529,7 @@ func (c *HisApiController) GetHisPatientInfo() {
529 529
 	//prescriptions, _ := service.GetHisPrescription(admin.CurrentOrgId, patient_id, his_patient_id, recordDateTime)
530 530
 	//monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
531 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 533
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
534 534
 
535 535
 	order, _ := service.GetHisOrder(admin.CurrentOrgId, number, patient_id)
@@ -1156,7 +1156,7 @@ func (c *HisApiController) EditHisPrescription() {
1156 1156
 
1157 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 1160
 	var hpInfo models.HisPrescriptionInfo
1161 1161
 	if info.ID == 0 {
1162 1162
 		var randNum int
@@ -3844,7 +3844,7 @@ func (c *HisApiController) GetHisChargePatientInfo() {
3844 3844
 	//}
3845 3845
 
3846 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 3849
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
3850 3850
 
@@ -5438,7 +5438,7 @@ func (c *HisApiController) GetHisMonthChargePatientInfo() {
5438 5438
 	}
5439 5439
 
5440 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 5443
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5444 5444
 
@@ -5495,7 +5495,7 @@ func (c *HisApiController) GetHisMonthPatientInfo() {
5495 5495
 
5496 5496
 	monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
5497 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 5499
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5500 5500
 
5501 5501
 	order, _ := service.GetHisOrder(admin.CurrentOrgId, number, patient_id)

+ 1 - 1
controllers/his_hospital_api_controller.go Zobrazit soubor

@@ -198,7 +198,7 @@ func (c *HisHospitalApiController) GetHisHospitalChargePatientInfo() {
198 198
 		monthPrescriptions, _ = service.GetChargeMonthHisPrescriptionFour(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
199 199
 	}
200 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 202
 	order, _ := service.GetNewHisOrder(admin.CurrentOrgId, his_patient_info.Number, patient_id)
203 203
 	doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
204 204
 	//获取所有科室信息

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

@@ -100,7 +100,7 @@ func (c *MobileHisApiController) GetHisPatientInfo() {
100 100
 	prescriptions, _ := service.GetHisPrescription(admin.Org.Id, patient_id, recordDateTime, 2)
101 101
 	monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.Org.Id, patient_id, startRecordDateTime, endRecordDateTime, 2)
102 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 104
 	order, _ := service.GetHisOrder(admin.Org.Id, number, patient_id)
105 105
 	all_prescriptions, _ := service.GetCallHisPrescriptions(startRecordDateTime, endRecordDateTime, admin.Org.Id, patient_id, 2)
106 106
 	adminUserInfo, _ := service.GetAdminUserInfoByID(admin.Org.Id, admin.AdminUser.Id)
@@ -527,7 +527,7 @@ func (c *MobileHisApiController) CreateHisPrescription() {
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 531
 	var hpInfo models.HisPrescriptionInfo
532 532
 	if info.ID == 0 {
533 533
 		var randNum int

+ 8 - 2
service/his_service.go Zobrazit soubor

@@ -810,8 +810,14 @@ func CreateOrderInfo(order *models.HisOrderInfo) (err error) {
810 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 821
 	return
816 822
 
817 823
 }