英德人医按需采集初始化
commit
4a5d8df44c
@ -0,0 +1,175 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="web" name="Web">
|
||||||
|
<configuration>
|
||||||
|
<webroots />
|
||||||
|
<sourceRoots>
|
||||||
|
<root url="file://$MODULE_DIR$/src/main/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/src/main/resources" />
|
||||||
|
</sourceRoots>
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
<facet type="Spring" name="Spring">
|
||||||
|
<configuration />
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||||
|
<output url="file://$MODULE_DIR$/target/classes" />
|
||||||
|
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/${project.build.directory}/classes" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/${project.build.directory}/test-classes" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-boot-starter:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-oas:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger.core.v3:swagger-annotations:2.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger.core.v3:swagger-models:2.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-core:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.github.classgraph:classgraph:4.8.83" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-webmvc:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-webflux:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: org.mapstruct:mapstruct:1.3.1.Final" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-data-rest:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.20" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.12.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.12.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.12.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-guava:2.10.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.3.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.13.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.13.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.26" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.12.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.12.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.12.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-test:2.3.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.assertj:assertj-core:3.16.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter:5.6.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.junit.platform:junit-platform-commons:1.6.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.3" level="project" />
|
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.junit.vintage:junit-vintage-engine:5.6.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.junit.platform:junit-platform-engine:1.6.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mockito:mockito-core:3.3.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.19" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.19" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.12.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.12.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-test:5.2.12.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: junit:junit:4.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:2.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.microsoft.sqlserver:sqljdbc6:6.4.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.oracle:ojdbc14:14.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.xdb:xdb:1.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http:3.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.4.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.2.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.1.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http-jetty:3.0.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-server:9.4.35.v20201120" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-http:9.4.35.v20201120" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-util:9.4.35.v20201120" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-io:9.4.35.v20201120" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-security:9.4.35.v20201120" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-servlet_3.0_spec:1.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-net:commons-net:1.4.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: oro:oro:2.0.8" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.4" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.17" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-dbutils:commons-dbutils:1.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.mchange:c3p0:0.9.5.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.mchange:mchange-commons-java:0.2.11" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.itextpdf:itextpdf:5.5.13" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.oracle.ojdbc:xmlparserv2:19.3.0.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk16:1.46" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.3.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.13" level="project" />
|
||||||
|
<orderEntry type="library" scope="PROVIDED" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||||
|
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.41" level="project" />
|
||||||
|
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
|
||||||
|
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.41" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.5" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.8.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.12.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.12.RELEASE" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.6" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
@ -0,0 +1,233 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.3.8.RELEASE</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<groupId>com.xjgs</groupId>
|
||||||
|
<artifactId>pacs</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.source>1.7</maven.compiler.source>
|
||||||
|
<maven.compiler.target>1.7</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!--新增-->
|
||||||
|
<!--springboot的swagger3的整合包-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-boot-starter</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-guava</artifactId>
|
||||||
|
<version>2.10.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.microsoft.sqlserver</groupId>
|
||||||
|
<artifactId>sqljdbc6</artifactId>
|
||||||
|
<version>6.4.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle</groupId>
|
||||||
|
<artifactId>ojdbc14</artifactId>
|
||||||
|
<version>14.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xdb</groupId>
|
||||||
|
<artifactId>xdb</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!--WS-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.cxf</groupId>
|
||||||
|
<artifactId>cxf-rt-transports-http</artifactId>
|
||||||
|
<version>3.1.8</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.cxf</groupId>
|
||||||
|
<artifactId>cxf-rt-frontend-jaxws</artifactId>
|
||||||
|
<version>3.1.8</version>
|
||||||
|
</dependency>
|
||||||
|
<!--内置jetty web服务器-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.cxf</groupId>
|
||||||
|
<artifactId>cxf-rt-transports-http-jetty</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-net</groupId>
|
||||||
|
<artifactId>commons-net</artifactId>
|
||||||
|
<version>1.4.1</version>
|
||||||
|
</dependency>
|
||||||
|
<!--日志实现-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
|
<version>1.6.4</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>dom4j</groupId>
|
||||||
|
<artifactId>dom4j</artifactId>
|
||||||
|
<version>1.6.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>5.1.17</version>
|
||||||
|
</dependency>
|
||||||
|
<!--DBUtis-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-dbutils</groupId>
|
||||||
|
<artifactId>commons-dbutils</artifactId>
|
||||||
|
<version>1.6</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mchange</groupId>
|
||||||
|
<artifactId>c3p0</artifactId>
|
||||||
|
<version>0.9.5.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>log4j</groupId>
|
||||||
|
<artifactId>log4j</artifactId>
|
||||||
|
<version>1.2.17</version>
|
||||||
|
</dependency>
|
||||||
|
<!--itext-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.itextpdf</groupId>
|
||||||
|
<artifactId>itextpdf</artifactId>
|
||||||
|
<version>5.5.13</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.ojdbc</groupId>
|
||||||
|
<artifactId>xmlparserv2</artifactId>
|
||||||
|
<version>19.3.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- 导入DES对称加密包 -->
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk16 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk16</artifactId>
|
||||||
|
<version>1.46</version>
|
||||||
|
</dependency>
|
||||||
|
<!--commons-lang3-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>3.3.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
<version>1.13</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-extension</artifactId>
|
||||||
|
<version>3.4.2</version>
|
||||||
|
</dependency>
|
||||||
|
<!--mybatis-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>3.4.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-annotation</artifactId>
|
||||||
|
<version>3.4.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-core</artifactId>
|
||||||
|
<version>3.4.2</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
|
||||||
|
<!--此处新增-->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>2.3.8.RELEASE</version>
|
||||||
|
<configuration>
|
||||||
|
<mainClass>com.xjgs.Applicaltion</mainClass>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<!--可以把依赖的包都打包到生成的Jar包中-->
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>8</source>
|
||||||
|
<target>8</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**/*.xml</include>
|
||||||
|
<include>**/*.properties</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
|
||||||
|
<!--此处为新增-->
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**/*.*</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -0,0 +1,34 @@
|
|||||||
|
//package com.xjgs;
|
||||||
|
//
|
||||||
|
//import com.xjgs.service.PacsService;
|
||||||
|
//import com.xjgs.service.RadiateService;
|
||||||
|
//
|
||||||
|
//import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||||
|
//import java.util.concurrent.TimeUnit;
|
||||||
|
//
|
||||||
|
//public class Application3 {
|
||||||
|
// static ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = null;
|
||||||
|
// public static void main(String[] args) {
|
||||||
|
// final PacsService pacsService = new PacsService ();
|
||||||
|
// final RadiateService radiateService = new RadiateService ();
|
||||||
|
// scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(5);
|
||||||
|
// scheduledThreadPoolExecutor.scheduleWithFixedDelay(new Runnable() {
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// pacsService.uploadRadiation ();
|
||||||
|
// }
|
||||||
|
// },0,5, TimeUnit.MINUTES);
|
||||||
|
// scheduledThreadPoolExecutor.scheduleWithFixedDelay(new Runnable() {
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// pacsService.fanshe ();
|
||||||
|
// }
|
||||||
|
// },2,5, TimeUnit.MINUTES);
|
||||||
|
// scheduledThreadPoolExecutor.scheduleWithFixedDelay(new Runnable() {
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// radiateService.fangsheInfo ();
|
||||||
|
// }
|
||||||
|
// },4,5, TimeUnit.MINUTES);
|
||||||
|
// }
|
||||||
|
//}
|
@ -0,0 +1,109 @@
|
|||||||
|
package com.xjgs.controller;
|
||||||
|
|
||||||
|
import com.xjgs.pacsDao.PacsMapper;
|
||||||
|
import com.xjgs.recordDao.ArchiveDetailMapper;
|
||||||
|
import com.xjgs.exception.BusinessException;
|
||||||
|
import com.xjgs.exception.ExceptionCode;
|
||||||
|
import com.xjgs.service.MakeUpPacsService;
|
||||||
|
import com.xjgs.service.PacsService;
|
||||||
|
import com.xjgs.util.JsonResult;
|
||||||
|
import com.xjgs.util.StringUtil;
|
||||||
|
import com.xjgs.vo.ArchiveMaster;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: pacs
|
||||||
|
* @BelongsPackage: com.xjgs.controller
|
||||||
|
* @Author: ChenJ
|
||||||
|
* @CreateTime: 2022-05-11 17:00
|
||||||
|
*/
|
||||||
|
@Api("补偿采集的相关接口")
|
||||||
|
@Controller
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/makeUp")
|
||||||
|
public class MakeUpPacs {
|
||||||
|
@Autowired
|
||||||
|
ArchiveDetailMapper archiveDetailMapper;
|
||||||
|
@Autowired
|
||||||
|
PacsMapper pacsMapper;
|
||||||
|
@Autowired
|
||||||
|
MakeUpPacsService makeUpPacsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 根据记账号补偿采集
|
||||||
|
* @author: ChenJ
|
||||||
|
* @date: 2022/5/11 17:24
|
||||||
|
* @param:
|
||||||
|
* @param patient 患者记账号
|
||||||
|
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||||
|
**/
|
||||||
|
// @ApiOperation("按需采集")
|
||||||
|
// @GetMapping("/makeUpByPacs")
|
||||||
|
// public Map<String, Object> makeUpByNeed(String patient) throws BusinessException {
|
||||||
|
//
|
||||||
|
// // 先对参数进行校验,如果为空则抛出异常
|
||||||
|
// if (StringUtil.isEmpty(patient)){
|
||||||
|
// throw new BusinessException(ExceptionCode.WRONG_PARAMS);
|
||||||
|
// }
|
||||||
|
// // 声明Pacs操作类
|
||||||
|
// PacsService pacsService = new PacsService();
|
||||||
|
// // 调用采集
|
||||||
|
// pacsService.fanshe(patient);
|
||||||
|
// pacsService.uploadRadiation(patient);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// // 声明返回
|
||||||
|
// JsonResult jsonResult = new JsonResult();
|
||||||
|
// jsonResult.setCode("200");
|
||||||
|
// jsonResult.setMsg("调用成功,请稍等下载文件");
|
||||||
|
// return jsonResult.getDataMap();
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 根据出院时间按需采集
|
||||||
|
* @params: startTime
|
||||||
|
* @params: endTime
|
||||||
|
* @author linjj
|
||||||
|
* @date: 2023/7/25 14:34
|
||||||
|
*/
|
||||||
|
@ApiOperation("按需采集")
|
||||||
|
@GetMapping("/makeUpByPacsAndTime")
|
||||||
|
public Map<String, Object> makeUpByNeed(String startTime,String endTime) throws BusinessException {
|
||||||
|
//返回类
|
||||||
|
JsonResult jsonResult = new JsonResult();
|
||||||
|
// 先对参数进行校验,如果为空则抛出异常
|
||||||
|
if (StringUtil.isEmpty(startTime)){
|
||||||
|
throw new BusinessException(ExceptionCode.WRONG_PARAMS);
|
||||||
|
}
|
||||||
|
// 先对参数进行校验,如果为空则抛出异常
|
||||||
|
if (StringUtil.isEmpty(endTime)){
|
||||||
|
throw new BusinessException(ExceptionCode.WRONG_PARAMS);
|
||||||
|
}
|
||||||
|
//查询时间段内需要按需采集病历信息
|
||||||
|
List<ArchiveMaster> archiveMasterList = archiveDetailMapper.getArchiveMasterList(startTime, endTime);
|
||||||
|
if (archiveMasterList.size()==0){
|
||||||
|
jsonResult.setCode("100");
|
||||||
|
jsonResult.setMsg("该时间段内无采集病历");
|
||||||
|
return jsonResult.getDataMap();
|
||||||
|
}
|
||||||
|
//循环执行
|
||||||
|
for (ArchiveMaster list:archiveMasterList){
|
||||||
|
makeUpPacsService.getPacsPathList(list);
|
||||||
|
}
|
||||||
|
// 声明返回
|
||||||
|
jsonResult.setCode("200");
|
||||||
|
jsonResult.setMsg("调用成功,请稍等下载文件");
|
||||||
|
return jsonResult.getDataMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.xjgs.dao;
|
||||||
|
|
||||||
|
import com.mchange.v2.c3p0.C3P0ProxyConnection;
|
||||||
|
import com.mchange.v2.c3p0.ComboPooledDataSource;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
|
||||||
|
public class JDBCUtils {
|
||||||
|
//创建数据库连接池对象
|
||||||
|
private static ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource("his");
|
||||||
|
|
||||||
|
//获取连接的方法
|
||||||
|
public static Connection getConnection() throws SQLException {
|
||||||
|
return comboPooledDataSource.getConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
//提供数据库连接池对象的方法
|
||||||
|
public static DataSource getDataSource(){
|
||||||
|
return comboPooledDataSource;
|
||||||
|
}
|
||||||
|
//释放资源的方法
|
||||||
|
public static void release(ResultSet rs, Statement stmt, Connection conn) {
|
||||||
|
|
||||||
|
if (rs != null) {
|
||||||
|
try {
|
||||||
|
rs.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
rs = null;
|
||||||
|
}
|
||||||
|
release(stmt, conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void release(Statement stmt, Connection conn) {
|
||||||
|
if (stmt != null) {
|
||||||
|
try {
|
||||||
|
stmt.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
stmt = null;
|
||||||
|
}
|
||||||
|
if (conn != null) {
|
||||||
|
try {
|
||||||
|
conn.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
conn = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static Connection getRawConnection(Connection conn) {
|
||||||
|
C3P0ProxyConnection cpCon = (C3P0ProxyConnection) conn;
|
||||||
|
Connection unwrappedCon = null;
|
||||||
|
try {
|
||||||
|
Method rawConnectionMethod = JDBCUtils.class.getMethod("getRawConnection", new Class[]{Connection.class});
|
||||||
|
unwrappedCon = (Connection) cpCon.rawConnectionOperation(rawConnectionMethod, null, new Object[]{C3P0ProxyConnection.RAW_CONNECTION});
|
||||||
|
} catch (Exception ex) {
|
||||||
|
//do something }
|
||||||
|
}
|
||||||
|
return conn;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package com.xjgs.dao;
|
||||||
|
|
||||||
|
import com.mchange.v2.c3p0.ComboPooledDataSource;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
|
||||||
|
public class JDBCUtils3 {
|
||||||
|
//创建数据库连接池对象
|
||||||
|
private static ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource("sql");
|
||||||
|
|
||||||
|
//获取连接的方法
|
||||||
|
public static Connection getConnection() throws SQLException {
|
||||||
|
return comboPooledDataSource.getConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
//提供数据库连接池对象的方法
|
||||||
|
public static DataSource getDataSource(){
|
||||||
|
return comboPooledDataSource;
|
||||||
|
}
|
||||||
|
//释放资源的方法
|
||||||
|
public static void release(ResultSet rs, Statement stmt, Connection conn) {
|
||||||
|
|
||||||
|
if (rs != null) {
|
||||||
|
try {
|
||||||
|
rs.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
rs = null;
|
||||||
|
}
|
||||||
|
release(stmt, conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void release(Statement stmt, Connection conn) {
|
||||||
|
if (stmt != null) {
|
||||||
|
try {
|
||||||
|
stmt.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
stmt = null;
|
||||||
|
}
|
||||||
|
if (conn != null) {
|
||||||
|
try {
|
||||||
|
conn.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
conn = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package com.xjgs.dao;
|
||||||
|
|
||||||
|
import com.mchange.v2.c3p0.ComboPooledDataSource;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
|
||||||
|
public class JDBCUtils4 {
|
||||||
|
//创建数据库连接池对象
|
||||||
|
private static ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource("chaosheng");
|
||||||
|
|
||||||
|
//获取连接的方法
|
||||||
|
public static Connection getConnection() throws SQLException {
|
||||||
|
return comboPooledDataSource.getConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
//提供数据库连接池对象的方法
|
||||||
|
public static DataSource getDataSource(){
|
||||||
|
return comboPooledDataSource;
|
||||||
|
}
|
||||||
|
//释放资源的方法
|
||||||
|
public static void release(ResultSet rs, Statement stmt, Connection conn) {
|
||||||
|
|
||||||
|
if (rs != null) {
|
||||||
|
try {
|
||||||
|
rs.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
rs = null;
|
||||||
|
}
|
||||||
|
release(stmt, conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void release(Statement stmt, Connection conn) {
|
||||||
|
if (stmt != null) {
|
||||||
|
try {
|
||||||
|
stmt.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
stmt = null;
|
||||||
|
}
|
||||||
|
if (conn != null) {
|
||||||
|
try {
|
||||||
|
conn.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
conn = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package com.xjgs.dao;
|
||||||
|
|
||||||
|
import com.mchange.v2.c3p0.ComboPooledDataSource;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
|
||||||
|
public class JDBCUtils5 {
|
||||||
|
//创建数据库连接池对象
|
||||||
|
private static ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource("mysql");
|
||||||
|
|
||||||
|
//获取连接的方法
|
||||||
|
public static Connection getConnection() throws SQLException {
|
||||||
|
return comboPooledDataSource.getConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
//提供数据库连接池对象的方法
|
||||||
|
public static DataSource getDataSource(){
|
||||||
|
return comboPooledDataSource;
|
||||||
|
}
|
||||||
|
//释放资源的方法
|
||||||
|
public static void release(ResultSet rs, Statement stmt, Connection conn) {
|
||||||
|
|
||||||
|
if (rs != null) {
|
||||||
|
try {
|
||||||
|
rs.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
rs = null;
|
||||||
|
}
|
||||||
|
release(stmt, conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void release(Statement stmt, Connection conn) {
|
||||||
|
if (stmt != null) {
|
||||||
|
try {
|
||||||
|
stmt.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
stmt = null;
|
||||||
|
}
|
||||||
|
if (conn != null) {
|
||||||
|
try {
|
||||||
|
conn.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
conn = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.xjgs.exception;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 自定义的异常类
|
||||||
|
* @author: ChenJ
|
||||||
|
* @date: 2022/5/9 17:29
|
||||||
|
* @param:
|
||||||
|
* @return:
|
||||||
|
**/
|
||||||
|
public class BusinessException extends Exception {
|
||||||
|
/**
|
||||||
|
* 枚举类型,内含状态码code和信息msg
|
||||||
|
*/
|
||||||
|
private final ExceptionCode exceptionCode;
|
||||||
|
|
||||||
|
public ExceptionCode getExceptionCode() {
|
||||||
|
return exceptionCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BusinessException(ExceptionCode exceptionCode) {
|
||||||
|
super(exceptionCode.getMessage());
|
||||||
|
this.exceptionCode = exceptionCode;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.xjgs.pacsDao;
|
||||||
|
|
||||||
|
import com.xjgs.vo.ArchiveMaster;
|
||||||
|
import com.xjgs.vo.PacsVo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @InterfaceName commomtableMapper
|
||||||
|
* @Description
|
||||||
|
* @Author linjj
|
||||||
|
* @Date 2023/8/2 17:49
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface PacsMapper {
|
||||||
|
/**
|
||||||
|
* @description: 查询pacs路径集合
|
||||||
|
* @params: ArchiveMaster
|
||||||
|
* @return: PacsVo
|
||||||
|
* @author linjj
|
||||||
|
* @date: 2023/8/3 11:08
|
||||||
|
*/
|
||||||
|
List<PacsVo> getPacsPathList(ArchiveMaster archiveMaster);
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.xjgs.recordDao;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.xjgs.vo.ArchiveMaster;
|
||||||
|
import com.xjgs.vo.Archive_Detail;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ArchiveDetailMapper {
|
||||||
|
|
||||||
|
List<ArchiveMaster>getArchiveMasterList(@Param(value = "startTime") String startTime, @Param(value = "endTime") String endTime);
|
||||||
|
|
||||||
|
List<Archive_Detail>pacsGetPatId();
|
||||||
|
|
||||||
|
List<ArchiveMaster> getIdAndJzh(@Param(value = "ids")String ids);
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.xjgs.service;
|
||||||
|
|
||||||
|
import com.xjgs.vo.ArchiveMaster;
|
||||||
|
import com.xjgs.vo.PacsVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @InterfaceName MakeUpPacsService
|
||||||
|
* @Description 按需采集pacs接口
|
||||||
|
* @Author linjj
|
||||||
|
* @Date 2023/8/3 11:06
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public interface MakeUpPacsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 查询pacs路径集合
|
||||||
|
* @params: ArchiveMaster
|
||||||
|
* @return: PacsVo
|
||||||
|
* @author linjj
|
||||||
|
* @date: 2023/8/3 11:08
|
||||||
|
*/
|
||||||
|
void getPacsPathList(ArchiveMaster archiveMaster);
|
||||||
|
}
|
@ -0,0 +1,724 @@
|
|||||||
|
package com.xjgs.service;
|
||||||
|
|
||||||
|
import com.xjgs.dao.JDBCUtils;
|
||||||
|
import com.xjgs.dao.JDBCUtils3;
|
||||||
|
import com.xjgs.dao.JDBCUtils4;
|
||||||
|
import com.xjgs.dao.JDBCUtils5;
|
||||||
|
import com.xjgs.pacsDao.PacsMapper;
|
||||||
|
import com.xjgs.recordDao.ArchiveDetailMapper;
|
||||||
|
import com.xjgs.util.FileUtil;
|
||||||
|
import com.xjgs.util.FtpUtil;
|
||||||
|
import com.xjgs.util.Logger;
|
||||||
|
import com.xjgs.vo.*;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.dom4j.Document;
|
||||||
|
import org.dom4j.DocumentException;
|
||||||
|
import org.dom4j.Element;
|
||||||
|
import org.dom4j.io.SAXReader;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName MakeUpPacsServiceImpl
|
||||||
|
* @Description pacs按需采集实现类
|
||||||
|
* @Author linjj
|
||||||
|
* @Date 2023/8/3 11:06
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MakeUpPacsServiceImpl implements MakeUpPacsService {
|
||||||
|
private static Logger logger = new Logger();
|
||||||
|
@Autowired
|
||||||
|
PacsMapper pacsMapper;
|
||||||
|
@Autowired
|
||||||
|
ArchiveDetailMapper archiveDetailMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getPacsPathList(ArchiveMaster archiveMaster) {
|
||||||
|
//病案主件id
|
||||||
|
String ids = archiveMaster.getId();
|
||||||
|
//根据入院前六小时出院后六小时住院号查询要下载pdf的路径
|
||||||
|
List<PacsVo> pacsPathList = pacsMapper.getPacsPathList(archiveMaster);
|
||||||
|
|
||||||
|
//判断文件表中是否存在
|
||||||
|
List<Archive_Detail> archiveDetails = archiveDetailMapper.pacsGetPatId();
|
||||||
|
//判断是否需要采集
|
||||||
|
if (!pacsPathList.isEmpty()) {
|
||||||
|
for (PacsVo list : pacsPathList) {
|
||||||
|
boolean flag = true;
|
||||||
|
for (Archive_Detail archive_detail : archiveDetails) {
|
||||||
|
if (archive_detail.getSubAssort().equals(list.getSOURCEID() + "_" + list.getACCESSIONNUMBER())) {
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//不存在执行
|
||||||
|
if (flag) {
|
||||||
|
loadDcmToPdf(list, ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void loadDcmToPdf(PacsVo pacsVo, String ids) {
|
||||||
|
String temp = System.getProperty("user.dir") + "\\temp";
|
||||||
|
File fs = new File(temp);
|
||||||
|
if (!fs.isDirectory()) {
|
||||||
|
fs.mkdirs();
|
||||||
|
}
|
||||||
|
UUID uuid = UUID.randomUUID();//UUID唯一识别
|
||||||
|
String id = uuid.toString();
|
||||||
|
id = id.replace("-", "");
|
||||||
|
FtpUtil ftpUtil = new FtpUtil();
|
||||||
|
File file = new File(temp + "\\" + id + ".pdf");
|
||||||
|
File file3 = new File(temp + "\\" + id + ".dcm");
|
||||||
|
System.out.println("temp" + temp);
|
||||||
|
ftpUtil.downloadFile(pacsVo.getDCMFile(), pacsVo.getDCMName(), temp, id + ".dcm");
|
||||||
|
File fd = new File(temp + "\\" + id + ".dcm");
|
||||||
|
boolean b = fd.exists();
|
||||||
|
try {
|
||||||
|
if (b) {
|
||||||
|
//DCM转pdf工具
|
||||||
|
DCM2PDF(temp + "\\" + id + ".dcm", temp + "\\" + id + ".pdf");
|
||||||
|
if (file.exists()) {
|
||||||
|
Archive_Detail archiveDetail = new Archive_Detail();
|
||||||
|
// ArchiveMaster archiveMaster = pacsGetHisId(pacsVo.getSOURCEID());
|
||||||
|
// ArchiveMaster archiveMaster1 = null;
|
||||||
|
// if (StringUtils.isNoneBlank(archiveMaster.getPatientId())) {
|
||||||
|
// System.out.println("112");
|
||||||
|
// archiveMaster1 = getMasterIdByPa(archiveMaster.getPatientId());
|
||||||
|
// if (StringUtils.isNoneBlank(archiveMaster1.getId())) {
|
||||||
|
// System.out.println("113");
|
||||||
|
// archiveMaster.setId(archiveMaster1.getId());
|
||||||
|
// } else {
|
||||||
|
// uploadHomePageByPid(archiveMaster.getPatientId());
|
||||||
|
// ArchiveMaster id1 = getMasterIdByPa(archiveMaster.getPatientId());
|
||||||
|
// archiveMaster.setId(id1.getId());
|
||||||
|
// System.out.println("114");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
List<ArchiveMaster> list = archiveDetailMapper.getIdAndJzh(ids);
|
||||||
|
if (list.size()==0){
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
ArchiveMaster archiveMaster = list.get(0);
|
||||||
|
archiveDetail.setMasterId(ids);
|
||||||
|
archiveDetail.setUploadDateTime(new Date());
|
||||||
|
archiveDetail.setAssortId("EABEEB5D628449A7930F4C0A9953A754");
|
||||||
|
archiveDetail.setSource("pacs");
|
||||||
|
archiveDetail.setFlag("0");
|
||||||
|
archiveDetail.setTitle(pacsVo.getREQUESTEDPROCEDUREDESCRIPTION().replaceAll("\\s*", ""));
|
||||||
|
archiveDetail.setSubAssort(pacsVo.getSOURCEID() + "_" + pacsVo.getACCESSIONNUMBER());
|
||||||
|
archiveDetail.setPdfPath(getXmlPath("path") + "\\pacs\\" + archiveMaster.getPatientId() + "\\" + id + ".pdf");
|
||||||
|
File file2 = new File(getXmlPath("path") + "\\pacs\\" + archiveMaster.getPatientId());
|
||||||
|
if (!file2.isDirectory()) {
|
||||||
|
file2.mkdirs();
|
||||||
|
}
|
||||||
|
FileUtils.copyFile(file, new File(archiveDetail.getPdfPath()));
|
||||||
|
File file1 = new File(archiveDetail.getPdfPath());
|
||||||
|
logger.log("4");
|
||||||
|
if (file1.exists() && FileUtil.checkFileWritingOn(file1.getAbsolutePath())) {
|
||||||
|
logger.log("5");
|
||||||
|
writeArchiveDetail(archiveDetail);
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String format = sdf.format(new Date());
|
||||||
|
logger.log("dcm转化成功,同步时间:" + format);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fanshe(pacsVo.getPATIENTID());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
file.delete();
|
||||||
|
file3.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//增加病例文件信息表记录
|
||||||
|
public int writeArchiveDetail(Archive_Detail archiveDetail) {
|
||||||
|
String sql = "insert into archive_detail(id,PDF_PATH,MasterID,UpLoadDateTime,AssortID,Source,SubAssort,Title,flag)values(replace(newid(), '-', '')," +
|
||||||
|
"?,?,?,?,?,?,?,?)";
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
Object[] parms = new Object[]{archiveDetail.getPdfPath(), archiveDetail.getMasterId(), archiveDetail.getUploadDateTime(), archiveDetail.getAssortId(), archiveDetail.getSource(), archiveDetail.getSubAssort(), archiveDetail.getTitle(), archiveDetail.getFlag()};
|
||||||
|
int j = 0;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j = statement.executeUpdate();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
JDBCUtils.release(null, statement, connection);
|
||||||
|
}
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DCM2PDF(String dcmFile, String toPDFFile) throws Exception {
|
||||||
|
File oFile = null;
|
||||||
|
byte b1 = 37;
|
||||||
|
byte b2 = 80;
|
||||||
|
byte b3 = 68;
|
||||||
|
byte b4 = 70;
|
||||||
|
FileInputStream inputStream = null;
|
||||||
|
String pdfFile = toPDFFile;
|
||||||
|
File tFile = null;
|
||||||
|
FileOutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
oFile = new File(dcmFile);
|
||||||
|
|
||||||
|
if (!(oFile.isFile() && oFile.exists())) {
|
||||||
|
throw new Exception("DCM 文件读取失败=>" + dcmFile);
|
||||||
|
}
|
||||||
|
inputStream = new FileInputStream(oFile);
|
||||||
|
byte[] bs = new byte[(int) oFile.length()];
|
||||||
|
inputStream.read(bs, 0, bs.length);
|
||||||
|
int seekPos = -1;
|
||||||
|
for (int i = 0; i < bs.length; i++) {
|
||||||
|
byte B1 = bs[i];
|
||||||
|
byte B2 = 0;
|
||||||
|
byte B3 = 0;
|
||||||
|
byte B4 = 0;
|
||||||
|
if (i + 1 < bs.length) {
|
||||||
|
B2 = (byte) bs[i + 1];
|
||||||
|
}
|
||||||
|
if (i + 2 < bs.length) {
|
||||||
|
B3 = (byte) bs[i + 2];
|
||||||
|
}
|
||||||
|
if (i + 3 < bs.length) {
|
||||||
|
B4 = (byte) bs[i + 3];
|
||||||
|
}
|
||||||
|
if (b1 == B1 && b2 == B2 && B3 == b3 && b4 == B4) {
|
||||||
|
seekPos = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (seekPos == -1) {
|
||||||
|
System.out.println("未发现2550 4446");
|
||||||
|
throw new Exception("DCM 未读取到标志位=>" + dcmFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
tFile = new File(pdfFile);
|
||||||
|
if (tFile.isFile() && tFile.exists()) {
|
||||||
|
throw new Exception("目标文件已经存在=>" + pdfFile);
|
||||||
|
}
|
||||||
|
outputStream = new FileOutputStream(tFile, true);
|
||||||
|
for (int i = seekPos; i < bs.length; i++) {
|
||||||
|
outputStream.write(bs[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
System.out.println("读写出错" + ex.getMessage());
|
||||||
|
throw ex;
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (inputStream != null) {
|
||||||
|
inputStream.close();
|
||||||
|
|
||||||
|
}
|
||||||
|
if (outputStream != null) {
|
||||||
|
outputStream.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ArchiveMaster pacsGetHisId(String sourceId) {
|
||||||
|
String sql = "select fvisit_id,fappnote_no from mp.smp_pacs_appnote where fappnote_no = ?";
|
||||||
|
Object[] parms = new Object[]{sourceId};
|
||||||
|
ArchiveMaster archiveMaster = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement preparedStatement = null;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils.getConnection();
|
||||||
|
preparedStatement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
preparedStatement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = preparedStatement.executeQuery();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
archiveMaster = new ArchiveMaster();
|
||||||
|
archiveMaster.setPatientId(resultSet.getString("fvisit_id"));
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
JDBCUtils.release(resultSet, preparedStatement, connection);
|
||||||
|
}
|
||||||
|
return archiveMaster == null ? new ArchiveMaster() : archiveMaster;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ArchiveMaster getMasterIdByPa(String jzh) {
|
||||||
|
String sql = "select ID,patient_id from archive_master where patient_id = ?";
|
||||||
|
Object[] parms = new Object[]{jzh};
|
||||||
|
ArchiveMaster archiveMaster = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
archiveMaster = new ArchiveMaster();
|
||||||
|
archiveMaster.setId(resultSet.getString("ID"));
|
||||||
|
archiveMaster.setPatientId(resultSet.getString("patient_id"));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
JDBCUtils.release(resultSet, statement, connection);
|
||||||
|
}
|
||||||
|
return archiveMaster == null ? new ArchiveMaster() : archiveMaster;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void uploadHomePageByPid(String patientId) {
|
||||||
|
String sql = "select t.zyh as 住院号,t.jzh as 记账号,t.zycs as 住院次数,t.xm as 姓名,t.xb as 性别,t.ryrq as 入院日期,t.cyrq as 出院日期,t.sfzh as 身份证号,t.rybq as 入院科室,t.dqbq as 出院科室,t.rycw as 入院床位,hp.fdrname as 主管医生 " +
|
||||||
|
"from ndns.zl t left join hthis.p_doctor hp on t.dqys = hp.fdrid where t.jzh = ? order by t.jzh desc";
|
||||||
|
ArchiveMaster master = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
Object[] parms = new Object[]{patientId};
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
master = new ArchiveMaster();
|
||||||
|
master.setInpNo(resultSet.getString("住院号").trim());
|
||||||
|
master.setPatientId(resultSet.getString("记账号").trim());
|
||||||
|
master.setVisitId(resultSet.getString("住院次数"));
|
||||||
|
master.setName(resultSet.getString("姓名"));
|
||||||
|
master.setSex(resultSet.getString("性别"));
|
||||||
|
master.setAdmissionDateTime(resultSet.getString("入院日期"));
|
||||||
|
master.setDischargeDateTime(resultSet.getString("出院日期"));
|
||||||
|
master.setIdNo(resultSet.getString("身份证号"));
|
||||||
|
master.setDeptAdmissionTo(resultSet.getString("入院科室"));
|
||||||
|
master.setDeptName(resultSet.getString("出院科室"));
|
||||||
|
master.setDoctorInCharge(resultSet.getString("主管医生"));
|
||||||
|
master.setBedId(resultSet.getString("入院床位"));
|
||||||
|
if (null == master.getDischargeDateTime() || master.getDischargeDateTime().isEmpty()) {
|
||||||
|
master.setStatus("在院");
|
||||||
|
} else {
|
||||||
|
master.setStatus("归档中");
|
||||||
|
}
|
||||||
|
if ("2".equals(master.getSex())) {
|
||||||
|
master.setSex("女");
|
||||||
|
} else {
|
||||||
|
master.setSex("男");
|
||||||
|
}
|
||||||
|
writeHomeEntity(master);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
JDBCUtils.release(resultSet, statement, connection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//新增首页数据
|
||||||
|
int writeHomeEntity(ArchiveMaster archiveMaster) {
|
||||||
|
String sql = "insert into archive_master(id,patient_id,inp_no,visit_id,name,sex,dept_name,discharge_date_time," +
|
||||||
|
"archivestate,admission_date_time,dept_admission_to,doctor_in_charge,id_no,bed_id)values(replace(newid(), '-', ''),?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||||
|
Object[] parms = new Object[]{archiveMaster.getPatientId(), archiveMaster.getInpNo(), archiveMaster.getVisitId(), archiveMaster.getName(), archiveMaster.getSex(), archiveMaster.getDeptName(), archiveMaster.getDischargeDateTime(), archiveMaster.getStatus(), archiveMaster.getAdmissionDateTime(), archiveMaster.getDeptAdmissionTo(), archiveMaster.getDoctorInCharge(), archiveMaster.getIdNo(), archiveMaster.getBedId()};
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
int j = 0;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j = statement.executeUpdate();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
JDBCUtils.release(null, statement, connection);
|
||||||
|
}
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getXmlPath(String elementName) {
|
||||||
|
Document doc = null;
|
||||||
|
try {
|
||||||
|
doc = new SAXReader().read(this.getClass().getResourceAsStream("/localPath.xml"));
|
||||||
|
} catch (DocumentException e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}
|
||||||
|
Element root = doc.getRootElement();
|
||||||
|
Iterator itr = root.elementIterator();
|
||||||
|
while (itr.hasNext()) {
|
||||||
|
Element element = (Element) itr.next();
|
||||||
|
if (elementName.equals(element.getName())) {
|
||||||
|
return element.getTextTrim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fanshe(String patient_id) {
|
||||||
|
String temp = System.getProperty("user.dir") + "\\temp";
|
||||||
|
File fs = new File(temp);
|
||||||
|
if (!fs.isDirectory()) {
|
||||||
|
fs.mkdirs();
|
||||||
|
}
|
||||||
|
String loccalPath = getXmlPath("path");
|
||||||
|
ItextPdfImpl itextPdf = new ItextPdfImpl();
|
||||||
|
List<Fangshe> fangsheList = getFangshe(patient_id);
|
||||||
|
List<Archive_Detail> archive_details = getAssortIdBySource("pacs");
|
||||||
|
Archive_Detail archiveDetail = null;
|
||||||
|
for (Fangshe fangshe : fangsheList) {
|
||||||
|
boolean flag = true;
|
||||||
|
for (Archive_Detail archive_detail : archive_details) {
|
||||||
|
if (archive_detail.getSubAssort().equals(fangshe.getSource_id() + "_" + fangshe.getACCESSIONNUMBER())) {
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
String picPath = getPicPath(fangshe);
|
||||||
|
String picPath1 = getPicPath1(fangshe);
|
||||||
|
UUID uuid = UUID.randomUUID();//UUID唯一识别
|
||||||
|
String id = uuid.toString();
|
||||||
|
id = id.replace("-", "");
|
||||||
|
archiveDetail = new Archive_Detail();
|
||||||
|
archiveDetail.setAssortId("EABEEB5D628449A7930F4C0A9953A754");
|
||||||
|
archiveDetail.setSubAssort(fangshe.getSource_id() + "_" + fangshe.getACCESSIONNUMBER());
|
||||||
|
archiveDetail.setUploadDateTime(new Date());
|
||||||
|
archiveDetail.setSource("pacs");
|
||||||
|
archiveDetail.setFlag("0");
|
||||||
|
archiveDetail.setTitle(fangshe.getREQUESTEDPROCEDUREDESCRIPTION().replaceAll("\\s*", ""));
|
||||||
|
try {
|
||||||
|
ArchiveMaster archiveMaster = pacsGetHisId(fangshe.getSource_id());
|
||||||
|
if (StringUtils.isNoneBlank(archiveMaster.getPatientId())) {
|
||||||
|
ArchiveMaster archiveMaster1 = getMasterIdByPa(archiveMaster.getPatientId());
|
||||||
|
if (StringUtils.isNoneBlank(archiveMaster1.getId())) {
|
||||||
|
archiveMaster.setId(archiveMaster1.getId());
|
||||||
|
} else {
|
||||||
|
uploadHomePageByPid(archiveMaster.getPatientId());
|
||||||
|
ArchiveMaster id1 = getMasterIdByPa(archiveMaster.getPatientId());
|
||||||
|
archiveMaster.setId(id1.getId());
|
||||||
|
}
|
||||||
|
File file = new File(loccalPath + "\\pacs\\" + archiveMaster.getPatientId());
|
||||||
|
if (!file.isDirectory()) {
|
||||||
|
file.mkdirs();
|
||||||
|
}
|
||||||
|
boolean b = itextPdf.writePdf(fangshe, temp + "\\" + id + ".pdf", picPath, picPath1, fangshe.getProf());
|
||||||
|
if (b && FileUtil.checkFileWritingOn(temp + "\\" + id + ".pdf")) {
|
||||||
|
FileUtils.copyFile(new File(temp + "\\" + id + ".pdf"), new File(loccalPath + "\\pacs\\" + archiveMaster.getPatientId() + "\\" + id + ".pdf"));
|
||||||
|
archiveDetail.setPdfPath(loccalPath + "\\pacs\\" + archiveMaster.getPatientId() + "\\" + id + ".pdf");
|
||||||
|
archiveDetail.setMasterId(archiveMaster.getId());
|
||||||
|
File file1 = new File(archiveDetail.getPdfPath());
|
||||||
|
if (file1.exists() && FileUtil.checkFileWritingOn(file1.getAbsolutePath())) {
|
||||||
|
writeArchiveDetail(archiveDetail);
|
||||||
|
logger.log("模板打出报告>>>>>单号:" + patient_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
File file2 = new File(temp + "\\" + id + ".pdf");
|
||||||
|
if (file2.exists()) {
|
||||||
|
file2.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Fangshe> getFangshe(String patient_id) {
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
String sql = "select ACCESSIONNUMBER,PROF,source_id,FIRSTNAME AS 姓名,PATIENTSEX AS 性别,PATIENTAGE AS 年龄,PATIENT_ID AS 检查号,\n" +
|
||||||
|
"REQUESTINGDEPARTMENT AS 申请科室,BEDID AS 床号,INPATIENT_ID AS 住院号,CLINICAL_ID AS 门诊号,\n" +
|
||||||
|
"REQUESTEDPROCEDUREDESCRIPTION AS 检查部位,EXAMINEDESCRIPTION AS 检查所见,DIAGNOSISPROMPT AS \n" +
|
||||||
|
"诊断提示,CONVERT(varchar, DATEPART(yy,EXAMINEDATE))+'年'+CONVERT(varchar, DATEPART(mm,EXAMINEDATE))+'月'+\n" +
|
||||||
|
"CONVERT(varchar, DATEPART(DD,EXAMINEDATE))+'日'AS 检查日期,CONVERT(varchar, DATEPART(yy,REPORTDATE))+'年'+\n" +
|
||||||
|
"CONVERT(varchar, DATEPART(mm,REPORTDATE))+'月'+CONVERT(varchar, DATEPART(DD,REPORTDATE))+'日' AS 报告日期,\n" +
|
||||||
|
"REPORTDOCTOR AS 报告医生,CONVERT(varchar, DATEPART(yy,AUDITINGDATE))+'年'+CONVERT(varchar, DATEPART(mm,AUDITINGDATE))+'月'+\n" +
|
||||||
|
"CONVERT(varchar, DATEPART(DD,AUDITINGDATE))+'日'AS 审核日期,AUDITINGDOCTOR AS 审核医生 from RIS_STUDIES\n" +
|
||||||
|
"where REPORTDATE is not null and PATIENT_ID=?";
|
||||||
|
Fangshe fangshe = null;
|
||||||
|
List<Fangshe> fangsheList = new ArrayList<>();
|
||||||
|
Object[] parms = new Object[]{patient_id};
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils4.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
fangshe = new Fangshe();
|
||||||
|
fangshe.setACCESSIONNUMBER(resultSet.getString("ACCESSIONNUMBER"));
|
||||||
|
fangshe.setProf(convertProf(resultSet.getString("PROF")));
|
||||||
|
fangshe.setSource_id(resultSet.getString("source_id"));
|
||||||
|
fangshe.setFIRSTNAME(resultSet.getString("姓名"));
|
||||||
|
fangshe.setPATIENTSEX(resultSet.getString("性别"));
|
||||||
|
fangshe.setPATIENTAGE(resultSet.getString("年龄"));
|
||||||
|
fangshe.setPATIENT_ID(resultSet.getString("检查号"));
|
||||||
|
fangshe.setREQUESTINGDEPARTMENT(resultSet.getString("申请科室"));
|
||||||
|
fangshe.setBEDID(resultSet.getString("床号"));
|
||||||
|
fangshe.setINPATIENT_ID(resultSet.getString("门诊号"));
|
||||||
|
fangshe.setCLINICAL_ID(resultSet.getString("住院号"));
|
||||||
|
fangshe.setREQUESTEDPROCEDUREDESCRIPTION(resultSet.getString("检查部位"));
|
||||||
|
fangshe.setEXAMINEDESCRIPTION(resultSet.getString("检查所见"));
|
||||||
|
fangshe.setDIAGNOSISPROMPT(resultSet.getString("诊断提示"));
|
||||||
|
fangshe.setEXAMINEDATE(resultSet.getString("检查日期"));
|
||||||
|
fangshe.setREPORTDATE(resultSet.getString("报告日期"));
|
||||||
|
fangshe.setREPORTDOCTOR(convertName(resultSet.getString("报告医生")));
|
||||||
|
fangshe.setAUDITINGDATE(resultSet.getString("审核日期"));
|
||||||
|
fangshe.setAUDITINGDOCTOR(convertName(resultSet.getString("审核医生")));
|
||||||
|
fangsheList.add(fangshe);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
JDBCUtils.release(resultSet, statement, connection);
|
||||||
|
}
|
||||||
|
return fangsheList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String convertProf(String profName) {
|
||||||
|
Map<String, String> profMap = new HashMap<>();
|
||||||
|
profMap.put("1", "B超检查报告单");
|
||||||
|
profMap.put("2", "CR检查报告单");
|
||||||
|
profMap.put("3", "CT检查报告单");
|
||||||
|
profMap.put("4", "MR检查报告单");
|
||||||
|
profMap.put("5", "放射检查报告单");
|
||||||
|
profMap.put("6", "DR检查报告单");
|
||||||
|
profMap.put("7", "数字胃肠检查报告单");
|
||||||
|
profMap.put("8", "DSA检查小C报告单");
|
||||||
|
profMap.put("9", "DSA检查大C报告单");
|
||||||
|
profMap.put("20", "骨密度检查报告单");
|
||||||
|
profMap.put("22", "胃镜检查报告单");
|
||||||
|
profMap.put("23", "肠镜检查报告单");
|
||||||
|
profMap.put("24", "鼻咽喉镜检查报告单");
|
||||||
|
profMap.put("25", "十二指肠镜检查报告单");
|
||||||
|
profMap.put("26", "TCD检查报告单");
|
||||||
|
profMap.put("27", "支气管检查报告单");
|
||||||
|
profMap.put("28", "肺功能检查报告单");
|
||||||
|
profMap.put("29", "心电图检查报告单");
|
||||||
|
profMap.put("30", "病理检查报告单");
|
||||||
|
profMap.put("32", "超声内镜报告单");
|
||||||
|
profMap.put("33", "胶囊内镜检查报告单");
|
||||||
|
profMap.put("34", "呼气试验检查报告单");
|
||||||
|
profMap.put("36", "液基检查报告单");
|
||||||
|
profMap.put("37", "细胞学检查报告单");
|
||||||
|
profMap.put("38", "HPV检查报告单");
|
||||||
|
profMap.put("39", "皮肤科检查报告单");
|
||||||
|
if (StringUtils.isNoneBlank(profName)) {
|
||||||
|
return profMap.get(profName);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String convertName(String name) {
|
||||||
|
if (StringUtils.isNoneBlank(name)) {
|
||||||
|
String[] strings = name.split("/");
|
||||||
|
if (2 == strings.length) {
|
||||||
|
return strings[0];
|
||||||
|
} else {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Archive_Detail> getAssortIdBySource(String source) {
|
||||||
|
String sql = "select SubAssort from archive_detail where Source = ? order by UpLoadDateTime desc";
|
||||||
|
Object[] parms = new Object[]{source};
|
||||||
|
Archive_Detail archive_detail = null;
|
||||||
|
List<Archive_Detail> details = new ArrayList<>();
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
archive_detail = new Archive_Detail();
|
||||||
|
archive_detail.setSubAssort(resultSet.getString("SubAssort"));
|
||||||
|
details.add(archive_detail);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
JDBCUtils.release(resultSet, statement, connection);
|
||||||
|
}
|
||||||
|
return details;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicPath(Fangshe source) {
|
||||||
|
String path = getXmlPath("pic");
|
||||||
|
User user = getUserEntity(source.getREPORTDOCTOR());
|
||||||
|
String str = "";
|
||||||
|
if (null != user.getCode()) {
|
||||||
|
File file = new File(path + user.getCode() + ".png");
|
||||||
|
if (file.exists()) {
|
||||||
|
str = path + user.getCode() + ".png";
|
||||||
|
}
|
||||||
|
File file1 = new File(path + "介入科\\" + user.getCode() + ".png");
|
||||||
|
if (file1.exists()) {
|
||||||
|
str = path + "介入科\\" + user.getCode() + ".png";
|
||||||
|
}
|
||||||
|
File file2 = new File(path + "内镜中心\\" + user.getCode() + ".png");
|
||||||
|
if (file2.exists()) {
|
||||||
|
str = path + "内镜中心\\" + user.getCode() + ".png";
|
||||||
|
}
|
||||||
|
if (!StringUtils.isNoneBlank(str)) {
|
||||||
|
File file3 = new File(path + "B超\\" + source.getREPORTDOCTOR() + ".png");
|
||||||
|
if (file3.exists()) {
|
||||||
|
str = path + "B超\\" + source.getREPORTDOCTOR() + ".png";
|
||||||
|
}
|
||||||
|
File file4 = new File(path + "病理\\" + source.getREPORTDOCTOR() + ".png");
|
||||||
|
if (file4.exists()) {
|
||||||
|
str = path + "病理\\" + source.getREPORTDOCTOR() + ".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
File file = new File(path + "B超\\" + source.getREPORTDOCTOR() + ".png");
|
||||||
|
if (file.exists()) {
|
||||||
|
str = path + "B超\\" + source.getREPORTDOCTOR() + ".png";
|
||||||
|
}
|
||||||
|
File file1 = new File(path + "病理\\" + source.getREPORTDOCTOR() + ".png");
|
||||||
|
if (file1.exists()) {
|
||||||
|
str = path + "病理\\" + source.getREPORTDOCTOR() + ".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!StringUtils.isNoneBlank(str)) {
|
||||||
|
logger.log("未签名医师:" + source.getProf() + "-:" + source.getREPORTDOCTOR());
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicPath1(Fangshe source) {
|
||||||
|
String path = getXmlPath("pic");
|
||||||
|
User user = getUserEntity(source.getAUDITINGDOCTOR());
|
||||||
|
String str = "";
|
||||||
|
if (null != user.getCode()) {
|
||||||
|
File file = new File(path + user.getCode() + ".png");
|
||||||
|
if (file.exists()) {
|
||||||
|
str = path + user.getCode() + ".png";
|
||||||
|
}
|
||||||
|
File file1 = new File(path + "介入科\\" + user.getCode() + ".png");
|
||||||
|
if (file1.exists()) {
|
||||||
|
str = path + "介入科\\" + user.getCode() + ".png";
|
||||||
|
}
|
||||||
|
File file2 = new File(path + "内镜中心\\" + user.getCode() + ".png");
|
||||||
|
if (file2.exists()) {
|
||||||
|
str = path + "内镜中心\\" + user.getCode() + ".png";
|
||||||
|
}
|
||||||
|
if (!StringUtils.isNoneBlank(str)) {
|
||||||
|
File file3 = new File(path + "B超\\" + source.getAUDITINGDOCTOR() + ".png");
|
||||||
|
if (file3.exists()) {
|
||||||
|
str = path + "B超\\" + source.getAUDITINGDOCTOR() + ".png";
|
||||||
|
}
|
||||||
|
File file4 = new File(path + "病理\\" + source.getAUDITINGDOCTOR() + ".png");
|
||||||
|
if (file4.exists()) {
|
||||||
|
str = path + "病理\\" + source.getAUDITINGDOCTOR() + ".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
File file = new File(path + "B超\\" + source.getAUDITINGDOCTOR() + ".png");
|
||||||
|
if (file.exists()) {
|
||||||
|
str = path + "B超\\" + source.getAUDITINGDOCTOR() + ".png";
|
||||||
|
}
|
||||||
|
File file1 = new File(path + "病理\\" + source.getAUDITINGDOCTOR() + ".png");
|
||||||
|
if (file1.exists()) {
|
||||||
|
str = path + "病理\\" + source.getAUDITINGDOCTOR() + ".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!StringUtils.isNoneBlank(str)) {
|
||||||
|
logger.log("未签名医师:" + source.getProf() + "-:" + source.getAUDITINGDOCTOR());
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public User getUserEntity(String name) {
|
||||||
|
String sql = "select user_name from power_user where name=?";
|
||||||
|
Object[] parms = new Object[]{name};
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
User user = new User();
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils5.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
user.setCode(resultSet.getString("user_name"));
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
JDBCUtils.release(resultSet, statement, connection);
|
||||||
|
}
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,665 @@
|
|||||||
|
package com.xjgs.service;
|
||||||
|
|
||||||
|
import com.xjgs.dao.JDBCUtils;
|
||||||
|
import com.xjgs.dao.JDBCUtils3;
|
||||||
|
import com.xjgs.dao.JDBCUtils4;
|
||||||
|
import com.xjgs.dao.JDBCUtils5;
|
||||||
|
import com.xjgs.util.FileUtil;
|
||||||
|
import com.xjgs.util.FtpUtil;
|
||||||
|
import com.xjgs.util.Logger;
|
||||||
|
import com.xjgs.util.PDFHelper;
|
||||||
|
import com.xjgs.vo.ArchiveMaster;
|
||||||
|
import com.xjgs.vo.Archive_Detail;
|
||||||
|
import com.xjgs.vo.Fangshe;
|
||||||
|
import com.xjgs.vo.User;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.dom4j.Document;
|
||||||
|
import org.dom4j.DocumentException;
|
||||||
|
import org.dom4j.Element;
|
||||||
|
import org.dom4j.io.SAXReader;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class PacsService {
|
||||||
|
private static Logger logger = new Logger();
|
||||||
|
//下载超声pdf并填入文件表
|
||||||
|
public void uploadRadiation(String patientId) {
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd");
|
||||||
|
String format1 = dateFormat.format (new Date ());
|
||||||
|
String rootPath = System.getProperty ("user.dir");
|
||||||
|
rootPath = rootPath+"\\logs\\"+format1;
|
||||||
|
File fs = new File (rootPath);
|
||||||
|
if(!fs.isDirectory ()){
|
||||||
|
fs.mkdirs ();
|
||||||
|
}
|
||||||
|
System.setProperty ("log.base",rootPath);
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String format = sdf.format(new Date ());
|
||||||
|
List<Archive_Detail> archive_details = getAssortIdBySource ("pacs");
|
||||||
|
List<Fangshe> fangsheList = getRadiEntity (patientId);
|
||||||
|
for(Fangshe fangshe : fangsheList){
|
||||||
|
boolean flag = true;
|
||||||
|
for (Archive_Detail archive_detail:archive_details) {
|
||||||
|
if(archive_detail.getSubAssort ().equals (fangshe.getSource_id ()+"_"+fangshe.getACCESSIONNUMBER())){
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(flag){
|
||||||
|
UUID uuid = UUID.randomUUID();//UUID唯一识别
|
||||||
|
String id = uuid.toString();
|
||||||
|
id = id.replace("-", "");
|
||||||
|
Date date = new Date();
|
||||||
|
writeRadiEntity(fangshe,id,getXmlPath("path"), date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.log("患者记账号为:"+patientId+"的超声数据已同步,同步时间:"+format);
|
||||||
|
}
|
||||||
|
public List<Fangshe> getRadiEntity(String patientId) {
|
||||||
|
String sql = "select ACCESSIONNUMBER,PROF,REQUESTEDPROCEDUREDESCRIPTION AS 检查部位,source_id,CLINICAL_ID, REPORTDATE as 报告日期,\n" +
|
||||||
|
"AUDITINGDATE as 审核日期,PATIENT_ID as 检查号,INPATIENT_ID as 住院号,FIRSTNAME as 患者姓名,EXAMINEDATE \n" +
|
||||||
|
"as 开始检查时间@,CONVERT(varchar, DATEPART(yy,REGISTERDATE))+'/'+\n" +
|
||||||
|
"CONVERT(varchar,DATEPART(mm,REGISTERDATE))+'/'+CONVERT(varchar,DATEPART(dd,REGISTERDATE)) +'/'+RTRIM(ACCESSIONNUMBER)\n" +
|
||||||
|
" +'/zip/' as path,REPORTDOCTOR AS 报告医生,AUDITINGDOCTOR AS 审核医生 from RIS_STUDIES where ACCESSIONNUMBER like'J%'\n" +
|
||||||
|
"AND REPORTDATE is not null and SOURCE_ID is not null and (PATIENTTYPE = '住院' or PATIENTTYPE='急诊') and CLINICAL_ID = ? order by REPORTDATE desc";
|
||||||
|
|
||||||
|
Fangshe fangshe = null;
|
||||||
|
List<Fangshe>fangsheList = new ArrayList<> ();
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
Object[]parms = new Object[]{patientId};
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils4.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
fangshe = new Fangshe ();
|
||||||
|
fangshe.setACCESSIONNUMBER (resultSet.getString ("ACCESSIONNUMBER"));
|
||||||
|
fangshe.setSource_id (resultSet.getString ("source_id"));
|
||||||
|
fangshe.setINPATIENT_ID (resultSet.getString ("住院号"));
|
||||||
|
fangshe.setProf (convertProf (resultSet.getString ("PROF")));
|
||||||
|
fangshe.setREQUESTEDPROCEDUREDESCRIPTION (resultSet.getString ("检查部位"));
|
||||||
|
fangshe.setREPORTDOCTOR (convertName (resultSet.getString ("报告医生")));
|
||||||
|
fangshe.setAUDITINGDOCTOR (convertName (resultSet.getString ("审核医生")));
|
||||||
|
fangshe.setREPORTDATE(resultSet.getString("报告日期"));
|
||||||
|
fangshe.setPath (resultSet.getString ("path"));
|
||||||
|
if(null !=fangshe.getPath()){
|
||||||
|
fangsheList.add(fangshe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
JDBCUtils.release(resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
return fangsheList;
|
||||||
|
}
|
||||||
|
public void fanshe(String patientId){
|
||||||
|
String temp = System.getProperty("user.dir")+"\\temp";
|
||||||
|
File fs = new File (temp);
|
||||||
|
if(!fs.isDirectory ()){
|
||||||
|
fs.mkdirs ();
|
||||||
|
}
|
||||||
|
String loccalPath = getXmlPath("path");
|
||||||
|
ItextPdfImpl itextPdf = new ItextPdfImpl();
|
||||||
|
List<Fangshe>fangsheList= getFangshe(patientId);
|
||||||
|
List<Archive_Detail> archive_details = getAssortIdBySource ("pacs");
|
||||||
|
Archive_Detail archiveDetail = null;
|
||||||
|
for(Fangshe fangshe:fangsheList){
|
||||||
|
boolean flag = true;
|
||||||
|
for(Archive_Detail archive_detail:archive_details){
|
||||||
|
if(archive_detail.getSubAssort ().equals(fangshe.getSource_id ()+"_"+fangshe.getACCESSIONNUMBER())){
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(flag){
|
||||||
|
String picPath = getPicPath(fangshe);
|
||||||
|
String picPath1 = getPicPath1 (fangshe);
|
||||||
|
UUID uuid = UUID.randomUUID();//UUID唯一识别
|
||||||
|
String id = uuid.toString();
|
||||||
|
id = id.replace("-", "");
|
||||||
|
archiveDetail = new Archive_Detail();
|
||||||
|
archiveDetail.setAssortId("EABEEB5D628449A7930F4C0A9953A754");
|
||||||
|
archiveDetail.setSubAssort(fangshe.getSource_id ()+"_"+fangshe.getACCESSIONNUMBER());
|
||||||
|
archiveDetail.setUploadDateTime(new Date());
|
||||||
|
archiveDetail.setSource("pacs");
|
||||||
|
archiveDetail.setFlag("0");
|
||||||
|
archiveDetail.setTitle(fangshe.getREQUESTEDPROCEDUREDESCRIPTION().replaceAll ("\\s*",""));
|
||||||
|
try {
|
||||||
|
ArchiveMaster archiveMaster = pacsGetHisId(fangshe.getSource_id());
|
||||||
|
if(StringUtils.isNoneBlank(archiveMaster.getPatientId ())){
|
||||||
|
ArchiveMaster archiveMaster1 = getMasterIdByPa(archiveMaster.getPatientId());
|
||||||
|
if(StringUtils.isNoneBlank(archiveMaster1.getId())){
|
||||||
|
archiveMaster.setId(archiveMaster1.getId());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
uploadHomePageByPid(archiveMaster.getPatientId());
|
||||||
|
ArchiveMaster id1 = getMasterIdByPa(archiveMaster.getPatientId());
|
||||||
|
archiveMaster.setId(id1.getId());
|
||||||
|
}
|
||||||
|
File file = new File("Z:\\pacs\\"+archiveMaster.getPatientId());
|
||||||
|
if(!file.isDirectory ()){
|
||||||
|
file.mkdirs();
|
||||||
|
}
|
||||||
|
boolean b = itextPdf.writePdf (fangshe,temp + "\\" + id + ".pdf",picPath,picPath1,fangshe.getProf ());
|
||||||
|
if(b && FileUtil.checkFileWritingOn(temp + "\\" + id + ".pdf")){
|
||||||
|
FileUtils.copyFile (new File (temp+"\\"+id+".pdf"),new File (/*loccalPath+"\\pacs\\"+*/"Z:\\pacs\\"+archiveMaster.getPatientId()+"\\"+id+".pdf"));
|
||||||
|
archiveDetail.setPdfPath(/*loccalPath+"\\pacs\\"*/"G:\\pdf\\pacs\\"+archiveMaster.getPatientId()+"\\"+id+".pdf");
|
||||||
|
archiveDetail.setMasterId(archiveMaster.getId());
|
||||||
|
File file1 = new File (archiveDetail.getPdfPath ());
|
||||||
|
if(file1.exists () && FileUtil.checkFileWritingOn(file1.getAbsolutePath())){
|
||||||
|
writeArchiveDetail(archiveDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.log(e.toString());
|
||||||
|
}finally {
|
||||||
|
File file2 = new File (temp+"\\"+id+".pdf");
|
||||||
|
file2.delete ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public int writeArchiveDetail(Archive_Detail archiveDetail) {
|
||||||
|
String sql = "insert into archive_detail(id,PDF_PATH,MasterID,UpLoadDateTime,AssortID,Source,SubAssort,Title,flag)values(replace(newid(), '-', '')," +
|
||||||
|
"?,?,?,?,?,?,?,?)";
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
Object[] parms = new Object[]{archiveDetail.getPdfPath(), archiveDetail.getMasterId(), archiveDetail.getUploadDateTime(), archiveDetail.getAssortId(), archiveDetail.getSource(), archiveDetail.getSubAssort(), archiveDetail.getTitle(), archiveDetail.getFlag()};
|
||||||
|
int j = 0;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
if(parms[i] instanceof Date) {
|
||||||
|
parms[i] = new java.sql.Timestamp(((Date) parms[i]).getTime());
|
||||||
|
}
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j = statement.executeUpdate();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release(null,statement,connection);
|
||||||
|
}
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
public List<Fangshe> getFangshe(String patientId){
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
String sql = "select ACCESSIONNUMBER,PROF,source_id,FIRSTNAME AS 姓名,PATIENTSEX AS 性别,PATIENTAGE AS 年龄,PATIENT_ID AS 检查号,\n" +
|
||||||
|
"REQUESTINGDEPARTMENT AS 申请科室,BEDID AS 床号,INPATIENT_ID AS 住院号,CLINICAL_ID AS 门诊号,\n" +
|
||||||
|
"REQUESTEDPROCEDUREDESCRIPTION AS 检查部位,EXAMINEDESCRIPTION AS 检查所见,DIAGNOSISPROMPT AS \n" +
|
||||||
|
"诊断提示,CONVERT(varchar, DATEPART(yy,EXAMINEDATE))+'年'+CONVERT(varchar, DATEPART(mm,EXAMINEDATE))+'月'+\n" +
|
||||||
|
"CONVERT(varchar, DATEPART(DD,EXAMINEDATE))+'日'AS 检查日期,CONVERT(varchar, DATEPART(yy,REPORTDATE))+'年'+\n" +
|
||||||
|
"CONVERT(varchar, DATEPART(mm,REPORTDATE))+'月'+CONVERT(varchar, DATEPART(DD,REPORTDATE))+'日' AS 报告日期,\n" +
|
||||||
|
"REPORTDOCTOR AS 报告医生,CONVERT(varchar, DATEPART(yy,AUDITINGDATE))+'年'+CONVERT(varchar, DATEPART(mm,AUDITINGDATE))+'月'+\n" +
|
||||||
|
"CONVERT(varchar, DATEPART(DD,AUDITINGDATE))+'日'AS 审核日期,AUDITINGDOCTOR AS 审核医生 from RIS_STUDIES\n" +
|
||||||
|
"where CLINICAL_ID = ? order by REPORTDATE desc";
|
||||||
|
Fangshe fangshe = null;
|
||||||
|
List<Fangshe>fangsheList = new ArrayList<>();
|
||||||
|
Object[]parms= new Object[]{patientId};;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils4.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()){
|
||||||
|
fangshe = new Fangshe();
|
||||||
|
fangshe.setACCESSIONNUMBER (resultSet.getString ("ACCESSIONNUMBER"));
|
||||||
|
fangshe.setProf (convertProf (resultSet.getString ("PROF")));
|
||||||
|
fangshe.setSource_id(resultSet.getString("source_id"));
|
||||||
|
fangshe.setFIRSTNAME(resultSet.getString("姓名"));
|
||||||
|
fangshe.setPATIENTSEX(resultSet.getString("性别"));
|
||||||
|
fangshe.setPATIENTAGE(resultSet.getString("年龄"));
|
||||||
|
fangshe.setPATIENT_ID(resultSet.getString("检查号"));
|
||||||
|
fangshe.setREQUESTINGDEPARTMENT(resultSet.getString("申请科室"));
|
||||||
|
fangshe.setBEDID(resultSet.getString("床号"));
|
||||||
|
fangshe.setINPATIENT_ID(resultSet.getString("门诊号"));
|
||||||
|
fangshe.setCLINICAL_ID(resultSet.getString("住院号"));
|
||||||
|
fangshe.setREQUESTEDPROCEDUREDESCRIPTION(resultSet.getString("检查部位"));
|
||||||
|
fangshe.setEXAMINEDESCRIPTION(resultSet.getString("检查所见"));
|
||||||
|
fangshe.setDIAGNOSISPROMPT(resultSet.getString("诊断提示"));
|
||||||
|
fangshe.setEXAMINEDATE(resultSet.getString("检查日期"));
|
||||||
|
fangshe.setREPORTDATE(resultSet.getString("报告日期"));
|
||||||
|
fangshe.setREPORTDOCTOR(convertName (resultSet.getString("报告医生")));
|
||||||
|
fangshe.setAUDITINGDATE(resultSet.getString("审核日期"));
|
||||||
|
fangshe.setAUDITINGDOCTOR(convertName (resultSet.getString("审核医生")));
|
||||||
|
fangsheList.add(fangshe);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release(resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
return fangsheList;
|
||||||
|
}
|
||||||
|
public String convertName(String name){
|
||||||
|
if(StringUtils.isNoneBlank (name)){
|
||||||
|
String[] strings = name.split ("/");
|
||||||
|
if(2 == strings.length){
|
||||||
|
return strings[0];
|
||||||
|
}else {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public ArchiveMaster pacsGetHisId(String sourceId){
|
||||||
|
String sql = "select fvisit_id,fappnote_no from mp.smp_pacs_appnote where fappnote_no = ?";
|
||||||
|
Object[]parms = new Object[]{sourceId};
|
||||||
|
ArchiveMaster archiveMaster = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement preparedStatement = null;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils.getConnection();
|
||||||
|
preparedStatement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
preparedStatement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = preparedStatement.executeQuery();
|
||||||
|
while (resultSet.next()){
|
||||||
|
archiveMaster = new ArchiveMaster();
|
||||||
|
archiveMaster.setPatientId(resultSet.getString("fvisit_id"));
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
JDBCUtils.release(resultSet,preparedStatement,connection);
|
||||||
|
}
|
||||||
|
return archiveMaster == null ? new ArchiveMaster():archiveMaster;
|
||||||
|
}
|
||||||
|
public Integer writeRadiEntity(Fangshe fangshe, String id, String localPath, Date date) {
|
||||||
|
String temp = System.getProperty("user.dir")+"\\temp";
|
||||||
|
File fs = new File (temp);
|
||||||
|
if(!fs.isDirectory ()){
|
||||||
|
fs.mkdirs ();
|
||||||
|
}
|
||||||
|
int j = 0;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
Archive_Detail archiveDetail = new Archive_Detail ();
|
||||||
|
archiveDetail.setSubAssort (fangshe.getSource_id ());
|
||||||
|
ArchiveMaster archiveMaster = pacsGetHisId (fangshe.getSource_id ());
|
||||||
|
ArchiveMaster archiveMaster1 = null;
|
||||||
|
if(StringUtils.isNoneBlank (archiveMaster.getPatientId ())) {
|
||||||
|
try {
|
||||||
|
archiveMaster1 = getMasterIdByPa (archiveMaster.getPatientId ());
|
||||||
|
if (StringUtils.isNoneBlank(archiveMaster1.getId ())) {
|
||||||
|
archiveMaster.setId (archiveMaster1.getId ());
|
||||||
|
} else {
|
||||||
|
uploadHomePageByPid (archiveMaster.getPatientId ());
|
||||||
|
ArchiveMaster id1 = getMasterIdByPa (archiveMaster.getPatientId ());
|
||||||
|
archiveMaster.setId (id1.getId ());
|
||||||
|
}
|
||||||
|
FtpUtil ftpUtil = new FtpUtil ();
|
||||||
|
ftpUtil.downloadFile (fangshe.getPath (), "yun.pdf", temp, id + ".pdf");
|
||||||
|
File fd = new File (temp+"\\"+id + ".pdf");
|
||||||
|
if (fd.exists() && FileUtil.checkFileWritingOn(temp+"\\"+id + ".pdf")) {
|
||||||
|
String picPath = getPicPath (fangshe);
|
||||||
|
String picPath1 = getPicPath1 (fangshe);
|
||||||
|
archiveDetail.setPdfPath ((localPath + "\\pacs\\" + archiveMaster.getPatientId () + "\\" + id + ".pdf"));
|
||||||
|
File file = new File (localPath + "\\pacs\\" + archiveMaster.getPatientId ());
|
||||||
|
if (!file.isDirectory ()) {
|
||||||
|
file.mkdirs ();
|
||||||
|
}
|
||||||
|
PDFHelper.AddWatermark (temp + "\\" + id + ".pdf", picPath, picPath1, archiveDetail.getPdfPath ());
|
||||||
|
if (new File (archiveDetail.getPdfPath ()).exists () && FileUtil.checkFileWritingOn(archiveDetail.getPdfPath())) {
|
||||||
|
logger.log("准备添加文件信息");
|
||||||
|
archiveDetail.setMasterId (archiveMaster.getId ());
|
||||||
|
archiveDetail.setUploadDateTime (date);
|
||||||
|
archiveDetail.setAssortId ("EABEEB5D628449A7930F4C0A9953A754");
|
||||||
|
archiveDetail.setSource ("pacs");
|
||||||
|
archiveDetail.setFlag ("0");
|
||||||
|
archiveDetail.setSubAssort (fangshe.getSource_id ()+"_"+fangshe.getACCESSIONNUMBER());
|
||||||
|
archiveDetail.setTitle (fangshe.getREQUESTEDPROCEDUREDESCRIPTION ().replaceAll ("\\s*",""));
|
||||||
|
String sql = "insert into archive_detail(ID,PDF_PATH,MasterID,UpLoadDateTime,AssortID,Source,flag,title,SubAssort)values(replace(newid(), '-', ''),?,?,?,?,?,?,?,?)";
|
||||||
|
Object[] parms = new Object[]{archiveDetail.getPdfPath (), archiveDetail.getMasterId (), archiveDetail.getUploadDateTime (), archiveDetail.getAssortId (), archiveDetail.getSource (), archiveDetail.getFlag (), archiveDetail.getTitle (), archiveDetail.getSubAssort ()};
|
||||||
|
connection = JDBCUtils3.getConnection ();
|
||||||
|
statement = connection.prepareStatement (sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject (i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j = statement.executeUpdate ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log ("超声数据未同步_____"+archiveMaster.getPatientId ());
|
||||||
|
} finally {
|
||||||
|
File file = new File (temp + "\\" + id + ".pdf");
|
||||||
|
file.delete ();
|
||||||
|
JDBCUtils.release (null, statement, connection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
public void uploadHomePageByPid(String patientId){
|
||||||
|
String sql = "select t.zyh as 住院号,t.jzh as 记账号,t.zycs as 住院次数,t.xm as 姓名,t.xb as 性别,t.ryrq as 入院日期,t.cyrq as 出院日期,t.sfzh as 身份证号,t.rybq as 入院科室,t.dqbq as 出院科室,t.rycw as 入院床位,hp.fdrname as 主管医生 " +
|
||||||
|
"from ndns.zl t left join hthis.p_doctor hp on t.dqys = hp.fdrid where t.jzh = ? order by t.jzh desc";
|
||||||
|
ArchiveMaster master = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
Object[]parms = new Object[]{patientId};
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
master = new ArchiveMaster();
|
||||||
|
master.setInpNo(resultSet.getString("住院号").trim());
|
||||||
|
master.setPatientId(resultSet.getString("记账号").trim());
|
||||||
|
master.setVisitId(resultSet.getString("住院次数"));
|
||||||
|
master.setName(resultSet.getString("姓名"));
|
||||||
|
master.setSex(resultSet.getString("性别"));
|
||||||
|
master.setAdmissionDateTime(resultSet.getString("入院日期"));
|
||||||
|
master.setDischargeDateTime(resultSet.getString("出院日期"));
|
||||||
|
master.setIdNo(resultSet.getString("身份证号"));
|
||||||
|
master.setDeptAdmissionTo(resultSet.getString("入院科室"));
|
||||||
|
master.setDeptName(resultSet.getString("出院科室"));
|
||||||
|
master.setDoctorInCharge(resultSet.getString("主管医生"));
|
||||||
|
master.setBedId(resultSet.getString ("入院床位"));
|
||||||
|
if(null == master.getDischargeDateTime()|| master.getDischargeDateTime().isEmpty()){
|
||||||
|
master.setStatus("在院");
|
||||||
|
}else{
|
||||||
|
master.setStatus("归档中");
|
||||||
|
}
|
||||||
|
if ("2".equals(master.getSex())) {
|
||||||
|
master.setSex("女");
|
||||||
|
} else {
|
||||||
|
master.setSex("男");
|
||||||
|
}
|
||||||
|
writeHomeEntity(master);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
JDBCUtils.release(resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//新增首页数据
|
||||||
|
int writeHomeEntity(ArchiveMaster archiveMaster) {
|
||||||
|
String sql = "insert into archive_master(id,patient_id,inp_no,visit_id,name,sex,dept_name,discharge_date_time," +
|
||||||
|
"archivestate,admission_date_time,dept_admission_to,doctor_in_charge,id_no,bed_id)values(replace(newid(), '-', ''),?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||||
|
Object[] parms = new Object[]{archiveMaster.getPatientId(), archiveMaster.getInpNo(), archiveMaster.getVisitId(), archiveMaster.getName(), archiveMaster.getSex(), archiveMaster.getDeptName(), archiveMaster.getDischargeDateTime(), archiveMaster.getStatus(), archiveMaster.getAdmissionDateTime(), archiveMaster.getDeptAdmissionTo(), archiveMaster.getDoctorInCharge(), archiveMaster.getIdNo(),archiveMaster.getBedId ()};
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
int j = 0;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j = statement.executeUpdate();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release(null,statement,connection);
|
||||||
|
}
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
public ArchiveMaster getMasterIdByPa(String jzh){
|
||||||
|
String sql = "select ID,patient_id from archive_master where patient_id = ?";
|
||||||
|
Object[]parms = new Object[]{jzh};
|
||||||
|
ArchiveMaster archiveMaster = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()){
|
||||||
|
archiveMaster = new ArchiveMaster();
|
||||||
|
archiveMaster.setId(resultSet.getString("ID"));
|
||||||
|
archiveMaster.setPatientId(resultSet.getString("patient_id"));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
JDBCUtils.release(resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
return archiveMaster == null ? new ArchiveMaster():archiveMaster;
|
||||||
|
}
|
||||||
|
public String getPicPath(Fangshe source){
|
||||||
|
String path = getXmlPath("pic");
|
||||||
|
User user = getUserEntity (source.getREPORTDOCTOR ());
|
||||||
|
String str = "";
|
||||||
|
if(StringUtils.isNoneBlank(user.getCode())){
|
||||||
|
File file = new File (path+user.getCode ()+".png");
|
||||||
|
if(file.exists ()){
|
||||||
|
str = path+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
File file1 = new File (path+"介入科\\"+user.getCode ()+".png");
|
||||||
|
if(file1.exists ()){
|
||||||
|
str = path+"介入科\\"+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
File file2 = new File (path+"内镜中心\\"+user.getCode ()+".png");
|
||||||
|
if(file2.exists ()){
|
||||||
|
str = path+"内镜中心\\"+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
if(!StringUtils.isNoneBlank (str)){
|
||||||
|
File file3 = new File (path+"B超\\"+source.getREPORTDOCTOR ()+".png");
|
||||||
|
if(file3.exists ()){
|
||||||
|
str = path+"B超\\"+source.getREPORTDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
File file4 = new File (path+"病理\\"+source.getREPORTDOCTOR ()+".png");
|
||||||
|
if(file4.exists ()){
|
||||||
|
str = path+"病理\\"+source.getREPORTDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
File file = new File (path+"B超\\"+source.getREPORTDOCTOR ()+".png");
|
||||||
|
if(file.exists ()){
|
||||||
|
str = path+"B超\\"+source.getREPORTDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
File file1 = new File (path+"病理\\"+source.getREPORTDOCTOR ()+".png");
|
||||||
|
if(file1.exists ()){
|
||||||
|
str = path+"病理\\"+source.getREPORTDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!StringUtils.isNoneBlank (str)){
|
||||||
|
logger.log ("未签名医师:"+source.getProf ()+"-:"+source.getREPORTDOCTOR ());
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
public String getPicPath1(Fangshe source){
|
||||||
|
String path = getXmlPath("pic");
|
||||||
|
User user = getUserEntity (source.getAUDITINGDOCTOR ());
|
||||||
|
String str = "";
|
||||||
|
if(StringUtils.isNoneBlank(user.getCode())){
|
||||||
|
File file = new File (path+user.getCode ()+".png");
|
||||||
|
if(file.exists ()){
|
||||||
|
str = path+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
File file1 = new File (path+"介入科\\"+user.getCode ()+".png");
|
||||||
|
if(file1.exists ()){
|
||||||
|
str = path+"介入科\\"+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
File file2 = new File (path+"内镜中心\\"+user.getCode ()+".png");
|
||||||
|
if(file2.exists ()){
|
||||||
|
str = path+"内镜中心\\"+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
if(!StringUtils.isNoneBlank (str)){
|
||||||
|
File file3 = new File (path+"B超\\"+source.getAUDITINGDOCTOR ()+".png");
|
||||||
|
if(file3.exists ()){
|
||||||
|
str = path+"B超\\"+source.getAUDITINGDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
File file4 = new File (path+"病理\\"+source.getAUDITINGDOCTOR ()+".png");
|
||||||
|
if(file4.exists ()){
|
||||||
|
str = path+"病理\\"+source.getAUDITINGDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
File file = new File (path+"B超\\"+source.getAUDITINGDOCTOR ()+".png");
|
||||||
|
if(file.exists ()){
|
||||||
|
str = path+"B超\\"+source.getAUDITINGDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
File file1 = new File (path+"病理\\"+source.getAUDITINGDOCTOR ()+".png");
|
||||||
|
if(file1.exists ()){
|
||||||
|
str = path+"病理\\"+source.getAUDITINGDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!StringUtils.isNoneBlank (str)){
|
||||||
|
logger.log ("未签名医师:"+source.getProf ()+"-:"+source.getAUDITINGDOCTOR ());
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
public User getUserEntity(String name){
|
||||||
|
String sql = "select user_name from power_user where name=?";
|
||||||
|
Object[]parms = new Object[]{name};
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
User user = new User ();
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils5.getConnection ();
|
||||||
|
statement = connection.prepareStatement (sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery ();
|
||||||
|
while (resultSet.next ()){
|
||||||
|
user.setCode (resultSet.getString ("user_name"));
|
||||||
|
}
|
||||||
|
}catch (Exception ex){
|
||||||
|
logger.log(ex.toString());
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release (resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
public String convertProf(String profName){
|
||||||
|
Map<String,String>profMap = new HashMap<> ();
|
||||||
|
profMap.put ("1","B超检查报告单");
|
||||||
|
profMap.put ("2","CR检查报告单");
|
||||||
|
profMap.put ("3","CT检查报告单");
|
||||||
|
profMap.put ("4","MR检查报告单");
|
||||||
|
profMap.put ("5","放射检查报告单");
|
||||||
|
profMap.put ("6","DR检查报告单");
|
||||||
|
profMap.put ("7","数字胃肠检查报告单");
|
||||||
|
profMap.put ("8","DSA检查小C报告单");
|
||||||
|
profMap.put ("9","DSA检查大C报告单");
|
||||||
|
profMap.put ("20","骨密度检查报告单");
|
||||||
|
profMap.put ("22","胃镜检查报告单");
|
||||||
|
profMap.put ("23","肠镜检查报告单");
|
||||||
|
profMap.put ("24","鼻咽喉镜检查报告单");
|
||||||
|
profMap.put ("25","十二指肠镜检查报告单");
|
||||||
|
profMap.put ("26","TCD检查报告单");
|
||||||
|
profMap.put ("27","支气管检查报告单");
|
||||||
|
profMap.put ("28","肺功能检查报告单");
|
||||||
|
profMap.put ("29","心电图检查报告单");
|
||||||
|
profMap.put ("30","病理检查报告单");
|
||||||
|
profMap.put ("32","超声内镜报告单");
|
||||||
|
profMap.put ("33","胶囊内镜检查报告单");
|
||||||
|
profMap.put ("34","呼气试验检查报告单");
|
||||||
|
profMap.put ("36","液基检查报告单");
|
||||||
|
profMap.put ("37","细胞学检查报告单");
|
||||||
|
profMap.put ("38","HPV检查报告单");
|
||||||
|
profMap.put ("39","皮肤科检查报告单");
|
||||||
|
if(StringUtils.isNoneBlank (profName)){
|
||||||
|
return profMap.get (profName);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
public List<Archive_Detail>getAssortIdBySource(String source){
|
||||||
|
String sql = "select SubAssort from archive_detail where Source = ? order by UpLoadDateTime desc";
|
||||||
|
Object[]parms = new Object[]{source};
|
||||||
|
Archive_Detail archive_detail = null;
|
||||||
|
List<Archive_Detail>details = new ArrayList<>();
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()){
|
||||||
|
archive_detail = new Archive_Detail();
|
||||||
|
archive_detail.setSubAssort(resultSet.getString("SubAssort"));
|
||||||
|
details.add(archive_detail);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.log(e.toString());
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release(resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
return details;
|
||||||
|
}
|
||||||
|
public String getXmlPath(String elementName) {
|
||||||
|
Document doc = null;
|
||||||
|
try {
|
||||||
|
doc = new SAXReader ().read(this.getClass().getResourceAsStream("/localPath.xml"));
|
||||||
|
} catch (DocumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Element root = doc.getRootElement();
|
||||||
|
Iterator itr = root.elementIterator();
|
||||||
|
while(itr.hasNext()){
|
||||||
|
Element element = (Element)itr.next();
|
||||||
|
if(elementName.equals(element.getName())){
|
||||||
|
return element.getTextTrim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String pacs(ArchiveMaster archiveMaster){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,737 @@
|
|||||||
|
package com.xjgs.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xjgs.dao.JDBCUtils;
|
||||||
|
import com.xjgs.dao.JDBCUtils3;
|
||||||
|
import com.xjgs.dao.JDBCUtils4;
|
||||||
|
import com.xjgs.dao.JDBCUtils5;
|
||||||
|
import com.xjgs.util.FileUtil;
|
||||||
|
import com.xjgs.util.FtpUtil;
|
||||||
|
import com.xjgs.util.Logger;
|
||||||
|
import com.xjgs.vo.*;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.dom4j.Document;
|
||||||
|
import org.dom4j.DocumentException;
|
||||||
|
import org.dom4j.Element;
|
||||||
|
import org.dom4j.io.SAXReader;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class RadiateService {
|
||||||
|
private static Logger logger = new Logger();
|
||||||
|
public List<Ris_Study> getFansheEntity(){
|
||||||
|
String sql = "select PATIENT_ID,REQUESTEDPROCEDUREDESCRIPTION,ACCESSIONNUMBER,STUDYUID,REPORTDATE,SOURCE_ID\n" +
|
||||||
|
",\n" +
|
||||||
|
"( CAST( DATEPART(year,REPORTDATE) as nvarchar(4)) +'/' + CAST( DATEPART(MONTH,REPORTDATE) as nvarchar(2))+'/'+ CAST(DATEPART(DAY,REPORTDATE) as nvarchar(2))\n" +
|
||||||
|
"+'/1.2.277.0.10.'+rtrim(ACCESSIONNUMBER)+'/'\n" +
|
||||||
|
"+'1.2.277.0.10.'+rtrim(ACCESSIONNUMBER)+'/')\n" +
|
||||||
|
"as 'DCMFile',\n" +
|
||||||
|
"('1.2.277.0.10.5.1.4.1.1.88.11.'+rtrim(ACCESSIONNUMBER)+'.dcm')\n" +
|
||||||
|
"as 'DCMName' \n" +
|
||||||
|
"from RIS_STUDIES where \n" +
|
||||||
|
"PROF in (2,3,4,5,6) \n" +
|
||||||
|
"and REPORTDATE is not null\n" +
|
||||||
|
"and SOURCE_ID is not null\n" +
|
||||||
|
"and AUDITINGDATE between DATEADD(SS,-1036800,getdate()) and CONVERT(varchar(100), GETDATE(), 21) and (PATIENTTYPE = '住院' or PATIENTTYPE='急诊')\n" +
|
||||||
|
"order by REPORTDATE DESC";
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
List<Ris_Study>ris_studies = new ArrayList<> ();
|
||||||
|
Ris_Study ris_study = null;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils4.getConnection ();
|
||||||
|
statement = connection.prepareStatement (sql);
|
||||||
|
resultSet = statement.executeQuery ();
|
||||||
|
while (resultSet.next ()){
|
||||||
|
ris_study = new Ris_Study ();
|
||||||
|
ris_study.setPatientId(resultSet.getString("PATIENT_ID"));
|
||||||
|
ris_study.setACCESSIONNUMBER(resultSet.getString("ACCESSIONNUMBER"));
|
||||||
|
ris_study.setRecord_name (resultSet.getString ("REQUESTEDPROCEDUREDESCRIPTION"));
|
||||||
|
ris_study.setSource_id (resultSet.getString("SOURCE_ID"));
|
||||||
|
ris_study.setReportdate (resultSet.getString ("REPORTDATE"));
|
||||||
|
ris_study.setPath (resultSet.getString ("DCMFile"));
|
||||||
|
ris_study.setFirstname (resultSet.getString ("DCMName"));
|
||||||
|
ris_studies.add (ris_study);
|
||||||
|
}
|
||||||
|
}catch (Exception ex){
|
||||||
|
logger.log(ex.toString());
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release (resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
return ris_studies;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadDcmToPdf(Ris_Study ris_study) {
|
||||||
|
String temp = System.getProperty("user.dir") + "\\temp";
|
||||||
|
File fs = new File(temp);
|
||||||
|
if (!fs.isDirectory()) {
|
||||||
|
fs.mkdirs();
|
||||||
|
}
|
||||||
|
UUID uuid = UUID.randomUUID();//UUID唯一识别
|
||||||
|
String id = uuid.toString();
|
||||||
|
id = id.replace("-", "");
|
||||||
|
FtpUtil ftpUtil = new FtpUtil();
|
||||||
|
File file = new File(temp + "\\" + id + ".pdf");
|
||||||
|
File file3 = new File(temp + "\\" + id + ".dcm");
|
||||||
|
ftpUtil.downloadFile(ris_study.getPath(), ris_study.getFirstname(), temp, id + ".dcm");
|
||||||
|
File fd = new File(temp + "\\" + id + ".dcm");
|
||||||
|
boolean b = fd.exists();
|
||||||
|
try {
|
||||||
|
if (b) {
|
||||||
|
DCM2PDF(temp + "\\" + id + ".dcm", temp + "\\" + id + ".pdf");
|
||||||
|
if (file.exists()) {
|
||||||
|
Archive_Detail archiveDetail = new Archive_Detail();
|
||||||
|
ArchiveMaster archiveMaster = pacsGetHisId(ris_study.getSource_id());
|
||||||
|
ArchiveMaster archiveMaster1 = null;
|
||||||
|
if (StringUtils.isNoneBlank(archiveMaster.getPatientId())) {
|
||||||
|
archiveMaster1 = getMasterIdByPa(archiveMaster.getPatientId());
|
||||||
|
if (StringUtils.isNoneBlank(archiveMaster1.getId())) {
|
||||||
|
archiveMaster.setId(archiveMaster1.getId());
|
||||||
|
} else {
|
||||||
|
uploadHomePageByPid(archiveMaster.getPatientId());
|
||||||
|
ArchiveMaster id1 = getMasterIdByPa(archiveMaster.getPatientId());
|
||||||
|
archiveMaster.setId(id1.getId());
|
||||||
|
}
|
||||||
|
archiveDetail.setMasterId(archiveMaster.getId());
|
||||||
|
archiveDetail.setUploadDateTime(new Date());
|
||||||
|
archiveDetail.setAssortId("EABEEB5D628449A7930F4C0A9953A754");
|
||||||
|
archiveDetail.setSource("pacs");
|
||||||
|
archiveDetail.setFlag("0");
|
||||||
|
archiveDetail.setTitle(ris_study.getRecord_name().replaceAll("\\s*", ""));
|
||||||
|
archiveDetail.setSubAssort(ris_study.getSource_id() + "_" + ris_study.getACCESSIONNUMBER());
|
||||||
|
archiveDetail.setPdfPath(getXmlPath("path") + "\\pacs\\" + archiveMaster.getPatientId() + "\\" + id + ".pdf");
|
||||||
|
File file2 = new File(getXmlPath("path") + "\\pacs\\" + archiveMaster.getPatientId());
|
||||||
|
if (!file2.isDirectory()) {
|
||||||
|
file2.mkdirs();
|
||||||
|
}
|
||||||
|
FileUtils.copyFile(file, new File(archiveDetail.getPdfPath()));
|
||||||
|
File file1 = new File(archiveDetail.getPdfPath());
|
||||||
|
if (file1.exists() && FileUtil.checkFileWritingOn(file1.getAbsolutePath())) {
|
||||||
|
writeArchiveDetail(archiveDetail);
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String format = sdf.format(new Date());
|
||||||
|
logger.log("dcm转化成功,同步时间:"+format);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fanshe(ris_study.getPatientId());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
file.delete();
|
||||||
|
file3.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void fanshe(String patient_id){
|
||||||
|
String temp = System.getProperty("user.dir")+"\\temp";
|
||||||
|
File fs = new File (temp);
|
||||||
|
if(!fs.isDirectory ()){
|
||||||
|
fs.mkdirs ();
|
||||||
|
}
|
||||||
|
String loccalPath = getXmlPath("path");
|
||||||
|
ItextPdfImpl itextPdf = new ItextPdfImpl();
|
||||||
|
List<Fangshe>fangsheList= getFangshe(patient_id);
|
||||||
|
List<Archive_Detail> archive_details = getAssortIdBySource ("pacs");
|
||||||
|
Archive_Detail archiveDetail = null;
|
||||||
|
for(Fangshe fangshe:fangsheList){
|
||||||
|
boolean flag = true;
|
||||||
|
for(Archive_Detail archive_detail:archive_details){
|
||||||
|
if(archive_detail.getSubAssort ().equals(fangshe.getSource_id ()+"_"+fangshe.getACCESSIONNUMBER())){
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(flag){
|
||||||
|
String picPath = getPicPath(fangshe);
|
||||||
|
String picPath1 = getPicPath1 (fangshe);
|
||||||
|
UUID uuid = UUID.randomUUID();//UUID唯一识别
|
||||||
|
String id = uuid.toString();
|
||||||
|
id = id.replace("-", "");
|
||||||
|
archiveDetail = new Archive_Detail();
|
||||||
|
archiveDetail.setAssortId("EABEEB5D628449A7930F4C0A9953A754");
|
||||||
|
archiveDetail.setSubAssort(fangshe.getSource_id ()+"_"+fangshe.getACCESSIONNUMBER());
|
||||||
|
archiveDetail.setUploadDateTime(new Date());
|
||||||
|
archiveDetail.setSource("pacs");
|
||||||
|
archiveDetail.setFlag("0");
|
||||||
|
archiveDetail.setTitle(fangshe.getREQUESTEDPROCEDUREDESCRIPTION().replaceAll ("\\s*",""));
|
||||||
|
try {
|
||||||
|
ArchiveMaster archiveMaster = pacsGetHisId(fangshe.getSource_id());
|
||||||
|
if(StringUtils.isNoneBlank(archiveMaster.getPatientId ())){
|
||||||
|
ArchiveMaster archiveMaster1 = getMasterIdByPa(archiveMaster.getPatientId());
|
||||||
|
if(StringUtils.isNoneBlank(archiveMaster1.getId())){
|
||||||
|
archiveMaster.setId(archiveMaster1.getId());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
uploadHomePageByPid(archiveMaster.getPatientId());
|
||||||
|
ArchiveMaster id1 = getMasterIdByPa(archiveMaster.getPatientId());
|
||||||
|
archiveMaster.setId(id1.getId());
|
||||||
|
}
|
||||||
|
File file = new File(loccalPath+"\\pacs\\"+archiveMaster.getPatientId());
|
||||||
|
if(!file.isDirectory ()){
|
||||||
|
file.mkdirs();
|
||||||
|
}
|
||||||
|
boolean b = itextPdf.writePdf (fangshe,temp + "\\" + id + ".pdf",picPath,picPath1,fangshe.getProf ());
|
||||||
|
if(b && FileUtil.checkFileWritingOn(temp + "\\" + id + ".pdf")){
|
||||||
|
FileUtils.copyFile (new File (temp+"\\"+id+".pdf"),new File (loccalPath+"\\pacs\\"+archiveMaster.getPatientId()+"\\"+id+".pdf"));
|
||||||
|
archiveDetail.setPdfPath(loccalPath+"\\pacs\\"+archiveMaster.getPatientId()+"\\"+id+".pdf");
|
||||||
|
archiveDetail.setMasterId(archiveMaster.getId());
|
||||||
|
File file1 = new File (archiveDetail.getPdfPath ());
|
||||||
|
if(file1.exists () && FileUtil.checkFileWritingOn(file1.getAbsolutePath())){
|
||||||
|
writeArchiveDetail(archiveDetail);
|
||||||
|
logger.log("模板打出报告>>>>>单号:"+patient_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.log(e.toString());
|
||||||
|
}finally {
|
||||||
|
File file2 = new File (temp+"\\"+id+".pdf");
|
||||||
|
if(file2.exists()){
|
||||||
|
file2.delete ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public String getPicPath(Fangshe source){
|
||||||
|
String path = getXmlPath("pic");
|
||||||
|
User user = getUserEntity (source.getREPORTDOCTOR ());
|
||||||
|
String str = "";
|
||||||
|
if(null != user.getCode ()){
|
||||||
|
File file = new File (path+user.getCode ()+".png");
|
||||||
|
if(file.exists ()){
|
||||||
|
str = path+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
File file1 = new File (path+"介入科\\"+user.getCode ()+".png");
|
||||||
|
if(file1.exists ()){
|
||||||
|
str = path+"介入科\\"+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
File file2 = new File (path+"内镜中心\\"+user.getCode ()+".png");
|
||||||
|
if(file2.exists ()){
|
||||||
|
str = path+"内镜中心\\"+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
if(!StringUtils.isNoneBlank (str)){
|
||||||
|
File file3 = new File (path+"B超\\"+source.getREPORTDOCTOR ()+".png");
|
||||||
|
if(file3.exists ()){
|
||||||
|
str = path+"B超\\"+source.getREPORTDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
File file4 = new File (path+"病理\\"+source.getREPORTDOCTOR ()+".png");
|
||||||
|
if(file4.exists ()){
|
||||||
|
str = path+"病理\\"+source.getREPORTDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
File file = new File (path+"B超\\"+source.getREPORTDOCTOR ()+".png");
|
||||||
|
if(file.exists ()){
|
||||||
|
str = path+"B超\\"+source.getREPORTDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
File file1 = new File (path+"病理\\"+source.getREPORTDOCTOR ()+".png");
|
||||||
|
if(file1.exists ()){
|
||||||
|
str = path+"病理\\"+source.getREPORTDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!StringUtils.isNoneBlank (str)){
|
||||||
|
logger.log ("未签名医师:"+source.getProf ()+"-:"+source.getREPORTDOCTOR ());
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
public String getPicPath1(Fangshe source){
|
||||||
|
String path = getXmlPath("pic");
|
||||||
|
User user = getUserEntity (source.getAUDITINGDOCTOR ());
|
||||||
|
String str = "";
|
||||||
|
if(null != user.getCode ()){
|
||||||
|
File file = new File (path+user.getCode ()+".png");
|
||||||
|
if(file.exists ()){
|
||||||
|
str = path+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
File file1 = new File (path+"介入科\\"+user.getCode ()+".png");
|
||||||
|
if(file1.exists ()){
|
||||||
|
str = path+"介入科\\"+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
File file2 = new File (path+"内镜中心\\"+user.getCode ()+".png");
|
||||||
|
if(file2.exists ()){
|
||||||
|
str = path+"内镜中心\\"+user.getCode ()+".png";
|
||||||
|
}
|
||||||
|
if(!StringUtils.isNoneBlank (str)){
|
||||||
|
File file3 = new File (path+"B超\\"+source.getAUDITINGDOCTOR ()+".png");
|
||||||
|
if(file3.exists ()){
|
||||||
|
str = path+"B超\\"+source.getAUDITINGDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
File file4 = new File (path+"病理\\"+source.getAUDITINGDOCTOR ()+".png");
|
||||||
|
if(file4.exists ()){
|
||||||
|
str = path+"病理\\"+source.getAUDITINGDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
File file = new File (path+"B超\\"+source.getAUDITINGDOCTOR ()+".png");
|
||||||
|
if(file.exists ()){
|
||||||
|
str = path+"B超\\"+source.getAUDITINGDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
File file1 = new File (path+"病理\\"+source.getAUDITINGDOCTOR ()+".png");
|
||||||
|
if(file1.exists ()){
|
||||||
|
str = path+"病理\\"+source.getAUDITINGDOCTOR ()+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!StringUtils.isNoneBlank (str)){
|
||||||
|
logger.log ("未签名医师:"+source.getProf ()+"-:"+source.getAUDITINGDOCTOR ());
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
public User getUserEntity(String name){
|
||||||
|
String sql = "select user_name from power_user where name=?";
|
||||||
|
Object[]parms = new Object[]{name};
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
User user = new User ();
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils5.getConnection ();
|
||||||
|
statement = connection.prepareStatement (sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery ();
|
||||||
|
while (resultSet.next ()){
|
||||||
|
user.setCode (resultSet.getString ("user_name"));
|
||||||
|
}
|
||||||
|
}catch (Exception ex){
|
||||||
|
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release (resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
public List<Archive_Detail>getAssortIdBySource(String source){
|
||||||
|
String sql = "select SubAssort from archive_detail where Source = ? order by UpLoadDateTime desc";
|
||||||
|
Object[]parms = new Object[]{source};
|
||||||
|
Archive_Detail archive_detail = null;
|
||||||
|
List<Archive_Detail>details = new ArrayList<>();
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()){
|
||||||
|
archive_detail = new Archive_Detail();
|
||||||
|
archive_detail.setSubAssort(resultSet.getString("SubAssort"));
|
||||||
|
details.add(archive_detail);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.log(e.toString());
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release(resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
return details;
|
||||||
|
}
|
||||||
|
public List<Fangshe> getFangshe(String patient_id){
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
String sql = "select ACCESSIONNUMBER,PROF,source_id,FIRSTNAME AS 姓名,PATIENTSEX AS 性别,PATIENTAGE AS 年龄,PATIENT_ID AS 检查号,\n" +
|
||||||
|
"REQUESTINGDEPARTMENT AS 申请科室,BEDID AS 床号,INPATIENT_ID AS 住院号,CLINICAL_ID AS 门诊号,\n" +
|
||||||
|
"REQUESTEDPROCEDUREDESCRIPTION AS 检查部位,EXAMINEDESCRIPTION AS 检查所见,DIAGNOSISPROMPT AS \n" +
|
||||||
|
"诊断提示,CONVERT(varchar, DATEPART(yy,EXAMINEDATE))+'年'+CONVERT(varchar, DATEPART(mm,EXAMINEDATE))+'月'+\n" +
|
||||||
|
"CONVERT(varchar, DATEPART(DD,EXAMINEDATE))+'日'AS 检查日期,CONVERT(varchar, DATEPART(yy,REPORTDATE))+'年'+\n" +
|
||||||
|
"CONVERT(varchar, DATEPART(mm,REPORTDATE))+'月'+CONVERT(varchar, DATEPART(DD,REPORTDATE))+'日' AS 报告日期,\n" +
|
||||||
|
"REPORTDOCTOR AS 报告医生,CONVERT(varchar, DATEPART(yy,AUDITINGDATE))+'年'+CONVERT(varchar, DATEPART(mm,AUDITINGDATE))+'月'+\n" +
|
||||||
|
"CONVERT(varchar, DATEPART(DD,AUDITINGDATE))+'日'AS 审核日期,AUDITINGDOCTOR AS 审核医生 from RIS_STUDIES\n" +
|
||||||
|
"where REPORTDATE is not null and PATIENT_ID=?";
|
||||||
|
Fangshe fangshe = null;
|
||||||
|
List<Fangshe>fangsheList = new ArrayList<>();
|
||||||
|
Object[]parms= new Object[]{patient_id};
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils4.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()){
|
||||||
|
fangshe = new Fangshe();
|
||||||
|
fangshe.setACCESSIONNUMBER (resultSet.getString ("ACCESSIONNUMBER"));
|
||||||
|
fangshe.setProf (convertProf (resultSet.getString ("PROF")));
|
||||||
|
fangshe.setSource_id(resultSet.getString("source_id"));
|
||||||
|
fangshe.setFIRSTNAME(resultSet.getString("姓名"));
|
||||||
|
fangshe.setPATIENTSEX(resultSet.getString("性别"));
|
||||||
|
fangshe.setPATIENTAGE(resultSet.getString("年龄"));
|
||||||
|
fangshe.setPATIENT_ID(resultSet.getString("检查号"));
|
||||||
|
fangshe.setREQUESTINGDEPARTMENT(resultSet.getString("申请科室"));
|
||||||
|
fangshe.setBEDID(resultSet.getString("床号"));
|
||||||
|
fangshe.setINPATIENT_ID(resultSet.getString("门诊号"));
|
||||||
|
fangshe.setCLINICAL_ID(resultSet.getString("住院号"));
|
||||||
|
fangshe.setREQUESTEDPROCEDUREDESCRIPTION(resultSet.getString("检查部位"));
|
||||||
|
fangshe.setEXAMINEDESCRIPTION(resultSet.getString("检查所见"));
|
||||||
|
fangshe.setDIAGNOSISPROMPT(resultSet.getString("诊断提示"));
|
||||||
|
fangshe.setEXAMINEDATE(resultSet.getString("检查日期"));
|
||||||
|
fangshe.setREPORTDATE(resultSet.getString("报告日期"));
|
||||||
|
fangshe.setREPORTDOCTOR(convertName (resultSet.getString("报告医生")));
|
||||||
|
fangshe.setAUDITINGDATE(resultSet.getString("审核日期"));
|
||||||
|
fangshe.setAUDITINGDOCTOR(convertName (resultSet.getString("审核医生")));
|
||||||
|
fangsheList.add(fangshe);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release(resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
return fangsheList;
|
||||||
|
}
|
||||||
|
public void fangsheInfo(){
|
||||||
|
List<Archive_Detail> archive_details = pacsGetPatId ();
|
||||||
|
List<Ris_Study> fansheEntity = getFansheEntity ();
|
||||||
|
for(Ris_Study risStudy:fansheEntity){
|
||||||
|
boolean flag = true;
|
||||||
|
for(Archive_Detail archive_detail:archive_details){
|
||||||
|
if(archive_detail.getSubAssort().equals(risStudy.getSource_id()+"_"+risStudy.getACCESSIONNUMBER())){
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(flag){
|
||||||
|
loadDcmToPdf (risStudy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public List<Archive_Detail> pacsGetPatId(){
|
||||||
|
String sql = "select SubAssort from archive_detail where Source = 'pacs'order by UpLoadDateTime desc";
|
||||||
|
Archive_Detail archive_detail = null;
|
||||||
|
List<Archive_Detail>details = new ArrayList<>();
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()){
|
||||||
|
archive_detail = new Archive_Detail();
|
||||||
|
archive_detail.setSubAssort(resultSet.getString("SubAssort"));
|
||||||
|
details.add(archive_detail);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.log(e.toString());
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release(resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
return details;
|
||||||
|
}
|
||||||
|
//增加病例文件信息表记录
|
||||||
|
public int writeArchiveDetail(Archive_Detail archiveDetail) {
|
||||||
|
String sql = "insert into archive_detail(id,PDF_PATH,MasterID,UpLoadDateTime,AssortID,Source,SubAssort,Title,flag)values(replace(newid(), '-', '')," +
|
||||||
|
"?,?,?,?,?,?,?,?)";
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
Object[] parms = new Object[]{archiveDetail.getPdfPath(), archiveDetail.getMasterId(), archiveDetail.getUploadDateTime(), archiveDetail.getAssortId(), archiveDetail.getSource(), archiveDetail.getSubAssort(), archiveDetail.getTitle(), archiveDetail.getFlag()};
|
||||||
|
int j = 0;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j = statement.executeUpdate();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release(null,statement,connection);
|
||||||
|
}
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
public ArchiveMaster getMasterIdByPa(String jzh){
|
||||||
|
String sql = "select ID,patient_id from archive_master where patient_id = ?";
|
||||||
|
Object[]parms = new Object[]{jzh};
|
||||||
|
ArchiveMaster archiveMaster = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()){
|
||||||
|
archiveMaster = new ArchiveMaster();
|
||||||
|
archiveMaster.setId(resultSet.getString("ID"));
|
||||||
|
archiveMaster.setPatientId(resultSet.getString("patient_id"));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
JDBCUtils.release(resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
return archiveMaster == null ? new ArchiveMaster():archiveMaster;
|
||||||
|
}
|
||||||
|
public ArchiveMaster pacsGetHisId(String sourceId){
|
||||||
|
String sql = "select fvisit_id,fappnote_no from mp.smp_pacs_appnote where fappnote_no = ?";
|
||||||
|
Object[]parms = new Object[]{sourceId};
|
||||||
|
ArchiveMaster archiveMaster = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement preparedStatement = null;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils.getConnection();
|
||||||
|
preparedStatement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
preparedStatement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = preparedStatement.executeQuery();
|
||||||
|
while (resultSet.next()){
|
||||||
|
archiveMaster = new ArchiveMaster();
|
||||||
|
archiveMaster.setPatientId(resultSet.getString("fvisit_id"));
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
} finally {
|
||||||
|
JDBCUtils.release(resultSet,preparedStatement,connection);
|
||||||
|
}
|
||||||
|
return archiveMaster == null ? new ArchiveMaster():archiveMaster;
|
||||||
|
}
|
||||||
|
public void uploadHomePageByPid(String patientId){
|
||||||
|
String sql = "select t.zyh as 住院号,t.jzh as 记账号,t.zycs as 住院次数,t.xm as 姓名,t.xb as 性别,t.ryrq as 入院日期,t.cyrq as 出院日期,t.sfzh as 身份证号,t.rybq as 入院科室,t.dqbq as 出院科室,t.rycw as 入院床位,hp.fdrname as 主管医生 " +
|
||||||
|
"from ndns.zl t left join hthis.p_doctor hp on t.dqys = hp.fdrid where t.jzh = ? order by t.jzh desc";
|
||||||
|
ArchiveMaster master = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
Object[]parms = new Object[]{patientId};
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultSet = statement.executeQuery();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
master = new ArchiveMaster();
|
||||||
|
master.setInpNo(resultSet.getString("住院号").trim());
|
||||||
|
master.setPatientId(resultSet.getString("记账号").trim());
|
||||||
|
master.setVisitId(resultSet.getString("住院次数"));
|
||||||
|
master.setName(resultSet.getString("姓名"));
|
||||||
|
master.setSex(resultSet.getString("性别"));
|
||||||
|
master.setAdmissionDateTime(resultSet.getString("入院日期"));
|
||||||
|
master.setDischargeDateTime(resultSet.getString("出院日期"));
|
||||||
|
master.setIdNo(resultSet.getString("身份证号"));
|
||||||
|
master.setDeptAdmissionTo(resultSet.getString("入院科室"));
|
||||||
|
master.setDeptName(resultSet.getString("出院科室"));
|
||||||
|
master.setDoctorInCharge(resultSet.getString("主管医生"));
|
||||||
|
master.setBedId(resultSet.getString ("入院床位"));
|
||||||
|
if(null == master.getDischargeDateTime()|| master.getDischargeDateTime().isEmpty()){
|
||||||
|
master.setStatus("在院");
|
||||||
|
}else{
|
||||||
|
master.setStatus("归档中");
|
||||||
|
}
|
||||||
|
if ("2".equals(master.getSex())) {
|
||||||
|
master.setSex("女");
|
||||||
|
} else {
|
||||||
|
master.setSex("男");
|
||||||
|
}
|
||||||
|
writeHomeEntity(master);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
JDBCUtils.release(resultSet,statement,connection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public String convertProf(String profName){
|
||||||
|
Map<String,String>profMap = new HashMap<> ();
|
||||||
|
profMap.put ("1","B超检查报告单");
|
||||||
|
profMap.put ("2","CR检查报告单");
|
||||||
|
profMap.put ("3","CT检查报告单");
|
||||||
|
profMap.put ("4","MR检查报告单");
|
||||||
|
profMap.put ("5","放射检查报告单");
|
||||||
|
profMap.put ("6","DR检查报告单");
|
||||||
|
profMap.put ("7","数字胃肠检查报告单");
|
||||||
|
profMap.put ("8","DSA检查小C报告单");
|
||||||
|
profMap.put ("9","DSA检查大C报告单");
|
||||||
|
profMap.put ("20","骨密度检查报告单");
|
||||||
|
profMap.put ("22","胃镜检查报告单");
|
||||||
|
profMap.put ("23","肠镜检查报告单");
|
||||||
|
profMap.put ("24","鼻咽喉镜检查报告单");
|
||||||
|
profMap.put ("25","十二指肠镜检查报告单");
|
||||||
|
profMap.put ("26","TCD检查报告单");
|
||||||
|
profMap.put ("27","支气管检查报告单");
|
||||||
|
profMap.put ("28","肺功能检查报告单");
|
||||||
|
profMap.put ("29","心电图检查报告单");
|
||||||
|
profMap.put ("30","病理检查报告单");
|
||||||
|
profMap.put ("32","超声内镜报告单");
|
||||||
|
profMap.put ("33","胶囊内镜检查报告单");
|
||||||
|
profMap.put ("34","呼气试验检查报告单");
|
||||||
|
profMap.put ("36","液基检查报告单");
|
||||||
|
profMap.put ("37","细胞学检查报告单");
|
||||||
|
profMap.put ("38","HPV检查报告单");
|
||||||
|
profMap.put ("39","皮肤科检查报告单");
|
||||||
|
if(StringUtils.isNoneBlank (profName)){
|
||||||
|
return profMap.get (profName);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
public String convertName(String name){
|
||||||
|
if(StringUtils.isNoneBlank (name)){
|
||||||
|
String[] strings = name.split ("/");
|
||||||
|
if(2 == strings.length){
|
||||||
|
return strings[0];
|
||||||
|
}else {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//新增首页数据
|
||||||
|
int writeHomeEntity(ArchiveMaster archiveMaster) {
|
||||||
|
String sql = "insert into archive_master(id,patient_id,inp_no,visit_id,name,sex,dept_name,discharge_date_time," +
|
||||||
|
"archivestate,admission_date_time,dept_admission_to,doctor_in_charge,id_no,bed_id)values(replace(newid(), '-', ''),?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||||
|
Object[] parms = new Object[]{archiveMaster.getPatientId(), archiveMaster.getInpNo(), archiveMaster.getVisitId(), archiveMaster.getName(), archiveMaster.getSex(), archiveMaster.getDeptName(), archiveMaster.getDischargeDateTime(), archiveMaster.getStatus(), archiveMaster.getAdmissionDateTime(), archiveMaster.getDeptAdmissionTo(), archiveMaster.getDoctorInCharge(), archiveMaster.getIdNo(),archiveMaster.getBedId ()};
|
||||||
|
Connection connection = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
int j = 0;
|
||||||
|
try {
|
||||||
|
connection = JDBCUtils3.getConnection();
|
||||||
|
statement = connection.prepareStatement(sql);
|
||||||
|
if (parms != null && parms.length > 0) {
|
||||||
|
for (int i = 0; i < parms.length; i++) {
|
||||||
|
statement.setObject(i + 1, parms[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j = statement.executeUpdate();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}finally {
|
||||||
|
JDBCUtils.release(null,statement,connection);
|
||||||
|
}
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DCM2PDF( String dcmFile, String toPDFFile) throws Exception
|
||||||
|
{
|
||||||
|
File oFile = null;
|
||||||
|
byte b1 = 37;
|
||||||
|
byte b2 = 80;
|
||||||
|
byte b3 = 68;
|
||||||
|
byte b4 = 70;
|
||||||
|
FileInputStream inputStream = null;
|
||||||
|
String pdfFile = toPDFFile;
|
||||||
|
File tFile = null;
|
||||||
|
FileOutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
oFile = new File(dcmFile);
|
||||||
|
|
||||||
|
if(!(oFile.isFile() && oFile.exists()))
|
||||||
|
{
|
||||||
|
throw new Exception("DCM 文件读取失败=>"+dcmFile);
|
||||||
|
}
|
||||||
|
inputStream = new FileInputStream(oFile);
|
||||||
|
byte[] bs = new byte[(int) oFile.length()];
|
||||||
|
inputStream.read(bs, 0, bs.length);
|
||||||
|
int seekPos = -1;
|
||||||
|
for (int i = 0; i < bs.length; i++) {
|
||||||
|
byte B1 = bs[i];
|
||||||
|
byte B2 = 0;
|
||||||
|
byte B3 = 0;
|
||||||
|
byte B4 = 0;
|
||||||
|
if (i + 1 < bs.length) {
|
||||||
|
B2 = (byte)bs[i + 1];
|
||||||
|
}
|
||||||
|
if (i + 2 < bs.length) {
|
||||||
|
B3 = (byte)bs[i + 2];
|
||||||
|
}
|
||||||
|
if (i + 3 < bs.length) {
|
||||||
|
B4 = (byte)bs[i + 3];
|
||||||
|
}
|
||||||
|
if (b1 == B1 && b2 == B2 && B3 == b3 && b4 == B4) {
|
||||||
|
seekPos = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (seekPos == -1) {
|
||||||
|
System.out.println("未发现2550 4446");
|
||||||
|
throw new Exception("DCM 未读取到标志位=>"+dcmFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
tFile = new File(pdfFile);
|
||||||
|
if(tFile.isFile() && tFile.exists())
|
||||||
|
{
|
||||||
|
throw new Exception("目标文件已经存在=>"+pdfFile);
|
||||||
|
}
|
||||||
|
outputStream = new FileOutputStream(tFile, true);
|
||||||
|
for (int i = seekPos; i < bs.length; i++) {
|
||||||
|
outputStream.write(bs[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
System.out.println("读写出错" + ex.getMessage());
|
||||||
|
throw ex;
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (inputStream != null) {
|
||||||
|
inputStream.close();
|
||||||
|
|
||||||
|
}
|
||||||
|
if (outputStream != null) {
|
||||||
|
outputStream.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public String getXmlPath(String elementName) {
|
||||||
|
Document doc = null;
|
||||||
|
try {
|
||||||
|
doc = new SAXReader ().read(this.getClass().getResourceAsStream("/localPath.xml"));
|
||||||
|
} catch (DocumentException e) {
|
||||||
|
logger.log(e.toString());
|
||||||
|
}
|
||||||
|
Element root = doc.getRootElement();
|
||||||
|
Iterator itr = root.elementIterator();
|
||||||
|
while(itr.hasNext()){
|
||||||
|
Element element = (Element)itr.next();
|
||||||
|
if(elementName.equals(element.getName())){
|
||||||
|
return element.getTextTrim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.xjgs.util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* CLASS_NAME
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author ly
|
||||||
|
* @since 2020/7/15 14:46
|
||||||
|
*/
|
||||||
|
public class FileUtil {
|
||||||
|
public static boolean checkFileWritingOn(String fileName) throws Exception {
|
||||||
|
long oldLen = 0;
|
||||||
|
long newLen = 0;
|
||||||
|
File file = new File(fileName);
|
||||||
|
newLen = file.length();
|
||||||
|
if ((newLen - oldLen) > 0) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.xjgs.util;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 这是一个给fastJSON/jackson准备的一个对象
|
||||||
|
*/
|
||||||
|
public class JsonResult implements Serializable {
|
||||||
|
private Map<String, Object> dataMap = new HashMap<>(3);
|
||||||
|
|
||||||
|
public JsonResult() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return dataMap.get("code").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.dataMap.put("code", code);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return dataMap.get("msg").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.dataMap.put("msg", msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getData() {
|
||||||
|
return dataMap.get("data");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(Object data) {
|
||||||
|
this.dataMap.put("data", data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getDataMap() {
|
||||||
|
return dataMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataMap(Map<String, Object> dataMap) {
|
||||||
|
this.dataMap = dataMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void put(String name, Object value) {
|
||||||
|
this.dataMap.put(name, value);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package com.xjgs.util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class Logger {
|
||||||
|
public void log(String info){
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd");
|
||||||
|
String format = dateFormat.format (new Date());
|
||||||
|
File file = new File (System.getProperty("user.dir")+"\\logs\\"+format);
|
||||||
|
if(!file.isDirectory ()){
|
||||||
|
file.mkdirs ();
|
||||||
|
}
|
||||||
|
OutputStream out = null;
|
||||||
|
try {
|
||||||
|
out = getOutputStream(file.getAbsolutePath ()+"\\log.log");
|
||||||
|
out.write(info.getBytes("utf-8"));
|
||||||
|
out.write("\r\n".getBytes());
|
||||||
|
out.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public OutputStream getOutputStream(String localpath) throws IOException {
|
||||||
|
File file = new File(localpath);
|
||||||
|
if (!file.exists()) {
|
||||||
|
file.createNewFile();
|
||||||
|
return new FileOutputStream(file);
|
||||||
|
} else {
|
||||||
|
return new FileOutputStream(file, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,127 @@
|
|||||||
|
package com.xjgs.util;
|
||||||
|
|
||||||
|
import com.itextpdf.text.Image;
|
||||||
|
import com.itextpdf.text.Rectangle;
|
||||||
|
import com.itextpdf.text.pdf.PdfContentByte;
|
||||||
|
import com.itextpdf.text.pdf.PdfReader;
|
||||||
|
import com.itextpdf.text.pdf.PdfStamper;
|
||||||
|
import com.itextpdf.text.pdf.PdfTemplate;
|
||||||
|
import com.sun.glass.ui.Size;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class PDFHelper {
|
||||||
|
|
||||||
|
|
||||||
|
public static void AddWatermark(String pdfPath, String img1, String img2, String toPath) throws Exception
|
||||||
|
{
|
||||||
|
String sFile = UUID.randomUUID().toString().replace("-", "").replace("{","").replace("}","")+".pdf";
|
||||||
|
File tmpFile = new File(sFile);
|
||||||
|
FileOutputStream outputStream = new FileOutputStream(tmpFile);
|
||||||
|
PdfReader reader = new PdfReader(pdfPath);
|
||||||
|
PdfStamper pdfStamper = new PdfStamper(reader, outputStream);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
float scaleP = 50;
|
||||||
|
|
||||||
|
//这里是加第一个签名
|
||||||
|
Image pImg1 = null;
|
||||||
|
if(StringUtils.isNoneBlank (img1)){
|
||||||
|
pImg1 = Image.getInstance(img1);
|
||||||
|
pImg1.scalePercent(scaleP);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//第二个签名
|
||||||
|
Image pImg2 = null;
|
||||||
|
if(StringUtils.isNoneBlank (img2)){
|
||||||
|
pImg2 = Image.getInstance(img2);
|
||||||
|
pImg2.scalePercent(scaleP);
|
||||||
|
}
|
||||||
|
for (int i = 1; i <= reader.getNumberOfPages(); i++)
|
||||||
|
{
|
||||||
|
Rectangle pageSize = reader.getPageSize(i);
|
||||||
|
PdfContentByte cb = pdfStamper.getOverContent(i);
|
||||||
|
//设置签名位置
|
||||||
|
if(null!=pImg1){
|
||||||
|
Point pt = new Point((int)(pageSize.getWidth() / 2 - pImg1.getScaledWidth() / 2-40), 45);
|
||||||
|
pImg1.setAbsolutePosition((float)pt.getX(), (float)pt.getY());
|
||||||
|
cb.addImage(pImg1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Point pt2 = new Point((int)(pageSize.getWidth() - pImg1.getScaledWidth() / 2-55), 45);
|
||||||
|
pImg2.setAbsolutePosition((float)pt2.getX(), (float)pt2.getY());
|
||||||
|
cb.addImage(pImg2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if(pdfStamper!= null)
|
||||||
|
{
|
||||||
|
pdfStamper.close();
|
||||||
|
}
|
||||||
|
if(outputStream!=null)
|
||||||
|
{
|
||||||
|
outputStream.close();
|
||||||
|
}
|
||||||
|
if(reader !=null) {
|
||||||
|
reader.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//复制文件到toFile
|
||||||
|
copy(sFile, toPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static int bufferSize = 10;
|
||||||
|
public static void copy(String source, String dest) throws Exception {
|
||||||
|
|
||||||
|
File fDest = new File(dest);
|
||||||
|
if(fDest.isFile()&& fDest.exists())
|
||||||
|
{
|
||||||
|
fDest.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
InputStream in = null;
|
||||||
|
OutputStream out = null;
|
||||||
|
try {
|
||||||
|
in = new FileInputStream(new File(source));
|
||||||
|
out = new FileOutputStream(fDest);
|
||||||
|
|
||||||
|
byte[] buffer = new byte[bufferSize];
|
||||||
|
int len;
|
||||||
|
|
||||||
|
while ((len = in.read(buffer)) > 0) {
|
||||||
|
out.write(buffer, 0, len);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
if(in!=null)
|
||||||
|
{
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
if(out!=null)
|
||||||
|
{
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void AddBackImageTemplate(PdfContentByte cb, Size ptSize, String srcImgPath, float x, float y) throws Exception
|
||||||
|
{
|
||||||
|
PdfTemplate pdfTemplate = cb.createTemplate(ptSize.width, ptSize.height);
|
||||||
|
Image pimg = Image.getInstance(srcImgPath);
|
||||||
|
pimg.setAbsolutePosition(0, 0);
|
||||||
|
pimg.scaleToFit(ptSize.width, ptSize.height);
|
||||||
|
pdfTemplate.addImage(pimg);
|
||||||
|
cb.addTemplate(pdfTemplate, x, y);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,219 @@
|
|||||||
|
package com.xjgs.vo;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 病人基本信息类
|
||||||
|
* */
|
||||||
|
public class ArchiveMaster {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String patientId;
|
||||||
|
private String inpNo;
|
||||||
|
private String visitId;
|
||||||
|
private String name;
|
||||||
|
private String sex;
|
||||||
|
private String deptName;
|
||||||
|
private String dischargeDateTime;
|
||||||
|
private String archiveState;
|
||||||
|
private String admissionDateTime;
|
||||||
|
private String deptAdmissionTo;
|
||||||
|
private String checkDoctor;
|
||||||
|
private String checkDatetime;
|
||||||
|
private String checkedDoctor;
|
||||||
|
private String checkedDatetime;
|
||||||
|
private String lockInfo;
|
||||||
|
private String doctorInCharge;
|
||||||
|
private String idNo;
|
||||||
|
private String dischargeDisposition;
|
||||||
|
private String deptCodeLend;
|
||||||
|
private String status;
|
||||||
|
private String bedId;
|
||||||
|
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id == null ? null:id.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getPatientId() {
|
||||||
|
return patientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPatientId(String patientId) {
|
||||||
|
this.patientId = patientId == null ? null : patientId.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getInpNo() {
|
||||||
|
return inpNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInpNo(String inpNo) {
|
||||||
|
this.inpNo = inpNo == null ? null : inpNo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getVisitId() {
|
||||||
|
return visitId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVisitId(String visitId) {
|
||||||
|
this.visitId = visitId == null ? null : visitId.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name == null ? null : name.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getSex() {
|
||||||
|
return sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSex(String sex) {
|
||||||
|
this.sex = sex == null ? null : sex.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getDeptName() {
|
||||||
|
return deptName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeptName(String deptName) {
|
||||||
|
this.deptName = deptName == null ? null : deptName.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getArchiveState() {
|
||||||
|
return archiveState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArchiveState(String archiveState) {
|
||||||
|
this.archiveState = archiveState == null ? null : archiveState.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeptAdmissionTo() {
|
||||||
|
return deptAdmissionTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeptAdmissionTo(String deptAdmissionTo) {
|
||||||
|
this.deptAdmissionTo = deptAdmissionTo == null ? null : deptAdmissionTo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getCheckDoctor() {
|
||||||
|
return checkDoctor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckDoctor(String checkDoctor) {
|
||||||
|
this.checkDoctor = checkDoctor == null ? null : checkDoctor.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCheckedDoctor() {
|
||||||
|
return checkedDoctor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckedDoctor(String checkedDoctor) {
|
||||||
|
this.checkedDoctor = checkedDoctor == null ? null : checkedDoctor.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLockInfo() {
|
||||||
|
return lockInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLockInfo(String lockInfo) {
|
||||||
|
this.lockInfo = lockInfo == null ? null : lockInfo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getDoctorInCharge() {
|
||||||
|
return doctorInCharge;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDoctorInCharge(String doctorInCharge) {
|
||||||
|
this.doctorInCharge = doctorInCharge == null ? null : doctorInCharge.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getIdNo() {
|
||||||
|
return idNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdNo(String idNo) {
|
||||||
|
this.idNo = idNo == null ? null : idNo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getDischargeDisposition() {
|
||||||
|
return dischargeDisposition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDischargeDisposition(String dischargeDisposition) {
|
||||||
|
this.dischargeDisposition = dischargeDisposition == null ? null : dischargeDisposition.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getDeptCodeLend() {
|
||||||
|
return deptCodeLend;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeptCodeLend(String deptCodeLend) {
|
||||||
|
this.deptCodeLend = deptCodeLend == null ? null : deptCodeLend.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDischargeDateTime() {
|
||||||
|
return dischargeDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDischargeDateTime(String dischargeDateTime) {
|
||||||
|
this.dischargeDateTime = dischargeDateTime == null ? null:dischargeDateTime.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAdmissionDateTime() {
|
||||||
|
return admissionDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdmissionDateTime(String admissionDateTime) {
|
||||||
|
this.admissionDateTime = admissionDateTime == null ? null : admissionDateTime.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCheckDatetime() {
|
||||||
|
return checkDatetime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckDatetime(String checkDatetime) {
|
||||||
|
this.checkDatetime = checkDatetime == null ? null : checkDatetime.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCheckedDatetime() {
|
||||||
|
return checkedDatetime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckedDatetime(String checkedDatetime) {
|
||||||
|
this.checkedDatetime = checkedDatetime == null ? null : checkedDatetime.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status == null ? null :status.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBedId() {
|
||||||
|
return bedId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBedId(String bedId) {
|
||||||
|
this.bedId = bedId == null ? null : bedId.trim ();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,112 @@
|
|||||||
|
package com.xjgs.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 病历文件类
|
||||||
|
* */
|
||||||
|
public class Archive_Detail {
|
||||||
|
private String id;
|
||||||
|
private String pdfPath;
|
||||||
|
private String masterId;
|
||||||
|
private Date uploadDateTime;
|
||||||
|
private String assortId;
|
||||||
|
private String source;
|
||||||
|
private String subAssort;
|
||||||
|
private String title;
|
||||||
|
private String flag;
|
||||||
|
private String sys;
|
||||||
|
public Archive_Detail(){}
|
||||||
|
public Archive_Detail(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 String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id == null ? null : id.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPdfPath() {
|
||||||
|
return pdfPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPdfPath(String pdfPath) {
|
||||||
|
this.pdfPath = pdfPath == null ? null : pdfPath.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMasterId() {
|
||||||
|
return masterId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMasterId(String masterId) {
|
||||||
|
this.masterId = masterId == null ? null : masterId.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAssortId() {
|
||||||
|
return assortId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssortId(String assortId) {
|
||||||
|
this.assortId = assortId == null ? null : assortId.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSource(String source) {
|
||||||
|
this.source = source == null ? null : source.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubAssort() {
|
||||||
|
return subAssort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubAssort(String subAssort) {
|
||||||
|
this.subAssort = subAssort == null ? null : subAssort.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title == null ? null : title.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlag() {
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlag(String flag) {
|
||||||
|
this.flag = flag == null ? null : flag.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSys() {
|
||||||
|
return sys;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSys(String sys) {
|
||||||
|
this.sys = sys == null ? null : sys.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUploadDateTime() {
|
||||||
|
return uploadDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUploadDateTime(Date uploadDateTime) {
|
||||||
|
this.uploadDateTime = uploadDateTime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,225 @@
|
|||||||
|
package com.xjgs.vo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pacs 报告类
|
||||||
|
* */
|
||||||
|
public class Fangshe {
|
||||||
|
private String ACCESSIONNUMBER;
|
||||||
|
/** 路径 */
|
||||||
|
private String path;
|
||||||
|
/** 类型 */
|
||||||
|
private String prof;
|
||||||
|
private String source_id;
|
||||||
|
/** 姓名 */
|
||||||
|
private String FIRSTNAME;
|
||||||
|
/** 性别 */
|
||||||
|
private String PATIENTSEX;
|
||||||
|
/** 年龄 */
|
||||||
|
private String PATIENTAGE;
|
||||||
|
/** 检查号 */
|
||||||
|
private String PATIENT_ID;
|
||||||
|
/** 申请科室 */
|
||||||
|
private String REQUESTINGDEPARTMENT;
|
||||||
|
/** 床号 */
|
||||||
|
private String BEDID;
|
||||||
|
/** 住院 号 */
|
||||||
|
private String INPATIENT_ID;
|
||||||
|
/** 门诊号 */
|
||||||
|
private String CLINICAL_ID;
|
||||||
|
/** 检查部位 */
|
||||||
|
private String REQUESTEDPROCEDUREDESCRIPTION;
|
||||||
|
/** 检查所见 */
|
||||||
|
private String EXAMINEDESCRIPTION;
|
||||||
|
/** 诊断提示 */
|
||||||
|
private String DIAGNOSISPROMPT;
|
||||||
|
/** 检查日期 */
|
||||||
|
private String EXAMINEDATE;
|
||||||
|
/** 报告日期 */
|
||||||
|
private String REPORTDATE;
|
||||||
|
/** 报告医生 */
|
||||||
|
private String REPORTDOCTOR;
|
||||||
|
/** 审核日期 */
|
||||||
|
private String AUDITINGDATE;
|
||||||
|
/** 审核医生 */
|
||||||
|
private String AUDITINGDOCTOR;
|
||||||
|
public Fangshe(){
|
||||||
|
}
|
||||||
|
public Fangshe(String FIRSTNAME, String PATIENTSEX, String PATIENTAGE, String PATIENT_ID, String REQUESTINGDEPARTMENT, String BEDID, String INPATIENT_ID, String CLINICAL_ID, String REQUESTEDPROCEDUREDESCRIPTION, String EXAMINEDESCRIPTION, String DIAGNOSISPROMPT, String EXAMINEDATE, String REPORTDATE, String REPORTDOCTOR, String AUDITINGDATE, String AUDITINGDOCTOR) {
|
||||||
|
this.FIRSTNAME = FIRSTNAME;
|
||||||
|
this.PATIENTSEX = PATIENTSEX;
|
||||||
|
this.PATIENTAGE = PATIENTAGE;
|
||||||
|
this.PATIENT_ID = PATIENT_ID;
|
||||||
|
this.REQUESTINGDEPARTMENT = REQUESTINGDEPARTMENT;
|
||||||
|
this.BEDID = BEDID;
|
||||||
|
this.INPATIENT_ID = INPATIENT_ID;
|
||||||
|
this.CLINICAL_ID = CLINICAL_ID;
|
||||||
|
this.REQUESTEDPROCEDUREDESCRIPTION = REQUESTEDPROCEDUREDESCRIPTION;
|
||||||
|
this.EXAMINEDESCRIPTION = EXAMINEDESCRIPTION;
|
||||||
|
this.DIAGNOSISPROMPT = DIAGNOSISPROMPT;
|
||||||
|
this.EXAMINEDATE = EXAMINEDATE;
|
||||||
|
this.REPORTDATE = REPORTDATE;
|
||||||
|
this.REPORTDOCTOR = REPORTDOCTOR;
|
||||||
|
this.AUDITINGDATE = AUDITINGDATE;
|
||||||
|
this.AUDITINGDOCTOR = AUDITINGDOCTOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFIRSTNAME() {
|
||||||
|
return FIRSTNAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFIRSTNAME(String FIRSTNAME) {
|
||||||
|
this.FIRSTNAME = FIRSTNAME == null? " ":FIRSTNAME.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPATIENTSEX() {
|
||||||
|
return PATIENTSEX;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPATIENTSEX(String PATIENTSEX) {
|
||||||
|
this.PATIENTSEX = PATIENTSEX == null?" ":PATIENTSEX.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPATIENTAGE() {
|
||||||
|
return PATIENTAGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPATIENTAGE(String PATIENTAGE) {
|
||||||
|
this.PATIENTAGE = PATIENTAGE == null?" ":PATIENTAGE.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPATIENT_ID() {
|
||||||
|
return PATIENT_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPATIENT_ID(String PATIENT_ID) {
|
||||||
|
this.PATIENT_ID = PATIENT_ID == null?" ":PATIENT_ID.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getREQUESTINGDEPARTMENT() {
|
||||||
|
return REQUESTINGDEPARTMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setREQUESTINGDEPARTMENT(String REQUESTINGDEPARTMENT) {
|
||||||
|
this.REQUESTINGDEPARTMENT = REQUESTINGDEPARTMENT == null?" ":REQUESTINGDEPARTMENT.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBEDID() {
|
||||||
|
return BEDID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBEDID(String BEDID) {
|
||||||
|
this.BEDID = BEDID == null?" ":BEDID.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getINPATIENT_ID() {
|
||||||
|
return INPATIENT_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setINPATIENT_ID(String INPATIENT_ID) {
|
||||||
|
this.INPATIENT_ID = INPATIENT_ID == null?"": INPATIENT_ID.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCLINICAL_ID() {
|
||||||
|
return CLINICAL_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCLINICAL_ID(String CLINICAL_ID) {
|
||||||
|
this.CLINICAL_ID = CLINICAL_ID == null ? " " :CLINICAL_ID.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getREQUESTEDPROCEDUREDESCRIPTION() {
|
||||||
|
return REQUESTEDPROCEDUREDESCRIPTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setREQUESTEDPROCEDUREDESCRIPTION(String REQUESTEDPROCEDUREDESCRIPTION) {
|
||||||
|
this.REQUESTEDPROCEDUREDESCRIPTION = REQUESTEDPROCEDUREDESCRIPTION == null ? " ":REQUESTEDPROCEDUREDESCRIPTION.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEXAMINEDESCRIPTION() {
|
||||||
|
return EXAMINEDESCRIPTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEXAMINEDESCRIPTION(String EXAMINEDESCRIPTION) {
|
||||||
|
this.EXAMINEDESCRIPTION =EXAMINEDESCRIPTION == null? " ":EXAMINEDESCRIPTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDIAGNOSISPROMPT() {
|
||||||
|
return DIAGNOSISPROMPT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDIAGNOSISPROMPT(String DIAGNOSISPROMPT) {
|
||||||
|
this.DIAGNOSISPROMPT = DIAGNOSISPROMPT== null? " ":DIAGNOSISPROMPT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEXAMINEDATE() {
|
||||||
|
return EXAMINEDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEXAMINEDATE(String EXAMINEDATE) {
|
||||||
|
this.EXAMINEDATE = EXAMINEDATE == null ? " " :EXAMINEDATE.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getREPORTDATE() {
|
||||||
|
return REPORTDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setREPORTDATE(String REPORTDATE) {
|
||||||
|
this.REPORTDATE = REPORTDATE == null ? " ":REPORTDATE.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getREPORTDOCTOR() {
|
||||||
|
return REPORTDOCTOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setREPORTDOCTOR(String REPORTDOCTOR) {
|
||||||
|
this.REPORTDOCTOR = REPORTDOCTOR == null ? " ":REPORTDOCTOR.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAUDITINGDATE() {
|
||||||
|
return AUDITINGDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAUDITINGDATE(String AUDITINGDATE) {
|
||||||
|
this.AUDITINGDATE = AUDITINGDATE == null ? " ":AUDITINGDATE.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAUDITINGDOCTOR() {
|
||||||
|
return AUDITINGDOCTOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAUDITINGDOCTOR(String AUDITINGDOCTOR) {
|
||||||
|
this.AUDITINGDOCTOR = AUDITINGDOCTOR == null ? " ":AUDITINGDOCTOR.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSource_id() {
|
||||||
|
return source_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSource_id(String source_id) {
|
||||||
|
this.source_id = source_id == null ? "" : source_id.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProf() {
|
||||||
|
return prof;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProf(String prof) {
|
||||||
|
this.prof = prof;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPath(String path) {
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getACCESSIONNUMBER() {
|
||||||
|
return ACCESSIONNUMBER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setACCESSIONNUMBER(String ACCESSIONNUMBER) {
|
||||||
|
this.ACCESSIONNUMBER = ACCESSIONNUMBER.trim();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,100 @@
|
|||||||
|
package com.xjgs.vo;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName PacsVo
|
||||||
|
* @Description 查询pacs路径实体
|
||||||
|
* @Author linjj
|
||||||
|
* @Date 2023/8/3 10:59
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class PacsVo {
|
||||||
|
|
||||||
|
private String PATIENTID;
|
||||||
|
|
||||||
|
/**文件标题
|
||||||
|
*/
|
||||||
|
private String REQUESTEDPROCEDUREDESCRIPTION;
|
||||||
|
|
||||||
|
private String ACCESSIONNUMBER;
|
||||||
|
|
||||||
|
private String STUDYUID;
|
||||||
|
|
||||||
|
private String REPORTDATE;
|
||||||
|
|
||||||
|
private String SOURCEID;
|
||||||
|
|
||||||
|
/**文件路径
|
||||||
|
*/
|
||||||
|
private String DCMFile;
|
||||||
|
|
||||||
|
/**文件名
|
||||||
|
*/
|
||||||
|
private String DCMName;
|
||||||
|
|
||||||
|
public String getPATIENTID() {
|
||||||
|
return PATIENTID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPATIENTID(String PATIENTID) {
|
||||||
|
this.PATIENTID = PATIENTID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getREQUESTEDPROCEDUREDESCRIPTION() {
|
||||||
|
return REQUESTEDPROCEDUREDESCRIPTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setREQUESTEDPROCEDUREDESCRIPTION(String REQUESTEDPROCEDUREDESCRIPTION) {
|
||||||
|
this.REQUESTEDPROCEDUREDESCRIPTION = REQUESTEDPROCEDUREDESCRIPTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getACCESSIONNUMBER() {
|
||||||
|
return ACCESSIONNUMBER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setACCESSIONNUMBER(String ACCESSIONNUMBER) {
|
||||||
|
this.ACCESSIONNUMBER = ACCESSIONNUMBER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSTUDYUID() {
|
||||||
|
return STUDYUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSTUDYUID(String STUDYUID) {
|
||||||
|
this.STUDYUID = STUDYUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getREPORTDATE() {
|
||||||
|
return REPORTDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setREPORTDATE(String REPORTDATE) {
|
||||||
|
this.REPORTDATE = REPORTDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSOURCEID() {
|
||||||
|
return SOURCEID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSOURCEID(String SOURCEID) {
|
||||||
|
this.SOURCEID = SOURCEID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDCMFile() {
|
||||||
|
return DCMFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDCMFile(String DCMFile) {
|
||||||
|
this.DCMFile = DCMFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDCMName() {
|
||||||
|
return DCMName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDCMName(String DCMName) {
|
||||||
|
this.DCMName = DCMName;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,99 @@
|
|||||||
|
package com.xjgs.vo;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 超声报告类
|
||||||
|
* */
|
||||||
|
public class Ris_Study {
|
||||||
|
private String record_name;
|
||||||
|
private String source_id;
|
||||||
|
private String uuid;
|
||||||
|
private String reportdate;
|
||||||
|
private String patientId;
|
||||||
|
private String inpatientId;
|
||||||
|
private String firstname;
|
||||||
|
private String ACCESSIONNUMBER;
|
||||||
|
|
||||||
|
public String getInpatientId() {
|
||||||
|
return inpatientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInpatientId(String inpatientId) {
|
||||||
|
this.inpatientId = inpatientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String Examinedate;
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
public String getReportdate() {
|
||||||
|
return reportdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReportdate(String reportdate) {
|
||||||
|
this.reportdate = reportdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPatientId() {
|
||||||
|
return patientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPatientId(String patientId) {
|
||||||
|
this.patientId = patientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstname() {
|
||||||
|
return firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstname(String firstname) {
|
||||||
|
this.firstname = firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPath(String path) {
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExaminedate() {
|
||||||
|
return Examinedate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExaminedate(String examinedate) {
|
||||||
|
Examinedate = examinedate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(String uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSource_id() {
|
||||||
|
return source_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSource_id(String source_id) {
|
||||||
|
this.source_id = source_id == null ? "" : source_id.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRecord_name() {
|
||||||
|
return record_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecord_name(String record_name) {
|
||||||
|
this.record_name = record_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getACCESSIONNUMBER() {
|
||||||
|
return ACCESSIONNUMBER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setACCESSIONNUMBER(String ACCESSIONNUMBER) {
|
||||||
|
this.ACCESSIONNUMBER = ACCESSIONNUMBER == null ? "" : ACCESSIONNUMBER.trim();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.xjgs.vo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限系统用户表
|
||||||
|
* */
|
||||||
|
public class User {
|
||||||
|
private String id;
|
||||||
|
private String code;
|
||||||
|
private String name;
|
||||||
|
private String password;
|
||||||
|
private String createDate;
|
||||||
|
private String departmentId;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateDate() {
|
||||||
|
return createDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateDate(String createDate) {
|
||||||
|
this.createDate = createDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDepartmentId() {
|
||||||
|
return departmentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDepartmentId(String departmentId) {
|
||||||
|
this.departmentId = departmentId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
server:
|
||||||
|
port: 8023
|
||||||
|
#数据库
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
# db1: # 数据源1
|
||||||
|
# jdbc-url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=gm_record
|
||||||
|
# username: sa
|
||||||
|
# password: admin123
|
||||||
|
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
# db2: # 数据源2
|
||||||
|
# jdbc-url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=qf_record
|
||||||
|
# username: sa
|
||||||
|
# password: admin123
|
||||||
|
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
db1: # 数据源1
|
||||||
|
jdbc-url: jdbc:sqlserver://10.36.116.108:1433;DatabaseName=emr_record
|
||||||
|
username: sa
|
||||||
|
password: xjgs+docus911
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
db2: # 数据源2
|
||||||
|
jdbc-url: jdbc:sqlserver://10.36.116.100:1433;DatabaseName=pacsdb
|
||||||
|
username: BLGD
|
||||||
|
password: Blgd_123
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
jpa:
|
||||||
|
hibernate:
|
||||||
|
dialect: org.hibernate.dialect.SQLServer2008Dialect
|
||||||
|
hikari:
|
||||||
|
#是否为只读数据库
|
||||||
|
read-only: false
|
||||||
|
# 等待连接池分配链接的最大时长
|
||||||
|
connection-timeout: 60000
|
||||||
|
# 一个链接idle状态最大时长
|
||||||
|
idle-timeout: 60000
|
||||||
|
validation-timeout: 3000
|
||||||
|
# 一个链接最长的生命时长,超时没有被使用则被释放掉 简易比数据库超时时长少 30s
|
||||||
|
max-lifetime: 70000
|
||||||
|
login-timeout: 5
|
||||||
|
# 连接池允许的最大连接数
|
||||||
|
maximum-pool-size: 60
|
||||||
|
# 连接池维护的最小空闲连接数
|
||||||
|
minimum-idle: 10
|
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<c3p0-config>
|
||||||
|
<!--默认配置-->
|
||||||
|
<default-config>
|
||||||
|
<property name="initialPoolSize">10</property>
|
||||||
|
<property name="maxIdleTime">0</property>
|
||||||
|
<property name="maxPoolSize">60</property>
|
||||||
|
<property name="minPoolSize">10</property>
|
||||||
|
<property name="maxStatements">200</property>
|
||||||
|
</default-config>
|
||||||
|
<!--电子病历-->
|
||||||
|
<named-config name="his">
|
||||||
|
<property name="driverClass">oracle.jdbc.driver.OracleDriver</property>
|
||||||
|
<property name="jdbcUrl">jdbc:oracle:thin:@192.168.10.6:1521/orc1</property>
|
||||||
|
<property name="user">pacs</property>
|
||||||
|
<property name="password">pacs</property>
|
||||||
|
</named-config>
|
||||||
|
<!--归档-->
|
||||||
|
<named-config name="sql">
|
||||||
|
<property name="driverClass">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
|
||||||
|
<property name="jdbcUrl">jdbc:sqlserver://10.36.116.108:1433;databaseName=emr_record</property>
|
||||||
|
<property name="user">sa</property>
|
||||||
|
<property name="password">xjgs+docus911</property>
|
||||||
|
</named-config>
|
||||||
|
<!--pacs-->
|
||||||
|
<named-config name="chaosheng">
|
||||||
|
<property name="driverClass">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
|
||||||
|
<property name="jdbcUrl">jdbc:sqlserver://10.36.116.100:1433;databaseName=pacsdb</property>
|
||||||
|
<property name="user">BLGD</property>
|
||||||
|
<property name="password">Blgd_123</property>
|
||||||
|
</named-config>
|
||||||
|
<!--权限系统-->
|
||||||
|
<named-config name="mysql">
|
||||||
|
<property name="driverClass">com.mysql.jdbc.Driver</property>
|
||||||
|
<property name="jdbcUrl">jdbc:mysql://10.36.116.108:3306/power?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true&failOverReadOnly=false</property>
|
||||||
|
<property name="user">root</property>
|
||||||
|
<property name="password">docus@702</property>
|
||||||
|
<property name="initialPoolSize">5</property>
|
||||||
|
<property name="maxIdleTime">0</property>
|
||||||
|
<property name="maxPoolSize">30</property>
|
||||||
|
<property name="minPoolSize">5</property>
|
||||||
|
<property name="maxStatements">200</property>
|
||||||
|
</named-config>
|
||||||
|
</c3p0-config>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CONFIG>
|
||||||
|
<path>f:\pdf</path>
|
||||||
|
<pic>D:\JSWorking\SignedPictures\</pic>
|
||||||
|
</CONFIG>
|
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.xjgs.recordDao.ArchiveDetailMapper" >
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getArchiveMasterList" resultType="com.xjgs.vo.ArchiveMaster">
|
||||||
|
select id,name,inp_no as inpNo,admission_date_time as admissionDateTime,discharge_date_time as dischargeDateTime from archive_master where discharge_date_time BETWEEN #{startTime} AND #{endTime}
|
||||||
|
</select>
|
||||||
|
<select id="pacsGetPatId" resultType="com.xjgs.vo.Archive_Detail">
|
||||||
|
select SubAssort from archive_detail where Source = 'pacs'order by UpLoadDateTime desc
|
||||||
|
</select>
|
||||||
|
<select id="getIdAndJzh" resultType="com.xjgs.vo.ArchiveMaster">
|
||||||
|
select id,patient_id as patientId from archive_master where id=#{ids}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.xjgs.pacsDao.PacsMapper" >
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getPacsPathList" resultType="com.xjgs.vo.PacsVo">
|
||||||
|
SELECT
|
||||||
|
PATIENT_ID,
|
||||||
|
REQUESTEDPROCEDUREDESCRIPTION,
|
||||||
|
ACCESSIONNUMBER,
|
||||||
|
STUDYUID,
|
||||||
|
REPORTDATE,
|
||||||
|
SOURCE_ID,
|
||||||
|
(
|
||||||
|
CAST (
|
||||||
|
DATEPART(YEAR, REPORTDATE) AS nvarchar (4)
|
||||||
|
) + '/' + CAST (
|
||||||
|
DATEPART(MONTH, REPORTDATE) AS nvarchar (2)
|
||||||
|
) + '/' + CAST (
|
||||||
|
DATEPART(DAY, REPORTDATE) AS nvarchar (2)
|
||||||
|
) + '/1.2.277.0.10.' + rtrim(ACCESSIONNUMBER) + '/' + '1.2.277.0.10.' + rtrim(ACCESSIONNUMBER) + '/'
|
||||||
|
) AS 'DCMFile',
|
||||||
|
(
|
||||||
|
'1.2.277.0.10.5.1.4.1.1.88.11.' + rtrim(ACCESSIONNUMBER) + '.dcm'
|
||||||
|
) AS 'DCMName'
|
||||||
|
FROM
|
||||||
|
RIS_STUDIES
|
||||||
|
WHERE
|
||||||
|
(CLINICAL_ID = #{inpNo} or INPATIENT_ID = #{inpNo})
|
||||||
|
and ADMITTINGDATE BETWEEN DATEADD(hh, -6,#{admissionDateTime}) and DATEADD(hh, 6,#{dischargeDateTime})
|
||||||
|
and FIRSTNAME = #{name}
|
||||||
|
and PATIENTTYPE = '住院'
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE configuration
|
||||||
|
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||||
|
<configuration>
|
||||||
|
<settings>
|
||||||
|
<!-- 列自动映射 -->
|
||||||
|
<setting name="mapUnderscoreToCamelCase" value="true"/>
|
||||||
|
<!-- 打印查询语句 -->
|
||||||
|
<!--<setting name="logImpl" value="STDOUT_LOGGING"/>-->
|
||||||
|
</settings>
|
||||||
|
|
||||||
|
<typeAliases>
|
||||||
|
<package name="com.emr.entity"/>
|
||||||
|
</typeAliases>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<!-- com.github.pagehelper为PageHelper类所在包名 -->
|
||||||
|
<plugin interceptor="com.github.pagehelper.PageInterceptor">
|
||||||
|
<!--分页参数合理化-->
|
||||||
|
<property name="reasonable" value="true"/>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
<!-- Oracle的配置 -->
|
||||||
|
<environments default="development">
|
||||||
|
<environment id="development">
|
||||||
|
<transactionManager type="JDBC"></transactionManager>
|
||||||
|
<dataSource type="POOLED">
|
||||||
|
<property name="driver" value="oracle.jdbc.OracleDriver"/>
|
||||||
|
<property name="url" value="jdbc:oracle:thin:@10.6.0.150:1521:jhemr"/>
|
||||||
|
<property name="username" value="jswzh"/>
|
||||||
|
<property name="password" value="jswzh123"/>
|
||||||
|
</dataSource>
|
||||||
|
</environment>
|
||||||
|
</environments>
|
||||||
|
<!-- Oracle的mapper文件扫描 ,单独测试使用-->
|
||||||
|
<mappers>
|
||||||
|
<mapper resource="mapper/FinishedDateTimeMapperTest.xml"></mapper>
|
||||||
|
</mappers>
|
||||||
|
</configuration>
|
Loading…
Reference in New Issue