新增对外暴露的接口 根据体检编号查询患者基本信息

This commit is contained in:
lxd 2025-04-15 17:03:41 +08:00
parent 2dc2ea0745
commit 6f9294f349
2 changed files with 58 additions and 0 deletions

View File

@ -1176,6 +1176,35 @@ public class InspectPatientController {
InspectPatientDO patient = patientService.getPatient(id);
return success(BeanUtils.toBean(patient, InspectPatientRespVO.class));
}
@GetMapping("/MedicalSnPatientInfo")
@Operation(summary = "获得患者信息 对外暴露")
public CommonResult<PersonalInfoVO> getMedicalSnPatientInfo(@RequestParam("medicalSn") String medicalSn)
{
if(medicalSn!=null&&!medicalSn.isEmpty())
{
InspectPatientDO patientDO= patientService.getPatientOfMedicalSn(medicalSn);
if(patientDO!=null)
{
PersonalInfoVO personalInfoVO = new PersonalInfoVO();
personalInfoVO.setIdCard(patientDO.getCardId());
personalInfoVO.setName(patientDO.getPName());
personalInfoVO.setSex(patientDO.getGender());
personalInfoVO.setAge(String.valueOf(StrUtils.calculateAgeFromIdCard(patientDO.getCardId())));
personalInfoVO.setBirthday(patientDO.getBirthday().toString());
personalInfoVO.setAddress(patientDO.getDomicileaddress());
personalInfoVO.setTelephone(patientDO.getPhoneNum());
return success(personalInfoVO);
}
else
{
return success("未查询到体检信息");
}
}
else {
return success("体检编号为空");
}
}
@GetMapping("/getpatientjson")
@Operation(summary = "根据体检获得患者信息")

View File

@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.inspect.controller.admin.inspectpatient.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class PersonalInfoVO {
@Schema(description = "身份证号")
private String idCard;
@Schema(description = "姓名")
private String name;
@Schema(description = "性别")
private String sex;
@Schema(description = "年龄")
private String age;
@Schema(description = "出生日期")
private String birthday;
@Schema(description = "地址")
private String address;
@Schema(description = "电话号码")
private String telephone;
}