浏览代码

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

csx 4 年前
父节点
当前提交
2643f89dc5
共有 6 个文件被更改,包括 48 次插入41 次删除
  1. 18 34
      controllers/sg/his_api_controller.go
  2. 2 0
      models/drug.go
  3. 2 0
      models/his_models.go
  4. 2 0
      models/self_drug_models.go
  5. 22 7
      service/gdyb_service.go
  6. 2 0
      service/his_service.go

+ 18 - 34
controllers/sg/his_api_controller.go 查看文件

3196
 
3196
 
3197
 	for _, item := range orderInfos {
3197
 	for _, item := range orderInfos {
3198
 		if item.MedChrgitmType == "01" { //床位费
3198
 		if item.MedChrgitmType == "01" { //床位费
3199
-
3200
 			bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3199
 			bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3201
-			bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3202
-			bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3203
-
3200
+			bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
3201
+			bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
3204
 		}
3202
 		}
3205
 
3203
 
3206
 		if item.MedChrgitmType == "03" { //检查费
3204
 		if item.MedChrgitmType == "03" { //检查费
3207
-
3208
 			checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3205
 			checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3209
-			checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3210
-			checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3211
-
3206
+			checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
3207
+			checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
3212
 		}
3208
 		}
3213
 
3209
 
3214
 		if item.MedChrgitmType == "04" { //化验费
3210
 		if item.MedChrgitmType == "04" { //化验费
3215
-
3216
 			laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3211
 			laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3217
-			laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3218
-			laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3219
-
3212
+			laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
3213
+			laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
3220
 		}
3214
 		}
3221
 
3215
 
3222
 		if item.MedChrgitmType == "05" { //治疗费
3216
 		if item.MedChrgitmType == "05" { //治疗费
3223
-
3224
 			treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3217
 			treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3225
-			treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3226
-			treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3227
-
3218
+			treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
3219
+			treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
3228
 		}
3220
 		}
3229
 
3221
 
3230
 		if item.MedChrgitmType == "06" { //手术费
3222
 		if item.MedChrgitmType == "06" { //手术费
3231
-
3232
 			operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3223
 			operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3233
-			operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3234
-			operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3235
-
3224
+			operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
3225
+			operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
3236
 		}
3226
 		}
3237
 
3227
 
3238
 		if item.MedChrgitmType == "08" { //材料费
3228
 		if item.MedChrgitmType == "08" { //材料费
3239
-
3240
 			materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3229
 			materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3241
-			materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3242
-			materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3243
-
3230
+			materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
3231
+			materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
3244
 		}
3232
 		}
3245
 
3233
 
3246
 		if item.MedChrgitmType == "09" { //西药费
3234
 		if item.MedChrgitmType == "09" { //西药费
3247
-
3248
 			westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3235
 			westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3249
-			westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3250
-			westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3251
-
3236
+			westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
3237
+			westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
3252
 		}
3238
 		}
3253
 
3239
 
3254
 		if item.MedChrgitmType == "11" { //中成费
3240
 		if item.MedChrgitmType == "11" { //中成费
3255
-
3256
 			chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3241
 			chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3257
-			chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3258
-			chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3259
-
3242
+			chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
3243
+			chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
3260
 		}
3244
 		}
3261
 
3245
 
3262
 		if item.MedChrgitmType == "14" { //其他费
3246
 		if item.MedChrgitmType == "14" { //其他费
3263
 			otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3247
 			otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
3264
-			otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3265
-			otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
3248
+			otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
3249
+			otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
3266
 		}
3250
 		}
3267
 
3251
 
3268
 	}
3252
 	}

+ 2 - 0
models/drug.go 查看文件

57
 	SocialSecurityDirectoryCode string  `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
57
 	SocialSecurityDirectoryCode string  `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
58
 	DoseCode                    string  `gorm:"column:dose_code" json:"dose_code" form:"dose_code"`
58
 	DoseCode                    string  `gorm:"column:dose_code" json:"dose_code" form:"dose_code"`
59
 	IsMark                      int64   `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
59
 	IsMark                      int64   `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
60
+	HospApprFlag                int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
61
+	LmtUsedFlag                 int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
60
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
62
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
61
 }
63
 }
62
 
64
 

+ 2 - 0
models/his_models.go 查看文件

435
 	OrgId                  int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
435
 	OrgId                  int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
436
 	DrugCode               string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
436
 	DrugCode               string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
437
 	MedicalInsuranceNumber string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number"`
437
 	MedicalInsuranceNumber string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number"`
438
+	HospApprFlag           int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
439
+	LmtUsedFlag            int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
438
 }
440
 }
439
 
441
 
440
 func (VMDrug) TableName() string {
442
 func (VMDrug) TableName() string {

+ 2 - 0
models/self_drug_models.go 查看文件

64
 	Mtime                  int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
64
 	Mtime                  int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
65
 	OrgId                  int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
65
 	OrgId                  int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
66
 	IsMark                 int64   `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
66
 	IsMark                 int64   `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
67
+	HospApprFlag           int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
68
+	LmtUsedFlag            int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
67
 }
69
 }
68
 
70
 
69
 func (XtBaseDrug) TableName() string {
71
 func (XtBaseDrug) TableName() string {

+ 22 - 7
service/gdyb_service.go 查看文件

541
 	FeedetlSn        string
541
 	FeedetlSn        string
542
 	Price            string
542
 	Price            string
543
 	MedListCodg      string
543
 	MedListCodg      string
544
+	LmtUsedFlag      int64
545
+	HospApprFlag     int64
544
 }
546
 }
545
 
547
 
