Browse Source

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

csx 3 years ago
parent
commit
81b4bab6b1
4 changed files with 24 additions and 13 deletions
  1. 1 1
      conf/app.conf
  2. 5 5
      controllers/sg/his_api_controller.go
  3. 17 4
      service/gdyb_service.go
  4. 1 3
      service/his_service.go

+ 1 - 1
conf/app.conf View File

@@ -45,7 +45,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
45 45
 
46 46
 
47 47
 [prod]
48
-org_id = 10028
48
+org_id =
49 49
 mobile_token_expiration_second = 86400
50 50
 httpdomain = https://api.xt.kuyicloud.com
51 51
 sso_domain = https://sso.kuyicloud.com

+ 5 - 5
controllers/sg/his_api_controller.go View File

@@ -2285,9 +2285,9 @@ func (c *HisApiController) GetUploadInfo() {
2285 2285
 
2286 2286
 		} else {
2287 2287
 			if miConfig.InsuplcAdmdvs == "440781" { //
2288
-				result, requestLog = 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.ContentCode, sickConfig.ClassName, roles.UserName, config)
2288
+				result, requestLog = service.Gdyb2203A(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.DoctorNumber, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, roles.UserName, config)
2289 2289
 			} else {
2290
-				result, requestLog = 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.ContentCode, sickConfig.ClassName, roles.UserName, config)
2290
+				result, requestLog = service.Gdyb2203(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.DoctorNumber, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, roles.UserName, config)
2291 2291
 			}
2292 2292
 			saveLog(result, requestLog, "2203", "上传就诊信息")
2293 2293
 			var respJSON2 map[string]interface{}
