修改逻辑

This commit is contained in:
lxd 2024-08-15 13:08:27 +08:00
parent 5086973d12
commit e3138c423e
5 changed files with 125 additions and 46 deletions

View File

@ -104,5 +104,8 @@ public class PatientexamlistPageReqVO extends PageParam {
@Schema(description = "开单科室")
private String billDoctorDepartment;
private String StudyInsta;
}

View File

@ -125,4 +125,7 @@ public class PatientexamlistRespVO {
@Schema(description = "开单科室")
private String billDoctorDepartment;
private String StudyInsta;
}

View File

@ -98,5 +98,7 @@ public class PatientexamlistSaveReqVO {
private String billDoctorDepartment;
@Schema(description = "审核状态")
private String reviewStatus;
private String StudyInsta;
}

View File

@ -172,5 +172,7 @@ public class PatientexamlistDO extends BaseDO {
@TableField(value = "reviewStatus")
private String reviewStatus;
@TableField(value = "StudyInsta")
private String StudyInsta;
}

View File

@ -1,4 +1,12 @@
package cn.iocoder.yudao.module.ultrasoniccom.controller.admin.ultrasonic;
import cn.iocoder.yudao.module.system.dal.dataobject.dicomworklist.DicomImagesDO;
import cn.iocoder.yudao.module.system.dal.dataobject.dicomworklist.DicomSeriesDO;
import cn.iocoder.yudao.module.system.dal.dataobject.dicomworklist.DicompatientDO;
import cn.iocoder.yudao.module.system.dal.dataobject.org.OrgUnitDO;
import cn.iocoder.yudao.module.system.service.dicomworklist.DicomworklistService;
import cn.iocoder.yudao.module.system.service.org.OrgUnitService;
import com.fasterxml.jackson.databind.SerializationFeature;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
@ -43,6 +51,7 @@ import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 超声科组件")
@RestController
@RequestMapping("/ultrasoniccom/ultrasonic")
@ -54,6 +63,12 @@ public class ultrasonicController {
private ultrasonicService ultrasonicService;
@Resource
private medicalimgService medicalimgService;
@Resource
private DicomworklistService dicomworklistService;
@Resource
private OrgUnitService Service;
@GetMapping("/reporttemplatetlist")
@Operation(summary = "获取模版表数据")
@ -70,26 +85,21 @@ public class ultrasonicController {
devicelist = sortedList;
if (!orgID.isEmpty())
{
if (!orgID.isEmpty()) {
filteredList = devicelist.stream()
.filter(ultrasonicDO -> (ultrasonicDO.getOrgId().equals(orgID)))
.collect(Collectors.toList());
}
if(filteredList.isEmpty())
{
if (filteredList.isEmpty()) {
filteredList = devicelist;
}
if (!type.isEmpty()&&!type.equals("undefined"))
{
if (!type.isEmpty() && !type.equals("undefined")) {
// 筛选条件
filteredList = filteredList.stream()
.filter(ultrasonicDO -> (ultrasonicDO.getTemplateType().equals(type)))
.collect(Collectors.toList());
}
if(isprivate.equals("1"))
{
if (isprivate.equals("1")) {
// 筛选条件
filteredList = filteredList.stream()
.filter(ultrasonicDO -> (ultrasonicDO.getPrivateDoctorId() != null))
@ -165,8 +175,7 @@ public class ultrasonicController {
@PreAuthorize("@ss.hasPermission('tblist:patientexamlist:update')")
public CommonResult<Boolean> updateexamineimagelist(@Valid @RequestBody List<upmedicalimgVO> updateReqVO) {
if (!updateReqVO.isEmpty())
{
if (!updateReqVO.isEmpty()) {
//最终提交的数据
List<medicalimgDO> doList = new ArrayList<>();
@ -178,30 +187,23 @@ public class ultrasonicController {
//新增对象
medicalimgDO medicalimgDO = new medicalimgDO();
medicalimgDO.setId(s.getId());
if(!s.getIsDelete().isEmpty())
{
if (!s.getIsDelete().isEmpty()) {
medicalimgDO.setIsDelete(s.getIsDelete());
medicalimgDO.setDeletePerson(s.getDeletePerson());
medicalimgDO.setDeleteDate(dateTime);
}
if(!s.getSelected().isEmpty())
{
if (!s.getSelected().isEmpty()) {
medicalimgDO.setSelected(s.getSelected());
}
doList.add(medicalimgDO);
}
if (!doList.isEmpty())
{
if (!doList.isEmpty()) {
boolean bol = medicalimgService.updateBatchById(doList);
return success(bol);
}
else
{
} else {
return success(false);
}
}
else
{
} else {
log.error("超声审核更新图片数据方法参数为空");
return success(false);
@ -211,8 +213,6 @@ public class ultrasonicController {
}
@GetMapping("/upreporttemplatetime")
@Operation(summary = "更新模版表时间")
@DataPermission(enable = false)
@ -238,15 +238,84 @@ public class ultrasonicController {
}
@GetMapping("/getdcm")
@Operation(summary = "获取dcm数据")
@PreAuthorize("@ss.hasPermission('ultrasoniccom:ultrasonic:create')")
public CommonResult<String> GetDcmList()
{
public CommonResult<String> GetDcmList(@RequestParam("orgID") String orgID, @RequestParam("studyInsta") String studyInsta, @RequestParam("regId") String regId) throws JsonProcessingException {
String strJson = "";
String json="";
if (!studyInsta.isEmpty() && !orgID.isEmpty()) {
String Res="{\"status\":\"success\",\"patientname\":\"朱晓珍\",\"hospital\":\"东营康惠健康体检中心\",\"seriesList\":[{\"thumbUrl\":\"/static/101缩略图.jpg\",\"seriesdesc\":\"CHEST\",\"instanceList\":[{\"imageid\":\"/static/49814@101@1@1.2.156.112605.189250948694021.20221211000237.4.28076.1.dcm\"}]},{\"thumbUrl\":\"/static/201缩略图.jpg\",\"seriesdesc\":\"CHEST\",\"instanceList\":[{\"imageid\":\"/static/49814@201@1@1.2.156.112605.189250948694021.20221211000325.4.16016.1.dcm\"},{\"imageid\":\"/static/49814@201@2@1.2.156.112605.189250948694021.20221211000325.4.16016.2.dcm\"},{\"imageid\":\"/static/49814@201@3@1.2.156.112605.189250948694021.20221211000325.4.16016.3.dcm\"},{\"imageid\":\"/static/49814@201@4@1.2.156.112605.189250948694021.20221211000326.4.16016.1.dcm\"},{\"imageid\":\"/static/49814@201@5@1.2.156.112605.189250948694021.20221211000326.4.16016.2.dcm\"}]}]}";
// 先查询基本信息 一个患者基本信息就一条
DicompatientDO dicompatientDO = dicomworklistService.GetPatientIdData(regId, orgID);
// 获取机构名称
OrgUnitDO aDo = Service.get(orgID);
//studyInsta 当前检查部位 去查询检查项目 一个检查项目就是一个序列 一个序列里有多个文件
List<DicomSeriesDO> doList = dicomworklistService.GetDicomSeriesData(studyInsta, orgID);
if (!doList.isEmpty()) {
StringBuilder seriesassembleList = new StringBuilder();
//存放条件数据
List<String> seriesInstList = new ArrayList<>();
for (DicomSeriesDO d : doList) {
//先循环取出来所需要的service表的需要的条件数据
seriesInstList.add(d.getSeriesInst());
}
List<DicomImagesDO> imagesDOList = dicomworklistService.GetDicomImageListData(seriesInstList, orgID);
return success(Res);
for (DicomSeriesDO d : doList) {
//判断第一条数据 是他的缩略图
boolean isFirst = true;
String url="";
StringBuilder instanceList = new StringBuilder();
StringBuilder imageid = new StringBuilder();
StringBuilder seriesList = new StringBuilder();
if (!imagesDOList.isEmpty()) {
//筛选数据
List<DicomImagesDO> activeImages = imagesDOList.stream()
.filter(DicomImagesDO -> DicomImagesDO.getSeriesInst().equals(d.getSeriesInst()))
.sorted(Comparator.comparing(DicomImagesDO->Integer.parseInt(DicomImagesDO.getImageNumbe()))) // 保持原始顺序
.collect(Collectors.toList());
for (DicomImagesDO imagesDO : activeImages) {
if (isFirst) {
// 这是第一条数据的逻辑处理
// url="/dcm/"+imagesDO.getObjectFile().replace("\\", "\\\\").replaceFirst("\\.dcm$", ".jpg");
url="/static/ctlogo.png";
// 处理完第一条数据后将isFirst标志设置为false
isFirst = false;
}
imageid.append("{\"imageid\": \"").append("/dcm/"+imagesDO.getObjectFile().replace("\\", "\\\\")).append("\"},");
}
}
if (imageid.length() > 0) {
imageid.deleteCharAt(imageid.length() - 1);
}
instanceList.append(" \"instanceList\": [").append(imageid).append("]");
seriesList.append(" { \"SeriesDesc\": \""+d.getSeriesDesc()+"\",\"thumbUrl\": \""+url+"\",\n" + " \"seriesdesc\": \"CHEST\",\n").append(instanceList).append("},");
seriesassembleList.append(seriesList);
}
if (seriesassembleList.length() > 0) {
seriesassembleList.deleteCharAt(seriesassembleList.length() - 1);
}
strJson = " { " +
" \"status\": \"success\"," +
" \"patientname\": \"" + dicompatientDO.getPatientNam() + "\"," +
"\"hospital\": \"" + aDo.getOrgName() + "\"," +
" \"seriesList\": [" +
seriesassembleList +
"]" +
" }";
}
ObjectMapper mapper = new ObjectMapper();
json= mapper.writeValueAsString(strJson);
}
// String Res="{\"status\":\"success\",\"patientname\":\"朱晓珍\",\"hospital\":\"东营康惠健康体检中心\",\"seriesList\":[{\"thumbUrl\":\"/static/101缩略图.jpg\",\"seriesdesc\":\"CHEST\",\"instanceList\":[{\"imageid\":\"/static/49814@101@1@1.2.156.112605.189250948694021.20221211000237.4.28076.1.dcm\"}]},{\"thumbUrl\":\"/static/201缩略图.jpg\",\"seriesdesc\":\"CHEST\",\"instanceList\":[{\"imageid\":\"/static/49814@201@1@1.2.156.112605.189250948694021.20221211000325.4.16016.1.dcm\"},{\"imageid\":\"/static/49814@201@2@1.2.156.112605.189250948694021.20221211000325.4.16016.2.dcm\"},{\"imageid\":\"/static/49814@201@3@1.2.156.112605.189250948694021.20221211000325.4.16016.3.dcm\"},{\"imageid\":\"/static/49814@201@4@1.2.156.112605.189250948694021.20221211000326.4.16016.1.dcm\"},{\"imageid\":\"/static/49814@201@5@1.2.156.112605.189250948694021.20221211000326.4.16016.2.dcm\"}]}]}";
return success(strJson);
}