超声增加查看视频和插入图片方法
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
yudao-ui-admin CI / build (14.x) (push) Has been cancelled
yudao-ui-admin CI / build (16.x) (push) Has been cancelled

This commit is contained in:
lxd 2024-09-05 11:39:21 +08:00
parent b0b5c56acd
commit 2be0ed2de0
7 changed files with 84 additions and 32 deletions

View File

@ -8,18 +8,8 @@ import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.service.dicomworklist.DicomworklistService; import cn.iocoder.yudao.module.system.service.dicomworklist.DicomworklistService;
import cn.iocoder.yudao.module.system.service.org.OrgUnitService; import cn.iocoder.yudao.module.system.service.org.OrgUnitService;
import cn.iocoder.yudao.module.system.service.user.AdminUserService; import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import com.fasterxml.jackson.databind.SerializationFeature; import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.ultrasonic.medicalimg.insimagescreenshotVO;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.http.entity.ContentType;
import cn.hutool.core.date.DateTime;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.devicevo.DeviceVO;
import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.devicevo.deviceupVO;
import cn.iocoder.yudao.module.applyregistration.dal.dataobject.applyform.ApplyformDO;
import cn.iocoder.yudao.module.applyregistration.dal.device.DeviceDO;
import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.ultrasonic.medicalimg.medicalimgVO;
import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.ultrasonic.medicalimg.upmedicalimgVO; import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.ultrasonic.medicalimg.upmedicalimgVO;
import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.medicalimg.medicalimgDO; import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.medicalimg.medicalimgDO;
import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.ultrasonicDO; import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.ultrasonicDO;
@ -29,9 +19,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.ApplyformController; import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.ApplyformController;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -43,8 +31,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -81,7 +67,7 @@ public class ultrasonicController {
public CommonResult<List<Tree>> getreporttemplatelist(@RequestParam("orgID") String orgID, @RequestParam("type") String type, @RequestParam("isprivate") String isprivate) throws Exception { public CommonResult<List<Tree>> getreporttemplatelist(@RequestParam("orgID") String orgID, @RequestParam("type") String type, @RequestParam("isprivate") String isprivate) throws Exception {
//当前登陆用户 //当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId()); AdminUserDO user = userService.getUser(getLoginUserId());
orgID= user.getOrgId(); orgID = user.getOrgId();
List<ultrasonicDO> devicelist = ultrasonicService.getreporttemplate(); List<ultrasonicDO> devicelist = ultrasonicService.getreporttemplate();
List<ultrasonicDO> filteredList = new ArrayList<>(); List<ultrasonicDO> filteredList = new ArrayList<>();
@ -114,8 +100,7 @@ public class ultrasonicController {
.filter(ultrasonicDO -> Objects.equals(ultrasonicDO.getPrivateDoctorId(), user.getDoctorID())) .filter(ultrasonicDO -> Objects.equals(ultrasonicDO.getPrivateDoctorId(), user.getDoctorID()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} } else// 共有
else// 共有
{ {
// 筛选条件 // 筛选条件
filteredList = filteredList.stream() filteredList = filteredList.stream()
@ -172,8 +157,7 @@ public class ultrasonicController {
parent.children = new ArrayList<>(); // 初始化 parent.children 列表 parent.children = new ArrayList<>(); // 初始化 parent.children 列表
} }
parent.children.add(tree); parent.children.add(tree);
} } else if (privateId != null && !privateId.isEmpty())//判断是否是私有模版 私有的直接加到树里面
else if(privateId!=null && !privateId.isEmpty())//判断是否是私有模版 私有的直接加到树里面
{ {
treeList.add(tree); treeList.add(tree);
} }
@ -199,6 +183,15 @@ public class ultrasonicController {
return success(BeanUtils.toBean(devicelist, medicalimgDO.class)); return success(BeanUtils.toBean(devicelist, medicalimgDO.class));
} }
@GetMapping("/GetImageVideo")
@Operation(summary = "获取图片表视频")
public CommonResult<String> GetImageVideo(@RequestParam("regID") String regId) {
//当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
String imgurl = medicalimgService.GetImagevideo(user.getOrgId(), regId);
return success(imgurl);
}
@PutMapping("/examineimageupdate") @PutMapping("/examineimageupdate")
@Operation(summary = "超声审核更新图片数据") @Operation(summary = "超声审核更新图片数据")
@ -274,7 +267,7 @@ public class ultrasonicController {
@PreAuthorize("@ss.hasPermission('ultrasoniccom:ultrasonic:create')") @PreAuthorize("@ss.hasPermission('ultrasoniccom:ultrasonic:create')")
public CommonResult<String> GetDcmList(@RequestParam("orgID") String orgID, @RequestParam("studyInsta") String studyInsta, @RequestParam("regId") String regId) throws JsonProcessingException { public CommonResult<String> GetDcmList(@RequestParam("orgID") String orgID, @RequestParam("studyInsta") String studyInsta, @RequestParam("regId") String regId) throws JsonProcessingException {
String strJson = ""; String strJson = "";
String json=""; String json = "";
if (!studyInsta.isEmpty() && !orgID.isEmpty()) { if (!studyInsta.isEmpty() && !orgID.isEmpty()) {
// 先查询基本信息 一个患者基本信息就一条 // 先查询基本信息 一个患者基本信息就一条
@ -296,7 +289,7 @@ public class ultrasonicController {
for (DicomSeriesDO d : doList) { for (DicomSeriesDO d : doList) {
//判断第一条数据 是他的缩略图 //判断第一条数据 是他的缩略图
boolean isFirst = true; boolean isFirst = true;
String url=""; String url = "";
StringBuilder instanceList = new StringBuilder(); StringBuilder instanceList = new StringBuilder();
StringBuilder imageid = new StringBuilder(); StringBuilder imageid = new StringBuilder();
StringBuilder seriesList = new StringBuilder(); StringBuilder seriesList = new StringBuilder();
@ -304,25 +297,25 @@ public class ultrasonicController {
//筛选数据 //筛选数据
List<DicomImagesDO> activeImages = imagesDOList.stream() List<DicomImagesDO> activeImages = imagesDOList.stream()
.filter(DicomImagesDO -> DicomImagesDO.getSeriesInst().equals(d.getSeriesInst())) .filter(DicomImagesDO -> DicomImagesDO.getSeriesInst().equals(d.getSeriesInst()))
.sorted(Comparator.comparing(DicomImagesDO->Integer.parseInt(DicomImagesDO.getImageNumbe()))) // 保持原始顺序 .sorted(Comparator.comparing(DicomImagesDO -> Integer.parseInt(DicomImagesDO.getImageNumbe()))) // 保持原始顺序
.collect(Collectors.toList()); .collect(Collectors.toList());
for (DicomImagesDO imagesDO : activeImages) { for (DicomImagesDO imagesDO : activeImages) {
if (isFirst) { if (isFirst) {
// 这是第一条数据的逻辑处理 // 这是第一条数据的逻辑处理
// url="/dcm/"+imagesDO.getObjectFile().replace("\\", "\\\\").replaceFirst("\\.dcm$", ".jpg"); // url="/dcm/"+imagesDO.getObjectFile().replace("\\", "\\\\").replaceFirst("\\.dcm$", ".jpg");
url="/static/ctlogo.png"; url = "/static/ctlogo.png";
// 处理完第一条数据后将isFirst标志设置为false // 处理完第一条数据后将isFirst标志设置为false
isFirst = false; isFirst = false;
} }
imageid.append("{\"imageid\": \"").append("/dcm/"+imagesDO.getObjectFile().replace("\\", "\\\\")).append("\"},"); imageid.append("{\"imageid\": \"").append("/dcm/" + imagesDO.getObjectFile().replace("\\", "\\\\")).append("\"},");
} }
} }
if (imageid.length() > 0) { if (imageid.length() > 0) {
imageid.deleteCharAt(imageid.length() - 1); imageid.deleteCharAt(imageid.length() - 1);
} }
instanceList.append(" \"instanceList\": [").append(imageid).append("]"); instanceList.append(" \"instanceList\": [").append(imageid).append("]");
seriesList.append(" { \"SeriesDesc\": \""+d.getSeriesDesc()+"\",\"thumbUrl\": \""+url+"\",\n" + " \"seriesdesc\": \"CHEST\",\n").append(instanceList).append("},"); seriesList.append(" { \"SeriesDesc\": \"" + d.getSeriesDesc() + "\",\"thumbUrl\": \"" + url + "\",\n" + " \"seriesdesc\": \"CHEST\",\n").append(instanceList).append("},");
seriesassembleList.append(seriesList); seriesassembleList.append(seriesList);
} }
@ -340,7 +333,7 @@ public class ultrasonicController {
} }
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
json= mapper.writeValueAsString(strJson); 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\"}]}]}"; // 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\"}]}]}";
@ -348,5 +341,26 @@ public class ultrasonicController {
return success(strJson); return success(strJson);
} }
@PostMapping("/insimagescreenshot")
@Operation(summary = "插入视频截屏图像")
public int InsImageScreenshot(@RequestBody insimagescreenshotVO insimagescreenshotVO) {
//当前时间
LocalDateTime dateTime = LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
//当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
// 生成随机 UUID
UUID randomUUID = UUID.randomUUID();
medicalimgDO medicalimgDO = new medicalimgDO();
medicalimgDO.setId(randomUUID.toString());
medicalimgDO.setImgUrl(insimagescreenshotVO.getImagebase());
medicalimgDO.setCreatePerson(user.getUsername());
medicalimgDO.setCreateDate(dateTime);
medicalimgDO.setRegId(insimagescreenshotVO.getID());
medicalimgDO.setOrgId(user.getOrgId());
medicalimgDO.setSelected("0");
medicalimgDO.setImgType("1");
return medicalimgService.insimage(medicalimgDO);
}
} }

View File

@ -92,4 +92,7 @@ public class medicalimgDO {
*/ */
@TableField("selected") @TableField("selected")
private String selected; private String selected;
@TableField("imgType")
private String imgType;
} }

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.medicalimg; package cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.medicalimg;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ultrasoniccom.dal.ultrasonic.ultrasonicDO;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -16,4 +15,6 @@ public interface medicalimgMapper extends BaseMapperX<medicalimgDO> {
List<medicalimgDO> getmedicalimgist(@Param("orgId") String orgId,@Param("regId") String regId,@Param("select") String select); List<medicalimgDO> getmedicalimgist(@Param("orgId") String orgId,@Param("regId") String regId,@Param("select") String select);
List<medicalimgDO> getmedicalimgist(UserDataDocumentFactory UserDataDocumentFactory); List<medicalimgDO> getmedicalimgist(UserDataDocumentFactory UserDataDocumentFactory);
String GetImageVideo(@Param("orgId") String orgId,@Param("regId") String regId);
} }

View File

@ -16,4 +16,9 @@ public interface medicalimgService extends IService<medicalimgDO> {
void updatePatientexamlist(@Valid medicalimgVO medicalimgVO); void updatePatientexamlist(@Valid medicalimgVO medicalimgVO);
int insimage(medicalimgDO medicalimgDO);
String GetImagevideo(String orgId,String regId);
} }

