Compare commits

...

10 Commits

@ -1,30 +1,111 @@
//{
// //-----------------------
// //,
// "ResHead":"Response,RetInfo",
// //
// "ResCode":"RetCode",
// //
// "ResMsg":"RetCon",
// //
// "successCode":"0",
// //
// "errorCode":"1",
//
// //,
// "directory":["Msg"],
// //
// "indexFlag":"INHOSP_NO",
// //
// "serialnum":"IDNO",
// //
// "filetitle":"FILENAME",
// //
// "sortingTime":"MIN_TIME",
// //,&
// "downurl":"PDF_PATH",
// //
// "nurseSubmitTime": "SUBMIT_TIME",
// //
// "doctorSubmitTime": "SUBMIT_TIME",
// //id
// "assortid":"",
// //id
// "collectorid":"1",
// //id
// "assortidParamKey":"TABLE_TYPE",
// //( 1:2)
// "filesource":1,
// //(1:2ftp3)
// "filestoragetype":1,
// //
// "uploadConnector":"http://192.9.100.171:9291/api/downplatform/report",
// //doubleBasic
// "basicDirectory":[""],
// //
// "doubleBasic":["ITEM"],
//
// //--------------/---------------
// /// 01
// "isJudge":"0",
// //
// "judgeDirectory":[""],
// //,0-1-2-
// "judgeIndex":"",
//
//
// //--------------------
// //,
// "repealDirectory":[""],
// //
// "repealSerialnum":"UNIQUE_ID",
// //
// "repoalConnector":"http://192.9.100.171:9291/api/down/cancel",
// "urlReplace":["<ORIGINAL_URL>","</ORIGINAL_URL>","<REPORT_URLS>","</REPORT_URLS>","<URL>","</URL>","<ImageFiles>","</ImageFiles>","<ImageFile>","</ImageFile>"],
//
// //--------------------
// "zyUrl":"http://192.9.100.32:9022/ktin/api/webservice/ChasWebService?wsdl",
// // "zyUrl":"http://localhost:9000/services/api?wsdl",
// "zyMethod":"ChasMessageServer",
// // "zyMethod":"getPdfId",
// "zyNamespance":"http://webservice.http.plugins.api.his.karrytech.com/",
// // "zyNamespance":"http://server.webservice.example.com",
// "zyDirectory":["PDF_DETAIL_INFO"],
// "pdfUrl":"http://192.9.100.32:9022/ktin/api/flow/flow-mra-getpdffile?PDF_ID=",
// "zysj":"2022-01-28"
//
//}
{
//-----------------------
//,
"ResHead":"Response,Result",
"ResHead":"Response,RetInfo",
//
"ResCode":"Code",
"ResCode":"RetCode",
//
"ResMsg":"Msg",
"ResMsg":"RetCon",
//
"successCode":"1",
"successCode":"0",
//
"errorCode":"0",
"errorCode":"1",
//,
"directory":[],
"directory":["Msg"],
//
"indexFlag":"VISITING_SERIAL_NUMBER",
"indexFlag":"INHOSP_NO",
//
"serialnum":"UNIQUE_ID",
"serialnum":"IDNO",
//
"filetitle":"DOCUMENT_TITLE",
"filetitle":"FILENAME",
//
"doctorSubmitTime":"SUBMIT_TIME",
//,&
"downurl":"BASE64&ORIGINAL_URL",
"downurl":"PDF_PATH",
//
"sortingTime":"MIN_TIME",
//id
"assortid":"",
"assortid":"Wiw213woq412awqe41",
//id
"collectorid":"2",
"collectorid":"22",
//id
"assortidParamKey":"DOCUMENT_TOPIC",
//( 1:2)
@ -32,11 +113,11 @@
//(1:2ftp3)
"filestoragetype":1,
//
"uploadConnector":"http://127.0.0.1:9291/api/downplatform/report",
"uploadConnector":"http://192.9.100.171:9291/api/downplatform/report",
//doubleBasic
"basicDirectory":[""],
//
"doubleBasic":["TestItemInfo","BioTestInfo"],
"doubleBasic":["ITEM"],
//--------------/---------------
/// 01
@ -49,10 +130,23 @@
//--------------------
//,
"repealDirectory":["DOCUMENT"],
"repealDirectory":[""],
//
"repealSerialnum":"UNIQUE_ID",
//
"repoalConnector":"http://127.0.0.1:9291/api/down/cancel"
"repoalConnector":"http://192.9.100.171:9291/api/down/cancel",
"urlReplace":[],
//--------------------
"zyUrl":"http://192.9.100.32:9022/ktin/api/webservice/ChasWebService?wsdl",
// "zyUrl":"http://localhost:9000/services/api?wsdl",
"zyMethod":"ChasMessageServer",
// "zyMethod":"getPdfId",
"zyNamespance":"http://webservice.http.plugins.api.his.karrytech.com/",
// "zyNamespance":"http://server.webservice.example.com",
"zyDirectory":["PDF_DETAIL_INFO"],
"pdfUrl":"http://192.9.100.32:9022/ktin/api/flow/flow-mra-getpdffile?PDF_ID=",
"zysj":"2022-01-28"
}
}

@ -53,6 +53,6 @@
//
"repealSerialnum":"SAMPLE_NO",
//
"repoalConnector":"http://192.9.100.171:9291/api/down/cancel"
"repoalConnector":"http://192.9.100.171:9291/api/down/cancel",
"urlReplace":[]
}

@ -19,8 +19,14 @@
"serialnum":"IDNO",
//
"filetitle":"FILENAME",
//
"doctorSubmitTime":"SUBMIT_TIME",
//id
"sealId":"SEAL_ID",
//,&
"downurl":"PDF_PATH",
//
"sortingTime":"MIN_TIME",
//id
"assortid":"Wiw213woq412awqe41",
//id
@ -33,6 +39,8 @@
"filestoragetype":1,
//
"uploadConnector":"http://192.9.100.171:9291/api/downplatform/report",
//
"sealUpload":"",
//doubleBasic
"basicDirectory":[""],
//
@ -54,6 +62,7 @@
"repealSerialnum":"UNIQUE_ID",
//
"repoalConnector":"http://192.9.100.171:9291/api/down/cancel",
"urlReplace":[],
//--------------------
"zyUrl":"http://192.9.100.32:9022/ktin/api/webservice/ChasWebService?wsdl",

@ -15,6 +15,10 @@
"directory":["Msg"],
//
"indexFlag":"PatInfo,INHOSP_NO",
//
"examApplyDate": "ExamInfo,EXAM_APPLY_DATETIME",
//
"inPatientNo": "PatInfo,INHOSP_INDEX_NO",
//
"serialnum":"ReportInfo,UPDATE_REPORT_NO",
//
@ -51,6 +55,7 @@
//
"repealSerialnum":"REPORT_STATUS_FLAG",
//
"repoalConnector":"http://192.9.100.171:9291/api/down/cancel"
"repoalConnector":"http://192.9.100.171:9291/api/down/cancel",
"urlReplace":[]
}

@ -54,6 +54,7 @@
"repealSerialnum":"UNIQUE_ID",
//
"repoalConnector":"http://192.9.100.171:9291/api/down/cancel",
"urlReplace":[],
//--------------------
"zyUrl":"http://192.9.100.32:9022/ktin/api/webservice/ChasWebService?wsdl",

@ -19,6 +19,8 @@
"serialnum":"IDNO",
//
"filetitle":"FILENAME",
//
"nurseSubmitTime":"SUBMIT_TIME",
//,&
"downurl":"PDF_PATH",
//id
@ -53,6 +55,7 @@
//
"repealSerialnum":"IDNO",
//
"repoalConnector":"http://192.9.100.171:9291/api/down/cancel"
"repoalConnector":"http://192.9.100.171:9291/api/down/cancel",
"urlReplace":[]
}

@ -38,7 +38,7 @@
//
"doubleBasic":["TestItemInfo","BioTestInfo"],
//--------------/---------------
//--------------/---------------
/// 01
"isJudge":"0",
//
@ -53,6 +53,7 @@
//
"repealSerialnum":"UNIQUE_ID",
//
"repoalConnector":"http://127.0.0.1:9291/api/down/cancel"
"repoalConnector":"http://127.0.0.1:9291/api/down/cancel",
"urlReplace":["<REPORT_URLS>","</REPORT_URLS>","<URL>","</URL>","<ImageFiles>","</ImageFiles>","<ImageFile>","</ImageFile>"]
}

@ -17,6 +17,16 @@
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
@ -43,10 +53,7 @@
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>

@ -26,7 +26,7 @@ public class AfCollectTask implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id 雪花算法")
@TableId(value = "id", type = IdType.ID_WORKER_STR)
@TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id;
@ApiModelProperty(value = "病案主键")

@ -0,0 +1,32 @@
package com.docus.bgts.entity;
import lombok.Data;
/**
* @description
* @author zhengkai.blog.csdn.net
* @date 2022-08-17
*/
@Data
public class CqcSubmitState {
private static final long serialVersionUID = 1L;
/**
*
*/
private String patientId;
/**
* (0:1)
*/
private Integer doctorState;
/**
*
*/
private Integer nurseState;
}

