Browse Source

艾迪康报告查询

lighter 1 year ago
parent
commit
9f9bfb54a3
18 changed files with 566 additions and 327 deletions
  1. 12 0
      pom.xml
  2. 53 0
      src/main/java/thyyxxk/webserver/controller/examinations/AdiconController.java
  3. 0 60
      src/main/java/thyyxxk/webserver/entity/examinations/adicon/AdiconHeader.java
  4. 0 35
      src/main/java/thyyxxk/webserver/entity/examinations/adicon/AdiconIndex.java
  5. 14 0
      src/main/java/thyyxxk/webserver/entity/examinations/adicon/AdiconInquiry.java
  6. 0 28
      src/main/java/thyyxxk/webserver/entity/examinations/adicon/AdiconItem.java
  7. 6 0
      src/main/java/thyyxxk/webserver/entity/examinations/adicon/BarcodeType.java
  8. 107 0
      src/main/java/thyyxxk/webserver/entity/examinations/adicon/ListTableItem.java
  9. 166 0
      src/main/java/thyyxxk/webserver/entity/examinations/adicon/ReportDetail.java
  10. 0 5
      src/main/java/thyyxxk/webserver/entity/examinations/inspections/detail/InspectionDetail.java
  11. 1 1
      src/main/java/thyyxxk/webserver/entity/examinations/inspections/request/ReportIndexInquiry.java
  12. 5 4
      src/main/java/thyyxxk/webserver/service/LoginService.java
  13. 157 0
      src/main/java/thyyxxk/webserver/service/examinations/AdiconService.java
  14. 0 76
      src/main/java/thyyxxk/webserver/service/examinations/adicon/Proxy.java
  15. 0 117
      src/main/java/thyyxxk/webserver/service/examinations/adicon/ProxySoap.java
  16. 40 0
      src/main/java/thyyxxk/webserver/service/externalhttp/AdiconHttpSrvc.java
  17. 0 1
      src/main/java/thyyxxk/webserver/service/externalhttp/OutpatientBookingHttp.java
  18. 5 0
      src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

+ 12 - 0
pom.xml

@@ -174,6 +174,18 @@
             <version>3.3.4</version>
         </dependency>
 
+        <!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+            <version>2.3.1</version>
+        </dependency>
+        <!-- Apache Commons Text -->
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-text</artifactId>
+            <version>1.9</version>
+        </dependency>
         <!-- spring-boot-actuator依赖,监控系统健康情况的工具 -->
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 53 - 0
src/main/java/thyyxxk/webserver/controller/examinations/AdiconController.java

@@ -0,0 +1,53 @@
+package thyyxxk.webserver.controller.examinations;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.examinations.adicon.AdiconInquiry;
+import thyyxxk.webserver.entity.examinations.adicon.ListTableItem;
+import thyyxxk.webserver.entity.examinations.adicon.ReportDetail;
+import thyyxxk.webserver.service.examinations.AdiconService;
+import thyyxxk.webserver.utils.ResultVoUtil;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/adicon")
+public class AdiconController {
+    private final AdiconService adiconService;
+
+    @Autowired
+    public AdiconController(AdiconService adiconService) {
+        this.adiconService = adiconService;
+    }
+
+    @GetMapping("/login")
+    public ResultVo<Map<String, String>> login() throws Exception {
+        Map<String, String> map = new HashMap<>();
+        map.put("jyKey", adiconService.login("JYK"));
+        map.put("blKey", adiconService.login("BL"));
+        return ResultVoUtil.success(map);
+    }
+
+    @PostMapping("/getReportList")
+    public ResultVo<List<ListTableItem>> getReportList(@RequestBody AdiconInquiry inquiry) throws Exception {
+        return ResultVoUtil.success(adiconService.getReportList(inquiry));
+    }
+
+    @PostMapping("/getReportItems")
+    public ResultVo<List<ReportDetail>> getReportItemListByCustomerBarcode(@RequestBody AdiconInquiry inquiry) throws Exception {
+        return ResultVoUtil.success(adiconService.getReportItemListByCustomerBarcode(inquiry));
+    }
+
+    @PostMapping("/setSampleDown")
+    public ResultVo<String> setSampleDownFlagByCustomerBarcode(@RequestBody AdiconInquiry inquiry) throws Exception {
+        return ResultVoUtil.success(adiconService.setSampleDownFlagByCustomerBarcode(inquiry));
+    }
+
+    @PostMapping("/getByteReport")
+    public ResultVo<String> getByteReport(@RequestBody AdiconInquiry inquiry) throws Exception {
+        return ResultVoUtil.success(adiconService.getByteReport(inquiry));
+    }
+}

+ 0 - 60
src/main/java/thyyxxk/webserver/entity/examinations/adicon/AdiconHeader.java

