Browse Source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 4 years ago
parent
commit
bf368acf76
2 changed files with 11 additions and 1 deletions
  1. 7 1
      controllers/sz/sz_his_api_controller.go
  2. 4 0
      enums/error_code.go

+ 7 - 1
controllers/sz/sz_his_api_controller.go View File

1691
 
1691
 
1692
 	patientPrescription, _ := service.FindPatientPrescriptionInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
1692
 	patientPrescription, _ := service.FindPatientPrescriptionInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
1693
 
1693
 
1694
+	sick, _ := service.FindSickById(patientPrescription.SickType)
1695
+
1696
+	if sick.ID == 0 {
1697
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamSickTypeWrong)
1698
+		return
1699
+	}
1700
+
1694
 	adminRole_two, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, patientPrescription.DoctorId)
1701
 	adminRole_two, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, patientPrescription.DoctorId)
1695
 
1702
 
1696
 	adminRole, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
1703
 	adminRole, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
1968
 			//根据业务的人员信息跟设备读社保卡获取的信息进行匹配,判断是否为同一个人,相同则进行挂号操作,不同则报错
1975
 			//根据业务的人员信息跟设备读社保卡获取的信息进行匹配,判断是否为同一个人,相同则进行挂号操作,不同则报错
1969
 			tempPatient, _ := service.GetPatientByNumber(id_card_number, adminUser.CurrentOrgId)
1976
 			tempPatient, _ := service.GetPatientByNumber(id_card_number, adminUser.CurrentOrgId)
1970
 			if tempPatient.ID == patient_id {
1977
 			if tempPatient.ID == patient_id {
1971
-				sick, _ := service.FindSickById(patientPrescription.SickType)
1972
 				result_three := service.SzybFY005(doctor_name, doctor_code, miConfig.Code, total, yiliao_number, verifyCode, number, mz_number, version_code, drug_doctor_code, drug_doctor_name, his.MedicalTreatmentType, sick.CountryCode)
1978
 				result_three := service.SzybFY005(doctor_name, doctor_code, miConfig.Code, total, yiliao_number, verifyCode, number, mz_number, version_code, drug_doctor_code, drug_doctor_name, his.MedicalTreatmentType, sick.CountryCode)
1973
 				var dat map[string]interface{}
1979
 				var dat map[string]interface{}
1974
 				if err := json.Unmarshal([]byte(result_three), &dat); err == nil {
1980
 				if err := json.Unmarshal([]byte(result_three), &dat); err == nil {

+ 4 - 0
enums/error_code.go View File

245
 	ErrorDoctorLoginFaildParamWrong   = 30004
245
 	ErrorDoctorLoginFaildParamWrong   = 30004
246
 
246
 
247
 	ErrorNoReadCardException = 30005
247
 	ErrorNoReadCardException = 30005
248
+
249
+	ErrorCodeParamSickTypeWrong = 30006
248
 )
250
 )
249
 
251
 
250
 var ErrCodeMsgs = map[int]string{
252
 var ErrCodeMsgs = map[int]string{
472
 	ErrorDoctorLoginFaildParamWrong:    "登记失败",
474
 	ErrorDoctorLoginFaildParamWrong:    "登记失败",
473
 
475
 
474
 	ErrorNoReadCardException: "无法读取除社保卡以外的卡",
476
 	ErrorNoReadCardException: "无法读取除社保卡以外的卡",
477
+
478
+	ErrorCodeParamSickTypeWrong: "医生所开处方的疾病类型不能为空",
475
 }
479
 }
476
 
480
 
477
 type SGJError struct {
481
 type SGJError struct {