|
@@ -1138,7 +1138,7 @@ func (c *ZHHisApiController) GetSettleInfo() {
|
1138
|
1138
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
1139
|
1139
|
roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
1140
|
1140
|
order, _ := service.GetHisOrderByID(order_id)
|
1141
|
|
- allTotal := fmt.Sprintf("%.4f", order.MedfeeSumamt)
|
|
1141
|
+
|
1142
|
1142
|
var rf []*ResultFive
|
1143
|
1143
|
json.Unmarshal([]byte(record.Iinfo), &rf)
|
1144
|
1144
|
chrg_bchno := order.Number
|
|
@@ -1157,6 +1157,40 @@ func (c *ZHHisApiController) GetSettleInfo() {
|
1157
|
1157
|
}
|
1158
|
1158
|
var result string
|
1159
|
1159
|
var src_resquest string
|
|
1160
|
+
|
|
1161
|
+ timeLayout := "2006-01-02"
|
|
1162
|
+ loc, _ := time.LoadLocation("Local")
|
|
1163
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record.InHosptialTime, loc)
|
|
1164
|
+ if err != nil {
|
|
1165
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
1166
|
+ return
|
|
1167
|
+ }
|
|
1168
|
+ recordStartDateTime := theTime.Unix()
|
|
1169
|
+
|
|
1170
|
+ theTimeEnd, err := time.ParseInLocation(timeLayout+" 15:04:05", record.OutHosptialTime, loc)
|
|
1171
|
+ if err != nil {
|
|
1172
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
1173
|
+ return
|
|
1174
|
+ }
|
|
1175
|
+ recordEndDateTime := theTimeEnd.Unix()
|
|
1176
|
+
|
|
1177
|
+ prescriptions, _ := service.GetZHSettleMonthHisPrescription(c.GetAdminUserInfo().CurrentOrgId, patient_id, recordStartDateTime, recordEndDateTime)
|
|
1178
|
+
|
|
1179
|
+ var total float64
|
|
1180
|
+ for _, item := range prescriptions {
|
|
1181
|
+ if item.Type == 1 { //药品
|
|
1182
|
+ for _, subItem := range item.HisDoctorAdviceInfo {
|
|
1183
|
+ total = total + (subItem.Price * subItem.PrescribingNumber)
|
|
1184
|
+ }
|
|
1185
|
+ }
|
|
1186
|
+ if item.Type == 2 { //项目
|
|
1187
|
+ for _, subItem := range item.HisPrescriptionProject {
|
|
1188
|
+ cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
|
1189
|
+ total = total + (subItem.Price * cnt)
|
|
1190
|
+ }
|
|
1191
|
+ }
|
|
1192
|
+ }
|
|
1193
|
+ allTotal := fmt.Sprintf("%.2f", total)
|
1160
|
1194
|
result, src_resquest = service.ZHGdyb2304(record.PsnNo, record.Number, chrg_bchno, cert_no, record.InsutypeType, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, record.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, "0", record.IdCardType, 0, 0, 0, 0, record.Certificates)
|
1161
|
1195
|
//saveLog()
|
1162
|
1196
|
saveLog(result, src_resquest, "2304", "住院结算")
|