|
@@ -51,16 +51,15 @@ func HisManagerApiRegistRouters() {
|
51
|
51
|
beego.Router("/api/readcard", &HisApiController{}, "get:ReadCard")
|
52
|
52
|
|
53
|
53
|
//beego.Router("/api/testpay", &HisApiController{}, "get:TestPay")
|
54
|
|
-
|
55
|
54
|
beego.Router("/api/presettle/get", &HisApiController{}, "get:GetPreUploadInfo")
|
56
|
55
|
|
57
|
56
|
//beego.Router("/api/settle/get", &HisApiController{}, "get:GetSettleInfo")
|
58
|
57
|
|
59
|
58
|
beego.Router("/api/310", &HisApiController{}, "get:Check310")
|
|
59
|
+
|
60
|
60
|
beego.Router("/api/390", &HisApiController{}, "get:Check390")
|
61
|
61
|
|
62
|
62
|
beego.Router("/api/patient/info", &HisApiController{}, "get:GetPatientInfo")
|
63
|
|
-
|
64
|
63
|
//备案撤销相关接口
|
65
|
64
|
beego.Router("/api/checkcode/get", &HisApiController{}, "get:GetCheckCode")
|
66
|
65
|
beego.Router("/api/uncheckcode/get", &HisApiController{}, "get:UnCheckCode")
|
|
@@ -2565,7 +2564,7 @@ func (c *HisApiController) GetUploadInfo() {
|
2565
|
2564
|
}
|
2566
|
2565
|
}
|
2567
|
2566
|
|
2568
|
|
- allTotal := fmt.Sprintf("%.2f", total)
|
|
2567
|
+ allTotal := fmt.Sprintf("%.4f", total)
|
2569
|
2568
|
if res.Infcode == 0 {
|
2570
|
2569
|
var rf []*ResultFive
|
2571
|
2570
|
json.Unmarshal([]byte(his.Iinfo), &rf)
|
|
@@ -2818,7 +2817,7 @@ func (c *HisApiController) GetUploadInfo() {
|
2818
|
2817
|
|
2819
|
2818
|
} else if tempOrder.ID > 0 {
|
2820
|
2819
|
if tempOrder.IsPre == 1 {
|
2821
|
|
- allTotal := fmt.Sprintf("%.2f", tempOrder.MedfeeSumamt)
|
|
2820
|
+ allTotal := fmt.Sprintf("%.4f", tempOrder.MedfeeSumamt)
|
2822
|
2821
|
var rf []*ResultFive
|
2823
|
2822
|
json.Unmarshal([]byte(his.Iinfo), &rf)
|
2824
|
2823
|
chrg_bchno := tempOrder.Number
|
|
@@ -3933,7 +3932,7 @@ func (c *HisApiController) GetPreUploadInfo() {
|
3933
|
3932
|
}
|
3934
|
3933
|
}
|
3935
|
3934
|
|
3936
|
|
- allTotal := fmt.Sprintf("%.2f", total)
|
|
3935
|
+ allTotal := fmt.Sprintf("%.4f", total)
|
3937
|
3936
|
if res.Infcode == 0 {
|
3938
|
3937
|
var rf []*ResultFive
|
3939
|
3938
|
json.Unmarshal([]byte(his.Iinfo), &rf)
|
|
@@ -4798,9 +4797,9 @@ func (c *HisApiController) GetCheckAccount() {
|
4798
|
4797
|
"&setl_optins=" + "定点医保中心" +
|
4799
|
4798
|
"&stmt_begndate=" + start_time +
|
4800
|
4799
|
"&stm_enddate=" + end_time +
|
4801
|
|
- "&medfee_sumamt=" + fmt.Sprintf("%.2f", medfee_sumamt) +
|
4802
|
|
- "&fund_pay_sumamt=" + fmt.Sprintf("%.2f", fund_pay_sumamt) +
|
4803
|
|
- "&acct_pay=" + fmt.Sprintf("%.2f", acct_pay) +
|
|
4800
|
+ "&medfee_sumamt=" + fmt.Sprintf("%.4f", medfee_sumamt) +
|
|
4801
|
+ "&fund_pay_sumamt=" + fmt.Sprintf("%.4f", fund_pay_sumamt) +
|
|
4802
|
+ "&acct_pay=" + fmt.Sprintf("%.4f", acct_pay) +
|
4804
|
4803
|
"&fixmedins_setl_cnt=" + strconv.FormatInt(fixmedins_setl_cnt, 10) +
|
4805
|
4804
|
"&fixmedins_code=" + miConfig.Code +
|
4806
|
4805
|
"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs +
|
|
@@ -5038,9 +5037,9 @@ func (c *HisApiController) GetCheckDetailAccount() {
|
5038
|
5037
|
str = item.SetlId + " " +
|
5039
|
5038
|
item.MdtrtId + " " +
|
5040
|
5039
|
item.PsnNo + " " +
|
5041
|
|
- fmt.Sprintf("%.2f", item.MedfeeSumamt) + " " +
|
5042
|
|
- fmt.Sprintf("%.2f", item.FundPaySumamt) + " " +
|
5043
|
|
- fmt.Sprintf("%.2f", item.AcctPay) + " " + refd_setl_flag + "\r\n"
|
|
5040
|
+ fmt.Sprintf("%.4f", item.MedfeeSumamt) + " " +
|
|
5041
|
+ fmt.Sprintf("%.4f", item.FundPaySumamt) + " " +
|
|
5042
|
+ fmt.Sprintf("%.4f", item.AcctPay) + " " + refd_setl_flag + "\r\n"
|
5044
|
5043
|
_, err = f.Write([]byte(str))
|
5045
|
5044
|
}
|
5046
|
5045
|
if item.OrderStatus == 3 {
|
|
@@ -5049,18 +5048,18 @@ func (c *HisApiController) GetCheckDetailAccount() {
|
5049
|
5048
|
str = item.SetlId + " " +
|
5050
|
5049
|
item.MdtrtId + " " +
|
5051
|
5050
|
item.PsnNo + " " +
|
5052
|
|
- fmt.Sprintf("%.2f", item.MedfeeSumamt) + " " +
|
5053
|
|
- fmt.Sprintf("%.2f", item.FundPaySumamt) + " " +
|
5054
|
|
- fmt.Sprintf("%.2f", item.AcctPay) + " " + "1" + "\r\n"
|
|
5051
|
+ fmt.Sprintf("%.4f", item.MedfeeSumamt) + " " +
|
|
5052
|
+ fmt.Sprintf("%.4f", item.FundPaySumamt) + " " +
|
|
5053
|
+ fmt.Sprintf("%.4f", item.AcctPay) + " " + "1" + "\r\n"
|
5055
|
5054
|
_, err = f.Write([]byte(str))
|
5056
|
5055
|
|
5057
|
5056
|
var str2 string
|
5058
|
5057
|
str2 = item.SetlId + " " +
|
5059
|
5058
|
item.MdtrtId + " " +
|
5060
|
5059
|
item.PsnNo + " " +
|
5061
|
|
- fmt.Sprintf("%.2f", 0-item.MedfeeSumamt) + " " +
|
5062
|
|
- fmt.Sprintf("%.2f", 0-item.FundPaySumamt) + " " +
|
5063
|
|
- fmt.Sprintf("%.2f", 0-item.AcctPay) + " " + "1" + "\r\n"
|
|
5060
|
+ fmt.Sprintf("%.4f", 0-item.MedfeeSumamt) + " " +
|
|
5061
|
+ fmt.Sprintf("%.4f", 0-item.FundPaySumamt) + " " +
|
|
5062
|
+ fmt.Sprintf("%.4f", 0-item.AcctPay) + " " + "1" + "\r\n"
|
5064
|
5063
|
_, err = f.Write([]byte(str2))
|
5065
|
5064
|
}
|
5066
|
5065
|
|
|
@@ -5115,9 +5114,9 @@ func (c *HisApiController) GetCheckDetailAccount() {
|
5115
|
5114
|
"&setl_optins=" + "定点医保中心" +
|
5116
|
5115
|
"&stmt_begndate=" + start_time +
|
5117
|
5116
|
"&stm_enddate=" + end_time +
|
5118
|
|
- "&medfee_sumamt=" + fmt.Sprintf("%.2f", medfee_sumamt) +
|
5119
|
|
- "&fund_pay_sumamt=" + fmt.Sprintf("%.2f", fund_pay_sumamt) +
|
5120
|
|
- "&cash_payamt=" + fmt.Sprintf("%.2f", psn_cash_pay) +
|
|
5117
|
+ "&medfee_sumamt=" + fmt.Sprintf("%.4f", medfee_sumamt) +
|
|
5118
|
+ "&fund_pay_sumamt=" + fmt.Sprintf("%.4f", fund_pay_sumamt) +
|
|
5119
|
+ "&cash_payamt=" + fmt.Sprintf("%.4f", psn_cash_pay) +
|
5121
|
5120
|
"&fixmedins_setl_cnt=" + strconv.FormatInt(fixmedins_setl_cnt, 10) +
|
5122
|
5121
|
"&fixmedins_code=" + miConfig.Code +
|
5123
|
5122
|
"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs +
|
|
@@ -5184,6 +5183,15 @@ func (c *HisApiController) GetCheckDetailAccount() {
|
5184
|
5183
|
}
|
5185
|
5184
|
}
|
5186
|
5185
|
|
|
5186
|
+type CustomOrderInfo struct {
|
|
5187
|
+ Name string
|
|
5188
|
+ Spec string
|
|
5189
|
+ Unit string
|
|
5190
|
+ Count float64
|
|
5191
|
+ Price float64
|
|
5192
|
+ Total float64
|
|
5193
|
+}
|
|
5194
|
+
|
5187
|
5195
|
func (c *HisApiController) GetSettleAccounts() {
|
5188
|
5196
|
//id, _ := c.GetInt64("id")
|
5189
|
5197
|
//record_time := c.GetString("record_time")
|
|
@@ -5204,6 +5212,38 @@ func (c *HisApiController) GetSettleAccounts() {
|
5204
|
5212
|
his, _ := service.GetHisPatientByNumber(order.MdtrtId)
|
5205
|
5213
|
orderInfos, _ := service.GetHisOrderInfoByNumber(order.Number)
|
5206
|
5214
|
orderInfos_two, _ := service.GetHisOrderInfoByNumberTwo(order.Number)
|
|
5215
|
+ orderInfos_three, _ := service.GetHisOrderInfoByNumberThree(order.Number)
|
|
5216
|
+
|
|
5217
|
+ var orderInfos_four []*models.HisOrderInfo
|
|
5218
|
+ for _, item := range orderInfos_three {
|
|
5219
|
+ if item.HisPrescriptionProject.HisProject.CostClassify == 3 {
|
|
5220
|
+ item.HisPrescriptionProject.IsCheckTeam = 1
|
|
5221
|
+ orderInfos_four = append(orderInfos_four, item)
|
|
5222
|
+
|
|
5223
|
+ }
|
|
5224
|
+ if item.HisPrescriptionProject.HisProject.CostClassify != 3 {
|
|
5225
|
+ item.HisPrescriptionProject.IsCheckTeam = 2
|
|
5226
|
+ orderInfos_two = append(orderInfos_two, item)
|
|
5227
|
+ }
|
|
5228
|
+ }
|
|
5229
|
+
|
|
5230
|
+ new_order_info := RemoveRepeatedTeam(orderInfos_four)
|
|
5231
|
+ var cus_slice []CustomOrderInfo
|
|
5232
|
+ for _, item := range new_order_info {
|
|
5233
|
+ var cus CustomOrderInfo
|
|
5234
|
+ cus.Name = item.HisPrescriptionProject.XtHisProjectTeam.ProjectTeam
|
|
5235
|
+ cus.Unit = ""
|
|
5236
|
+ cus.Spec = ""
|
|
5237
|
+ for _, subItem := range orderInfos_four {
|
|
5238
|
+ if item.HisPrescriptionProject.TeamId == subItem.HisPrescriptionProject.TeamId {
|
|
5239
|
+ cus.Count = cus.Count + subItem.Cnt
|
|
5240
|
+ cus.Price = cus.Price + subItem.Pric
|
|
5241
|
+ cus.Total = cus.Total + (cus.Price * cus.Count)
|
|
5242
|
+ }
|
|
5243
|
+ }
|
|
5244
|
+ cus_slice = append(cus_slice, cus)
|
|
5245
|
+ }
|
|
5246
|
+
|
5207
|
5247
|
orderInfos = append(orderInfos, orderInfos_two...)
|
5208
|
5248
|
//diagnosisConfig, _ := service.FindDiagnoseById(his.Diagnosis)
|
5209
|
5249
|
|
|
@@ -5482,6 +5522,7 @@ func (c *HisApiController) GetSettleAccounts() {
|
5482
|
5522
|
"org_name": miConfig.OrgName,
|
5483
|
5523
|
"org_code": miConfig.Code,
|
5484
|
5524
|
"order_number": order.Number,
|
|
5525
|
+ "check_order_info": cus_slice,
|
5485
|
5526
|
})
|
5486
|
5527
|
}
|
5487
|
5528
|
}
|
|
@@ -6683,12 +6724,12 @@ func ReadFile(filePath string) []byte {
|
6683
|
6724
|
return fd
|
6684
|
6725
|
}
|
6685
|
6726
|
|
6686
|
|
-func RemoveRepeatedCode(arr []string) (newArr []string) {
|
6687
|
|
- newArr = make([]string, 0)
|
|
6727
|
+func RemoveRepeatedTeam(arr []*models.HisOrderInfo) (newArr []*models.HisOrderInfo) {
|
|
6728
|
+ newArr = make([]*models.HisOrderInfo, 0)
|
6688
|
6729
|
for i := 0; i < len(arr); i++ {
|
6689
|
6730
|
repeat := false
|
6690
|
6731
|
for j := i + 1; j < len(arr); j++ {
|
6691
|
|
- if arr[i] == arr[j] {
|
|
6732
|
+ if arr[i].HisPrescriptionProject.TeamId == arr[j].HisPrescriptionProject.TeamId {
|
6692
|
6733
|
repeat = true
|
6693
|
6734
|
break
|
6694
|
6735
|
}
|