546
 type RequestResult struct {
548
 type RequestResult struct {
614
 						FeedetlSn:        subItem.FeedetlSn,
616
 						FeedetlSn:        subItem.FeedetlSn,
615
 						Price:            fmt.Sprintf("%.2f", subItem.Price),
617
 						Price:            fmt.Sprintf("%.2f", subItem.Price),
616
 						MedListCodg:      subItem.BaseDrugLib.MedicalInsuranceNumber,
618
 						MedListCodg:      subItem.BaseDrugLib.MedicalInsuranceNumber,
619
+						HospApprFlag:     subItem.BaseDrugLib.HospApprFlag,
617
 					}
620
 					}
618
 
621
 
619
 					customs = append(customs, cus)
622
 					customs = append(customs, cus)
633
 						FeedetlSn:        subItem.FeedetlSn,
636
 						FeedetlSn:        subItem.FeedetlSn,
634
 						Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
637
 						Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
635
 						MedListCodg:      subItem.HisProject.MedicalCode,
638
 						MedListCodg:      subItem.HisProject.MedicalCode,
639
+						HospApprFlag:     -1,
636
 					}
640
 					}
637
 					customs = append(customs, cus)
641
 					customs = append(customs, cus)
638
 				}
642
 				}
647
 					FeedetlSn:        subItem.FeedetlSn,
651
 					FeedetlSn:        subItem.FeedetlSn,
648
 					Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
652
 					Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
649
 					MedListCodg:      subItem.XtHisAddtionConfig.Code,
653
 					MedListCodg:      subItem.XtHisAddtionConfig.Code,
654
+					HospApprFlag:     -1,
650
 				}
655
 				}
651
 				customs = append(customs, cus)
656
 				customs = append(customs, cus)
652
 			}
657
 			}
687
 		feedetailInfo["acord_dept_name"] = ""                        // 受单科室名称
692
 		feedetailInfo["acord_dept_name"] = ""                        // 受单科室名称
688
 		feedetailInfo["orders_dr_code"] = ""                         // 受单医生编码
693
 		feedetailInfo["orders_dr_code"] = ""                         // 受单医生编码
689
 		feedetailInfo["orders_dr_name"] = ""                         // 受单医生姓名
694
 		feedetailInfo["orders_dr_name"] = ""                         // 受单医生姓名
690
-		feedetailInfo["hosp_appr_flag"] = "1"                        // 医院审批标志
691
-		feedetailInfo["tcmdrug_used_way"] = ""                       // 中药使用方式
692
-		feedetailInfo["etip_flag"] = ""                              // 外检标志
693
-		feedetailInfo["etip_hosp_code"] = ""                         // 外检医院编码
694
-		feedetailInfo["dscg_tkdrug_flag"] = ""                       // 出院带药标志
695
-		feedetailInfo["matn_fee_flag"] = ""                          // 生育费用标志
695
+
696
+		if item.HospApprFlag != -1 {
697
+			feedetailInfo["hosp_appr_flag"] = item.HospApprFlag // 医院审批标志
698
+		} else {
699
+			feedetailInfo["hosp_appr_flag"] = "" // 医院审批标志
700
+		}
701
+
702
+		feedetailInfo["tcmdrug_used_way"] = "" // 中药使用方式
703
+		feedetailInfo["etip_flag"] = ""        // 外检标志
704
+		feedetailInfo["etip_hosp_code"] = ""   // 外检医院编码
705
+		feedetailInfo["dscg_tkdrug_flag"] = "" // 出院带药标志
706
+		feedetailInfo["matn_fee_flag"] = ""    // 生育费用标志
696
 		feedetail = append(feedetail, feedetailInfo)
707
 		feedetail = append(feedetail, feedetailInfo)
697
 	}
708
 	}
698
 	input["feedetail"] = feedetail
709
 	input["feedetail"] = feedetail
1791
 
1802
 
1792
 	timeFormatTwo := tempTime.Format("2006-01-02")
1803
 	timeFormatTwo := tempTime.Format("2006-01-02")
1793
 
1804
 
1805
+	t := time.Now()
1806
+	last := time.Date(t.Year(), time.December, 31, 0, 0, 0, 0, time.UTC)
1807
+	tm := time.Unix(last.Unix(), 0)
1808
+
1794
 	// 生成输入报文
1809
 	// 生成输入报文
1795
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
1810
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
1796
 	input := make(map[string]interface{})
1811
 	input := make(map[string]interface{})
1809
 	inputData["begndate"] = timeFormatTwo          // 医师编码
1824
 	inputData["begndate"] = timeFormatTwo          // 医师编码
1810
 	inputData["tel"] = ""                          // 医师编码
1825
 	inputData["tel"] = ""                          // 医师编码
1811
 	inputData["addr"] = ""                         // 医师编码
1826
 	inputData["addr"] = ""                         // 医师编码
1812
-	inputData["enddate"] = "2099-12-31"            // 医师编码
1827
+	inputData["enddate"] = tm.Format("2006-01-02") // 医师编码
1813
 
1828
 
1814
 	input["data"] = inputData
1829
 	input["data"] = inputData
1815
 	inputMessage["input"] = input //交易输入
1830
 	inputMessage["input"] = input //交易输入

+ 2 - 0
service/his_service.go 查看文件

390
 	Mtime                  int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
390
 	Mtime                  int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
391
 	OrgId                  int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
391
 	OrgId                  int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
392
 	DrugCode               string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
392
 	DrugCode               string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
393
+	HospApprFlag           int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
394
+	LmtUsedFlag            int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
393
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
395
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
394
 	OtherDrugWarehouseInfo []*OtherDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"stock_in"`
396
 	OtherDrugWarehouseInfo []*OtherDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"stock_in"`
395
 	VMDrugSalesReturnInfo  []*VMDrugSalesReturnInfo  `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"sales_return"`
397
 	VMDrugSalesReturnInfo  []*VMDrugSalesReturnInfo  `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"sales_return"`