就诊-元数据
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationQueryDto;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class IOrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
@@ -39,7 +41,7 @@ public class IOrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
private List<OrganizationQueryDto> buildTree(List<Organization> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<Organization> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
|
||||
Map<String, OrganizationQueryDto> nodeMap = new HashMap<>();
|
||||
List<OrganizationQueryDto> tree = new ArrayList<>();
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
package com.openhis.web.outpatientservice.appservice;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.outpatientservice.dto.ContractMetadata;
|
||||
import com.openhis.web.outpatientservice.dto.PatientMetadata;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IOutpatientRegistrationAppService {
|
||||
|
||||
/**
|
||||
* 门诊挂号 - 查询患者信息
|
||||
* 查询患者信息
|
||||
*
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 患者信息
|
||||
*/
|
||||
Page<PatientMetadata> getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 查询费用性质
|
||||
*
|
||||
* @return 费用性质
|
||||
*/
|
||||
List<ContractMetadata> getContractMetadata();
|
||||
}
|
||||
|
||||
@@ -1,21 +1,30 @@
|
||||
package com.openhis.web.outpatientservice.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
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.financial.domain.Contract;
|
||||
import com.openhis.financial.mapper.ContractMapper;
|
||||
import com.openhis.web.outpatientservice.appservice.IOutpatientRegistrationAppService;
|
||||
import com.openhis.web.outpatientservice.dto.ContractMetadata;
|
||||
import com.openhis.web.outpatientservice.dto.PatientMetadata;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* 门诊挂号 实现类
|
||||
@@ -26,25 +35,27 @@ public class IOutpatientRegistrationAppServiceImpl implements IOutpatientRegistr
|
||||
@Resource
|
||||
PatientMapper patientMapper;
|
||||
|
||||
@Resource
|
||||
ContractMapper contractMapper;
|
||||
|
||||
/**
|
||||
* 门诊挂号 - 查询患者信息
|
||||
*
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @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<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);
|
||||
Page<PatientMetadata> patientMetadataPage =
|
||||
HisPageUtils.selectPage(patientMapper, queryWrapper, pageNo, pageSize, PatientMetadata.class);
|
||||
|
||||
patientMetadataPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
@@ -55,5 +66,26 @@ public class IOutpatientRegistrationAppServiceImpl implements IOutpatientRegistr
|
||||
return patientMetadataPage;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 查询费用性质
|
||||
*
|
||||
* @return 费用性质
|
||||
*/
|
||||
@Override
|
||||
public List<ContractMetadata> getContractMetadata() {
|
||||
// TODO: Contract表的基础数据维护还没做,具体不知道状态字段的取值是什么,先查询默认值为0的数据
|
||||
List<Contract> ContractList =
|
||||
contractMapper.selectList(new LambdaQueryWrapper<Contract>().eq(Contract::getStatusEnum, 0));
|
||||
// 复制同名字段并 return
|
||||
return ContractList.stream().map(contract -> {
|
||||
ContractMetadata metadata = new ContractMetadata();
|
||||
try {
|
||||
BeanUtils.copyProperties(contract, metadata);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return metadata;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,21 +3,23 @@
|
||||
*/
|
||||
package com.openhis.web.outpatientservice.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
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 com.core.common.core.domain.R;
|
||||
import com.openhis.common.enums.PriorityLevel;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.outpatientservice.appservice.IOutpatientRegistrationAppService;
|
||||
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;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 门诊挂号 controller
|
||||
@@ -32,13 +34,14 @@ public class OutpatientRegistrationController {
|
||||
private final IOrganizationAppService iOrganizationAppService;
|
||||
|
||||
/**
|
||||
* 门诊挂号 - 基础数据初始化
|
||||
* 基础数据初始化
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
OutpatientRegistrationInitDto outpatientRegistrationInitDto = new OutpatientRegistrationInitDto();
|
||||
// 优先级
|
||||
List<OutpatientRegistrationInitDto.priorityLevelOption> priorityLevelOptionOptions = Stream.of(PriorityLevel.values())
|
||||
List<OutpatientRegistrationInitDto.priorityLevelOption> priorityLevelOptionOptions =
|
||||
Stream.of(PriorityLevel.values())
|
||||
.map(e -> new OutpatientRegistrationInitDto.priorityLevelOption(e.getValue(), e.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
outpatientRegistrationInitDto.setPriorityLevelOptionOptions(priorityLevelOptionOptions);
|
||||
@@ -46,33 +49,44 @@ public class OutpatientRegistrationController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 门诊挂号 - 查询患者信息
|
||||
* 查询患者信息
|
||||
*
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @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) {
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return R.ok(iOutpatientRegistrationAppService.getPatientMetadataBySearchKey(searchKey, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 门诊挂号 - 查询机构树
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 机构分页列表
|
||||
* 查询费用性质
|
||||
*
|
||||
* @return 费用性质
|
||||
*/
|
||||
@GetMapping(value = "/organization-tree")
|
||||
public R<?> getOrganizationTree(
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return R.ok(iOrganizationAppService.getOrganizationTree(pageNo, pageSize));
|
||||
@GetMapping(value = "/contract-list")
|
||||
public R<?> getContractList() {
|
||||
return R.ok(iOutpatientRegistrationAppService.getContractMetadata());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询第一诊断
|
||||
*/
|
||||
|
||||
/**
|
||||
* 查询就诊位置
|
||||
*/
|
||||
|
||||
/**
|
||||
* 根据位置id筛选医生
|
||||
*/
|
||||
|
||||
/**
|
||||
* 根据机构id筛选服务项目
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.openhis.web.outpatientservice.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 诊断 元数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ConditionDefinitionMetadata {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.web.outpatientservice.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 费用性质 元数据
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ContractMetadata {
|
||||
/** 合同名称 */
|
||||
private String contractName;
|
||||
/** 合同编码 */
|
||||
private String busNo;
|
||||
}
|
||||
@@ -43,7 +43,6 @@
|
||||
adm_healthcare_service AS T1
|
||||
LEFT JOIN adm_charge_item_definition AS T2 ON T2.instance_id = T1.ID
|
||||
AND T2.instance_table = #{tableName}
|
||||
AND T1.delete_flag = '0'
|
||||
WHERE T1.delete_flag = '0'
|
||||
ORDER BY
|
||||
T1.create_time DESC
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -25,6 +27,7 @@ public class Patient extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 活动标记 */
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.enums.ConditionDefinitionSource;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
|
||||
@@ -25,6 +27,7 @@ public class ConditionDefinition extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 所属分类 */
|
||||
|
||||
Reference in New Issue
Block a user