feat:init and 英德中医院lis任务同步与修复
commit
acacab53df
@ -0,0 +1,35 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
docus-services/docus-services-system1/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
*.log
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
mvnw*
|
||||
*.cmd
|
||||
*.mvn
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
logs*
|
@ -0,0 +1,73 @@
|
||||
<assembly 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/assembly-1.0.0.xsd">
|
||||
|
||||
<id>exe</id>
|
||||
<formats>
|
||||
<format>dir</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
|
||||
<fileSets>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/lib</outputDirectory>
|
||||
<directory>${basedir}/target/lib</directory>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/config</outputDirectory>
|
||||
<directory>${basedir}/target/resources</directory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>*.xml</include>
|
||||
<include>*.yml</include>
|
||||
<include>*.properties</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/dataConfig</outputDirectory>
|
||||
<directory>${basedir}/target/dataConfig</directory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>*.json</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<directory>${basedir}/target/resources/bin</directory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>*.bat</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<directory>${basedir}/target/resources/bin</directory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>*.xml</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<directory>${basedir}</directory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>*.exe</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<!-- 将项目启动jar打包到boot目录中 -->
|
||||
<fileSet>
|
||||
<directory>${basedir}/target</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>${project.build.finalName}.jar</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
@ -0,0 +1,28 @@
|
||||
package com.docus.server;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@SpringBootApplication(scanBasePackages = {"com.docus"})
|
||||
@MapperScan("com.docus.server.**.mapper")
|
||||
@EnableFeignClients(basePackages = {"com.docus"})
|
||||
@EnableAsync
|
||||
public class AppRunBootstrap {
|
||||
public static void main(String[] args) {
|
||||
Properties props = System.getProperties();
|
||||
props.setProperty("org.apache.cxf.stax.allowInsecureParser", "1");
|
||||
props.setProperty("UseSunHttpHandler", "true");
|
||||
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
|
||||
SpringApplication.run(AppRunBootstrap.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.docus.server;
|
||||
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @ProjectName:
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2021/5/7 16:23
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2021/5/7 16:23
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@Configuration
|
||||
public class XxlJobConfig {
|
||||
private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
|
||||
|
||||
@Value("${xxl.job.admin.addresses}")
|
||||
private String adminAddresses;
|
||||
|
||||
@Value("${xxl.job.accessToken}")
|
||||
private String accessToken;
|
||||
|
||||
@Value("${xxl.job.executor.appname}")
|
||||
private String appname;
|
||||
|
||||
@Value("${xxl.job.executor.address}")
|
||||
private String address;
|
||||
|
||||
@Value("${xxl.job.executor.ip}")
|
||||
private String ip;
|
||||
|
||||
@Value("${xxl.job.executor.port}")
|
||||
private int port;
|
||||
|
||||
@Value("${xxl.job.executor.logpath}")
|
||||
private String logPath;
|
||||
|
||||
@Value("${xxl.job.executor.logretentiondays}")
|
||||
private int logRetentionDays;
|
||||
|
||||
|
||||
@Bean
|
||||
public XxlJobSpringExecutor xxlJobExecutor() {
|
||||
logger.info(">>>>>>>>>>> xxl-job config init.");
|
||||
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
||||
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
|
||||
xxlJobSpringExecutor.setAppname(appname);
|
||||
xxlJobSpringExecutor.setAddress(address);
|
||||
xxlJobSpringExecutor.setIp(ip);
|
||||
xxlJobSpringExecutor.setPort(port);
|
||||
xxlJobSpringExecutor.setAccessToken(accessToken);
|
||||
xxlJobSpringExecutor.setLogPath(logPath);
|
||||
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
|
||||
|
||||
return xxlJobSpringExecutor;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.docus.server.archive.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author YongBin Wen
|
||||
* @date 2025/1/16 14:38
|
||||
*/
|
||||
@Getter
|
||||
public enum SysFlagType {
|
||||
/**
|
||||
* 检验报告任务类型
|
||||
*/
|
||||
LIS("6");
|
||||
|
||||
/**
|
||||
* 采集任务类型
|
||||
*/
|
||||
private final String type;
|
||||
|
||||
SysFlagType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.docus.server.archive.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.docus.server.archive.entity.AfCollectTask;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采集任务 表mapper
|
||||
*
|
||||
* @author wyb
|
||||
*/
|
||||
@DS("archive-mysql")
|
||||
public interface AfCollectTaskMapper {
|
||||
|
||||
int saveBatch(@Param("tasks") List<AfCollectTask> collectTasks);
|
||||
|
||||
int update(@Param("tasks") List<AfCollectTask> collectTasks);
|
||||
|
||||
List<AfCollectTask> findByPatientIds(@Param("patientIdList") List<String> patientIdList);
|
||||
|
||||
int cancelTask(@Param("taskIds") List<Long> taskIds);
|
||||
|
||||
int cancelFile(@Param("taskIds") List<Long> taskIds);
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.docus.server.archive.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.docus.server.archive.entity.TBasic;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 患者基础信息表mapper
|
||||
*
|
||||
* @author wyb
|
||||
*/
|
||||
@DS("archive-mysql")
|
||||
public interface TBasicMapper {
|
||||
|
||||
List<TBasic> getByDisDate(@Param("start") String start,@Param("end") String end);
|
||||
|
||||
List<TBasic> getByPatientIds(@Param("patientIdList") List<String> patientIdList);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.docus.server.synclis.controller;
|
||||
|
||||
import com.docus.core.util.Func;
|
||||
import com.docus.infrastructure.web.api.CommonResult;
|
||||
import com.docus.server.archive.entity.TBasic;
|
||||
import com.docus.server.archive.mapper.TBasicMapper;
|
||||
import com.docus.server.synclis.service.LisService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author YongBin Wen
|
||||
* @date 2025/1/16 17:10
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "LIS检验报告视图任务")
|
||||
@RequestMapping("/ydzyylistask")
|
||||
@Slf4j
|
||||
public class LisTaskController {
|
||||
@Resource
|
||||
private LisService lisService;
|
||||
@Resource
|
||||
private TBasicMapper basicMapper;
|
||||
|
||||
@ApiOperation(value = "根据患者主键,同步")
|
||||
@GetMapping("/syncFullLisByPatientIds")
|
||||
public CommonResult<String> syncFullLisByPatientIds(@RequestBody List<String> patientIds){
|
||||
if(Func.isEmpty(patientIds)){
|
||||
return CommonResult.failed("请传入正确的患者病案主键!");
|
||||
}
|
||||
List<TBasic> basicList = basicMapper.getByPatientIds(patientIds);
|
||||
for (TBasic basic : basicList) {
|
||||
lisService.syncFullTask(basic);
|
||||
}
|
||||
|
||||
return CommonResult.success("同步完成!");
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "修订门诊任务和文件")
|
||||
@GetMapping("/revisionMzTaskAndFile")
|
||||
public CommonResult<String> revisionMzTaskAndFile() {
|
||||
String start = "2022-10-01 00:00:00";
|
||||
String end = Func.formatDateTime(new Date());
|
||||
List<TBasic> tbasics = basicMapper.getByDisDate(start, end);
|
||||
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 修订门诊任务和文件。出院时间:{} 至 {} 共 {} 条数据!", start, end, tbasics.size());
|
||||
for (TBasic tbasic : tbasics) {
|
||||
lisService.revisionMzTaskAndFile(tbasic);
|
||||
}
|
||||
return CommonResult.success("修订完成!");
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.docus.server.synclis.converter;
|
||||
|
||||
import com.docus.core.util.Func;
|
||||
import com.docus.server.archive.entity.AfCollectTask;
|
||||
import com.docus.server.archive.entity.TBasic;
|
||||
import com.docus.server.archive.enums.SysFlagType;
|
||||
import com.docus.server.synclis.entity.LisView;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @author YongBin Wen
|
||||
* @date 2025/1/16 14:33
|
||||
*/
|
||||
public class LisViewConverter {
|
||||
public static AfCollectTask convertTask(LisView view, TBasic basic) {
|
||||
if (view == null) {
|
||||
return null;
|
||||
}
|
||||
AfCollectTask task = new AfCollectTask();
|
||||
task.setPatientId(basic.getPatientId());
|
||||
task.setSysflag(SysFlagType.LIS.getType());
|
||||
task.setSyncTime(new Date());
|
||||
task.setState("0");
|
||||
task.setPresult("");
|
||||
task.setC1(view.getPatientId());
|
||||
task.setC2(view.getLabNum());
|
||||
task.setC3(view.getName());
|
||||
task.setC4(view.getLabNum());
|
||||
task.setC5(basic.getJzh());
|
||||
task.setC6(view.getCheckName());
|
||||
task.setC7(view.getPatSource());
|
||||
String pattern1 = "yyyy-MM-dd";
|
||||
String pattern2 = "yyyy-MM-dd HH:mm:ss";
|
||||
task.setT1(pattern1.length() == view.getReqDate().length() ? Func.parseDate(view.getAuditTime(), pattern1) : Func.parseDate(view.getAuditTime(), pattern2));
|
||||
task.setT2(Func.parseDate(view.getAuditTime(), pattern2));
|
||||
return task;
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
|
||||
|
||||
WinSW.exe status|findstr NonExistent && winsw install
|
||||
|
||||
WinSW.exe status|findstr Stopped && winsw start
|
@ -0,0 +1,33 @@
|
||||
@echo off
|
||||
|
||||
for /f "delims=" %%t in ('winsw.exe status') do set str=%%t
|
||||
echo %str%
|
||||
|
||||
|
||||
|
||||
if %str%==Started (
|
||||
echo "restart....."
|
||||
winsw stop
|
||||
PING 127.0.0.1 -n 10 -w 30000 >NUL
|
||||
winsw start
|
||||
)
|
||||
|
||||
|
||||
|
||||
if %str%==Stopped (
|
||||
echo "start....."
|
||||
winsw start
|
||||
)
|
||||
|
||||
|
||||
if %str%==NonExistent (
|
||||
echo "deploy and start....."
|
||||
winsw install
|
||||
winsw start
|
||||
echo c
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,23 @@
|
||||
@echo off
|
||||
|
||||
set parentDir=%1
|
||||
echo %parentDir%
|
||||
if ""==%parentDir% set parentDir=d:\webroot
|
||||
|
||||
set deployDir=%parentDir%\@project.artifactId@
|
||||
|
||||
set curr_file=%cd%
|
||||
cd /d %deployDir%
|
||||
call stop.bat
|
||||
sc query @project.artifactId@ |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul
|
||||
cd %curr_file%
|
||||
rd/s/q %deployDir%\lib
|
||||
rd/s/q %deployDir%\dataConfig
|
||||
rd/s/q %deployDir%\config
|
||||
del /s/q %deployDir%\*.jar
|
||||
xcopy /Y/E/I * %deployDir%
|
||||
|
||||
cd /d %deployDir%
|
||||
call auto.bat
|
||||
cd %curr_file%
|
||||
|
@ -0,0 +1,21 @@
|
||||
set java_opts=-Xms512m -Xmx512m
|
||||
set key="java_opts"
|
||||
|
||||
|
||||
rem 文件不存在,就跳过
|
||||
if not exist java-ops.ini goto end
|
||||
|
||||
for /f "tokens=1,2 delims==" %%i in (java-ops.ini) do (
|
||||
if "%%i"==%key% set java_opts=%%j)
|
||||
echo java_opts is : %java_opts%
|
||||
|
||||
:end
|
||||
|
||||
rem 启动java
|
||||
|
||||
java %java_opts% -Dfile.encoding=utf-8 -jar -Dspring.profiles.active=@profile.name@ -Dloader.path=config,lib @project.build.finalName@.jar
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
@echo off
|
||||
|
||||
for /f "delims=" %%t in ('winsw.exe status') do set str=%%t
|
||||
echo %str%
|
||||
|
||||
|
||||
|
||||
if %str%==Started (
|
||||
winsw stop
|
||||
@echo wait program stop .....
|
||||
PING 127.0.0.1 -n 30 -w 10000 >NUL
|
||||
)
|
||||
|
@ -0,0 +1,19 @@
|
||||
@echo off
|
||||
|
||||
set deployDir=%1\docus-task-ydzyy
|
||||
if %deployDir%=="" set deployDir=d:\webroot\docus-task-ydzyy
|
||||
|
||||
set curr_file=%cd%
|
||||
cd /d %deployDir%
|
||||
call stop.bat
|
||||
cd %curr_file%
|
||||
sc query docus-backup-sys |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul
|
||||
rd/s/q %deployDir%\lib
|
||||
rd/s/q %deployDir%\dataConfig
|
||||
rd/s/q %deployDir%\config
|
||||
del /s/q %deployDir%\*.jar
|
||||
xcopy /Y/E/I * %deployDir%
|
||||
|
||||
cd /d %deployDir%
|
||||
call install.bat
|
||||
|
@ -0,0 +1,8 @@
|
||||
<service>
|
||||
<id>docus-task-ydzyy</id>
|
||||
<name>生产-嘉时病案无纸化-英德中医院视图任务同步</name>
|
||||
<description>生产-嘉时病案无纸化-英德中医院视图任务同步</description>
|
||||
<startmode>Automatic</startmode>
|
||||
<executable>%BASE%\start.bat</executable>
|
||||
<log mode="none"></log>
|
||||
</service>
|
@ -0,0 +1,2 @@
|
||||
# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger
|
||||
log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
|
@ -0,0 +1,54 @@
|
||||
<?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.docus.server.archive.mapper.AfCollectTaskMapper">
|
||||
<insert id="saveBatch">
|
||||
INSERT INTO docus_archivefile.af_collect_task
|
||||
(id, patient_id, af_archive_detail_id, sysflag,state, sync_time, create_time, remark, pResult, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, T1, T2)
|
||||
VALUES
|
||||
<foreach collection="tasks" separator="," item="task">
|
||||
(
|
||||
#{task.id}, #{task.patientId},0, #{task.sysflag}, '0', #{task.syncTime}, #{task.createTime}, '', '',
|
||||
#{task.c1}, #{task.c2}, #{task.c3}, #{task.c4}, #{task.c5}, #{task.c6}, #{task.c7}, #{task.c8}, #{task.c9}, #{task.c10}, #{task.t1}, #{task.t2}
|
||||
)
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
<foreach collection="tasks" item="task" separator=";" >
|
||||
UPDATE docus_archivefile.af_collect_task
|
||||
SET state=#{task.state}, sync_time=#{task.syncTime}, pResult=#{task.presult},
|
||||
C1=#{task.c1}, C2=#{task.c2}, C3=#{task.c3}, C4=#{task.c4}, C5=#{task.c5}, C6=#{task.c6}, C7=#{task.c7}, C8=#{task.c8}, C9=#{task.c9}, C10=#{task.c10},
|
||||
T1=#{task.t1}, T2=#{task.t2}
|
||||
WHERE id=#{task.id}
|
||||
</foreach>
|
||||
|
||||
</update>
|
||||
<update id="cancelTask">
|
||||
UPDATE `docus_archivefile`.`af_collect_task` set state='4'
|
||||
WHERE id IN
|
||||
<foreach collection="taskIds" item="taskId" open="(" close=")" separator=",">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="cancelFile">
|
||||
UPDATE `docus_archivefile`.`t_scan_assort` SET is_del = '1'
|
||||
WHERE taskid IN
|
||||
<foreach collection="taskIds" item="taskId" open="(" close=")" separator=",">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="findByPatientIds" resultType="com.docus.server.archive.entity.AfCollectTask">
|
||||
SELECT *
|
||||
FROM
|
||||
`docus_archivefile`.`af_collect_task`
|
||||
WHERE
|
||||
patient_id IN
|
||||
<foreach collection="patientIdList" item="patientId" separator="," open="(" close=")">
|
||||
#{patientId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,133 @@
|
||||
<?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.docus.server.synclis.mapper.LisViewMapper">
|
||||
|
||||
<select id="getZyDataFromView" resultType="com.docus.server.synclis.entity.LisView">
|
||||
SELECT
|
||||
patient_id AS patientId,
|
||||
lab_num AS labNum,
|
||||
name,
|
||||
hst_num AS hstNum,
|
||||
req_num AS reqNum,
|
||||
req_date AS reqDate,
|
||||
audit_time AS auditTime,
|
||||
CheckName AS checkName,
|
||||
PatSource AS patSource,
|
||||
IDCARD AS idCard
|
||||
FROM dbo.v_LISReport_YDZYView
|
||||
WHERE PatSource = '住院'
|
||||
AND hst_num = #{inpatientNo}
|
||||
AND Audit_time != ''
|
||||
AND Audit_time IS NOT NULL
|
||||
AND Audit_time >= '2022-10-01'
|
||||
AND req_date >= #{admissDate}
|
||||
AND req_date <= #{disDate}
|
||||
ORDER BY audit_time DESC
|
||||
</select>
|
||||
<select id="getMzDataFromView" resultType="com.docus.server.synclis.entity.LisView">
|
||||
SELECT
|
||||
patient_id AS patientId,
|
||||
lab_num AS labNum,
|
||||
name,
|
||||
hst_num AS hstNum,
|
||||
req_num AS reqNum,
|
||||
req_date AS reqDate,
|
||||
audit_time AS auditTime,
|
||||
CheckName AS checkName,
|
||||
PatSource AS patSource,
|
||||
IDCARD AS idCard
|
||||
FROM hylisproc.dbo.v_LISReport_YDZYView
|
||||
WHERE PatSource IN ('门诊','急诊')
|
||||
AND IDCARD =#{idCard}
|
||||
AND IDCARD != ''
|
||||
AND IDCARD IS NOT NULL
|
||||
AND Audit_time != ''
|
||||
AND Audit_time IS NOT NULL
|
||||
AND Audit_time >= '2022-10-01'
|
||||
AND req_date >= #{startDate}
|
||||
AND req_date <= #{endDate}
|
||||
ORDER BY audit_time DESC
|
||||
</select>
|
||||
<select id="getFullZyData" resultType="com.docus.server.synclis.entity.LisView">
|
||||
SELECT
|
||||
patient_id AS patientId,
|
||||
lab_num AS labNum,
|
||||
name,
|
||||
hst_num AS hstNum,
|
||||
req_num AS reqNum,
|
||||
req_date AS reqDate,
|
||||
audit_time AS auditTime,
|
||||
CheckName AS checkName,
|
||||
PatSource AS patSource,
|
||||
IDCARD AS idCard
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a.patient_id,
|
||||
a.lab_num,b.name,
|
||||
a.hst_num,
|
||||
ISNULL(a.req_num,'') AS req_num,
|
||||
a.req_date,
|
||||
CONVERT(VARCHAR(19),a.audit_time,120) AS audit_time,
|
||||
dbo.fnGetChkTypeNameByLabNum(a.lab_num) AS CheckName,
|
||||
ISNULL(c.name,'') AS PatSource,
|
||||
ISNULL(b.id_card,'') as IDCARD
|
||||
FROM hylisdb..patient_register a WITH(NOLOCK)
|
||||
JOIN hylisdb..patient_baseinfo b WITH(NOLOCK) ON a.patient_id=b.patient_id
|
||||
JOIN hylisdb..ill_type c ON a.send_type=c.type_id
|
||||
WHERE
|
||||
a.hst_num = #{inpatientNo}
|
||||
AND c.name = '住院'
|
||||
AND a.req_date >= #{admissDate}
|
||||
AND a.req_date <= #{disDate}
|
||||
AND a.proc_flag = '8'
|
||||
) temp
|
||||
WHERE
|
||||
Audit_time != ''
|
||||
AND Audit_time IS NOT NULL
|
||||
AND Audit_time >= '2022-10-01'
|
||||
ORDER BY audit_time DESC
|
||||
</select>
|
||||
<select id="getFullMzData" resultType="com.docus.server.synclis.entity.LisView">
|
||||
SELECT
|
||||
patient_id AS patientId,
|
||||
lab_num AS labNum,
|
||||
name,
|
||||
hst_num AS hstNum,
|
||||
req_num AS reqNum,
|
||||
req_date AS reqDate,
|
||||
audit_time AS auditTime,
|
||||
CheckName AS checkName,
|
||||
PatSource AS patSource,
|
||||
IDCARD AS idCard
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a.patient_id,
|
||||
a.lab_num,b.name,
|
||||
a.hst_num,
|
||||
ISNULL(a.req_num,'') AS req_num,
|
||||
a.req_date,
|
||||
CONVERT(VARCHAR(19),a.audit_time,120) AS audit_time,
|
||||
dbo.fnGetChkTypeNameByLabNum(a.lab_num) AS CheckName,
|
||||
ISNULL(c.name,'') AS PatSource,
|
||||
ISNULL(b.id_card,'') as IDCARD
|
||||
FROM hylisdb..patient_register a WITH(NOLOCK)
|
||||
JOIN hylisdb..patient_baseinfo b WITH(NOLOCK) ON a.patient_id=b.patient_id
|
||||
JOIN hylisdb..ill_type c ON a.send_type=c.type_id
|
||||
WHERE
|
||||
b.id_card = #{idCard}
|
||||
AND c.name IN ('门诊','急诊')
|
||||
AND a.req_date >= #{startDate}
|
||||
AND a.req_date <= #{endDate}
|
||||
AND a.proc_flag = '8'
|
||||
) temp
|
||||
WHERE
|
||||
Audit_time != ''
|
||||
AND Audit_time IS NOT NULL
|
||||
AND Audit_time >= '2022-10-01'
|
||||
ORDER BY audit_time DESC
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,43 @@
|
||||
<?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.docus.server.archive.mapper.TBasicMapper">
|
||||
<sql id="basicInfoColumns">
|
||||
patient_id AS patientId,
|
||||
admiss_times AS admissTimes,
|
||||
inpatient_no AS inpatientNo,
|
||||
admiss_id AS admissId,
|
||||
admiss_date AS admissDate,
|
||||
dis_date AS disDate,
|
||||
admiss_dept_name AS admissDeptName,
|
||||
dis_dept_name AS disDeptName ,
|
||||
jzh,
|
||||
name,
|
||||
id_card AS idCard
|
||||
</sql>
|
||||
<select id="getByDisDate" resultType="com.docus.server.archive.entity.TBasic">
|
||||
SELECT
|
||||
<include refid="basicInfoColumns"></include>
|
||||
FROM
|
||||
docus_medicalrecord.t_basic
|
||||
WHERE
|
||||
dis_date BETWEEN #{start} AND #{end}
|
||||
AND admiss_date IS NOT NULL
|
||||
AND is_cancel = 0
|
||||
ORDER BY dis_date DESC
|
||||
</select>
|
||||
<select id="getByPatientIds" resultType="com.docus.server.archive.entity.TBasic">
|
||||
SELECT
|
||||
<include refid="basicInfoColumns"></include>
|
||||
FROM
|
||||
docus_medicalrecord.t_basic
|
||||
WHERE
|
||||
patient_id IN
|
||||
<foreach collection="patientIdList" item="patientId" separator="," open="(" close=")">
|
||||
#{patientId}
|
||||
</foreach>
|
||||
ORDER BY dis_date DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue