test_user 1 年間 前
コミット
8bcb753ce1
共有7 個のファイルを変更した117 個の追加97 個の削除を含む
  1. 8 6
      controllers/js/jsyb_controller.go
  2. 86 60
      controllers/sg/his_api_controller.go
  3. 3 0
      models/his_models.go
  4. 7 11
      service/gdyb_service.go
  5. 4 3
      service/gdyb_zifei_service.go
  6. 5 11
      service/hn_service.go
  7. 4 6
      service/jsyb_service.go

+ 8 - 6
controllers/js/jsyb_controller.go ファイルの表示

@@ -661,6 +661,7 @@ func (c *JSybController) PostSeven() {
661 661
 	certificates, _ := c.GetInt64("certificates")
662 662
 	verify_number := c.GetString("verify_number")
663 663
 	cainfo := c.GetString("cainfo")
664
+	mdtrt_grp_type := c.GetString("mdtrt_grp_type")
664 665
 
665 666
 	url := c.GetString("url")
666 667
 	ak := c.GetString("ak")
@@ -668,7 +669,7 @@ func (c *JSybController) PostSeven() {
668 669
 	var result string
669 670
 	var request_log string
670 671
 
671
-	result, request_log = service.Jsyb2206(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, id_card_type, 0, 0, 0, 0, certificates, url, ak, verify_number, cainfo)
672
+	result, request_log = service.Jsyb2206(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, id_card_type, 0, 0, 0, 0, certificates, url, ak, verify_number, cainfo, mdtrt_grp_type)
672 673
 
673 674
 	saveJsLog(result, request_log, "2206", "预结算", org_name)
674 675
 	var dat map[string]interface{}
@@ -717,6 +718,7 @@ func (c *JSybController) PostEight() {
717 718
 	ak := c.GetString("ak")
718 719
 	verify_number := c.GetString("verify_number")
719 720
 	cainfo := c.GetString("cainfo")
721
+	mdtrt_grp_type := c.GetString("mdtrt_grp_type")
720 722
 
721 723
 	var result string
722 724
 	var request_log string
@@ -730,10 +732,10 @@ func (c *JSybController) PostEight() {
730 732
 		//}
731 733
 		//token := ele.Data.EcCardToken
732 734
 		//if len(token) > 0 {
733
-		result, request_log = service.Jsyb2207(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, id_card_type, fulamt_ownpay_amt, overlmt_selfpay, preselfpay_amt, inscp_scp_amt, certificates, acct_used_flag, url, ak, verify_number, cainfo)
735
+		result, request_log = service.Jsyb2207(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, id_card_type, fulamt_ownpay_amt, overlmt_selfpay, preselfpay_amt, inscp_scp_amt, certificates, acct_used_flag, url, ak, verify_number, cainfo, mdtrt_grp_type)
734 736
 		//}
735 737
 	} else {
736
-		result, request_log = service.Jsyb2207(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, id_card_type, fulamt_ownpay_amt, overlmt_selfpay, preselfpay_amt, inscp_scp_amt, certificates, acct_used_flag, url, ak, verify_number, cainfo)
738
+		result, request_log = service.Jsyb2207(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, id_card_type, fulamt_ownpay_amt, overlmt_selfpay, preselfpay_amt, inscp_scp_amt, certificates, acct_used_flag, url, ak, verify_number, cainfo, mdtrt_grp_type)
737 739
 
738 740
 	}
739 741
 
@@ -1187,10 +1189,10 @@ func (c *JSybController) GetELeCertInfo(code string, operator_id string, operato
1187 1189
 	inputData := make(map[string]interface{})
1188 1190
 	inputData["orgId"] = code
1189 1191
 	inputData["businessType"] = "01101"
1190
-	inputData["operatorId"] = "1"
1191
-	inputData["operatorName"] = "admin"
1192
+	inputData["operatorId"] = operator_id
1193
+	inputData["operatorName"] = operator_name
1192 1194
 	inputData["officeId"] = "001"
1193
-	inputData["officeName"] = "admin"
1195
+	inputData["officeName"] = "xuetou"
1194 1196
 	data["data"] = inputData
1195 1197
 	data["transType"] = "ec.query"
1196 1198
 	data["orgId"] = code

+ 86 - 60
controllers/sg/his_api_controller.go ファイルの表示

@@ -111,9 +111,7 @@ func (c *HisApiController) Get2505() {
111 111
 
112 112
 func (c *HisApiController) Get4201A() {
113 113
 	order_id, _ := c.GetInt64("order_id")
114
-	order_id = 172977
115 114
 	admin_user_id, _ := c.GetInt64("admin_user_id")
116
-	admin_user_id = 3432
117 115
 	order, _ := service.GetHisOrderByIDTwo(order_id)
118 116
 	his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
119 117
 	order_info, _ := service.GetHisOrderInfoByNumber(order.MdtrtId)
@@ -137,19 +135,20 @@ func (c *HisApiController) Get4201A() {
137 135
 		var fsiOPFLD models.FsiOwnpayPatnFeeListDDTO
138 136
 		fsiOPFLD.FixmedinsMdtrtID = items.OrderNumber
139 137
 		fsiOPFLD.MedType = "14"
140
-		fsiOPFLD.BkkpSn = items.OrderNumber
138
+		fsiOPFLD.BkkpSn = items.FeedetlSn
141 139
 		fsiOPFLD.FixmedinsCode = miConfig.Code
142 140
 		fsiOPFLD.FixmedinsName = miConfig.OrgName
143 141
 		fsiOPFLD.Cnt = fmt.Sprintf("%.2f", items.Cnt)
144 142
 		fsiOPFLD.Pric = fmt.Sprintf("%.2f", items.Pric)
145 143
 		fsiOPFLD.DetItemFeeSumamt = fmt.Sprintf("%.2f", items.DetItemFeeSumamt)
146 144
 
147
-		if items.AdviceId > 0 && items.ProjectId == 0 {
145
+		if items.AdviceId > 0 && items.ProjectId == 0 && items.HisDoctorAdviceInfo.BaseDrugLib.IsUser != 1 && len(items.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber) > 0 {
148 146
 			fsiOPFLD.FeeOcurTime = time.Unix(items.HisDoctorAdviceInfo.CreatedTime, 0).Format("2006-01-02 15:04:05")
149 147
 			fsiOPFLD.MedListCodg = items.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
150 148
 
151 149
 			fsiOPFLD.MedinsListCodg = items.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
152 150
 			fsiOPFLD.MedinsListName = items.HisDoctorAdviceInfo.BaseDrugLib.DrugName
151
+
153 152
 			fsiOPFLD.Prodname = items.HisDoctorAdviceInfo.BaseDrugLib.DrugName
154 153
 			fsiOPFLD.BilgDeptName = department.Name
155 154
 			fsiOPFLD.BilgDeptCodg = department.Number
@@ -157,19 +156,24 @@ func (c *HisApiController) Get4201A() {
157 156
 			fsiOPFLD.BilgDrName = doctor.UserName
158 157
 			fsiOPFLD.MedChrgitmType = "09"
159 158
 
160
-		} else if items.AdviceId == 0 && items.ProjectId > 0 {
161
-			fsiOPFLD.FeeOcurTime = time.Unix(items.HisPrescriptionProject.Ctime, 0).Format("2006-01-02 15:04:05")
162
-			fsiOPFLD.MedListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
159
+			memo["hosp_appr_flag"] = "1"
160
+			memo["invoice_no"] = order.MdtrtId
161
+			memo["memo"] = "自费"
162
+			bytesData, _ := json.Marshal(memo)
163
+			fsiOPFLD.Memo = string(bytesData)
164
+			fsiOPFLDs = append(fsiOPFLDs, fsiOPFLD)
163 165
 
164
-			fsiOPFLD.MedinsListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
165
-			fsiOPFLD.BilgDeptName = department.Name
166
-			fsiOPFLD.BilgDeptCodg = department.Number
167
-			fsiOPFLD.BilgDrCode = doctor.DoctorNumber
168
-			fsiOPFLD.BilgDrName = doctor.UserName
169
-			if items.HisPrescriptionProject.Type == 2 {
166
+		} else if items.AdviceId == 0 && items.ProjectId > 0 {
167
+			if items.HisPrescriptionProject.Type == 2 && len(items.HisPrescriptionProject.HisProject.MedicalCode) > 0 {
168
+				fsiOPFLD.FeeOcurTime = time.Unix(items.HisPrescriptionProject.Ctime, 0).Format("2006-01-02 15:04:05")
169
+				fsiOPFLD.MedListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
170
+				fsiOPFLD.MedinsListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
170 171
 				fsiOPFLD.MedinsListName = items.HisPrescriptionProject.HisProject.ProjectName
171 172
 				fsiOPFLD.Prodname = items.HisPrescriptionProject.HisProject.ProjectName
172
-
173
+				fsiOPFLD.BilgDeptName = department.Name
174
+				fsiOPFLD.BilgDeptCodg = department.Number
175
+				fsiOPFLD.BilgDrCode = doctor.DoctorNumber
176
+				fsiOPFLD.BilgDrName = doctor.UserName
173 177
 				switch items.HisPrescriptionProject.HisProject.CostClassify {
174 178
 				case 0:
175 179
 
@@ -227,38 +231,46 @@ func (c *HisApiController) Get4201A() {
227 231
 					break
228 232
 
229 233
 				}
230
-			} else if items.HisPrescriptionProject.Type == 3 {
234
+				memo["hosp_appr_flag"] = "1"
235
+				memo["invoice_no"] = order.MdtrtId
236
+				memo["memo"] = "自费"
237
+				bytesData, _ := json.Marshal(memo)
238
+				fsiOPFLD.Memo = string(bytesData)
239
+				fsiOPFLDs = append(fsiOPFLDs, fsiOPFLD)
240
+			} else if items.HisPrescriptionProject.Type == 3 && items.HisPrescriptionProject.GoodInfo.IsUser != 1 && len(items.HisPrescriptionProject.GoodInfo.MedicalInsuranceNumber) > 0 {
241
+				fsiOPFLD.FeeOcurTime = time.Unix(items.HisPrescriptionProject.Ctime, 0).Format("2006-01-02 15:04:05")
242
+				fsiOPFLD.MedListCodg = items.HisPrescriptionProject.GoodInfo.MedicalInsuranceNumber
243
+				fsiOPFLD.MedinsListCodg = items.HisPrescriptionProject.GoodInfo.MedicalInsuranceNumber
244
+				fsiOPFLD.BilgDeptName = department.Name
245
+				fsiOPFLD.BilgDeptCodg = department.Number
246
+				fsiOPFLD.BilgDrCode = doctor.DoctorNumber
247
+				fsiOPFLD.BilgDrName = doctor.UserName
231 248
 				fsiOPFLD.MedinsListName = items.HisPrescriptionProject.GoodInfo.GoodName
232 249
 				fsiOPFLD.Prodname = items.HisPrescriptionProject.GoodInfo.GoodName
233
-
234 250
 				fsiOPFLD.MedChrgitmType = "08"
251
+				memo["hosp_appr_flag"] = "1"
252
+				memo["invoice_no"] = order.MdtrtId
253
+				memo["memo"] = "自费"
254
+				bytesData, _ := json.Marshal(memo)
255
+				fsiOPFLD.Memo = string(bytesData)
256
+				fsiOPFLDs = append(fsiOPFLDs, fsiOPFLD)
235 257
 			}
236 258
 		}
237 259
 
238
-		fsiOPFLD.Prodname = items.HisDoctorAdviceInfo.AdviceName
239
-		fsiOPFLD.BilgDeptCodg = department.Number
240
-		fsiOPFLD.BilgDeptName = department.Name
241
-		memo["hosp_appr_flag"] = "1"
242
-		memo["invoice_no"] = order.MdtrtId
243
-		memo["memo"] = "自费"
244
-		bytesData, _ := json.Marshal(memo)
245
-		fsiOPFLD.Memo = string(bytesData)
246
-
247
-		fsiOPFLDs = append(fsiOPFLDs, fsiOPFLD)
248 260
 	}
249 261
 	for _, items := range order_info_two {
250 262
 		memo := make(map[string]interface{})
251 263
 		var fsiOPFLD models.FsiOwnpayPatnFeeListDDTO
252 264
 		fsiOPFLD.FixmedinsMdtrtID = items.OrderNumber
253 265
 		fsiOPFLD.MedType = "14"
254
-		fsiOPFLD.BkkpSn = items.OrderNumber
266
+		fsiOPFLD.BkkpSn = items.FeedetlSn
255 267
 		fsiOPFLD.FixmedinsCode = miConfig.Code
256 268
 		fsiOPFLD.FixmedinsName = miConfig.OrgName
257 269
 		fsiOPFLD.Cnt = fmt.Sprintf("%.2f", items.Cnt)
258 270
 		fsiOPFLD.Pric = fmt.Sprintf("%.2f", items.Pric)
259 271
 		fsiOPFLD.DetItemFeeSumamt = fmt.Sprintf("%.2f", items.DetItemFeeSumamt)
260 272
 
261
-		if items.AdviceId > 0 && items.ProjectId == 0 {
273
+		if items.AdviceId > 0 && items.ProjectId == 0 && items.HisDoctorAdviceInfo.BaseDrugLib.IsUser != 1 && len(items.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber) > 0 {
262 274
 			fsiOPFLD.FeeOcurTime = time.Unix(items.HisDoctorAdviceInfo.CreatedTime, 0).Format("2006-01-02 15:04:05")
263 275
 			fsiOPFLD.MedListCodg = items.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
264 276
 
@@ -271,19 +283,27 @@ func (c *HisApiController) Get4201A() {
271 283
 			fsiOPFLD.BilgDrName = doctor.UserName
272 284
 			fsiOPFLD.MedChrgitmType = "09"
273 285
 
286
+			memo["hosp_appr_flag"] = "1"
287
+			memo["invoice_no"] = order.MdtrtId
288
+			memo["memo"] = "自费"
289
+			bytesData, _ := json.Marshal(memo)
290
+			fsiOPFLD.Memo = string(bytesData)
291
+			fsiOPFLDs = append(fsiOPFLDs, fsiOPFLD)
292
+
274 293
 		} else if items.AdviceId == 0 && items.ProjectId > 0 {
275
-			fsiOPFLD.FeeOcurTime = time.Unix(items.HisPrescriptionProject.Ctime, 0).Format("2006-01-02 15:04:05")
276
-			fsiOPFLD.MedListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
277 294
 
278
-			fsiOPFLD.MedinsListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
279
-			fsiOPFLD.BilgDeptName = department.Name
280
-			fsiOPFLD.BilgDeptCodg = department.Number
281
-			fsiOPFLD.BilgDrCode = doctor.DoctorNumber
282
-			fsiOPFLD.BilgDrName = doctor.UserName
283
-			if items.HisPrescriptionProject.Type == 2 {
295
+			if items.HisPrescriptionProject.Type == 2 && len(items.HisPrescriptionProject.HisProject.MedicalCode) > 0 {
296
+				fsiOPFLD.FeeOcurTime = time.Unix(items.HisPrescriptionProject.Ctime, 0).Format("2006-01-02 15:04:05")
297
+				fsiOPFLD.MedListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
284 298
 				fsiOPFLD.MedinsListName = items.HisPrescriptionProject.HisProject.ProjectName
285 299
 				fsiOPFLD.Prodname = items.HisPrescriptionProject.HisProject.ProjectName
286 300
 
301
+				fsiOPFLD.MedinsListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
302
+				fsiOPFLD.BilgDeptName = department.Name
303
+				fsiOPFLD.BilgDeptCodg = department.Number
304
+				fsiOPFLD.BilgDrCode = doctor.DoctorNumber
305
+				fsiOPFLD.BilgDrName = doctor.UserName
306
+
287 307
 				switch items.HisPrescriptionProject.HisProject.CostClassify {
288 308
 				case 0:
289 309
 
@@ -341,24 +361,33 @@ func (c *HisApiController) Get4201A() {
341 361
 					break
342 362
 
343 363
 				}
344
-			} else if items.HisPrescriptionProject.Type == 3 {
364
+				memo["hosp_appr_flag"] = "1"
365
+				memo["invoice_no"] = order.MdtrtId
366
+				memo["memo"] = "自费"
367
+				bytesData, _ := json.Marshal(memo)
368
+				fsiOPFLD.Memo = string(bytesData)
369
+				fsiOPFLDs = append(fsiOPFLDs, fsiOPFLD)
370
+			} else if items.HisPrescriptionProject.Type == 3 && len(items.HisPrescriptionProject.GoodInfo.MedicalInsuranceNumber) > 0 && items.HisPrescriptionProject.GoodInfo.IsUser != 1 {
371
+				fsiOPFLD.FeeOcurTime = time.Unix(items.HisPrescriptionProject.Ctime, 0).Format("2006-01-02 15:04:05")
372
+				fsiOPFLD.MedListCodg = items.HisPrescriptionProject.GoodInfo.MedicalInsuranceNumber
373
+				fsiOPFLD.MedinsListCodg = items.HisPrescriptionProject.GoodInfo.MedicalInsuranceNumber
374
+				fsiOPFLD.BilgDeptName = department.Name
375
+				fsiOPFLD.BilgDeptCodg = department.Number
376
+				fsiOPFLD.BilgDrCode = doctor.DoctorNumber
377
+				fsiOPFLD.BilgDrName = doctor.UserName
345 378
 				fsiOPFLD.MedinsListName = items.HisPrescriptionProject.GoodInfo.GoodName
346 379
 				fsiOPFLD.Prodname = items.HisPrescriptionProject.GoodInfo.GoodName
347 380
 
348 381
 				fsiOPFLD.MedChrgitmType = "08"
382
+				memo["hosp_appr_flag"] = "1"
383
+				memo["invoice_no"] = order.MdtrtId
384
+				memo["memo"] = "自费"
385
+				bytesData, _ := json.Marshal(memo)
386
+				fsiOPFLD.Memo = string(bytesData)
387
+				fsiOPFLDs = append(fsiOPFLDs, fsiOPFLD)
349 388
 			}
350 389
 		}
351 390
 
352
-		fsiOPFLD.Prodname = items.HisDoctorAdviceInfo.AdviceName
353
-		fsiOPFLD.BilgDeptCodg = department.Number
354
-		fsiOPFLD.BilgDeptName = department.Name
355
-		memo["hosp_appr_flag"] = "1"
356
-		memo["invoice_no"] = order.MdtrtId
357
-		memo["memo"] = "自费"
358
-		bytesData, _ := json.Marshal(memo)
359
-		fsiOPFLD.Memo = string(bytesData)
360
-
361
-		fsiOPFLDs = append(fsiOPFLDs, fsiOPFLD)
362 391
 	}
363 392
 
364 393
 	fmt.Println(fsiOPFLDs)
@@ -396,11 +425,7 @@ func (c *HisApiController) Get4201A() {
396 425
 }
397 426
 func (c *HisApiController) Get4202() {
398 427
 	order_id, _ := c.GetInt64("order_id")
399
-	order_id = 220548
400
-
401 428
 	admin_user_id, _ := c.GetInt64("admin_user_id")
402
-	admin_user_id = 3432
403
-
404 429
 	order, _ := service.GetHisOrderByIDTwo(order_id)
405 430
 	his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
406 431
 	curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
@@ -488,8 +513,6 @@ func (c *HisApiController) Get4203() {
488 513
 	curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
489 514
 	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
490 515
 	order_id, _ := c.GetInt64("order_id")
491
-	order_id = 220548
492
-	admin_user_id = 3432
493 516
 
494 517
 	order, _ := service.GetHisOrderByIDTwo(order_id)
495 518
 	his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
@@ -7504,6 +7527,7 @@ func (c *HisApiController) GetRegisterInfo() {
7504 7527
 	med_type := c.GetString("social_type")
7505 7528
 	admin_user_id, _ := c.GetInt64("admin_user_id")
7506 7529
 	insuplc_admdvs := c.GetString("insuplc_admdvs")
7530
+	mdtrt_type := c.GetString("mdtrt_type")
7507 7531
 
7508 7532
 	timeLayout := "2006-01-02"
7509 7533
 	loc, _ := time.LoadLocation("Local")
@@ -7888,6 +7912,7 @@ func (c *HisApiController) GetRegisterInfo() {
7888 7912
 				IdCardType:             id_card_type,
7889 7913
 				Doctor:                 doctor,
7890 7914
 				Departments:            department,
7915
+				MdtrtGrpType:           mdtrt_type,
7891 7916
 			}
7892 7917
 
7893 7918
 			timestamp := time.Now().Unix()
@@ -8335,6 +8360,7 @@ func (c *HisApiController) GetRegisterInfo() {
8335 8360
 			his.Mtime = time.Now().Unix()
8336 8361
 			his.InsuplcAdmdvs = insuplc_admdvs_temp
8337 8362
 			his.Status = 1
8363
+			his.MdtrtGrpType = mdtrt_type
8338 8364
 			service.UpdateHisPatientStatus(&his)
8339 8365
 			service.UpdateHisPrescriptionHisID(his.ID, patient.ID, recordDateTime, adminInfo.CurrentOrgId)
8340 8366
 
@@ -9267,7 +9293,7 @@ func (c *HisApiController) GetUploadInfo() {
9267 9293
 											"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
9268 9294
 											"&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(his.IdCardType, 10) +
9269 9295
 											"&certificates=" + strconv.FormatInt(his.IdType, 10) + "&cert_no=" + cert_no +
9270
-											"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&acct_used_flag=" + acct_used_flag + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo
9296
+											"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&acct_used_flag=" + acct_used_flag + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo + "&mdtrt_grp_type=" + his.MdtrtGrpType
9271 9297
 									} else {
9272 9298
 										api = "http://192.168.5.251:9532/" + "jsyb/2207?psn_no=" + his.PsnNo + "&mdtrt_id=" +
9273 9299
 											his.Number + "&chrg_bchno=" + chrg_bchno + "&org_name=" + miConfig.OrgName +
@@ -9275,7 +9301,7 @@ func (c *HisApiController) GetUploadInfo() {
9275 9301
 											"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
9276 9302
 											"&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(his.IdCardType, 10) +
9277 9303
 											"&certificates=" + strconv.FormatInt(his.IdType, 10) + "&cert_no=" + cert_no +
9278
-											"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&acct_used_flag=" + acct_used_flag + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo
9304
+											"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&acct_used_flag=" + acct_used_flag + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo + "&mdtrt_grp_type=" + his.MdtrtGrpType
9279 9305
 
9280 9306
 									}
9281 9307
 
@@ -9736,7 +9762,7 @@ func (c *HisApiController) GetUploadInfo() {
9736 9762
 								"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
9737 9763
 								"&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(his.IdCardType, 10) +
9738 9764
 								"&certificates=" + strconv.FormatInt(his.IdType, 10) + "&cert_no=" + cert_no +
9739
-								"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + tempOrder.MedType + "&acct_used_flag=" + acct_used_flag + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo
9765
+								"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + tempOrder.MedType + "&acct_used_flag=" + acct_used_flag + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo + "&mdtrt_grp_type=" + his.MdtrtGrpType
9740 9766
 
9741 9767
 							//req, _ = http.NewRequest("POST", "http://192.168.2.110:9532/"+"jsyb/2204", bytes.NewReader(bytesData))
9742 9768
 
@@ -9748,7 +9774,7 @@ func (c *HisApiController) GetUploadInfo() {
9748 9774
 								"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
9749 9775
 								"&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(his.IdCardType, 10) +
9750 9776
 								"&certificates=" + strconv.FormatInt(his.IdType, 10) + "&cert_no=" + cert_no +
9751
-								"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + tempOrder.MedType + "&acct_used_flag=" + acct_used_flag + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo
9777
+								"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + tempOrder.MedType + "&acct_used_flag=" + acct_used_flag + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo + "&mdtrt_grp_type=" + his.MdtrtGrpType
9752 9778
 
9753 9779
 						}
9754 9780
 
@@ -11313,7 +11339,7 @@ func (c *HisApiController) GetPreUploadInfo() {
11313 11339
 						insutype = "310"
11314 11340
 					}
11315 11341
 					if len(insutypes) == 2 {
11316
-						insutype = strconv.FormatInt(his.SocialType, 64)
11342
+						insutype = strconv.FormatInt(his.SocialType, 10)
11317 11343
 					}
11318 11344
 
11319 11345
 					//insutype = "390"
@@ -11423,7 +11449,7 @@ func (c *HisApiController) GetPreUploadInfo() {
11423 11449
 										"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
11424 11450
 										"&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(his.IdCardType, 10) +
11425 11451
 										"&certificates=" + strconv.FormatInt(his.IdType, 10) + "&cert_no=" + cert_no +
11426
-										"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&verify_number=" + psn_info.VerifyNumber + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&cainfo=" + miConfig.Cainfo
11452
+										"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&verify_number=" + psn_info.VerifyNumber + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&cainfo=" + miConfig.Cainfo + "&mdtrt_grp_type=" + his.MdtrtGrpType
11427 11453
 
11428 11454
 									//req, _ = http.NewRequest("POST", "http://192.168.2.110:9532/"+"jsyb/2204", bytes.NewReader(bytesData))
11429 11455
 
@@ -11435,7 +11461,7 @@ func (c *HisApiController) GetPreUploadInfo() {
11435 11461
 										"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
11436 11462
 										"&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(his.IdCardType, 10) +
11437 11463
 										"&certificates=" + strconv.FormatInt(his.IdType, 10) + "&cert_no=" + cert_no +
11438
-										"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&verify_number=" + psn_info.VerifyNumber + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&cainfo=" + miConfig.Cainfo
11464
+										"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&verify_number=" + psn_info.VerifyNumber + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&cainfo=" + miConfig.Cainfo + "&mdtrt_grp_type=" + his.MdtrtGrpType
11439 11465
 
11440 11466
 								}
11441 11467
 

+ 3 - 0
models/his_models.go ファイルの表示

@@ -126,6 +126,7 @@ type HisPatient struct {
126 126
 	PatientInfo            string  `gorm:"column:patient_info" json:"patient_info" form:"patient_info"`
127 127
 	InsuplcAdmdvs          string  `gorm:"column:insuplc_admdvs" json:"insuplc_admdvs" form:"insuplc_admdvs"`
128 128
 	Insutype               string  `gorm:"column:insutype" json:"insutype" form:"insutype"`
129
+	MdtrtGrpType           string  `gorm:"column:mdtrt_grp_type" json:"mdtrt_grp_type" form:"mdtrt_grp_type"`
129 130
 }
130 131
 
131 132
 func (HisPatient) TableName() string {
@@ -600,6 +601,7 @@ type XtHisPatient struct {
600 601
 	PatientInfo            string  `gorm:"column:patient_info" json:"patient_info" form:"patient_info"`
601 602
 	Diagnosis              string  `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
602 603
 	Insutype               string  `gorm:"column:insutype" json:"insutype" form:"insutype"`
604
+	MdtrtGrpType           string  `gorm:"column:mdtrt_grp_type" json:"mdtrt_grp_type" form:"mdtrt_grp_type"`
603 605
 }
604 606
 
605 607
 func (XtHisPatient) TableName() string {
@@ -811,6 +813,7 @@ type VMHisPatient struct {
811 813
 	PType                  int64   `gorm:"column:p_type" json:"p_type" form:"p_type"`
812 814
 	InsuplcAdmdvs          string  `gorm:"column:insuplc_admdvs" json:"insuplc_admdvs" form:"insuplc_admdvs"`
813 815
 	Insutype               string  `gorm:"column:insutype" json:"insutype" form:"insutype"`
816
+	MdtrtGrpType           string  `gorm:"column:mdtrt_grp_type" json:"mdtrt_grp_type" form:"mdtrt_grp_type"`
814 817
 }
815 818
 
816 819
 func (VMHisPatient) TableName() string {

+ 7 - 11
service/gdyb_service.go ファイルの表示

@@ -189,7 +189,7 @@ func Gdyb1101A(certNo string, org_name string, doctor string, fixmedins_code str
189 189
 	inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
190 190
 	inputData["card_sn"] = ""           // 卡识别码
191 191
 	inputData["certno"] = certNo        // 证件号码
192
-	inputData["psn_cert_type"] = "1"    // 人员证件类型
192
+	inputData["psn_cert_type"] = "01"   // 人员证件类型
193 193
 	inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
194 194
 	inputData["begntime"] = ""          // 开始时间
195 195
 	inputData["psn_name"] = name        // 人员姓名
@@ -3005,10 +3005,10 @@ func Gdyb4101(struct4101 Struct4101, secret_key string, org_name string, doctor
3005 3005
 	opspdiseinfo := make([]map[string]interface{}, 0) // 门诊慢特病诊断信息
3006 3006
 
3007 3007
 	opspdiseinfotemp := make(map[string]interface{})
3008
-	opspdiseinfotemp["diag_name"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagName // 诊断名称  必填
3009
-	opspdiseinfotemp["diag_code"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagCode // 诊断代码 必填
3010
-	opspdiseinfotemp["oprn_oprt_name"] = "血液透析"                                                                  // 手术操作名称 必填
3011
-	opspdiseinfotemp["oprn_oprt_code"] = "39.9500"                                                               // 手术操作代码 必填
3008
+	opspdiseinfotemp["diag_name"] = struct4101.Diseinfo[len(struct4101.Diseinfo)-1].DiagName // 诊断名称  必填
3009
+	opspdiseinfotemp["diag_code"] = struct4101.Diseinfo[len(struct4101.Diseinfo)-1].DiagCode // 诊断代码 必填
3010
+	opspdiseinfotemp["oprn_oprt_name"] = "血液透析"                                              // 手术操作名称 必填
3011
+	opspdiseinfotemp["oprn_oprt_code"] = "39.9500"                                           // 手术操作代码 必填
3012 3012
 	opspdiseinfo = append(opspdiseinfo, opspdiseinfotemp)
3013 3013
 
3014 3014
 	diseinfo := make([]map[string]interface{}, 0) // 住院诊断信息
@@ -3057,7 +3057,7 @@ func Gdyb4101(struct4101 Struct4101, secret_key string, org_name string, doctor
3057 3057
 
3058 3058
 	input["setlinfo"] = inputData
3059 3059
 	input["payinfo"] = payinfo
3060
-	input["opspdiseinfo"] = oprninfo
3060
+	input["opspdiseinfo"] = opspdiseinfo
3061 3061
 	input["diseinfo"] = diseinfo
3062 3062
 	input["iteminfo"] = iteminfo
3063 3063
 	inputMessage["input"] = input //交易输入
@@ -3078,13 +3078,9 @@ func Gdyb4101(struct4101 Struct4101, secret_key string, org_name string, doctor
3078 3078
 	if fixmedins_code == "H15049901371" {
3079 3079
 		url = gdyb_url
3080 3080
 	} else {
3081
-		if org_id == 10106 || org_id == 10215 || org_id == 10138 || org_id == 9504 {
3082
-			url = gdyb_url + "4101A"
3083 3081
 
3084
-		} else {
3085
-			url = gdyb_url + "4101"
3082
+		url = gdyb_url + "4101A"
3086 3083
 
3087
-		}
3088 3084
 	}
3089 3085
 
3090 3086
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/4101"

+ 4 - 3
service/gdyb_zifei_service.go ファイルの表示

@@ -123,6 +123,7 @@ func Gdyb4202(org_name string, doctor string, fixmedins_code string, insuplc_adm
123 123
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
124 124
 	input := make(map[string]interface{})
125 125
 	inputData := make(map[string]interface{})
126
+
126 127
 	inputMessage["infno"] = "4202" // 交易编码
127 128
 
128 129
 	feedetail := make([]map[string]interface{}, 0)
@@ -168,7 +169,7 @@ func Gdyb4202(org_name string, doctor string, fixmedins_code string, insuplc_adm
168 169
 	inputData["oprn_oprt_name"] = ""
169 170
 
170 171
 	inputData["otp_diag_info"] = ""
171
-	inputData["inhosp_stas"] = ""
172
+	inputData["inhosp_stas"] = "0"
172 173
 	inputData["die_date"] = ""
173 174
 	inputData["ipt_days"] = ""
174 175
 	inputData["fpsc_no"] = ""
@@ -212,9 +213,9 @@ func Gdyb4202(org_name string, doctor string, fixmedins_code string, insuplc_adm
212 213
 		feedetail = append(feedetail, feedetailInfo)
213 214
 	}
214 215
 
215
-	inputData["ownPayPatnDiagListD"] = feedetail
216
+	input["ownPayPatnDiagListD"] = feedetail
217
+	input["ownPayPatnMdtrtD"] = inputData
216 218
 
217
-	input["data"] = inputData
218 219
 	inputMessage["input"] = input //交易输入
219 220
 
220 221
 	var inputLog string

+ 5 - 11
service/hn_service.go ファイルの表示

@@ -16,7 +16,7 @@ import (
16 16
 func Hnyb1101(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string, certificates string, request_url string, access_key string, cainfo string, name string, mdtrt_cert_no string) (string, string) {
17 17
 	timestamp := time.Now().Unix()
18 18
 	//生成输入报文
19
-	inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
19
+	inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
20 20
 
21 21
 	input := make(map[string]interface{})
22 22
 	inputData := make(map[string]interface{})
@@ -1076,16 +1076,10 @@ func SetHnInputMessage(timestamp int64, org_name string, doctor string, fixmedin
1076 1076
 	inputMessage["signtype"] = "SM3"                                                            // 签名类型
1077 1077
 	inputMessage["infver"] = "V1.0"                                                             // 接收方系统代码
1078 1078
 	inputMessage["opter_type"] = "1"                                                            // 经办人类别
1079
-	if fixmedins_code == "H32090403023" {
1080
-
1081
-		inputMessage["opter"] = "晁海燕"      // 经办人
1082
-		inputMessage["opter_name"] = "晁海燕" // 经办人姓名
1083
-	} else {
1084
-		inputMessage["opter"] = doctor      // 经办人
1085
-		inputMessage["opter_name"] = doctor // 经办人姓名
1086
-	}
1087
-	inputMessage["inf_time"] = timeFormatOne        // 交易时间
1088
-	inputMessage["fixmedins_code"] = fixmedins_code // 定点医药机构编号
1079
+	inputMessage["opter"] = doctor                                                              // 经办人
1080
+	inputMessage["opter_name"] = doctor                                                         // 经办人姓名
1081
+	inputMessage["inf_time"] = timeFormatOne                                                    // 交易时间
1082
+	inputMessage["fixmedins_code"] = fixmedins_code                                             // 定点医药机构编号
1089 1083
 	inputMessage["fixmedins_name"] = org_name
1090 1084
 	inputMessage["fixmedins_soft_fcty"] = "深圳市领透科技有限公司" //定点医药机构名称
1091 1085
 	//定点医药机构名称

+ 4 - 6
service/jsyb_service.go ファイルの表示

@@ -713,7 +713,7 @@ func Jsyb2205(psnNo string, mdtrtId string, chrgBchno string, org_name string, d
713 713
 }
714 714
 
715 715
 //  门诊预结算
716
-func Jsyb2206(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, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, request_url string, access_key string, verify_number string, cainfo string) (string, string) {
716
+func Jsyb2206(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, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, request_url string, access_key string, verify_number string, cainfo string, mdtrt_grp_type string) (string, string) {
717 717
 
718 718
 	// 生成签名
719 719
 	timestamp := time.Now().Unix() //		inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
@@ -751,7 +751,6 @@ func Jsyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
751 751
 	} else {
752 752
 		inputData["med_type"] = med_type // 医疗类别 11 普通门诊  12 门诊挂号
753 753
 	}
754
-
755 754
 	inputData["medfee_sumamt"] = total  // 医疗费总额
756 755
 	inputData["psn_setlway"] = "01"     // 个人结算方式 01 按项目结 02 按定额结算
757 756
 	inputData["mdtrt_id"] = mdtrtId     // 就诊 ID(来自2201接口返回)
@@ -763,7 +762,7 @@ func Jsyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
763 762
 	inputData2["trum_flag"] = ""
764 763
 	inputData2["rel_ttp_flag"] = ""
765 764
 	inputData2["otp_er_refl_flag"] = ""
766
-	inputData2["mdtrt_grp_type"] = ""
765
+	inputData2["mdtrt_grp_type"] = mdtrt_grp_type
767 766
 	inputData2["need_ipt_flag"] = ""
768 767
 	inputData["exp_content"] = inputData2
769 768
 	input["data"] = inputData
@@ -787,7 +786,7 @@ func Jsyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
787 786
 }
788 787
 
789 788
 //  门诊结算
790
-func Jsyb2207(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, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, acct_used_flag string, request_url string, access_key string, verify_number string, cainfo string) (string, string) {
789
+func Jsyb2207(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, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, acct_used_flag string, request_url string, access_key string, verify_number string, cainfo string, mdtrt_grp_type string) (string, string) {
791 790
 	// 生成签名
792 791
 	timestamp := time.Now().Unix()
793 792
 	// 生成输入报文
@@ -842,7 +841,7 @@ func Jsyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
842 841
 	inputData2["trum_flag"] = ""
843 842
 	inputData2["rel_ttp_flag"] = ""
844 843
 	inputData2["otp_er_refl_flag"] = ""
845
-	inputData2["mdtrt_grp_type"] = ""
844
+	inputData2["mdtrt_grp_type"] = mdtrt_grp_type
846 845
 	inputData2["need_ipt_flag"] = ""
847 846
 	inputData["exp_content"] = inputData2
848 847
 
@@ -1049,7 +1048,6 @@ func SetJSInputMessage(timestamp int64, org_name string, doctor string, fixmedin
1049 1048
 	inputMessage["infver"] = "1.0.0"                                                            // 接收方系统代码
1050 1049
 	inputMessage["opter_type"] = "1"                                                            // 经办人类别
1051 1050
 	if fixmedins_code == "H32090403023" {
1052
-
1053 1051
 		inputMessage["opter"] = "晁海燕"      // 经办人
1054 1052
 		inputMessage["opter_name"] = "晁海燕" // 经办人姓名
1055 1053
 	} else {