Browse Source

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

csx 2 years ago
parent
commit
1d597e00d8

+ 2 - 2
controllers/nm/nm_controller.go View File

@@ -732,9 +732,9 @@ func (c *NmController) GetELeInfo(code string, operator_id string, operator_name
732 732
 	input["transType"] = "ec.query"
733 733
 
734 734
 	bytesData, _ := json.Marshal(input)
735
-	gdyb_url := beego.AppConfig.String("gdyb_url")
735
+	//gdyb_url := beego.AppConfig.String("gdyb_url")
736 736
 
737
-	url := gdyb_url + "/localcfc/api/hsecfc/localQrCodeQuery"
737
+	url := "http://10.38.23.105:8090" + "/localcfc/api/hsecfc/localQrCodeQuery"
738 738
 	ret2, _, _ := readCard.Call(StrPtr(url), StrPtr(string(bytesData)), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
739 739
 	fmt.Println(ret2)
740 740
 	fmt.Println(DeleteExtraSpace(string(pBusiCardInfo)))

+ 45 - 9
controllers/zh/zh_his_api_controller.go View File

@@ -683,11 +683,21 @@ func (c *ZHHisApiController) GetZHInHospitalCheck() {
683 683
 
684 684
 	if miConfig.MdtrtareaAdmvs == "150499" {
685 685
 		if id_card_type == 1 {
686
+			mdtrt_cert_no := ""
687
+			card_sn := ""
688
+
689
+			if record.IdCardType == 1 {
690
+				bas := strings.Split(psn_info.CardInfo, "|")
691
+				cardNumber := bas[2]
692
+				mdtrt_cert_no = cardNumber
693
+				card_sn = bas[3]
694
+			} else {
695
+				mdtrt_cert_no = record.Certno
696
+			}
686 697
 			//请求内网数据
687
-			api := "http://172.16.13.254:9532/" + "nmyb/1101?cert_no=" + patient.IdCardNo +
698
+			api := "http://172.16.13.254:9532/" + "nmyb/1101?cert_no=" + mdtrt_cert_no +
688 699
 				"&org_name=" + miConfig.OrgName + "&doctor=" + role.UserName + "&fixmedins_code=" + miConfig.Code +
689
-				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&card_sn=" + "" + "&certificates=" + strconv.FormatInt(certificates, 10) + "&name=" + patient.Name
690
-
700
+				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&card_sn=" + card_sn + "&certificates=" + strconv.FormatInt(certificates, 10) + "&name=" + patient.Name
691 701
 			resp, requestErr := http.Get(api)
692 702
 			if requestErr != nil {
693 703
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -872,8 +882,18 @@ func (c *ZHHisApiController) GetZHInHospitalCheck() {
872 882
 		var struct2401 service.Struct2401
873 883
 		struct2401.PsnNo = res2.Output.Baseinfo.PsnNo
874 884
 		struct2401.Insutype = insutype
875
-		struct2401.MdtrtCertType = "02"
876
-		struct2401.MdtrtCertNo = res2.Output.Baseinfo.Certno
885
+		psn_info, _ := service.GetPsnByPatientId(patient.ID)
886
+
887
+		if id_card_type == 1 {
888
+			struct2401.MdtrtCertType = "03"
889
+			bas := strings.Split(psn_info.CardInfo, "|")
890
+			cardNumber := bas[2]
891
+			struct2401.MdtrtCertNo = cardNumber
892
+		} else {
893
+			struct2401.MdtrtCertType = "02"
894
+			struct2401.MdtrtCertNo = res2.Output.Baseinfo.Certno
895
+		}
896
+
877 897
 		if miConfig.Code == "H15049901371" {
878 898
 			if med_type == 14 {
879 899
 				if insutype == "390" {
@@ -942,6 +962,7 @@ func (c *ZHHisApiController) GetZHInHospitalCheck() {
942 962
 			data["mdtrtarea_admvs"] = miConfig.MdtrtareaAdmvs
943 963
 			data["secret_key"] = miConfig.SecretKey
944 964
 			data["struct_2401"] = struct2401
965
+
945 966
 			var req *http.Request
946 967
 			bytesData, _ := json.Marshal(data)
947 968
 			req, _ = http.NewRequest("POST", "http://172.16.13.254:9532/"+"nmyb/2401", bytes.NewReader(bytesData))
@@ -1365,11 +1386,21 @@ func (c *ZHHisApiController) GetSettleInfo() {
1365 1386
 	}
1366 1387
 
1367 1388
 	if miConfig.MdtrtareaAdmvs == "150499" {
1389
+		psn_info, _ := service.GetPsnByPatientId(patient_id)
1390
+		mdtrt_cert_no := ""
1391
+		if record.IdCardType == 1 {
1392
+			bas := strings.Split(psn_info.CardInfo, "|")
1393
+			cardNumber := bas[2]
1394
+			mdtrt_cert_no = cardNumber
1395
+
1396
+		} else {
1397
+			mdtrt_cert_no = record.Certno
1398
+		}
1368 1399
 		//请求内网数据
1369 1400
 		api := "http://172.16.13.254:9532/" + "nmyb/2304?psn_no=" + record.PsnNo + "&mdtrt_id=" + record.Number + "&chrg_bchno=" + chrg_bchno +
1370 1401
 			"&insutype_type=" + record.InsutypeType + "&total=" + allTotal +
1371 1402
 			"&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
1372
-			"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(record.IdCardType, 10) + "&card_sn=" + "" + "&certificates=" + strconv.FormatInt(record.Certificates, 10) + "&name=" + record.Name + "&cert_no=" + record.IdCardNo
1403
+			"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(record.IdCardType, 10) + "&card_sn=" + "" + "&certificates=" + strconv.FormatInt(record.Certificates, 10) + "&name=" + record.Name + "&cert_no=" + mdtrt_cert_no
1373 1404
 		resp, requestErr := http.Get(api)
1374 1405
 		if requestErr != nil {
1375 1406
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -1395,10 +1426,9 @@ func (c *ZHHisApiController) GetSettleInfo() {
1395 1426
 		result = string(result_byte)
1396 1427
 
1397 1428
 	} else {
1429
+
1398 1430
 		result, src_resquest = service.ZHGdyb2304(record.PsnNo, record.Number, chrg_bchno, cert_no, record.InsutypeType, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, record.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, "0", record.IdCardType, 0, 0, 0, 0, record.Certificates)
1399
-		//saveLog()
1400 1431
 		saveLog(result, src_resquest, "2304", "住院结算")
1401
-
1402 1432
 	}
1403 1433
 
1404 1434
 	var dat map[string]interface{}
@@ -1570,7 +1600,13 @@ func (c *ZHHisApiController) GetPreSettleInfo() {
1570 1600
 	//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHospitalNoExistDataException)
1571 1601
 	//	return
1572 1602
 	//}
1603
+	psn_info, _ := service.GetPsnByPatientId(patient_id)
1604
+
1573 1605
 	if record.IdCardType == 1 {
1606
+		bas := strings.Split(psn_info.CardInfo, "|")
1607
+		cardNumber := bas[2]
1608
+		cert_no = cardNumber
1609
+
1574 1610
 	} else {
1575 1611
 		cert_no = record.Certno
1576 1612
 	}
@@ -1582,7 +1618,7 @@ func (c *ZHHisApiController) GetPreSettleInfo() {
1582 1618
 		api := "http://172.16.13.254:9532/" + "nmyb/2303?psn_no=" + record.PsnNo + "&mdtrt_id=" + record.Number + "&chrg_bchno=" + chrg_bchno +
1583 1619
 			"&insutype_type=" + record.InsutypeType + "&total=" + allTotal +
1584 1620
 			"&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
1585
-			"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(record.IdCardType, 10) + "&card_sn=" + "" + "&certificates=" + strconv.FormatInt(record.Certificates, 10) + "&name=" + record.Name + "&cert_no=" + record.IdCardNo
1621
+			"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(record.IdCardType, 10) + "&card_sn=" + "" + "&certificates=" + strconv.FormatInt(record.Certificates, 10) + "&name=" + record.Name + "&cert_no=" + cert_no
1586 1622
 		resp, requestErr := http.Get(api)
1587 1623
 		if requestErr != nil {
1588 1624
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)

+ 5 - 5
service/zh_his_service.go View File

@@ -151,11 +151,11 @@ func ZHGdyb2401(struct2401 Struct2401, secret_key string, org_name string, fixme
151 151
 	inputData["insutype"] = struct2401.Insutype // 险种类型(来自1101接口返回)
152 152
 	inputData["tel"] = ""
153 153
 	inputData["coner_name"] = ""
154
-	inputData["begntime"] = struct2401.Begntime         // 开始时间
155
-	inputData["mdtrt_cert_type"] = "02"                 // 就诊凭证类型
156
-	inputData["mdtrt_cert_no"] = struct2401.MdtrtCertNo // 就诊凭证编号
157
-	inputData["med_type"] = struct2401.MedType          // 就诊凭证编号
158
-	inputData["ipt_no"] = struct2401.IptNo              // 住院/门诊号
154
+	inputData["begntime"] = struct2401.Begntime             // 开始时间
155
+	inputData["mdtrt_cert_type"] = struct2401.MdtrtCertType // 就诊凭证类型
156
+	inputData["mdtrt_cert_no"] = struct2401.MdtrtCertNo     // 就诊凭证编号
157
+	inputData["med_type"] = struct2401.MedType              // 就诊凭证编号
158
+	inputData["ipt_no"] = struct2401.IptNo                  // 住院/门诊号
159 159
 	inputData["medrcdno"] = ""
160 160
 	inputData["atddr_no"] = struct2401.AtddrNo
161 161
 	inputData["chfpdr_name"] = struct2401.ChfpdrName