View File

@ -12,6 +12,7 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.UUID;
@Service @Service
@Validated @Validated
@ -32,4 +33,14 @@ public class medicalimgServiceImpl extends ServiceImpl<medicalimgMapper, medical
medicalimgDO updateObj = BeanUtils.toBean(updateReqVO, medicalimgDO.class); medicalimgDO updateObj = BeanUtils.toBean(updateReqVO, medicalimgDO.class);
medicalimgMapper.updateById(updateObj); medicalimgMapper.updateById(updateObj);
} }
@Override
public int insimage(medicalimgDO medicalimgDO) {
return medicalimgMapper.insert(medicalimgDO);
}
@Override
public String GetImagevideo(String orgId,String regId) {
return medicalimgMapper.GetImageVideo(orgId,regId);
}
} }

View File

@ -25,4 +25,6 @@ public interface ultrasonicService extends IService<ultrasonicDO> {
List<medicalimgDO> getmedicalimgist(@Param("orgId") String orgId, @Param("regId") String regId,@Param("select") String select); List<medicalimgDO> getmedicalimgist(@Param("orgId") String orgId, @Param("regId") String regId,@Param("select") String select);
void updatePatientexamlist(@Valid medicalimgVO medicalimgVO); void updatePatientexamlist(@Valid medicalimgVO medicalimgVO);
} }

