|
@@ -1381,6 +1381,71 @@ func (c *HisApiController) ReadCard() {
|
1381
|
1381
|
|
1382
|
1382
|
}
|
1383
|
1383
|
|
|
1384
|
+ } else if miConfig.MdtrtareaAdmvs == "350500" {
|
|
1385
|
+ cardnum, cardCode, id_card_no, name, errmsg := c.GetFjBasBaseInfo()
|
|
1386
|
+ fmt.Println(cardnum)
|
|
1387
|
+ fmt.Println(cardCode)
|
|
1388
|
+ fmt.Println(id_card_no)
|
|
1389
|
+ fmt.Println(name)
|
|
1390
|
+ fmt.Println(errmsg)
|
|
1391
|
+ basStr := cardnum + "|" + cardCode + "|" + id_card_no + "|" + name
|
|
1392
|
+ result, _ := service.FJyb1101(cardnum, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, id_card_type, cardCode, certificates, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey)
|
|
1393
|
+ var dat map[string]interface{}
|
|
1394
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
1395
|
+ fmt.Println(dat)
|
|
1396
|
+ } else {
|
|
1397
|
+ fmt.Println(err)
|
|
1398
|
+ }
|
|
1399
|
+
|
|
1400
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
1401
|
+ var res ResultTwo
|
|
1402
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
1403
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
1404
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
1405
|
+ return
|
|
1406
|
+ }
|
|
1407
|
+
|
|
1408
|
+ if res.Infcode == 0 {
|
|
1409
|
+ patient, err := service.GetPatientByNumber(id_card_no, c.GetAdminUserInfo().CurrentOrgId)
|
|
1410
|
+ if err == gorm.ErrRecordNotFound {
|
|
1411
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
|
|
1412
|
+ return
|
|
1413
|
+ } else if err != nil {
|
|
1414
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1415
|
+ return
|
|
1416
|
+
|
|
1417
|
+ } else {
|
|
1418
|
+ Iinfos, _ := json.Marshal(res.Output.Iinfo)
|
|
1419
|
+ Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
|
1420
|
+ infoStr := string(Iinfos)
|
|
1421
|
+ idetinfoStr := string(Idetinfos)
|
|
1422
|
+ psn := &models.HisPsn{
|
|
1423
|
+ PsnNo: res.Output.Baseinfo.PsnNo,
|
|
1424
|
+ Age: res.Output.Baseinfo.Age,
|
|
1425
|
+ PatientId: patient.ID,
|
|
1426
|
+ Certno: res.Output.Baseinfo.Certno,
|
|
1427
|
+ Brdy: res.Output.Baseinfo.Brdy,
|
|
1428
|
+ Gend: res.Output.Baseinfo.Gend,
|
|
1429
|
+ Naty: res.Output.Baseinfo.Naty,
|
|
1430
|
+ PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
1431
|
+ PsnName: res.Output.Baseinfo.PsnName,
|
|
1432
|
+ Idetinfo: idetinfoStr,
|
|
1433
|
+ Insuinfo: infoStr,
|
|
1434
|
+ UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
1435
|
+ CardInfo: basStr,
|
|
1436
|
+ VerifyNumber: "",
|
|
1437
|
+ }
|
|
1438
|
+ service.CreateHisPsn(psn)
|
|
1439
|
+
|
|
1440
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1441
|
+ "patient": patient,
|
|
1442
|
+ "number": cardnum,
|
|
1443
|
+ })
|
|
1444
|
+ }
|
|
1445
|
+ } else {
|
|
1446
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
|
|
1447
|
+ return
|
|
1448
|
+ }
|
1384
|
1449
|
} else {
|
1385
|
1450
|
if initFlag == 0 {
|
1386
|
1451
|
c.TestGetBasBaseInit()
|
|
@@ -1875,6 +1940,37 @@ func (c *HisApiController) GetBasBaseInfo() string {
|
1875
|
1940
|
return string(str)
|
1876
|
1941
|
}
|
1877
|
1942
|
|
|
1943
|
+func (c *HisApiController) GetFjBasBaseInfo() (string, string, string, string, string) {
|
|
1944
|
+ DllDef := syscall.MustLoadDLL("chs_fjs_standard.dll")
|
|
1945
|
+ readCard := DllDef.MustFindProc("read_cardinfo")
|
|
1946
|
+ if readCard == nil {
|
|
1947
|
+ fmt.Println("readcard is nil")
|
|
1948
|
+ readCard = DllDef.MustFindProc("read_cardinfo")
|
|
1949
|
+ }
|
|
1950
|
+ str := make([]byte, 1024) //卡号
|
|
1951
|
+ str1 := make([]byte, 1024) //卡识别码
|
|
1952
|
+ str2 := make([]byte, 1024) //身份证号
|
|
1953
|
+ str3 := make([]byte, 1024) //姓名
|
|
1954
|
+ str4 := make([]byte, 1024) //错误信息
|
|
1955
|
+
|
|
1956
|
+ ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&str[0])), uintptr(1024), (uintptr)(unsafe.Pointer(&str1[0])), (uintptr)(unsafe.Pointer(&str2[0])), (uintptr)(unsafe.Pointer(&str3[0])), (uintptr)(unsafe.Pointer(&str4[0])))
|
|
1957
|
+ fmt.Println(string(str1))
|
|
1958
|
+ fmt.Println(string(str))
|
|
1959
|
+ fmt.Println(string(str2))
|
|
1960
|
+ fmt.Println(string(str3))
|
|
1961
|
+ fmt.Println(string(str4))
|
|
1962
|
+ fmt.Println(":", ConvertToString(string(str1), "gbk", "utf-8"))
|
|
1963
|
+ fmt.Println(":", ConvertToString(string(str), "gbk", "utf-8"))
|
|
1964
|
+ fmt.Println(":", ConvertToString(string(str2), "gbk", "utf-8"))
|
|
1965
|
+ fmt.Println(":", ConvertToString(string(str3), "gbk", "utf-8"))
|
|
1966
|
+ fmt.Println(":", ConvertToString(string(str4), "gbk", "utf-8"))
|
|
1967
|
+
|
|
1968
|
+ if ret2 != 0 {
|
|
1969
|
+ return "", "", "", "", ""
|
|
1970
|
+ }
|
|
1971
|
+ return string(str), string(str1), string(str2), string(str3), string(str4)
|
|
1972
|
+}
|
|
1973
|
+
|
1878
|
1974
|
type CustomFundPay struct {
|
1879
|
1975
|
FundPayType string `json:"fund_pay_type"`
|
1880
|
1976
|
FundPayamt float64 `json:"fund_payamt"`
|
|
@@ -4972,6 +5068,21 @@ func (c *HisApiController) GetRegisterInfo() {
|
4972
|
5068
|
infocode = 0
|
4973
|
5069
|
verify_number = psn_info.VerifyNumber
|
4974
|
5070
|
|
|
5071
|
+ } else if miConfig.MdtrtareaAdmvs == "350500" {
|
|
5072
|
+ psn_info, _ := service.GetPsnByPatientId(id)
|
|
5073
|
+ PsnNo = psn_info.PsnNo
|
|
5074
|
+ PsnCertType = psn_info.PsnCertType
|
|
5075
|
+ Certno = psn_info.Certno
|
|
5076
|
+ PsnName = psn_info.PsnName
|
|
5077
|
+ Gend = psn_info.Gend
|
|
5078
|
+ Naty = psn_info.Naty
|
|
5079
|
+ Brdy = psn_info.Brdy
|
|
5080
|
+ Age = psn_info.Age
|
|
5081
|
+ infoStr = psn_info.Insuinfo
|
|
5082
|
+ idetinfoStr = psn_info.Idetinfo
|
|
5083
|
+ infocode = 0
|
|
5084
|
+ verify_number = psn_info.VerifyNumber
|
|
5085
|
+
|
4975
|
5086
|
} else {
|
4976
|
5087
|
var result string
|
4977
|
5088
|
var requestLog string
|
|
@@ -5242,6 +5353,27 @@ func (c *HisApiController) GetRegisterInfo() {
|
5242
|
5353
|
|
5243
|
5354
|
resThree.InfRefmsgid = resThree10265.InfRefmsgid
|
5244
|
5355
|
|
|
5356
|
+ infocode, _ = strconv.ParseInt(resThree10265.Infcode, 10, 64)
|
|
5357
|
+ } else if miConfig.MdtrtareaAdmvs == "350500" {
|
|
5358
|
+ result, requestLog := service.FJyb2201(res.Output.Baseinfo.PsnNo, insutype, IdCardNo, miConfig.OrgName, doctor_info.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_id, 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)
|
|
5359
|
+ saveLog(result, requestLog, "2201", "挂号")
|
|
5360
|
+ if miConfig.Code == "H15049901371" {
|
|
5361
|
+
|
|
5362
|
+ if err := json.Unmarshal([]byte(result), &resThree10265); err != nil {
|
|
5363
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
5364
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
5365
|
+ return
|
|
5366
|
+ }
|
|
5367
|
+ resThree.ErrMsg = resThree10265.ErrMsg
|
|
5368
|
+ resThree.Output = resThree10265.Output
|
|
5369
|
+ resThree.InfRefmsgid = resThree10265.InfRefmsgid
|
|
5370
|
+ } else {
|
|
5371
|
+ if err := json.Unmarshal([]byte(result), &resThree); err != nil {
|
|
5372
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
5373
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
5374
|
+ return
|
|
5375
|
+ }
|
|
5376
|
+ }
|
5245
|
5377
|
infocode, _ = strconv.ParseInt(resThree10265.Infcode, 10, 64)
|
5246
|
5378
|
} else {
|
5247
|
5379
|
result, requestLog := service.Gdyb2201A(res.Output.Baseinfo.PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_id, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, record_time)
|