门诊挂号-元数据

This commit is contained in:
Wang.Huan
2025-03-05 14:14:41 +08:00
parent 4f0f9a994a
commit fb8321a8ef
5 changed files with 147 additions and 2 deletions

View File

@@ -4,14 +4,14 @@
package com.openhis.web.outpatientservice.controller;
import com.core.common.core.domain.R;
import com.openhis.common.enums.AccountStatus;
import com.openhis.common.enums.PriorityLevel;
import com.openhis.web.basicservice.dto.HealthcareServiceInitDto;
import com.openhis.web.outpatientservice.controller.appservice.IOutpatientRegistrationService;
import com.openhis.web.outpatientservice.dto.OutpatientRegistrationInitDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@@ -27,6 +27,8 @@ import java.util.stream.Stream;
@AllArgsConstructor
public class OutpatientRegistrationController {
private final IOutpatientRegistrationService iOutpatientRegistrationService;
/**
* 门诊挂号基础数据初始化
*/
@@ -41,4 +43,20 @@ public class OutpatientRegistrationController {
return R.ok(outpatientRegistrationInitDto);
}
/**
* 门诊挂号 - 查询患者信息
*
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 患者信息
*/
@GetMapping(value = "/patient-metadata")
public R<?> getPatientMetadata(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
return R.ok(iOutpatientRegistrationService.getPatientMetadataBySearchKey(searchKey, pageNo, pageSize));
}
}

View File

@@ -0,0 +1,21 @@
package com.openhis.web.outpatientservice.controller.appservice;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.outpatientservice.dto.PatientMetadata;
/**
* 门诊挂号 Service
*/
public interface IOutpatientRegistrationService {
/**
* 门诊挂号 - 查询患者信息
*
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 患者信息
*/
Page<PatientMetadata> getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize);
}

View File

@@ -0,0 +1,56 @@
package com.openhis.web.outpatientservice.controller.appservice.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.administration.domain.Patient;
import com.openhis.administration.mapper.PatientMapper;
import com.openhis.common.enums.AdministrativeGender;
import com.openhis.common.utils.EnumUtils;
import com.openhis.common.utils.HisPageUtils;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.web.outpatientservice.controller.appservice.IOutpatientRegistrationService;
import com.openhis.web.outpatientservice.dto.PatientMetadata;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.HashSet;
/**
* 门诊挂号 实现类
*/
@Service
public class IOutpatientRegistrationServiceImpl implements IOutpatientRegistrationService {
@Resource
PatientMapper patientMapper;
/**
* 门诊挂号 - 查询患者信息
*
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 患者信息
*/
@Override
public Page<PatientMetadata> getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize) {
// 构建查询条件
QueryWrapper<Patient> queryWrapper = HisQueryUtils.buildQueryWrapper(null,
searchKey, new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null
);
// 设置排序
queryWrapper.orderByDesc("update_time");
// 患者信息
Page<PatientMetadata> patientMetadataPage = HisPageUtils.selectPage(patientMapper,
queryWrapper, pageNo, pageSize, PatientMetadata.class);
patientMetadataPage.getRecords().forEach(e -> {
// 性别枚举
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
});
return patientMetadataPage;
}
}

View File

@@ -0,0 +1,22 @@
package com.openhis.web.outpatientservice.dto;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 门诊挂号 新增数据
*/
@Data
@Accessors(chain = true)
public class OutpatientRegistrationAddParam {
// 就诊管理-表单数据
// 就诊诊断管理-表单数据
// 就诊位置管理-表单数据
// 就诊参数者管理-表单数据
}

View File

@@ -0,0 +1,28 @@
package com.openhis.web.outpatientservice.dto;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 患者信息 元数据
*/
@Data
@Accessors(chain = true)
public class PatientMetadata {
/**
* ID
*/
private Long id;
/**
* 患者姓名
*/
private String name;
/**
* 性别编码
*/
private Integer genderEnum;
private String genderEnum_enumText;
}