View File

@ -14,7 +14,7 @@
WHERE WHERE
<trim prefixOverrides="and | or"> <trim prefixOverrides="and | or">
<if test="orgId != null or regId != null"> <if test="orgId != null or regId != null">
AND (isDelete != '1' OR isDelete IS NULL) AND (isDelete != '1' OR isDelete IS NULL) AND imgType='1'
</if> </if>
<if test="orgId != null"> <if test="orgId != null">
AND orgId = #{orgId} AND orgId = #{orgId}
@ -27,9 +27,25 @@
</if> </if>
</trim> </trim>
</select> </select>
<select id="GetImageVideo" resultType="java.lang.String">
SELECT imgUrl FROM tb_medicalimg
WHERE
<trim prefixOverrides="and | or">
<if test="orgId != null or regId != null">
AND (isDelete != '1' OR isDelete IS NULL) AND imgType='2'
</if>
<if test="orgId != null">
AND orgId = #{orgId}
</if>
<if test="regId != null">
AND regId = #{regId}
</if>
</trim>
</select>
<!-- @Param("NameList")--> <!-- @Param("NameList")-->
<!-- name in--> <!-- name in-->
<!-- <foreach collection="NameList" item="name" separator="," open="(" close=")" >--> <!-- <foreach collection="NameList" item="name" separator="," open="(" close=")" >-->
<!-- #{name}--> <!-- #{name}-->