省中医住院接口

master
lzy 4 years ago
parent ba8cd51b39
commit a76fd21139

@ -12,15 +12,15 @@
"errorCode":"0",
//,
"directory":[],
"directory":["Msg"],
//
"indexFlag":"VISITING_SERIAL_NUMBER",
"indexFlag":"INHOSP_NO",
//
"serialnum":"UNIQUE_ID",
"serialnum":"IDNO",
//
"filetitle":"DOCUMENT_TITLE",
"filetitle":"FILENAME",
//,&
"downurl":"BASE64&ORIGINAL_URL",
"downurl":"PDF_PATH",
//id
"assortid":"Wiw213woq412awqe41",
//id
@ -36,7 +36,7 @@
//doubleBasic
"basicDirectory":[""],
//
"doubleBasic":["TestItemInfo","BioTestInfo"],
"doubleBasic":["ITEM"],
//--------------/---------------
/// 01

@ -0,0 +1,69 @@
{
//-----------------------
//,
"ResHead":"Response,Result",
//
"ResCode":"Code",
//
"ResMsg":"Msg",
//
"successCode":"1",
//
"errorCode":"0",
//,
"directory":["Msg"],
//
"indexFlag":"INHOSP_NO",
//
"serialnum":"IDNO",
//
"filetitle":"FILENAME",
//,&
"downurl":"PDF_PATH",
//id
"assortid":"Wiw213woq412awqe41",
//id
"collectorid":"22",
//id
"assortidParamKey":"DOCUMENT_TOPIC",
//( 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",
//--------------------
"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"
}

