|
@@ -79,7 +79,7 @@ func HisManagerApiRegistRouters() {
|
79
|
79
|
func (c *HisApiController) TestGetBasBaseInfo() {
|
80
|
80
|
DllDef := syscall.MustLoadDLL("SSCard.dll")
|
81
|
81
|
defer syscall.FreeLibrary(DllDef)
|
82
|
|
- Iinit:= DllDef.MustFindProc("Init")
|
|
82
|
+ Iinit := DllDef.MustFindProc("Init")
|
83
|
83
|
readCard := DllDef.MustFindProc("ReadCardBas")
|
84
|
84
|
ret, _, err := Iinit.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
|
85
|
85
|
if ret != 0 {
|
|
@@ -101,13 +101,12 @@ func (c *HisApiController) TestGetBasBaseInfo() {
|
101
|
101
|
return
|
102
|
102
|
}
|
103
|
103
|
|
104
|
|
-
|
105
|
104
|
str := make([]byte, 1024)
|
106
|
105
|
str1 := make([]byte, 1024)
|
107
|
|
- cdat:=len(str)
|
108
|
|
- cdat1:=len(str1)
|
109
|
|
- p:= *((*int32)(unsafe.Pointer(&str[0])))
|
110
|
|
- p1:= *((*int32)(unsafe.Pointer(&str1[0])))
|
|
106
|
+ cdat := len(str)
|
|
107
|
+ cdat1 := len(str1)
|
|
108
|
+ p := *((*int32)(unsafe.Pointer(&str[0])))
|
|
109
|
+ p1 := *((*int32)(unsafe.Pointer(&str1[0])))
|
111
|
110
|
ret2, _, err2 := readCard.Call(uintptr(p), uintptr(cdat), uintptr(p1), uintptr(cdat1))
|
112
|
111
|
fmt.Println(" Add(4,5)的结果为:", ret2)
|
113
|
112
|
str11 := prttostr(uintptr(p))
|
|
@@ -126,17 +125,16 @@ func (c *HisApiController) TestGetBasBaseInfo() {
|
126
|
125
|
|
127
|
126
|
func prttostr(vcode uintptr) string {
|
128
|
127
|
var vbyte []byte
|
129
|
|
- for i:=0;i<10;i++{
|
130
|
|
- sbyte:=*((*byte)(unsafe.Pointer(vcode)))
|
131
|
|
- if sbyte==0{
|
132
|
|
- break
|
133
|
|
- }
|
134
|
|
- vbyte=append(vbyte,sbyte)
|
135
|
|
- vcode += 1
|
|
128
|
+ for i := 0; i < 10; i++ {
|
|
129
|
+ sbyte := *((*byte)(unsafe.Pointer(vcode)))
|
|
130
|
+ if sbyte == 0 {
|
|
131
|
+ break
|
|
132
|
+ }
|
|
133
|
+ vbyte = append(vbyte, sbyte)
|
|
134
|
+ vcode += 1
|
136
|
135
|
}
|
137
|
136
|
return string(vbyte)
|
138
|
|
- }
|
139
|
|
-
|
|
137
|
+}
|
140
|
138
|
|
141
|
139
|
//func (c *HisApiController) TestPay() {
|
142
|
140
|
// DllDef2 := syscall.MustLoadDLL("SSSE32.dll")
|
|
@@ -1010,7 +1008,7 @@ func (c *HisApiController) GetRegisterInfo() {
|
1010
|
1008
|
config, _ := service.GetMedicalInsuranceConfig(adminInfo.CurrentOrgId)
|
1011
|
1009
|
|
1012
|
1010
|
if config.IsOpen == 1 {
|
1013
|
|
- api := "http://127.0.0.1:9532/" + "gdyb/one?cert_no=" + patient.IdCardNo + "&org_name=" + miConfig.OrgName + "&doctor=" + patientPrescription.Doctor + "&fixmedins_code=" + miConfig.Code + "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
|
|
1011
|
+ api := "http://127.0.0.1:9532/" + "gdyb/one?cert_no=" + patient.IdCardNo + "&org_name=" + miConfig.OrgName + "&doctor=" + patientPrescription.Doctor + "&fixmedins_code=" + miConfig.Code + "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&certificates=" + strconv.FormatInt(certificates, 10)
|
1014
|
1012
|
resp, requestErr := http.Get(api)
|
1015
|
1013
|
if requestErr != nil {
|
1016
|
1014
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
@@ -1086,7 +1084,7 @@ func (c *HisApiController) GetRegisterInfo() {
|
1086
|
1084
|
timeFormat := tempTime.Format("20060102150405")
|
1087
|
1085
|
chrgBchno := rand.Intn(100000) + 10000
|
1088
|
1086
|
ipt_otp_no := timeFormat + strconv.FormatInt(int64(chrgBchno), 10) + strconv.FormatInt(his.PatientId, 10)
|
1089
|
|
- //count, _ := service.FindHisRegisterRecord(theTime.Unix(), patient.ID, adminInfo.CurrentOrgId)
|
|
1087
|
+ count, _ := service.FindHisRegisterRecord(theTime.Unix(), patient.ID, adminInfo.CurrentOrgId)
|
1090
|
1088
|
department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
|
1091
|
1089
|
doctor_id := strconv.FormatInt(patientPrescription.DoctorId, 10)
|
1092
|
1090
|
|
|
@@ -1126,6 +1124,10 @@ func (c *HisApiController) GetRegisterInfo() {
|
1126
|
1124
|
if is310 == 1 {
|
1127
|
1125
|
insutype = "310"
|
1128
|
1126
|
}
|
|
1127
|
+ if count == 1 {
|
|
1128
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeRegisterRepeatException)
|
|
1129
|
+ return
|
|
1130
|
+ }
|
1129
|
1131
|
api := "http://127.0.0.1:9532/" + "gdyb/two?cert_no=" + IdCardNo + "&insutype=" +
|
1130
|
1132
|
insutype + "&psn_no=" + res.Output.Baseinfo.PsnNo +
|
1131
|
1133
|
"&org_name=" + miConfig.OrgName + "&doctor=" + patientPrescription.Doctor + "&ipt_otp_no=" + ipt_otp_no +
|
|
@@ -1610,7 +1612,7 @@ func (c *HisApiController) GetUploadInfo() {
|
1610
|
1612
|
|
1611
|
1613
|
}
|
1612
|
1614
|
|
1613
|
|
- result, src_resquest := service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(patientPrescription.RegisterType, 10), his.IdCardType, 0, 0, 0, 0)
|
|
1615
|
+ result, src_resquest := service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(patientPrescription.RegisterType, 10), his.IdCardType, 0, 0, 0, 0, his.IdType)
|
1614
|
1616
|
var dat map[string]interface{}
|
1615
|
1617
|
if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
1616
|
1618
|
fmt.Println(dat)
|