Compare commits

...

3 Commits

Author SHA1 Message Date
7e15513a93 超声接受数据 2025-08-05 09:18:45 +08:00
0697235a27 修改 2025-07-28 11:42:34 +08:00
ad89e8ecbc 查询条件修改 2025-06-30 15:09:40 +08:00
9 changed files with 107 additions and 56 deletions

View File

@ -440,7 +440,7 @@ public class InspectPatientController {
@Operation(summary = "发送检验申请单")
public CommonResult<Boolean> syncinspectApplyTj(@RequestParam("medicalSn") String medicalSn) throws JsonProcessingException {
//获取患者信息
InspectPatientDO patientDO = patientService.getPatientInfo(medicalSn);
InspectPatientDO patientDO = patientService.getnewPatientInfo(medicalSn);
if (patientDO != null) {
String checkBarCode1, checkBarCode2, checkBarCode3;
@ -591,11 +591,7 @@ public class InspectPatientController {
String barCodestatus=reportData.getBarCodeStatus();
//更新检验检查状态
if (barCodestatus!=null) {
if (pacsDataService.existsReportStatus(medicalSn, model)) {
pacsDataService.updateReportStatus(medicalSn, model, barCodestatus);
} else {
pacsDataService.insertReportStatus(medicalSn, model, barCodestatus);
}
pacsDataService.upsertReportStatus(medicalSn, model, barCodestatus);
}
if (!reportPath.contains("报告暂未出")) {
StringBuilder sb = new StringBuilder();
@ -645,11 +641,7 @@ public class InspectPatientController {
String barCodestatus=reportData.getBarCodeStatus();
//更新检验检查状态
if (barCodestatus!=null) {
if (pacsDataService.existsReportStatus(medicalSn, model)) {
pacsDataService.updateReportStatus(medicalSn, model, barCodestatus);
} else {
pacsDataService.insertReportStatus(medicalSn, model, barCodestatus);
}
pacsDataService.upsertReportStatus(medicalSn, model, barCodestatus);
}
if (!reportPath.contains("报告暂未出")) {
StringBuilder sb = new StringBuilder();
@ -761,7 +753,7 @@ public class InspectPatientController {
@Operation(summary = "回传体检相关信息")
public CommonResult<Boolean> PushJYPatientInfo(@RequestParam("medicalSn") String medicalSn) throws JsonProcessingException {
//获取患者信息
InspectPatientDO patientDO = patientService.getPatientInfo(medicalSn);
InspectPatientDO patientDO = patientService.getnewPatientInfo(medicalSn);
if (patientDO != null) {
if (patientDO.getNcgcode() != null && patientDO.getXcgcode() != null && patientDO.getShqx() != null) {
// 定义条形码列表
@ -1073,6 +1065,80 @@ public class InspectPatientController {
return success(true);
}
@PostMapping("/receiveUSReport")
@Operation(summary = "接收外部推送的超声报告数据")
public CommonResult<Boolean> receiveUSReport(@RequestBody Map<String, Object> requestData) {
try {
// 从请求数据中提取必要字段
String medicalSn = (String) requestData.get("examid");
if (medicalSn == null || medicalSn.isEmpty()) {
return success(false, "体检编号不能为空");
}
// 验证患者是否存在
InspectPatientDO patientDO = patientService.getPatientInfo(medicalSn);
if (patientDO == null) {
return success(false, "未找到对应的患者信息");
}
// 记录推送日志
InspectApplylogSaveReqVO logVO = new InspectApplylogSaveReqVO();
logVO.setTime(LocalDateTime.now());
logVO.setMedicalsn(medicalSn);
logVO.setIdcard(patientDO.getCardId());
ObjectMapper objectMapper = new ObjectMapper();
String jsonRequestBody = objectMapper.writeValueAsString(requestData);
logVO.setJson(jsonRequestBody);
applylogService.createApplylog(logVO);
// 提取超声报告数据
String pdfurl = (String) requestData.get("pdfurl");
String pname = (String) requestData.get("pname");
String examDescription = (String) requestData.get("examDescription");
String diagResults = (String) requestData.get("diagResults");
// 处理PACS数据
if (pdfurl != null && !pdfurl.isEmpty() && pname != null && !pname.isEmpty()) {
InspectPacsDataSaveReqVO inspectPacs = new InspectPacsDataSaveReqVO();
inspectPacs.setCode(medicalSn);
inspectPacs.setData(pdfurl);
inspectPacs.setType("US");
inspectPacs.setPersonName(pname);
// 检查数据是否存在
if (pacsDataService.IspacsDataExist(medicalSn, "US")) {
// 如果存在获取现有数据并更新
InspectPacsDataDO existingData = pacsDataService.getPacsDataByCode(medicalSn, "US");
if (existingData != null) {
inspectPacs.setId(existingData.getId());
pacsDataService.updatePacsData(inspectPacs);
}
} else {
// 如果不存在创建新数据
pacsDataService.createPacsData(inspectPacs);
}
}
// 更新超声所见所得
if (examDescription != null && !examDescription.isEmpty() && diagResults != null && !diagResults.isEmpty()) {
InspectPatientitemsSaveReqVO saveReqVO = new InspectPatientitemsSaveReqVO();
saveReqVO.setMedicalSn(medicalSn);
saveReqVO.setItemCode("US001");
saveReqVO.setExamDescription(examDescription.replace('\n', ' '));
saveReqVO.setItemResult(diagResults.replace('\n', ' '));
saveReqVO.setAnalyse("检查所见: " + examDescription.replace('\n', ' ') + "\n" + "检查结论: " + diagResults.replace('\n', ' '));
patientitemsService.updateitemUSinference(saveReqVO);
}
return success(true, "超声报告数据接收成功");
} catch (Exception e) {
e.printStackTrace();
return success(false, "处理超声报告数据失败:" + e.getMessage());
}
}
@PutMapping("/update")
@Operation(summary = "更新患者信息")
public CommonResult<Boolean> updatePatient(@Valid @RequestBody InspectPatientSaveReqVO updateReqVO) {
@ -1841,7 +1907,7 @@ public class InspectPatientController {
@RequestParam("pdfUrl") String pdfUrl) {
try {
// 获取患者信息
InspectPatientDO patientDO = patientService.getPatientInfo(medicalSn);
InspectPatientDO patientDO = patientService.getnewPatientInfo(medicalSn);
if (patientDO == null) {
return success(false, "未找到该患者信息");
}
@ -2070,4 +2136,6 @@ public class InspectPatientController {
patientService.updatePatientStatus(medicalSn, status);
return success(true);
}
}
}

View File

@ -42,13 +42,6 @@ public interface InspectPacsDataMapper extends BaseMapperX<InspectPacsDataDO> {
@Param("type") String type,
@Param("status") String status);
/**
* 更新检验报告状态
*/
int updateReportStatus(@Param("medicalSn") String medicalSn,
@Param("type") String type,
@Param("status") String status);
/**
* 统计检验报告状态表中指定体检编号和类型的记录数
*/

View File

@ -50,24 +50,14 @@ public interface InspectPacsDataService {
void updatebarcodestatus(String medicalSn, String type, String barcodestatus);
/**
* 插入检验报告状态到tb_report_status表
* 插入或更新检验报告状态到tb_report_status表upsert操作
*
* @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);
int upsertReportStatus(String medicalSn, String type, String status);
/**
* 获得pacs抓取数据

View File

@ -81,21 +81,13 @@ public class InspectPacsDataServiceImpl implements InspectPacsDataService {
}
/**
* 插入检验报告状态到tb_report_status表
* 插入或更新检验报告状态到tb_report_status表upsert操作
*/
@Override
public int insertReportStatus(String medicalSn, String type, String status) {
public int upsertReportStatus(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) {

View File

@ -192,8 +192,9 @@ public class InspectPatientServiceImpl implements InspectPatientService {
InspectPatientDO::getSmiflag,
InspectPatientDO::getPulflag,
InspectPatientDO::getXcgcode,
InspectPatientDO::getNcgcode,
InspectPatientDO::getShqx,
InspectPatientDO::getNcgcode,
InspectPatientDO::getShqx,
InspectPatientDO::getPdfurl,
InspectPatientDO::getMedicalDateTime
);
@ -206,7 +207,15 @@ public class InspectPatientServiceImpl implements InspectPatientService {
public InspectPatientDO getPatientShortid(String medicalSn) {
LambdaQueryWrapper<InspectPatientDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(InspectPatientDO::getMedicalSn, medicalSn)
.select(InspectPatientDO::getShortid);
.select(
InspectPatientDO::getShortid,
InspectPatientDO::getXcgcode,
InspectPatientDO::getNcgcode,
InspectPatientDO::getShqx,
InspectPatientDO::getPName,
InspectPatientDO::getGender,
InspectPatientDO::getCardId
);
InspectPatientDO patientDO = patientMapper.selectOne(queryWrapper);
return patientDO;
}

View File

@ -161,6 +161,7 @@ public class InspectPatientitemsServiceImpl implements InspectPatientitemsServic
LambdaUpdateWrapper<InspectPatientitemsDO> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(InspectPatientitemsDO::getItemResult, saveReqVO.getItemResult())
.set(InspectPatientitemsDO::getExamDescription, saveReqVO.getExamDescription())
.set(InspectPatientitemsDO::getAnalyse, saveReqVO.getAnalyse())
.eq(InspectPatientitemsDO::getMedicalSn, saveReqVO.getMedicalSn())
.eq(InspectPatientitemsDO::getItemCode, saveReqVO.getItemCode());
patientitemsMapper.update(null, updateWrapper);

View File

@ -9,19 +9,14 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<!-- 插入检验报告状态 -->
<!-- 插入或更新检验报告状态 -->
<insert id="insertReportStatus">
INSERT INTO tb_report_status (medicalSn, type, status)
VALUES (#{medicalSn}, #{type}, #{status})
ON DUPLICATE KEY UPDATE
status = VALUES(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}

View File

@ -155,7 +155,7 @@ spring:
# 日志文件配置
logging:
file:
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
name: D:/logs/yudao/${spring.application.name}.log # 日志文件名,全路径
level:
# 配置自己写的 MyBatis Mapper 打印日志
cn.iocoder.yudao.module.bpm.dal.mysql: debug

View File

@ -73,7 +73,7 @@ mybatis-plus:
# id-type: AUTO # 自增 ID适合 MySQL 等直接自增的数据库
# id-type: INPUT # 用户输入 ID适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
# id-type: ASSIGN_ID # 分配 ID默认使用雪花算法。注意Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-delete-value: 1 # 逻辑已删除值(默认为 1)l
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
banner: false # 关闭控制台的 Banner 打印
type-aliases-package: ${yudao.info.base-package}.module.*.dal.dataobject
@ -239,6 +239,7 @@ yudao:
- /admin-api/inspect/patient/updatepersonimg #更新体检头像图片
- /admin-api/inspect/patient/PatientBySearchKey #根据姓名、身份证号、体检编号获得患者信息
- /admin-api/inspect/patient/insertPatinetInfo #创建患者
- /admin-api/inspect/patient/receiveUSReport #接收超声报告
websocket:
enable: true # websocket的开关
path: /infra/ws # 路径
@ -293,6 +294,7 @@ yudao:
- /admin-api/inspect/patient/updatepersonimg #更新体检头像图片
- /admin-api/inspect/patient/PatientBySearchKey #根据姓名、身份证号、体检编号获得患者信息
- /admin-api/inspect/patient/insertPatinetInfo #创建患者
- /admin-api/inspect/patient/receiveUSReport #接收超声报告
- /adminInspect/admin-api/inspect/department/getList
- /adminInspect/admin-api/inspect/patient/getUSPatientInfo
- /adminInspect/admin-api/system/captcha/get
@ -314,6 +316,7 @@ yudao:
- /adminInspect/admin-api/inspect/patient/updatepersonimg #更新体检头像图片
- /adminInspect/admin-api/inspect/patient/PatientBySearchKey #根据姓名、身份证号、体检编号获得患者信息
- /adminInspect/admin-api/inspect/patient/insertPatinetInfo #创建患者
- /adminInspect/admin-api/inspect/patient/receiveUSReport #接收超声报告
ignore-tables:
- system_tenant
- system_tenant_package