@@ -1,60 +0,0 @@
-package thyyxxk.webserver.entity.examinations.adicon;
-
-import lombok.Data;
-
-@Data
-public class AdiconHeader {
-    // 报告ID
-    private String ordrId;
-    // 报告类别   1|2|99 -- 普通报告|微生物报告|尚未审核的报告
-    private String infoType;
-    // 申请时间
-    private String aplyDate;
-    // 报告录入时间
-    private String ordrCreateDate;
-    // 审核时间
-    private String audtTime;
-    // 打印时间
-    private String prntTime;
-    // 审核状态   0|1 -- 未审核|已审核
-    private String audtStatus;
-    // 打印状态   0|1 -- 未打印|已打印
-    private String prntStatus;
-    // 样本编号
-    private String smplNum;
-    // 样本类型
-    private String smplName;
-    // 送检医生
-    private String docName;
-    // 检验者
-    private String testUsrName;
-    // 录入者
-    private String ordrUsrName;
-    // 审核者
-    private String audtUsrName;
-    // 打印者
-    private String prntUsrName;
-    // 检查目的
-    private String aplyCntn;
-    // 报告备注
-    private String ordrRemark;
-    // 样本条码号	--
-    private String 	aplyFlowNum;
-    // 急诊标志	0|1	--	普通|急诊
-    private String 	emcyMrk;
-    // 来源科室	--
-    private String 	deptName;
-    private String 	empi; // EMPI	--
-    private String 	idCard; //	身份证号	--
-    private String 	icCard; //	就诊卡号	--
-    private String 	patientType; // 患者类别	同病历号类型
-    private String 	ptntNo; //	病历号	--
-    private String 	ptntNoType; // 病历号类型	0|1|2|3|4	--	门诊号|住院号|验单号|体检号|婚检号
-    private String 	ptntName; // 患者姓名	--
-    private String 	ptntSex; // 患者性别	0|1|2|3	--	未填|男|女|未知性别
-    private String 	ptntBirth; // 出生日期	--
-    private String 	ptntAge; // 年龄	--
-    private String 	ptntAgeUnit; // 年龄单位	0|1|2|3	--	岁|月|天|时
-    private String 	ptntBedNo; //	PTNT_BED_NO	床号
-
-}

+ 0 - 35
src/main/java/thyyxxk/webserver/entity/examinations/adicon/AdiconIndex.java

@@ -1,35 +0,0 @@
-package thyyxxk.webserver.entity.examinations.adicon;
-
-import lombok.Data;
-
-@Data
-public class AdiconIndex {
-    // 报告ID
-    private String ordrId;
-    // 病历号类型   0|1|3 -- 门诊号|住院号|体检号
-    private String ptntNoType;
-    // 患者姓名
-    private String ptntName;
-    // 患者性别
-    private String ptntSex;
-    // 出生日期
-    private String ptntBirth;
-    // 年龄
-    private String ptntAge;
-    // 样本编号
-    private String sampleNumber;
-    // 报告类别   1|2 -- 普通报告|微生物报告
-    private String infoType;
-    // 报告录入时间
-    private String ordrCreateDate;
-    // 患者类别   0|1|3 -- 门诊|住院|体检
-    private String patientType;
-    // 患者编号
-    private String ptntId;
-    // 身份证号
-    private String idCard;
-    // 就诊卡号
-    private String icCard;
-    // 检查目的
-    private String aplyCtnt;
-}

+ 14 - 0
src/main/java/thyyxxk/webserver/entity/examinations/adicon/AdiconInquiry.java

@@ -0,0 +1,14 @@
+package thyyxxk.webserver.entity.examinations.adicon;
+
+import lombok.Data;
+
+@Data
+public class AdiconInquiry {
+    private String key;
+    private String id;
+    private String begin;
+    private String end;
+    private String barcode;
+    private BarcodeType barcodeType;
+    private String reportType;
+}

+ 0 - 28
src/main/java/thyyxxk/webserver/entity/examinations/adicon/AdiconItem.java

@@ -1,28 +0,0 @@
-package thyyxxk.webserver.entity.examinations.adicon;
-
-import lombok.Data;
-
-@Data
-public class AdiconItem {
-    private String itmId; // 检验项目ID
-    private String itmCode; // 检验项目代码
-    private String itmName; // 检验项目名称
-    private String itmUnit; // 计量单位
-    private String itmOrdr; // 顺序号
-    private String itmValue; // 定量及半定量的定量部分检验结果
-    private String itmSrcValue; // 定量原始结果(仪器检测的原始记录)
-    private String rangeLow; // 定量参考值低限
-    private String rangeHigh; // 定量参考值高限
-    private String range; // 定量参考值
-    private String itmAlert; // 异常标记L|H 偏低|偏高
-    private String criticalLow; // 危急值低限
-    private String criticalHigh; // 危急值高限
-    private String critical; // 危急值范围
-    private String criticalAlert; // 危急值标记 L|H 低于危急值下限|高于危急值上限
-    private String itmStrValue; // 定性及描述性结果
-    private String rangeStr; // 定性、半定量描述部分及描述性参考值
-    private String resType; // 结果类型 1|2|3|4 定量|半定量|定性|描述性
-    private String srcAplyId; // 来源申请项目 ID来源系统的申请项目ID
-    private String srcAplyFlowNum; // 来源申请单编号
-    private String mapCode; // 检验项目输出对照码
-}

+ 6 - 0
src/main/java/thyyxxk/webserver/entity/examinations/adicon/BarcodeType.java

@@ -0,0 +1,6 @@
+package thyyxxk.webserver.entity.examinations.adicon;
+
+public enum BarcodeType {
+    ADICON,
+    CUSTOMER
+}

