csx 4 years ago
parent
commit
cd756d6f7a
3 changed files with 39 additions and 15 deletions
  1. 2 1
      controllers/gdyb_controller.go
  2. 35 12
      controllers/his_api_controller.go
  3. 2 2
      service/gdyb_service.go

+ 2 - 1
controllers/gdyb_controller.go View File

@@ -298,8 +298,9 @@ func (c *GdybController) PostEight() {
298 298
 	insuplc_admdvs := c.GetString("insuplc_admdvs")
299 299
 	mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
300 300
 	secret_key := c.GetString("secret_key")
301
+	med_type := c.GetString("med_type")
301 302
 
302
-	result := service.Gdyb2207(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key)
303
+	result := service.Gdyb2207(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type)
303 304
 	var dat map[string]interface{}
304 305
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
305 306
 		fmt.Println(dat)

+ 35 - 12
controllers/his_api_controller.go View File

@@ -702,7 +702,8 @@ func (c *HisApiController) GetUploadInfo() {
702 702
 
703 703
 	//if settle_accounts_type == 1 { //日结
704 704
 	//
705
-	//} else { //月结
705
+	//} else
706
+	//{ //月结
706 707
 	//	start_time := c.GetString("start_time")
707 708
 	//	end_time := c.GetString("end_time")
708 709
 	//	timeLayout := "2006-01-02"
@@ -754,22 +755,44 @@ func (c *HisApiController) GetUploadInfo() {
754 755
 	//		var custom models.Custom
755 756
 	//		for _,subItem := range advices{
756 757
 	//			if item == subItem.MedListCodg{
757
-	//
758
-	//
759
-	//
758
+	//				custom.Price =fmt.Sprintf("%.2f", subItem.Price)
759
+	//				custom.MedListCodg = subItem.MedListCodg
760
+	//				custom.Cut = fmt.Sprintf("%.2f", subItem.PrescribingNumber)
761
+	//				custom.DetItemFeeSumamt = fmt.Sprintf("%.2f", subItem.Price*subItem.PrescribingNumber)
762
+	//				custom.FeedetlSn = subItem.FeedetlSn
763
+	//				customs = append(customs,&custom)
760 764
 	//			}
761 765
 	//		}
762 766
 	//	}
763 767
 	//
764 768
 	//
769
+	//	for  _, item := range additionCodes{
770
+	//		var custom models.Custom
771
+	//		for _,subItem := range additions{
772
+	//			if item == subItem.XtHisAddtionConfig.Code{
773
+	//				custom.Price =fmt.Sprintf("%.2f", subItem.Price)
774
+	//				custom.MedListCodg = subItem.XtHisAddtionConfig.Code
775
+	//				custom.Cut = fmt.Sprintf("%.2f", subItem.Count)
776
+	//				custom.DetItemFeeSumamt = fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count))
777
+	//				custom.FeedetlSn = subItem.FeedetlSn
778
+	//				customs = append(customs,&custom)
779
+	//			}
780
+	//		}
781
+	//	}
765 782
 	//
766
-	//
767
-	//
768
-	//
769
-	//
770
-	//
771
-	//
772
-	//
783
+	//	for  _, item := range projectCodes{
784
+	//		var custom models.Custom
785
+	//		for _,subItem := range projects{
786
+	//			if item == subItem.MedListCodg{
787
+	//				custom.Price =fmt.Sprintf("%.2f", subItem.Price)
788
+	//				custom.MedListCodg = subItem.MedListCodg
789
+	//				custom.Cut = fmt.Sprintf("%.2f", subItem.Count)
790
+	//				custom.DetItemFeeSumamt = fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count))
791
+	//				custom.FeedetlSn = subItem.FeedetlSn
792
+	//				customs = append(customs,&custom)
793
+	//			}
794
+	//		}
795
+	//	}
773 796
 	//
774 797
 	//}
775 798
 
@@ -953,7 +976,7 @@ func (c *HisApiController) GetUploadInfo() {
953 976
 				insutype := rf[0].Insutype
954 977
 				api := "http://127.0.0.1:9532/" + "gdyb/eight?cert_no=" + cert_no + "&insutype=" +
955 978
 					insutype + "&psn_no=" + psn_no + "&chrg_bchno=" + chrg_bchno + "&mdtrt_id=" + mdtrt_id +
956
-					"&total=" + allTotal + "&org_name=" + miConfig.OrgName + "&doctor=" + patientPrescription.Doctor + "&fixmedins_code=" + miConfig.Code + "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
979
+					"&total=" + allTotal + "&org_name=" + miConfig.OrgName + "&doctor=" + patientPrescription.Doctor + "&fixmedins_code=" + miConfig.Code + "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&med_type=" + strconv.FormatInt(patientPrescription.RegisterType, 10)
957 980
 				resp, requestErr := http.Get(api)
958 981
 
959 982
 				if requestErr != nil {

+ 2 - 2
service/gdyb_service.go View File

@@ -625,7 +625,7 @@ func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
625 625
 }
626 626
 
627 627
 //  门诊结算
628
-func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string) string {
628
+func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, med_type string) string {
629 629
 	// 生成签名
630 630
 	nonce := GetRandomString(32)
631 631
 	timestamp := time.Now().Unix()
@@ -640,7 +640,7 @@ func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
640 640
 	inputData["psn_no"] = psnNo         // 人员编号 (来自1101接口返回)
641 641
 	inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
642 642
 	inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
643
-	inputData["med_type"] = "11"        // 医疗类别 11 普通门诊  12 门诊挂号
643
+	inputData["med_type"] = med_type    // 医疗类别 11 普通门诊  12 门诊挂号
644 644
 	inputData["medfee_sumamt"] = total  // 医疗费总额
645 645
 	inputData["psn_setlway"] = "01"     // 个人结算方式 01 按项目结 02 按定额结算
646 646
 	inputData["mdtrt_id"] = mdtrtId     // 就诊 ID(来自2201接口返回)