@ -1,12 +1,4 @@
package cn.iocoder.yudao.module.ultrasoniccom.controller.admin.ultrasonic ;
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.OkHttpClient ;
import okhttp3.Request ;
import okhttp3.Request ;
import okhttp3.Response ;
import okhttp3.Response ;
@ -51,7 +43,6 @@ import java.util.*;
import java.util.stream.Collectors ;
import java.util.stream.Collectors ;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success ;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success ;
@Tag ( name = " 管理后台 - 超声科组件 " )
@Tag ( name = " 管理后台 - 超声科组件 " )
@RestController
@RestController
@RequestMapping ( " /ultrasoniccom/ultrasonic " )
@RequestMapping ( " /ultrasoniccom/ultrasonic " )
@ -63,12 +54,6 @@ public class ultrasonicController {
private ultrasonicService ultrasonicService ;
private ultrasonicService ultrasonicService ;
@Resource
@Resource
private medicalimgService medicalimgService ;
private medicalimgService medicalimgService ;
@Resource
private DicomworklistService dicomworklistService ;
@Resource
private OrgUnitService Service ;
@GetMapping ( " /reporttemplatetlist " )
@GetMapping ( " /reporttemplatetlist " )
@Operation ( summary = " 获取模版表数据 " )
@Operation ( summary = " 获取模版表数据 " )
@ -85,21 +70,26 @@ public class ultrasonicController {
devicelist = sortedList ;
devicelist = sortedList ;
if ( ! orgID . isEmpty ( ) ) {
if ( ! orgID . isEmpty ( ) )
{
filteredList = devicelist . stream ( )
filteredList = devicelist . stream ( )
. filter ( ultrasonicDO - > ( ultrasonicDO . getOrgId ( ) . equals ( orgID ) ) )
. filter ( ultrasonicDO - > ( ultrasonicDO . getOrgId ( ) . equals ( orgID ) ) )
. collect ( Collectors . toList ( ) ) ;
. collect ( Collectors . toList ( ) ) ;
}
}
if ( filteredList . isEmpty ( ) ) {
if ( filteredList . isEmpty ( ) )
{
filteredList = devicelist ;
filteredList = devicelist ;
}
}
if ( ! type . isEmpty ( ) & & ! type . equals ( " undefined " ) ) {
if ( ! type . isEmpty ( ) & & ! type . equals ( " undefined " ) )
{
/ / 筛选条件 :
/ / 筛选条件 :
filteredList = filteredList . stream ( )
filteredList = filteredList . stream ( )
. filter ( ultrasonicDO - > ( ultrasonicDO . getTemplateType ( ) . equals ( type ) ) )
. filter ( ultrasonicDO - > ( ultrasonicDO . getTemplateType ( ) . equals ( type ) ) )
. collect ( Collectors . toList ( ) ) ;
. collect ( Collectors . toList ( ) ) ;
}
}
if ( isprivate . equals ( " 1 " ) ) {
if ( isprivate . equals ( " 1 " ) )
{
/ / 筛选条件 :
/ / 筛选条件 :
filteredList = filteredList . stream ( )
filteredList = filteredList . stream ( )
. filter ( ultrasonicDO - > ( ultrasonicDO . getPrivateDoctorId ( ) ! = null ) )
. filter ( ultrasonicDO - > ( ultrasonicDO . getPrivateDoctorId ( ) ! = null ) )
@ -175,7 +165,8 @@ public class ultrasonicController {
@PreAuthorize ( " @ss.hasPermission('tblist:patientexamlist:update') " )
@PreAuthorize ( " @ss.hasPermission('tblist:patientexamlist:update') " )
public CommonResult < Boolean > updateexamineimagelist ( @Valid @RequestBody List < upmedicalimgVO > updateReqVO ) {
public CommonResult < Boolean > updateexamineimagelist ( @Valid @RequestBody List < upmedicalimgVO > updateReqVO ) {
if ( ! updateReqVO . isEmpty ( ) ) {
if ( ! updateReqVO . isEmpty ( ) )
{
/ / 最终提交的数据
/ / 最终提交的数据
List < medicalimgDO > doList = new ArrayList < > ( ) ;
List < medicalimgDO > doList = new ArrayList < > ( ) ;
@ -187,23 +178,30 @@ public class ultrasonicController {
/ / 新增对象
/ / 新增对象
medicalimgDO medicalimgDO = new medicalimgDO ( ) ;
medicalimgDO medicalimgDO = new medicalimgDO ( ) ;
medicalimgDO . setId ( s . getId ( ) ) ;
medicalimgDO . setId ( s . getId ( ) ) ;
if ( ! s . getIsDelete ( ) . isEmpty ( ) ) {
if ( ! s . getIsDelete ( ) . isEmpty ( ) )
{
medicalimgDO . setIsDelete ( s . getIsDelete ( ) ) ;
medicalimgDO . setIsDelete ( s . getIsDelete ( ) ) ;
medicalimgDO . setDeletePerson ( s . getDeletePerson ( ) ) ;
medicalimgDO . setDeletePerson ( s . getDeletePerson ( ) ) ;
medicalimgDO . setDeleteDate ( dateTime ) ;
medicalimgDO . setDeleteDate ( dateTime ) ;
}
}
if ( ! s . getSelected ( ) . isEmpty ( ) ) {
if ( ! s . getSelected ( ) . isEmpty ( ) )
{
medicalimgDO . setSelected ( s . getSelected ( ) ) ;
medicalimgDO . setSelected ( s . getSelected ( ) ) ;
}
}
doList . add ( medicalimgDO ) ;
doList . add ( medicalimgDO ) ;
}
}
if ( ! doList . isEmpty ( ) ) {
if ( ! doList . isEmpty ( ) )
{
boolean bol = medicalimgService . updateBatchById ( doList ) ;
boolean bol = medicalimgService . updateBatchById ( doList ) ;
return success ( bol ) ;
return success ( bol ) ;
} else {
}
else
{
return success ( false ) ;
return success ( false ) ;
}
}
} else {
}
else
{
log . error ( " 超声审核更新图片数据方法参数为空 " ) ;
log . error ( " 超声审核更新图片数据方法参数为空 " ) ;
return success ( false ) ;
return success ( false ) ;
@ -213,6 +211,8 @@ public class ultrasonicController {
}
}
@GetMapping ( " /upreporttemplatetime " )
@GetMapping ( " /upreporttemplatetime " )
@Operation ( summary = " 更新模版表时间 " )
@Operation ( summary = " 更新模版表时间 " )
@DataPermission ( enable = false )
@DataPermission ( enable = false )
@ -238,84 +238,15 @@ public class ultrasonicController {
}
}
@GetMapping ( " /getdcm " )
@GetMapping ( " /getdcm " )
@Operation ( summary = " 获取dcm数据 " )
@Operation ( summary = " 获取dcm数据 " )
@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 ( )
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 ) ;
for ( DicomSeriesDO d : doList ) {
return success ( Res ) ;
/ / 判断第一条数据 是他的缩略图
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 ) ;
}
}