|
@@ -91,9 +91,9 @@ func HisManagerApiRegistRouters() {
|
91
|
91
|
|
92
|
92
|
beego.Router("/api/2505", &HisApiController{}, "get:Get2505")
|
93
|
93
|
|
94
|
|
- //beego.Router("/api/4201A", &HisApiController{}, "get:Get4201A")
|
95
|
|
- //beego.Router("/api/4202", &HisApiController{}, "get:Get4202")
|
96
|
|
- //beego.Router("/api/4203", &HisApiController{}, "get:Get4203")
|
|
94
|
+ beego.Router("/api/4201A", &HisApiController{}, "get:Get4201A")
|
|
95
|
+ beego.Router("/api/4202", &HisApiController{}, "get:Get4202")
|
|
96
|
+ beego.Router("/api/4203", &HisApiController{}, "get:Get4203")
|
97
|
97
|
//beego.Router("/api/4205", &HisApiController{}, "get:Get4205")
|
98
|
98
|
//beego.Router("/api/4207", &HisApiController{}, "get:Get4207")
|
99
|
99
|
//beego.Router("/api/4208", &HisApiController{}, "get:Get4208")
|
|
@@ -109,123 +109,189 @@ func (c *HisApiController) Get2505() {
|
109
|
109
|
|
110
|
110
|
}
|
111
|
111
|
|
112
|
|
-//func (c *HisApiController) Get4201A(){
|
113
|
|
-// order_id, _ := c.GetInt64("order_id")
|
114
|
|
-// admin_user_id, _ := c.GetInt64("admin_user_id")
|
115
|
|
-// order, _ := service.GetHisOrderByIDTwo(order_id)
|
116
|
|
-// his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
117
|
|
-// order_info, _ := service.GetHisOrderInfoByNumber(order.MdtrtId)
|
118
|
|
-// order_info_two, _ := service.GetHisOrderInfoByNumberTwo(order.MdtrtId)
|
119
|
|
-// order_info = append(order_info, order_info_two...)
|
120
|
|
-// curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
121
|
|
-// miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
122
|
|
-//
|
123
|
|
-// department,_ := service.GetDepartMentDetail(his.Departments)
|
124
|
|
-//
|
125
|
|
-//
|
126
|
|
-//
|
127
|
|
-//
|
128
|
|
-// if order.ID == 0 {
|
129
|
|
-// c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisOrderNoExistParamWrong)
|
130
|
|
-// return
|
131
|
|
-// }
|
132
|
|
-// var fsiOPFLDs []models.FsiOwnpayPatnFeeListDDTO
|
133
|
|
-// for _,items := range order_info{
|
134
|
|
-// var fsiOPFLD models.FsiOwnpayPatnFeeListDDTO
|
135
|
|
-// fsiOPFLD.FixmedinsMdtrtID = items.OrderNumber
|
136
|
|
-// fsiOPFLD.MedType = "14"
|
137
|
|
-// fsiOPFLD.BkkpSn = items.OrderNumber
|
138
|
|
-// fsiOPFLD.FeeOcurTime = time.Unix(items.HisDoctorAdviceInfo.CreatedTime,0).Format("2006-01-02 15:04:05")
|
139
|
|
-// fsiOPFLD.FixmedinsCode = miConfig.Code
|
140
|
|
-// fsiOPFLD.FixmedinsName = miConfig.OrgName
|
141
|
|
-// fsiOPFLD.Cnt = fmt.Sprintf("%.2f", items.Cnt)
|
142
|
|
-// fsiOPFLD.Pric = fmt.Sprintf("%.2f", items.Pric)
|
143
|
|
-// fsiOPFLD.MedChrgitmType = "09"
|
144
|
|
-// fsiOPFLD.Prodname = items.HisDoctorAdviceInfo.AdviceName
|
145
|
|
-// fsiOPFLD.BilgDeptCodg = department.Number
|
146
|
|
-// fsiOPFLD.BilgDeptName = department.Name
|
147
|
|
-//
|
148
|
|
-//
|
149
|
|
-//
|
150
|
|
-//
|
151
|
|
-//
|
152
|
|
-//
|
153
|
|
-// }
|
154
|
|
-//
|
155
|
|
-//
|
156
|
|
-//
|
157
|
|
-//
|
158
|
|
-//
|
159
|
|
-//
|
160
|
|
-//}
|
161
|
|
-//func (c *HisApiController) Get4202(){
|
162
|
|
-// order_id, _ := c.GetInt64("order_id")
|
163
|
|
-// admin_user_id, _ := c.GetInt64("admin_user_id")
|
164
|
|
-// order, _ := service.GetHisOrderByIDTwo(order_id)
|
165
|
|
-// his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
166
|
|
-// curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
167
|
|
-// miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
168
|
|
-//
|
169
|
|
-// if order.ID == 0 {
|
170
|
|
-// c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisOrderNoExistParamWrong)
|
171
|
|
-// return
|
172
|
|
-// }
|
173
|
|
-//
|
174
|
|
-// var struct4202 models.Struct4202
|
175
|
|
-// struct4202.OwnPayPatnMdtrtD.FixmedinsMdtrtID = his.Number
|
176
|
|
-// struct4202.OwnPayPatnMdtrtD.FixmedinsCode = miConfig.Code
|
177
|
|
-// struct4202.OwnPayPatnMdtrtD.FixmedinsName = miConfig.OrgName
|
178
|
|
-// struct4202.OwnPayPatnMdtrtD.PsnCertType ="01"
|
179
|
|
-// struct4202.OwnPayPatnMdtrtD.Certno =his.IdCardNo
|
180
|
|
-// struct4202.OwnPayPatnMdtrtD.PsnName = his.Name
|
181
|
|
-// struct4202.OwnPayPatnMdtrtD.Begntime = his.InHosptialTime
|
182
|
|
-// struct4202.OwnPayPatnMdtrtD.MedType = "14"
|
183
|
|
-// struct4202.OwnPayPatnMdtrtD.ValiFlag = "1"
|
184
|
|
-// struct4202.OwnPayPatnMdtrtD.MedfeeSumamt = fmt.Sprintf("%.2f",order.MedfeeSumamt)
|
185
|
|
-//
|
186
|
|
-//
|
187
|
|
-// diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
188
|
|
-// var config []*models.HisXtDiagnoseConfig
|
189
|
|
-// for _, item := range diagnosis_ids {
|
190
|
|
-// id, _ := strconv.ParseInt(item, 10, 64)
|
191
|
|
-// diagnosisConfig, _ := service.FindDiagnoseById(id)
|
192
|
|
-// config = append(config, &diagnosisConfig)
|
193
|
|
-// }
|
194
|
|
-// var tempDiaginfos []models.OwnPayPatnDiagListD
|
195
|
|
-// for index, item := range config {
|
196
|
|
-// if index == 0 {
|
197
|
|
-// var tempDiaginfo models.OwnPayPatnDiagListD
|
198
|
|
-// tempDiaginfo.InoutDiagType = "1"
|
199
|
|
-// tempDiaginfo.DiagCode = item.CountryCode
|
200
|
|
-// tempDiaginfo.DiagName = item.CountryContentName
|
201
|
|
-// tempDiaginfo.DiagType = "1"
|
202
|
|
-// tempDiaginfo.DiagSrtNo = "1"
|
203
|
|
-// tempDiaginfo.MaindiagFlag = "1"
|
204
|
|
-// tempDiaginfo.ValiFlag = "1"
|
205
|
|
-// tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
206
|
|
-// } else {
|
207
|
|
-//
|
208
|
|
-// var tempDiaginfo models.OwnPayPatnDiagListD
|
209
|
|
-// tempDiaginfo.DiagCode = item.CountryCode
|
210
|
|
-// tempDiaginfo.DiagName = item.CountryContentName
|
211
|
|
-// tempDiaginfo.DiagType = "2"
|
212
|
|
-// tempDiaginfo.DiagSrtNo = strconv.FormatInt(int64(index+1),10)
|
213
|
|
-// tempDiaginfo.MaindiagFlag = "0"
|
214
|
|
-// tempDiaginfo.ValiFlag = "1"
|
215
|
|
-// tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
216
|
|
-// }
|
217
|
|
-// }
|
218
|
|
-// struct4202.ODiagListD = tempDiaginfos
|
219
|
|
-// service.Gdyb4202(miConfig.OrgName,curRoles.UserName,miConfig.Code,miConfig.InsuplcAdmdvs,miConfig.MdtrtareaAdmvs,miConfig.SecretKey,struct4202)
|
220
|
|
-//
|
221
|
|
-//
|
222
|
|
-//
|
223
|
|
-//
|
224
|
|
-//}
|
225
|
|
-//func (c *HisApiController) Get4203(){
|
226
|
|
-//
|
227
|
|
-//
|
228
|
|
-//}
|
|
112
|
+func (c *HisApiController) Get4201A() {
|
|
113
|
+ order_id, _ := c.GetInt64("order_id")
|
|
114
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
115
|
+ order, _ := service.GetHisOrderByIDTwo(order_id)
|
|
116
|
+ his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
|
117
|
+ order_info, _ := service.GetHisOrderInfoByNumber(order.MdtrtId)
|
|
118
|
+ order_info_two, _ := service.GetHisOrderInfoByNumberTwo(order.MdtrtId)
|
|
119
|
+ order_info = append(order_info, order_info_two...)
|
|
120
|
+ curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
|
121
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
122
|
+ department, _ := service.GetDepartMentDetail(his.Departments)
|
|
123
|
+ pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
|
|
124
|
+ doctor, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, pre.Creator)
|
|
125
|
+
|
|
126
|
+ if order.ID == 0 {
|
|
127
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisOrderNoExistParamWrong)
|
|
128
|
+ return
|
|
129
|
+ }
|
|
130
|
+ var struct4201A models.Struct4201A
|
|
131
|
+ var fsiOPFLDs []models.FsiOwnpayPatnFeeListDDTO
|
|
132
|
+ for _, items := range order_info {
|
|
133
|
+ var fsiOPFLD models.FsiOwnpayPatnFeeListDDTO
|
|
134
|
+ fsiOPFLD.FixmedinsMdtrtID = items.OrderNumber
|
|
135
|
+ fsiOPFLD.MedType = "14"
|
|
136
|
+ fsiOPFLD.BkkpSn = items.OrderNumber
|
|
137
|
+ fsiOPFLD.FeeOcurTime = time.Unix(items.HisDoctorAdviceInfo.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
|
138
|
+ fsiOPFLD.FixmedinsCode = miConfig.Code
|
|
139
|
+ fsiOPFLD.FixmedinsName = miConfig.OrgName
|
|
140
|
+ fsiOPFLD.Cnt = fmt.Sprintf("%.2f", items.Cnt)
|
|
141
|
+ fsiOPFLD.Pric = fmt.Sprintf("%.2f", items.Pric)
|
|
142
|
+ fsiOPFLD.DetItemFeeSumamt = fmt.Sprintf("%.2f", items.DetItemFeeSumamt)
|
|
143
|
+
|
|
144
|
+ if items.AdviceId > 0 && items.ProjectId == 0 {
|
|
145
|
+ fsiOPFLD.MedinsListCodg = items.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
|
|
146
|
+ fsiOPFLD.MedinsListName = items.HisDoctorAdviceInfo.BaseDrugLib.DrugName
|
|
147
|
+ fsiOPFLD.Prodname = items.HisDoctorAdviceInfo.BaseDrugLib.DrugName
|
|
148
|
+ fsiOPFLD.BilgDeptName = department.Name
|
|
149
|
+ fsiOPFLD.BilgDeptCodg = department.Number
|
|
150
|
+ fsiOPFLD.BilgDrCode = doctor.DoctorCode
|
|
151
|
+ fsiOPFLD.BilgDrName = doctor.UserName
|
|
152
|
+
|
|
153
|
+ } else if items.AdviceId == 0 && items.ProjectId > 0 {
|
|
154
|
+ fsiOPFLD.MedinsListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
|
|
155
|
+ fsiOPFLD.MedinsListName = items.HisPrescriptionProject.HisProject.ProjectName
|
|
156
|
+ fsiOPFLD.Prodname = items.HisPrescriptionProject.HisProject.ProjectName
|
|
157
|
+ fsiOPFLD.BilgDeptName = department.Name
|
|
158
|
+ fsiOPFLD.BilgDeptCodg = department.Number
|
|
159
|
+ fsiOPFLD.BilgDrCode = doctor.DoctorCode
|
|
160
|
+ fsiOPFLD.BilgDrName = doctor.UserName
|
|
161
|
+ }
|
|
162
|
+
|
|
163
|
+ //fsiOPFLD.DetItemFeeSumamt = items.DetItemFeeSumamt
|
|
164
|
+ fsiOPFLD.MedChrgitmType = "09"
|
|
165
|
+ fsiOPFLD.Prodname = items.HisDoctorAdviceInfo.AdviceName
|
|
166
|
+ fsiOPFLD.BilgDeptCodg = department.Number
|
|
167
|
+ fsiOPFLD.BilgDeptName = department.Name
|
|
168
|
+ fsiOPFLDs = append(fsiOPFLDs, fsiOPFLD)
|
|
169
|
+ }
|
|
170
|
+ struct4201A.Fopfd = fsiOPFLDs
|
|
171
|
+ result, requestLog := service.Gdyb4201A(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, struct4201A)
|
|
172
|
+
|
|
173
|
+}
|
|
174
|
+func (c *HisApiController) Get4202() {
|
|
175
|
+ order_id, _ := c.GetInt64("order_id")
|
|
176
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
177
|
+ order, _ := service.GetHisOrderByIDTwo(order_id)
|
|
178
|
+ his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
|
179
|
+ curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
|
180
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
181
|
+
|
|
182
|
+ if order.ID == 0 {
|
|
183
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisOrderNoExistParamWrong)
|
|
184
|
+ return
|
|
185
|
+ }
|
|
186
|
+
|
|
187
|
+ var struct4202 models.Struct4202
|
|
188
|
+ struct4202.OwnPayPatnMdtrtD.FixmedinsMdtrtID = his.Number
|
|
189
|
+ struct4202.OwnPayPatnMdtrtD.FixmedinsCode = miConfig.Code
|
|
190
|
+ struct4202.OwnPayPatnMdtrtD.FixmedinsName = miConfig.OrgName
|
|
191
|
+ struct4202.OwnPayPatnMdtrtD.PsnCertType = "01"
|
|
192
|
+ struct4202.OwnPayPatnMdtrtD.Certno = his.IdCardNo
|
|
193
|
+ struct4202.OwnPayPatnMdtrtD.PsnName = his.Name
|
|
194
|
+ struct4202.OwnPayPatnMdtrtD.Begntime = his.InHosptialTime
|
|
195
|
+ struct4202.OwnPayPatnMdtrtD.MedType = "14"
|
|
196
|
+ struct4202.OwnPayPatnMdtrtD.ValiFlag = "1"
|
|
197
|
+ struct4202.OwnPayPatnMdtrtD.MedfeeSumamt = fmt.Sprintf("%.2f", order.MedfeeSumamt)
|
|
198
|
+
|
|
199
|
+ diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
|
200
|
+ var config []*models.HisXtDiagnoseConfig
|
|
201
|
+ for _, item := range diagnosis_ids {
|
|
202
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
203
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
204
|
+ config = append(config, &diagnosisConfig)
|
|
205
|
+ }
|
|
206
|
+ var tempDiaginfos []models.OwnPayPatnDiagListD
|
|
207
|
+ for index, item := range config {
|
|
208
|
+ if index == 0 {
|
|
209
|
+ var tempDiaginfo models.OwnPayPatnDiagListD
|
|
210
|
+ tempDiaginfo.InoutDiagType = "1"
|
|
211
|
+ tempDiaginfo.DiagCode = item.CountryCode
|
|
212
|
+ tempDiaginfo.DiagName = item.CountryContentName
|
|
213
|
+ tempDiaginfo.DiagType = "1"
|
|
214
|
+ tempDiaginfo.DiagSrtNo = "1"
|
|
215
|
+ tempDiaginfo.MaindiagFlag = "1"
|
|
216
|
+ tempDiaginfo.ValiFlag = "1"
|
|
217
|
+ tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
|
218
|
+ } else {
|
|
219
|
+
|
|
220
|
+ var tempDiaginfo models.OwnPayPatnDiagListD
|
|
221
|
+ tempDiaginfo.DiagCode = item.CountryCode
|
|
222
|
+ tempDiaginfo.DiagName = item.CountryContentName
|
|
223
|
+ tempDiaginfo.DiagType = "2"
|
|
224
|
+ tempDiaginfo.DiagSrtNo = strconv.FormatInt(int64(index+1), 10)
|
|
225
|
+ tempDiaginfo.MaindiagFlag = "0"
|
|
226
|
+ tempDiaginfo.ValiFlag = "1"
|
|
227
|
+ tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
|
228
|
+ }
|
|
229
|
+ }
|
|
230
|
+ struct4202.ODiagListD = tempDiaginfos
|
|
231
|
+ result, requestLog := service.Gdyb4202(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, struct4202)
|
|
232
|
+ saveLog(result, requestLog, "4202", "自费就诊和诊断信息上传")
|
|
233
|
+ var res2 ResultSix
|
|
234
|
+ var respJSON2 map[string]interface{}
|
|
235
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
|
|
236
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
237
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
238
|
+ return
|
|
239
|
+ }
|
|
240
|
+ userJSONBytes2, _ := json.Marshal(respJSON2)
|
|
241
|
+ if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
|
|
242
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
243
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
244
|
+ return
|
|
245
|
+ }
|
|
246
|
+ if res2.Infcode != 0 {
|
|
247
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
248
|
+ "failed_code": -10,
|
|
249
|
+ "msg": res2.ErrMsg,
|
|
250
|
+ })
|
|
251
|
+ return
|
|
252
|
+
|
|
253
|
+ } else {
|
|
254
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
255
|
+ "msg": "上传成功",
|
|
256
|
+ })
|
|
257
|
+ }
|
|
258
|
+}
|
|
259
|
+func (c *HisApiController) Get4203() {
|
|
260
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
261
|
+ curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
|
262
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
263
|
+ order_id, _ := c.GetInt64("order_id")
|
|
264
|
+ order, _ := service.GetHisOrderByIDTwo(order_id)
|
|
265
|
+ his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
|
266
|
+ result, requestLog := service.Gdyb4203(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, his.Number)
|
|
267
|
+ saveLog(result, requestLog, "4203", "自费就诊与结算明细上传完成")
|
|
268
|
+ var res2 ResultSix
|
|
269
|
+ var respJSON2 map[string]interface{}
|
|
270
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
|
|
271
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
272
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
273
|
+ return
|
|
274
|
+ }
|
|
275
|
+ userJSONBytes2, _ := json.Marshal(respJSON2)
|
|
276
|
+ if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
|
|
277
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
278
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
279
|
+ return
|
|
280
|
+ }
|
|
281
|
+ if res2.Infcode != 0 {
|
|
282
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
283
|
+ "failed_code": -10,
|
|
284
|
+ "msg": res2.ErrMsg,
|
|
285
|
+ })
|
|
286
|
+ return
|
|
287
|
+
|
|
288
|
+ } else {
|
|
289
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
290
|
+ "msg": "上传成功",
|
|
291
|
+ })
|
|
292
|
+ }
|
|
293
|
+}
|
|
294
|
+
|
229
|
295
|
//func (c *HisApiController) Get4205(){
|
230
|
296
|
//
|
231
|
297
|
//
|
|
@@ -2354,7 +2420,7 @@ func (c *HisApiController) ReadCard() {
|
2354
|
2420
|
}
|
2355
|
2421
|
|
2356
|
2422
|
if len(insutypes) == 0 {
|
2357
|
|
- insutype = "310"
|
|
2423
|
+ insutype = "390"
|
2358
|
2424
|
}
|
2359
|
2425
|
|
2360
|
2426
|
c.ServeSuccessJSON(map[string]interface{}{
|
|
@@ -3605,7 +3671,7 @@ func (c *HisApiController) ReadCard() {
|
3605
|
3671
|
token := ele.Data.EcToken
|
3606
|
3672
|
fmt.Println(inputInfo)
|
3607
|
3673
|
fmt.Println(outPutInfo)
|
3608
|
|
- result, requestLog, errMsgLog := service.FJyb1101ForEleToken(ele.Data.IDNo, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, id_card_type, "", 1, miConfig.Url, miConfig.Cainfo, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey, token, ele.Data.UserName)
|
|
3674
|
+ result, requestLog, errMsgLog := service.FJyb1101ForEleToken(ele.Data.IDNo, miConfig.OrgName, roles.UserName, miConfig.Code, ele.Data.InsuOrg, miConfig.MdtrtareaAdmvs, id_card_type, "", 1, miConfig.Url, miConfig.Cainfo, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey, token, ele.Data.UserName)
|
3609
|
3675
|
saveLog(result, requestLog, "1101", "获取人员信息")
|
3610
|
3676
|
var dat map[string]interface{}
|
3611
|
3677
|
if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
@@ -3638,20 +3704,21 @@ func (c *HisApiController) ReadCard() {
|
3638
|
3704
|
infoStr := string(Iinfos)
|
3639
|
3705
|
idetinfoStr := string(Idetinfos)
|
3640
|
3706
|
psn := &models.HisPsn{
|
3641
|
|
- PsnNo: res.Output.Baseinfo.PsnNo,
|
3642
|
|
- Age: res.Output.Baseinfo.Age,
|
3643
|
|
- PatientId: patient.ID,
|
3644
|
|
- Certno: res.Output.Baseinfo.Certno,
|
3645
|
|
- Brdy: res.Output.Baseinfo.Brdy,
|
3646
|
|
- Gend: res.Output.Baseinfo.Gend,
|
3647
|
|
- Naty: res.Output.Baseinfo.Naty,
|
3648
|
|
- PsnCertType: res.Output.Baseinfo.PsnCertType,
|
3649
|
|
- PsnName: res.Output.Baseinfo.PsnName,
|
3650
|
|
- Idetinfo: idetinfoStr,
|
3651
|
|
- Insuinfo: infoStr,
|
3652
|
|
- UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
3653
|
|
- CardInfo: outPutInfo,
|
3654
|
|
- VerifyNumber: token,
|
|
3707
|
+ PsnNo: res.Output.Baseinfo.PsnNo,
|
|
3708
|
+ Age: res.Output.Baseinfo.Age,
|
|
3709
|
+ PatientId: patient.ID,
|
|
3710
|
+ Certno: res.Output.Baseinfo.Certno,
|
|
3711
|
+ Brdy: res.Output.Baseinfo.Brdy,
|
|
3712
|
+ Gend: res.Output.Baseinfo.Gend,
|
|
3713
|
+ Naty: res.Output.Baseinfo.Naty,
|
|
3714
|
+ PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
3715
|
+ PsnName: res.Output.Baseinfo.PsnName,
|
|
3716
|
+ Idetinfo: idetinfoStr,
|
|
3717
|
+ Insuinfo: infoStr,
|
|
3718
|
+ UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
3719
|
+ CardInfo: outPutInfo,
|
|
3720
|
+ VerifyNumber: token,
|
|
3721
|
+ InsuplcAdmdvs: ele.Data.InsuOrg,
|
3655
|
3722
|
}
|
3656
|
3723
|
service.CreateHisPsn(psn)
|
3657
|
3724
|
|
|
@@ -4047,30 +4114,32 @@ func (c *HisApiController) GetSettleList() {
|
4047
|
4114
|
curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
4048
|
4115
|
depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
|
4049
|
4116
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
4117
|
+ pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
|
|
4118
|
+ doctor, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, pre.Creator)
|
4050
|
4119
|
|
4051
|
4120
|
if order.ID == 0 {
|
4052
|
4121
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisOrderNoExistParamWrong)
|
4053
|
4122
|
return
|
4054
|
4123
|
}
|
4055
|
4124
|
|
4056
|
|
- last_order, _ := service.GetLastHisOrder(c.GetAdminUserInfo().CurrentOrgId)
|
4057
|
|
- max_order, _ := service.GetLastHisOrderTwo(c.GetAdminUserInfo().CurrentOrgId)
|
4058
|
|
- count, _ := strconv.ParseInt(max_order.FaPiaoNumber, 10, 64)
|
4059
|
|
- fmt.Println(count)
|
4060
|
|
- var zero string
|
4061
|
|
- number := count + 1
|
4062
|
|
- if number >= 1000 {
|
4063
|
|
- zero = "0000" + strconv.FormatInt(number, 10)
|
4064
|
|
- } else if number >= 10000 {
|
4065
|
|
- zero = "000" + strconv.FormatInt(number, 10)
|
4066
|
|
- } else if number >= 100000 {
|
4067
|
|
- zero = "00" + strconv.FormatInt(number, 10)
|
4068
|
|
- } else if number >= 1000000 {
|
4069
|
|
- zero = "0" + strconv.FormatInt(number, 10)
|
4070
|
|
- } else {
|
4071
|
|
- zero = strconv.FormatInt(number, 10)
|
4072
|
|
- }
|
4073
|
|
- fmt.Println(zero)
|
|
4125
|
+ //last_order, _ := service.GetLastHisOrder(c.GetAdminUserInfo().CurrentOrgId)
|
|
4126
|
+ //max_order, _ := service.GetLastHisOrderTwo(c.GetAdminUserInfo().CurrentOrgId)
|
|
4127
|
+ //count, _ := strconv.ParseInt(max_order.FaPiaoNumber, 10, 64)
|
|
4128
|
+ //fmt.Println(count)
|
|
4129
|
+ //var zero string
|
|
4130
|
+ //number := count + 1
|
|
4131
|
+ //if number >= 1000 {
|
|
4132
|
+ // zero = "0000" + strconv.FormatInt(number, 10)
|
|
4133
|
+ //} else if number >= 10000 {
|
|
4134
|
+ // zero = "000" + strconv.FormatInt(number, 10)
|
|
4135
|
+ //} else if number >= 100000 {
|
|
4136
|
+ // zero = "00" + strconv.FormatInt(number, 10)
|
|
4137
|
+ //} else if number >= 1000000 {
|
|
4138
|
+ // zero = "0" + strconv.FormatInt(number, 10)
|
|
4139
|
+ //} else {
|
|
4140
|
+ // zero = strconv.FormatInt(number, 10)
|
|
4141
|
+ //}
|
|
4142
|
+ //fmt.Println(zero)
|
4074
|
4143
|
|
4075
|
4144
|
struct4101 := service.Struct4101{
|
4076
|
4145
|
PsnNo: order.PsnNo,
|
|
@@ -4144,7 +4213,6 @@ func (c *HisApiController) GetSettleList() {
|
4144
|
4213
|
tempDiaginfo.MaindiagFlag = "1"
|
4145
|
4214
|
tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
4146
|
4215
|
} else {
|
4147
|
|
-
|
4148
|
4216
|
var tempDiaginfo service.DiaginfoStructTwo
|
4149
|
4217
|
tempDiaginfo.DiagCode = item.CountryCode
|
4150
|
4218
|
tempDiaginfo.DiagName = item.CountryContentName
|
|
@@ -4529,6 +4597,9 @@ func (c *HisApiController) GetSettleList() {
|
4529
|
4597
|
struct4101.Ntly = "中国"
|
4530
|
4598
|
struct4101.AdmCaty = "A03.06"
|
4531
|
4599
|
|
|
4600
|
+ struct4101.DoctorName = doctor.UserName
|
|
4601
|
+ struct4101.DoctorCode = doctor.DoctorNumber
|
|
4602
|
+
|
4532
|
4603
|
var res ResultSeventeen
|
4533
|
4604
|
|
4534
|
4605
|
if miConfig.MdtrtareaAdmvs == "320921" || miConfig.MdtrtareaAdmvs == "320982" {
|
|
@@ -4613,7 +4684,6 @@ func (c *HisApiController) GetSettleList() {
|
4613
|
4684
|
}
|
4614
|
4685
|
|
4615
|
4686
|
} else if miConfig.MdtrtareaAdmvs == "430800" {
|
4616
|
|
-
|
4617
|
4687
|
var pp models.PublicParams
|
4618
|
4688
|
pp.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
4619
|
4689
|
pp.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
@@ -4663,9 +4733,9 @@ func (c *HisApiController) GetSettleList() {
|
4663
|
4733
|
})
|
4664
|
4734
|
return
|
4665
|
4735
|
} else {
|
4666
|
|
- order.FaPiaoNumber = zero
|
4667
|
|
- order.FaPiaoCode = last_order.FaPiaoCode
|
4668
|
|
- service.UpdateOrder(order)
|
|
4736
|
+ //order.FaPiaoNumber = zero
|
|
4737
|
+ //order.FaPiaoCode = last_order.FaPiaoCode
|
|
4738
|
+ //service.UpdateOrder(order)
|
4669
|
4739
|
hisFundSettleListResult := &models.HisFundSettleListResult{
|
4670
|
4740
|
Number: res.Output.SetlListId,
|
4671
|
4741
|
Status: 1,
|
|
@@ -7673,13 +7743,32 @@ func (c *HisApiController) GetRegisterInfo() {
|
7673
|
7743
|
json.Unmarshal([]byte(idetinfoStr), &rf)
|
7674
|
7744
|
if len(rf) > 0 {
|
7675
|
7745
|
if len(rf[0].Memo) > 0 {
|
|
7746
|
+ fmt.Println("122222222222222")
|
|
7747
|
+
|
7676
|
7748
|
content := rf[0].Memo[1:len(rf[0].Memo)]
|
7677
|
|
- content2 := content[:len(rf[0].Memo)-1]
|
|
7749
|
+ content2 := content[:len(content)-1]
|
7678
|
7750
|
fmt.Println(content2)
|
7679
|
|
- var rf2 ResultMemo
|
7680
|
|
- json.Unmarshal([]byte(content2), &rf2)
|
7681
|
|
- fmt.Println(rf2)
|
7682
|
|
- fmt.Println(rf2.InsuAdmdvs)
|
|
7751
|
+ //var rf2 ResultMemo
|
|
7752
|
+ //json.Unmarshal([]byte(content2), &rf2)
|
|
7753
|
+ //fmt.Println(rf2)
|
|
7754
|
+ //fmt.Println(rf2.InsuAdmdvs)
|
|
7755
|
+ arr := strings.Split(content2, ",")
|
|
7756
|
+
|
|
7757
|
+ var tarstring string
|
|
7758
|
+ for _, item := range arr {
|
|
7759
|
+ if find := strings.Contains(item, "insuAdmdvs"); find {
|
|
7760
|
+ tarstring = item
|
|
7761
|
+ }
|
|
7762
|
+ }
|
|
7763
|
+ fmt.Println(tarstring)
|
|
7764
|
+
|
|
7765
|
+ if len(tarstring) > 0 {
|
|
7766
|
+ arr := strings.Split(tarstring, ":")
|
|
7767
|
+
|
|
7768
|
+ insuplc_admdvs_temp = strings.Replace(arr[1], "\"", "", -1)
|
|
7769
|
+
|
|
7770
|
+ //insuplc_admdvs_temp = arr[1]
|
|
7771
|
+ }
|
7683
|
7772
|
|
7684
|
7773
|
}
|
7685
|
7774
|
}
|
|
@@ -7841,11 +7930,12 @@ func (c *HisApiController) GetRegisterInfo() {
|
7841
|
7930
|
cert_no = strings.Split(psn_info.CardInfo, "|")[0]
|
7842
|
7931
|
} else if id_card_type == 4 {
|
7843
|
7932
|
cert_no = psn_info.VerifyNumber
|
|
7933
|
+ insuplc_admdvs_temp = psn_info.InsuplcAdmdvs
|
7844
|
7934
|
} else {
|
7845
|
7935
|
cert_no = psn_info.VerifyNumber
|
7846
|
7936
|
}
|
7847
|
7937
|
|
7848
|
|
- result, requestLog, _ := service.FJyb2201(psn_info.PsnNo, insutype, IdCardNo, miConfig.OrgName, doctor_info.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, roles.UserName, doctor_info.UserName, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey, cert_no)
|
|
7938
|
+ result, requestLog, _ := service.FJyb2201(psn_info.PsnNo, insutype, IdCardNo, miConfig.OrgName, doctor_info.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, roles.UserName, doctor_info.UserName, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey, cert_no, record_time)
|
7849
|
7939
|
saveLog(result, requestLog, "2201", "挂号")
|
7850
|
7940
|
if miConfig.Code == "H15049901371" {
|
7851
|
7941
|
|
|
@@ -12451,8 +12541,8 @@ func (c *HisApiController) GetCheckAccount() {
|
12451
|
12541
|
loc, _ := time.LoadLocation("Local")
|
12452
|
12542
|
startime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
12453
|
12543
|
endtime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
12454
|
|
- orders, _ := service.GetOrderByTime(startime.Unix(), endtime.Unix(), adminUser.CurrentOrgId, insutype, "", clr_type)
|
12455
|
|
- orders_two, _ := service.GetOrderByTimeFive(startime.Unix(), endtime.Unix(), adminUser.CurrentOrgId, insutype, "", clr_type)
|
|
12544
|
+ orders, _ := service.GetOrderByTime(startime.Unix(), endtime.Unix(), adminUser.CurrentOrgId, insutype, "", clr_type, miConfig.MdtrtareaAdmvs)
|
|
12545
|
+ orders_two, _ := service.GetOrderByTimeFive(startime.Unix(), endtime.Unix(), adminUser.CurrentOrgId, insutype, "", clr_type, miConfig.MdtrtareaAdmvs)
|
12456
|
12546
|
|
12457
|
12547
|
fixmedins_setl_cnt := int64(len(orders))
|
12458
|
12548
|
var medfee_sumamt float64
|
|
@@ -12528,10 +12618,12 @@ func (c *HisApiController) GetCheckAccount() {
|
12528
|
12618
|
res.Infcode = infocode
|
12529
|
12619
|
|
12530
|
12620
|
} else if miConfig.MdtrtareaAdmvs == "150499" {
|
12531
|
|
-
|
|
12621
|
+ if clr_type == "11" {
|
|
12622
|
+ fixmedins_setl_cnt = 2
|
|
12623
|
+ }
|
12532
|
12624
|
api := "http://172.16.13.254:9532/" + "nmyb/3201?" +
|
12533
|
12625
|
"insutype=" + insutype +
|
12534
|
|
- "&clr_type=" + "21" +
|
|
12626
|
+ "&clr_type=" + clr_type +
|
12535
|
12627
|
"&setl_optins=" + clr_org +
|
12536
|
12628
|
"&stmt_begndate=" + start_time +
|
12537
|
12629
|
"&stm_enddate=" + end_time +
|
|
@@ -14490,12 +14582,22 @@ func (c *HisApiController) PsnPutNCDSOnRecord() {
|
14490
|
14582
|
end_time := c.GetString("end_time")
|
14491
|
14583
|
check_time := c.GetString("check_time")
|
14492
|
14584
|
|
|
14585
|
+ hospital_code := c.GetString("hospital_code")
|
|
14586
|
+ hospital_name := c.GetString("hospital_name")
|
|
14587
|
+
|
14493
|
14588
|
adminUser := c.GetAdminUserInfo()
|
14494
|
14589
|
patient, _ := service.GetPatientByID(adminUser.CurrentOrgId, patient_id)
|
14495
|
14590
|
miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
14496
|
14591
|
config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)
|
14497
|
14592
|
sick, _ := service.FindSickById(sick_id)
|
14498
|
14593
|
doctor, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, doctor_id)
|
|
14594
|
+ if len(hospital_code) == 0 {
|
|
14595
|
+
|
|
14596
|
+ hospital_code = miConfig.Code
|
|
14597
|
+ }
|
|
14598
|
+ if len(hospital_name) == 0 {
|
|
14599
|
+ hospital_name = miConfig.OrgName
|
|
14600
|
+ }
|
14499
|
14601
|
|
14500
|
14602
|
role, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, doctor_id)
|
14501
|
14603
|
var res ResultTwo
|
|
@@ -14629,7 +14731,7 @@ func (c *HisApiController) PsnPutNCDSOnRecord() {
|
14629
|
14731
|
if miConfig.MdtrtareaAdmvs == "320921" || miConfig.MdtrtareaAdmvs == "320982" {
|
14630
|
14732
|
|
14631
|
14733
|
} else {
|
14632
|
|
- result := service.Gdyb2503(psn_no, insutype, miConfig.OrgName, doctor.UserName, miConfig.Code, strconv.FormatInt(doctor.ID, 10), insuplc_admdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sick.ClassName, sick.ContentCode, start_time, end_time, check_time)
|
|
14734
|
+ result := service.Gdyb2503(psn_no, insutype, miConfig.OrgName, doctor.UserName, miConfig.Code, strconv.FormatInt(doctor.ID, 10), insuplc_admdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sick.ClassName, sick.ContentCode, start_time, end_time, check_time, hospital_code, hospital_name)
|
14633
|
14735
|
var dat map[string]interface{}
|
14634
|
14736
|
if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
14635
|
14737
|
fmt.Println(dat)
|