Sfoglia il codice sorgente

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

28169 8 mesi fa
parent
commit
296613f34e

+ 2 - 2
controllers/zuobiao_api_controller.go Vedi File

92
 	} else if is_upload == 2 { //已上传
92
 	} else if is_upload == 2 { //已上传
93
 		prescriptions, _ = service.GetUploadHisZuoBiaoPrescription(adminInfo.CurrentOrgId, patient_id, recordDateTime)
93
 		prescriptions, _ = service.GetUploadHisZuoBiaoPrescription(adminInfo.CurrentOrgId, patient_id, recordDateTime)
94
 	}
94
 	}
95
-	patient, _ := service.GetPatientByID(c.GetAdminUserInfo().CurrentOrgId, patient_id)
95
+	patient, _ := service.GetPatientByIDThree(c.GetAdminUserInfo().CurrentOrgId, patient_id)
96
 	var monthPrescriptions []*models.HisPrescription
96
 	var monthPrescriptions []*models.HisPrescription
97
 	if is_upload == 1 {
97
 	if is_upload == 1 {
98
 		monthPrescriptions, _ = service.GetMonthUnUploadHisZuoBiaoPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
98
 		monthPrescriptions, _ = service.GetMonthUnUploadHisZuoBiaoPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
99
 	} else if is_upload == 2 {
99
 	} else if is_upload == 2 {
100
 		monthPrescriptions, _ = service.GetMonthUploadHisZuoBiaoPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
100
 		monthPrescriptions, _ = service.GetMonthUploadHisZuoBiaoPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
101
 	}
101
 	}
102
-	prescription_info, _ := service.GetZuoBiaoPrescriptionInfo(c.GetAdminUserInfo().CurrentOrgId, patient.ID)
102
+	prescription_info, _ := service.GetZuoBiaoPrescriptionInfo(adminInfo.CurrentOrgId, patient.ID)
103
 
103
 
104
 	c.ServeSuccessJSON(map[string]interface{}{
104
 	c.ServeSuccessJSON(map[string]interface{}{
105
 		"prescription":        prescriptions,
105
 		"prescription":        prescriptions,

+ 13 - 0
service/patient_dataconfig_service.go Vedi File

161
 	}
161
 	}
162
 	return &patient, nil
162
 	return &patient, nil
163
 }
163
 }
164
+
165
+func GetPatientByIDThree(orgID int64, patientID int64) (*models.Patients, error) {
166
+	var patient models.Patients
167
+	err := readDb.Model(&models.Patients{}).Where("id = ? and user_org_id=? and status=1", patientID, orgID).First(&patient).Error
168
+	if err != nil {
169
+		if err == gorm.ErrRecordNotFound {
170
+			return nil, nil
171
+		} else {
172
+			return nil, err
173
+		}
174
+	}
175
+	return &patient, nil
176
+}