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