@ -21,5 +21,4 @@ public class ReportDownDto {
@ApiModelProperty(value = "分类id")
private String assortid;
}

@ -7,4 +7,10 @@ import lombok.Data;
public class ReportDownPatientDto {
@ApiModelProperty(value = "记帐号")
private String jzh;
@ApiModelProperty(value = "封存id")
private String sealId;
@ApiModelProperty(value = "主键")
private String patientid;
}

@ -17,6 +17,8 @@ public class ReportDownScanFileDto {
private String recordid;
@ApiModelProperty("采集流水号")
private String serialnum;
@ApiModelProperty("排序时间")
private String sortdate;
@ApiModelProperty(value = "任务id")
private Long taskid;
@ApiModelProperty("文件类型(1:url,2:base64)")

@ -0,0 +1,465 @@
package com.docus.bgts.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jiashi
* @since 2021-04-14
*/
@Data
@EqualsAndHashCode
@ApiModel(value="TBasic对象", description="病案基本信息")
public class TBasic implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "病案主键")
@TableId(value = "patient_id", type = IdType.ASSIGN_ID)
private String patientId;
/**
*
*/
@ApiModelProperty("住院次数")
private Integer admissTimes;
/**
*
*/
@ApiModelProperty("病案号")
private String inpatientNo;
/**
* id
*/
@ApiModelProperty("住院id号")
private String admissId;
/**
*
*/
@ApiModelProperty("患者姓名")
private String name;
/**
*
*/
@ApiModelProperty("盘号")
private String ph;
/**
*
*/
@ApiModelProperty("患者姓名首拼")
private String nameSpell;
/**
*
*/
@ApiModelProperty("性别")
private String sex;
/**
* _
*/
@ApiModelProperty("年龄_岁")
private Integer age;
/**
* _
*/
@ApiModelProperty("年龄_月")
private Integer ageMonth;
/**
* _
*/
@ApiModelProperty("年龄_天")
private Integer ageDay;
/**
*
*/
@ApiModelProperty("身份证")
private String idCard;
/**
*
*/
@ApiModelProperty("手机号码")
private String telphone;
/**
*
*/
@ApiModelProperty("住院日期")
private Date admissDate;
/**
*
*/
@ApiModelProperty("住院科室")
private String admissDept;
/**
*
*/
@ApiModelProperty("住院科室名称")
private String admissDeptName;
/**
*
*/
@ApiModelProperty("出院日期")
private Date disDate;
/**
*
*/
@ApiModelProperty("出院科室")
private String disDept;
/**
*
*/
@ApiModelProperty("出院科室名称")
private String disDeptName;
/**
*
*/
@ApiModelProperty("实际住院天数")
private Integer admissDays;
/**
*
*/
@ApiModelProperty("主管医生")
private String attending;
/**
*
*/
@ApiModelProperty("主管医生名称")
private String attendingName;
/**
*
*/
@ApiModelProperty("主要诊断编码")
private String mainDiagCode;
/**
*
*/
@ApiModelProperty("主要诊断名称")
private String mainDiagName;
/**
*
*/
@ApiModelProperty("主要手术编码")
private String mainOperateCode;
/**
*
*/
@ApiModelProperty("主要手术名称")
private String mainOperateName;
/**
*
*/
@ApiModelProperty("是否死亡")
private Integer isDead;
/**
* (01)
*/
@ApiModelProperty("是否作废(01是)")
private Integer isCancel;
/**
*
*/
@ApiModelProperty("签收时间")
private Date signTime;
/**
*
*/
@ApiModelProperty("创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty("修改时间")
private Date updateTime;
/**
* 10
*/
@ApiModelProperty("是否归档 1已归档0未归档")
private Integer isArchive;
/**
*
*/
@ApiModelProperty("归档时间")
private Date archiveTime;
/**
* 1 pdf2 3 pdf4
*/
@ApiModelProperty("1 归档采集pdf2 异地扫描图片3 现场扫描pdf4 其他来源")
private Integer fileSource;
/**
*
*/
@ApiModelProperty("完整性描述")
private String integrityDesc;
/**
* -
*/
@ApiModelProperty("扫描生产软件-视频脑电图号")
private String bColumn1;
/**
* -ep
*/
@ApiModelProperty("扫描生产软件-ep号")
private String bColumn2;
/**
*
*/
@ApiModelProperty("茂名流水号")
private String bColumn3;
/**
* -
*/
@ApiModelProperty("扫描生产软件-门诊号")
private String bColumn4;
/**
* b_column5
*/
@ApiModelProperty("b_column5")
private String bColumn5;
/**
* b_column6
*/
@ApiModelProperty("b_column6")
private Integer bColumn6;
/**
* b_column7
*/
@ApiModelProperty("b_column7")
private Integer bColumn7;
/**
* b_column8
*/
@ApiModelProperty("b_column8")
private Integer bColumn8;
/**
* b_column9
*/
@ApiModelProperty("b_column9")
private Integer bColumn9;
/**
* b_column10
*/
@ApiModelProperty("b_column10")
private Integer bColumn10;
/**
*
*/
@ApiModelProperty("性别名称")
private String sexName;
/**
* (id)
*/
@ApiModelProperty("记账号(省中医患者主索引id)")
private String jzh;
/**
* ()
*/
@ApiModelProperty("患者主索引号(省中医记账号)")
private String empId;
/**
* visit_type_code
*/
@ApiModelProperty("visit_type_code")
private String visitTypeCode;
/**
* visit_type_name
*/
@ApiModelProperty("visit_type_name")
private String visitTypeName;
/**
* tcm_diag_code
*/
@ApiModelProperty("tcm_diag_code")
private String tcmDiagCode;
/**
* tcm_diag_name
*/
@ApiModelProperty("tcm_diag_name")
private String tcmDiagName;
/**
* ward_palce
*/
@ApiModelProperty("ward_palce")
private String wardPalce;
/**
*
*/
@ApiModelProperty("床号位")
private String bedNum;
/**
* 使
*/
@ApiModelProperty("接收时间,目前澄海人医 使用")
private Date receiveTime;
/**
* 13
*/
@ApiModelProperty("状态 1封存3锁定")
private Integer state;
/**
* 2 1
*/
@ApiModelProperty("是否扫描 2否 1是")
private String scanSource;
/**
* id
*/
@ApiModelProperty("暂缓审核配置id ,隔开")
private String cqcDeferAuditConfigId;
/**
* 0 1
*/
@ApiModelProperty("病案是否批注 0没有批注 1有批注")
private Integer commentStatus;
/**
* (0:1)
*/
@ApiModelProperty("医生提交状态(0:未提交1已提交)")
private Integer doctorState;
/**
*
*/
@ApiModelProperty("护士提交状态")
private Integer nurseState;
/**
* 0 1
*/
@ApiModelProperty("纸质签收 0未签收 1已签收")
private Integer cqcSigninfo;
/**
*
*/
@ApiModelProperty("责任护士")
private String dutyNurse;
/**
* 0 1
*/
@ApiModelProperty("审核状态 0否 1是")
private Integer tagState;
/**
*
*/
@ApiModelProperty("是否手术")
private String isOper;
/**
*
*/
@ApiModelProperty("现住址")
private String homeAddr;
/**
*
*/
@ApiModelProperty("损伤中毒")
private String poisoningName;
/**
*
*/
@ApiModelProperty("病理诊断")
private String pathologyName;
/**
*
*/
@ApiModelProperty("其他诊断")
private String otherDiagName;
/**
*
*/
@ApiModelProperty("联系方式")
private String homeTel;
public TBasic() {}
/**
* yn
* @param isDead
*/
public void setIsDead(String isDead) {
this.isDead = isDead!=null&&isDead.toLowerCase().equals("y")?1:0;
}
public Integer getIsDead() {
return isDead;
}
// public void setIsDead(Integer isDead) {
// this.isDead = isDead;
// }
}

@ -0,0 +1,44 @@
package com.docus.bgts.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jiashi
* @since 2022-06-13
*/
@Data
@EqualsAndHashCode
@ApiModel(value="TBasicExtend对象", description="病案基本信息扩展表")
public class TBasicExtend {
@ApiModelProperty(value = "病案主键")
@TableId(value = "patient_id", type = IdType.ASSIGN_ID)
private String patientId;
@ApiModelProperty(value = "报销政策代码")
private String claimPolicyCode;
@ApiModelProperty(value = "报销政策名称")
private String claimPolicyName;
@ApiModelProperty(value = "医保结算类型代码")
private String mioSettleTypeCode;
@ApiModelProperty(value = "医保结算类型名称")
private String mioSettleTypeName;
@ApiModelProperty(value = "医生提交时间")
private Date doctorSubmitTime;
@ApiModelProperty(value = "护理提交时间")
private Date nurseSubmitTime;
@ApiModelProperty(value = "责任护士")
private String dutyNurse;
@ApiModelProperty(value = "预住院流水号")
private String preJzh;
}

