Compare commits

...

2 Commits

Author SHA1 Message Date
418be095df Merge remote-tracking branch 'origin/main' 2025-06-27 16:18:10 +08:00
dc5526f8bb 修改BUG 2025-06-27 16:17:44 +08:00
10 changed files with 207 additions and 13 deletions

View File

@ -103,4 +103,13 @@ public class InspectPacsDataController {
BeanUtils.toBean(list, InspectPacsDataRespVO.class));
}
@GetMapping("/getByMedicalSnAndType")
@Operation(summary = "根据体检编号和类型查询报告状态")
public CommonResult<Map<String, Object>> getPacsDataByMedicalSnAndType(
@RequestParam("medicalSn") String medicalSn,
@RequestParam("type") String type) {
Map<String, Object> result = pacsDataService.getPacsDataByMedicalSnAndType(medicalSn, type);
return success(result);
}
}

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.inspect.controller.admin.inspectpacsdata.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@Schema(description = "管理后台 - 报告状态 Response VO")
@Data
public class ReportStatusRespVO {
@Schema(description = "体检编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20241201123456")
private String medicalSn;
@Schema(description = "检查类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "US")
private String type;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private String status;
}

View File

@ -588,12 +588,15 @@ public class InspectPatientController {
ReportData reportData = reportResponse.getData();
// 获取 reportPath
String reportPath = reportData.getReportPath();
String barCodestatus=reportData.getBarCodestatus();
String barCodestatus=reportData.getBarCodeStatus();
//更新检验检查状态
if (barCodestatus!=null) {
pacsDataService.updatebarcodestatus(medicalSn, model, barCodestatus);
if (pacsDataService.existsReportStatus(medicalSn, model)) {
pacsDataService.updateReportStatus(medicalSn, model, barCodestatus);
} else {
pacsDataService.insertReportStatus(medicalSn, model, barCodestatus);
}
}
if (!reportPath.contains("报告暂未出")) {
StringBuilder sb = new StringBuilder();
InspectPacsDataSaveReqVO inspectPacs = new InspectPacsDataSaveReqVO();
@ -639,10 +642,14 @@ public class InspectPatientController {
ReportData reportData = reportResponse.getData();
// 获取 reportPath
String reportPath = reportData.getReportPath();
String barCodestatus=reportData.getBarCodestatus();
String barCodestatus=reportData.getBarCodeStatus();
//更新检验检查状态
if (barCodestatus!=null) {
pacsDataService.updatebarcodestatus(medicalSn, model, barCodestatus);
if (pacsDataService.existsReportStatus(medicalSn, model)) {
pacsDataService.updateReportStatus(medicalSn, model, barCodestatus);
} else {
pacsDataService.insertReportStatus(medicalSn, model, barCodestatus);
}
}
if (!reportPath.contains("报告暂未出")) {
StringBuilder sb = new StringBuilder();
@ -1000,7 +1007,8 @@ public class InspectPatientController {
@Operation(summary = "获取超声报告")
public CommonResult<Boolean> GetApiPacsInfo(@RequestParam("medicalSn") String medicalSn) {
// 只获取shortid字段提高查询性能
String shortid = patientService.getPatientShortid(medicalSn);
InspectPatientDO patientDO = patientService.getPatientShortid(medicalSn);
String shortid = patientDO != null ? patientDO.getShortid() : null;
if (shortid == null) {
return success(false);
}
@ -1918,7 +1926,7 @@ public class InspectPatientController {
public CommonResult<BarcodeInfoVO> GetbarcodeInfo(@RequestParam("medicalSn") String medicalSn) {
// 获取患者信息
InspectPatientDO patientDO = patientService.getPatientInfo(medicalSn);
InspectPatientDO patientDO = patientService.getPatientShortid(medicalSn);
if (patientDO == null) {
return success("未找到该患者信息");
}

View File

@ -7,7 +7,7 @@ import java.util.List;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class ReportData {
private String barCodestatus;
private String barCodeStatus;
private String reportPath;
private List<ResultItem> results;
private List<ResultItem> resultsAll;

View File

@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.inspect.dal.dataobject.inspectpacsdata.InspectPacsDataDO;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import cn.iocoder.yudao.module.inspect.controller.admin.inspectpacsdata.vo.*;
/**
@ -34,4 +35,28 @@ public interface InspectPacsDataMapper extends BaseMapperX<InspectPacsDataDO> {
.orderByDesc(InspectPacsDataDO::getId));
}
/**
* 插入检验报告状态
*/
int insertReportStatus(@Param("medicalSn") String medicalSn,
@Param("type") String type,
@Param("status") String status);
/**
* 更新检验报告状态
*/
int updateReportStatus(@Param("medicalSn") String medicalSn,
@Param("type") String type,
@Param("status") String status);
/**
* 统计检验报告状态表中指定体检编号和类型的记录数
*/
int countReportStatus(@Param("medicalSn") String medicalSn, @Param("type") String type);
/**
* 根据体检编号和类型查询PACS数据
*/
Map<String, Object> getPacsDataByMedicalSnAndType(@Param("medicalSn") String medicalSn, @Param("type") String type);
}

View File

@ -49,6 +49,26 @@ public interface InspectPacsDataService {
* */
void updatebarcodestatus(String medicalSn, String type, String barcodestatus);
/**
* 插入检验报告状态到tb_report_status表
*
* @param medicalSn 体检编号
* @param type 类型
* @param status 状态
* @return 影响行数
*/
int insertReportStatus(String medicalSn, String type, String status);
/**
* 更新检验报告状态到tb_report_status表
*
* @param medicalSn 体检编号
* @param type 类型
* @param status 状态
* @return 影响行数
*/
int updateReportStatus(String medicalSn, String type, String status);
/**
* 获得pacs抓取数据
*
@ -86,4 +106,18 @@ public interface InspectPacsDataService {
PageResult<InspectPacsDataDO> getPacsDataPage(InspectPacsDataPageReqVO pageReqVO);
List<InspectPacsDataDO> getPacsDataByCode(String medicalSn);
/**
* 判断检验报告状态表中指定体检编号和类型的记录是否存在
*/
boolean existsReportStatus(String medicalSn, String type);
/**
* 根据体检编号和类型查询PACS数据
*
* @param medicalSn 体检编号
* @param type 数据类型
* @return 报告状态数据
*/
Map<String, Object> getPacsDataByMedicalSnAndType(String medicalSn, String type);
}

View File

@ -79,6 +79,23 @@ public class InspectPacsDataServiceImpl implements InspectPacsDataService {
.set(InspectPacsDataDO::getRemark, barcodestatus);
pacsDataMapper.update(null, updateWrapper);
}
/**
* 插入检验报告状态到tb_report_status表
*/
@Override
public int insertReportStatus(String medicalSn, String type, String status) {
return pacsDataMapper.insertReportStatus(medicalSn, type, status);
}
/**
* 更新检验报告状态到tb_report_status表
*/
@Override
public int updateReportStatus(String medicalSn, String type, String status) {
return pacsDataMapper.updateReportStatus(medicalSn, type, status);
}
private void validatePacsDataExists(Integer id) {
if (pacsDataMapper.selectById(id) == null) {
@ -131,4 +148,14 @@ public class InspectPacsDataServiceImpl implements InspectPacsDataService {
return Collections.emptyList();
}
@Override
public boolean existsReportStatus(String medicalSn, String type) {
return pacsDataMapper.countReportStatus(medicalSn, type) > 0;
}
@Override
public Map<String, Object> getPacsDataByMedicalSnAndType(String medicalSn, String type) {
return pacsDataMapper.getPacsDataByMedicalSnAndType(medicalSn, type);
}
}

View File

@ -88,9 +88,9 @@ public interface InspectPatientService {
InspectPatientDO getnewPatientInfo(String medicalSn);
/*
* 根据体检编号只获取shortid字段
* 根据体检编号获取患者信息除头像外
* */
String getPatientShortid(String medicalSn);
InspectPatientDO getPatientShortid(String medicalSn);
/*
* 更新患者的基本信息里的补充信息 高血压老年人行政村卫生院糖尿病精神病
* */

View File

@ -203,12 +203,59 @@ public class InspectPatientServiceImpl implements InspectPatientService {
}
@Override
public String getPatientShortid(String medicalSn) {
public InspectPatientDO getPatientShortid(String medicalSn) {
LambdaQueryWrapper<InspectPatientDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(InspectPatientDO::getMedicalSn, medicalSn)
.select(InspectPatientDO::getShortid);
.select(
InspectPatientDO::getId,
InspectPatientDO::getMedicalSn,
InspectPatientDO::getPName,
InspectPatientDO::getGender,
InspectPatientDO::getBirthday,
InspectPatientDO::getCardType,
InspectPatientDO::getCardId,
InspectPatientDO::getNationality,
InspectPatientDO::getNation,
InspectPatientDO::getRace,
InspectPatientDO::getPhoneNum,
InspectPatientDO::getStatus,
InspectPatientDO::getReportType,
InspectPatientDO::getMedicalDateTime,
InspectPatientDO::getChargeType,
InspectPatientDO::getTotalPrice,
InspectPatientDO::getIsprint,
InspectPatientDO::getSummaryResult,
InspectPatientDO::getAuditor,
InspectPatientDO::getAuditorTime,
InspectPatientDO::getAuditStatus,
InspectPatientDO::getInspectionOpinion,
InspectPatientDO::getChargetime,
InspectPatientDO::getDomicileaddress,
InspectPatientDO::getHospitalNo,
InspectPatientDO::getXcgcode,
InspectPatientDO::getNcgcode,
InspectPatientDO::getShqx,
InspectPatientDO::getZybs,
InspectPatientDO::getFeatures,
InspectPatientDO::getChiefinspectorid,
InspectPatientDO::getChiefinspector,
InspectPatientDO::getPrinttime,
InspectPatientDO::getBarcodetime,
InspectPatientDO::getPdfurl,
InspectPatientDO::getOldmanflag,
InspectPatientDO::getOrgname,
InspectPatientDO::getDistrictname,
InspectPatientDO::getHtnflag,
InspectPatientDO::getDiaflag,
InspectPatientDO::getSmiflag,
InspectPatientDO::getPulflag,
InspectPatientDO::getExamhoscode,
InspectPatientDO::getExamhosname,
InspectPatientDO::getShortid
);
InspectPatientDO patientDO = patientMapper.selectOne(queryWrapper);
return patientDO != null ? patientDO.getShortid() : null;
return patientDO;
}
@Override
public List<InspectPatientDO> getPatientdetails(PatientDetailsVO detailsVO) {

View File

@ -9,4 +9,29 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<!-- 插入检验报告状态 -->
<insert id="insertReportStatus">
INSERT INTO tb_report_status (medicalSn, type, status)
VALUES (#{medicalSn}, #{type}, #{status})
</insert>
<!-- 更新检验报告状态 -->
<update id="updateReportStatus">
UPDATE tb_report_status
SET status = #{status}
WHERE medicalSn = #{medicalSn} AND type = #{type}
</update>
<!-- 统计检验报告状态表中指定体检编号和类型的记录数 -->
<select id="countReportStatus" resultType="int">
SELECT COUNT(*) FROM tb_report_status WHERE medicalSn = #{medicalSn} AND type = #{type}
</select>
<!-- 根据体检编号和类型查询PACS数据 -->
<select id="getPacsDataByMedicalSnAndType" resultType="java.util.Map">
SELECT medicalSn, type, status FROM tb_report_status
WHERE medicalSn = #{medicalSn} AND type = #{type}
LIMIT 1
</select>
</mapper>