+ 107 - 0
src/main/java/thyyxxk/webserver/entity/examinations/adicon/ListTableItem.java

@@ -0,0 +1,107 @@
+package thyyxxk.webserver.entity.examinations.adicon;
+
+import lombok.Data;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@Data
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement(name = "listtable")
+public class ListTableItem {
+    @XmlElement(name = "Id")
+    private String id;
+    @XmlElement(name = "ReportType")
+    private String reportType;
+    @XmlElement(name = "AdiconBarcode")
+    private String AdiconBarcode;
+
+    @XmlElement(name = "PatientName")
+    private String PatientName;
+
+    @XmlElement(name = "CustomerBarcode")
+    private String CustomerBarcode;
+
+    @XmlElement(name = "Repno")
+    private String Repno;
+
+    @XmlElement(name = "PdfFileName")
+    private String PdfFileName;
+
+    @XmlElement(name = "DownFlag")
+    private String DownFlag;
+
+    @XmlElement(name = "DownDate")
+    private String DownDate;
+
+    @XmlElement(name = "Sjrq")
+    private String Sjrq;
+
+    @XmlElement(name = "Sjys")
+    private String Sjys;
+
+    @XmlElement(name = "Brnl")
+    private String Brnl;
+
+    @XmlElement(name = "Brxb")
+    private String Brxb;
+
+    @XmlElement(name = "Bbzl")
+    private String Bbzl;
+
+    @XmlElement(name = "Bgrq")
+    private String Bgrq;
+
+    @XmlElement(name = "Bzlbid")
+    private String Bzlbid;
+
+    @XmlElement(name = "Sampleid")
+    private String Sampleid;
+
+    @XmlElement(name = "PdfFileType")
+    private String PdfFileType;
+
+    @XmlElement(name = "PageType")
+    private String PageType;
+
+    @XmlElement(name = "SfzId")
+    private String SfzId;
+
+    @XmlElement(name = "CertificatesType")
+    private String CertificatesType;
+
+    @XmlElement(name = "Nationality")
+    private String Nationality;
+
+    @XmlElement(name = "Instrument")
+    private String Instrument;
+
+    @XmlElement(name = "LisDate")
+    private String LisDate;
+
+    @XmlElement(name = "SerialNumber")
+    private String SerialNumber;
+
+    @XmlElement(name = "Str1")
+    private String Str1;
+
+    @XmlElement(name = "Str2")
+    private String Str2;
+
+    @XmlElement(name = "Str3")
+    private String Str3;
+
+    @XmlElement(name = "Str4")
+    private String Str4;
+
+    @XmlElement(name = "Str5")
+    private String Str5;
+
+    @XmlElement(name = "TWBG")
+    private String TWBG;
+
+    @XmlElement(name = "PatientNo")
+    private String PatientNo;
+}

+ 166 - 0
src/main/java/thyyxxk/webserver/entity/examinations/adicon/ReportDetail.java

@@ -0,0 +1,166 @@
+package thyyxxk.webserver.entity.examinations.adicon;
+
+import lombok.Data;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@Data
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement(name = "item")
+public class ReportDetail {
+    @XmlElement(name = "AdiconBarcode")
+    private String adiconBarcode;
+
+    @XmlElement(name = "PatientName")
+    private String patientName;
+
+    @XmlElement(name = "Sex")
+    private String sex;
+
+    @XmlElement(name = "Age")
+    private String age;
+
+    @XmlElement(name = "AgeType")
+    private String ageType;
+
+    @XmlElement(name = "Department")
+    private String department;
+
+    @XmlElement(name = "BedNo")
+    private String bedNo;
+
+    @XmlElement(name = "CollectionDate")
+    private String collectionDate;
+
+    @XmlElement(name = "ReceivedDate")
+    private String receivedDate;
+
+    @XmlElement(name = "LisDate")
+    private String lisDate;
+
+    @XmlElement(name = "ReportDate")
+    private String reportDate;
+
+    @XmlElement(name = "CustomerBarcode")
+    private String customerBarcode;
+
+    @XmlElement(name = "Doctor")
+    private String doctor;
+
+    @XmlElement(name = "Technician")
+    private String technician;
+
+    @XmlElement(name = "CheckedBy")
+    private String checkedBy;
+
+    @XmlElement(name = "Remark")
+    private String remark;
+
+    @XmlElement(name = "Instrument")
+    private String instrument;
+
+    @XmlElement(name = "SerialNumber")
+    private String serialNumber;
+
+    @XmlElement(name = "SampleType")
+    private String sampleType;
+
+    @XmlElement(name = "ClinicalDiagnosis")
+    private String clinicalDiagnosis;
+
+    @XmlElement(name = "ItemCode")
+    private String itemCode;
+
+    @XmlElement(name = "ItemName_CN")
+    private String itemNameCN;
+
+    @XmlElement(name = "ItemName_EN")
+    private String itemNameEN;
+
+    @XmlElement(name = "Result")
+    private String result;
+
+    @XmlElement(name = "ResultHint")
+    private String resultHint;
+
+    @XmlElement(name = "ResultReference")
+    private String resultReference;
+
+    @XmlElement(name = "ResultUnit")
+    private String resultUnit;
+
+    @XmlElement(name = "TestMethod")
+    private String testMethod;
+
+    @XmlElement(name = "TestMethod_EN")
+    private String testMethodEN;
+
+    @XmlElement(name = "Result_Pathology")
+    private String resultPathology;
+
+    @XmlElement(name = "SampleChar")
+    private String sampleChar;
+
+    @XmlElement(name = "PatientNumber")
+    private String patientNumber;
+
+    @XmlElement(name = "PatientPhone")
+    private String patientPhone;
+
+    @XmlElement(name = "BirthDate")
+    private String birthDate;
+
+    @XmlElement(name = "Str1")
+    private String str1;
+
+    @XmlElement(name = "Str2")
+    private String str2;
+
+    @XmlElement(name = "Str3")
+    private String str3;
+
+    @XmlElement(name = "Str4")
+    private String str4;
+
+    @XmlElement(name = "Str5")
+    private String str5;
+
+    @XmlElement(name = "TechnicianId")
+    private String technicianId;
+
+    @XmlElement(name = "CheckedById")
+    private String checkedById;
+
+    @XmlElement(name = "Approver")
+    private String approver;
+
+    @XmlElement(name = "ApproverId")
+    private String approverId;
+
+    @XmlElement(name = "CustomRequestItemId")
+    private String customRequestItemId;
+
+    @XmlElement(name = "CustomItemId")
+    private String customItemId;
+
+    @XmlElement(name = "CriticalValueFlag")
+    private String criticalValueFlag;
+
+    @XmlElement(name = "CustomerPositiveFlag")
+    private String customerPositiveFlag;
+
+    @XmlElement(name = "Xmbh")
+    private String xmbh;
+
+    @XmlElement(name = "Ybzt")
+    private String ybzt;
+
+    @XmlElement(name = "Zhmc")
+    private String zhmc;
+
+    @XmlElement(name = "Bgjyjs")
+    private String bgjyjs;
+}