@ -12,6 +12,8 @@ public enum Codes {
DIRECTORY("1000","directory"),
//上传接口地址
UPLOAD("0","uploadConnector"),
//封存上传接口地址
SEALUPLOAD("0","sealUpload"),
REPOAL("0","repoalConnector"),
assortid("assortid","assortidKey"),
collectorid("collectorid","collectoridKey"),

@ -2,10 +2,8 @@ package com.docus.bgts.facade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.docus.bgts.entity.AfCollectTask;
import com.docus.bgts.entity.CanlcelDto;
import com.docus.bgts.entity.ReportDownDto;
import com.docus.bgts.entity.ZdAssort;
import com.docus.bgts.entity.*;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@ -24,30 +22,101 @@ public interface IAfCollectTaskService extends IService<AfCollectTask> {
*/
String getpatientIdByEmpId(String empId);
/**
* idpatient_id
* @param sealId
* @return
*/
String getpatientIdBysealId(String sealId);
String getNameByPatientId(String patientId);
String getOutpatientIdByJzhel(String jzh);
void insert(ReportDownDto reportDownDto);
void insertSeal(ReportDownDto reportDownDto);
void insertOut(ReportDownDto reportDownDto);
void updateInterfaceCollect(String collectSubId, int state);
List<String> listJZHByDate(String date1,String date2);
List<String> listJZHByDate(String date1, String date2);
/**
*
*
* @param canlcelDto
*/
void invokeRepoalFile(CanlcelDto canlcelDto) throws Exception;
String selectJzh(String inPatientNo, String examApplyDate);
/**
* assortId assortId
*
* @param assortId
* @return
*/
String getAssortIdByAssortId(String assortId);
/**
* assortId assortName
*
* @param assortId
* @return
*/
String getAssortIdByAssortName(String assortId);
void insertZdAssort(ZdAssort zdAssort);
/**
* af_downfile
*/
int deleteByPatientIdAndCollectorId(String patientId, String collectorId);
/**
* t_scan_assort
*/
int deleteByPatientIdAndAssortId(String patientId, String assortId);
/**
* af_collect_task
*/
int deleteByPatientIdAndSysFlag(String patientId, String sysFlag);
/**
*
*
* @param reportDownDto
* @param nurseSubmitTime
* @return
*/
int updateNurseSubmitTime(ReportDownDto reportDownDto, String nurseSubmitTime);
/**
*
*
* @param reportDownDto
* @param doctorSubmitTime
* @return
*/
int updateDoctorSubmitTime(ReportDownDto reportDownDto, String doctorSubmitTime);
/**
*
*/
void insertNurseState(ReportDownDto reportDownDto, String nurseSubmitTime);
/**
*
*/
void insertDoctorState(ReportDownDto reportDownDto, String doctorSubmitTime);
TBasic selectDisDateIsNull( String inPatientNo);
String selectDisDateIsNullJzh(String inPatientNo,String examApplyDate);
}

@ -13,20 +13,27 @@ public interface ITBasicWebService {
@WebMethod
String pushSurveyReport(String xml);
/**
*
* @param xml
* @return
*/
@WebMethod
String EmrDocumentArchive(String xml);
// /**
// * 电子病理采集(梅州人民医院)
// * @param xml
// * @return
// */
// @WebMethod
// String EmrDocumentArchive(String xml);
//
// /**
// * 电子病理撤销(梅州人民医院)
// * @param xml
// * @return
// */
// @WebMethod
// String EmrDocumentArchiveCancel(String xml);
/**
*
* @param xml
*
* @return
*/
@WebMethod
String EmrDocumentArchiveCancel(String xml);
String outPatient(String xml);
}

@ -2,29 +2,45 @@ package com.docus.bgts.handler;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.docus.bgts.entity.*;
import com.docus.bgts.enums.Codes;
import com.docus.bgts.facade.IAfCollectTaskService;
import com.docus.bgts.facade.IMrReportErrorService;
import com.docus.bgts.mapper.TBasicExtendMapper;
import com.docus.bgts.mapper.TBasicMapper;
import com.docus.bgts.mapper.TScanAssortMapper;
import com.docus.bgts.utils.FileUtils;
import com.docus.bgts.utils.HttpUtils;
import com.docus.bgts.utils.ResultUtils;
import com.docus.bgts.utils.XmlUtils;
//import com.sun.xml.internal.ws.util.xml.XmlUtil;
import org.apache.commons.lang3.CharEncoding;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.Namespace;
import org.dom4j.io.SAXReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import sun.misc.BASE64Decoder;
import javax.jws.WebService;
import java.io.ByteArrayInputStream;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@WebService
public class TBasicWebService implements ITBasicWebService {
@ -35,6 +51,16 @@ public class TBasicWebService implements ITBasicWebService {
@Autowired
IMrReportErrorService mrReportErrorService;
@Autowired
TBasicMapper tBasicMapper;
@Autowired
TBasicExtendMapper tBasicExtendMapper;
@Autowired
TScanAssortMapper tScanAssortMapper;
// private Object lock = new Object();
private final Logger logger = LoggerFactory.getLogger(getClass());
@ -56,6 +82,7 @@ public class TBasicWebService implements ITBasicWebService {
@Override
public String pushSurveyReport(String xml) {
long l6 = System.currentTimeMillis();
try {
logger.info("报告推送入参:" + xml);
// 1、创建document对象
@ -63,13 +90,22 @@ public class TBasicWebService implements ITBasicWebService {
//解析XML
XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(xml.getBytes("UTF-8")));
//获取数据存在的节点节点
Element elementRoot = xmlUtils.getMsgElement();
//key
String serialnmnKey = String.valueOf(FileUtils.getJsonByName("serialnum"));
String filetitleKey = String.valueOf(FileUtils.getJsonByName("filetitle"));
String downurlKey = String.valueOf(FileUtils.getJsonByName("downurl"));
String nurseSubmitTime = String.valueOf(FileUtils.getJsonByName("nurseSubmitTime"));
String doctorSubmitTime = String.valueOf(FileUtils.getJsonByName("doctorSubmitTime"));
String examApplyDate = String.valueOf(FileUtils.getJsonByName("examApplyDate"));
String inPatientNo = String.valueOf(FileUtils.getJsonByName("inPatientNo"));
//电子病历排序时间
String sortingTimeKey = String.valueOf(FileUtils.getJsonByName("sortingTime"));
// 获取患者主索引号
String empId = String.valueOf(FileUtils.getJsonByName(Codes.EMP_ID.getMessage()));
//电子病历封存id
String seal = String.valueOf(FileUtils.getJsonByName("sealId"));
//判断是否为撤销
String isJudge = String.valueOf(FileUtils.getJsonByName("isJudge"));
if (StringUtils.isBlank(isJudge) || isJudge.equals("0")) {
@ -85,14 +121,9 @@ public class TBasicWebService implements ITBasicWebService {
logger.info("------新增/修改------");
} else if (judgeIndexElement.getText().equals("1")) {
logger.info("---------撤回--------");
CanlcelDto canlcelDto = new CanlcelDto();
String serialnum = String.valueOf(FileUtils.getJsonByName("serialnum"));
// Element serialnumElement = elementRoot.element(serialnum);
String serialnumElement = getElementText(elementRoot, serialnum.split(","));;
// if (serialnumElement != null || StringUtils.isBlank(serialnumElement.getText())) {
// throw new RuntimeException("撤回操作时:" + serialnum + "标签不能为空!");
// }
String serialnumElement = getElementText(elementRoot, serialnum.split(","));
canlcelDto.setSerialnum(serialnumElement);
//调用上传服务撤销功能
afCollectTaskService.invokeRepoalFile(canlcelDto);
@ -111,7 +142,291 @@ public class TBasicWebService implements ITBasicWebService {
String serialnum;
String filetitle;
String downurl;
String sortingTime;
String assortid;
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
if (collectorid.equals("1")) {
assortid = String.valueOf(FileUtils.getJsonByName("assortid"));
} else {
assortid = getAssortid(elementRoot);
}
reportDownDto = new ReportDownDto();
reportDownDto.setCollectorid(collectorid);
reportDownDto.setAssortid(assortid);
//获取基本数据信息
List<ReportDownScanFileDto> reportDownDtoArr = new ArrayList<>();
reportDownPatientDto = new ReportDownPatientDto();
//获取jzh
String empIdText = getElementText(elementRoot, empId.split(","));
//获取封存id
String sealId = getElementTextCanBeEmpty(elementRoot, seal.split(","));
if (null != sealId && !"".equals(sealId)) {
reportDownPatientDto.setJzh(empIdText);
reportDownPatientDto.setSealId(sealId);
logger.info("封存患者jzh " + empIdText);
reportDownDto.setPatient(reportDownPatientDto);
List<Element> elementList = xmlUtils.getJsonByName(elementRoot);
for (Element element : elementList) {
filetitle = getElementText(element, filetitleKey.split(","));
downurl = getElementText(element, downurlKey.split(","));
//downurl = handleDownUrl(downurl);
//添加护理提交时间
if (collectorid.equals("1")) {
nurseSubmitTime = getElementText(element, nurseSubmitTime.split(","));
afCollectTaskService.updateNurseSubmitTime(reportDownDto, nurseSubmitTime);
afCollectTaskService.insertNurseState(reportDownDto, nurseSubmitTime);
}
//获取电子病历排序时间
sortingTime = getElementTextCanBeEmpty(element, sortingTimeKey.split(","));
//获取采集流水号
serialnum = getElementText(element, serialnmnKey.split(","));
reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(downurl);
reportDownScanFileDto.setFiletitle(filetitle);
reportDownScanFileDto.setSerialnum(serialnum);
reportDownScanFileDto.setSortdate(sortingTime);
reportDownScanFileDto.setFilesource(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))));
reportDownScanFileDto.setFilestoragetype(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))));
//判断是否为base64
if (reportDownScanFileDto.getDownurl().length() > 200) {
reportDownScanFileDto.setFiletype(2);
}
reportDownDtoArr.add(reportDownScanFileDto);
}
if (reportDownDtoArr.size() <= 0) {
throw new RuntimeException("不存在必要的基本信息");
} else {
reportDownDto.setScanfiles(reportDownDtoArr);
}
afCollectTaskService.insertSeal(reportDownDto);
String post = "";
logger.info("--------执行上传功能----------");
Map params = JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class);
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+ ": 上传参数:" + params);
}
long l = System.currentTimeMillis();
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.SEALUPLOAD.getMessage())), headMap, params);
long l1 = System.currentTimeMillis();
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+"请求下载耗时----------" + (l1 - l));
if (StringUtils.isBlank(post)) {
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+"--------上传时出现错误,可能是文件服务没有启动----------");
throw new RuntimeException("封存id--"+reportDownDto.getPatient().getSealId()+"上传时出现错误,可能是文件服务没有启动");
}
Map resMap = JSON.parseObject(post, Map.class);
long l7 = System.currentTimeMillis();
logger.info("接口总耗时--------" + (l7 - l6));
if (String.valueOf(resMap.get("code")).equals("500")) {
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+ "--------上传失败!" + resMap.get("msg"));
throw new RuntimeException("封存id--"+reportDownDto.getPatient().getSealId()+ "上传失败:" + resMap.get("msg"));
} else {
logger.info("----------执行成功-----------");
return ResultUtils.success().asXML();
}
}else {
//病理没有就诊流水号的根据住院号和检查申请日期时间匹配患者
// String empIdText = getElementTextCanBeEmpty(elementRoot, empId.split(","));
// if (null==empIdText||empIdText.equals("")){
// String examApplyDates = getElementText(elementRoot, examApplyDate.split(","));
// String inPatientNos = getElementText(elementRoot, inPatientNo.split(","));
// empIdText = afCollectTaskService.selectJzh(inPatientNos, examApplyDates);
// if (null==empIdText){
// TBasic tBasic = afCollectTaskService.selectDisDateIsNull(inPatientNos);
// if (null!=tBasic){
// empIdText = tBasic.getJzh();
// }else {
// throw new RuntimeException("住院号未匹配到患者");
// }
// }
//
// }
// doctorSubmitTime = getElementText(elementRoot, doctorSubmitTime.split(","));
/**
*
*/
// long l2 = System.currentTimeMillis();
// String patientId = afCollectTaskService.getpatientIdByEmpId(empIdText);
// long l3 = System.currentTimeMillis();
// logger.info("查询patient_id耗时" + (l3 - l2));
// //删除af_downfile表数据
// long l4 = System.currentTimeMillis();
// int i = afCollectTaskService.deleteByPatientIdAndCollectorId(patientId, collectorid);
// long l5 = System.currentTimeMillis();
// logger.info("删除" + empIdText + "af_downfile表" + i + "条数据耗时-----" + (l5 - l4));
// //删除t_scan_assort表数据
// long l8 = System.currentTimeMillis();
// int i1 = afCollectTaskService.deleteByPatientIdAndAssortId(patientId, assortid);
// long l11 = System.currentTimeMillis();
// logger.info("删除" + empIdText + "t_scan_assort表" + i1 + "条数据耗时-----" + (l11 - l8));
// //删除af_collect_task表数据
// long l9 = System.currentTimeMillis();
// int i2 = afCollectTaskService.deleteByPatientIdAndSysFlag(patientId, collectorid);
// long l10 = System.currentTimeMillis();
// logger.info("删除" + empIdText + "af_collect_task表" + i2 + "条数据耗时-----" + (l10 - l9));
reportDownPatientDto.setJzh(empIdText);
logger.info("患者主索引号:" + empIdText);
reportDownDto.setPatient(reportDownPatientDto);
List<Element> elementList = xmlUtils.getJsonByName(elementRoot);
for (Element element : elementList) {
filetitle = getElementText(element, filetitleKey.split(","));
downurl = getElementText(element, downurlKey.split(","));
//downurl = handleDownUrl(downurl);
//添加护理提交时间
if (collectorid.equals("1")) {
nurseSubmitTime = getElementText(element, nurseSubmitTime.split(","));
afCollectTaskService.updateNurseSubmitTime(reportDownDto, nurseSubmitTime);
afCollectTaskService.insertNurseState(reportDownDto, nurseSubmitTime);
}
//获取电子病历排序时间
// sortingTime = getElementTextCanBeEmpty(element, sortingTimeKey.split(","));
//获取采集流水号
serialnum = getElementText(element, serialnmnKey.split(","));
reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(downurl);
reportDownScanFileDto.setFiletitle(filetitle);
reportDownScanFileDto.setSerialnum(serialnum);
// reportDownScanFileDto.setSortdate(sortingTime);
reportDownScanFileDto.setFilesource(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))));
reportDownScanFileDto.setFilestoragetype(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))));
//判断是否为base64
if (reportDownScanFileDto.getDownurl().length() > 200) {
reportDownScanFileDto.setFiletype(2);
}
reportDownDtoArr.add(reportDownScanFileDto);
}
if (reportDownDtoArr.size() <= 0) {
throw new RuntimeException("不存在必要的基本信息");
} else {
reportDownDto.setScanfiles(reportDownDtoArr);
}
if (collectorid.equals("22")) {
//查询正式住院患者信息
TBasic tBasic = tBasicMapper.selectByjzh(empIdText);
if (null != tBasic) {
//查询预住院患者信息
TBasicExtend tBasicExtend = tBasicExtendMapper.selectByPatientId(tBasic.getPatientId());
if (null != tBasicExtend) {
TBasic tBasicPre = tBasicMapper.selectByjzh(tBasicExtend.getPreJzh());
if (null != tBasicPre) {
int pre = tScanAssortMapper.updateByPatientId(tBasic.getPatientId(), tBasicPre.getPatientId());
if (pre <= 0) {
logger.info("当前预住院没有文件!");
} else {
logger.info("本次预住院合并" + pre + "份报告");
}
} else {
logger.info("未查询到预住院患者信息!");
}
}
}
}
//插入医生提交时间
// afCollectTaskService.updateDoctorSubmitTime(reportDownDto, doctorSubmitTime);
//插入医生提交状态
// afCollectTaskService.insertDoctorState(reportDownDto, doctorSubmitTime);
//插入文件af_collect_task表数据
// synchronized (lock) {
// System.err.println(reportDownDto);
afCollectTaskService.insert(reportDownDto);
// }
String post = "";
logger.info("--------执行上传功能----------");
Map params = JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class);
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
logger.info(reportDownDto.getPatient().getJzh() + ": 上传参数:" + params);
}
long l = System.currentTimeMillis();
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, params);
long l1 = System.currentTimeMillis();
logger.info("请求下载耗时----------" + (l1 - l));
// String post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), map, headMap);
if (StringUtils.isBlank(post)) {
logger.info("--------上传时出现错误,可能是文件服务没有启动----------");
throw new RuntimeException("上传时出现错误,可能是文件服务没有启动");
}
Map resMap = JSON.parseObject(post, Map.class);
long l7 = System.currentTimeMillis();
logger.info("接口总耗时--------" + (l7 - l6));
if (String.valueOf(resMap.get("code")).equals("500")) {
logger.info(reportDownDto.getPatient().getJzh() + "--------上传失败!" + resMap.get("msg"));
throw new RuntimeException(reportDownDto.getPatient().getJzh() + "上传失败:" + resMap.get("msg"));
} else {
logger.info("----------执行成功-----------");
return ResultUtils.success().asXML();
}
}
} catch (RuntimeException e) {
e.printStackTrace();
// mrReportErrorService.insert(xml);
logger.error(e.getMessage());
String stackTrace = ExceptionUtils.getStackTrace(e);
logger.info("错误信息----------" + stackTrace);
return ResultUtils.fail(e.getMessage());
} catch (Exception e) {
// mrReportErrorService.insert(xml);
logger.error(e.getMessage());
String stackTrace = ExceptionUtils.getStackTrace(e);
logger.info("错误信息----------" + stackTrace);
e.printStackTrace();
return ResultUtils.fail(e.getMessage());
}
}
/**
*
*
* @param xml
* @return
*/
@Override
public String outPatient(String xml) {
long l6 = System.currentTimeMillis();
try {
logger.info("报告推送入参:" + xml);
// 1、创建document对象
xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" + xml;
//解析XML
XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(xml.getBytes("UTF-8")));
//获取数据存在的节点节点
Element elementRoot = xmlUtils.getMsgElement();
//key
String serialnmnKey = String.valueOf(FileUtils.getJsonByName("serialnum"));
String filetitleKey = String.valueOf(FileUtils.getJsonByName("filetitle"));
String downurlKey = String.valueOf(FileUtils.getJsonByName("downurl"));
// 获取患者主索引号
String empId = String.valueOf(FileUtils.getJsonByName(Codes.EMP_ID.getMessage()));
Map<String, Object> headMap = new HashMap<>();
headMap.put("Content-Type", "application/json");
ReportDownDto reportDownDto;
ReportDownScanFileDto reportDownScanFileDto;
ReportDownPatientDto reportDownPatientDto;
//临时资料存储
String serialnum;
String filetitle;
String downurl;
// String sortingTime;
int filetype = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filetype")));
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
String assortid = getAssortid(elementRoot);
reportDownDto = new ReportDownDto();
reportDownDto.setCollectorid(collectorid);
@ -126,17 +441,15 @@ public class TBasicWebService implements ITBasicWebService {
logger.info("患者主索引号:" + empIdText);
reportDownDto.setPatient(reportDownPatientDto);
List<Element> elementList = xmlUtils.getJsonByName(elementRoot);
for (Element element : elementList) {
filetitle = getElementText(element, filetitleKey.split(","));
downurl = getElementText(element, downurlKey.split(","));
downurl = handleDownUrl(downurl);
//获取采集流水号
serialnum = getElementText(element, serialnmnKey.split(","));
reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(downurl);
reportDownScanFileDto.setDownurl(downurl.substring(1, downurl.length() - 1));
reportDownScanFileDto.setFiletitle(filetitle);
reportDownScanFileDto.setSerialnum(serialnum);
reportDownScanFileDto.setFiletype(filetype);
reportDownScanFileDto.setFilesource(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))));
reportDownScanFileDto.setFilestoragetype(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))));
//判断是否为base64
@ -150,21 +463,28 @@ public class TBasicWebService implements ITBasicWebService {
} else {
reportDownDto.setScanfiles(reportDownDtoArr);
}
//插入文件af_collect_task表数据
afCollectTaskService.insert(reportDownDto);
// System.err.println(reportDownDto);
afCollectTaskService.insertOut(reportDownDto);
String post = "";
logger.info("--------执行上传功能----------");
Map params = JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class);
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
logger.info("上传参数:" + params);
}
logger.info("上传参数:" + params);
long l = System.currentTimeMillis();
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, params);
// String post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), map, headMap);
long l1 = System.currentTimeMillis();
logger.info("请求下载耗时----------" + (l1 - l));
if (StringUtils.isBlank(post)) {
logger.info("--------上传时出现错误,可能是文件服务没有启动----------");
throw new RuntimeException("上传时出现错误,可能是文件服务没有启动");
}
Map resMap = JSON.parseObject(post, Map.class);
long l7 = System.currentTimeMillis();
logger.info("接口总耗时--------" + (l7 - l6));
if (String.valueOf(resMap.get("code")).equals("500")) {
throw new RuntimeException(String.valueOf(resMap.get("msg")));
} else {
@ -173,11 +493,15 @@ public class TBasicWebService implements ITBasicWebService {
}
} catch (RuntimeException e) {
e.printStackTrace();
mrReportErrorService.insert(xml);
logger.error(e.getMessage());
// String stackTrace = ExceptionUtils.getStackTrace(e);
// logger.info("错误信息----------"+stackTrace);
return ResultUtils.fail(e.getMessage());
} catch (Exception e) {
logger.error(e.getMessage());
// String stackTrace = ExceptionUtils.getStackTrace(e);
// logger.info("错误信息----------"+stackTrace);
e.printStackTrace();
mrReportErrorService.insert(xml);
return ResultUtils.fail(e.getMessage());
}
}
@ -191,82 +515,52 @@ public class TBasicWebService implements ITBasicWebService {
private String handleDownUrl(String downurl) {
String url = "";
try {
XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(downurl.getBytes("UTF-8")));
if (null != xmlUtils) {
url=downurl;
url = downurl.replaceAll("<REST>", "");
url = url.replaceAll("</REST>", "");
url = url.replaceAll("<SQW>", "");
url = url.replaceAll("</SQW>", "");
}
} catch (Exception e) {
}
int pdfIndex = -1;
int httpIndex = downurl.indexOf("http");
if (httpIndex == -1) {
return downurl;
}
if (downurl.indexOf(".pdf") == -1) {
if (downurl.indexOf(".PDF") == -1) {
if (downurl.indexOf(".jpg") == -1) {
if (downurl.indexOf(".JPG") == -1) {
if (downurl.indexOf(".png") == -1) {
if (downurl.indexOf(".PNG") == -1) {
return downurl;
} else {
pdfIndex = downurl.indexOf(".PNG") + 4;
}
} else {
pdfIndex = downurl.indexOf(".png") + 4;
}
} else {
pdfIndex = downurl.indexOf(".JPG") + 4;
}
} else {
pdfIndex = downurl.indexOf(".jpg") + 4;
url = downurl;
List<String> urlReplaces = (List<String>) FileUtils.getJsonByName("urlReplace");
for (String urlReplace : urlReplaces) {
url = url.replaceAll(urlReplace, "");
}
} else {
pdfIndex = downurl.indexOf(".PDF") + 4;
return url;
}
} else {
pdfIndex = downurl.indexOf(".pdf") + 4;
}
url = downurl.substring(httpIndex, pdfIndex);
return url;
}
@Override
public String EmrDocumentArchive(String xml) {
return pushSurveyReport(xml);
}
@Override
public String EmrDocumentArchiveCancel(String xml) {
try {
logger.info("--------------撤销接收到xml--------------");
logger.info(xml);
//解析xml并提取CanlcelDto对象
CanlcelDto canlcelDto = getCanlCelDtoByXml(xml);
//调用上传服务撤销功能
afCollectTaskService.invokeRepoalFile(canlcelDto);
logger.info("--------------撤销操作完成-------------");
return ResultUtils.success().asXML();
} catch (RuntimeException e) {
logger.info("发送错误:" + e.getMessage());
mrReportErrorService.insert(xml);
e.printStackTrace();
return ResultUtils.fail(e.getMessage());
} catch (Exception e) {
logger.info("发送错误:" + e.getMessage());
e.printStackTrace();
mrReportErrorService.insert(xml);
return ResultUtils.fail(e.getMessage());
}
return "";
}
// @Override
// public String EmrDocumentArchive(String xml) {
// return pushSurveyReport(xml);
// }
//
// @Override
// public String EmrDocumentArchiveCancel(String xml) {
// try {
// logger.info("--------------撤销接收到xml--------------");
// logger.info(xml);
// //解析xml并提取CanlcelDto对象
// CanlcelDto canlcelDto = getCanlCelDtoByXml(xml);
// //调用上传服务撤销功能
// afCollectTaskService.invokeRepoalFile(canlcelDto);
// logger.info("--------------撤销操作完成-------------");
// return ResultUtils.success().asXML();
// } catch (RuntimeException e) {
// logger.info("发送错误:" + e.getMessage());
// // mrReportErrorService.insert(xml);
// e.printStackTrace();
// return ResultUtils.fail(e.getMessage());
// } catch (Exception e) {
// logger.info("发送错误:" + e.getMessage());
// e.printStackTrace();
// // mrReportErrorService.insert(xml);
// return ResultUtils.fail(e.getMessage());
// }
//
// }
/**
* xmlCanlcelDto
*
@ -344,6 +638,50 @@ public class TBasicWebService implements ITBasicWebService {
return resText;
}
/**
* key
*
* @param element
* @param args
* @return
*/
private String getElementTextCanBeEmpty(Element element, String[] args) {
String resText = "";
Element byElement = (Element) element.clone();
Element byElement1 = null;
String[] split;
for (String arg : args) {
split = arg.split("&");
if (split.length > 1) {
for (String spi : split) {
if (byElement1 == null) {
byElement1 = byElement.element(spi);
} else {
byElement1 = byElement1.element(spi);
}
if (byElement1 != null && StringUtils.isNotBlank(byElement1.getText())) {
break;
} else {
byElement1 = null;
}
}
} else {
if (byElement1 == null) {
byElement1 = byElement.element(arg);
} else {
byElement1 = byElement1.element(arg);
}
}
if (byElement1 != null) {
resText = byElement1.getText();
} else {
break;
}
}
return resText;
}
/**
* id
@ -380,4 +718,42 @@ public class TBasicWebService implements ITBasicWebService {
}
return assortId;
}
public static void depdf() {
// 存放pdf的base64
Path path = Paths.get("D:\\pdf.txt");
Stream<String> lines = null;
try {
lines = Files.lines(path);
} catch (IOException e) {
e.printStackTrace();
}
// 读取文件转换为String
String collect = lines.collect(Collectors.joining(System.lineSeparator()));
String encodedBytes = collect;
BASE64Decoder decoder = new BASE64Decoder();
byte[] decodedBytes = new byte[0];
try {
decodedBytes = decoder.decodeBuffer(encodedBytes);
} catch (IOException e) {
e.printStackTrace();
}
File file = new File("D:\\newfile.pdf");
FileOutputStream fop = null;
try {
fop = new FileOutputStream(file);
fop.write(decodedBytes);
fop.flush();
fop.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
depdf();
}
}

@ -3,6 +3,8 @@ package com.docus.bgts.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.bgts.entity.AfCollectTask;
import com.docus.bgts.entity.CqcSubmitState;
import com.docus.bgts.entity.TBasic;
import com.docus.bgts.entity.ZdAssort;
import org.apache.ibatis.annotations.Param;
@ -27,6 +29,21 @@ public interface AfCollectTaskMapper extends BaseMapper<AfCollectTask> {
*/
String getpatientIdByEmpId(@Param("jzh") String empId);
/**
* idpatient_id
* @param sealId
* @return
*/
String getPatientIdBysealId(@Param("sealId") String sealId);
String selectJzh(@Param("inPatientNo") String inPatientNo,@Param("examApplyDate") String examApplyDate);
TBasic selectDisDateIsNull(@Param("inPatientNo") String inPatientNo);
String selectDisDateIsNullJzh(@Param("inPatientNo") String inPatientNo,@Param("examApplyDate") String examApplyDate);
/**
* assortId assortId
* @param assortId
@ -46,4 +63,39 @@ public interface AfCollectTaskMapper extends BaseMapper<AfCollectTask> {
* @param zdAssort
*/
void insertZdAssort(@Param("zdAssort") ZdAssort zdAssort);
/**
* af_downfile
*/
int deleteByPatientIdAndCollectorId(@Param("patientId") String patientId,@Param("collectorId") String collectorId);
/**
* t_scan_assort
*/
int deleteByPatientIdAndAssortId(@Param("patientId") String patientId,@Param("assortId") String assortId);
/**
* af_collect_task
*/
int deleteByPatientIdAndSysFlag(@Param("patientId") String patientId,@Param("sysFlag") String sysFlag);
/**
*
*/
int insertDoctorState(CqcSubmitState cqcSubmitState);
/**
*
*/
int updateDoctorState(CqcSubmitState cqcSubmitState);
/**
* patientId
* @param patientId
* @return
*/
CqcSubmitState selectByPatientId(String patientId);
String selectPatientByjzh(String jzh);
String selectNameByPatientId(String patientId);
}

