feat: 梅州中医院LIS检验单采集
parent
dce5abdc3e
commit
2c5a8cdea7
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"lis":{
|
||||||
|
"collectorId":"1",
|
||||||
|
"assortId":"lis",
|
||||||
|
"url": "http://199.168.91.176:9001/NeuLisExportPDFService.asmx?wsdl",
|
||||||
|
"namespaceUri": "",
|
||||||
|
"pdfListOperationName": "GetTestFormPDF",
|
||||||
|
"RTBase64OperationName": "ExportTestFormPDF_GMForNoPaper",
|
||||||
|
"GMBase64OperationName": "ExportTestFormPDF_GMForNoPaper"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.docus.server.config;
|
||||||
|
|
||||||
|
|
||||||
|
import com.docus.server.util.StaticResourceMapping;
|
||||||
|
import com.docus.server.util.TableJsonRead;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author WYBDEV
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class StaticResourceWebConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
// 静态资源映射
|
||||||
|
registry.addResourceHandler("/"+ StaticResourceMapping.LIS +"/**")
|
||||||
|
.addResourceLocations("file:"+ TableJsonRead.currentPath(StaticResourceMapping.STATIC_RESOURCE_PREFIX+ File.separator+StaticResourceMapping.LIS)+File.separator);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.docus.server.mzzyy.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.docus.infrastructure.web.api.CommonResult;
|
||||||
|
import com.docus.server.rpc.MzZyyLisService;
|
||||||
|
import com.docus.server.rpc.dto.MzZyyLisExportDto;
|
||||||
|
import com.docus.server.rpc.dto.MzZyyTestDto;
|
||||||
|
import com.docus.server.rpc.enums.MzZyyLisType;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* api测试类
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/mzzyyApi")
|
||||||
|
@Api(tags = "梅州中医院文件采集接口")
|
||||||
|
public class MzZyyApiController {
|
||||||
|
@Autowired
|
||||||
|
private MzZyyLisService mzZyyLisService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试
|
||||||
|
*/
|
||||||
|
@GetMapping("/lis/getpdftest")
|
||||||
|
@ApiOperation("获取lis报告列表接口测试")
|
||||||
|
public CommonResult<Object> getpdftest(@RequestParam(name = "jzh") String jzh,
|
||||||
|
@RequestParam(name = "inpatientNo") String inpatientNo,
|
||||||
|
@RequestParam(name = "patientType") String patientType) {
|
||||||
|
List<MzZyyTestDto> list = mzZyyLisService.getTestFormPdf(jzh, inpatientNo, patientType);
|
||||||
|
return CommonResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 补采
|
||||||
|
*/
|
||||||
|
@GetMapping("/lis/base64test")
|
||||||
|
@ApiOperation("获取lis报告base64接口测试")
|
||||||
|
public CommonResult<Object> base64test(@RequestParam(name = "type") String type,
|
||||||
|
@RequestParam(name = "machineId") String machineId,
|
||||||
|
@RequestParam(name = "sampleId") String sampleId,
|
||||||
|
@RequestParam(name = "testdate") String testdate) {
|
||||||
|
MzZyyLisType mzZyyLisType = MzZyyLisType.getLisType(type);
|
||||||
|
List<MzZyyLisExportDto> files = mzZyyLisService.exportTestFormPdf(mzZyyLisType, machineId, sampleId, testdate);
|
||||||
|
return CommonResult.success(files);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(new MzZyyLisExportDto());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,82 @@
|
|||||||
|
package com.docus.server.rpc.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.docus.server.rpc.MzZyyLisService;
|
||||||
|
import com.docus.server.rpc.dto.MzZyyLisExportDto;
|
||||||
|
import com.docus.server.rpc.dto.MzZyyTestDto;
|
||||||
|
import com.docus.server.rpc.enums.MzZyyLisType;
|
||||||
|
import com.docus.server.util.JaxWsDynamicClientUtil;
|
||||||
|
import com.docus.server.util.TableJsonRead;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2025/3/18 9:27
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MzZyyLisServiceImpl implements MzZyyLisService {
|
||||||
|
final String configPath = "data-config";
|
||||||
|
final String configName = "mzzyy-ws-config";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MzZyyTestDto> getTestFormPdf(String jzh, String inpatientNo, String patientType) {
|
||||||
|
|
||||||
|
TableJsonRead jsonReader = new TableJsonRead();
|
||||||
|
JSONObject configOjb = jsonReader.Read(configPath, configName, JSONObject.class);
|
||||||
|
|
||||||
|
JSONObject lisWsConfig = configOjb.getJSONObject("lis");
|
||||||
|
String wsUrl = lisWsConfig.getString("url");
|
||||||
|
String namespaceUri = lisWsConfig.getString("namespaceUri");
|
||||||
|
String method = lisWsConfig.getString("pdfListOperationName");
|
||||||
|
String[] params = {jzh, inpatientNo, patientType};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Object result = JaxWsDynamicClientUtil.send(wsUrl, namespaceUri, method, params);
|
||||||
|
String reportDataJsonStr = JSONObject.toJSONString(result);
|
||||||
|
JSONObject reportDataObject = JSONObject.parseObject(reportDataJsonStr);
|
||||||
|
JSONArray jsonArray = reportDataObject.getJSONArray("string");
|
||||||
|
|
||||||
|
return jsonArray.toJavaList(String.class).stream()
|
||||||
|
.map(str ->{
|
||||||
|
String[] split = str.split("\\|");
|
||||||
|
MzZyyTestDto dto = new MzZyyTestDto();
|
||||||
|
dto.setTestDate(split[0]);
|
||||||
|
dto.setMachineId(split[1]);
|
||||||
|
dto.setSampleId(split[2]);
|
||||||
|
dto.setHisItemNameList(split[3]);
|
||||||
|
dto.setType(split[4]);
|
||||||
|
return dto;
|
||||||
|
}).sorted(Comparator.comparing(MzZyyTestDto::getTestDate)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MzZyyLisExportDto> exportTestFormPdf(MzZyyLisType type, String machineId, String sampleId, String testdate) {
|
||||||
|
TableJsonRead jsonReader = new TableJsonRead();
|
||||||
|
JSONObject configOjb = jsonReader.Read(configPath, configName, JSONObject.class);
|
||||||
|
JSONObject lisWsConfig = configOjb.getJSONObject("lis");
|
||||||
|
String wsUrl = lisWsConfig.getString("url");
|
||||||
|
String namespaceUri = lisWsConfig.getString("namespaceUri");
|
||||||
|
String method = null;
|
||||||
|
if (type == MzZyyLisType.GM) {
|
||||||
|
method = lisWsConfig.getString("GMBase64OperationName");
|
||||||
|
} else if (type == MzZyyLisType.RT) {
|
||||||
|
method = lisWsConfig.getString("RTBase64OperationName");
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String[] params = {machineId, sampleId, testdate};
|
||||||
|
Object resultObj = JaxWsDynamicClientUtil.send(wsUrl, namespaceUri, method, params);
|
||||||
|
String result = String.valueOf(resultObj);
|
||||||
|
return JSONObject.parseArray(result,MzZyyLisExportDto.class);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.docus.server.util;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author WYBDEV
|
||||||
|
*/
|
||||||
|
public interface StaticResourceMapping {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
String STATIC_RESOURCE_PREFIX ="static";
|
||||||
|
/**
|
||||||
|
* 输血报告存放地址
|
||||||
|
*/
|
||||||
|
String BLOOD = "blood";
|
||||||
|
/**
|
||||||
|
* lis检验报告存放地址
|
||||||
|
*/
|
||||||
|
String LIS= "lis";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue