|
@@ -2293,64 +2293,66 @@ func (c *HisApiController) ReadCard() {
|
2293
|
2293
|
return
|
2294
|
2294
|
}
|
2295
|
2295
|
} else if miConfig.MdtrtareaAdmvs == "440300" || miConfig.MdtrtareaAdmvs == "440305" {
|
2296
|
|
- result, requestLog := service.Gdyb6101(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey)
|
2297
|
|
- saveLog(result, requestLog, "6101", "电子凭证")
|
2298
|
|
- var ele ELeCertData
|
2299
|
|
- err := json.Unmarshal([]byte(result), &ele)
|
2300
|
|
- if err != nil {
|
2301
|
|
- utils.ErrorLog("解析失败:%v", err)
|
2302
|
|
- }
|
2303
|
|
- result2, requestLog2 := service.Gdyb1101ForEleCert(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, ele.Data.EcToken)
|
2304
|
|
- saveLog(result2, requestLog2, "1101", "获取人员信息")
|
2305
|
|
-
|
2306
|
|
- var res ResultTwo
|
2307
|
|
- if err := json.Unmarshal([]byte(result2), &res); err != nil {
|
2308
|
|
- utils.ErrorLog("解析失败:%v", err)
|
2309
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
2310
|
|
- return
|
2311
|
|
- }
|
2312
|
|
-
|
2313
|
|
- if res.Infcode == 0 {
|
2314
|
|
- patient, err := service.GetPatientByNumber(ele.Data.IDNo, c.GetAdminUserInfo().CurrentOrgId)
|
2315
|
|
- if err == gorm.ErrRecordNotFound {
|
2316
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
|
2317
|
|
- return
|
2318
|
|
- } else if err != nil {
|
2319
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
2320
|
|
- return
|
2321
|
|
-
|
2322
|
|
- } else {
|
2323
|
|
- Iinfos, _ := json.Marshal(res.Output.Iinfo)
|
2324
|
|
- Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
2325
|
|
- infoStr := string(Iinfos)
|
2326
|
|
- idetinfoStr := string(Idetinfos)
|
2327
|
|
- psn := &models.HisPsn{
|
2328
|
|
- PsnNo: res.Output.Baseinfo.PsnNo,
|
2329
|
|
- Age: res.Output.Baseinfo.Age,
|
2330
|
|
- PatientId: patient.ID,
|
2331
|
|
- Certno: res.Output.Baseinfo.Certno,
|
2332
|
|
- Brdy: res.Output.Baseinfo.Brdy,
|
2333
|
|
- Gend: res.Output.Baseinfo.Gend,
|
2334
|
|
- Naty: res.Output.Baseinfo.Naty,
|
2335
|
|
- PsnCertType: res.Output.Baseinfo.PsnCertType,
|
2336
|
|
- PsnName: res.Output.Baseinfo.PsnName,
|
2337
|
|
- Idetinfo: idetinfoStr,
|
2338
|
|
- Insuinfo: infoStr,
|
2339
|
|
- UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
2340
|
|
- CardInfo: "",
|
2341
|
|
- VerifyNumber: ele.Data.EcToken,
|
2342
|
|
- }
|
2343
|
|
- service.CreateHisPsn(psn)
|
2344
|
|
-
|
2345
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
2346
|
|
- "patient": patient,
|
2347
|
|
- "number": ele.Data.EcToken,
|
2348
|
|
- })
|
2349
|
|
- }
|
2350
|
|
- } else {
|
2351
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
|
2352
|
|
- return
|
2353
|
|
- }
|
|
2296
|
+ c.GetEleBaseInfo()
|
|
2297
|
+
|
|
2298
|
+ //result, requestLog := service.Gdyb6101(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey)
|
|
2299
|
+ //saveLog(result, requestLog, "6101", "电子凭证")
|
|
2300
|
+ //var ele ELeCertData
|
|
2301
|
+ //err := json.Unmarshal([]byte(result), &ele)
|
|
2302
|
+ //if err != nil {
|
|
2303
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
2304
|
+ //}
|
|
2305
|
+ //result2, requestLog2 := service.Gdyb1101ForEleCert(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, ele.Data.EcToken)
|
|
2306
|
+ //saveLog(result2, requestLog2, "1101", "获取人员信息")
|
|
2307
|
+ //
|
|
2308
|
+ //var res ResultTwo
|
|
2309
|
+ //if err := json.Unmarshal([]byte(result2), &res); err != nil {
|
|
2310
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
2311
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
2312
|
+ // return
|
|
2313
|
+ //}
|
|
2314
|
+ //
|
|
2315
|
+ //if res.Infcode == 0 {
|
|
2316
|
+ // patient, err := service.GetPatientByNumber(ele.Data.IDNo, c.GetAdminUserInfo().CurrentOrgId)
|
|
2317
|
+ // if err == gorm.ErrRecordNotFound {
|
|
2318
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
|
|
2319
|
+ // return
|
|
2320
|
+ // } else if err != nil {
|
|
2321
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
2322
|
+ // return
|
|
2323
|
+ //
|
|
2324
|
+ // } else {
|
|
2325
|
+ // Iinfos, _ := json.Marshal(res.Output.Iinfo)
|
|
2326
|
+ // Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
|
2327
|
+ // infoStr := string(Iinfos)
|
|
2328
|
+ // idetinfoStr := string(Idetinfos)
|
|
2329
|
+ // psn := &models.HisPsn{
|
|
2330
|
+ // PsnNo: res.Output.Baseinfo.PsnNo,
|
|
2331
|
+ // Age: res.Output.Baseinfo.Age,
|
|
2332
|
+ // PatientId: patient.ID,
|
|
2333
|
+ // Certno: res.Output.Baseinfo.Certno,
|
|
2334
|
+ // Brdy: res.Output.Baseinfo.Brdy,
|
|
2335
|
+ // Gend: res.Output.Baseinfo.Gend,
|
|
2336
|
+ // Naty: res.Output.Baseinfo.Naty,
|
|
2337
|
+ // PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
2338
|
+ // PsnName: res.Output.Baseinfo.PsnName,
|
|
2339
|
+ // Idetinfo: idetinfoStr,
|
|
2340
|
+ // Insuinfo: infoStr,
|
|
2341
|
+ // UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
2342
|
+ // CardInfo: "",
|
|
2343
|
+ // VerifyNumber: ele.Data.EcToken,
|
|
2344
|
+ // }
|
|
2345
|
+ // service.CreateHisPsn(psn)
|
|
2346
|
+ //
|
|
2347
|
+ // c.ServeSuccessJSON(map[string]interface{}{
|
|
2348
|
+ // "patient": patient,
|
|
2349
|
+ // "number": ele.Data.EcToken,
|
|
2350
|
+ // })
|
|
2351
|
+ // }
|
|
2352
|
+ //} else {
|
|
2353
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
|
|
2354
|
+ // return
|
|
2355
|
+ //}
|
2354
|
2356
|
|
2355
|
2357
|
}
|
2356
|
2358
|
break
|
|
@@ -2394,6 +2396,26 @@ func (c *HisApiController) GetSFZBaseInfo() string {
|
2394
|
2396
|
return string(str)
|
2395
|
2397
|
}
|
2396
|
2398
|
|
|
2399
|
+func (c *HisApiController) GetEleBaseInfo() string {
|
|
2400
|
+ DllDef := syscall.MustLoadDLL("SSCard.dll")
|
|
2401
|
+ readCard := DllDef.MustFindProc("GetQRBase")
|
|
2402
|
+ if readCard == nil {
|
|
2403
|
+ fmt.Println("readcard is nil")
|
|
2404
|
+ readCard = DllDef.MustFindProc("GetQRBase")
|
|
2405
|
+ }
|
|
2406
|
+ str := make([]byte, 1024)
|
|
2407
|
+ str1 := make([]byte, 1024)
|
|
2408
|
+ ret2, _, _ := readCard.Call(uintptr(180), (uintptr)(unsafe.Pointer(&str[0])), uintptr(1024), (uintptr)(unsafe.Pointer(&str1[0])), uintptr(1024))
|
|
2409
|
+ fmt.Println(string(str1))
|
|
2410
|
+ fmt.Println(string(str))
|
|
2411
|
+ fmt.Println(":", ConvertToString(string(str1), "gbk", "utf-8"))
|
|
2412
|
+ fmt.Println(":", ConvertToString(string(str), "gbk", "utf-8"))
|
|
2413
|
+ if ret2 != 0 {
|
|
2414
|
+ return ""
|
|
2415
|
+ }
|
|
2416
|
+ return string(str1)
|
|
2417
|
+}
|
|
2418
|
+
|
2397
|
2419
|
func (c *HisApiController) GetBasBaseInfo() string {
|
2398
|
2420
|
DllDef := syscall.MustLoadDLL("SSCard.dll")
|
2399
|
2421
|
readCard := DllDef.MustFindProc("ReadCardBas")
|