+ 0 - 5
src/main/java/thyyxxk/webserver/entity/examinations/inspections/detail/InspectionDetail.java

@@ -1,8 +1,6 @@
 package thyyxxk.webserver.entity.examinations.inspections.detail;
 
 import lombok.Data;
-import thyyxxk.webserver.entity.examinations.adicon.AdiconHeader;
-import thyyxxk.webserver.entity.examinations.adicon.AdiconItem;
 
 import java.util.List;
 
@@ -13,7 +11,4 @@ import java.util.List;
 public class InspectionDetail {
     private InspectionHeader inspectionHeader;
     private List<InspectionItem> inspectionItems;
-
-    private AdiconHeader adiconHeader;
-    private List<AdiconItem> adiconItems;
 }

+ 1 - 1
src/main/java/thyyxxk/webserver/entity/examinations/inspections/request/ReportIndexInquiry.java

@@ -9,4 +9,4 @@ public class ReportIndexInquiry {
     private String socialNo;
     private String reqStartTime;
     private String reqEndTime;
-}
+}

+ 5 - 4
src/main/java/thyyxxk/webserver/service/LoginService.java

@@ -72,10 +72,11 @@ public class LoginService {
             dao.insertNewUserToDjUserBase(tempUserInfo);
         }
         String ip = IpAddressUtil.getIPAddress(request);
