|
@@ -2,9 +2,11 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.diagbot.biz.push.entity.Lis;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.*;
|
|
|
+import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.facade.data.*;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
@@ -20,6 +22,7 @@ import org.apache.commons.httpclient.methods.PostMethod;
|
|
|
import org.apache.commons.lang.StringEscapeUtils;
|
|
|
import org.apache.commons.httpclient.NameValuePair;
|
|
|
import org.apache.commons.httpclient.methods.PostMethod;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.cxf.endpoint.Client;
|
|
|
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
|
|
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
@@ -34,6 +37,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.temporal.ChronoUnit;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -81,42 +86,88 @@ public class ViewFacade {
|
|
|
*/
|
|
|
public void executeOldData() {
|
|
|
String deptSql = "select * from dept where deptType='临床' and station='住院' ";
|
|
|
- String doctorAdviceSql = "select * from doctor_order where daStartDate >= to_date('"+ DateUtil.yesterdayFormate()+"','yyyy-MM-dd')";
|
|
|
+ String doctorAdviceSql = "select * from doctor_order where daStartDate >= to_date('" + DateUtil.yesterdayFormate() + "','yyyy-MM-dd')";
|
|
|
+ String lisSql = "select * from ASSAY_LIST where repDate >= '" + DateUtil.yesterdayFormate() + "' and behospitalNum is not null";
|
|
|
+ String pacsSql = "select * from CHECK_LIST where repDate >= '" + DateUtil.yesterdayFormate()+ "' and behospitalNum is not null";
|
|
|
+ String infoSql = "select * from admission_pat_regist where leaveHospitalDate >= '" + DateUtil.yesterdayFormate() + "'";
|
|
|
|
|
|
+ try {
|
|
|
+ Long startTime = System.currentTimeMillis();
|
|
|
+ //更新前一天出院的入院登记信息
|
|
|
+ this.getInfo(infoSql);
|
|
|
+
|
|
|
+ //得到全部的科室信息并添加修改
|
|
|
+ this.getDeptInfo(deptSql);
|
|
|
+
|
|
|
+ //得到前一天的医嘱信息并添加修改
|
|
|
+ this.getDoctorAdvice(doctorAdviceSql);
|
|
|
+
|
|
|
+ //得到前一天的化验信息和相应的化验结果并添加修改
|
|
|
+ this.getLisInfo(lisSql);
|
|
|
+
|
|
|
+ //得到前一天的检查信息和相应的检查结果并添加修改
|
|
|
+ this.getPacsInfo(pacsSql);
|
|
|
|
|
|
- Long startTime=System.currentTimeMillis();
|
|
|
- //得到全部的科室信息并添加修改
|
|
|
- this.getDeptInfo(deptSql);
|
|
|
- Long startTime1=System.currentTimeMillis();
|
|
|
- System.out.println("获取科室所用时间:----"+(startTime1-startTime)+"----");
|
|
|
+ Long startTime2 = System.currentTimeMillis();
|
|
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("每天拉去历史数据成功", "", "所用时间" + (startTime2 - startTime), DateUtil.now().toString(), "");
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("每天拉去历史数据失败", "", "", DateUtil.now().toString(), e.getMessage());
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- //得到前一天的医嘱信息并添加修改
|
|
|
- this.getDoctorAdvice(doctorAdviceSql);
|
|
|
- Long startTime2=System.currentTimeMillis();
|
|
|
- System.out.println("获取医嘱所用时间:----"+(startTime2-startTime1)+"----");
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 根据出院时间来拉取历史数据
|
|
|
+ *
|
|
|
+ * @param startDate
|
|
|
+ * @param stopDate
|
|
|
+ */
|
|
|
+ public void executeData(String startDate, String stopDate) {
|
|
|
+ //获取入院登记表中的信息
|
|
|
+ String infoSql = "select * from admission_pat_regist where leaveHospitalDate >= '" + startDate + "' and leaveHospitalDate <= '" + stopDate + "'";
|
|
|
+ List<BehospitalInfo> behospitalInfoList = this.getInfo(infoSql);
|
|
|
+ this.a(behospitalInfoList);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 根据时间来拉取历史数据
|
|
|
+ * 根据入院时间来拉取历史数据
|
|
|
+ *
|
|
|
* @param startDate
|
|
|
* @param stopDate
|
|
|
*/
|
|
|
- public void executeOldData(String startDate,String stopDate) {
|
|
|
+ public void executeOldData(String startDate, String stopDate) {
|
|
|
//获取入院登记表中的信息
|
|
|
- String infoSql="select * from admission_pat_regist where behospitalDate >= '"+startDate+"' and behospitalDate <= '"+stopDate+"'";
|
|
|
- List<BehospitalInfo> behospitalInfoList=this.getInfo( infoSql);
|
|
|
- //根据入院登记表的信息来查所需文书
|
|
|
- if (behospitalInfoList.size()>0){
|
|
|
- behospitalInfoList.forEach(s->{
|
|
|
- //获取拼接前的behospitalCode和behospitalNum
|
|
|
- String behospitalCode=s.getBehospitalCode();
|
|
|
- String hospitalCode=behospitalCode.substring(0,behospitalCode.indexOf("_"));
|
|
|
- String hospitalNum =behospitalCode.substring(hospitalCode.length()+1,behospitalCode.length());
|
|
|
+ String infoSql = "select * from admission_pat_regist where behospitalDate >= '" + startDate + "' and behospitalDate <= '" + stopDate + "'";
|
|
|
+ List<BehospitalInfo> behospitalInfoList = this.getInfo(infoSql);
|
|
|
+ this.a(behospitalInfoList);
|
|
|
+ }
|
|
|
|
|
|
- //获取文书信息和文书详情信息
|
|
|
- String recordSql="select * from record_list where behospitalCode= '"+hospitalCode+"' and behospitalnum= '"+hospitalNum+"'";
|
|
|
- this.getRecord(recordSql);
|
|
|
+ /**
|
|
|
+ * 根据住院号来拉取历史数据
|
|
|
+ *
|
|
|
+ * @param behospitalCode
|
|
|
+ * @param behospitalNum
|
|
|
+ */
|
|
|
+ public void executeOldDataOne(String behospitalCode, String behospitalNum) {
|
|
|
+ //获取入院登记表中的信息
|
|
|
+ String infoSql = "select * from admission_pat_regist where behospitalCode = '" + behospitalCode + "' and behospitalNum = '" + behospitalNum + "'";
|
|
|
+ List<BehospitalInfo> behospitalInfoList = this.getInfo(infoSql);
|
|
|
+ this.a(behospitalInfoList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 单独更新病案首页
|
|
|
+ */
|
|
|
+ public void executeHome(){
|
|
|
+ List<BehospitalInfo> behospitalInfoList = aBehospitalInfoFacade.list();
|
|
|
+ if (behospitalInfoList.size() > 0) {
|
|
|
+ behospitalInfoList.forEach(s -> {
|
|
|
+ //获取拼接前的behospitalCode和behospitalNum
|
|
|
+ String behospitalCode = s.getBehospitalCode();
|
|
|
+ String hospitalCode = behospitalCode.substring(0, behospitalCode.indexOf("_"));
|
|
|
+ String hospitalNum = behospitalCode.substring(hospitalCode.length() + 1, behospitalCode.length());
|
|
|
|
|
|
//获取病案首页
|
|
|
XyHomePageVo xyHomePageVo = new XyHomePageVo();
|
|
@@ -127,27 +178,24 @@ public class ViewFacade {
|
|
|
this.getHomePageByView(xyHomePageVo);
|
|
|
});
|
|
|
}
|
|
|
- System.out.println("没有数据--------------------------开始时间--+"+startDate+"--结束时间--"+stopDate);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- * 根据住院号来拉取历史数据
|
|
|
- * @param behospitalCode
|
|
|
- * @param behospitalNum
|
|
|
+ * 获取病人信息
|
|
|
+ *
|
|
|
+ * @param behospitalInfoList
|
|
|
*/
|
|
|
- public void executeOldDataOne(String behospitalCode,String behospitalNum) {
|
|
|
- //获取入院登记表中的信息
|
|
|
- String infoSql="select * from admission_pat_regist where behospitalCode = '"+behospitalCode+"' and behospitalNum = '"+behospitalNum+"'";
|
|
|
- List<BehospitalInfo> behospitalInfoList=this.getInfo( infoSql);
|
|
|
+ public void a(List<BehospitalInfo> behospitalInfoList) {
|
|
|
//根据入院登记表的信息来查所需文书
|
|
|
- if (behospitalInfoList.size()>0){
|
|
|
- behospitalInfoList.forEach(s->{
|
|
|
+ if (behospitalInfoList.size() > 0) {
|
|
|
+ behospitalInfoList.forEach(s -> {
|
|
|
//获取拼接前的behospitalCode和behospitalNum
|
|
|
- String behospitalCode1=s.getBehospitalCode();
|
|
|
- String hospitalCode=behospitalCode1.substring(0,behospitalCode1.indexOf("_"));
|
|
|
- String hospitalNum =behospitalCode1.substring(hospitalCode.length()+1,behospitalCode1.length());
|
|
|
+ String behospitalCode = s.getBehospitalCode();
|
|
|
+ String hospitalCode = behospitalCode.substring(0, behospitalCode.indexOf("_"));
|
|
|
+ String hospitalNum = behospitalCode.substring(hospitalCode.length() + 1, behospitalCode.length());
|
|
|
|
|
|
//获取文书信息和文书详情信息
|
|
|
- String recordSql="select * from record_list where behospitalCode= '"+hospitalCode+"' and behospitalnum= '"+hospitalNum+"'";
|
|
|
+ String recordSql = "select * from record_list where behospitalCode= '" + hospitalCode + "' and behospitalnum= '" + hospitalNum + "'";
|
|
|
this.getRecord(recordSql);
|
|
|
|
|
|
//获取病案首页
|
|
@@ -157,39 +205,43 @@ public class ViewFacade {
|
|
|
xyHomePageVo.setFileCode(hospitalNum);
|
|
|
xyHomePageVo.setDockModeType("0");
|
|
|
this.getHomePageByView(xyHomePageVo);
|
|
|
+ //获取病人医嘱
|
|
|
+ String doctorAdviceSql = "select * from doctor_order where behospitalCode= '" + hospitalCode + "' and behospitalnum= '" + hospitalNum + "'";
|
|
|
+ this.getDoctorAdvice(doctorAdviceSql);
|
|
|
});
|
|
|
}
|
|
|
- System.out.println("没有数据--------------------------住院号--+"+behospitalCode+"--住院次数--"+behospitalNum);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
- * 从试图获取病案首页(诊断和手术)
|
|
|
+ * 从试图获取病案首页(诊断和手术)
|
|
|
*/
|
|
|
- public RespDTO<Map<String, Object>> getHomePageByView(XyHomePageVo xyHomePageVo){
|
|
|
- //保存入参
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("病案首页入参", xyHomePageVo.getHomePageId(), xyHomePageVo.getBehospitalCode(), JSON.toJSONString(xyHomePageVo), "");
|
|
|
- Long modeId=Long.valueOf("6");//病案首页默认为6
|
|
|
- String behospitalCode=xyHomePageVo.getBehospitalCode()+"_"+xyHomePageVo.getFileCode();
|
|
|
- //从视图拉取数据
|
|
|
-
|
|
|
- String homepageSql="select * from homePage where behospitalCode= '"+xyHomePageVo.getBehospitalCode()+"' and behospitalnum= '"+xyHomePageVo.getFileCode()+"'";
|
|
|
- String diagSql="select * from homePage_diag where behospitalCode= '"+xyHomePageVo.getBehospitalCode()+"' and behospitalnum= '"+xyHomePageVo.getFileCode()+"'";
|
|
|
- String opsSql="select * from homePage_operation where behospitalCode= '"+xyHomePageVo.getBehospitalCode()+"' and behospitalnum= '"+xyHomePageVo.getFileCode()+"'";
|
|
|
-
|
|
|
- this.getHomePage(homepageSql);
|
|
|
- this.getHomeDiagnose(diagSql);
|
|
|
- this.getHomeOperation(opsSql);
|
|
|
-
|
|
|
-
|
|
|
- //根据传过来的方案编码来判断是否返回评分(1:返回评分,其他只保存数据)
|
|
|
- if (xyHomePageVo.getDockModeType().equals("1")){
|
|
|
- String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+xyHomePageVo.getHospitalId()+"&modeId="+modeId;
|
|
|
- Map<String,Object> map=new HashMap<String,Object>();
|
|
|
- map.put("url",url);
|
|
|
- return RespDTO.onSuc(map);
|
|
|
- }
|
|
|
- return RespDTO.onSuc(true);
|
|
|
+ public RespDTO<Map<String, Object>> getHomePageByView(XyHomePageVo xyHomePageVo) {
|
|
|
+ //保存入参
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("病案首页入参", xyHomePageVo.getHomePageId(), xyHomePageVo.getBehospitalCode(), JSON.toJSONString(xyHomePageVo), "");
|
|
|
+ Long modeId = Long.valueOf("6");//病案首页默认为6
|
|
|
+ String behospitalCode = xyHomePageVo.getBehospitalCode() + "_" + xyHomePageVo.getFileCode();
|
|
|
+ //从视图拉取数据
|
|
|
+
|
|
|
+ String homepageSql = "select * from homePage where behospitalCode= '" + xyHomePageVo.getBehospitalCode() + "' and behospitalnum= '" + xyHomePageVo.getFileCode() + "'";
|
|
|
+ String diagSql = "select * from homePage_diag where behospitalCode= '" + xyHomePageVo.getBehospitalCode() + "' and behospitalnum= '" + xyHomePageVo.getFileCode() + "'";
|
|
|
+ String opsSql = "select * from homePage_operation where behospitalCode= '" + xyHomePageVo.getBehospitalCode() + "' and behospitalnum= '" + xyHomePageVo.getFileCode() + "'";
|
|
|
+
|
|
|
+ this.getHomePage(homepageSql);
|
|
|
+ this.getHomeDiagnose(diagSql);
|
|
|
+ this.getHomeOperation(opsSql);
|
|
|
+
|
|
|
+
|
|
|
+ //根据传过来的方案编码来判断是否返回评分(1:返回评分,其他只保存数据)
|
|
|
+ if (xyHomePageVo.getDockModeType().equals("1")) {
|
|
|
+ String url = readProperties.getProcessQcUrl() + "?behospitalCode=" + behospitalCode + "&hospitalId=" + xyHomePageVo.getHospitalId() + "&modeId=" + modeId;
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("url", url);
|
|
|
+ return RespDTO.onSuc(map);
|
|
|
}
|
|
|
+ return RespDTO.onSuc(true);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 从视图获取科室信息
|
|
|
*
|
|
@@ -280,6 +332,11 @@ public class ViewFacade {
|
|
|
try {
|
|
|
lisInfos = tzDBConn.getLisInfo(sql);
|
|
|
aMedLisInfoFacade.execute(lisInfos);
|
|
|
+ if (lisInfos.size()>0){
|
|
|
+ lisInfos.forEach(lis->{
|
|
|
+ this.getLisResult(lis.getRepNo());
|
|
|
+ });
|
|
|
+ }
|
|
|
aMedAbnormalInfoFacade.saveAbnormalInfo("从试图拉取化验信息正常", "", sql, JSON.toJSONString(lisInfos), "");
|
|
|
} catch (Exception e) {
|
|
|
aMedAbnormalInfoFacade.saveAbnormalInfo("从试图拉取化验信息错误", "", sql, JSON.toJSONString(lisInfos), e.getMessage());
|
|
@@ -290,10 +347,11 @@ public class ViewFacade {
|
|
|
/**
|
|
|
* 从视图获取化验结果信息
|
|
|
*
|
|
|
- * @param sql
|
|
|
+ * @param repNo
|
|
|
*/
|
|
|
- public void getLisResult(String sql) {
|
|
|
+ public void getLisResult(String repNo) {
|
|
|
List<MedLisResult> lisResults = new ArrayList<>();
|
|
|
+ String sql="select * from ASSAY_DETAILS where repNo='"+repNo+"'";
|
|
|
try {
|
|
|
lisResults = tzDBConn.getLisResult(sql);
|
|
|
aMedLisResultFacade.execute(lisResults);
|
|
@@ -313,6 +371,11 @@ public class ViewFacade {
|
|
|
try {
|
|
|
pacsInfos = tzDBConn.getPacsInfo(sql);
|
|
|
aMedPacsInfoFacade.execute(pacsInfos);
|
|
|
+ if (pacsInfos.size()>0){
|
|
|
+ pacsInfos.forEach(pacs->{
|
|
|
+ this.getPacsResult(pacs.getRepNo());
|
|
|
+ });
|
|
|
+ }
|
|
|
aMedAbnormalInfoFacade.saveAbnormalInfo("从试图拉取检查信息正常", "", sql, JSON.toJSONString(pacsInfos), "");
|
|
|
} catch (Exception e) {
|
|
|
aMedAbnormalInfoFacade.saveAbnormalInfo("从试图拉取检查信息错误", "", sql, JSON.toJSONString(pacsInfos), e.getMessage());
|
|
@@ -322,10 +385,11 @@ public class ViewFacade {
|
|
|
/**
|
|
|
* 从视图获取检查结果信息
|
|
|
*
|
|
|
- * @param sql
|
|
|
+ * @param repNo
|
|
|
*/
|
|
|
- public void getPacsResult(String sql) {
|
|
|
+ public void getPacsResult(String repNo) {
|
|
|
List<MedPacsResult> pacsResults = new ArrayList<>();
|
|
|
+ String sql="select * from CHECK_DETAILS where repNo='"+repNo+"'";
|
|
|
try {
|
|
|
pacsResults = tzDBConn.getPacsResult(sql);
|
|
|
aMedPacsResultFacade.execute(pacsResults);
|
|
@@ -361,13 +425,13 @@ public class ViewFacade {
|
|
|
List<MedicalRecord> medicalRecordList = new ArrayList<>();
|
|
|
try {
|
|
|
medicalRecordList = tzDBConn.getMedicalRecord(sql);
|
|
|
- if (medicalRecordList.size()>0){
|
|
|
- medicalRecordList.forEach(s->{
|
|
|
+ if (medicalRecordList.size() > 0) {
|
|
|
+ medicalRecordList.forEach(s -> {
|
|
|
//获取文书详情
|
|
|
- String recId=s.getRecId();
|
|
|
+ String recId = s.getRecId();
|
|
|
//截取rec_id後面的_次數跟接口相對潁上
|
|
|
int inedx = s.getRecId().lastIndexOf("_");
|
|
|
- s.setRecId(s.getRecId().substring(0,inedx));
|
|
|
+ s.setRecId(s.getRecId().substring(0, inedx));
|
|
|
this.getRecordContent(recId);
|
|
|
});
|
|
|
}
|
|
@@ -386,7 +450,12 @@ public class ViewFacade {
|
|
|
public void getRecordContent(String recId) {
|
|
|
List<MedicalRecordContent> medicalRecordContentList = new ArrayList<>();
|
|
|
try {
|
|
|
- String html=this.getHtml(recId);
|
|
|
+ String html = this.getHtml(recId);
|
|
|
+ if (StringUtils.isBlank(html) || html.equals("<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
|
|
|
+ "<string xmlns=\"http://www.healthcare.supcon.com/wsmeddoc/\" />")) {
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("从webService获取文书详情信息为空", "", recId, JSON.toJSONString(html), "");
|
|
|
+ return;
|
|
|
+ }
|
|
|
MedicalRecordContent medicalRecordContent = new MedicalRecordContent();
|
|
|
medicalRecordContent.setRecId(recId);
|
|
|
medicalRecordContent.setHospitalId(Long.valueOf("35"));
|
|
@@ -395,7 +464,7 @@ public class ViewFacade {
|
|
|
medicalRecordContent.setXmlText(html);
|
|
|
//截取rec_id後面的_次數跟接口相對潁上
|
|
|
int inedx = medicalRecordContent.getRecId().lastIndexOf("_");
|
|
|
- medicalRecordContent.setRecId(medicalRecordContent.getRecId().substring(0,inedx));
|
|
|
+ medicalRecordContent.setRecId(medicalRecordContent.getRecId().substring(0, inedx));
|
|
|
medicalRecordContentList.add(medicalRecordContent);
|
|
|
|
|
|
aMedicalRecordContentFacade.execute(medicalRecordContentList);
|
|
@@ -407,46 +476,96 @@ public class ViewFacade {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public String getHtml(String recId){
|
|
|
- String url ="http://132.147.254.142:8093/DocService.asmx/GetDocsHTML";
|
|
|
+ public String getHtml(String recId) {
|
|
|
+ String url = "http://132.147.254.142:8093/DocService.asmx/GetDocsHTML";
|
|
|
try {
|
|
|
PostMethod postMethod = null;
|
|
|
postMethod = new PostMethod(url);
|
|
|
- postMethod.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
|
|
|
- NameValuePair[] data ={
|
|
|
+ postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
|
|
|
+ NameValuePair[] data = {
|
|
|
// new NameValuePair("startTime",""),
|
|
|
- new NameValuePair("szDocIDs",recId)
|
|
|
+ new NameValuePair("szDocIDs", recId)
|
|
|
};
|
|
|
postMethod.setRequestBody(data);
|
|
|
- org.apache.commons.httpclient.HttpClient httpClient=new org.apache.commons.httpclient.HttpClient();
|
|
|
- int response =httpClient.executeMethod(postMethod);
|
|
|
- String result =postMethod.getResponseBodyAsString();
|
|
|
- String html=this.decode(result);
|
|
|
+ org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient();
|
|
|
+ int response = httpClient.executeMethod(postMethod);
|
|
|
+ String result = postMethod.getResponseBodyAsString();
|
|
|
+ String html = this.decode(result);
|
|
|
return html;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
// System.out.println("请求异常"+e.getMessage());
|
|
|
throw new RuntimeException(e.getMessage());
|
|
|
- }finally {
|
|
|
+ } finally {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 数值行代码转换成中文
|
|
|
+ *
|
|
|
* @param result
|
|
|
* @return
|
|
|
*/
|
|
|
- public String decode(String result){
|
|
|
- String html=StringEscapeUtils.unescapeXml(result);
|
|
|
- String[] tmp =html.split("&#|&#|;");
|
|
|
+ public String decode(String result) {
|
|
|
+ String html = StringEscapeUtils.unescapeXml(result);
|
|
|
+ String[] tmp = html.split("&#|&#|;");
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
- for (int i = 0; i < tmp.length ; i++) {
|
|
|
- if (tmp[i].matches("\\d{5}")){
|
|
|
+ for (int i = 0; i < tmp.length; i++) {
|
|
|
+ if (tmp[i].matches("\\d{5}")) {
|
|
|
sb.append((char) Integer.parseInt(tmp[i]));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
sb.append(tmp[i]);
|
|
|
}
|
|
|
}
|
|
|
return sb.toString();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查看30天前的病人住院登记信息
|
|
|
+ */
|
|
|
+ public void execute(String date) {
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ now = now.minus(Integer.parseInt(date), ChronoUnit.DAYS);
|
|
|
+ List<BehospitalInfo> list = aBehospitalInfoFacade.list(new QueryWrapper<BehospitalInfo>()
|
|
|
+ .le("leave_hospital_date", DateUtil.now())
|
|
|
+ .ge("leave_hospital_date", now));
|
|
|
+ if (list.size() > 0) {
|
|
|
+ list.forEach(behospitalInfo -> {
|
|
|
+ this.IfCoincide(behospitalInfo.getBehospitalCode());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断文书量跟视图是否一致
|
|
|
+ *
|
|
|
+ * @param code
|
|
|
+ */
|
|
|
+ public void IfCoincide(String code) {
|
|
|
+ try {
|
|
|
+ Integer myCount = 0;
|
|
|
+ myCount = aMedicalRecordFacade.count(new QueryWrapper<MedicalRecord>()
|
|
|
+ .eq("behospital_code", code)
|
|
|
+ .eq("hospital_id", Long.valueOf("35"))
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey()));
|
|
|
+ String hospitalCode = code.substring(0, code.indexOf("_"));
|
|
|
+ String hospitalNum = code.substring(hospitalCode.length() + 1, code.length());
|
|
|
+ String sql = "select count(*) as count from record_list where behospitalCode= '" + hospitalCode + "' and behospitalnum= '" + hospitalNum + "'";
|
|
|
+ Integer count = tzDBConn.getCount(sql);
|
|
|
+ if (count != 0) {
|
|
|
+ if (count != myCount) {
|
|
|
+ aMedicalRecordFacade.remove(new QueryWrapper<MedicalRecord>()
|
|
|
+ .eq("behospital_code", code)
|
|
|
+ .eq("hospital_id", Long.valueOf("35")));
|
|
|
+ this.executeOldDataOne(hospitalCode, hospitalNum);
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("补传数据成功", code, "视图文书数量为" + count, "本地数量为" + myCount, "");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("补传数据失败", code, "", e.getMessage(), "");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|