|
@@ -1,8 +1,18 @@
|
1
|
1
|
package main
|
2
|
2
|
|
3
|
3
|
import (
|
|
4
|
+ "bytes"
|
|
5
|
+ "encoding/json"
|
|
6
|
+ "fmt"
|
|
7
|
+ "gdyb/models"
|
4
|
8
|
_ "gdyb/routers"
|
5
|
9
|
"gdyb/service"
|
|
10
|
+ "github.com/shopspring/decimal"
|
|
11
|
+ "io/ioutil"
|
|
12
|
+ "net/http"
|
|
13
|
+ "strconv"
|
|
14
|
+ "strings"
|
|
15
|
+ "time"
|
6
|
16
|
|
7
|
17
|
"github.com/astaxie/beego"
|
8
|
18
|
//"github.com/qiniu/api.v7/auth/qbox"
|
|
@@ -15,18 +25,21 @@ import (
|
15
|
25
|
|
16
|
26
|
func init() {
|
17
|
27
|
service.ConnectDB()
|
18
|
|
- org_id, _ := beego.AppConfig.Int64("org_id")
|
19
|
|
- miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
|
20
|
|
- //CreateLog(miConfig)
|
21
|
|
- //UploadLog(miConfig)
|
22
|
|
- if org_id == 10191 {
|
23
|
|
- service.GetFjAuthorizationInfo(miConfig.Code)
|
24
|
|
- }
|
|
28
|
+ //org_id, _ := beego.AppConfig.Int64("org_id")
|
|
29
|
+ //miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
|
|
30
|
+ ////CreateLog(miConfig)
|
|
31
|
+ ////UploadLog(miConfig)
|
|
32
|
+ //if org_id == 10191 {
|
|
33
|
+ // service.GetFjAuthorizationInfo(miConfig.Code)
|
|
34
|
+ //}
|
25
|
35
|
|
26
|
36
|
}
|
27
|
37
|
func main() {
|
28
|
|
- service.AutoCreateStock()
|
|
38
|
+ //service.AutoCreateStock()
|
|
39
|
+ //service.AutoUploadData
|
|
40
|
+ //GetBatchSettleList()
|
29
|
41
|
beego.Run()
|
|
42
|
+
|
30
|
43
|
}
|
31
|
44
|
|
32
|
45
|
type CustomFundPay struct {
|
|
@@ -47,6 +60,815 @@ type ResultSeventeen struct {
|
47
|
60
|
WarnInfo string `json:"warn_info"`
|
48
|
61
|
}
|
49
|
62
|
|
|
63
|
+func GetBatchSettleList() {
|
|
64
|
+
|
|
65
|
+ org_id, _ := beego.AppConfig.Int64("org_id")
|
|
66
|
+
|
|
67
|
+ orders, _ := service.GetAllHisOrder(org_id)
|
|
68
|
+ for _, item := range orders {
|
|
69
|
+ order_id := item.ID
|
|
70
|
+ order, _ := service.GetHisOrderByIDTwo(order_id)
|
|
71
|
+ roles, _ := service.GetDoctorListTwo(org_id)
|
|
72
|
+ his, _ := service.GetHisPatientByNumber(order.MdtrtId)
|
|
73
|
+ admin, _ := service.GetAdminUserByUserID(roles[0].AdminUserId)
|
|
74
|
+ curRoles, _ := service.GetAdminUserInfoByID(org_id, 2495)
|
|
75
|
+ depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
|
|
76
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
|
|
77
|
+
|
|
78
|
+ pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
|
|
79
|
+
|
|
80
|
+ doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
|
|
81
|
+
|
|
82
|
+ if order.ID == 0 {
|
|
83
|
+ return
|
|
84
|
+ }
|
|
85
|
+ if his.BalanceAccountsType == 2 {
|
|
86
|
+ continue
|
|
87
|
+ }
|
|
88
|
+ struct4101 := service.Struct4101{
|
|
89
|
+ PsnNo: order.PsnNo,
|
|
90
|
+ MdtrtId: order.MdtrtId,
|
|
91
|
+ SetlId: order.SetlId,
|
|
92
|
+ PsnName: order.PsnName,
|
|
93
|
+ Gend: order.Gend,
|
|
94
|
+ Brdy: his.Brdy,
|
|
95
|
+ Age: his.Age,
|
|
96
|
+ Naty: order.Naty,
|
|
97
|
+ PatnCertType: "01",
|
|
98
|
+ Certno: order.Certno,
|
|
99
|
+ Prfs: "90",
|
|
100
|
+ ConerName: roles[0].UserName,
|
|
101
|
+ PatnRlts: "99",
|
|
102
|
+ ConerAddr: miConfig.OrgName,
|
|
103
|
+ ConerTel: admin.Mobile,
|
|
104
|
+ HiType: order.Insutype,
|
|
105
|
+ Insuplc: his.InsuplcAdmdvs,
|
|
106
|
+ MaindiagFlag: "1",
|
|
107
|
+ BillCode: order.SetlId,
|
|
108
|
+ BillNo: order.SetlId,
|
|
109
|
+ BizSn: order.Number,
|
|
110
|
+ PsnSelfPay: order.PsnPartAmt,
|
|
111
|
+ PsnOwnPay: order.PsnPartAmt,
|
|
112
|
+ AcctPay: order.AcctPay,
|
|
113
|
+ PsnCashpay: order.PsnCashPay,
|
|
114
|
+ HiPaymtd: "1",
|
|
115
|
+ Hsorg: his.InsuplcAdmdvs,
|
|
116
|
+ HsorgOpter: his.InsuplcAdmdvs,
|
|
117
|
+ MedinsFillPsn: curRoles.UserName,
|
|
118
|
+ MedinsFillDept: depart.Name,
|
|
119
|
+ IptMedType: "2",
|
|
120
|
+ }
|
|
121
|
+ struct4101.SetlBegnDate = order.SetlTime
|
|
122
|
+ struct4101.SetlEndDate = order.SetlTime
|
|
123
|
+ //if order.SettleType == 1 {
|
|
124
|
+ // t := time.Unix(int64(order.SettleAccountsDate), 0)
|
|
125
|
+ // dateStr := t.Format("2006-01-02")
|
|
126
|
+ // struct4101.SetlBegnDate = dateStr
|
|
127
|
+ // struct4101.SetlEndDate = dateStr
|
|
128
|
+ //} else {
|
|
129
|
+ // t := time.Unix(int64(order.SettleStartTime), 0)
|
|
130
|
+ // t2 := time.Unix(int64(order.SettleEndTime), 0)
|
|
131
|
+ // dateStartStr := t.Format("2006-01-02")
|
|
132
|
+ // dateEndStr := t2.Format("2006-01-02")
|
|
133
|
+ // struct4101.SetlBegnDate = dateStartStr
|
|
134
|
+ // struct4101.SetlEndDate = dateEndStr
|
|
135
|
+ //}
|
|
136
|
+
|
|
137
|
+ var rf []CustomFundPay
|
|
138
|
+ json.Unmarshal([]byte(order.SetlDetail), &rf)
|
|
139
|
+
|
|
140
|
+ var tempFunPays []service.CustomStruct
|
|
141
|
+ var tempFunPay610100 service.CustomStruct
|
|
142
|
+
|
|
143
|
+ for _, item := range rf {
|
|
144
|
+ if item.FundPayType == "610100" {
|
|
145
|
+ tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
|
|
146
|
+ tempFunPay610100.FundPayType = item.FundPayType
|
|
147
|
+ } else {
|
|
148
|
+ var tempFunPay service.CustomStruct
|
|
149
|
+ tempFunPay.FundPayamt = item.FundPayamt
|
|
150
|
+ tempFunPay.FundPayType = item.FundPayType
|
|
151
|
+ tempFunPays = append(tempFunPays, tempFunPay)
|
|
152
|
+ }
|
|
153
|
+ }
|
|
154
|
+ tempFunPays = append(tempFunPays, tempFunPay610100)
|
|
155
|
+ struct4101.CustomStruct = tempFunPays
|
|
156
|
+
|
|
157
|
+ var tempDiaginfos []service.DiaginfoStructTwo
|
|
158
|
+ var tempOpspdiseinfo2 service.OpspdiseinfoStruct
|
|
159
|
+ var tempOpspdiseinfos []service.OpspdiseinfoStruct
|
|
160
|
+
|
|
161
|
+ diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
|
162
|
+ var config []*models.HisXtDiagnoseConfig
|
|
163
|
+ for _, item := range diagnosis_ids {
|
|
164
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
165
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
166
|
+ config = append(config, &diagnosisConfig)
|
|
167
|
+ }
|
|
168
|
+
|
|
169
|
+ for index, item := range config {
|
|
170
|
+ if index == 0 {
|
|
171
|
+ var tempDiaginfo service.DiaginfoStructTwo
|
|
172
|
+ tempDiaginfo.DiagCode = item.CountryCode
|
|
173
|
+ tempDiaginfo.DiagName = item.CountryContentName
|
|
174
|
+ tempDiaginfo.DiagType = "1"
|
|
175
|
+ tempDiaginfo.MaindiagFlag = "1"
|
|
176
|
+ tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
|
177
|
+ } else {
|
|
178
|
+
|
|
179
|
+ var tempDiaginfo service.DiaginfoStructTwo
|
|
180
|
+ tempDiaginfo.DiagCode = item.CountryCode
|
|
181
|
+ tempDiaginfo.DiagName = item.CountryContentName
|
|
182
|
+ tempDiaginfo.DiagType = "2"
|
|
183
|
+ tempDiaginfo.MaindiagFlag = "0"
|
|
184
|
+ tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
|
185
|
+ }
|
|
186
|
+ }
|
|
187
|
+ struct4101.Diseinfo = tempDiaginfos
|
|
188
|
+
|
|
189
|
+ sickConfigTwo, _ := service.FindSickById(his.SickType)
|
|
190
|
+ tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
|
|
191
|
+ tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
|
|
192
|
+ tempOpspdiseinfo2.OprnOprtCode = ""
|
|
193
|
+ tempOpspdiseinfo2.OprnOprtName = ""
|
|
194
|
+ tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
|
|
195
|
+ struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
|
|
196
|
+
|
|
197
|
+ var iteminfo service.IteminfoStruct
|
|
198
|
+
|
|
199
|
+ var bedCostTotal float64 = 0 //床位总费
|
|
200
|
+ var bedCostSelfTotal float64 = 0 //床位自费
|
|
201
|
+ var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
|
|
202
|
+
|
|
203
|
+ var examineCostTotal float64 = 0 //诊查总费
|
|
204
|
+ var examineCostSelfTotal float64 = 0 //诊查自费
|
|
205
|
+ var examineCostPartSelfTotal float64 = 0 //诊查部分项目自费
|
|
206
|
+
|
|
207
|
+ var nursingCostTotal float64 = 0 //护理总费
|
|
208
|
+ var nursingCostSelfTotal float64 = 0 //护理自费
|
|
209
|
+ var nursingCostPartSelfTotal float64 = 0 //护理部分项目自费
|
|
210
|
+
|
|
211
|
+ var chineseMedicineCostTotal float64 = 0 //中成药
|
|
212
|
+ var chineseMedicineCostSelfTotal float64 = 0 //中成药
|
|
213
|
+ var chineseMedicineCostPartSelfTotal float64 = 0 //中成药
|
|
214
|
+
|
|
215
|
+ var commonlyTreatmentCostTotal float64 = 0 //一般诊疗费
|
|
216
|
+ var commonlyTreatmentCostSelfTotal float64 = 0 //一般诊疗费
|
|
217
|
+ var commonlyTreatmentCostPartSelfTotal float64 = 0 //一般诊疗费
|
|
218
|
+
|
|
219
|
+ var registerCostTotal float64 = 0 //一般诊疗费
|
|
220
|
+ var registerCostSelfTotal float64 = 0 //一般诊疗费
|
|
221
|
+ var registerPartSelfTotal float64 = 0 //一般诊疗费
|
|
222
|
+
|
|
223
|
+ var operationCostTotal float64 = 0 //手术费
|
|
224
|
+ var operationCostSelfTotal float64 = 0 //手术费
|
|
225
|
+ var operationCostPartSelfTotal float64 = 0 //手术费
|
|
226
|
+
|
|
227
|
+ var otherCostTotal float64 = 0 //其他费用
|
|
228
|
+ var otherCostSelfTotal float64 = 0 //其他费用
|
|
229
|
+ var otherCostPartSelfTotal float64 = 0 //其他费用
|
|
230
|
+
|
|
231
|
+ var materialCostTotal float64 = 0 //材料费
|
|
232
|
+ var materialCostSelfTotal float64 = 0 //材料费
|
|
233
|
+ var materialCostPartSelfTotal float64 = 0 //材料费
|
|
234
|
+
|
|
235
|
+ var westernMedicineCostTotal float64 = 0 //西药费
|
|
236
|
+ var westernMedicineCostSelfTotal float64 = 0 //西药费
|
|
237
|
+ var westernMedicineCostPartSelfTotal float64 = 0 //西药费
|
|
238
|
+
|
|
239
|
+ var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
|
|
240
|
+ var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
|
|
241
|
+ var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
|
|
242
|
+
|
|
243
|
+ var checkCostTotal float64 = 0 //检查费
|
|
244
|
+ var checkCostSelfTotal float64 = 0 //检查费
|
|
245
|
+ var checkCostPartSelfTotal float64 = 0 //检查费
|
|
246
|
+
|
|
247
|
+ var laboratoryCostTotal float64 = 0 //化验费
|
|
248
|
+ var laboratoryCostSelfTotal float64 = 0 //化验费
|
|
249
|
+ var laboratoryCostPartSelfTotal float64 = 0 //化验费
|
|
250
|
+
|
|
251
|
+ var treatCostTotal float64 = 0 //治疗费用
|
|
252
|
+ var treatCostSelfTotal float64 = 0 //治疗费用
|
|
253
|
+ var treatCostPartSelfTotal float64 = 0 //治疗费用
|
|
254
|
+
|
|
255
|
+ decimal.DivisionPrecision = 2
|
|
256
|
+
|
|
257
|
+ var bed_fulamt_ownpay_amt float64 = 0
|
|
258
|
+
|
|
259
|
+ var examine_fulamt_ownpay_amt float64 = 0
|
|
260
|
+
|
|
261
|
+ var nursing_fulamt_ownpay_amt float64 = 0
|
|
262
|
+
|
|
263
|
+ var chinese_medicine_fulamt_ownpay_amt float64 = 0
|
|
264
|
+
|
|
265
|
+ var commonly_treatment_fulamt_ownpay_amt float64 = 0
|
|
266
|
+
|
|
267
|
+ var register_fulamt_ownpay_amt float64 = 0
|
|
268
|
+
|
|
269
|
+ var operation_fulamt_ownpay_amt float64 = 0
|
|
270
|
+ var other_fulamt_ownpay_amt float64 = 0
|
|
271
|
+ var westernMedicine_fulamt_ownpay_amt float64 = 0
|
|
272
|
+ var chineseTraditional_fulamt_ownpay_amt float64 = 0
|
|
273
|
+ var check_fulamt_ownpay_amt float64 = 0
|
|
274
|
+ var material_fulamt_ownpay_amt float64 = 0
|
|
275
|
+ var laboratory_fulamt_ownpay_amt float64 = 0
|
|
276
|
+ var treat_fulamt_ownpay_amt float64 = 0
|
|
277
|
+
|
|
278
|
+ var bed_claa_sunmfee float64 = 0
|
|
279
|
+ var bed_clab_amt float64 = 0
|
|
280
|
+ var bed_other_amt float64 = 0
|
|
281
|
+
|
|
282
|
+ var examine_claa_sunmfee float64 = 0
|
|
283
|
+ var examine_clab_amt float64 = 0
|
|
284
|
+ var examine_other_amt float64 = 0
|
|
285
|
+
|
|
286
|
+ var nursing_claa_sunmfee float64 = 0
|
|
287
|
+ var nursing_clab_amt float64 = 0
|
|
288
|
+ var nursing_other_amt float64 = 0
|
|
289
|
+
|
|
290
|
+ var chinese_medicine_claa_sunmfee float64 = 0
|
|
291
|
+ var chinese_medicine_clab_amt float64 = 0
|
|
292
|
+ var chinese_medicine_other_amt float64 = 0
|
|
293
|
+
|
|
294
|
+ var commonly_treatment_claa_sunmfee float64 = 0
|
|
295
|
+ var commonly_treatment_clab_amt float64 = 0
|
|
296
|
+ var commonly_treatment_other_amt float64 = 0
|
|
297
|
+
|
|
298
|
+ var operation_claa_sunmfee float64 = 0
|
|
299
|
+ var operation_clab_amt float64 = 0
|
|
300
|
+ var operation_other_amt float64 = 0
|
|
301
|
+
|
|
302
|
+ var other_claa_sunmfee float64 = 0
|
|
303
|
+ var other_clab_amt float64 = 0
|
|
304
|
+ var other_other_amt float64 = 0
|
|
305
|
+
|
|
306
|
+ var westernMedicine_claa_sunmfee float64 = 0
|
|
307
|
+ var westernMedicine_clab_amt float64 = 0
|
|
308
|
+ var westernMedicine_other_amt float64 = 0
|
|
309
|
+
|
|
310
|
+ var chineseTraditional_claa_sunmfee float64 = 0
|
|
311
|
+ var chineseTraditional_clab_amt float64 = 0
|
|
312
|
+ var chineseTraditional_other_amt float64 = 0
|
|
313
|
+
|
|
314
|
+ var check_claa_sunmfee float64 = 0
|
|
315
|
+ var check_clab_amt float64 = 0
|
|
316
|
+ var check_other_amt float64 = 0
|
|
317
|
+
|
|
318
|
+ var material_claa_sunmfee float64 = 0
|
|
319
|
+ var material_clab_amt float64 = 0
|
|
320
|
+ var material_other_amt float64 = 0
|
|
321
|
+
|
|
322
|
+ var laboratory_claa_sunmfee float64 = 0
|
|
323
|
+ var laboratory_clab_amt float64 = 0
|
|
324
|
+ var laboratory_other_amt float64 = 0
|
|
325
|
+
|
|
326
|
+ var treat_claa_sunmfee float64 = 0
|
|
327
|
+ var treat_clab_amt float64 = 0
|
|
328
|
+ var treat_other_amt float64 = 0
|
|
329
|
+
|
|
330
|
+ var register_claa_sunmfee float64 = 0
|
|
331
|
+ var register_clab_amt float64 = 0
|
|
332
|
+ var register_other_amt float64 = 0
|
|
333
|
+
|
|
334
|
+ for _, item := range order.HisOrderInfo {
|
|
335
|
+ if item.MedChrgitmType == "01" { //床位费
|
|
336
|
+ bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
337
|
+ bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
338
|
+ bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
339
|
+ bed_fulamt_ownpay_amt, _ = decimal.NewFromFloat(bed_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
340
|
+ if item.ChrgitmLv == "1" {
|
|
341
|
+ bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
342
|
+ }
|
|
343
|
+ if item.ChrgitmLv == "2" {
|
|
344
|
+ bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
345
|
+
|
|
346
|
+ }
|
|
347
|
+ if item.ChrgitmLv == "3" {
|
|
348
|
+ bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
349
|
+ }
|
|
350
|
+
|
|
351
|
+ }
|
|
352
|
+
|
|
353
|
+ if item.MedChrgitmType == "02" { //诊查
|
|
354
|
+ examineCostTotal, _ = decimal.NewFromFloat(examineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
355
|
+ examineCostSelfTotal, _ = decimal.NewFromFloat(examineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
356
|
+ examineCostPartSelfTotal, _ = decimal.NewFromFloat(examineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
357
|
+ examine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(examine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
358
|
+ if item.ChrgitmLv == "1" {
|
|
359
|
+ examine_claa_sunmfee, _ = decimal.NewFromFloat(examine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
360
|
+ }
|
|
361
|
+ if item.ChrgitmLv == "2" {
|
|
362
|
+ examine_clab_amt, _ = decimal.NewFromFloat(examine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
363
|
+
|
|
364
|
+ }
|
|
365
|
+ if item.ChrgitmLv == "3" {
|
|
366
|
+ examine_other_amt, _ = decimal.NewFromFloat(examine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
367
|
+ }
|
|
368
|
+
|
|
369
|
+ }
|
|
370
|
+
|
|
371
|
+ if item.MedChrgitmType == "03" { //检查费
|
|
372
|
+ checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
373
|
+ checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
374
|
+ checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
375
|
+ check_fulamt_ownpay_amt, _ = decimal.NewFromFloat(check_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
376
|
+ if item.ChrgitmLv == "1" {
|
|
377
|
+
|
|
378
|
+ check_claa_sunmfee, _ = decimal.NewFromFloat(check_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
379
|
+
|
|
380
|
+ }
|
|
381
|
+ if item.ChrgitmLv == "2" {
|
|
382
|
+ check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
383
|
+
|
|
384
|
+ }
|
|
385
|
+ if item.ChrgitmLv == "3" {
|
|
386
|
+ check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
387
|
+ }
|
|
388
|
+ }
|
|
389
|
+
|
|
390
|
+ if item.MedChrgitmType == "04" { //化验费
|
|
391
|
+ laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
392
|
+ laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
393
|
+ laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
394
|
+ laboratory_fulamt_ownpay_amt, _ = decimal.NewFromFloat(laboratory_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
395
|
+ if item.ChrgitmLv == "1" {
|
|
396
|
+
|
|
397
|
+ laboratory_claa_sunmfee, _ = decimal.NewFromFloat(laboratory_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
398
|
+
|
|
399
|
+ }
|
|
400
|
+ if item.ChrgitmLv == "2" {
|
|
401
|
+ laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
402
|
+
|
|
403
|
+ }
|
|
404
|
+ if item.ChrgitmLv == "3" {
|
|
405
|
+ laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
406
|
+ }
|
|
407
|
+ }
|
|
408
|
+
|
|
409
|
+ if item.MedChrgitmType == "05" { //治疗费
|
|
410
|
+ treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
411
|
+ treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
412
|
+ treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
413
|
+ treat_fulamt_ownpay_amt, _ = decimal.NewFromFloat(treat_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
414
|
+ if item.ChrgitmLv == "1" {
|
|
415
|
+
|
|
416
|
+ treat_claa_sunmfee, _ = decimal.NewFromFloat(treat_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
417
|
+
|
|
418
|
+ }
|
|
419
|
+ if item.ChrgitmLv == "2" {
|
|
420
|
+ treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
421
|
+
|
|
422
|
+ }
|
|
423
|
+ if item.ChrgitmLv == "3" {
|
|
424
|
+ treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
425
|
+ }
|
|
426
|
+ }
|
|
427
|
+
|
|
428
|
+ if item.MedChrgitmType == "06" { //手术费
|
|
429
|
+ operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
430
|
+ operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
431
|
+ operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
432
|
+ operation_fulamt_ownpay_amt, _ = decimal.NewFromFloat(operation_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
433
|
+
|
|
434
|
+ if item.ChrgitmLv == "1" {
|
|
435
|
+
|
|
436
|
+ operation_claa_sunmfee, _ = decimal.NewFromFloat(operation_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
437
|
+
|
|
438
|
+ }
|
|
439
|
+ if item.ChrgitmLv == "2" {
|
|
440
|
+ operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
441
|
+
|
|
442
|
+ }
|
|
443
|
+ if item.ChrgitmLv == "3" {
|
|
444
|
+ operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
445
|
+ }
|
|
446
|
+ }
|
|
447
|
+
|
|
448
|
+ if item.MedChrgitmType == "07" { //手术费
|
|
449
|
+ nursingCostTotal, _ = decimal.NewFromFloat(nursingCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
450
|
+ nursingCostSelfTotal, _ = decimal.NewFromFloat(nursingCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
451
|
+ nursingCostPartSelfTotal, _ = decimal.NewFromFloat(nursingCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
452
|
+ nursing_fulamt_ownpay_amt, _ = decimal.NewFromFloat(nursing_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
453
|
+
|
|
454
|
+ if item.ChrgitmLv == "1" {
|
|
455
|
+
|
|
456
|
+ nursing_claa_sunmfee, _ = decimal.NewFromFloat(nursing_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
457
|
+
|
|
458
|
+ }
|
|
459
|
+ if item.ChrgitmLv == "2" {
|
|
460
|
+ nursing_clab_amt, _ = decimal.NewFromFloat(nursing_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
461
|
+
|
|
462
|
+ }
|
|
463
|
+ if item.ChrgitmLv == "3" {
|
|
464
|
+ nursing_other_amt, _ = decimal.NewFromFloat(nursing_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
465
|
+ }
|
|
466
|
+ }
|
|
467
|
+
|
|
468
|
+ if item.MedChrgitmType == "08" { //材料费
|
|
469
|
+ materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
470
|
+ materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
471
|
+ materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
472
|
+ material_fulamt_ownpay_amt, _ = decimal.NewFromFloat(material_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
473
|
+ if item.ChrgitmLv == "1" {
|
|
474
|
+
|
|
475
|
+ material_claa_sunmfee, _ = decimal.NewFromFloat(material_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
476
|
+
|
|
477
|
+ }
|
|
478
|
+ if item.ChrgitmLv == "2" {
|
|
479
|
+ material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
480
|
+
|
|
481
|
+ }
|
|
482
|
+ if item.ChrgitmLv == "3" {
|
|
483
|
+ material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
484
|
+ }
|
|
485
|
+ }
|
|
486
|
+ if item.MedChrgitmType == "09" { //西药费
|
|
487
|
+ westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
488
|
+ westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
489
|
+ westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
490
|
+ westernMedicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(westernMedicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
491
|
+ if item.ChrgitmLv == "1" {
|
|
492
|
+ westernMedicine_claa_sunmfee, _ = decimal.NewFromFloat(westernMedicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
493
|
+ }
|
|
494
|
+ if item.ChrgitmLv == "2" {
|
|
495
|
+ westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
496
|
+ }
|
|
497
|
+ if item.ChrgitmLv == "3" {
|
|
498
|
+ westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
499
|
+ }
|
|
500
|
+ }
|
|
501
|
+ if item.MedChrgitmType == "10" { //中药饮片
|
|
502
|
+ chineseMedicineCostTotal, _ = decimal.NewFromFloat(chineseMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
503
|
+ chineseMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
504
|
+ chineseMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
505
|
+ chinese_medicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chinese_medicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
506
|
+ if item.ChrgitmLv == "1" {
|
|
507
|
+ chinese_medicine_claa_sunmfee, _ = decimal.NewFromFloat(chinese_medicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
508
|
+ }
|
|
509
|
+ if item.ChrgitmLv == "2" {
|
|
510
|
+ chinese_medicine_clab_amt, _ = decimal.NewFromFloat(chinese_medicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
511
|
+ }
|
|
512
|
+ if item.ChrgitmLv == "3" {
|
|
513
|
+ chinese_medicine_other_amt, _ = decimal.NewFromFloat(chinese_medicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
514
|
+ }
|
|
515
|
+ }
|
|
516
|
+
|
|
517
|
+ if item.MedChrgitmType == "11" { //中成费
|
|
518
|
+ chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
519
|
+ chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
520
|
+ chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
521
|
+ chineseTraditional_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chineseTraditional_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
522
|
+ if item.ChrgitmLv == "1" {
|
|
523
|
+
|
|
524
|
+ chineseTraditional_claa_sunmfee, _ = decimal.NewFromFloat(chineseTraditional_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
525
|
+
|
|
526
|
+ }
|
|
527
|
+ if item.ChrgitmLv == "2" {
|
|
528
|
+ chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
529
|
+
|
|
530
|
+ }
|
|
531
|
+ if item.ChrgitmLv == "3" {
|
|
532
|
+ chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
533
|
+ }
|
|
534
|
+ }
|
|
535
|
+
|
|
536
|
+ if item.MedChrgitmType == "12" { //中成费
|
|
537
|
+ commonlyTreatmentCostTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
538
|
+ commonlyTreatmentCostSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
539
|
+ commonlyTreatmentCostPartSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
540
|
+ commonly_treatment_fulamt_ownpay_amt, _ = decimal.NewFromFloat(commonly_treatment_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
541
|
+ if item.ChrgitmLv == "1" {
|
|
542
|
+
|
|
543
|
+ commonly_treatment_claa_sunmfee, _ = decimal.NewFromFloat(commonly_treatment_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
544
|
+
|
|
545
|
+ }
|
|
546
|
+ if item.ChrgitmLv == "2" {
|
|
547
|
+ commonly_treatment_clab_amt, _ = decimal.NewFromFloat(commonly_treatment_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
548
|
+
|
|
549
|
+ }
|
|
550
|
+ if item.ChrgitmLv == "3" {
|
|
551
|
+ commonly_treatment_other_amt, _ = decimal.NewFromFloat(commonly_treatment_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
552
|
+ }
|
|
553
|
+ }
|
|
554
|
+
|
|
555
|
+ if item.MedChrgitmType == "13" { //中成费
|
|
556
|
+ registerCostTotal, _ = decimal.NewFromFloat(registerCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
557
|
+ registerCostSelfTotal, _ = decimal.NewFromFloat(registerCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
558
|
+ registerPartSelfTotal, _ = decimal.NewFromFloat(registerPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
559
|
+ register_fulamt_ownpay_amt, _ = decimal.NewFromFloat(register_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
560
|
+ if item.ChrgitmLv == "1" {
|
|
561
|
+
|
|
562
|
+ register_claa_sunmfee, _ = decimal.NewFromFloat(register_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
563
|
+
|
|
564
|
+ }
|
|
565
|
+ if item.ChrgitmLv == "2" {
|
|
566
|
+ register_clab_amt, _ = decimal.NewFromFloat(register_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
567
|
+
|
|
568
|
+ }
|
|
569
|
+ if item.ChrgitmLv == "3" {
|
|
570
|
+ register_other_amt, _ = decimal.NewFromFloat(register_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
571
|
+ }
|
|
572
|
+ }
|
|
573
|
+
|
|
574
|
+ if item.MedChrgitmType == "14" { //其他费
|
|
575
|
+ otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
576
|
+ otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
577
|
+ otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
578
|
+ other_fulamt_ownpay_amt, _ = decimal.NewFromFloat(other_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
579
|
+ if item.ChrgitmLv == "1" {
|
|
580
|
+ other_claa_sunmfee, _ = decimal.NewFromFloat(other_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
581
|
+
|
|
582
|
+ }
|
|
583
|
+ if item.ChrgitmLv == "2" {
|
|
584
|
+ other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
585
|
+
|
|
586
|
+ }
|
|
587
|
+ if item.ChrgitmLv == "3" {
|
|
588
|
+ other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
589
|
+ }
|
|
590
|
+ }
|
|
591
|
+
|
|
592
|
+ }
|
|
593
|
+
|
|
594
|
+ var iteminfoStructs []service.IteminfoStruct
|
|
595
|
+
|
|
596
|
+ if bedCostTotal != 0 {
|
|
597
|
+ iteminfo.MedChrgitm = "01"
|
|
598
|
+ iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
|
|
599
|
+ iteminfo.Amt = bedCostTotal
|
|
600
|
+ iteminfo.ClaaSumfee = bed_claa_sunmfee
|
|
601
|
+ iteminfo.ClabAmt = bed_clab_amt
|
|
602
|
+ iteminfo.OthAmt = bed_other_amt
|
|
603
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
604
|
+ }
|
|
605
|
+
|
|
606
|
+ if examineCostTotal != 0 {
|
|
607
|
+ iteminfo.MedChrgitm = "02"
|
|
608
|
+ iteminfo.FulamtOwnpayAmt = examine_fulamt_ownpay_amt
|
|
609
|
+ iteminfo.Amt = examineCostTotal
|
|
610
|
+ iteminfo.ClaaSumfee = examine_claa_sunmfee
|
|
611
|
+ iteminfo.ClabAmt = examine_clab_amt
|
|
612
|
+ iteminfo.OthAmt = examine_other_amt
|
|
613
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
614
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
615
|
+ }
|
|
616
|
+
|
|
617
|
+ if checkCostTotal != 0 {
|
|
618
|
+ iteminfo.MedChrgitm = "03"
|
|
619
|
+ iteminfo.FulamtOwnpayAmt = check_fulamt_ownpay_amt
|
|
620
|
+ iteminfo.Amt = checkCostTotal
|
|
621
|
+ iteminfo.ClaaSumfee = check_claa_sunmfee
|
|
622
|
+ iteminfo.ClabAmt = check_clab_amt
|
|
623
|
+ iteminfo.OthAmt = check_other_amt
|
|
624
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
625
|
+
|
|
626
|
+ }
|
|
627
|
+
|
|
628
|
+ if laboratoryCostTotal != 0 {
|
|
629
|
+ iteminfo.MedChrgitm = "04"
|
|
630
|
+ iteminfo.FulamtOwnpayAmt = laboratory_fulamt_ownpay_amt
|
|
631
|
+ iteminfo.Amt = laboratoryCostTotal
|
|
632
|
+ iteminfo.ClaaSumfee = laboratory_claa_sunmfee
|
|
633
|
+ iteminfo.ClabAmt = laboratory_clab_amt
|
|
634
|
+ iteminfo.OthAmt = laboratory_other_amt
|
|
635
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
636
|
+
|
|
637
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
638
|
+
|
|
639
|
+ }
|
|
640
|
+
|
|
641
|
+ if treatCostTotal != 0 {
|
|
642
|
+ iteminfo.MedChrgitm = "05"
|
|
643
|
+ iteminfo.FulamtOwnpayAmt = treat_fulamt_ownpay_amt
|
|
644
|
+ iteminfo.Amt = treatCostTotal
|
|
645
|
+ iteminfo.ClaaSumfee = treat_claa_sunmfee
|
|
646
|
+ iteminfo.ClabAmt = treat_clab_amt
|
|
647
|
+ iteminfo.OthAmt = treat_other_amt
|
|
648
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
649
|
+ //(struct4101.IteminfoStruct, iteminfo)
|
|
650
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
651
|
+ }
|
|
652
|
+
|
|
653
|
+ if operationCostTotal != 0 {
|
|
654
|
+ iteminfo.MedChrgitm = "06"
|
|
655
|
+ iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
|
|
656
|
+ iteminfo.Amt = operationCostTotal
|
|
657
|
+ iteminfo.ClaaSumfee = operation_claa_sunmfee
|
|
658
|
+ iteminfo.ClabAmt = operation_clab_amt
|
|
659
|
+ iteminfo.OthAmt = operation_other_amt
|
|
660
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
661
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
662
|
+ }
|
|
663
|
+
|
|
664
|
+ if nursingCostTotal != 0 {
|
|
665
|
+ iteminfo.MedChrgitm = "07"
|
|
666
|
+ iteminfo.FulamtOwnpayAmt = nursing_fulamt_ownpay_amt
|
|
667
|
+ iteminfo.Amt = nursingCostTotal
|
|
668
|
+ iteminfo.ClaaSumfee = nursing_claa_sunmfee
|
|
669
|
+ iteminfo.ClabAmt = nursing_clab_amt
|
|
670
|
+ iteminfo.OthAmt = nursing_other_amt
|
|
671
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
672
|
+ }
|
|
673
|
+
|
|
674
|
+ if materialCostTotal != 0 {
|
|
675
|
+ iteminfo.MedChrgitm = "08"
|
|
676
|
+ iteminfo.FulamtOwnpayAmt = material_fulamt_ownpay_amt
|
|
677
|
+ iteminfo.Amt = materialCostTotal
|
|
678
|
+ iteminfo.ClaaSumfee = material_claa_sunmfee
|
|
679
|
+ iteminfo.ClabAmt = material_clab_amt
|
|
680
|
+ iteminfo.OthAmt = material_other_amt
|
|
681
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
682
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
683
|
+ }
|
|
684
|
+
|
|
685
|
+ if westernMedicineCostTotal != 0 {
|
|
686
|
+ iteminfo.MedChrgitm = "09"
|
|
687
|
+ iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
|
|
688
|
+ iteminfo.Amt = westernMedicineCostTotal
|
|
689
|
+ iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
|
|
690
|
+ iteminfo.ClabAmt = westernMedicine_clab_amt
|
|
691
|
+ iteminfo.OthAmt = westernMedicine_other_amt
|
|
692
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
693
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
694
|
+
|
|
695
|
+ }
|
|
696
|
+
|
|
697
|
+ if chineseMedicineCostTotal != 0 {
|
|
698
|
+ iteminfo.MedChrgitm = "10"
|
|
699
|
+ iteminfo.FulamtOwnpayAmt = chinese_medicine_fulamt_ownpay_amt
|
|
700
|
+ iteminfo.Amt = chineseMedicineCostTotal
|
|
701
|
+ iteminfo.ClaaSumfee = chinese_medicine_claa_sunmfee
|
|
702
|
+ iteminfo.ClabAmt = chinese_medicine_clab_amt
|
|
703
|
+ iteminfo.OthAmt = chinese_medicine_other_amt
|
|
704
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
705
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
706
|
+
|
|
707
|
+ }
|
|
708
|
+
|
|
709
|
+ if chineseTraditionalMedicineCostTotal != 0 {
|
|
710
|
+ iteminfo.MedChrgitm = "11"
|
|
711
|
+ iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
|
|
712
|
+ iteminfo.Amt = westernMedicineCostTotal
|
|
713
|
+ iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
|
|
714
|
+ iteminfo.ClabAmt = westernMedicine_clab_amt
|
|
715
|
+ iteminfo.OthAmt = westernMedicine_other_amt
|
|
716
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
717
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
718
|
+
|
|
719
|
+ }
|
|
720
|
+
|
|
721
|
+ if commonlyTreatmentCostTotal != 0 {
|
|
722
|
+ iteminfo.MedChrgitm = "12"
|
|
723
|
+ iteminfo.FulamtOwnpayAmt = commonly_treatment_fulamt_ownpay_amt
|
|
724
|
+ iteminfo.Amt = commonlyTreatmentCostTotal
|
|
725
|
+ iteminfo.ClaaSumfee = commonly_treatment_claa_sunmfee
|
|
726
|
+ iteminfo.ClabAmt = commonly_treatment_clab_amt
|
|
727
|
+ iteminfo.OthAmt = commonly_treatment_other_amt
|
|
728
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
729
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
730
|
+
|
|
731
|
+ }
|
|
732
|
+
|
|
733
|
+ if registerCostTotal != 0 {
|
|
734
|
+ iteminfo.MedChrgitm = "13"
|
|
735
|
+ iteminfo.FulamtOwnpayAmt = register_fulamt_ownpay_amt
|
|
736
|
+ iteminfo.Amt = registerCostTotal
|
|
737
|
+ iteminfo.ClaaSumfee = register_claa_sunmfee
|
|
738
|
+ iteminfo.ClabAmt = register_clab_amt
|
|
739
|
+ iteminfo.OthAmt = register_other_amt
|
|
740
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
741
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
742
|
+
|
|
743
|
+ }
|
|
744
|
+
|
|
745
|
+ if otherCostTotal != 0 {
|
|
746
|
+ iteminfo.MedChrgitm = "14"
|
|
747
|
+ iteminfo.FulamtOwnpayAmt = other_fulamt_ownpay_amt
|
|
748
|
+ iteminfo.Amt = otherCostTotal
|
|
749
|
+ iteminfo.ClaaSumfee = other_claa_sunmfee
|
|
750
|
+ iteminfo.ClabAmt = other_clab_amt
|
|
751
|
+ iteminfo.OthAmt = other_other_amt
|
|
752
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
753
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
754
|
+
|
|
755
|
+ }
|
|
756
|
+ struct4101.IteminfoStruct = iteminfoStructs
|
|
757
|
+ time_arr := strings.Split(order.SetlTime, " ")
|
|
758
|
+ struct4101.AdmTime = time_arr[0]
|
|
759
|
+ struct4101.AdmEndTime = time_arr[0]
|
|
760
|
+
|
|
761
|
+ struct4101.DoctorName = doctor.UserName
|
|
762
|
+ struct4101.DoctorCode = doctor.DoctorNumber
|
|
763
|
+
|
|
764
|
+ struct4101.Ntly = "中国"
|
|
765
|
+ struct4101.AdmCaty = "A03.06"
|
|
766
|
+ var res ResultSeventeen
|
|
767
|
+ if miConfig.MdtrtareaAdmvs == "421300" {
|
|
768
|
+ data := make(map[string]interface{})
|
|
769
|
+ data["struct4101"] = struct4101
|
|
770
|
+ data["secret_key"] = miConfig.SecretKey
|
|
771
|
+ data["org_name"] = miConfig.OrgName
|
|
772
|
+ data["opera"] = curRoles.UserName
|
|
773
|
+ data["code"] = miConfig.Code
|
|
774
|
+ data["insuplc_admdvs"] = miConfig.InsuplcAdmdvs
|
|
775
|
+ data["mdtrtarea_admvs"] = miConfig.MdtrtareaAdmvs
|
|
776
|
+
|
|
777
|
+ client := &http.Client{}
|
|
778
|
+ bytesData, _ := json.Marshal(data)
|
|
779
|
+ req, _ := http.NewRequest("POST", "http://192.168.124.4:9532/"+"hbyb/4101", bytes.NewReader(bytesData))
|
|
780
|
+ resp, _ := client.Do(req)
|
|
781
|
+ defer resp.Body.Close()
|
|
782
|
+ body, ioErr := ioutil.ReadAll(resp.Body)
|
|
783
|
+ if ioErr != nil {
|
|
784
|
+ //utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
|
|
785
|
+ //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
786
|
+ return
|
|
787
|
+ }
|
|
788
|
+ var respJSON map[string]interface{}
|
|
789
|
+ if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
|
|
790
|
+ //utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
791
|
+ //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
792
|
+ return
|
|
793
|
+ }
|
|
794
|
+
|
|
795
|
+ respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
|
|
796
|
+ userJSONBytes, _ := json.Marshal(respJSON)
|
|
797
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
798
|
+ //utils.ErrorLog("解析失败:%v", err)
|
|
799
|
+ //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
800
|
+
|
|
801
|
+ errlog := &models.HisOrderError{
|
|
802
|
+ UserOrgId: org_id,
|
|
803
|
+ Ctime: time.Now().Unix(),
|
|
804
|
+ Mtime: time.Now().Unix(),
|
|
805
|
+ ErrMsg: res.ErrMsg + "解析失败",
|
|
806
|
+ Status: 1,
|
|
807
|
+ PatientId: order_id,
|
|
808
|
+ Stage: 10088,
|
|
809
|
+ }
|
|
810
|
+ service.CreateErrMsgLog(errlog)
|
|
811
|
+ continue
|
|
812
|
+ }
|
|
813
|
+
|
|
814
|
+ } else {
|
|
815
|
+ result := service.Gdyb4101(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
|
|
816
|
+ fmt.Println(result)
|
|
817
|
+
|
|
818
|
+ var dat map[string]interface{}
|
|
819
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
820
|
+ fmt.Println(dat)
|
|
821
|
+ } else {
|
|
822
|
+ fmt.Println(err)
|
|
823
|
+ }
|
|
824
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
825
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
826
|
+ //utils.ErrorLog("解析失败:%v", err)
|
|
827
|
+ //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
828
|
+ //adminUser := c.GetAdminUserInfo()
|
|
829
|
+ errlog := &models.HisOrderError{
|
|
830
|
+ UserOrgId: org_id,
|
|
831
|
+ Ctime: time.Now().Unix(),
|
|
832
|
+ Mtime: time.Now().Unix(),
|
|
833
|
+ ErrMsg: res.ErrMsg + "解析失败",
|
|
834
|
+ Status: 1,
|
|
835
|
+ PatientId: order_id,
|
|
836
|
+ Stage: 10106,
|
|
837
|
+ }
|
|
838
|
+ service.CreateErrMsgLog(errlog)
|
|
839
|
+ continue
|
|
840
|
+ }
|
|
841
|
+ }
|
|
842
|
+
|
|
843
|
+ if res.Infcode != 0 {
|
|
844
|
+ //adminUser := c.GetAdminUserInfo()
|
|
845
|
+ errlog := &models.HisOrderError{
|
|
846
|
+ UserOrgId: org_id,
|
|
847
|
+ Ctime: time.Now().Unix(),
|
|
848
|
+ Mtime: time.Now().Unix(),
|
|
849
|
+ ErrMsg: res.ErrMsg,
|
|
850
|
+ Status: 1,
|
|
851
|
+ PatientId: order_id,
|
|
852
|
+ Stage: 10106,
|
|
853
|
+ }
|
|
854
|
+ service.CreateErrMsgLog(errlog)
|
|
855
|
+ continue
|
|
856
|
+ } else {
|
|
857
|
+ hisFundSettleListResult := &models.HisFundSettleListResult{
|
|
858
|
+ Number: res.Output.SetlListId,
|
|
859
|
+ Status: 1,
|
|
860
|
+ Ctime: time.Now().Unix(),
|
|
861
|
+ Mtime: time.Now().Unix(),
|
|
862
|
+ UserOrgId: org_id,
|
|
863
|
+ IsUpload: 1,
|
|
864
|
+ OrderId: order_id,
|
|
865
|
+ }
|
|
866
|
+ service.CreateUploadRecord(hisFundSettleListResult)
|
|
867
|
+ continue
|
|
868
|
+ }
|
|
869
|
+ }
|
|
870
|
+}
|
|
871
|
+
|
50
|
872
|
//func UploadSettleList(org_id int64) {
|
51
|
873
|
// orders, _ := service.GetAllHisOrder(org_id)
|
52
|
874
|
// for _, item := range orders {
|