修改
This commit is contained in:
parent
647fcce907
commit
91d62bd7cd
@ -452,21 +452,36 @@ public class InspectPatientController {
|
||||
checkBarCode3 = patientDO.getShqx();
|
||||
} else {
|
||||
// 如果未打印,生成新的条码
|
||||
checkBarCode1 = DateUtils.generateUniqueCode();
|
||||
if(patientDO.getXcgcode()!=null){
|
||||
checkBarCode1 = patientDO.getXcgcode();
|
||||
}
|
||||
else{
|
||||
checkBarCode1 = DateUtils.generateUniqueCode();
|
||||
}
|
||||
try {
|
||||
// 等待2毫秒,确保时间戳不同
|
||||
Thread.sleep(2);
|
||||
} catch (InterruptedException e) {
|
||||
// 忽略中断异常
|
||||
}
|
||||
checkBarCode2 = DateUtils.generateUniqueCode();
|
||||
if(patientDO.getNcgcode()!=null){
|
||||
checkBarCode2 = patientDO.getNcgcode();
|
||||
}
|
||||
else{
|
||||
checkBarCode2 = DateUtils.generateUniqueCode();
|
||||
}
|
||||
try {
|
||||
// 等待2毫秒,确保时间戳不同
|
||||
Thread.sleep(2);
|
||||
} catch (InterruptedException e) {
|
||||
// 忽略中断异常
|
||||
}
|
||||
checkBarCode3 = DateUtils.generateUniqueCode();
|
||||
if(patientDO.getShqx()!=null){
|
||||
checkBarCode3 = patientDO.getShqx();
|
||||
}
|
||||
else{
|
||||
checkBarCode3 = DateUtils.generateUniqueCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -749,6 +764,33 @@ public class InspectPatientController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/getPatientInfoByCardId")
|
||||
@Operation(summary = "根据身份证号查询患者信息并获取体检相关信息")
|
||||
public CommonResult<PatientJYInfoVO> getPatientInfoByCardId(@RequestParam("cardId") String cardId) throws JsonProcessingException {
|
||||
try {
|
||||
// 根据身份证查询患者信息
|
||||
InspectPatientDO patientDO = patientService.getPatientByCardId(cardId);
|
||||
|
||||
if (patientDO == null) {
|
||||
return CommonResult.error(404, "未找到患者记录");
|
||||
}
|
||||
|
||||
String medicalSn = patientDO.getMedicalSn();
|
||||
|
||||
// 直接调用生成PatientJYInfoVO的逻辑
|
||||
PatientJYInfoVO patientJYInfoVO = generatePatientJYInfo(medicalSn);
|
||||
|
||||
if (patientJYInfoVO != null) {
|
||||
// 设置pdfurl字段
|
||||
patientJYInfoVO.setPdfurl(patientDO.getPdfurl());
|
||||
}
|
||||
|
||||
return success(patientJYInfoVO);
|
||||
} catch (Exception e) {
|
||||
return CommonResult.error(500, "查询失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/PushJYPatientInfo")
|
||||
@Operation(summary = "回传体检相关信息")
|
||||
public CommonResult<Boolean> PushJYPatientInfo(@RequestParam("medicalSn") String medicalSn) throws JsonProcessingException {
|
||||
@ -995,6 +1037,229 @@ public class InspectPatientController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成患者体检信息VO
|
||||
* @param medicalSn 体检编号
|
||||
* @return PatientJYInfoVO
|
||||
* @throws JsonProcessingException
|
||||
*/
|
||||
private PatientJYInfoVO generatePatientJYInfo(String medicalSn) throws JsonProcessingException {
|
||||
//获取患者信息
|
||||
InspectPatientDO patientDO = patientService.getnewPatientInfo(medicalSn);
|
||||
if (patientDO == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (patientDO.getNcgcode() != null && patientDO.getXcgcode() != null && patientDO.getShqx() != null) {
|
||||
// 定义条形码列表
|
||||
List<String> barcodes = Arrays.asList(
|
||||
patientDO.getNcgcode(),
|
||||
patientDO.getXcgcode(),
|
||||
patientDO.getShqx()
|
||||
);
|
||||
ConfigDO config = configService.getConfigByKey("url.reporttj");
|
||||
String url = config.getValue();
|
||||
//返回实体类
|
||||
PatientJYInfoVO patientJYInfoVO = new PatientJYInfoVO();
|
||||
//先添加基本信息
|
||||
patientJYInfoVO.setPatientname(patientDO.getPName());
|
||||
patientJYInfoVO.setIdcard(patientDO.getCardId());
|
||||
if (patientDO.getMedicalDateTime() != null) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
patientJYInfoVO.setExamindate(patientDO.getMedicalDateTime().format(formatter));
|
||||
}
|
||||
//心电图信息
|
||||
InspectPacsDataDO ecg = pacsDataService.getPacsDataByCode(medicalSn, "ecg");
|
||||
if (ecg != null) {
|
||||
if (ecg.getData() != null) {
|
||||
patientJYInfoVO.setElectrokardiagramtypeid(1);
|
||||
patientJYInfoVO.setElectrocardiogramimg(ecg.getData());
|
||||
}
|
||||
}
|
||||
|
||||
// 处理血常规、尿常规等检验数据
|
||||
for (String barCode : barcodes) {
|
||||
String response = HttpUtils.get(url + "?" + "barCode=" + barCode + "&" + "hospitalCode=" + patientDO.getHospitalNo());
|
||||
if (response != null) {
|
||||
// 解析 JSON 响应
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
ReportResponse reportResponse = objectMapper.readValue(response, ReportResponse.class);
|
||||
if ("操作成功".equals(reportResponse.getMsg()) && reportResponse.getCode() == 200) {
|
||||
ReportData reportData = reportResponse.getData();
|
||||
// 获取 reportPath
|
||||
String reportPath = reportData.getReportPath();
|
||||
if (!reportPath.contains("报告暂未出")) {
|
||||
if (reportData.getResultsAll() != null && reportData.getResultsAll().size() > 0) {
|
||||
// 获取 results 数组并遍历
|
||||
List<ResultItem> results = reportData.getResultsAll();
|
||||
for (ResultItem result : results) {
|
||||
switch (result.getItemCode()) {
|
||||
case "HGB"://血常规血红蛋白
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setHemoglobin(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "WBC"://血常规白细胞
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setLeukocyte(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "PLT"://血常规血小板
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setBloodplatelet(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "PRO"://尿常规尿蛋白
|
||||
if (result.getItemValue() != null) {
|
||||
patientJYInfoVO.setUrineprotein(result.getItemValue());
|
||||
}
|
||||
break;
|
||||
case "GLU"://尿常规尿糖
|
||||
if(barCode.equals(patientDO.getShqx()))
|
||||
{
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setFastplasmaglucoseml(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (result.getItemValue() != null) {
|
||||
patientJYInfoVO.setUrinesugar(result.getItemValue());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "KET"://尿常规尿酮体
|
||||
if (result.getItemValue() != null) {
|
||||
patientJYInfoVO.setUnrineketone(result.getItemValue());
|
||||
}
|
||||
break;
|
||||
case "BLD"://尿常规潜血
|
||||
if (result.getItemValue() != null) {
|
||||
patientJYInfoVO.setUnrineoccultblood(result.getItemValue());
|
||||
}
|
||||
break;
|
||||
case "RBC"://血常规红细胞
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setErythrocyte(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "TG"://甘油三酯
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setTriglycercide(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "TC"://总胆固醇
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setTotalcholesterol(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "LDL-C"://低密度脂蛋白胆固醇
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setLdlc(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "HDL-C"://高密度脂蛋白胆固醇
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setHdlc(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "AST"://谷丙转氨酶
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setSgot(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "UREA"://尿素
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setBun(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "ALT"://谷草转氨酶
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setSgpt(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "TBLL":
|
||||
if(barCode.equals(patientDO.getShqx()))
|
||||
{
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setTotalbilirubin(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "CREA":
|
||||
if(barCode.equals(patientDO.getShqx()))
|
||||
{
|
||||
if (result.getItemValue() != null) {
|
||||
if (NumberUtils.isNumeric(result.getItemValue())) {
|
||||
double value = Double.parseDouble(result.getItemValue());
|
||||
patientJYInfoVO.setSerumcreatinine(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//添加超声数据
|
||||
String usitemresult = patientitemsService.GetItemResult(medicalSn, "US001");
|
||||
if (usitemresult != null && usitemresult != "") {
|
||||
patientJYInfoVO.setBultrasound(usitemresult);
|
||||
}
|
||||
|
||||
return patientJYInfoVO;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@GetMapping("/getUSTj")
|
||||
@Operation(summary = "获取超声报告")
|
||||
public CommonResult<Boolean> GetApiPacsInfo(@RequestParam("medicalSn") String medicalSn) {
|
||||
@ -2033,9 +2298,9 @@ public class InspectPatientController {
|
||||
@GetMapping("/getworkload")
|
||||
@Operation(summary = "根据日期获取卫生院体检统计")
|
||||
public CommonResult<List<WorkloadStatisticsVO>> getWorkload(@RequestParam("dates") @DateTimeFormat(pattern = "yyyy-MM-dd") List<LocalDate> dates,
|
||||
@RequestParam(value = "hospitalNo", required = false) String hospitalNo) {
|
||||
@RequestParam(value = "examhoscode", required = false) String examhoscode) {
|
||||
// 获取指定日期范围内的所有患者补充信息,如果有医院名称则在数据库层面直接过滤
|
||||
List<PatientSupplementVO> supplements = patientService.getPatientSupplementsByDatesAndHospital(dates, hospitalNo);
|
||||
List<PatientSupplementVO> supplements = patientService.getPatientSupplementsByDatesAndHospital(dates, examhoscode);
|
||||
|
||||
// 使用Map来存储统计结果,key为卫生院名称+行政村名称
|
||||
Map<String, WorkloadStatisticsVO> statisticsMap = new HashMap<>();
|
||||
@ -2114,9 +2379,9 @@ public class InspectPatientController {
|
||||
public CommonResult<Boolean> updatePatientOrg(@RequestParam("medicalSn") String medicalSn,
|
||||
@RequestParam("examhoscode") String examhoscode,
|
||||
@RequestParam("examhosname") String examhosname,
|
||||
@RequestParam("hospitalNo") String hospitalNo,
|
||||
@RequestParam("examhoscode") String examhoscodeParam,
|
||||
@RequestParam("shortid") String shortid) {
|
||||
patientService.updatePatientOrg(medicalSn, examhoscode, examhosname,hospitalNo,shortid);
|
||||
patientService.updatePatientOrg(medicalSn, examhoscode, examhosname,examhoscodeParam,shortid);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
@ -131,4 +131,7 @@ public class PatientJYInfoVO {
|
||||
|
||||
@Schema(description = "随机血糖(mg/dL)")
|
||||
private String randomglucosemgl;
|
||||
|
||||
@Schema(description = "体检报告PDF链接")
|
||||
private String pdfurl;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public interface InspectPatientService {
|
||||
/*
|
||||
* 根据体检编号更新患者归属医院信息
|
||||
*/
|
||||
void updatePatientOrg(String medicalSn, String examhoscode, String examhosname,String hospitalNo,String shortid);
|
||||
void updatePatientOrg(String medicalSn, String examhoscode, String examhosname,String examhoscodeParam,String shortid);
|
||||
|
||||
/**
|
||||
* 删除患者信息
|
||||
@ -181,10 +181,10 @@ public interface InspectPatientService {
|
||||
* 根据日期列表和医院名称获取患者补充信息
|
||||
*
|
||||
* @param dates 日期列表
|
||||
* @param examhosname 医院名称(可选)
|
||||
* @param examhoscode 医院名称(可选)
|
||||
* @return 患者补充信息列表
|
||||
*/
|
||||
List<PatientSupplementVO> getPatientSupplementsByDatesAndHospital(List<LocalDate> dates, String hospitalNo);
|
||||
List<PatientSupplementVO> getPatientSupplementsByDatesAndHospital(List<LocalDate> dates, String examhoscode);
|
||||
|
||||
void exportStatistics(List<LocalDate> dates, HttpServletResponse response);
|
||||
|
||||
|
@ -978,7 +978,7 @@ public class InspectPatientServiceImpl implements InspectPatientService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PatientSupplementVO> getPatientSupplementsByDatesAndHospital(List<LocalDate> dates, String hospitalNo) {
|
||||
public List<PatientSupplementVO> getPatientSupplementsByDatesAndHospital(List<LocalDate> dates, String examhoscode) {
|
||||
if (dates == null || dates.isEmpty() || dates.size() < 2) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@ -1004,8 +1004,8 @@ public class InspectPatientServiceImpl implements InspectPatientService {
|
||||
.between(InspectPatientDO::getPrinttime, startDate.atStartOfDay(), endDate.atTime(23, 59, 59));
|
||||
|
||||
// 如果医院名称有效,添加筛选条件
|
||||
if (hospitalNo != null && !hospitalNo.isEmpty() && !"null".equals(hospitalNo)) {
|
||||
queryWrapper.eq(InspectPatientDO::getHospitalNo, hospitalNo);
|
||||
if (examhoscode != null && !examhoscode.isEmpty() && !"null".equals(examhoscode)) {
|
||||
queryWrapper.eq(InspectPatientDO::getExamhoscode, examhoscode);
|
||||
}
|
||||
|
||||
// 查询患者信息
|
||||
|
@ -3,8 +3,7 @@ spring:
|
||||
name: yudao-server
|
||||
|
||||
profiles:
|
||||
active: 222
|
||||
|
||||
active: local
|
||||
main:
|
||||
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||||
|
||||
@ -240,6 +239,8 @@ yudao:
|
||||
- /admin-api/inspect/patient/PatientBySearchKey #根据姓名、身份证号、体检编号获得患者信息
|
||||
- /admin-api/inspect/patient/insertPatinetInfo #创建患者
|
||||
- /admin-api/inspect/patient/receiveUSReport #接收超声报告
|
||||
- /admin-api/inspect/patient/getPatientInfoByCardId #根据身份证号查询患者信息并获取体检相关信息
|
||||
|
||||
websocket:
|
||||
enable: true # websocket的开关
|
||||
path: /infra/ws # 路径
|
||||
@ -295,6 +296,8 @@ yudao:
|
||||
- /admin-api/inspect/patient/PatientBySearchKey #根据姓名、身份证号、体检编号获得患者信息
|
||||
- /admin-api/inspect/patient/insertPatinetInfo #创建患者
|
||||
- /admin-api/inspect/patient/receiveUSReport #接收超声报告
|
||||
- /admin-api/inspect/patient/getPatientInfoByCardId #根据身份证号查询患者信息并获取体检相关信息
|
||||
|
||||
- /adminInspect/admin-api/inspect/department/getList
|
||||
- /adminInspect/admin-api/inspect/patient/getUSPatientInfo
|
||||
- /adminInspect/admin-api/system/captcha/get
|
||||
@ -317,6 +320,8 @@ yudao:
|
||||
- /adminInspect/admin-api/inspect/patient/PatientBySearchKey #根据姓名、身份证号、体检编号获得患者信息
|
||||
- /adminInspect/admin-api/inspect/patient/insertPatinetInfo #创建患者
|
||||
- /adminInspect/admin-api/inspect/patient/receiveUSReport #接收超声报告
|
||||
- /adminInspect/admin-api/inspect/patient/getPatientInfoByCardId #根据身份证号查询患者信息并获取体检相关信息
|
||||
|
||||
ignore-tables:
|
||||
- system_tenant
|
||||
- system_tenant_package
|
||||
@ -390,6 +395,6 @@ yudao:
|
||||
debug: false
|
||||
|
||||
#别名 需要的配置 项目名称:/admin
|
||||
server:
|
||||
servlet:
|
||||
context-path: /adminInspect
|
||||
#server:
|
||||
# servlet:
|
||||
# context-path: /adminInspect
|
||||
|
Loading…
Reference in New Issue
Block a user