浏览代码

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

csx 3 年前
父节点
当前提交
514729177b
共有 1 个文件被更改,包括 11 次插入3 次删除
  1. 11 3
      controllers/sg/his_api_controller.go

+ 11 - 3
controllers/sg/his_api_controller.go 查看文件

@@ -3072,15 +3072,23 @@ func (c *HisApiController) GetPreUploadInfo() {
3072 3072
 	chrgBchno := rand.Intn(100000) + 10000
3073 3073
 	chrg_bchno := timeFormat + strconv.FormatInt(int64(chrgBchno), 10) + strconv.FormatInt(his.PatientId, 10)
3074 3074
 	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
3075
-	patientPrescription, _ := service.FindHisPatientPrescriptionInfo(adminUser.CurrentOrgId, his_patient_id, recordDateTime)
3075
+	var patientPrescription models.HisPrescriptionInfo
3076
+	patientPrescription, _ = service.FindHisPatientPrescriptionInfo(adminUser.CurrentOrgId, his_patient_id, recordDateTime)
3077
+	if patientPrescription.ID == 0 {
3078
+		patientPrescription, _ = service.FindLastPatientPrescriptionInfo(adminUser.CurrentOrgId, id, recordDateTime)
3079
+	}
3080
+	//miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
3076 3081
 	department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
3082
+
3083
+	doctor_info, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, patientPrescription.DoctorId)
3084
+
3077 3085
 	strconv.FormatInt(his.PatientId, 10)
3078 3086
 
3079 3087
 	var result string
3080 3088
 	if miConfig.InsuplcAdmdvs == "440781" { //
3081
-		result = service.Gdyb2203A(his.PsnNo, his.Number, patientPrescription.Doctor, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), patientPrescription.DoctorId, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.CountryCode, sickConfig.ClassName, roles.UserName, config)
3089
+		result = service.Gdyb2203A(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.AdminUserId, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.CountryCode, sickConfig.ClassName, roles.UserName, config)
3082 3090
 	} else {
3083
-		result = service.Gdyb2203(his.PsnNo, his.Number, patientPrescription.Doctor, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), patientPrescription.DoctorId, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.CountryCode, sickConfig.ClassName, roles.UserName, config)
3091
+		result = service.Gdyb2203(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.AdminUserId, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.CountryCode, sickConfig.ClassName, roles.UserName, config)
3084 3092
 
3085 3093
 	}
3086 3094