初始化

master
linjj 1 year ago
parent 8b46d8b61b
commit ab8c13e99d

@ -4,10 +4,16 @@
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>
<groupId>his</groupId>
<artifactId>his</artifactId>
<groupId>com.xjgs</groupId>
<artifactId>hisOneDay</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>
<dependency>
<groupId>junit</groupId>
@ -29,11 +35,6 @@
<artifactId>xdb</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>xmlparserv2</artifactId>
<version>19.3.0.0</version>
</dependency>
<!--WS-->
<dependency>
<groupId>org.apache.cxf</groupId>
@ -67,6 +68,11 @@
<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>
@ -88,12 +94,37 @@
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!--quartz-->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-jobs</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<optional>true</optional>
</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>
@ -112,55 +143,14 @@
<artifactId>commons-codec</artifactId>
<version>1.13</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<!--quartz-->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-jobs</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<build>
<plugins>
<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>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
@ -185,8 +175,8 @@
</execution>
</executions>
</plugin>
</plugins>
<resources>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
@ -194,6 +184,6 @@
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</build>
</resources>
</build>
</project>

@ -1,54 +1,28 @@
package com.xjgs;
import com.xjgs.service.HisJob;
import com.xjgs.service.HisService;
import com.xjgs.service.XmlParseToVO;
import com.xjgs.util.Logger;
import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class Application1 {
private static Logger logger = new Logger();
static ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = null;
public static void main(String[] args) {
try {
new Application1().quartzHis();//同步电子病历与护理每5分钟同步一次
Application1 application1 = new Application1();
application1.quartzHis();//同步电子病历与护理每5分钟同步一次
} catch (InterruptedException e) {
logger.log(e.toString());
}
final HisService hisService = new HisService ();
final XmlParseToVO xmlParseToVO = new XmlParseToVO();//首页采集
scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(9);
scheduledThreadPoolExecutor.scheduleWithFixedDelay(() -> {
hisService.uploadHomePage();//同步基本信息
},0,5,TimeUnit.MINUTES);//每五分钟同步一次
scheduledThreadPoolExecutor.scheduleWithFixedDelay(() -> {
hisService.uploadIndex();//同步索引
},2,10, TimeUnit.MINUTES);//每20分钟同步一次
scheduledThreadPoolExecutor.scheduleWithFixedDelay(() -> {
xmlParseToVO.getId();//首页解析
},1,30,TimeUnit.SECONDS);//每30秒同步一次
scheduledThreadPoolExecutor.scheduleWithFixedDelay(() -> {
hisService.uploadUserInfo ();//用戶
},3,30,TimeUnit.MINUTES);
scheduledThreadPoolExecutor.scheduleWithFixedDelay(() -> {
hisService.uploadDeptInfo ();//科室
},4,10,TimeUnit.MINUTES);
scheduledThreadPoolExecutor.scheduleWithFixedDelay(() -> {
hisService.uploadDeath();//更新死亡字段
},5,10,TimeUnit.MINUTES);
scheduledThreadPoolExecutor.scheduleWithFixedDelay(() -> {
hisService.dropSzyh();//删除留观号
},6,6,TimeUnit.HOURS);
}
public void quartzHis() throws InterruptedException{
try {
//创建任务器:定义任务细节
JobDetail jobDetail = JobBuilder.newJob(HisJob.class).withIdentity("job1", "group1").build();
ScheduleBuilder scheduleBuilder = SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(300).repeatForever();
ScheduleBuilder scheduleBuilder = SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(86400).repeatForever();
//定义触发器
Trigger trigger=TriggerBuilder.newTrigger().withIdentity("simpleTrigger", "simpleTriggerGroup")
.withSchedule(scheduleBuilder).startNow().build();

@ -0,0 +1,50 @@
//package com.xjgs.controller;
//
//import com.xjgs.exception.BusinessException;
//import com.xjgs.exception.ExceptionCode;
//import com.xjgs.service.HisService;
//import com.xjgs.util.JsonResult;
//import com.xjgs.util.Logger;
//import org.eclipse.jetty.util.StringUtil;
//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.Map;
//
///**
// * @ClassName MakeUpHis
// * @Description 补偿采集的相关接口
// * @Author linjj
// * @Date 2024/2/23 11:27
// * @Version 1.0
// */
//
//@Controller
//@ResponseBody
//@RequestMapping("/makeUp")
//public class MakeUpHis {
//
// private static Logger logger = new Logger();
//
// /**
// * @description: his按需采集
// * @params: patientId
// * @author linjj
// * @date: 2024/2/23 11:34
// */
// @GetMapping("/makeUpByHis")
// public Map<String, Object> makeUpByNeed(String patientId) throws BusinessException {
// logger.log("开始补偿");
// // 声明his操作类
// HisService hisService=new HisService();
// //调用接口
// hisService.hisInfnByPatientId(patientId);
// // 声明返回
// JsonResult jsonResult = new JsonResult();
// jsonResult.setCode("200");
// jsonResult.setMsg("调用成功,请稍等下载文件");
// return jsonResult.getDataMap();
// }
//}

@ -0,0 +1,26 @@
package com.xjgs.exception;
/**
* @description:
* @author: ChenJ
* @date: 2022/5/9 17:29
* @param:
* @return:
**/
public class BusinessException extends Exception {
/**
* ,codemsg
*/
private final ExceptionCode exceptionCode;
public ExceptionCode getExceptionCode() {
return exceptionCode;
}
public BusinessException(ExceptionCode exceptionCode) {
super(exceptionCode.getMessage());
this.exceptionCode = exceptionCode;
}
}

@ -0,0 +1,30 @@
package com.xjgs.exception;
/**
* @description:
* @author: ChenJ
* @date: 2022/5/9 17:31
**/
public enum ExceptionCode {
/**
*
*/
WRONG_PARAMS("参数不对", 1001),
;
private final String message;
private final Integer code;
ExceptionCode(String message, int code) {
this.message = message;
this.code = code;
}
public String getMessage() {
return message;
}
public Integer getCode() {
return code;
}
}

@ -1,13 +1,19 @@
package com.xjgs.service;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@Slf4j
public class HisJob implements Job {
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
HisService hisService = new HisService();
hisService.hisInfo();
}catch (Exception e){
log.info(e.toString());
}
}
}

File diff suppressed because it is too large Load Diff

@ -1,836 +0,0 @@
package com.xjgs.service;
import com.google.gson.Gson;
import com.xjgs.dao.BaseDao;
import com.xjgs.dao.JDBCUtils;
import com.xjgs.dao.JDBCUtils3;
import com.xjgs.util.Logger;
import com.xjgs.vo.*;
import com.xjgs.xmlParseVO.XmlFirstPage;
import lombok.extern.slf4j.Slf4j;
import oracle.jdbc.driver.OracleResultSet;
import oracle.sql.OPAQUE;
import oracle.xdb.XMLType;
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.eclipse.jetty.util.ajax.JSON;
import org.junit.Test;
import java.io.*;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Slf4j
public class XmlParseToVO {
private static Logger logger = new Logger();
@Test
public void getId(){
String sql = "select dept_name,patient_id from archive_master where archivestate='已归档' and patient_id not in(select patient_id from commomtable2)";
Connection connection = null;
PreparedStatement statement = null;
ArchiveMaster archiveMaster = null;
List<ArchiveMaster>archiveMasterList = new ArrayList<ArchiveMaster> ();
ResultSet resultSet = null;
try {
connection = JDBCUtils3.getConnection();
statement = connection.prepareStatement(sql);
resultSet = statement.executeQuery();
while (resultSet.next()){
archiveMaster = new ArchiveMaster();
archiveMaster.setPatientId(resultSet.getString("patient_id"));
archiveMaster.setDeptName (resultSet.getString ("dept_name"));
archiveMasterList.add(archiveMaster);
}
}catch (Exception e){
logger.log(e.toString());
}finally {
JDBCUtils.release(resultSet,statement,connection);
}
for(ArchiveMaster archiveMaster1:archiveMasterList){
if((!archiveMaster1.getDeptName ().equals ("13"))&&(!archiveMaster1.getDeptName ().equals ("17"))&&(!archiveMaster1.getDeptName ().equals ("1702"))){
getMasterRecord(archiveMaster1);
}else{
Zl (archiveMaster1);
}
}
}
public void Zl(ArchiveMaster archiveMaster1){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss");
ArchiveMaster masterInfo = getMasterInfo (archiveMaster1);
CommomVo commomVo = new CommomVo ();
commomVo.setPatientId (getMasterId (masterInfo.getPatientId ()).getId ());
commomVo.setInpatientNo (masterInfo.getInpNo ());
commomVo.setAdmissId (masterInfo.getInpNo ());
commomVo.setName (masterInfo.getName ());
commomVo.setSex (masterInfo.getSex ());
if(StringUtils.isNoneBlank(masterInfo.getVisitId())){
commomVo.setAdmissTimes (Short.parseShort (masterInfo.getVisitId ()));
}
commomVo.setDisDept (masterInfo.getDeptName ());
try {
commomVo.setDisDate (simpleDateFormat.parse (masterInfo.getDischargeDateTime ()));
commomVo.setAdmissDate (simpleDateFormat.parse (masterInfo.getAdmissionDateTime ()));
commomVo.setAdmissDept (masterInfo.getDeptAdmissionTo ());
commomVo.setAttending (masterInfo.getDoctorInCharge ());
int i = insertArchive (commomVo);
int j =insertArchive1 (commomVo);
if(i==1 && j==1){
addCommom2 (masterInfo.getPatientId ());
}
} catch (Exception e) {
e.printStackTrace ();
}
}
public int insertArchive(CommomVo commomVo){
int j = 0;
String sql = "insert into commomtable(patient_id,inpatient_no,admiss_id,name,sex,dis_dept,dis_date,admiss_date,attending,is_oper,admiss_times)values(?,?,?,?,?,?,?,?,?,?,?)";
Object[]parms = new Object[]{commomVo.getPatientId (),commomVo.getInpatientNo (),commomVo.getAdmissId (),commomVo.getName (),commomVo.getSex (),commomVo.getDisDept (),
commomVo.getDisDate (),commomVo.getAdmissDate (),commomVo.getAttending (),"无",commomVo.getAdmissTimes ()};
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++) {
if(parms[i] instanceof Date) {
parms[i] = new Timestamp(((Date) parms[i]).getTime());
}
statement.setObject(i + 1, parms[i]);
}
}
j=statement.executeUpdate ();
}catch (Exception ex){
logger.log(ex.toString());
}finally {
JDBCUtils.release (null,statement,connection);
}
return j;
}
public int insertArchive1(CommomVo commomVo){
int j = 0;
String sql = "insert into commomtable1(patient_id,admiss_dept,is_medicine)values(?,?,?)";
Object[]parms = new Object[]{commomVo.getPatientId (),commomVo.getAdmissDept (),"无"};
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]);
}
}
j=statement.executeUpdate ();
}catch (Exception ex){
logger.log(ex.toString());
}finally {
JDBCUtils.release (null,statement,connection);
}
return j;
}
public ArchiveMaster getMasterInfo(ArchiveMaster archiveMaster){
String sql = "select am.patient_id,am.inp_no,am.visit_id,am.name,am.sex,ed.Name cyks,am.discharge_date_time,am.admission_date_time\n" +
",ed1.Name ryks,am.DOCTOR_IN_CHARGE from \n" +
"archive_master am join emr_dictionary ed \n" +
"on am.dept_name = ed.code join \n" +
"emr_dictionary ed1 on am.dept_admission_to = ed1.code where am.patient_id = ? and ed.parent_id=1 and ed1.parent_id=1";
Object[]parms = new Object[]{archiveMaster.getPatientId ()};
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
ArchiveMaster archiveMaster1 = new ArchiveMaster ();
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 ()){
archiveMaster1.setPatientId (resultSet.getString ("patient_id"));
archiveMaster1.setInpNo (resultSet.getString ("inp_no"));
archiveMaster1.setVisitId (resultSet.getString ("visit_id"));
archiveMaster1.setName (resultSet.getString ("name"));
archiveMaster1.setSex (resultSet.getString ("sex"));
archiveMaster1.setDeptName (resultSet.getString ("cyks"));
archiveMaster1.setDischargeDateTime (resultSet.getString ("discharge_date_time"));
archiveMaster1.setAdmissionDateTime (resultSet.getString ("admission_date_time"));
archiveMaster1.setDeptAdmissionTo (resultSet.getString ("ryks"));
archiveMaster1.setDoctorInCharge (resultSet.getString ("DOCTOR_IN_CHARGE"));
}
}catch (Exception ex){
logger.log(ex.toString());
}finally {
JDBCUtils.release (resultSet,statement,connection);
}
return archiveMaster1;
}
public void getMasterRecord(ArchiveMaster archiveMaster){
BaseDao baseDao = new BaseDao();//不能改为连接池,否则有类型转换错误
Connection connection = null;
PreparedStatement statement = null;
OracleResultSet resultSet = null;
String sql = "select t.fcontent 病案首页内容,t.fpatno 记账号 from ht.bl_tbs_record t where " +
"t.fentryno ='025' and t.fvalid ='1' and fpatno=?";
Object[]parms = new Object[]{archiveMaster.getPatientId ()};
MasterContentVO masterContentVO = new MasterContentVO ();
try {
connection = baseDao.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 = (OracleResultSet)statement.executeQuery();
while (resultSet.next()){
OPAQUE opaque = resultSet.getOPAQUE("病案首页内容");
XMLType xml = XMLType.createXML(opaque);
masterContentVO.setContent(xml.getStringVal());
masterContentVO.setPatientId(resultSet.getString("记账号"));
}
} catch (Exception e) {
logger.log(e.toString());
}finally {
JDBCUtils.release(resultSet,statement,connection);
}
converMasterRecord(masterContentVO,archiveMaster);
}
public void converMasterRecord(MasterContentVO masterRecord,ArchiveMaster archiveMaster){
CommomVo commomVo = new CommomVo();
XmlFirstPage xmlFirstPage = null;
try {
if(StringUtils.isNoneBlank (masterRecord.getContent ())){
xmlFirstPage = new XmlFirstPage(masterRecord.getContent());
TBasic tBasic = new TBasic();//病人基本信息表
tBasic.setPatientId(getMasterId (xmlFirstPage.eprhead.PATNO.getValText()).getId ());//master表id
tBasic.setPayType(xmlFirstPage.BasiInfor.MedTreatPayModeNew.getValText());//医疗付费方式
tBasic.setBaseMedicare(xmlFirstPage.BasiInfor.HealthNum.getValText());//健康卡号
if(StringUtils.isNoneBlank (xmlFirstPage.BasiInfor.TheNumOfInHos.getValText())){
tBasic.setAdmissTimes(Long.parseLong(xmlFirstPage.BasiInfor.TheNumOfInHos.getValText()));//住院次数
}
tBasic.setInpatientNo(xmlFirstPage.BasiInfor.ZYH.getValText());//病案号
tBasic.setName(xmlFirstPage.BasiInfor.NAME.getValText());//姓名
tBasic.setSex(xmlFirstPage.BasiInfor.SEXOption.getValText());//性别
log.info("时间格式"+xmlFirstPage.BasiInfor.BIRTHDATE.getValText());
tBasic.setBirthday(Timestamp.valueOf(xmlFirstPage.BasiInfor.BIRTHDATE.getValText()+" 00:00:00"));//出生日期
if(StringUtils.isNoneBlank(xmlFirstPage.BasiInfor.AGE.getValText())){
String regEx="[^0-9]";
Pattern compile = Pattern.compile(regEx);
Matcher matcher = compile.matcher(xmlFirstPage.BasiInfor.AGE.getValText());
if(StringUtils.isNoneBlank(matcher.replaceAll("").trim())){
tBasic.setAge(Short.parseShort(matcher.replaceAll("").trim()));//年龄
}
}
tBasic.setCountry(xmlFirstPage.BasiInfor.PatNATIVE.getValText());//国籍
tBasic.setNation(xmlFirstPage.BasiInfor.PatNATION.getValText());//民族
TBaby tBaby = new TBaby();//婴儿表
if(!"".equals(xmlFirstPage.BasiInfor.InfantWeight.getValText())){
tBaby.setPatientId(getMasterId (xmlFirstPage.eprhead.PATNO.getValText()).getId ());//
//tBaby.setAvoirdupois(Double.valueOf(xmlFirstPage.BasiInfor.InfantWeight.getValText()));//新生儿出生体重
//新生儿入院体重
addTbaby(tBaby);
}
tBasic.setBirthAddr(xmlFirstPage.BasiInfor.BIRTHPL.getValText());//出生地
//籍贯
tBasic.setIdCard(xmlFirstPage.BasiInfor.PatIDCARD.getValText());//身份证号
tBasic.setJob(xmlFirstPage.BasiInfor.JOB.getValText());//职业
tBasic.setMarriage(xmlFirstPage.BasiInfor.STATUOptionNEW.getValText());//婚姻
tBasic.setHomeAddr(xmlFirstPage.BasiInfor.NOWADDR.getValText());//现住址
tBasic.setHomeTel(xmlFirstPage.BasiInfor.NOWADDRTELE.getValText());//电话
tBasic.setHomeZip(xmlFirstPage.BasiInfor.NOWADDRPOST.getValText());//邮编
tBasic.setWorkAddr(xmlFirstPage.BasiInfor.DWNAME.getValText());//工作单位及地址
tBasic.setWorkTel(xmlFirstPage.BasiInfor.DWTELE.getValText());//单位电话
tBasic.setWorkZip(xmlFirstPage.BasiInfor.DWPOST.getValText());//邮编
tBasic.setLinkman(xmlFirstPage.BasiInfor.LXNAME.getValText());//联系人姓名
tBasic.setRelation(xmlFirstPage.BasiInfor.RELATE.getValText());//关系
tBasic.setRelAddr(xmlFirstPage.BasiInfor.LXADDR.getValText());//地址
tBasic.setRelTel(xmlFirstPage.BasiInfor.LXTELE.getValText());//联系人电话
TAdmissThing tAdmissThing = new TAdmissThing();//病人住院信息表
tAdmissThing.setPatientId(getMasterId (xmlFirstPage.eprhead.PATNO.getValText()).getId ());
tAdmissThing.setAdmissType(xmlFirstPage.BasiInfor.InHospWayOption.getValText());//入院途径
try {
tAdmissThing.setAdmissDate(Timestamp.valueOf(xmlFirstPage.BasiInfor.xmlRYDATE.RYDATEY.getValText() + "-" +
xmlFirstPage.BasiInfor.xmlRYDATE.RYDATEM.getValText() + "-" + xmlFirstPage.BasiInfor.xmlRYDATE.RYDATED.getValText()
+ " " + xmlFirstPage.BasiInfor.xmlRYDATE.RYDATEH.getValText() + ":" + xmlFirstPage.BasiInfor.xmlRYDATE.RYDATEMin.getValText() + ":00"));//入院时间
}catch (Exception ex){
}
tAdmissThing.setAdmissDept(xmlFirstPage.BasiInfor.RYDEPT.getValText());//入院科别
tAdmissThing.setAdmissWard(xmlFirstPage.BasiInfor.RYBS.getValText());//入院病房
//转科时间
tAdmissThing.setChangeDept(xmlFirstPage.BasiInfor.FirstZKDpt.FirstZKDptName1.getValText());//转科
try {
tAdmissThing.setDisDate(Timestamp.valueOf(xmlFirstPage.BasiInfor.xmlCYDATE.CYDATEY.getValText() + "-" +
xmlFirstPage.BasiInfor.xmlCYDATE.CYDATEM.getValText() + "-" + xmlFirstPage.BasiInfor.xmlCYDATE.CYDATED.getValText()
+ " " + xmlFirstPage.BasiInfor.xmlCYDATE.CYDATEH.getValText() + ":" + xmlFirstPage.BasiInfor.xmlCYDATE.CYDATEMin.getValText() + ":00"));//出院时间
}catch (Exception ex){
}
tAdmissThing.setDisDept(xmlFirstPage.BasiInfor.CYDEPT.getValText());//出院科别
tAdmissThing.setDisWard(xmlFirstPage.BasiInfor.CYBS.getValText());//出院病房
//实际住院天数
TDiag tDiag = new TDiag();//诊断表
int i = 1;
tDiag.setPatientId(getMasterId (xmlFirstPage.eprhead.PATNO.getValText()).getId ());
tDiag.setDiagNo(i);
tDiag.setDiagCode(xmlFirstPage.DiagInfor.MainDiag.ICD10.getValText());//疾病编码
tDiag.setDiagName(xmlFirstPage.DiagInfor.MainDiag.DiagName.getValText());//诊断名
tDiag.setDiagType("1");//入院病情
if("-1".equals(xmlFirstPage.DiagInfor.MainDiag.xmlInHospStat.InHospStatHav.getValText())){
tDiag.setDisThing("有");
}else if("-1".equals(xmlFirstPage.DiagInfor.MainDiag.xmlInHospStat.InHospStatNotS.getValText())){
tDiag.setDisThing("临床未确定");
}else if("-1".equals(xmlFirstPage.DiagInfor.MainDiag.xmlInHospStat.InHospStatNotC.getValText())){
tDiag.setDisThing("情况不明");
}else if("-1".equals(xmlFirstPage.DiagInfor.MainDiag.xmlInHospStat.InHospStatNon.getValText())){
tDiag.setDisThing("无");
}
addTdiag(tDiag);
i++;
if(!"".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag1.DiagName.getValText())){
TDiag tDiag1 = new TDiag();
tDiag1.setPatientId(getMasterId (xmlFirstPage.eprhead.PATNO.getValText()).getId ());
tDiag1.setDiagNo(i);
tDiag1.setDiagCode(xmlFirstPage.DiagInfor.OthDiag.OthDiag1.ICD10.getValText());
tDiag1.setDiagName(xmlFirstPage.DiagInfor.OthDiag.OthDiag1.DiagName.getValText());
tDiag1.setDiagType("2");
if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag1.xmlInHospStat.InHospStatHav.getValText())){
tDiag1.setDisThing("有");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag1.xmlInHospStat.InHospStatNotS.getValText())){
tDiag1.setDisThing("临床未确定");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag1.xmlInHospStat.InHospStatNotC.getValText())){
tDiag1.setDisThing("情况不明");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag1.xmlInHospStat.InHospStatNon.getValText())){
tDiag1.setDisThing("无");
}
i++;
addTdiag(tDiag1);
}
if(!"".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag2.DiagName.getValText())){
TDiag tDiag2 = new TDiag();
tDiag2.setPatientId(getMasterId (xmlFirstPage.eprhead.PATNO.getValText()).getId ());
tDiag2.setDiagNo(i);
tDiag2.setDiagCode(xmlFirstPage.DiagInfor.OthDiag.OthDiag2.ICD10.getValText());
tDiag2.setDiagName(xmlFirstPage.DiagInfor.OthDiag.OthDiag2.DiagName.getValText());
tDiag2.setDiagType("2");
if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag2.xmlInHospStat.InHospStatHav.getValText())){
tDiag2.setDisThing("有");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag2.xmlInHospStat.InHospStatNotS.getValText())){
tDiag2.setDisThing("临床未确定");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag2.xmlInHospStat.InHospStatNotC.getValText())){
tDiag2.setDisThing("情况不明");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag2.xmlInHospStat.InHospStatNon.getValText())){
tDiag2.setDisThing("无");
}
i++;
addTdiag(tDiag2);
}
if(!"".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag3.DiagName.getValText())){
TDiag tDiag3 = new TDiag();
tDiag3.setDiagNo(i);
tDiag3.setPatientId(getMasterId (xmlFirstPage.eprhead.PATNO.getValText()).getId ());
tDiag3.setDiagCode(xmlFirstPage.DiagInfor.OthDiag.OthDiag3.ICD10.getValText());
tDiag3.setDiagName(xmlFirstPage.DiagInfor.OthDiag.OthDiag3.DiagName.getValText());
tDiag3.setDiagType("2");
if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag3.xmlInHospStat.InHospStatHav.getValText())){
tDiag3.setDisThing("有");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag3.xmlInHospStat.InHospStatNotS.getValText())){
tDiag3.setDisThing("临床未确定");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag3.xmlInHospStat.InHospStatNotC.getValText())){
tDiag3.setDisThing("情况不明");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag3.xmlInHospStat.InHospStatNon.getValText())){
tDiag3.setDisThing("无");
}
i++;
addTdiag(tDiag3);
}
if(!"".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag4.DiagName.getValText())){
TDiag tDiag4 = new TDiag();
tDiag4.setDiagNo(i);
tDiag4.setPatientId(getMasterId (xmlFirstPage.eprhead.PATNO.getValText()).getId ());
tDiag4.setDiagCode(xmlFirstPage.DiagInfor.OthDiag.OthDiag4.ICD10.getValText());
tDiag4.setDiagName(xmlFirstPage.DiagInfor.OthDiag.OthDiag4.DiagName.getValText());
tDiag4.setDiagType("2");
if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag4.xmlInHospStat.InHospStatHav.getValText())){
tDiag4.setDisThing("有");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag4.xmlInHospStat.InHospStatNotS.getValText())){
tDiag4.setDisThing("临床未确定");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag4.xmlInHospStat.InHospStatNotC.getValText())){
tDiag4.setDisThing("情况不明");
}else if("-1".equals(xmlFirstPage.DiagInfor.OthDiag.OthDiag4.xmlInHospStat.InHospStatNon.getValText())){
tDiag4.setDisThing("无");
}
i++;
addTdiag(tDiag4);
}
addTadmissthing(tAdmissThing);
try {
addTbasic(tBasic);
}catch (Exception ex){
}
int j = 1;
if(!"".equals(xmlFirstPage.SurgInfor.Operation1.ICD9_CM.getValText())){
TOperate tOperate = new TOperate(); //手术表
tOperate.setPatientId(getMasterId (xmlFirstPage.eprhead.PATNO.getValText()).getId ());
tOperate.setOperateNo(j);
tOperate.setOperateCode(xmlFirstPage.SurgInfor.Operation1.ICD9_CM.getValText());//手术及操作编码
tOperate.setOperName(xmlFirstPage.SurgInfor.Operation1.OperName.getValText());//手术及操作名称
tOperate.setOperateClass(xmlFirstPage.SurgInfor.Operation1.OperDegrOption.getValText());//手术级别
tOperate.setOperator(xmlFirstPage.SurgInfor.Operation1.OperDoct.MainOperator.getValText());//术者
tOperate.setAssistant1(xmlFirstPage.SurgInfor.Operation1.OperDoct.Assistant1.getValText());//I助
tOperate.setAssistant2(xmlFirstPage.SurgInfor.Operation1.OperDoct.Assistant2.getValText());//II助
tOperate.setAssistant3(xmlFirstPage.SurgInfor.Operation1.OperDoct.Assistant3.getValText());//III助
//tOperate.setCut(xmlFirstPage.SurgInfor.Operation1.);切口愈合等级
//择期手术
tOperate.setAnaesthesiaType(xmlFirstPage.SurgInfor.Operation1.MAZUI.getValText());//麻醉方式
tOperate.setAnaesthesiaName(xmlFirstPage.SurgInfor.Operation1.HocusDoct.getValText());//麻醉医师
addToperate(tOperate);
}
if(!"".equals(xmlFirstPage.SurgInfor.Operation2.ICD9_CM.getValText())){
TOperate tOperate = new TOperate(); //手术表
tOperate.setPatientId(getMasterId (xmlFirstPage.eprhead.PATNO.getValText()).getId ());
tOperate.setOperateNo(j);
tOperate.setOperateCode(xmlFirstPage.SurgInfor.Operation2.ICD9_CM.getValText());//手术及操作编码
tOperate.setOperName(xmlFirstPage.SurgInfor.Operation2.OperName.getValText());//手术及操作名称
tOperate.setOperateClass(xmlFirstPage.SurgInfor.Operation2.OperDegrOption.getValText());//手术级别
tOperate.setOperator(xmlFirstPage.SurgInfor.Operation2.OperDoct.MainOperator.getValText());//术者
tOperate.setAssistant1(xmlFirstPage.SurgInfor.Operation2.OperDoct.Assistant1.getValText());//I助
tOperate.setAssistant2(xmlFirstPage.SurgInfor.Operation2.OperDoct.Assistant2.getValText());//II助
tOperate.setAssistant3(xmlFirstPage.SurgInfor.Operation2.OperDoct.Assistant3.getValText());//III助
//tOperate.setCut(xmlFirstPage.SurgInfor.Operation1.);切口愈合等级
//择期手术
tOperate.setAnaesthesiaType(xmlFirstPage.SurgInfor.Operation2.MAZUI.getValText());//麻醉方式
tOperate.setAnaesthesiaType(xmlFirstPage.SurgInfor.Operation2.HocusDoct.getValText());//麻醉医师
addToperate(tOperate);
}
if(!"".equals(xmlFirstPage.SurgInfor.Operation3.ICD9_CM.getValText())){
TOperate tOperate = new TOperate(); //手术表
tOperate.setPatientId(getMasterId (xmlFirstPage.eprhead.PATNO.getValText()).getId ());
tOperate.setOperateNo(j);
tOperate.setOperateCode(xmlFirstPage.SurgInfor.Operation3.ICD9_CM.getValText());//手术及操作编码
tOperate.setOperName(xmlFirstPage.SurgInfor.Operation3.OperName.getValText());//手术及操作名称
tOperate.setOperateClass(xmlFirstPage.SurgInfor.Operation3.OperDegrOption.getValText());//手术级别
tOperate.setOperator(xmlFirstPage.SurgInfor.Operation3.OperDoct.MainOperator.getValText());//术者
tOperate.setAssistant1(xmlFirstPage.SurgInfor.Operation3.OperDoct.Assistant1.getValText());//I助
tOperate.setAssistant2(xmlFirstPage.SurgInfor.Operation3.OperDoct.Assistant2.getValText());//II助
tOperate.setAssistant3(xmlFirstPage.SurgInfor.Operation3.OperDoct.Assistant3.getValText());//III助
//tOperate.setCut(xmlFirstPage.SurgInfor.Operation1.);切口愈合等级
//择期手术
tOperate.setAnaesthesiaType(xmlFirstPage.SurgInfor.Operation3.MAZUI.getValText());//麻醉方式
tOperate.setAnaesthesiaType(xmlFirstPage.SurgInfor.Operation3.HocusDoct.getValText());//麻醉医师
addToperate(tOperate);
}
commomVo.setPatientId(tBasic.getPatientId());//主键 唯一
commomVo.setAdmissTimes((short) tBasic.getAdmissTimes());//住院次数
commomVo.setInpatientNo(tBasic.getInpatientNo());//病案号
commomVo.setName(tBasic.getName());//姓名
commomVo.setAdmissId(tBasic.getInpatientNo());//住院号
commomVo.setSex(tBasic.getSex());//性别
commomVo.setAge((short) tBasic.getAge());//年龄
commomVo.setAgeMonth(Short.parseShort(xmlFirstPage.BasiInfor.BIRTHDAY.BIRTHDAYM.getValText()));//年龄(月)
commomVo.setAgeDay(Short.parseShort(xmlFirstPage.BasiInfor.BIRTHDAY.BIRTHDAYD.getValText()));//年龄(天)
commomVo.setHomeAddr(tBasic.getHomeAddr());//现住地址
commomVo.setNameCym(xmlFirstPage.BasiInfor.NAME.getValText());//姓名简写
commomVo.setAdmissDate(tAdmissThing.getAdmissDate());//入院日期
commomVo.setDisDate(tAdmissThing.getDisDate());//出院日期
if(StringUtils.isNoneBlank (xmlFirstPage.BasiInfor.DAYS.getValText())){
commomVo.setAdmissDays(Integer.valueOf(xmlFirstPage.BasiInfor.DAYS.getValText().trim()));
}
if(!"".equals(xmlFirstPage.SurgInfor.Operation1.ICD9_CM.getValText().trim())) {
commomVo.setIsOper("有");
}else {
commomVo.setIsOper("无");
}
commomVo.setDisDept(tAdmissThing.getDisDept());//出院科别
commomVo.setAttending(xmlFirstPage.ThirClassExa.ZZDOCT.getValText());//主治医师
commomVo.setMainDiagName(tDiag.getDiagName());
commomVo.setMainDisThing(tDiag.getDisThing ());//主诊断转归情况
commomVo.setCountry(tBasic.getCountry());//国籍
commomVo.setBirthAddr(tBasic.getBirthAddr());//出生地
commomVo.setIdCard(tBasic.getIdCard());//身份证号
commomVo.setJob(tBasic.getJob());//职业
commomVo.setMarriage(tBasic.getMarriage());//婚况 转
commomVo.setHomeTel(tBasic.getHomeTel());//家庭电话
commomVo.setHomeZip(tBasic.getHomeZip());//家庭邮编
commomVo.setWorkAddr(tBasic.getWorkAddr());//工作单位及地址
commomVo.setWorkTel(tBasic.getWorkTel());//工作单位电话
commomVo.setHomeZip(tBasic.getHomeZip());//工作单位住址邮编
commomVo.setLinkman(tBasic.getLinkman());//联系人姓名
commomVo.setRelation(tBasic.getRelation());//联系人关系
commomVo.setRelAddr(tBasic.getRelAddr());//关系人住址
commomVo.setRelTel(tBasic.getRelTel());//关系人电话
commomVo.setPayType(tBasic.getPayType());//医疗付费方式
commomVo.setBirthday(tBasic.getBirthday());//出生日期
commomVo.setAvoirdupois(BigDecimal.valueOf(tBaby.getAvoirdupois()));//新生儿体重
commomVo.setAdmissType(tAdmissThing.getAdmissType());//入院途径
commomVo.setAdmissDept(tAdmissThing.getAdmissDept());//入院科别
commomVo.setAdmissWard(tAdmissThing.getAdmissWard());//入院病房
commomVo.setChangeDept(tAdmissThing.getChangeDept());//转院科别
commomVo.setDisWard(tAdmissThing.getDisWard());//出院病房
//插入zd_icd_code clinic_diag clinic_name
//commomVo.setClinicDiag(xmlFirstPage.BasiInfor.MZZDCode.getValText());
//commomVo.setClinicName(xmlFirstPage.BasiInfor.MZZD.getValText());
//commomVo.setAdmissThing(null);//入院病情
if("1".equals(xmlFirstPage.DiagInfor.GMYWIfOption.getValText())){
commomVo.setIsMedicine("无");
}else {
commomVo.setIsMedicine("有");
commomVo.setMedicine(xmlFirstPage.DiagInfor.GMYW.getValText());//过敏药物
}
commomVo.setEmitPathology(xmlFirstPage.DiagInfor.BODYOption.getValText());// 是否尸检 插/转
commomVo.setDeptDirector(xmlFirstPage.ThirClassExa.KZR.getValText());//科主任
commomVo.setDirector(xmlFirstPage.ThirClassExa.ZRDOCT.getValText());//主任医师
commomVo.setAdmissDoctor(xmlFirstPage.ThirClassExa.ZYDOCT.getValText());//住院医师
commomVo.setRefresher(xmlFirstPage.ThirClassExa.JXDOCT.getValText());//进修医师
commomVo.setPraxis(xmlFirstPage.ThirClassExa.SXDOCT.getValText());//实习医师
commomVo.setCoding(xmlFirstPage.ThirClassExa.BMY.getValText());//编码员
commomVo.setQuality(xmlFirstPage.ThirClassExa.QUALITYOption.getValText());//病案质量
commomVo.setControl(xmlFirstPage.ThirClassExa.ZKDOCT.getValText());//质控医师
commomVo.setNurses(xmlFirstPage.ThirClassExa.ZKNURSE.getValText());//质控护士
//Date parse3 = format.parse(xmlFirstPage.ThirClassExa.ZKRQ.ZKRQYear.getValText()+"-"
// +xmlFirstPage.ThirClassExa.ZKRQ.ZKRQMon.getValText()+"-"+xmlFirstPage.ThirClassExa.ZKRQ.ZKRQDay.getValText());
//commomVo.setQualityDate(parse3);//质检日期
commomVo.setBloodType(xmlFirstPage.DiagInfor.BLOODOptionNEW.getValText());//血型
commomVo.setRh(xmlFirstPage.DiagInfor.RHOptionNEW.getValText());//Rh
addCommom(commomVo);
addCommom1(commomVo);
addCommom2(xmlFirstPage.eprhead.PATNO.getValText());
}
} catch (Exception e) {
log.error(e.getMessage(),e);
}
}
//根据流水号得到masterId
public ArchiveMaster getMasterId(String patientId){
String sql ="select id from archive_master where patient_id=?";
Object[]parms = new Object[]{patientId};
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
ArchiveMaster archiveMaster = 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"));
}
}catch (Exception ex){
logger.log(ex.toString());
} finally {
JDBCUtils.release(resultSet,statement,connection);
}
return archiveMaster;
}
//插入病人基本信息表
public int addTbasic(TBasic tBasic){
int j = 0;
Connection connection =null;
PreparedStatement statement = null;
try {
connection = JDBCUtils3.getConnection();
String sql = "INSERT INTO [t_basic]([patient_id],[base_medicare],[other_medicare]\n" +
",[pay_type],[bed_no],[clinic_id],[admiss_id],[inpatient_no]\n" +
",[admiss_times],[name],[sex],[birthday],[age],[age_month]\n" +
",[age_day],[marriage],[job],[birth_addr],[nation],[country]\n" +
",[id_card],[work_addr],[work_tel],[work_zip],[home_addr]\n" +
",[home_tel],[home_zip],[linkman],[relation],[rel_addr]\n" +
",[rel_tel],[m_addr],[ph],[gdh],[oper_code],[oper_name],[oper_date]\n" +
",[scan_id],[mir_id],[top_unit],[persennl_type],[duty]\n" +
",[service_system_indicator],[ident],[working_status],[rel_zip]\n" +
",[patient_origin],[management_code],[name_py],[create_date]\n" +
",[name_cym],[health_card],[birth_place_name],[native_place]\n" +
",[FZYID])\n" +
"VALUES\n" +
"(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);";
Object[]parms = new Object[]{
tBasic.getPatientId(),tBasic.getBaseMedicare(),tBasic.getOtherMedicare(),
tBasic.getPayType(),tBasic.getBedNo(),tBasic.getClinicId(),tBasic.getAdmissId(),
tBasic.getInpatientNo(),tBasic.getAdmissTimes(),tBasic.getName(),tBasic.getSex(),
tBasic.getBirthday(),tBasic.getAge(),tBasic.getAgeMonth(),tBasic.getAgeDay(),tBasic.getMarriage(),
tBasic.getJob(),tBasic.getBirthAddr(),tBasic.getNation(),tBasic.getCountry(),
tBasic.getIdCard(),tBasic.getWorkAddr(),tBasic.getWorkTel(),tBasic.getWorkZip(),
tBasic.getHomeAddr(),tBasic.getHomeTel(),tBasic.getHomeZip(),tBasic.getLinkman(),
tBasic.getRelation(),tBasic.getRelAddr(),tBasic.getRelTel(),tBasic.getMAddr(),
tBasic.getPh(),tBasic.getGdh(),tBasic.getOperCode(),tBasic.getOperName(),tBasic.getOperDate(),
tBasic.getScanId(),tBasic.getMirId(),tBasic.getTopUnit(),tBasic.getPersennlType(),
tBasic.getDuty(),tBasic.getServiceSystemIndicator(),tBasic.getIdent(),tBasic.getWorkingStatus(),
tBasic.getRelZip(),tBasic.getPatientOrigin(),tBasic.getManagementCode(),tBasic.getNamePy(),
tBasic.getCreateDate(),tBasic.getNameCym(),tBasic.getHealthCard(),tBasic.getBirthPlaceName(),
tBasic.getNativePlace(),tBasic.getFzyid()
};
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 int addTdiag(TDiag tDiag){
int j = 0;
Connection connection = null;
PreparedStatement statement = null;
try {
connection = JDBCUtils3.getConnection();
String sql = "INSERT INTO [t_diag]([patient_id],[diag_no],[diag_code],[diag_name],[diag_type],[dis_thing],[pathology_cut]\n" +
",[X_ray],[oper_code],[oper_name],[oper_date],[singl],[create_date],[pat_adm_condition],[pid],[vid],[INHospStat])\n" +
"VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
Object[]parms = new Object[]{tDiag.getPatientId(),tDiag.getDiagNo(),tDiag.getDiagCode(),tDiag.getDiagName(),tDiag.getDiagType(),tDiag.getDisThing(),tDiag.getPathologyCut(),
tDiag.getXRay(),tDiag.getOperCode(),tDiag.getOperName(),tDiag.getOperDate(),tDiag.getSingl(),tDiag.getCreateDate(),tDiag.getPatAdmCondition(),tDiag.getPid(),tDiag.getVid(),tDiag.getInHospStat()};
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 int addToperate(TOperate tOperate){
int j = 0;
Connection connection = null;
PreparedStatement statement = null;
String sql = "INSERT INTO [t_operate]([patient_id],[operate_no],[operate_code],[operate_name]\n" +
",[operate_date],[operator],[assistant_1],[assistant_2],[assistant_3],[anaesthesia_type]\n" +
",[cut],[anaesthesia_name],[oper_code],[oper_name],[oper_date],[operate_class],[OPERATION_SCALE]\n" +
",[ChosSurg],[OperDegr])\n" +
"VALUES(replace(newid(), '-', ''),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
Object[]parms = new Object[]{
tOperate.getOperateNo(),tOperate.getOperateCode(),tOperate.getOperateName(),
tOperate.getOperDate(),tOperate.getOperator(),tOperate.getAssistant1(),tOperate.getAssistant2(),tOperate.getAssistant3(),tOperate.getAnaesthesiaType(),
tOperate.getCut(),tOperate.getAnaesthesiaName(),tOperate.getOperCode(),tOperate.getOperName(),tOperate.getOperDate(),tOperate.getOperateClass(),tOperate.getOperationScale(),
tOperate.getChosSurg(),tOperate.getOperDegr()
};
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 int addTbaby(TBaby tBaby){
int j = 0;
Connection connection = null;
PreparedStatement statement = null;
String sql = "INSERT INTO [t_baby]([patient_id],[fetation_times],[childbirth_times],[childbirth_time]\n" +
",[childbirth_mothed],[sex],[head],[chest],[avoirdupois],[stature]\n" +
",[diag_type],[diag_code],[diag_name],[father],[id_card],[work_addr]\n" +
",[home_addr])\n" +
"VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
Object[]parms = new Object[]{tBaby.getPatientId(),tBaby.getFetationTimes(),tBaby.getChildbirthTimes(),tBaby.getChildbirthTime(),
tBaby.getChildbirthMothed(),tBaby.getSex(),tBaby.getHead(),tBaby.getChest(),tBaby.getAvoirdupois(),tBaby.getStature(),
tBaby.getDiagType(),tBaby.getDiagCode(),tBaby.getDiagName(),tBaby.getFather(),tBaby.getIdCard(),tBaby.getWorkAddr(),
tBaby.getHomeAddr()};
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 int addTadmissthing(TAdmissThing tAdmissThing){
int j = 0;
Connection connection = null;
PreparedStatement statement = null;
String sql = "INSERT INTO [t_admiss_thing]\n" +
"([patient_id],[admiss_date],[admiss_dept],[admiss_ward],[change_dept]\n" +
",[change_ward],[dis_date],[dis_dept],[dis_ward],[clinic_diag],[clinic_name]\n" +
",[admiss_thing],[admiss_diag],[admiss_name],[affirm_date],[diag_flag]\n" +
",[clinic_doctor],[dis_type],[diag_mode],[other_diag],[admiss_type]\n" +
",[clinic_date],[operator],[admiss_doctor],[dis_doctor],[clinic_diag_2]\n" +
",[clinic_name_2],[admiss_diag_2],[admiss_name_2],[admiss_diag_3]\n" +
",[admiss_name_3])\n" +
"VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);";
Object[]parms = new Object[]{tAdmissThing.getPatientId(),tAdmissThing.getAdmissDate(),tAdmissThing.getAdmissDept(),tAdmissThing.getAdmissWard(),
tAdmissThing.getChangeDept(),tAdmissThing.getChangeWard(),tAdmissThing.getDisDate(),tAdmissThing.getDisDept(),tAdmissThing.getDisWard(),tAdmissThing.getClinicDiag(),
tAdmissThing.getClinicName(),tAdmissThing.getAdmissThing(),tAdmissThing.getAdmissDiag(),tAdmissThing.getAdmissName(),tAdmissThing.getAffirmDate(),tAdmissThing.getDiagFlag(),
tAdmissThing.getClinicDoctor(),tAdmissThing.getDisType(),tAdmissThing.getDiagMode(),tAdmissThing.getOtherDiag(),tAdmissThing.getAdmissType(),tAdmissThing.getClinicDate(),tAdmissThing.getOperator(),
tAdmissThing.getAdmissDoctor(),tAdmissThing.getDisDoctor(),tAdmissThing.getClinicDiag2(),
tAdmissThing.getClinicName2(),tAdmissThing.getAdmissDiag2(),tAdmissThing.getAdmissName2(),tAdmissThing.getAdmissDiag3(),tAdmissThing.getAdmissName3()};
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 ;
}
//插入病人检查信息表
//int addTcheck
//插入费用表
//插入公共表
public int addCommom(CommomVo commomVo){
int j = 0;
String sql = "insert into commomtable\n" +
"(\n" +
"\tpatient_id,admiss_times,inpatient_no,name,admiss_id,sex,age,age_month,age_day,home_addr,name_cym,\n" +
"\tadmiss_date,dis_date,admiss_days,dis_dept,is_oper,attending,main_diag_name,main_dis_thing\n" +
")\n" +
"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
Object[]parms = new Object[]{
commomVo.getPatientId(),commomVo.getAdmissTimes(),commomVo.getInpatientNo(),commomVo.getName(),commomVo.getAdmissId(),commomVo.getSex(),commomVo.getAge(),
commomVo.getAgeMonth(),commomVo.getAgeDay(),commomVo.getHomeAddr(),commomVo.getNameCym(),
commomVo.getAdmissDate(),commomVo.getDisDate(),commomVo.getAdmissDays(),commomVo.getDisDept(),
commomVo.getIsOper(),commomVo.getAttending(),commomVo.getMainDiagName(),commomVo.getMainDisThing()
};
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]);
}
}
j = statement.executeUpdate();
} catch (Exception e) {
logger.log(e.toString());
}finally {
JDBCUtils.release(null,statement,connection);
}
return j ;
}
public int addCommom1(CommomVo commomVo){
Connection connection = null;
PreparedStatement statement = null;
String sql = "insert into commomtable1\n" +
"(\n" +
"\tpatient_id,country,birth_addr,id_card,job,marriage,home_tel,home_zip,work_addr,\n" +
"\twork_tel,work_zip,linkman,relation,rel_addr,rel_tel,pay_type,birthday,avoirdupois,\n" +
"\tadmiss_type,admiss_dept,admiss_ward,change_dept,dis_ward,clinic_diag,clinic_name,\n" +
"\tadmiss_thing,medicine,is_medicine,emit_pathology,dept_director,director,admiss_doctor,\n" +
"\trefresher,praxis,coding,quality,control,nurses,quality_date,blood_type,RH\n" +
")\n" +
"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
Object[]parms = new Object[]{commomVo.getPatientId(),commomVo.getCountry(),commomVo.getBirthAddr(),commomVo.getIdCard(),commomVo.getJob(),
commomVo.getMarriage(),commomVo.getHomeTel(),commomVo.getHomeZip(),commomVo.getWorkAddr(),
commomVo.getWorkTel(),commomVo.getWorkZip(),commomVo.getLinkman(),commomVo.getRelation(),commomVo.getRelAddr(),commomVo.getRelTel(),
commomVo.getPayType(),commomVo.getBirthday(),commomVo.getAvoirdupois(),commomVo.getAdmissType(),commomVo.getAdmissDept(),
commomVo.getAdmissWard(),commomVo.getChangeDept(),commomVo.getDisWard(),commomVo.getClinicDiag(),commomVo.getClinicName(),
commomVo.getAdmissThing(),commomVo.getMedicine(),commomVo.getIsMedicine(),commomVo.getEmitPathology(),commomVo.getDeptDirector(),commomVo.getDirector(),commomVo.getAdmissDoctor(),
commomVo.getRefresher(),commomVo.getPraxis(),commomVo.getCoding(),commomVo.getQuality(),commomVo.getControl(),commomVo.getNurses(),commomVo.getQualityDate(),commomVo.getBloodType(),commomVo.getRh()};
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 int addCommom2(String patientId){
String sql = "insert into commomtable2(patient_id)VALUES(?)";
Object[]parms = new Object[]{patientId};
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;
}
}

@ -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);
}
}

