新增同步中医体质辨识结果接口

This commit is contained in:
lxd 2025-03-20 13:44:23 +08:00
parent bf04998b09
commit 84daa7d10a
3 changed files with 54 additions and 0 deletions

View File

@ -836,7 +836,48 @@ public class InspectPatientController {
pacsDataService.createPacsData(inspectPacs);
return success(true);
}
@PutMapping("/syncPatientZyInfo")
@Operation(summary = "同步中医体质结果项")
public CommonResult<Boolean> syncPatientZyInfo(@RequestParam("medicalSn") String medicalSn,@RequestParam("cardId") String cardId) throws JsonProcessingException {
ConfigDO config = configService.getConfigByKey("url.zytz");
String url = config.getValue();
if(url!=null)
{
String response = HttpUtils.get(url + "?" + "idCard=" + cardId);
if(response!=null)
{
// 解析 JSON 响应
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> responseMap = objectMapper.readValue(response, Map.class);
String msg = (String) responseMap.get("message");
if(msg.contains("查询成功"))
{
String data = (String) responseMap.get("data");
if(data!=null)
{
// data 字段解析为一个 Java 对象
Map<String, Object> dataMap = objectMapper.readValue(data, Map.class);
InspectPatientSaveReqVO inspectPatientSaveReqVO = new InspectPatientSaveReqVO();
inspectPatientSaveReqVO.setMedicalSn(medicalSn);
// 根据图片中的 JSON 格式映射数据
if (dataMap.containsKey("physiquename")) {
inspectPatientSaveReqVO.setZybs((String) dataMap.get("physiquename"));
}
if (dataMap.containsKey("features")) {
inspectPatientSaveReqVO.setFeatures((String) dataMap.get("features"));
}
patientService.medicalSnfeaturesupdate(inspectPatientSaveReqVO);
}
}
}
}
return success(true);
}
@GetMapping("/page")
@Operation(summary = "获得患者信息分页")
public CommonResult<PageResult<InspectPatientRespVO>> getPatientPage(@Valid InspectPatientPageReqVO pageReqVO) {

View File

@ -41,6 +41,10 @@ public interface InspectPatientService {
*
* */
void medicalSnupdate(InspectPatientSaveReqVO updateReqVO);
/*
* 更新中医体质详情
* */
void medicalSnfeaturesupdate(InspectPatientSaveReqVO updateReqVO);
/**
* 删除患者信息

View File

@ -99,6 +99,15 @@ public class InspectPatientServiceImpl implements InspectPatientService {
patientMapper.update(null, updateWrapper);
}
@Override
public void medicalSnfeaturesupdate(InspectPatientSaveReqVO updateReqVO)
{
LambdaUpdateWrapper<InspectPatientDO> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(InspectPatientDO::getMedicalSn, updateReqVO.getMedicalSn())
.set(InspectPatientDO::getZybs, updateReqVO.getZybs())
.set(InspectPatientDO::getFeatures, updateReqVO.getFeatures());
patientMapper.update(null, updateWrapper);
}
@Override
public void deletePatient(Integer id) {
// 校验存在
validatePatientExists(id);