@@ -2384,7 +2384,7 @@ func (c *HisApiController) GetUploadInfo() {
2384 2384
 			data["chrg_bchno"] = chrg_bchno
2385 2385
 			data["org_name"] = miConfig.OrgName
2386 2386
 			data["doctor"] = roles.UserName
2387
-			data["doctor_id"] = strconv.FormatInt(roles.AdminUserId, 10)
2387
+			data["doctor_id"] = roles.DoctorNumber
2388 2388
 			data["dept"] = strconv.FormatInt(patientPrescription.Departments, 10)
2389 2389
 			data["fixmedins_code"] = miConfig.Code
2390 2390
 			if (department.ID == 0 && adminUser.CurrentOrgId == 9919) || (department.ID == 0 && adminUser.CurrentOrgId == 10106) {
@@ -3683,9 +3683,9 @@ func (c *HisApiController) GetPreUploadInfo() {
3683 3683
 		var result string
3684 3684
 		var requestLog string
3685 3685
 		if miConfig.InsuplcAdmdvs == "440781" { //
3686
-			result, requestLog = 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.ContentCode, sickConfig.ClassName, roles.UserName, config)
3686
+			result, requestLog = service.Gdyb2203A(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.DoctorNumber, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, roles.UserName, config)
3687 3687
 		} else {
3688
-			result, requestLog = 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)
3688
+			result, requestLog = service.Gdyb2203(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.DoctorNumber, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.CountryCode, sickConfig.ClassName, roles.UserName, config)
3689 3689
 			saveLog(result, requestLog, "2203", "上传就诊信息")
3690 3690
 			var respJSON2 map[string]interface{}
3691 3691
 			if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {

+ 17 - 4
service/gdyb_service.go View File

@@ -517,7 +517,7 @@ func Gdyb2202(psnNo string, mdtrtId string, ipt_otp_no string, org_name string,
517 517
 }
518 518
 
519 519
 // 门诊就诊信息上传
520
-func Gdyb2203(psnNo string, mdtrtId string, doctor string, department string, org_name string, med_type string, doctor_id int64, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, sick_code string, sick_name string, dept string, config []*models.HisXtDiagnoseConfig) (string, string) {
520
+func Gdyb2203(psnNo string, mdtrtId string, doctor string, department string, org_name string, med_type string, doctor_id string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, sick_code string, sick_name string, dept string, config []*models.HisXtDiagnoseConfig) (string, string) {
521 521
 	// 生成签名
522 522
 	nonce := GetRandomString(32)
523 523
 	timestamp := time.Now().Unix()
@@ -626,7 +626,7 @@ func Gdyb2203(psnNo string, mdtrtId string, doctor string, department string, or
626 626
 }
627 627
 
628 628
 // 门诊就诊信息上传
629
-func Gdyb2203A(psnNo string, mdtrtId string, doctor string, department string, org_name string, med_type string, doctor_id int64, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, sick_code string, sick_name string, dept string, config []*models.HisXtDiagnoseConfig) (string, string) {
629
+func Gdyb2203A(psnNo string, mdtrtId string, doctor string, department string, org_name string, med_type string, doctor_id string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, sick_code string, sick_name string, dept string, config []*models.HisXtDiagnoseConfig) (string, string) {
630 630
 	// 生成签名
631 631
 	nonce := GetRandomString(32)
632 632
 	timestamp := time.Now().Unix()
@@ -745,6 +745,8 @@ type Custom struct {
745 745
 	MedListCodg      string
746 746
 	LmtUsedFlag      int64
747 747
 	HospApprFlag     int64
748
+	DoctorNumber     string
749
+	DoctorName       string
748 750
 }
749 751
 
750 752
 type RequestResult struct {
@@ -807,11 +809,14 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
807 809
 	var customs []*Custom
808 810
 
809 811
 	for _, item := range hisPrescription {
812
+		role, _ := GetAdminUserInfoByID(item.UserOrgId, item.Creator)
813
+
810 814
 		if item.Type == 1 { //药品
811 815
 			for _, subItem := range item.HisDoctorAdviceInfo {
812 816
 				if len(subItem.BaseDrugLib.MedicalInsuranceNumber) > 0 {
813 817
 					//var randNum int
814 818
 					//randNum = rand.Intn(10000) + 1000
819
+					role, _ := GetAdminUserInfoByID(item.UserOrgId, item.Creator)
815 820
 					cus := &Custom{
816 821
 						DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*subItem.PrescribingNumber),
817 822
 						Cut:              fmt.Sprintf("%.2f", subItem.PrescribingNumber),
@@ -819,6 +824,8 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
819 824
 						Price:            fmt.Sprintf("%.2f", subItem.Price),
820 825
 						MedListCodg:      subItem.BaseDrugLib.MedicalInsuranceNumber,
821 826
 						HospApprFlag:     subItem.HospApprFlag,
827
+						DoctorNumber:     role.DoctorNumber,
828
+						DoctorName:       role.UserName,
822 829
 					}
823 830
 
824 831
 					customs = append(customs, cus)
@@ -839,6 +846,8 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
839 846
 							FeedetlSn:        subItem.FeedetlSn,
840 847
 							Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
841 848
 							MedListCodg:      subItem.HisProject.MedicalCode,
849
+							DoctorNumber:     role.DoctorNumber,
850
+							DoctorName:       role.UserName,
842 851
 							HospApprFlag:     -1,
843 852
 						}
844 853
 						customs = append(customs, cus)
@@ -853,6 +862,8 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
853 862
 							Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
854 863
 							MedListCodg:      subItem.GoodInfo.MedicalInsuranceNumber,
855 864
 							HospApprFlag:     -1,
865
+							DoctorNumber:     role.DoctorNumber,
866
+							DoctorName:       role.UserName,
856 867
 						}
857 868
 						customs = append(customs, cus)
858 869
 					}
@@ -871,6 +882,8 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
871 882
 					Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
872 883
 					MedListCodg:      subItem.XtHisAddtionConfig.Code,
873 884
 					HospApprFlag:     -1,
885
+					DoctorNumber:     role.DoctorNumber,
886
+					DoctorName:       role.UserName,
874 887
 				}
875 888
 				customs = append(customs, cus)
876 889
 			}
@@ -905,8 +918,8 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
905 918
 		feedetailInfo["medc_way_dscr"] = ""                          // 用药途径描述
906 919
 		feedetailInfo["bilg_dept_codg"] = dept_code                  // 开单科室编码
907 920
 		feedetailInfo["bilg_dept_name"] = dept                       // 开单科室名称
908
-		feedetailInfo["bilg_dr_codg"] = doctor_id                    // 开单医生编码
909
-		feedetailInfo["bilg_dr_name"] = doctor                       // 开单医师姓名
921
+		feedetailInfo["bilg_dr_codg"] = item.DoctorNumber            // 开单医生编码
922
+		feedetailInfo["bilg_dr_name"] = item.DoctorName              // 开单医师姓名
910 923
 		feedetailInfo["acord_dept_codg"] = ""                        // 受单科室编码
911 924
 		feedetailInfo["acord_dept_name"] = ""                        // 受单科室名称
912 925
 		feedetailInfo["orders_dr_code"] = ""                         // 受单医生编码

+ 1 - 3
service/his_service.go View File

@@ -1132,9 +1132,7 @@ func GetPrescriptionByIds(ids []string, org_id int64) (prescription []*models.Hi
1132 1132
 		}).
1133 1133
 		Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
1134 1134
 			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject").Preload("GoodInfo", "status=1")
1135
-		}).Preload("TempHisOrder", func(db *gorm.DB) *gorm.DB {
1136
-		return db.Where("status = 1 AND user_org_id = ?", org_id)
1137
-	}).
1135
+		}).
1138 1136
 		Where("id in (?) AND user_org_id = ? AND status = 1", ids, org_id).
1139 1137
 		Find(&prescription).Error
1140 1138