@ -15,6 +15,15 @@ public class ArchiveMaster {
private String deptName;
private String dischargeDateTime;
private String archiveState;
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
private String admissionDateTime;
private String deptAdmissionTo;
private String checkDoctor;
@ -29,6 +38,8 @@ public class ArchiveMaster {
private String status;
private String bedId;
private String source;
public String getId() {
return id;

@ -0,0 +1,2 @@
server:
port: 8017

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<path>Z:</path>
<path>G:</path>
<pic>D:\JSWorking\SignedPictures\</pic>
</CONFIG>

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<contextName>logback</contextName>
<!--输出到控制台-->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<!--按天生成日志,即一天只生成一个文件夹和一个日志文件-->
<appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<Prudent>true</Prudent>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>
hisLog/%d{yyyy-MM-dd}/%d{yyyy-MM-dd}.log
</FileNamePattern>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{yyyy-MM-dd HH:mm:ss} -%msg%n
</Pattern>
</layout>
</appender>
<!-- logger节点可选节点作用是指明具体的包或类的日志输出级别
以及要使用的<appender>(可以把<appender>理解为一个日志模板)。
addtivity非必写属性是否向上级loger传递打印信息。默认是true-->
<logger name="com.framework.job" additivity="false">
<appender-ref ref="console"/>
<appender-ref ref="logFile"/>
</logger>
<!--项目的整体的日志打印级别为info-->
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="logFile"/>
</root>
</configuration>
Loading…
Cancel
Save