@ -85,117 +85,117 @@ public class MyScheduling {
}
//10分钟执行一次
@Scheduled(fixedRate = 1000 * 60 * 60 * 5)
public void ruyuan() {
log.info("----------开始采集------------");
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = fmt.format(oneDate);
log.info("-----采集时间:开始时间:"+ format);
Date twoDate = new Date();
String format1 = fmt.format(twoDate);
log.info("-----采集时间:结束时间:"+ format1);
//获取jzh列表
List<String> jzhs = afCollectTaskService.listJZHByDate(format, format1);
int size = jzhs.size();
log.info("-------本次采集数:" + size);
if(size==0){
oneDate=twoDate;
log.info("------------采集结束-----------------");
return;
}
Object[] params;
List<String> keys = new ArrayList<>();
keys.add("action");
keys.add("message");
XmlUtils xmlUtils;
List<String> zyDirectory = (List<String>) FileUtils.getJsonByName("zyDirectory");
String assortid = String.valueOf(FileUtils.getJsonByName("assortid"));
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
String filesource = String.valueOf(FileUtils.getJsonByName("filesource"));
String filestoragetype = String.valueOf(FileUtils.getJsonByName("filestoragetype"));
String res;
Element element;
Map<String, Object> headMap = new HashMap<>();
headMap.put("Content-Type", "application/json");
for (String jzh : jzhs) {
try {
params = new Object[]{"flow-mra-queryencounterpdf", "<Req>\n" +
"<Params>\n" +
"<ENCT_ID>" + jzh + "</ENCT_ID>\n" +
"</Params>\n" +
"</Req>"};
res = requestFunctionWebService(params, url, methodName, namespance, keys);
log.info("返回值:" + res);
xmlUtils = new XmlUtils(new ByteArrayInputStream(res.getBytes("UTF-8")));
element = xmlUtils.getElement(zyDirectory);
List<Element> items = element.elements("ITEM");
if (items == null || items.size() <= 0) {
throw new RuntimeException("查询到的信息不存在");
}
ReportDownDto reportDownDto = new ReportDownDto();
reportDownDto.setCollectorid(collectorid);
reportDownDto.setAssortid(assortid);
ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto();
reportDownPatientDto.setJzh(jzh);
reportDownDto.setPatient(reportDownPatientDto);
List<ReportDownScanFileDto> scanFileDtos = new ArrayList<>();
ReportDownScanFileDto reportDownScanFileDto;
for (Element item : items) {
Element pdfId = item.element("PDF_ID");
if (pdfId != null && StringUtils.isNotBlank(pdfId.getText())) {
//采集流水号
String pdfIdText = pdfId.getText();
//文件标题
String fileTitle = item.element("MED_REC_CAT_NAME").getText();
//url地址
String pdf = pdfUrl + pdfIdText;
reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setFiletitle(fileTitle);
reportDownScanFileDto.setFilesource(Integer.parseInt(filesource));
reportDownScanFileDto.setFilestoragetype(Integer.parseInt(filestoragetype));
reportDownScanFileDto.setSerialnum(pdfIdText);
reportDownScanFileDto.setDownurl(pdf);
scanFileDtos.add(reportDownScanFileDto);
} else {
log.info("记账号:", jzh + "不存在pdfId");
size--;
throw new RuntimeException("记账号:" + jzh + "不存在pdfId");
}
}
log.info("文件信息:" + scanFileDtos);
reportDownDto.setScanfiles(scanFileDtos);
afCollectTaskService.insert(reportDownDto);
String post = "";
logger.info("--------执行上传功能----------");
Map paramMap = JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class);
logger.info("上传参数:" + paramMap);
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, paramMap);
// 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);
if (String.valueOf(resMap.get("code")).equals("500")) {
throw new RuntimeException(String.valueOf(resMap.get("msg")));
} else {
logger.info("----------执行成功,当前最后更新日期" + twoDate + "-----------");
}
} catch (Exception e) {
log.info(e.getMessage());
e.printStackTrace();
size--;
mrReportErrorService.insert(jzh);
}
}
log.info("-------本次成功采集数:" + size);
// oneDate = twoDate;
}
// @Scheduled(fixedRate = 1000 * 60 * 60 * 5)
// public void ruyuan() {
// log.info("----------开始采集------------");
// SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// String format = fmt.format(oneDate);
// log.info("-----采集时间:开始时间:"+ format);
// Date twoDate = new Date();
// String format1 = fmt.format(twoDate);
// log.info("-----采集时间:结束时间:"+ format1);
//
// //获取jzh列表
// List<String> jzhs = afCollectTaskService.listJZHByDate(format, format1);
// int size = jzhs.size();
// log.info("-------本次采集数:" + size);
// if(size==0){
// oneDate=twoDate;
// log.info("------------采集结束-----------------");
// return;
// }
// Object[] params;
// List<String> keys = new ArrayList<>();
// keys.add("action");
// keys.add("message");
// XmlUtils xmlUtils;
// List<String> zyDirectory = (List<String>) FileUtils.getJsonByName("zyDirectory");
// String assortid = String.valueOf(FileUtils.getJsonByName("assortid"));
// String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
// String filesource = String.valueOf(FileUtils.getJsonByName("filesource"));
// String filestoragetype = String.valueOf(FileUtils.getJsonByName("filestoragetype"));
// String res;
// Element element;
// Map<String, Object> headMap = new HashMap<>();
// headMap.put("Content-Type", "application/json");
// for (String jzh : jzhs) {
// try {
// params = new Object[]{"flow-mra-queryencounterpdf", "<Req>\n" +
// "<Params>\n" +
// "<ENCT_ID>" + jzh + "</ENCT_ID>\n" +
// "</Params>\n" +
// "</Req>"};
// res = requestFunctionWebService(params, url, methodName, namespance, keys);
// log.info("返回值:" + res);
// xmlUtils = new XmlUtils(new ByteArrayInputStream(res.getBytes("UTF-8")));
// element = xmlUtils.getElement(zyDirectory);
// List<Element> items = element.elements("ITEM");
// if (items == null || items.size() <= 0) {
// throw new RuntimeException("查询到的信息不存在");
// }
// ReportDownDto reportDownDto = new ReportDownDto();
// reportDownDto.setCollectorid(collectorid);
// reportDownDto.setAssortid(assortid);
//
// ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto();
// reportDownPatientDto.setJzh(jzh);
// reportDownDto.setPatient(reportDownPatientDto);
// List<ReportDownScanFileDto> scanFileDtos = new ArrayList<>();
// ReportDownScanFileDto reportDownScanFileDto;
//
// for (Element item : items) {
// Element pdfId = item.element("PDF_ID");
// if (pdfId != null && StringUtils.isNotBlank(pdfId.getText())) {
// //采集流水号
// String pdfIdText = pdfId.getText();
// //文件标题
// String fileTitle = item.element("MED_REC_CAT_NAME").getText();
// //url地址
// String pdf = pdfUrl + pdfIdText;
//
// reportDownScanFileDto = new ReportDownScanFileDto();
// reportDownScanFileDto.setFiletitle(fileTitle);
// reportDownScanFileDto.setFilesource(Integer.parseInt(filesource));
// reportDownScanFileDto.setFilestoragetype(Integer.parseInt(filestoragetype));
// reportDownScanFileDto.setSerialnum(pdfIdText);
// reportDownScanFileDto.setDownurl(pdf);
// scanFileDtos.add(reportDownScanFileDto);
// } else {
// log.info("记账号:", jzh + "不存在pdfId");
// size--;
// throw new RuntimeException("记账号:" + jzh + "不存在pdfId");
// }
// }
// log.info("文件信息:" + scanFileDtos);
// reportDownDto.setScanfiles(scanFileDtos);
// afCollectTaskService.insert(reportDownDto);
// String post = "";
// logger.info("--------执行上传功能----------");
// Map paramMap = JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class);
// logger.info("上传参数:" + paramMap);
// post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, paramMap);
//// 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);
// if (String.valueOf(resMap.get("code")).equals("500")) {
// throw new RuntimeException(String.valueOf(resMap.get("msg")));
// } else {
// logger.info("----------执行成功,当前最后更新日期" + twoDate + "-----------");
// }
//
// } catch (Exception e) {
// log.info(e.getMessage());
// e.printStackTrace();
// size--;
// mrReportErrorService.insert(jzh);
// }
// }
// log.info("-------本次成功采集数:" + size);
//// oneDate = twoDate;
// }
private String requestFunctionWebService(Object[] params,
String url,

@ -117,8 +117,7 @@ public class TBasicWebService implements ITBasicWebService {
reportDownPatientDto = new ReportDownPatientDto();
//获取jzh
String empIdText = getElementText(elementRoot, empId.split(","));
//获取采集流水号
serialnum = getElementText(elementRoot, serialnmnKey.split(","));
reportDownPatientDto.setJzh(empIdText);
logger.info("患者主索引号:" + empIdText);
reportDownDto.setPatient(reportDownPatientDto);
@ -128,6 +127,8 @@ public class TBasicWebService implements ITBasicWebService {
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.setFiletitle(filetitle);

@ -15,8 +15,8 @@ beat:
url: http://localhost:9399/beat
system:
code: "EmrDocAr"
prop: 9805
code: "empcllect"
prop: 9405
# web service

@ -0,0 +1,28 @@
server:
port: 9205
# http
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
call-setters-on-nulls: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
field-strategy: NOT_EMPTY
db-type: MYSQL
beat:
url: http://localhost:9399/beat
system:
code: "empcllect"
prop: 9405
# web service
spring:
datasource:
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

@ -5,7 +5,7 @@
<!-- ConsoleAppender把日志输出到控制台 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %p (%file:%line\)- %m%n</pattern>
<pattern>[%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%contextName] [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n</pattern>
<!-- 控制台也要使用UTF-8不要使用GBK否则会中文乱码 -->
<charset>UTF-8</charset>
</encoder>
@ -31,8 +31,9 @@
<encoder>
<!-- pattern节点用来设置日志的输入格式 -->
<pattern>
%d %p (%file:%line\)- %m%n
[%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n
</pattern>
<charset>utf-8</charset>
<!-- 记录日志的编码:此处设置字符集 - -->
<charset>UTF-8</charset>
</encoder>

Loading…
Cancel
Save