-        ResultVo<String> socketValidate = webSocketService.hasCertainIpAndCode(ip, tempUserInfo.getCode());
-        if (socketValidate.getCode() != ExceptionEnum.SUCCESS.getCode()) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, socketValidate.getMessage());
-        }
+
+//        ResultVo<String> socketValidate = webSocketService.hasCertainIpAndCode(ip, tempUserInfo.getCode());
+//        if (socketValidate.getCode() != ExceptionEnum.SUCCESS.getCode()) {
+//            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, socketValidate.getMessage());
+//        }
 
         String pwd = encrypt ? SecureUtil.md5(userInfo.getPassword()) : userInfo.getPassword();
         if (!Objects.equals("fromTriageScreen", userInfo.getSid()) && !pwd.equals(tempUserInfo.getPassword())) {

+ 157 - 0
src/main/java/thyyxxk/webserver/service/examinations/AdiconService.java

@@ -0,0 +1,157 @@
+package thyyxxk.webserver.service.examinations;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.text.StringEscapeUtils;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import thyyxxk.webserver.config.exception.BizException;
+import thyyxxk.webserver.entity.examinations.adicon.AdiconInquiry;
+import thyyxxk.webserver.entity.examinations.adicon.BarcodeType;
+import thyyxxk.webserver.entity.examinations.adicon.ListTableItem;
+import thyyxxk.webserver.entity.examinations.adicon.ReportDetail;
+import thyyxxk.webserver.service.externalhttp.AdiconHttpSrvc;
+import thyyxxk.webserver.utils.FilterUtil;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+import java.io.StringReader;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@Service
+public class AdiconService {
+    private final AdiconHttpSrvc adiconHttpSrvc;
+
+    private static final String URL = "http://222.240.235.22/CSWebService/ADReportWebService.asmx";
+
+    @Autowired
+    public AdiconService(AdiconHttpSrvc adiconHttpSrvc) {
+        this.adiconHttpSrvc = adiconHttpSrvc;
+    }
+
+    public String login(String type) throws Exception {
+        String xml = type.equals("JYK") ? adiconHttpSrvc.jykLogin() : adiconHttpSrvc.blkLogin();
+        Document document = DocumentHelper.parseText(xml);
+        Element root = document.getRootElement();
+        return root.getText();
+    }
+
+    public List<ListTableItem> getReportList(AdiconInquiry inquiry) throws Exception {
+        String key = URLEncoder.encode(inquiry.getKey(), StandardCharsets.UTF_8.name());
+        String xmlString = adiconHttpSrvc.getReportList(key, inquiry.getBegin(), inquiry.getEnd());
+        List<ListTableItem> result = new ArrayList<>();
+        Element root = getRootElement(xmlString);
+        List<Element> listtable = FilterUtil.cast(root.elements("listtable"));
+        JAXBContext jaxbContext = JAXBContext.newInstance(ListTableItem.class);
+        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+        for (Element element : listtable) {
+            StringReader reader = new StringReader(element.asXML());
+            ListTableItem listTable = (ListTableItem) unmarshaller.unmarshal(reader);
+            if (inquiry.getReportType().equals("全部") ||
+                inquiry.getReportType().equals(listTable.getReportType())) {
+                result.add(listTable);
+            }
+
+        }
+        return result;
+    }
+
+    public List<ReportDetail> getReportItemListByCustomerBarcode(AdiconInquiry inquiry) throws Exception {
+        String key = URLEncoder.encode(inquiry.getKey(), StandardCharsets.UTF_8.name());
+        String xmlString;
+        if (inquiry.getBarcodeType() == BarcodeType.CUSTOMER) {
+            xmlString = adiconHttpSrvc.getReportItemListByCustomerBarcode(key, inquiry.getBarcode(), inquiry.getReportType());
+        } else {
+            xmlString = adiconHttpSrvc.getReportItemListByAdiconBarcode(key, inquiry.getBarcode(), inquiry.getReportType());
+        }
+        List<ReportDetail> result = new ArrayList<>();
+        Element root = getRootElement(xmlString);
+        List<Element> items = FilterUtil.cast(root.elements("item"));
+        JAXBContext jaxbContext = JAXBContext.newInstance(ReportDetail.class);
+        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+        for (Element element : items) {
+            StringReader reader = new StringReader(element.asXML());
+            ReportDetail reportDetail = (ReportDetail) unmarshaller.unmarshal(reader);
+            result.add(reportDetail);
+        }
+        return result;
+    }
+
+    public String setSampleDownFlagByCustomerBarcode(AdiconInquiry inquiry) throws Exception {
+        String key = URLEncoder.encode(inquiry.getKey(), StandardCharsets.UTF_8.name());
+        String xmlString;
+        if (inquiry.getBarcodeType() == BarcodeType.CUSTOMER) {
+            xmlString = adiconHttpSrvc.setSampleDownFlagByCustomerBarcode(key, inquiry.getBarcode(), inquiry.getReportType());
+        } else {
+            xmlString = adiconHttpSrvc.setSampleDownFlagByAdiconBarcode(key, inquiry.getBarcode(), inquiry.getReportType());
+        }
+        Document document = DocumentHelper.parseText(xmlString);
+        Element root = document.getRootElement();
+        return root.getText();
+    }
+
+    public String getByteReport(AdiconInquiry inquiry) throws Exception {
+        String key = URLEncoder.encode(inquiry.getKey(), StandardCharsets.UTF_8.name());
+        String xmlString = adiconHttpSrvc.getByteReport(inquiry.getId(), key);
+        Document document = DocumentHelper.parseText(xmlString);
+        Element root = document.getRootElement();
+        return root.getText();
+    }
+
+    private Element getRootElement(String xmlString) throws DocumentException {
+        String xmlWithoutDeclaration = removeXmlDeclaration(xmlString);
+        String standardXml = StringEscapeUtils.unescapeXml(xmlWithoutDeclaration);
+        standardXml = standardXml.replaceAll("\r\n", "");
+        if (standardXml.startsWith("<string")) {
+            int startIndex = standardXml.indexOf(">");
+            int endIndex = standardXml.lastIndexOf("</string>");
+            standardXml = standardXml.substring(startIndex + 1, endIndex);
+        }
+        if (!standardXml.startsWith("<")) {
+            throw new BizException(standardXml);
+        }
+        Document document = DocumentHelper.parseText(standardXml);
+        return document.getRootElement();
+    }
+
+    private static String removeXmlDeclaration(String xmlString) {
+        // 去除XML声明
+        return xmlString.replaceAll("<\\?xml.*?\\?>", "");
+    }
+
+    public void test() {
+//        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+//        DocumentBuilder builder = factory.newDocumentBuilder();
+//        ByteArrayInputStream input = new ByteArrayInputStream(standardXml.getBytes(StandardCharsets.UTF_8));
+//        org.w3c.dom.Document document = builder.parse(input);
+//
+//        NodeList listTableNodes = document.getElementsByTagName("listtable");
+//
+//        for (int i = 0; i < listTableNodes.getLength(); i++) {
+//            Node node = listTableNodes.item(i);
+//            if (node.getNodeType() == Node.ELEMENT_NODE) {
+//                org.w3c.dom.Element element = (org.w3c.dom.Element) node;
+//                String id = element.getElementsByTagName("Id").item(0).getTextContent();
+//                String reportType = element.getElementsByTagName("ReportType").item(0).getTextContent();
+//                String adiconBarcode = element.getElementsByTagName("AdiconBarcode").item(0).getTextContent();
+//                String patientName = element.getElementsByTagName("PatientName").item(0).getTextContent();
+//
+//                System.out.println("Id: " + id);
+//                System.out.println("Report Type: " + reportType);
+//                System.out.println("Adicon Barcode: " + adiconBarcode);
+//                System.out.println("Patient Name: " + patientName);
+//                System.out.println("---------------");
+//            }
+//        }
+    }
+}
+
+
+

+ 0 - 76
src/main/java/thyyxxk/webserver/service/examinations/adicon/Proxy.java

@@ -1,76 +0,0 @@
-package thyyxxk.webserver.service.examinations.adicon;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebEndpoint;
-import javax.xml.ws.WebServiceClient;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServiceFeature;
-
-
-/**
- * This class was generated by the JAX-WS RI.
- * JAX-WS RI 2.2.9-b130926.1035
- * Generated source version: 2.2
- */
-@WebServiceClient(name = "Proxy", targetNamespace = "http://www.hautechs.com/", wsdlLocation = "http://172.16.32.178:623/Foreignlaboratory/Proxy.asmx?wsdl")
-public class Proxy extends Service {
-
-    private final static URL PROXY_WSDL_LOCATION;
-    private final static WebServiceException PROXY_EXCEPTION;
-    private final static QName PROXY_QNAME = new QName("http://www.hautechs.com/", "Proxy");
-
-    static {
-        URL url = null;
-        WebServiceException e = null;
-        try {
-            url = new URL("http://172.16.32.178:623/Foreignlaboratory/Proxy.asmx?wsdl");
-        } catch (MalformedURLException ex) {
-            e = new WebServiceException(ex);
-        }
-        PROXY_WSDL_LOCATION = url;
-        PROXY_EXCEPTION = e;
-    }
-
-    public Proxy() {
-        super(__getWsdlLocation(), PROXY_QNAME);
-    }
-
-    public Proxy(WebServiceFeature... features) {
-        super(__getWsdlLocation(), PROXY_QNAME, features);
-    }
-
-    public Proxy(URL wsdlLocation) {
-        super(wsdlLocation, PROXY_QNAME);
-    }
-
-    public Proxy(URL wsdlLocation, WebServiceFeature... features) {
-        super(wsdlLocation, PROXY_QNAME, features);
-    }
-
-    public Proxy(URL wsdlLocation, QName serviceName) {
-        super(wsdlLocation, serviceName);
-    }
-
-    public Proxy(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
-        super(wsdlLocation, serviceName, features);
-    }
-
-    private static URL __getWsdlLocation() {
-        if (PROXY_EXCEPTION != null) {
-            throw PROXY_EXCEPTION;
-        }
-        return PROXY_WSDL_LOCATION;
-    }
-
-    /**
-     * @return returns ProxySoap
-     */
-    @WebEndpoint(name = "ProxySoap")
-    public ProxySoap getProxySoap() {
-        return super.getPort(new QName("http://www.hautechs.com/", "ProxySoap"), ProxySoap.class);
-    }
-
-}

+ 0 - 117
src/main/java/thyyxxk/webserver/service/examinations/adicon/ProxySoap.java

@@ -1,117 +0,0 @@
-package thyyxxk.webserver.service.examinations.adicon;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-
-
-/**
- * This class was generated by the JAX-WS RI.
- * JAX-WS RI 2.2.9-b130926.1035
- * Generated source version: 2.2
- */
-@WebService(name = "ProxySoap", targetNamespace = "http://www.hautechs.com/")
-public interface ProxySoap {
-
-    /**
-     * 根据样本条码获取申请详情
-     *
-     * @param barcode
-     * @param token
-     * @return returns java.lang.String
-     */
-    @WebMethod(operationName = "GetSampleRequest", action = "http://www.hautechs.com/GetSampleRequest")
-    @WebResult(name = "GetSampleRequestResult", targetNamespace = "http://www.hautechs.com/")
-    @RequestWrapper(localName = "GetSampleRequest", targetNamespace = "http://www.hautechs.com/", className = "adicon.GetSampleRequest")
-    @ResponseWrapper(localName = "GetSampleRequestResponse", targetNamespace = "http://www.hautechs.com/", className = "adicon.GetSampleRequestResponse")
-    String getSampleRequest(@WebParam(name = "token", targetNamespace = "http://www.hautechs.com/") String token,
-                            @WebParam(name = "barcode", targetNamespace = "http://www.hautechs.com/") String barcode);
-
-    /**
-     * 确认已经获取标本信息
-     *
-     * @param barcode
-     * @param token
-     * @return returns java.lang.String
-     */
-    @WebMethod(operationName = "ConfirmRequest", action = "http://www.hautechs.com/ConfirmRequest")
-    @WebResult(name = "ConfirmRequestResult", targetNamespace = "http://www.hautechs.com/")
-    @RequestWrapper(localName = "ConfirmRequest", targetNamespace = "http://www.hautechs.com/", className = "adicon.ConfirmRequest")
-    @ResponseWrapper(localName = "ConfirmRequestResponse", targetNamespace = "http://www.hautechs.com/", className = "adicon.ConfirmRequestResponse")
-    String confirmRequest(@WebParam(name = "token", targetNamespace = "http://www.hautechs.com/") String token,
-                          @WebParam(name = "barcode", targetNamespace = "http://www.hautechs.com/") String barcode);
-
-    /**
-     * 现行的检验申请项目字典
-     *
-     * @return returns java.lang.String
-     */
-    @WebMethod(operationName = "LisApplyItemDictionary", action = "http://www.hautechs.com/LisApplyItemDictionary")
-    @WebResult(name = "LisApplyItemDictionaryResult", targetNamespace = "http://www.hautechs.com/")
-    @RequestWrapper(localName = "LisApplyItemDictionary", targetNamespace = "http://www.hautechs.com/", className = "adicon.LisApplyItemDictionary")
-    @ResponseWrapper(localName = "LisApplyItemDictionaryResponse", targetNamespace = "http://www.hautechs.com/", className = "adicon.LisApplyItemDictionaryResponse")
-    String lisApplyItemDictionary();
-
-    /**
-     * 现行的检验样本容器字典
-     *
-     * @return returns java.lang.String
-     */
-    @WebMethod(operationName = "LisContainerDictionary", action = "http://www.hautechs.com/LisContainerDictionary")
-    @WebResult(name = "LisContainerDictionaryResult", targetNamespace = "http://www.hautechs.com/")
-    @RequestWrapper(localName = "LisContainerDictionary", targetNamespace = "http://www.hautechs.com/", className = "adicon.LisContainerDictionary")
-    @ResponseWrapper(localName = "LisContainerDictionaryResponse", targetNamespace = "http://www.hautechs.com/", className = "adicon.LisContainerDictionaryResponse")
-    String lisContainerDictionary();
-
-    /**
-     * 现行的检验样本类型字典
-     *
-     * @return returns java.lang.String
-     */
-    @WebMethod(operationName = "LisSpecimenDictionary", action = "http://www.hautechs.com/LisSpecimenDictionary")
-    @WebResult(name = "LisSpecimenDictionaryResult", targetNamespace = "http://www.hautechs.com/")
-    @RequestWrapper(localName = "LisSpecimenDictionary", targetNamespace = "http://www.hautechs.com/", className = "adicon.LisSpecimenDictionary")
-    @ResponseWrapper(localName = "LisSpecimenDictionaryResponse", targetNamespace = "http://www.hautechs.com/", className = "adicon.LisSpecimenDictionaryResponse")
-    String lisSpecimenDictionary();
-
-    /**
-     * 现行的检验测试项目字典
-     *
-     * @return returns java.lang.String
-     */
-    @WebMethod(operationName = "LisItemDictionary", action = "http://www.hautechs.com/LisItemDictionary")
-    @WebResult(name = "LisItemDictionaryResult", targetNamespace = "http://www.hautechs.com/")
-    @RequestWrapper(localName = "LisItemDictionary", targetNamespace = "http://www.hautechs.com/", className = "adicon.LisItemDictionary")
-    @ResponseWrapper(localName = "LisItemDictionaryResponse", targetNamespace = "http://www.hautechs.com/", className = "adicon.LisItemDictionaryResponse")
-    String lisItemDictionary();
-
-    /**
-     * 根据申请项目关键字查询包含的检验测试项目列表
-     *
-     * @param itemKey
-     * @return returns java.lang.String
-     */
-    @WebMethod(operationName = "GetApplyItemDetail", action = "http://www.hautechs.com/GetApplyItemDetail")
-    @WebResult(name = "GetApplyItemDetailResult", targetNamespace = "http://www.hautechs.com/")
-    @RequestWrapper(localName = "GetApplyItemDetail", targetNamespace = "http://www.hautechs.com/", className = "adicon.GetApplyItemDetail")
-    @ResponseWrapper(localName = "GetApplyItemDetailResponse", targetNamespace = "http://www.hautechs.com/", className = "adicon.GetApplyItemDetailResponse")
-    String getApplyItemDetail(@WebParam(name = "itemKey", targetNamespace = "http://www.hautechs.com/") String itemKey);
-
-    /**
-     * 上传检验结果到数据平台
-     *
-     * @param packages
-     * @param token
-     * @return returns java.lang.String
-     */
-    @WebMethod(operationName = "UploadLisRepData", action = "http://www.hautechs.com/UploadLisRepData")
-    @WebResult(name = "UploadLisRepDataResult", targetNamespace = "http://www.hautechs.com/")
-    @RequestWrapper(localName = "UploadLisRepData", targetNamespace = "http://www.hautechs.com/", className = "adicon.UploadLisRepData")
-    @ResponseWrapper(localName = "UploadLisRepDataResponse", targetNamespace = "http://www.hautechs.com/", className = "adicon.UploadLisRepDataResponse")
-    String uploadLisRepData(@WebParam(name = "token", targetNamespace = "http://www.hautechs.com/") String token,
-                            @WebParam(name = "packages", targetNamespace = "http://www.hautechs.com/") String packages);
-
-}

+ 40 - 0
src/main/java/thyyxxk/webserver/service/externalhttp/AdiconHttpSrvc.java

@@ -0,0 +1,40 @@
+package thyyxxk.webserver.service.externalhttp;
+
+import com.dtflys.forest.annotation.*;
+
+@BaseRequest(baseURL = "http://222.240.235.22/CSWebService/ADReportWebService.asmx")
+public interface AdiconHttpSrvc {
+    @Get("/Login?logid=X15024&password=Xx15024*")
+    String jykLogin();
+
+    @Get("/Login?logid=X15083&password=Xx15083*")
+    String blkLogin();
+
+    @Get("/GetReportList?Key={key}&BeginDateTime={begin}&EndDateTime={end}&TypeDateTime=2&AgainFlag=0")
+    String getReportList(@Var("key") String key,
+                         @Var("begin") String begin,
+                         @Var("end") String end);
+
+    @Get("/GetReportItemListByCustomerBarocde?Key={key}&CustomerBarcode={barcode}&ReportType={reportType}")
+    String getReportItemListByCustomerBarcode(@Var("key") String key,
+                                              @Var("barcode") String barcode,
+                                              @Var("reportType") String reportType);
+
+    @Get("/GetReportItemListByAdiconBarocde?Key={key}&CustomerBarcode={barcode}&ReportType={reportType}")
+    String getReportItemListByAdiconBarcode(@Var("key") String key,
+                                            @Var("barcode") String barcode,
+                                            @Var("reportType") String reportType);
+
+    @Get("/SetSampleDownFlagByCustomerBarocde?Key={key}&CustomerBarcode={barcode}&ReportType={reportType}")
+    String setSampleDownFlagByCustomerBarcode(@Var("key") String key,
+                                              @Var("barcode") String barcode,
+                                              @Var("reportType") String reportType);
+
+    @Get("/SetSampleDownFlagByAdiconBarocde?Key={key}&CustomerBarcode={barcode}&ReportType={reportType}")
+    String setSampleDownFlagByAdiconBarcode(@Var("key") String key,
+                                            @Var("barcode") String barcode,
+                                            @Var("reportType") String reportType);
+
+    @Get("/GetByteReport?Id={id}&Key={key}")
+    String getByteReport(@Var("id") String id, @Var("key") String key);
+}

+ 0 - 1
src/main/java/thyyxxk/webserver/service/externalhttp/OutpatientBookingHttp.java

@@ -3,7 +3,6 @@ package thyyxxk.webserver.service.externalhttp;
 import com.alibaba.fastjson.JSONObject;
 import com.dtflys.forest.annotation.*;
 
-//@BaseRequest(baseURL = "http://172.16.30.33:8089/thmz")
 @BaseRequest(baseURL = "http://webhis.thyy.cn:81/thmz")
 public interface OutpatientBookingHttp {
 

+ 5 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

@@ -89,13 +89,16 @@ public class SiQueryService {
     }
 
     public ResultVo<PsnBaseInfo> obtainBasicPersonInfo(QryPsnBsInfo qryPsnBsInfo) {
+        log.info("1,{}", qryPsnBsInfo.getPsnCertType());
         if (null == qryPsnBsInfo.getOnlyQry() && StringUtil.isBlank(qryPsnBsInfo.getMedType())) {
             return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "请选择患者的医疗类别!");
         }
+        log.info("2,{}", qryPsnBsInfo.getPsnCertType());
         if (StringUtil.isBlank(qryPsnBsInfo.getSocialNo()) && StringUtil.notBlank(qryPsnBsInfo.getPatNo())
                 && qryPsnBsInfo.getPatNo().length() >= 15) {
             qryPsnBsInfo.setSocialNo(qryPsnBsInfo.getPatNo());
         }
+        log.info("3,{}", qryPsnBsInfo.getPsnCertType());
         if (StringUtil.isBlank(qryPsnBsInfo.getSocialNo())) {
             QryPsnBsInfo qpbi = dao.selectMzSocialAndName(qryPsnBsInfo.getPatNo());
             if (null == qpbi || StringUtil.isBlank(qpbi.getSocialNo())) {
@@ -109,9 +112,11 @@ public class SiQueryService {
             qryPsnBsInfo.setPsnCertType(qpbi.getPsnCertType());
             qryPsnBsInfo.setLedgerSn(0);
         }
+        log.info("4,{}", qryPsnBsInfo.getPsnCertType());
         if (null != qryPsnBsInfo.getLedgerSn() && qryPsnBsInfo.getLedgerSn() != 0) {
             qryPsnBsInfo.setLedgerSn(dao.selectMaxLedgerSn(qryPsnBsInfo.getPatNo(), qryPsnBsInfo.getTimes()));
         }
+        log.info("5,{}", qryPsnBsInfo.getPsnCertType());
         if (StringUtil.isBlank(qryPsnBsInfo.getStaffId())) {
             qryPsnBsInfo.setStaffId(TokenUtil.getInstance().getTokenUserId());
         }