# Conflicts:
#	yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java
This commit is contained in:
lxd 2024-10-25 21:59:20 +08:00
commit c4e49c9265
2 changed files with 128 additions and 142 deletions

View File

@ -52,6 +52,7 @@ public interface PatientexamlistMapper extends BaseMapperX<PatientexamlistDO> {
.eqIfPresent(PatientexamlistDO::getDeviceType, reqVO.getDeviceType())
.likeIfPresent(PatientexamlistDO::getPName, reqVO.getPname())
.isNotNull(PatientexamlistDO::getDiagDate)
.eq(PatientexamlistDO::getReportstatus, "已审核")
.orderByDesc(PatientexamlistDO::getExamDate));
}
@ -67,7 +68,7 @@ public interface PatientexamlistMapper extends BaseMapperX<PatientexamlistDO> {
.betweenIfPresent(PatientexamlistDO::getUploadDate, reqVO.getUploadDate())
.likeIfPresent(PatientexamlistDO::getOrgName, reqVO.getOrgName())
// .eqIfPresent(PatientexamlistDO::getOrgId, reqVO.getOrgId())
.likeIfPresent(PatientexamlistDO::getDeviceType,reqVO.getDeviceType())
.likeIfPresent(PatientexamlistDO::getDeviceType, reqVO.getDeviceType())
// .eqIfPresent(PatientexamlistDO::getHighLevelOrgId, reqVO.getHighLevelOrgId())
.betweenIfPresent(PatientexamlistDO::getCreateDate, reqVO.getCreateDate())
.eqIfPresent(PatientexamlistDO::getExamDescription, reqVO.getExamDescription())
@ -76,7 +77,7 @@ public interface PatientexamlistMapper extends BaseMapperX<PatientexamlistDO> {
.eqIfPresent(PatientexamlistDO::getDiagDoctor, reqVO.getDiagDoctor())
.betweenIfPresent(PatientexamlistDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(PatientexamlistDO::getOrgId, reqVO.getHighLevelOrgId())
.eqIfPresent(PatientexamlistDO::getIsFavourite,reqVO.getIsFavourite())
.eqIfPresent(PatientexamlistDO::getIsFavourite, reqVO.getIsFavourite())
.eq(PatientexamlistDO::getOrgId, reqVO.getOrgId()) // 始终添加orgId条件
.or(wrapper -> {
if (reqVO.getHighLevelOrgId() != null) {

View File

@ -153,14 +153,14 @@ public class ultrasonicController {
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(filteredList);
List<Tree> tree = convertJsonToTree(json,isprivate);
List<Tree> tree = convertJsonToTree(json, isprivate);
return success(tree);
}
//返回树结构
private List<Tree> convertJsonToTree(String jsonData,String isprivate) {
private List<Tree> convertJsonToTree(String jsonData, String isprivate) {
try {
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> dataList = objectMapper.readValue(jsonData, List.class);
@ -180,7 +180,7 @@ public class ultrasonicController {
tree.tempname = (String) data.get("templateName");
tree.examDescription = (String) data.get("examDescription");
tree.diagResults = (String) data.get("diagResults");
tree.dataType=(String) data.get("dataType");
tree.dataType = (String) data.get("dataType");
treeMap.put(id, tree);
if (privateId != null && !privateId.isEmpty()) {
@ -189,15 +189,12 @@ public class ultrasonicController {
publicTrees.add(tree); // 添加到公共节点列表
}
}
if (isprivate.equals("1"))
{
if (isprivate.equals("1")) {
// 构建公共树
buildTree(privateTrees, "0", treeMap);
// 将私有节点添加到结果列表
return new ArrayList<>(privateTrees); //
}
else
{
} else {
// 构建公共树
buildTree(publicTrees, "0", treeMap);
// 将私有节点添加到结果列表
@ -205,7 +202,6 @@ public class ultrasonicController {
}
} catch (JsonProcessingException e) {
return new ArrayList<>();
}
@ -329,13 +325,12 @@ public class ultrasonicController {
public CommonResult<String> GetDcmList(@RequestParam("orgID") String orgID, @RequestParam("studyInsta") String studyInsta, @RequestParam("regId") String regId) throws JsonProcessingException {
String strJson = "";
String json = "";
String Dcmprefix="";
String Dcmprefix = "";
if (!studyInsta.isEmpty() && !orgID.isEmpty()) {
OrgUnitDO unitDO= Service.getonekey(orgID);
if(!unitDO.getDcmprefix().isEmpty())
{
Dcmprefix=unitDO.getDcmprefix();
OrgUnitDO unitDO = Service.getonekey(orgID);
if (!unitDO.getDcmprefix().isEmpty()) {
Dcmprefix = unitDO.getDcmprefix();
}
// 先查询基本信息 一个患者基本信息就一条
DicompatientDO dicompatientDO = dicomworklistService.GetPatientIdData(regId, orgID);
@ -375,7 +370,7 @@ public class ultrasonicController {
// 处理完第一条数据后将isFirst标志设置为false
isFirst = false;
}
imageid.append("{\"imageid\": \"").append("/"+Dcmprefix+"/" + imagesDO.getObjectFile().replace("\\", "\\\\")).append("\"},");
imageid.append("{\"imageid\": \"").append("/" + Dcmprefix + "/" + imagesDO.getObjectFile().replace("\\", "\\\\")).append("\"},");
}
}
if (imageid.length() > 0) {
@ -430,17 +425,17 @@ public class ultrasonicController {
return medicalimgService.insimage(medicalimgDO);
}
@PostMapping("/ftpimage")
@Operation(summary = "获取图片上传ftp")
public void FtpImage(@RequestBody insimagescreenshotVO insimagescreenshotVO)
{
public void FtpImage(@RequestBody insimagescreenshotVO insimagescreenshotVO) {
String base64String = insimagescreenshotVO.getImagebase();
String ftpServer = "192.168.0.110";//114.55.171.231
String ftpServer = "192.168.0.110"; //114.55.171.231
int ftpPort = 21; // FTP端口默认为21
String ftpUser = "pacs";
String ftpPassword = "pacs123";
String uploadPath = "/";
String fileName = System.currentTimeMillis()+".jpg";
String fileName = System.currentTimeMillis() + ".jpg";
FTPClient ftpClient = new FTPClient();
@ -472,17 +467,20 @@ public class ultrasonicController {
UUID randomUUID = UUID.randomUUID();
medicalimgDO medicalimgDO = new medicalimgDO();
medicalimgDO.setId(randomUUID.toString());
medicalimgDO.setImgUrl("/video/"+fileName);
medicalimgDO.setImgUrl("http://192.168.0.110:48082/" + fileName);
medicalimgDO.setCreatePerson("");
medicalimgDO.setCreateDate(dateTime);
medicalimgDO.setRegId(insimagescreenshotVO.getID());
if (insimagescreenshotVO.getOrgId() != null && !insimagescreenshotVO.getOrgId().trim().equals(""))
medicalimgDO.setOrgId(insimagescreenshotVO.getOrgId().trim());
else if (user != null && user.getOrgId() != null)
medicalimgDO.setOrgId(user.getOrgId());
medicalimgDO.setSelected("0");
if (insimagescreenshotVO.getImgType() == null || insimagescreenshotVO.getImgType().trim().equals(""))
medicalimgDO.setImgType("1");
else
medicalimgDO.setImgType(insimagescreenshotVO.getImgType().trim());
int count=medicalimgService.insimage(medicalimgDO);
int count = medicalimgService.insimage(medicalimgDO);
} else {
System.out.println("文件上传失败");
}
@ -511,26 +509,24 @@ public class ultrasonicController {
@Operation(summary = "影像信息")
public CommonResult<String> InsImageInfo(@RequestBody List<PatientInfoVO> patientInfoVOS) throws ParseException {
try {
if(!patientInfoVOS.isEmpty())
{
List<dicompatientsDO> dicompatientsDOList=new ArrayList<>();
List<dicomstudiesDO> dicomstudiesDOList=new ArrayList<>();
List<dicomseriesDO> dicomseriesDOList=new ArrayList<>();
List<dicomimagesDO> dicomimagesDOList=new ArrayList<>();
for (PatientInfoVO patientInfo : patientInfoVOS)
{
if (!patientInfoVOS.isEmpty()) {
List<dicompatientsDO> dicompatientsDOList = new ArrayList<>();
List<dicomstudiesDO> dicomstudiesDOList = new ArrayList<>();
List<dicomseriesDO> dicomseriesDOList = new ArrayList<>();
List<dicomimagesDO> dicomimagesDOList = new ArrayList<>();
for (PatientInfoVO patientInfo : patientInfoVOS) {
//获取基础信息
String PatientID=patientInfo.getPatientID();
String PatientNam=patientInfo.getPatientNam();
String PatientBir=DateUtils.formatedcsrq(Long.parseLong(patientInfo.getPatientBir())) ;
String PatientSex=patientInfo.getPatientSex();
String AccessTime= DateUtils.timestamp();
String orgId=patientInfo.getOrgId();
String orgname=patientInfo.getOrgName();
String StudyDate=patientInfo.getStudyDate();
List<StudyVO> studyVOS= patientInfo.getStudies();
String PatientID = patientInfo.getPatientID();
String PatientNam = patientInfo.getPatientNam();
String PatientBir = DateUtils.formatedcsrq(Long.parseLong(patientInfo.getPatientBir()));
String PatientSex = patientInfo.getPatientSex();
String AccessTime = DateUtils.timestamp();
String orgId = patientInfo.getOrgId();
String orgname = patientInfo.getOrgName();
String StudyDate = patientInfo.getStudyDate();
List<StudyVO> studyVOS = patientInfo.getStudies();
//填充dicompatients信息
dicompatientsDO dicompatientsDO=new dicompatientsDO();
dicompatientsDO dicompatientsDO = new dicompatientsDO();
dicompatientsDO.setPatientID(PatientID);
dicompatientsDO.setPatientNam(PatientNam);
dicompatientsDO.setPatientBir(PatientBir);
@ -540,16 +536,14 @@ public class ultrasonicController {
dicompatientsDO.setDataSync("1");
dicompatientsDOList.add(dicompatientsDO);
if(!studyVOS.isEmpty())
{
for (StudyVO studyVO :studyVOS)
{
if (!studyVOS.isEmpty()) {
for (StudyVO studyVO : studyVOS) {
// study表的主键
// String StudyInsta= UUID.randomUUID().toString();
String StudyInsta= studyVO.getStudyID();
dicomstudiesDO dicomstudiesDO=new dicomstudiesDO();
String StudyInsta = studyVO.getStudyID();
dicomstudiesDO dicomstudiesDO = new dicomstudiesDO();
dicomstudiesDO.setStudyInsta(StudyInsta);
dicomstudiesDO.setStudyDate(StudyDate.split(" ")[0].replace("-",""));
dicomstudiesDO.setStudyDate(StudyDate.split(" ")[0].replace("-", ""));
dicomstudiesDO.setStudyTime(DateUtils.formattedTime(StudyDate.split(" ")[1]));
dicomstudiesDO.setStudyID(studyVO.getStudyID());
dicomstudiesDO.setStudyDescr(studyVO.getStudyDescr());
@ -561,20 +555,18 @@ public class ultrasonicController {
dicomstudiesDO.setAccessTime(AccessTime);
dicomstudiesDO.setOrgId(orgId);
dicomstudiesDOList.add(dicomstudiesDO);
List<SeriesVO> series= studyVO.getSeries();
List<SeriesVO> series = studyVO.getSeries();
if (!series.isEmpty())
{
if (!series.isEmpty()) {
for (SeriesVO seriesVO:series)
{
for (SeriesVO seriesVO : series) {
//service表主键
String SeriesInst=UUID.randomUUID().toString();
String SeriesInst = UUID.randomUUID().toString();
// String SeriesInst= seriesVO.getSeriesNumb();
dicomseriesDO dicomseriesDO=new dicomseriesDO();
dicomseriesDO dicomseriesDO = new dicomseriesDO();
dicomseriesDO.setSeriesInst(SeriesInst);
dicomseriesDO.setSeriesNumb(seriesVO.getSeriesNumb());
dicomseriesDO.setSeriesDate(StudyDate.split(" ")[0].replace("-",""));
dicomseriesDO.setSeriesDate(StudyDate.split(" ")[0].replace("-", ""));
dicomseriesDO.setSeriesTime(DateUtils.formattedTime(StudyDate.split(" ")[1]));
dicomseriesDO.setSeriesDesc(seriesVO.getSeriesDesc());
dicomseriesDO.setModality(seriesVO.getModality());
@ -586,19 +578,17 @@ public class ultrasonicController {
dicomseriesDO.setAccessTime(AccessTime);
dicomseriesDO.setOrgId(orgId);
dicomseriesDOList.add(dicomseriesDO);
List<ImageVO> imageVOS= seriesVO.getImage() ;
if (!imageVOS.isEmpty())
{
for (ImageVO imageVO:imageVOS)
{
List<ImageVO> imageVOS = seriesVO.getImage();
if (!imageVOS.isEmpty()) {
for (ImageVO imageVO : imageVOS) {
//image主键
String SOPInstanc=UUID.randomUUID().toString();
dicomimagesDO dicomimagesDO=new dicomimagesDO();
String SOPInstanc = UUID.randomUUID().toString();
dicomimagesDO dicomimagesDO = new dicomimagesDO();
dicomimagesDO.setSOPInstanc(SOPInstanc);
dicomimagesDO.setImageNumbe(imageVO.getImageNumber());
dicomimagesDO.setImageDate(StudyDate.split(" ")[0].replace("-",""));
dicomimagesDO.setImageDate(StudyDate.split(" ")[0].replace("-", ""));
dicomimagesDO.setImageTime(DateUtils.formattedTime(StudyDate.split(" ")[1]));
dicomimagesDO.setAcqDate(StudyDate.split(" ")[0].replace("-",""));
dicomimagesDO.setAcqDate(StudyDate.split(" ")[0].replace("-", ""));
dicomimagesDO.setAcqTime(DateUtils.formattedTime(StudyDate.split(" ")[1]));
dicomimagesDO.setSeriesInst(SeriesInst);
dicomimagesDO.setAccessTime(AccessTime);
@ -618,18 +608,13 @@ public class ultrasonicController {
}
}
if (!dicompatientsDOList.isEmpty()&&!dicomstudiesDOList.isEmpty()&&!dicomseriesDOList.isEmpty()&&!dicomimagesDOList.isEmpty())
{
dicompatientsService.insertAll(dicompatientsDOList,dicomstudiesDOList,dicomseriesDOList,dicomimagesDOList);
if (!dicompatientsDOList.isEmpty() && !dicomstudiesDOList.isEmpty() && !dicomseriesDOList.isEmpty() && !dicomimagesDOList.isEmpty()) {
dicompatientsService.insertAll(dicompatientsDOList, dicomstudiesDOList, dicomseriesDOList, dicomimagesDOList);
}
}
else
{
} else {
return success("参数为空");
}
}
catch (Exception e)
{
} catch (Exception e) {
return success(e.getMessage());
}