@ -0,0 +1,20 @@
package com.docus.bgts.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.bgts.entity.TBasicExtend;
/**
* <p>
* Mapper
* </p>
*
* @author jiashi
* @since 2022-06-13
*/
public interface TBasicExtendMapper extends BaseMapper<TBasicExtend> {
TBasicExtend selectByPatientId(String patientId);
int updatenurseSubmitTime(TBasicExtend tBasicExtend);
int updateDoctorSubmitTime(TBasicExtend tBasicExtend);
}

@ -0,0 +1,21 @@
package com.docus.bgts.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.bgts.entity.TBasic;
/**
* <p>
* Mapper
* </p>
*
* @author jiashi
* @since 2021-04-14
*/
public interface TBasicMapper extends BaseMapper<TBasic> {
TBasic selectByjzh(String jzh);
TBasic selectByPatientId(String patientId);
int update(TBasic tbasic);
}

@ -0,0 +1,17 @@
package com.docus.bgts.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.bgts.entity.TBasic;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* Mapper
* </p>
*
* @author jiashi
* @since 2022-11-21
*/
public interface TScanAssortMapper extends BaseMapper<TBasic> {
int updateByPatientId(@Param("patientId") String PatientId,@Param("PrePatientId") String PrePatientId);
}

@ -7,11 +7,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.docus.bgts.entity.*;
import com.docus.bgts.enums.Codes;
import com.docus.bgts.facade.IAfCollectTaskService;
import com.docus.bgts.mapper.AfCollectTaskMapper;
import com.docus.bgts.mapper.AfInterfaceCollectMapper;
import com.docus.bgts.mapper.AfInterfaceCollectSubMapper;
import com.docus.bgts.mapper.*;
import com.docus.bgts.utils.FileUtils;
import com.docus.bgts.utils.HttpUtils;
import com.docus.bgts.utils.ResultUtils;
import com.docus.bgts.utils.XmlUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -22,10 +21,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* <p>
@ -49,12 +46,92 @@ public class AfCollectTaskServiceImpl extends ServiceImpl<AfCollectTaskMapper, A
@Autowired
AfInterfaceCollectSubMapper afInterfaceCollectSubMapper;
@Autowired
TBasicExtendMapper tBasicExtendMapper;
@Autowired
TBasicMapper tBasicMapper;
@Override
public String getpatientIdByEmpId(String empId) {
String patientId = afCollectTaskMapper.getpatientIdByEmpId(empId);
return patientId;
}
@Override
public String getpatientIdBysealId(String sealId) {
return afCollectTaskMapper.getPatientIdBysealId(sealId);
}
@Override
public String getNameByPatientId(String patientId) {
return afCollectTaskMapper.selectNameByPatientId(patientId);
}
@Override
public String getOutpatientIdByJzhel(String jzh) {
return afCollectTaskMapper.selectPatientByjzh(jzh);
}
@Transactional
@Override
public void insertOut(ReportDownDto reportDownDto) {
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
log.info("新增任务表初始数据:" + reportDownDto);
}
AfCollectTask afCollectTask;
String patientId = getOutpatientIdByJzhel(reportDownDto.getPatient().getJzh());
if (StringUtils.isBlank(patientId)) {
throw new RuntimeException("操作的病案信息不存在");
}
Date date = new Date();
Integer save = null;
List<ReportDownScanFileDto> scanfiles = reportDownDto.getScanfiles();
for (ReportDownScanFileDto scanfile : scanfiles) {
long l = System.currentTimeMillis();
// 判断任务是否已存在
afCollectTask = afCollectTaskMapper.selectOne(new QueryWrapper<AfCollectTask>().eq("C1", scanfile.getSerialnum()).eq("sysflag", reportDownDto.getCollectorid()));
if (afCollectTask == null || afCollectTask.getId() == null) {
//不存在 新增
afCollectTask = new AfCollectTask();
afCollectTask.setPatientId(patientId);
afCollectTask.setSysflag(reportDownDto.getCollectorid());
afCollectTask.setState("0");
afCollectTask.setSyncTime(date);
afCollectTask.setC1(scanfile.getSerialnum());
afCollectTask.setC2(scanfile.getFiletitle());
afCollectTask.setC3(reportDownDto.getPatient().getJzh());
save = afCollectTaskMapper.insert(afCollectTask);
} else {
//存在就修改
afCollectTask.setPatientId(patientId);
afCollectTask.setSysflag(reportDownDto.getCollectorid());
afCollectTask.setState("0");
afCollectTask.setSyncTime(date);
afCollectTask.setC1(scanfile.getSerialnum());
afCollectTask.setC2(scanfile.getFiletitle());
afCollectTask.setC3(reportDownDto.getPatient().getJzh());
save = afCollectTaskMapper.updateById(afCollectTask);
}
if (save <= 0) {
log.info("任务表操作出错");
throw new RuntimeException("插入病案任务表数据出错");
}
if (afCollectTask.getId() != null) {
scanfile.setTaskid(afCollectTask.getId());
} else {
log.info("插入任务id为空");
throw new RuntimeException("插入任务id为空");
}
}
reportDownDto.setScanfiles(scanfiles);
}
@Transactional
@Override
public void insert(ReportDownDto reportDownDto) {
@ -70,9 +147,11 @@ public class AfCollectTaskServiceImpl extends ServiceImpl<AfCollectTaskMapper, A
Integer save = null;
List<ReportDownScanFileDto> scanfiles = reportDownDto.getScanfiles();
for (ReportDownScanFileDto scanfile : scanfiles) {
long l = System.currentTimeMillis();
// 判断任务是否已存在
afCollectTask = afCollectTaskMapper.selectOne(new QueryWrapper<AfCollectTask>().eq("C1", scanfile.getSerialnum()).eq("sysflag", reportDownDto.getCollectorid()));
if (afCollectTask == null) {
if (afCollectTask == null || afCollectTask.getId() == null) {
//不存在 新增
afCollectTask = new AfCollectTask();
afCollectTask.setPatientId(patientId);
@ -83,7 +162,9 @@ public class AfCollectTaskServiceImpl extends ServiceImpl<AfCollectTaskMapper, A
afCollectTask.setC2(scanfile.getFiletitle());
afCollectTask.setC3(reportDownDto.getPatient().getJzh());
save = afCollectTaskMapper.insert(afCollectTask);
} else {
//存在就修改
afCollectTask.setPatientId(patientId);
afCollectTask.setSysflag(reportDownDto.getCollectorid());
@ -93,13 +174,77 @@ public class AfCollectTaskServiceImpl extends ServiceImpl<AfCollectTaskMapper, A
afCollectTask.setC2(scanfile.getFiletitle());
afCollectTask.setC3(reportDownDto.getPatient().getJzh());
save = afCollectTaskMapper.updateById(afCollectTask);
}
if (save <= 0) {
log.info("任务表操作出错");
throw new RuntimeException("插入病案任务表数据出错");
}
scanfile.setTaskid(afCollectTask.getId());
if (afCollectTask.getId() != null) {
scanfile.setTaskid(afCollectTask.getId());
} else {
log.info("插入任务id为空");
throw new RuntimeException("插入任务id为空");
}
}
reportDownDto.setScanfiles(scanfiles);
}
@Override
public void insertSeal(ReportDownDto reportDownDto) {
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
log.info("新增封存任务表初始数据:" + reportDownDto);
}
AfCollectTask afCollectTask;
String patientId = getpatientIdBysealId(reportDownDto.getPatient().getSealId());
if (StringUtils.isBlank(patientId)) {
throw new RuntimeException("操作的病案信息不存在");
}
reportDownDto.getPatient().setPatientid(patientId);
Date date = new Date();
Integer save = null;
List<ReportDownScanFileDto> scanfiles = reportDownDto.getScanfiles();
for (ReportDownScanFileDto scanfile : scanfiles) {
long l = System.currentTimeMillis();
// 判断任务是否已存在
afCollectTask = afCollectTaskMapper.selectOne(new QueryWrapper<AfCollectTask>().eq("C1", scanfile.getSerialnum()).eq("sysflag", reportDownDto.getCollectorid()));
if (afCollectTask == null || afCollectTask.getId() == null) {
//不存在 新增
afCollectTask = new AfCollectTask();
afCollectTask.setPatientId(patientId);
afCollectTask.setSysflag(reportDownDto.getCollectorid());
afCollectTask.setState("0");
afCollectTask.setSyncTime(date);
afCollectTask.setC1(scanfile.getSerialnum());
afCollectTask.setC2(scanfile.getFiletitle());
afCollectTask.setC3(reportDownDto.getPatient().getJzh());
save = afCollectTaskMapper.insert(afCollectTask);
} else {
//存在就修改
afCollectTask.setPatientId(patientId);
afCollectTask.setSysflag(reportDownDto.getCollectorid());
afCollectTask.setState("0");
afCollectTask.setSyncTime(date);
afCollectTask.setC1(scanfile.getSerialnum());
afCollectTask.setC2(scanfile.getFiletitle());
afCollectTask.setC3(reportDownDto.getPatient().getJzh());
save = afCollectTaskMapper.updateById(afCollectTask);
}
if (save <= 0) {
log.info("封存任务表操作出错");
throw new RuntimeException("封存插入病案任务表数据出错");
}
if (afCollectTask.getId() != null) {
scanfile.setTaskid(afCollectTask.getId());
} else {
log.info("封存插入任务id为空");
throw new RuntimeException("封存插入任务id为空");
}
}
reportDownDto.setScanfiles(scanfiles);
}
@ -146,6 +291,11 @@ public class AfCollectTaskServiceImpl extends ServiceImpl<AfCollectTaskMapper, A
}
}
@Override
public String selectJzh(String inPatientNo, String examApplyDate) {
return afCollectTaskMapper.selectJzh(inPatientNo, examApplyDate);
}
@Override
public String getAssortIdByAssortId(String assortId) {
return afCollectTaskMapper.getAssortIdByAssortId(assortId);
@ -161,4 +311,188 @@ public class AfCollectTaskServiceImpl extends ServiceImpl<AfCollectTaskMapper, A
afCollectTaskMapper.insertZdAssort(zdAssort);
}
@Override
public int deleteByPatientIdAndCollectorId(String patientId, String collectorId) {
return afCollectTaskMapper.deleteByPatientIdAndCollectorId(patientId, collectorId);
}
@Override
public int deleteByPatientIdAndAssortId(String patientId, String assortId) {
return afCollectTaskMapper.deleteByPatientIdAndAssortId(patientId, assortId);
}
@Override
public int deleteByPatientIdAndSysFlag(String patientId, String sysFlag) {
return afCollectTaskMapper.deleteByPatientIdAndSysFlag(patientId, sysFlag);
}
@Override
public int updateNurseSubmitTime(ReportDownDto reportDownDto, String nurseSubmitTime) {
String patientId = getpatientIdByEmpId(reportDownDto.getPatient().getJzh());
TBasicExtend tBasicExtend = tBasicExtendMapper.selectByPatientId(patientId);
int update = 0;
try {
//TBasicExtend存在修改不存在就新增
if (null != tBasicExtend) {
//暂时使用当前时间为提交时间
tBasicExtend.setNurseSubmitTime(new Date());
// tBasicExtend.setNurseSubmitTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(nurseSubmitTime));
update = tBasicExtendMapper.updatenurseSubmitTime(tBasicExtend);
if (null != patientId && null != tBasicExtend.getNurseSubmitTime()) {
String name = getNameByPatientId(patientId);
Map<String, Object> headMap = new HashMap<>();
headMap.put("Content-Type", "application/json");
Map<String, List<String>> params = new HashMap<>();
List<String> list = new ArrayList<>();
list.add("护士");
list.add(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(tBasicExtend.getNurseSubmitTime()));
params.put(patientId, list);
params = JSON.parseObject(JSON.toJSONString(params), Map.class);
String post = HttpUtils.postSubmit("http://192.9.100.171:9102/basic/tlog/saveLog?nodeCode=again_submit&" + "userName=" + name + "&" + "name=" + name, headMap, params);
Map resMap = JSON.parseObject(post, Map.class);
long l7 = System.currentTimeMillis();
if (String.valueOf(resMap.get("code")).equals("500")) {
throw new RuntimeException(String.valueOf(resMap.get("msg")));
} else {
System.err.println("返回值为--" + resMap);
}
}
} else {
TBasicExtend tBasicExtend1 = new TBasicExtend();
tBasicExtend1.setPatientId(patientId);
//暂时使用当前时间为提交时间
// tBasicExtend1.setNurseSubmitTime(new Date());
tBasicExtend1.setNurseSubmitTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(nurseSubmitTime));
update = tBasicExtendMapper.insert(tBasicExtend1);
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}
return update;
}
@Override
public int updateDoctorSubmitTime(ReportDownDto reportDownDto, String doctorSubmitTime) {
String patientId = getpatientIdByEmpId(reportDownDto.getPatient().getJzh());
TBasicExtend tBasicExtend = tBasicExtendMapper.selectByPatientId(patientId);
int update = 0;
log.info("医生提交方法------");
try {
SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date submitTime = simple.parse(doctorSubmitTime);
//TBasicExtend存在修改不存在就新增
if (null != tBasicExtend) {
tBasicExtend.setDoctorSubmitTime(submitTime);
update = tBasicExtendMapper.updateDoctorSubmitTime(tBasicExtend);
try {
if (null != patientId && null != tBasicExtend.getDoctorSubmitTime()) {
String name = getNameByPatientId(patientId);
Map<String, Object> headMap = new HashMap<>();
headMap.put("Content-Type", "application/json");
Map<String, List<String>> params = new HashMap<>();
List<String> list = new ArrayList<>();
list.add("医生");
list.add(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(tBasicExtend.getDoctorSubmitTime()));
params.put(patientId, list);
params = JSON.parseObject(JSON.toJSONString(params), Map.class);
long l = System.currentTimeMillis();
String post = HttpUtils.postSubmit("http://192.9.100.171:9102/basic/tlog/saveLog?nodeCode=again_submit&" + "userName=" + name + "&" + "name=" + name, headMap, params);
long l1 = System.currentTimeMillis();
log.info("调用示踪接口耗时{}", (l1 - l));
Map resMap = JSON.parseObject(post, Map.class);
long l7 = System.currentTimeMillis();
if (String.valueOf(resMap.get("code")).equals("500")) {
log.info("调用示踪接口返回----" + resMap);
throw new RuntimeException(String.valueOf(resMap.get("msg")));
} else {
log.info("调用示踪接口返回----" + resMap);
}
} else {
log.info("未调用示踪接口-----");
}
} catch (Exception e) {
log.error(e.getMessage());
}
} else {
TBasicExtend tBasicExtend1 = new TBasicExtend();
tBasicExtend1.setPatientId(patientId);
tBasicExtend1.setDoctorSubmitTime(submitTime);
update = tBasicExtendMapper.insert(tBasicExtend1);
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}
return update;
}
@Override
public void insertNurseState(ReportDownDto reportDownDto, String nurseSubmitTime) {
TBasic tBasic = tBasicMapper.selectByjzh(reportDownDto.getPatient().getJzh());
if (null == tBasic) {
throw new RuntimeException("操作的病案信息不存在");
}
if (null != nurseSubmitTime && !("").equals(nurseSubmitTime)) {
tBasic.setNurseState(1);
int update = tBasicMapper.update(tBasic);
if (update > 0) {
log.info("护士提交状态修改成功!");
}else {
log.info("护士提交状态修改失败!");
}
} else {
tBasic.setNurseState(0);
int update = tBasicMapper.update(tBasic);
if (update > 0) {
log.info("护士提交状态修改成功!");
}else {
log.info("护士提交状态修改失败!");
}
}
}
@Override
public void insertDoctorState(ReportDownDto reportDownDto, String doctorSubmitTime) {
TBasic tBasic = tBasicMapper.selectByjzh(reportDownDto.getPatient().getJzh());
if (null == tBasic) {
throw new RuntimeException("操作的病案信息不存在");
}
if (null != doctorSubmitTime && !("").equals(doctorSubmitTime)) {
tBasic.setDoctorState(1);
int update = tBasicMapper.update(tBasic);
if (update > 0) {
log.info("医生提交状态修改成功!");
}else {
log.info("医生提交状态修改失败!");
}
} else {
tBasic.setDoctorState(0);
int update = tBasicMapper.update(tBasic);
if (update > 0) {
log.info("医生提交状态修改成功!");
}else {
log.info("医生提交状态修改失败!");
}
}
}
@Override
public TBasic selectDisDateIsNull(String inPatientNo) {
return afCollectTaskMapper.selectDisDateIsNull(inPatientNo);
}
@Override
public String selectDisDateIsNullJzh(String inPatientNo, String examApplyDate) {
return afCollectTaskMapper.selectDisDateIsNullJzh(inPatientNo, examApplyDate);
}
}

@ -1,6 +1,7 @@
package com.docus.bgts.utils;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
@ -14,18 +15,23 @@ import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Slf4j
public class HttpUtils {
private static PoolingHttpClientConnectionManager cm;
private static String EMPTY_STR = "";
private static String UTF_8 = "UTF-8";
private static void init() {
if (cm == null) {
cm = new PoolingHttpClientConnectionManager();
@ -141,12 +147,27 @@ public class HttpUtils {
httpPost.addHeader(param.getKey(), String.valueOf(param.getValue()));
}
}
log.info("调用下载参数----" + JSON.toJSONString(params));
httpPost.setEntity(new StringEntity(JSON.toJSONString(params), ContentType.APPLICATION_JSON));
return getResult(httpPost);
}
public static String postSubmit(String url, Map<String, Object> headers, Map<String, List<String>> params)
throws UnsupportedEncodingException {
HttpPost httpPost = new HttpPost(url);
if (params != null) {
for (Map.Entry<String, Object> param : headers.entrySet()) {
httpPost.addHeader(param.getKey(), String.valueOf(param.getValue()));
}
}
httpPost.setEntity(new StringEntity(JSON.toJSONString(params), ContentType.APPLICATION_JSON));
return getResult(httpPost);
}
/**
* Http
*

@ -35,11 +35,16 @@ public class XmlUtils {
}
}
public XmlUtils(InputStream path) throws Exception{
public XmlUtils(InputStream path){
//获取解析器
saxReader = new SAXReader();
try{
//获取文档对象
document = saxReader.read(path);
}catch (DocumentException e){
e.printStackTrace();
}
}

@ -1,5 +1,5 @@
server:
port: 9701
port: 9205
# http
mybatis-plus:
@ -15,8 +15,8 @@ beat:
url: http://localhost:9399/beat
system:
code: "EmrDocAr"
prop: 9801
code: "empcllect"
prop: 9405
# web service
@ -25,4 +25,4 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
username: docus
password: docus702
url: jdbc:mysql://db.docus.cn:3306/docus_archivefile?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
url: jdbc:mysql://localhost:3306/docus_archivefile?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&allowMultiQueries=true

@ -21,8 +21,8 @@
<!-- 活动文件的名字会根据fileNamePattern的值每隔一段时间改变一次 -->
<!-- 文件名log/demo.2017-12-05.0.log -->
<fileNamePattern>log/demo.%d.%i.log</fileNamePattern>
<!-- 每产生一个日志文件,该日志文件的保存期限为15-->
<maxHistory>15</maxHistory>
<!-- 每产生一个日志文件,该日志文件的保存期限为30-->
<maxHistory>90</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- maxFileSize:这是活动文件的大小默认值是10MB测试时可改成1KB看效果 -->
<maxFileSize>10MB</maxFileSize>

@ -4,6 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.bgts.mapper.AfCollectTaskMapper">
<select id="listJZHByDate" resultType="string">
select jzh
from docus_medicalrecord.t_basic a
@ -17,7 +18,32 @@
(select C3 from af_collect_task where sysflag=22 and state=3)
order by create_time asc
</select>
<select id="selectDisDateIsNull" resultType="com.docus.bgts.entity.TBasic">
select *
from docus_medicalrecord.t_basic
where inpatient_no=#{inPatientNo}
and dis_date is null
</select>
<select id="selectDisDateIsNullJzh" resultType="string">
select t.jzh
from(
select admiss_date,dis_date,jzh
from docus_medicalrecord.t_basic
where inpatient_no=#{inPatientNo} and dis_date is null and ph is null
) t
where date_sub(t.admiss_date, interval 6 hour) &lt;= #{examApplyDate}
</select>
<select id="selectJzh" resultType="string">
select t.jzh
from(
select admiss_date,dis_date,jzh,ph
from docus_medicalrecord.t_basic
where inpatient_no=#{inPatientNo}
) t
where date_sub(t.admiss_date, interval 6 hour) &lt;= #{examApplyDate}
and date_add(t.dis_date, interval 6 hour) &gt;= #{examApplyDate}
and t.ph is null
</select>
<select id="getpatientIdByEmpId" resultType="string">
select patient_id
from docus_medicalrecord.t_basic
@ -32,7 +58,58 @@
select assort_id from zd_assort where assort_name=#{assortName}
</select>
<insert id="insertZdAssort">
insert into zd_assort(assort_id,assort_name,effective) values(#{zdAssort.assortId},#{zdAssort.assortName},#{zdAssort.effective})
</insert>
<delete id="deleteByPatientIdAndCollectorId">
delete from af_downfile where
patient_id=#{patientId} and collectorid=#{collectorId}
</delete>
<delete id="deleteByPatientIdAndAssortId">
delete from t_scan_assort where
patient_id=#{patientId} and assort_id=#{assortId}
</delete>
<delete id="deleteByPatientIdAndSysFlag">
delete from af_collect_task where
patient_id=#{patientId} and sysflag=#{sysFlag}
</delete>
<insert id="insertDoctorState">
insert into docus_medicalrecord.cqc_submit_state(patient_id,doctor_state,nurse_state) values(#{patientId},#{doctorState},#{nurseState})
</insert>
<update id="updateDoctorState">
update docus_medicalrecord.cqc_submit_state
<set>
<if test="doctorState!=null">
doctor_state=#{doctorState},
</if>
<if test="nurseState!=null">
nurse_state=#{nurseState},
</if>
</set>
where patient_id=#{patientId}
</update>
<select id="selectByPatientId" resultType="com.docus.bgts.entity.CqcSubmitState">
select * from docus_medicalrecord.cqc_submit_state
where patient_id=#{patientId}
</select>
<select id="selectPatientByjzh" resultType="java.lang.String">
select patient_id
from docus_medicalrecord.t_basic_out
where jzh=#{jzh}
</select>
<select id="selectNameByPatientId" resultType="java.lang.String">
select creater_name from docus_medicalrecord.cqc_back_info_log where patient_id=#{patientId} and create_time in
(select max(create_time) from docus_medicalrecord.cqc_back_info_log where patient_id=#{patientId})
</select>
<select id="getPatientIdBysealId" resultType="java.lang.String">
select patient_id from docus_medicalrecord.t_seal where seal_id=#{sealId}
</select>
</mapper>

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.bgts.mapper.TBasicExtendMapper">
<update id="updatenurseSubmitTime">
update docus_medicalrecord.t_basic_extend
set nurse_submit_time=#{nurseSubmitTime}
where patient_id=#{patientId}
</update>
<update id="updateDoctorSubmitTime">
update docus_medicalrecord.t_basic_extend
set doctor_submit_time=#{doctorSubmitTime}
where patient_id=#{patientId}
</update>
<select id="selectByPatientId" resultType="com.docus.bgts.entity.TBasicExtend">
select *
from
docus_medicalrecord.t_basic_extend
where patient_id=#{patientId}
</select>
<insert id="insert" parameterType="com.docus.bgts.entity.TBasicExtend">
insert into docus_medicalrecord.t_basic_extend (patient_id,claim_policy_code,claim_policy_name,mio_settle_type_code,mio_settle_type_name,doctor_submit_time,nurse_submit_time,duty_nurse)
values (#{patientId},#{claimPolicyCode},#{claimPolicyName},#{mioSettleTypeCode},#{mioSettleTypeName},#{doctorSubmitTime},#{nurseSubmitTime},#{dutyNurse})
</insert>
</mapper>

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.bgts.mapper.TBasicMapper">
<update id="updateDisDate">
update docus_medicalrecord.t_basic
<set>
<if test="tBasic.admiss_times != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
</set>
where id=#{pcmachine.id}
</update>
<update id="update" parameterType="com.docus.bgts.entity.TBasic">
UPDATE docus_medicalrecord.t_basic
<set>
<if test="null != doctorState and '' != doctorState">doctor_state = #{doctorState},</if>
<if test="null != nurseState and '' != nurseState">nurse_state = #{nurseState},</if>
</set>
WHERE patient_id = #{patientId}
</update>
<select id="selectByjzh" resultType="com.docus.bgts.entity.TBasic">
SELECT *
FROM docus_medicalrecord.t_basic
WHERE jzh = #{jzh}
</select>
<select id="selectByPatientId" resultType="com.docus.bgts.entity.TBasic">
SELECT *
FROM docus_medicalrecord.t_basic
WHERE patient_id = #{patientId}
</select>
</mapper>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.bgts.mapper.TScanAssortMapper">
<update id="updateByPatientId">
update docus_archivefile.t_scan_assort set patient_id=#{patientId},assort_id='Wiw213woq412awqe42' where patient_id=#{PrePatientId}
</update>
</mapper>
Loading…
Cancel
Save