From b315ab9165f83069e8f16728d11486d86fc8b810 Mon Sep 17 00:00:00 2001
From: linjj <850658129@qq.com>
Date: Mon, 22 Jul 2024 11:15:30 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 91 +++++++++++
.../java/com/ann/demo/DemoApplication.java | 13 ++
.../java/com/ann/demo/ServletInitializer.java | 13 ++
.../java/com/ann/demo/TestController.java | 100 ++++++++++++
.../ann/demo/entity/filing/ArchiveDetail.java | 92 +++++++++++
.../ann/demo/entity/filing/ArchiveMaster.java | 146 +++++++++++++++++
.../ann/demo/entity/filing/ExamApplyDto.java | 18 +++
.../demo/interfaces/HomepageDictionary.java | 14 ++
.../interfaces/config/WebServiceConfig.java | 46 ++++++
.../impl/HomepageDictionaryImpl.java | 107 +++++++++++++
.../primary/ArchiveDetailRepository.java | 109 +++++++++++++
.../primary/ArchiveMasterRepository.java | 14 ++
.../demo/service/ArchiveDetailService.java | 24 +++
.../demo/service/ArchiveMasterService.java | 16 ++
.../impl/ArchiveDetailServiceImpl.java | 148 ++++++++++++++++++
.../impl/ArchiveMasterServiceImpl.java | 27 ++++
.../java/com/ann/demo/util/MapObjUtil.java | 75 +++++++++
src/main/resources/application.yml | 32 ++++
src/main/resources/logback-spring.xml | 47 ++++++
.../com/ann/demo/DemoApplicationTests.java | 9 ++
20 files changed, 1141 insertions(+)
create mode 100644 pom.xml
create mode 100644 src/main/java/com/ann/demo/DemoApplication.java
create mode 100644 src/main/java/com/ann/demo/ServletInitializer.java
create mode 100644 src/main/java/com/ann/demo/TestController.java
create mode 100644 src/main/java/com/ann/demo/entity/filing/ArchiveDetail.java
create mode 100644 src/main/java/com/ann/demo/entity/filing/ArchiveMaster.java
create mode 100644 src/main/java/com/ann/demo/entity/filing/ExamApplyDto.java
create mode 100644 src/main/java/com/ann/demo/interfaces/HomepageDictionary.java
create mode 100644 src/main/java/com/ann/demo/interfaces/config/WebServiceConfig.java
create mode 100644 src/main/java/com/ann/demo/interfaces/impl/HomepageDictionaryImpl.java
create mode 100644 src/main/java/com/ann/demo/repository/primary/ArchiveDetailRepository.java
create mode 100644 src/main/java/com/ann/demo/repository/primary/ArchiveMasterRepository.java
create mode 100644 src/main/java/com/ann/demo/service/ArchiveDetailService.java
create mode 100644 src/main/java/com/ann/demo/service/ArchiveMasterService.java
create mode 100644 src/main/java/com/ann/demo/service/impl/ArchiveDetailServiceImpl.java
create mode 100644 src/main/java/com/ann/demo/service/impl/ArchiveMasterServiceImpl.java
create mode 100644 src/main/java/com/ann/demo/util/MapObjUtil.java
create mode 100644 src/main/resources/application.yml
create mode 100644 src/main/resources/logback-spring.xml
create mode 100644 src/test/java/com/ann/demo/DemoApplicationTests.java
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..5145e42
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,91 @@
+
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.2.1.RELEASE
+
+ com.ann
+ demo
+ 0.0.1-SNAPSHOT
+ war
+ demo
+ Demo project for Spring Boot
+
+
+ 1.8
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+ provided
+
+
+
+
+ com.microsoft.sqlserver
+ sqljdbc4
+ 4.0
+
+
+
+ com.oracle
+ ojdbc14
+ 14.0.0
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+
+ org.projectlombok
+ lombok
+
+
+
+
+ org.apache.commons
+ commons-lang3
+ 3.3.2
+
+
+
+
+ org.apache.cxf
+ cxf-spring-boot-starter-jaxws
+ 3.2.5
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.junit.vintage
+ junit-vintage-engine
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+ WholeCheckInterface
+
+
+
diff --git a/src/main/java/com/ann/demo/DemoApplication.java b/src/main/java/com/ann/demo/DemoApplication.java
new file mode 100644
index 0000000..7a132a5
--- /dev/null
+++ b/src/main/java/com/ann/demo/DemoApplication.java
@@ -0,0 +1,13 @@
+package com.ann.demo;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class DemoApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(DemoApplication.class, args);
+ }
+
+}
diff --git a/src/main/java/com/ann/demo/ServletInitializer.java b/src/main/java/com/ann/demo/ServletInitializer.java
new file mode 100644
index 0000000..8bf4915
--- /dev/null
+++ b/src/main/java/com/ann/demo/ServletInitializer.java
@@ -0,0 +1,13 @@
+package com.ann.demo;
+
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+public class ServletInitializer extends SpringBootServletInitializer {
+
+ @Override
+ protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
+ return application.sources(DemoApplication.class);
+ }
+
+}
diff --git a/src/main/java/com/ann/demo/TestController.java b/src/main/java/com/ann/demo/TestController.java
new file mode 100644
index 0000000..9d56334
--- /dev/null
+++ b/src/main/java/com/ann/demo/TestController.java
@@ -0,0 +1,100 @@
+package com.ann.demo;
+
+import com.ann.demo.service.impl.ArchiveDetailServiceImpl;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author: LeiJiaXin
+ * @Date: 2019/7/18 10:47
+ */
+@RestController
+@RequestMapping("/")
+public class TestController {
+
+ @Autowired
+ private ArchiveDetailServiceImpl archiveDetailService;
+
+ // @Autowired
+// private ArchiveDetailService archiveDetailService;
+//
+// @Autowired
+// private ArchiveMasterService archiveMasterService;
+//
+// // pdf地址
+// public static String mustCheckData;
+//
+// @Value("${mustCheckData}")
+// public void setMustCheckData(String mustCheckData) {
+// TestController.mustCheckData = mustCheckData;
+// }
+//
+// public static String getMustCheckData() {
+// return mustCheckData;
+// }
+ @RequestMapping("/haha1")
+ public String createJob1() {
+ JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
+ Client client = dcf.createClient("http://localhost:57777/AppEngine3?wsdl");
+ Object[] objects = new Object[0];
+ // invoke("方法名",参数1,参数2,参数3....);
+ try {
+ objects = client.invoke("SearchFulltext", "护理");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return objects[0].toString();
+ }
+
+
+ @RequestMapping("/haha")
+ public String createJob() {
+ List list = new ArrayList();
+ list.add("10");
+ // archiveDetailService.getInspectionReportNotExits(list,"02e4bec6-633f-49cf-9acd-a3d332376800");
+
+ return "123";
+ }
+
+// Integer result = archiveMasterService.countByIdAndIsValid(masterId);
+//
+// if (result == 0){
+// return "没有该患者信息!";
+// }
+//
+// // 必须检查类型
+// StringBuffer sb = new StringBuffer();
+// if (mustCheckData != "") {
+// String[] mustCheckDataArray = mustCheckData.split(",");
+// List types = Arrays.asList(mustCheckDataArray);
+// String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId);
+// if (typeIsExits != null) {
+// sb.append(typeIsExits + "缺失");
+// }
+// }
+//
+// // 检查申请单
+// String checkReportNotExits = archiveDetailService.getCheckReportNotExits(masterId);
+// if(checkReportNotExits != null){
+// if(sb.length() != 0){
+// sb.append(",");
+// }
+// sb.append(checkReportNotExits);
+// }
+//
+// // 检验申请单
+//
+// //最后
+// if (sb.length() == 0) {
+// sb.append("完整");
+// }
+// return sb + "";
+// }
+
+}
diff --git a/src/main/java/com/ann/demo/entity/filing/ArchiveDetail.java b/src/main/java/com/ann/demo/entity/filing/ArchiveDetail.java
new file mode 100644
index 0000000..dc72c71
--- /dev/null
+++ b/src/main/java/com/ann/demo/entity/filing/ArchiveDetail.java
@@ -0,0 +1,92 @@
+package com.ann.demo.entity.filing;
+
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import java.util.Date;
+
+/**
+ *
+ * 病历文件表
+ *
+ *
+ * @author ly
+ * @since 2019-04-24
+ */
+@Entity
+@Data
+public class ArchiveDetail {
+
+ /**
+ * id
+ */
+ @Id
+ private String id;
+
+ /**
+ * pdf路径
+ */
+ private String pdfPath;
+
+ /**
+ * master表关联id
+ */
+ @Column(name = "masterid")
+ private String masterID;
+
+ /**
+ * 抓取时间
+ */
+ @Column(name = "uploaddatetime")
+ private Date upLoadDateTime;
+
+ /**
+ * 分段id
+ */
+ @Column(name = "assortid")
+ private String assortID;
+
+ /**
+ * 来源
+ */
+ private String source;
+
+ /**
+ * 冗余字段
+ */
+ @Column(name = "subassort")
+ private String subAssort;
+
+ /**
+ * 标题
+ */
+ private String title;
+
+ /**
+ * 是否显示 0显示 1不显示
+ */
+ private String flag;
+
+ /**
+ * 系统
+ */
+ private String sys;
+
+ public ArchiveDetail(String id, String pdfPath, String masterID, Date upLoadDateTime, String assortID, String source, String subAssort, String title, String flag, String sys) {
+ this.id = id;
+ this.pdfPath = pdfPath;
+ this.masterID = masterID;
+ this.upLoadDateTime = upLoadDateTime;
+ this.assortID = assortID;
+ this.source = source;
+ this.subAssort = subAssort;
+ this.title = title;
+ this.flag = flag;
+ this.sys = sys;
+ }
+
+ public ArchiveDetail() {
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/ann/demo/entity/filing/ArchiveMaster.java b/src/main/java/com/ann/demo/entity/filing/ArchiveMaster.java
new file mode 100644
index 0000000..4085b36
--- /dev/null
+++ b/src/main/java/com/ann/demo/entity/filing/ArchiveMaster.java
@@ -0,0 +1,146 @@
+package com.ann.demo.entity.filing;
+
+
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import java.util.Date;
+
+
+/**
+ *
+ * 病人基本信息表
+ *
+ *
+ * @author ly
+ * @since 2019-04-24
+ */
+@Entity
+@Data
+public class ArchiveMaster {
+
+ /**
+ * id
+ */
+ @Id
+ private String id;
+
+ /**
+ * 记帐号
+ */
+ private String patientId;
+
+ /**
+ * 住院号
+ */
+ private String inpNo;
+
+ /**
+ * 住院次数
+ */
+ private String visitId;
+
+ /**
+ * 姓名
+ */
+ private String name;
+
+ /**
+ * 性别
+ */
+ private String sex;
+
+ /**
+ * 出院科室
+ */
+ private String deptName;
+
+ /**
+ * 出院时间 not null '1801'开头为在院 非'1801'开头为出院
+ */
+ private Date dischargeDateTime;
+
+ /**
+ * 归档状态 仅质控流程使用
+ */
+ @Column(name = "archivestate")
+ private String archiveState;
+
+ /**
+ * 入院时间
+ */
+ private Date admissionDateTime;
+
+ /**
+ * 入院科室
+ */
+ private String deptAdmissionTo;
+
+ /**
+ * 审核医生
+ */
+ private String checkDoctor;
+
+ /**
+ * 审核时间
+ */
+ private Date checkDatetime;
+
+ /**
+ * 终审医生
+ */
+ private String checkedDoctor;
+
+ /**
+ * 终审时间
+ */
+ private Date checkedDatetime;
+
+ /**
+ *
+ */
+ @Column(name = "lockinfo")
+ private String LockInfo;
+
+ /**
+ * 主管医生
+ */
+ private String doctorInCharge;
+
+ /**
+ * 身份证号
+ */
+ private String idNo;
+
+ /**
+ * 是否死亡 死亡填5
+ */
+ private String dischargeDisposition;
+
+ /**
+ * 离院方式
+ */
+ private String deptCodeLend;
+
+ /**
+ * 退回人角色
+ */
+ private String returntoRole;
+
+ /**
+ * 退回人工号
+ */
+ private String returnOperUsername;
+
+ /**
+ * 召回原因
+ */
+ private String changeReason;
+
+ /**
+ * 床号
+ */
+ private String bedId;
+}
\ No newline at end of file
diff --git a/src/main/java/com/ann/demo/entity/filing/ExamApplyDto.java b/src/main/java/com/ann/demo/entity/filing/ExamApplyDto.java
new file mode 100644
index 0000000..45f142e
--- /dev/null
+++ b/src/main/java/com/ann/demo/entity/filing/ExamApplyDto.java
@@ -0,0 +1,18 @@
+package com.ann.demo.entity.filing;
+
+
+import lombok.Data;
+
+@Data
+public class ExamApplyDto {
+
+ /**
+ * 申请单号
+ */
+ private String applyId;
+
+ /**
+ * 报告名
+ */
+ private String name;
+}
diff --git a/src/main/java/com/ann/demo/interfaces/HomepageDictionary.java b/src/main/java/com/ann/demo/interfaces/HomepageDictionary.java
new file mode 100644
index 0000000..3e757fe
--- /dev/null
+++ b/src/main/java/com/ann/demo/interfaces/HomepageDictionary.java
@@ -0,0 +1,14 @@
+package com.ann.demo.interfaces;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+@WebService
+public interface HomepageDictionary {
+
+ @WebMethod
+ String CheckData(@WebParam(name = "masterId") String masterId);
+
+
+}
diff --git a/src/main/java/com/ann/demo/interfaces/config/WebServiceConfig.java b/src/main/java/com/ann/demo/interfaces/config/WebServiceConfig.java
new file mode 100644
index 0000000..9ebec77
--- /dev/null
+++ b/src/main/java/com/ann/demo/interfaces/config/WebServiceConfig.java
@@ -0,0 +1,46 @@
+package com.ann.demo.interfaces.config;
+
+import com.ann.demo.interfaces.HomepageDictionary;
+import com.ann.demo.interfaces.impl.HomepageDictionaryImpl;
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBus;
+import org.apache.cxf.jaxws.EndpointImpl;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.xml.ws.Endpoint;
+
+/**
+ * @Author: LeiJiaXin
+ * @Date: 2019/6/11 17:13
+ */
+
+@Configuration
+public class WebServiceConfig {
+
+ /*//默认servlet路径/*,如果覆写则按照自己定义的来
+ @Bean
+ public ServletRegistrationBean dispatcherServlet() {
+ return new ServletRegistrationBean(new CXFServlet(), "/services/*");
+ }*/
+
+ @Bean(name = Bus.DEFAULT_BUS_ID)
+ public SpringBus springBus() {
+ return new SpringBus();
+ }
+
+ //把实现类交给spring管理
+ @Bean
+ public HomepageDictionary homepageDictionary() {
+ return new HomepageDictionaryImpl();
+ }
+
+ @Bean
+ public Endpoint endpoint(){
+ System.out.println("-----------------------已发布-------------------------");
+ EndpointImpl endpoint = new EndpointImpl(springBus(),homepageDictionary());
+ endpoint.publish("HomepageDictionary");
+ return endpoint;
+ }
+
+}
diff --git a/src/main/java/com/ann/demo/interfaces/impl/HomepageDictionaryImpl.java b/src/main/java/com/ann/demo/interfaces/impl/HomepageDictionaryImpl.java
new file mode 100644
index 0000000..596024e
--- /dev/null
+++ b/src/main/java/com/ann/demo/interfaces/impl/HomepageDictionaryImpl.java
@@ -0,0 +1,107 @@
+package com.ann.demo.interfaces.impl;
+
+
+import com.ann.demo.entity.filing.ArchiveMaster;
+import com.ann.demo.interfaces.HomepageDictionary;
+import com.ann.demo.service.ArchiveDetailService;
+import com.ann.demo.service.ArchiveMasterService;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+
+import javax.jws.WebService;
+import java.util.*;
+
+/**
+ * @Author: LeiJiaXin
+ * @Date: 2019/6/11 17:01
+ */
+
+@WebService(serviceName = "HomepageDictionary", // 与接口中指定的name一致
+ targetNamespace = "http://interfaces.demo.ann.com/", // 与接口中的命名空间一致,一般是接口的包名倒
+ endpointInterface = "com.ann.demo.interfaces.HomepageDictionary"// 接口地址
+)
+public class HomepageDictionaryImpl implements HomepageDictionary {
+
+ private static final Logger logger = LoggerFactory.getLogger(HomepageDictionaryImpl.class);
+
+ @Autowired
+ private ArchiveDetailService archiveDetailService;
+
+ @Autowired
+ private ArchiveMasterService archiveMasterService;
+
+ public static String mustCheckData;
+
+ @Value("${mustCheckData}")
+ public void setMustCheckData(String mustCheckData) {
+ HomepageDictionaryImpl.mustCheckData = mustCheckData;
+ }
+
+ public static String deathMustCheckData;
+
+ @Value("${deathMustCheckData}")
+ public void setBabyMustCheckData(String deathMustCheckData) {
+ HomepageDictionaryImpl.deathMustCheckData = deathMustCheckData;
+ }
+ @Override
+ public String CheckData(String masterId) {
+ StringBuffer sb = new StringBuffer();
+ try {
+ Optional archiveMaster = archiveMasterService.findById(masterId);
+ if (!archiveMaster.isPresent()) {
+ return "没有该患者信息!";
+ }
+
+ // 必须检查类型
+ sb = new StringBuffer();
+ //判断是否是死亡病例
+ if(StringUtils.isNoneBlank(archiveMaster.get().getDischargeDisposition())){
+ if (archiveMaster.get().getDischargeDisposition().equalsIgnoreCase("5")){
+ if (!deathMustCheckData.equals("")) {
+ String[] mustCheckDataArray = deathMustCheckData.split(",");
+ List types = Arrays.asList(mustCheckDataArray);
+ String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId);
+ if (typeIsExits != null) {
+ sb.append(typeIsExits + "缺失");
+ }
+ }
+ } else {
+ if (!mustCheckData.equals("")) {
+ String[] mustCheckDataArray = mustCheckData.split(",");
+ List types = Arrays.asList(mustCheckDataArray);
+ String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId);
+ if (typeIsExits != null) {
+ sb.append(typeIsExits + "缺失");
+ }
+ }
+ }
+ }else{
+ if (!mustCheckData.equals("")) {
+ String[] mustCheckDataArray = mustCheckData.split(",");
+ List types = Arrays.asList(mustCheckDataArray);
+ String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId);
+ if (typeIsExits != null) {
+ sb.append(typeIsExits + "缺失");
+ }
+ }
+ }
+ //最后
+ if (sb.length() == 0) {
+ sb.append("完整");
+ }
+ } catch (Exception e) {
+ sb.setLength(0);
+ sb.append("服务器正忙");
+ logger.error("出错了:", e);
+ }
+
+ return sb + "";
+ }
+}
+
+
+
+
diff --git a/src/main/java/com/ann/demo/repository/primary/ArchiveDetailRepository.java b/src/main/java/com/ann/demo/repository/primary/ArchiveDetailRepository.java
new file mode 100644
index 0000000..fd3ee6e
--- /dev/null
+++ b/src/main/java/com/ann/demo/repository/primary/ArchiveDetailRepository.java
@@ -0,0 +1,109 @@
+package com.ann.demo.repository.primary;
+
+import com.ann.demo.entity.filing.ArchiveDetail;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author: LeiJiaXin
+ * @Date: 2019/7/12 9:10
+ */
+@Transactional
+@Repository
+public interface ArchiveDetailRepository extends JpaRepository {
+ @Query(value = "SELECT stuff(" +
+ " (SELECT ',' + CONVERT(VARCHAR,a.assort_name) " +
+ " FROM zd_assort a WHERE a.assort_id in ?1 " +
+ " and NOT EXISTS(SELECT id FROM archive_detail d WHERE a.assort_id = d.AssortID and d.MasterID = ?2 ) " +
+ " FOR XML PATH ('') " +
+ " ),1,1,'') ", nativeQuery = true)
+ String getTypeNotExits(List type, String masterId);
+
+ @Query(value = "select * from archive_detail where MasterID = ?1 \n" +
+ " and Source !='电子病历系统采集服务-长临医嘱' and Source !='扫描上传' and Source !='手工上传' and flag =0 and id not in\n" +
+ " (select DID from archive_other_ext where MID = ?1) ",nativeQuery = true)
+ ListgetRepeatRecord(String mid);
+
+
+ @Query(value = " SELECT stuff( " +
+ " ( select ',' +name+'缺失' + cast(COUNT(report_type) as varchar)+'份' from exam_apply e " +
+ " where not exists (select 1 from archive_detail a where source <> '后台' and a.apply_id = e.apply_id and a.assortid in ?1 ) " +
+ " and exists (select 1 from archive_master m " +
+ " where m.inp_no = e.inp_no and m.visit_id = e.visit_id and m.patient_id = e.patient_id and " +
+ " m.ID = ?2 ) " +
+ " and e.report_type in ?1 " +
+ " and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
+ " group by name " +
+ " FOR XML PATH ('') " +
+ " ),1,1,'')", nativeQuery = true)
+ String getCheckReportNotExits( List type,String masterId);
+
+
+
+
+ /**
+ * 备份,如果检查申请单没有名称的,还是按照之前的查
+ * */
+ @Query(value = "SELECT stuff( " +
+ " ( select ',' +z.assort_name+'缺失' + cast(COUNT(report_type) as varchar)+'份' from exam_apply e , zd_assort z" +
+ " where z.assort_id = e.report_type and not exists (select 1 from archive_detail a where source <> '后台' and a.apply_id = e.apply_id and a.assortid in ?1 ) " +
+ " and exists (select 1 from archive_master m " +
+ " where m.inp_no = e.inp_no and m.visit_id = e.visit_id and m.patient_id = e.patient_id and " +
+ " m.ID = ?2 ) " +
+ " and e.report_type in ?1 " +
+ " and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
+ " group by z.assort_name " +
+ " FOR XML PATH ('') " +
+ " ),1,1,'')", nativeQuery = true)
+ String getCheckReportNotExits1( List type,String masterId);
+
+ @Query(value = "select pdf_path from archive_detail where MasterID in ( " +
+ "select id from Archive_Master WHERE name = '刘钰' ) and flag = 0 and AssortID in (9,113,10,54,57,59,52,30) " +
+ "",nativeQuery = true)
+ List haha();
+
+
+ /**
+ * 备份,如果检验申请单没有名称的,还是按照之前的查
+ * */
+// @Query(value = " select '检验报告缺失' +cast( (select isnull((select count(e.apply_id) from exam_apply e " +
+// " where e.report_type in ?1 and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
+// " and exists " +
+// " (select 1 from archive_master m where m.inp_no = e.inp_no and m.visit_id = e.visit_id and m.patient_id = e.patient_id " +
+// " and m.ID = ?2 ) ),0) " +
+// " -" +
+// " isnull((select COUNT(*) from exam_apply e,archive_detail d " +
+// " where source <> '后台' and e.report_type in ?1 and d.AssortID = ?1 and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
+// " and masterid = ?2 " +
+// " and charindex( e.apply_id,d.apply_id ) > 0),0) )as varchar)+'份' ",nativeQuery = true)
+// String getInspectionReportNotExits(List type,String masterId);
+
+
+// @Query(value = " select e.apply_id as applyId,e.name from exam_apply e,archive_detail d " +
+// " where e.report_type in ?1 and d.AssortID in ?1 and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
+// " and masterid = ?2 and d.flag = 0 " +
+// " and charindex( e.apply_id,d.apply_id ) > 0 ",nativeQuery = true)
+// List