Bladeren bron

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

28169 2 maanden geleden
bovenliggende
commit
296613f34e
2 gewijzigde bestanden met toevoegingen van 15 en 2 verwijderingen
  1. 2 2
      controllers/zuobiao_api_controller.go
  2. 13 0
      service/patient_dataconfig_service.go

+ 2 - 2
controllers/zuobiao_api_controller.go Bestand weergeven

@@ -92,14 +92,14 @@ func (c *ZuobiaoApiController) GetHisZuoBiaoDetailInfo() {
92 92
 	} else if is_upload == 2 { //已上传
93 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 96
 	var monthPrescriptions []*models.HisPrescription
97 97
 	if is_upload == 1 {
98 98
 		monthPrescriptions, _ = service.GetMonthUnUploadHisZuoBiaoPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
99 99
 	} else if is_upload == 2 {
100 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 104
 	c.ServeSuccessJSON(map[string]interface{}{
105 105
 		"prescription":        prescriptions,

+ 13 - 0
service/patient_dataconfig_service.go Bestand weergeven

@@ -161,3 +161,16 @@ func GetFaPiaoPatientByID(orgID int64, patientID int64) (*models.Patients, error
161 161
 	}
162 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
+}