From 8fe7805b75fceef28f00fb0124901031a287429c Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期四, 07 五月 2026 16:46:10 +0800
Subject: [PATCH] 【市一】remark 统一调整

---
 smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java |   50 +++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 39 insertions(+), 11 deletions(-)

diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
index 6df1fae..9644504 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
@@ -79,7 +79,8 @@
         try {
             Map<String, Object> requestParams = buildRequestParams(reqVO);
             Map<String, String> headers = buildRequestHeaders();
-            String result = HttpUtils.sendPostByHeader(sltdPubPath + "osj/hbos-thirdparty-integration/standard/common/healthcareRecord/dtcQueryHealthcareRecordList", new Gson().toJson(requestParams), headers);
+            log.info("璇锋眰鍙傛暟鍑洪櫌鏁版嵁鍦板潃锛歿},appKey:{}", sltdPubPath + "/osj/hbos-thirdparty-integration/standard/common/healthcareRecord/dtcQueryHealthcareRecordList", APP_KEY);
+            String result = HttpUtils.sendPostByHeader(sltdPubPath + "/osj/hbos-thirdparty-integration/standard/common/healthcareRecord/dtcQueryHealthcareRecordList", new Gson().toJson(requestParams), headers);
 
             String cry = determineCry(reqVO);
             log.info("cry鐨勫�间负锛歿}", cry);
@@ -88,7 +89,7 @@
             return serviceSLTDInhospResDTOS;
         } catch (Exception e) {
             log.error("銆恞ueryHealthcareRecordList銆戣皟鐢ㄧ渷绔嬪悓寰峰仴搴疯褰曟煡璇㈡帴鍙e紓甯革紝璇锋眰鍙傛暟锛歿}", reqVO, e);
-            throw new RuntimeException("璋冪敤鐪佺珛鍚屽痉鍋ュ悍璁板綍鏌ヨ鎺ュ彛澶辫触", e);
+            throw new RuntimeException("璋冪敤鐪佺珛鍚屽痉鍋ュ悍璁板綍鏌ヨ鎺ュ彛澶辫触:" + e.getMessage());
         }
     }
 
@@ -584,6 +585,7 @@
         queryInhosp.setSerialnum(StringUtils.trim(patMedInhosp.getSerialnum()));
         queryInhosp.setOrgid(StringUtils.trim(dto.getOrgId()));
         queryInhosp.setInhospstate(cry);
+        queryInhosp.setSchemestatus(0L);
         log.info("----------------杩欓噷鐨勫叆鍙備负锛歿},{}", queryInhosp.getPatno(), queryInhosp.getSerialnum());
         List<PatMedInhosp> existingInhosps = patMedInhospService.selectPatMedInhosp(queryInhosp);
 
@@ -707,11 +709,43 @@
         patMedInhosp.setSerialnum(dto.getHealthcareRecordNo());
         patMedInhosp.setInhospno(dto.getHealthcareRecordNo());
         patMedInhosp.setFuflag("1");
+
+
         if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1"))
             patMedInhosp.setFuflag("0");
-        if ("0".equals(cry)) patMedInhosp.setInhospstate("0");
-        if ("1".equals(cry)) patMedInhosp.setInhospstate("1");
-        if ("3".equals(cry)) patMedInhosp.setInhospstate("3");
+        if ("0".equals(cry)) {
+            patMedInhosp.setInhospstate("0");
+            if (CollectionUtils.isNotEmpty(dto.getDiagnosisList()) && dto.getDiagnosisList().size() > 0) {
+                for (ServiceSLTDDiagnosisResDTO diagnosis : dto.getDiagnosisList()) {
+                    if (diagnosis.getIsMainDiagnosis() == 1) {
+                        patMedInhosp.setDiagname(diagnosis.getDiagnosisDictName() == null ? "" : diagnosis.getDiagnosisDictName());
+                        patMedInhosp.setIcd10code(diagnosis.getDiagnosisDictCode() == null ? "" : diagnosis.getDiagnosisDictCode());
+                    }
+                }
+            }
+        }
+        if ("1".equals(cry)) {
+            patMedInhosp.setInhospstate("1");
+            if (CollectionUtils.isNotEmpty(dto.getDiagnosisList()) && dto.getDiagnosisList().size() > 0) {
+                for (ServiceSLTDDiagnosisResDTO diagnosis : dto.getDiagnosisList()) {
+                    if (diagnosis.getIsMainDiagnosis() == 1) {
+                        patMedInhosp.setLeavediagname(diagnosis.getDiagnosisDictName() == null ? "" : diagnosis.getDiagnosisDictName());
+                        patMedInhosp.setLeaveicd10code(diagnosis.getDiagnosisDictCode() == null ? "" : diagnosis.getDiagnosisDictCode());
+                    }
+                }
+            }
+        }
+        if ("3".equals(cry)) {
+            patMedInhosp.setInhospstate("3");
+            if (CollectionUtils.isNotEmpty(dto.getDiagnosisList()) && dto.getDiagnosisList().size() > 0) {
+                for (ServiceSLTDDiagnosisResDTO diagnosis : dto.getDiagnosisList()) {
+                    if (diagnosis.getIsMainDiagnosis() == 1) {
+                        patMedInhosp.setDiagname(diagnosis.getDiagnosisDictName() == null ? "" : diagnosis.getDiagnosisDictName());
+                        patMedInhosp.setIcd10code(diagnosis.getDiagnosisDictCode() == null ? "" : diagnosis.getDiagnosisDictCode());
+                    }
+                }
+            }
+        }
         patMedInhosp.setHospitalcode(dto.getOrgId());
         patMedInhosp.setBedNo(dto.getBedNumber());
         patMedInhosp.setStarttime(parseDate(dto.getStartTime()));
@@ -765,12 +799,6 @@
             queryByPatientNo.setIdcardno(StringUtils.isNotEmpty(dto.getIdCardNo()) ? dto.getIdCardNo().trim() : null);
             existingArchives = patArchiveService.selectPatArchiveList(queryByPatientNo);
         }
-//        if (CollectionUtils.isEmpty(existingArchives) && !StringUtils.isEmpty(dto.getIdCardNo())) {
-//            PatArchive queryByIdCard = new PatArchive();
-//            queryByIdCard.setIdcardno(dto.getIdCardNo().trim());
-//            existingArchives = patArchiveService.selectPatArchiveList(queryByIdCard);
-//        }
-
         PatArchive patArchive = buildPatientArchive(dto);
 
         if (CollectionUtils.isEmpty(existingArchives)) {

--
Gitblit v1.9.3