Browse Source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 2 years ago
parent
commit
6f8fd043af
4 changed files with 30 additions and 3 deletions
  1. 26 1
      controllers/sg/his_api_controller.go
  2. 1 1
      controllers/zh/zh_his_api_controller.go
  3. BIN
      gdyb
  4. 3 1
      service/gdyb_service.go

+ 26 - 1
controllers/sg/his_api_controller.go View File

@@ -244,7 +244,10 @@ func (c *HisApiController) CheckCardPWD() {
244 244
 	roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
245 245
 	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
246 246
 	his, _ := service.GetNewHisPatientInfoFour(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
247
-	result := service.Gdyb90991(his.PsnNo, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, card_pwd)
247
+	psn, _ := service.GetPsnByPatientId(his.PatientId)
248
+	bas := strings.Split(psn.CardInfo, "|")
249
+	basNumber := bas[2]
250
+	result := service.Gdyb90991(his.PsnNo, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, card_pwd, basNumber)
248 251
 
249 252
 	var dat map[string]interface{}
250 253
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
@@ -616,6 +619,28 @@ func (c *HisApiController) ReadCard() {
616 619
 					return
617 620
 
618 621
 				} else {
622
+					Iinfos, _ := json.Marshal(res.Output.Iinfo)
623
+					Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
624
+					infoStr := string(Iinfos)
625
+					idetinfoStr := string(Idetinfos)
626
+					psn := &models.HisPsn{
627
+						PsnNo:        res.Output.Baseinfo.PsnNo,
628
+						Age:          res.Output.Baseinfo.Age,
629
+						PatientId:    patient.ID,
630
+						Certno:       res.Output.Baseinfo.Certno,
631
+						Brdy:         res.Output.Baseinfo.Brdy,
632
+						Gend:         res.Output.Baseinfo.Gend,
633
+						Naty:         res.Output.Baseinfo.Naty,
634
+						PsnCertType:  res.Output.Baseinfo.PsnCertType,
635
+						PsnName:      res.Output.Baseinfo.PsnName,
636
+						Idetinfo:     idetinfoStr,
637
+						Insuinfo:     infoStr,
638
+						UserOrgId:    c.GetAdminUserInfo().CurrentOrgId,
639
+						CardInfo:     basStr,
640
+						VerifyNumber: "",
641
+					}
642
+					service.CreateHisPsn(psn)
643
+
619 644
 					c.ServeSuccessJSON(map[string]interface{}{
620 645
 						"patient": patient,
621 646
 						"number":  basNumber,

+ 1 - 1
controllers/zh/zh_his_api_controller.go View File

@@ -944,7 +944,7 @@ func (c *ZHHisApiController) GetZHInHospitalCheck() {
944 944
 			data["struct_2401"] = struct2401
945 945
 			var req *http.Request
946 946
 			bytesData, _ := json.Marshal(data)
947
-			req, _ = http.NewRequest("POST", "http://172.16.13.254:9532/"+"jsyb/2401", bytes.NewReader(bytesData))
947
+			req, _ = http.NewRequest("POST", "http://172.16.13.254:9532/"+"nmyb/2401", bytes.NewReader(bytesData))
948 948
 			client := &http.Client{}
949 949
 			resp, _ := client.Do(req)
950 950
 			defer resp.Body.Close()

BIN
gdyb View File


+ 3 - 1
service/gdyb_service.go View File

@@ -3858,7 +3858,7 @@ func StrPtr(s string) uintptr {
3858 3858
 	return uintptr(unsafe.Pointer(syscall.StringBytePtr(s)))
3859 3859
 }
3860 3860
 
3861
-func Gdyb90991(psn_no string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, pwd string) string {
3861
+func Gdyb90991(psn_no string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, pwd string, card_number string) string {
3862 3862
 	//生成签名
3863 3863
 	nonce := GetRandomString(32)
3864 3864
 	timestamp := time.Now().Unix()
@@ -3872,6 +3872,8 @@ func Gdyb90991(psn_no string, org_name string, doctor string, fixmedins_code str
3872 3872
 	inputData["fixmedins_code"] = fixmedins_code // 就诊凭证编号
3873 3873
 	inputData["psn_no"] = psn_no                 // 开始时间
3874 3874
 	inputData["card_pwd"] = pwd                  // 人员姓名
3875
+	inputData["sscno"] = card_number             // 人员姓名
3876
+
3875 3877
 	input["data"] = inputData
3876 3878
 	inputMessage["input"] = input //交易输入
3877 3879