Browse Source

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

csx 3 years ago
parent
commit
ecf74b06d0
3 changed files with 25 additions and 19 deletions
  1. 1 1
      controllers/sg/gdyb_controller.go
  2. 2 0
      controllers/sg/his_api_controller.go
  3. 22 18
      service/gdyb_service.go

+ 1 - 1
controllers/sg/gdyb_controller.go View File

@@ -236,7 +236,7 @@ func (c *GdybController) PostFive() {
236 236
 	fmt.Println(respJSON["secret_key"].(string))
237 237
 
238 238
 	result := service.Gdyb2204(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
239
-		respJSON["doctor"].(string), respJSON["dept"].(string), respJSON["fixmedins_code"].(string), respJSON["dept_code"].(string), respJSON["doctor_id"].(string), respJSON["insuplc_admdvs"].(string), respJSON["mdtrtarea_admvs"].(string), respJSON["secret_key"].(string))
239
+		respJSON["doctor"].(string), respJSON["dept"].(string), respJSON["fixmedins_code"].(string), respJSON["dept_code"].(string), respJSON["doctor_id"].(string), respJSON["insuplc_admdvs"].(string), respJSON["mdtrtarea_admvs"].(string), respJSON["secret_key"].(string), respJSON["balance_accounts_type"].(string))
240 240
 
241 241
 	var dat map[string]interface{}
242 242
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {

+ 2 - 0
controllers/sg/his_api_controller.go View File

@@ -3149,6 +3149,8 @@ func (c *HisApiController) GetPreUploadInfo() {
3149 3149
 		data["doctor_id"] = strconv.FormatInt(roles.AdminUserId, 10)
3150 3150
 		data["dept"] = strconv.FormatInt(patientPrescription.Departments, 10)
3151 3151
 		data["fixmedins_code"] = miConfig.Code
3152
+		data["balance_accounts_type"] = strconv.FormatInt(his.BalanceAccountsType, 10)
3153
+
3152 3154
 		if (department.ID == 0 && adminUser.CurrentOrgId == 9919) || (department.ID == 0 && adminUser.CurrentOrgId == 10106) {
3153 3155
 			data["dept_code"] = "15"
3154 3156
 		} else {

+ 22 - 18
service/gdyb_service.go View File

@@ -608,7 +608,7 @@ type Result struct {
608 608
 }
609 609
 
610 610
 //  门诊费用明细信息上传
611
-func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescription, chrg_bchno string, org_name string, doctor string, dept string, fixmedins_code string, dept_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string) string {
611
+func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescription, chrg_bchno string, org_name string, doctor string, dept string, fixmedins_code string, dept_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, balance_accounts_type string) string {
612 612
 	// 生成签名
613 613
 	nonce := GetRandomString(32)
614 614
 	timestamp := time.Now().Unix()
@@ -701,14 +701,13 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
701 701
 	for _, item := range customs {
702 702
 		feedetailInfo := make(map[string]interface{})
703 703
 		feedetailInfo["feedetl_sn"] = item.FeedetlSn
704
-		feedetailInfo["mdtrt_id"] = mdtrtId            // 就诊 ID(来自2201接口返回)
705
-		feedetailInfo["psn_no"] = psnNo                // 人员编号 (来自1101接口返回)
706
-		feedetailInfo["chrg_bchno"] = chrg_bchno       // 收费批次号
707
-		feedetailInfo["dise_codg"] = ""                // 病种编码
708
-		feedetailInfo["rxno"] = ""                     // 处方号
709
-		feedetailInfo["rx_circ_flag"] = "0"            // 外购处方标志
710
-		feedetailInfo["fee_ocur_time"] = timeFormatOne // 费用发生时间
711
-
704
+		feedetailInfo["mdtrt_id"] = mdtrtId                          // 就诊 ID(来自2201接口返回)
705
+		feedetailInfo["psn_no"] = psnNo                              // 人员编号 (来自1101接口返回)
706
+		feedetailInfo["chrg_bchno"] = chrg_bchno                     // 收费批次号
707
+		feedetailInfo["dise_codg"] = ""                              // 病种编码
708
+		feedetailInfo["rxno"] = ""                                   // 处方号
709
+		feedetailInfo["rx_circ_flag"] = "0"                          // 外购处方标志
710
+		feedetailInfo["fee_ocur_time"] = timeFormatOne               // 费用发生时间
712 711
 		feedetailInfo["med_list_codg"] = item.MedListCodg            // 医疗目录编码
713 712
 		feedetailInfo["medins_list_codg"] = fixmedins_code           // 医药机构目录编码
714 713
 		feedetailInfo["det_item_fee_sumamt"] = item.DetItemFeeSumamt // 明细项目费用总额
@@ -726,19 +725,24 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
726 725
 		feedetailInfo["acord_dept_name"] = ""                        // 受单科室名称
727 726
 		feedetailInfo["orders_dr_code"] = ""                         // 受单医生编码
728 727
 		feedetailInfo["orders_dr_name"] = ""                         // 受单医生姓名
728
+		if balance_accounts_type == "8" {
729
+			feedetailInfo["hosp_appr_flag"] = "2" // 医院审批标志
730
+		} else {
729 731
 
730
-		if item.HospApprFlag != -1 {
731
-			if item.HospApprFlag == 1 {
732
-				feedetailInfo["hosp_appr_flag"] = "0" // 医院审批标志
733
-			} else if item.HospApprFlag == 2 {
734
-				feedetailInfo["hosp_appr_flag"] = "1" // 医院审批标志
735
-			} else if item.HospApprFlag == 3 {
736
-				feedetailInfo["hosp_appr_flag"] = "2" // 医院审批标志
732
+			if item.HospApprFlag != -1 {
733
+				if item.HospApprFlag == 1 {
734
+					feedetailInfo["hosp_appr_flag"] = "0" // 医院审批标志
735
+				} else if item.HospApprFlag == 2 {
736
+					feedetailInfo["hosp_appr_flag"] = "1" // 医院审批标志
737
+				} else if item.HospApprFlag == 3 {
738
+					feedetailInfo["hosp_appr_flag"] = "2" // 医院审批标志
739
+				} else {
740
+					feedetailInfo["hosp_appr_flag"] = "1" // 医院审批标志
741
+				}
737 742
 			} else {
738 743
 				feedetailInfo["hosp_appr_flag"] = "1" // 医院审批标志
739 744
 			}
740
-		} else {
741
-			feedetailInfo["hosp_appr_flag"] = "1" // 医院审批标志
745
+
742 746
 		}
743 747
 
744 748
 		feedetailInfo["tcmdrug_used_way"] = "" // 中药使用方式