tb
This commit is contained in:
@@ -79,7 +79,8 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
bizUser.setStatus(userAndPractitionerDto.getStatus()); // 状态
|
||||
bizUser.setRemark(userAndPractitionerDto.getRemark()); // 备注
|
||||
iBizUserService.save(bizUser);
|
||||
Long userId = bizUser.getUserId(); // 用户id
|
||||
Long userId =
|
||||
iBizUserService.getOne(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserName, userName)).getUserId(); // 用户id
|
||||
// 新增 sys_user_role
|
||||
List<Long> roleIds = userAndPractitionerDto.getRoleIds();
|
||||
BizUserRole bizUserRole;
|
||||
@@ -135,6 +136,7 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
// 构建查询条件
|
||||
QueryWrapper<UserAndPractitionerDto> queryWrapper = HisQueryUtils.buildQueryWrapper(userAndPractitionerDto,
|
||||
searchKey, new HashSet<>(Arrays.asList("user_name", "nick_name", "py_str", "wb_str")), null);
|
||||
queryWrapper.orderByDesc("user_id");
|
||||
IPage<UserAndPractitionerDto> userPractitionerPage =
|
||||
practitionerAppAppMapper.getUserPractitionerPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
List<UserAndPractitionerDto> records = userPractitionerPage.getRecords();
|
||||
|
||||
@@ -19,7 +19,9 @@ import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.domain.OrganizationLocation;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.administration.service.IOrganizationLocationService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
@@ -59,6 +61,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
@Resource
|
||||
IChargeItemService iChargeItemService;
|
||||
|
||||
@Resource
|
||||
IOrganizationLocationService iOrganizationLocationService;
|
||||
|
||||
/**
|
||||
* 查询医嘱信息
|
||||
*
|
||||
@@ -78,7 +83,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
IPage<AdviceBaseDto> adviceBaseInfo =
|
||||
doctorStationAdviceAppMapper.getAdviceBaseInfo(new Page<>(pageNo, pageSize),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, queryWrapper);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, DeviceCategory.SINGLE_USE.getInfo(), queryWrapper);
|
||||
List<AdviceBaseDto> adviceBaseDtoList = adviceBaseInfo.getRecords();
|
||||
// 医嘱定义ID集合
|
||||
List<Long> adviceDefinitionIdList =
|
||||
@@ -203,7 +208,14 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
medicationRequest.setPatientId(adviceSaveDto.getPatientId());
|
||||
medicationRequest.setPractitionerId(adviceSaveDto.getPractitionerId());
|
||||
medicationRequest.setOrgId(adviceSaveDto.getOrgId());
|
||||
medicationRequest.setLocationId(adviceSaveDto.getLocationId());
|
||||
// 查询机构位置关系
|
||||
OrganizationLocation orgLocByOrgIdAndCategoryCode = iOrganizationLocationService
|
||||
.getOrgLocByOrgIdAndCategoryCode(adviceSaveDto.getOrgId(), adviceSaveDto.getCategoryCode());
|
||||
if (orgLocByOrgIdAndCategoryCode != null) {
|
||||
// 发放药房
|
||||
medicationRequest.setPerformLocation(orgLocByOrgIdAndCategoryCode.getDefLocationId());
|
||||
}
|
||||
// medicationRequest.setLocationId(adviceSaveDto.getLocationId()); // 请求发起的位置
|
||||
medicationRequest.setEncounterId(adviceSaveDto.getEncounterId());
|
||||
medicationRequest.setConditionId(adviceSaveDto.getConditionId()); // 诊断id
|
||||
medicationRequest.setTherapyEnum(adviceSaveDto.getTherapyEnum());
|
||||
@@ -235,7 +247,14 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
deviceRequest.setPatientId(adviceSaveDto.getPatientId());
|
||||
deviceRequest.setRequesterId(adviceSaveDto.getPractitionerId());
|
||||
deviceRequest.setOrgId(adviceSaveDto.getOrgId());
|
||||
deviceRequest.setLocationId(adviceSaveDto.getLocationId());
|
||||
// 查询机构位置关系
|
||||
OrganizationLocation orgLocByOrgIdAndCategoryCode = iOrganizationLocationService
|
||||
.getOrgLocByOrgIdAndCategoryCode(adviceSaveDto.getOrgId(), adviceSaveDto.getCategoryCode());
|
||||
if (orgLocByOrgIdAndCategoryCode != null) {
|
||||
// 发放耗材房
|
||||
deviceRequest.setPerformLocation(orgLocByOrgIdAndCategoryCode.getDefLocationId());
|
||||
}
|
||||
// deviceRequest.setLocationId(adviceSaveDto.getLocationId()); 请求发起的位置
|
||||
deviceRequest.setEncounterId(adviceSaveDto.getEncounterId());
|
||||
// deviceRequest.setPackageId(adviceSaveDto.getPackageId());
|
||||
// deviceRequest.setActivityId(adviceSaveDto.getActivityId());
|
||||
|
||||
@@ -19,6 +19,11 @@ public class AdviceBaseDto {
|
||||
/** 医嘱类型 */
|
||||
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
||||
|
||||
/**
|
||||
* 医嘱详细分类
|
||||
*/
|
||||
private String categoryCode;
|
||||
|
||||
/** 医嘱定义ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long adviceDefinitionId;
|
||||
|
||||
@@ -22,6 +22,11 @@ public class AdviceSaveDto {
|
||||
/** 医嘱类型 */
|
||||
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
||||
|
||||
/**
|
||||
* 医嘱详细分类
|
||||
*/
|
||||
private String categoryCode;
|
||||
|
||||
/** 执行次数 */
|
||||
private Integer executeNum; // 当医嘱类型为药品时,选填
|
||||
|
||||
@@ -68,10 +73,14 @@ public class AdviceSaveDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerId;
|
||||
|
||||
/** 所属位置 */
|
||||
/** 请求发起的位置 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 发放位置 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long performLocation;
|
||||
|
||||
/** 所属科室 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
@@ -128,6 +137,7 @@ public class AdviceSaveDto {
|
||||
this.categoryEnum = EncounterClass.AMB.getValue();
|
||||
this.therapyEnum = TherapyTimeType.TEMPORARY.getValue();
|
||||
this.practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
this.orgId = SecurityUtils.getLoginUser().getOrgId(); // 开发人科室
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,12 +26,13 @@ public interface DoctorStationAdviceAppMapper {
|
||||
* @param medicationTableName 药品定义表名
|
||||
* @param deviceTableName 耗材定义表名
|
||||
* @param activityTableName 诊疗定义表名
|
||||
* @param singleUse 单次消耗类 (耗材只查这类)
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 医嘱信息
|
||||
*/
|
||||
IPage<AdviceBaseDto> getAdviceBaseInfo(@Param("page") Page<AdviceBaseDto> page,
|
||||
@Param("medicationTableName") String medicationTableName, @Param("deviceTableName") String deviceTableName,
|
||||
@Param("activityTableName") String activityTableName,
|
||||
@Param("activityTableName") String activityTableName, @Param("singleUse") String singleUse,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<AdviceBaseDto> queryWrapper);
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<select id="getAdviceBaseInfo" resultType="com.openhis.web.doctorstation.dto.AdviceBaseDto">
|
||||
SELECT abi.tenant_id,
|
||||
abi.advice_type,
|
||||
abi.category_code,
|
||||
abi.advice_definition_id,
|
||||
abi.advice_name,
|
||||
abi.advice_bus_no,
|
||||
@@ -31,6 +32,7 @@
|
||||
from (
|
||||
SELECT T1.tenant_id,
|
||||
1 AS advice_type,
|
||||
T1.category_code AS category_code,
|
||||
T1.ID AS advice_definition_id,
|
||||
T1.NAME AS advice_name,
|
||||
T1.bus_no AS advice_bus_no,
|
||||
@@ -66,6 +68,7 @@
|
||||
UNION ALL
|
||||
SELECT T1.tenant_id,
|
||||
2 AS advice_type,
|
||||
T1.category_code AS category_code,
|
||||
T1.ID AS advice_definition_id,
|
||||
T1.NAME AS advice_name,
|
||||
T1.bus_no AS advice_bus_no,
|
||||
@@ -96,9 +99,11 @@
|
||||
AND T4.delete_flag = '0'
|
||||
AND T4.instance_table = #{deviceTableName}
|
||||
WHERE T1.delete_flag = '0'
|
||||
AND T1.category_code = #{singleUse}
|
||||
UNION ALL
|
||||
SELECT T1.tenant_id,
|
||||
3 AS advice_type,
|
||||
'' AS category_code,
|
||||
T1.ID AS advice_definition_id,
|
||||
T1.NAME AS advice_name,
|
||||
T1.bus_no AS advice_bus_no,
|
||||
|
||||
@@ -7,16 +7,16 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DeviceCategory implements HisEnumInterface {
|
||||
ACTIVE (1, "active", "有源的"),
|
||||
COMMUNICATING(2, "communicating", "通讯类"),
|
||||
HOMEUSE(3, "communicating", "非院内使用"),
|
||||
IMPLANTABLE(4, "implantable", "植入类"),
|
||||
IN_VITRO(5, "in-vitro", "试管类"),
|
||||
POINT_OF_CARE(6, "point-of-care", "床旁类"),
|
||||
SINGLE_USE(7, "single-use", "单次消耗类"),
|
||||
REUSABLE(8, "reusable", "可重用的"),
|
||||
SOFTWARE(9, "software", "软件类"),
|
||||
DME(10, "dme", "治疗设备");
|
||||
ACTIVE (1, "1", "有源的"),
|
||||
COMMUNICATING(2, "2", "通讯类"),
|
||||
HOMEUSE(3, "3", "非院内使用"),
|
||||
IMPLANTABLE(4, "4", "植入类"),
|
||||
IN_VITRO(5, "5", "试管类"),
|
||||
POINT_OF_CARE(6, "6", "床旁类"),
|
||||
SINGLE_USE(7, "7", "单次消耗类"),
|
||||
REUSABLE(8, "8", "可重用的"),
|
||||
SOFTWARE(9, "9", "软件类"),
|
||||
DME(10, "10", "治疗设备");
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String code;
|
||||
|
||||
@@ -9,4 +9,15 @@ import com.openhis.administration.domain.OrganizationLocation;
|
||||
* @author system
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
public interface IOrganizationLocationService extends IService<OrganizationLocation> {}
|
||||
public interface IOrganizationLocationService extends IService<OrganizationLocation> {
|
||||
|
||||
/**
|
||||
* 查询机构位置关系
|
||||
*
|
||||
* @param orgId 机构id
|
||||
* @param categoryCode 发放类型
|
||||
* @return机构位置关系
|
||||
*/
|
||||
OrganizationLocation getOrgLocByOrgIdAndCategoryCode(Long orgId, String categoryCode);
|
||||
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.OrganizationLocation;
|
||||
import com.openhis.administration.mapper.OrganizationLocationMapper;
|
||||
@@ -17,4 +20,20 @@ import com.openhis.administration.service.IOrganizationLocationService;
|
||||
public class OrganizationLocationServiceImpl extends ServiceImpl<OrganizationLocationMapper, OrganizationLocation>
|
||||
implements IOrganizationLocationService {
|
||||
|
||||
/**
|
||||
* 查询机构位置关系
|
||||
*
|
||||
* @param orgId 机构id
|
||||
* @param categoryCode 发放类型
|
||||
* @return机构位置关系
|
||||
*/
|
||||
@Override
|
||||
public OrganizationLocation getOrgLocByOrgIdAndCategoryCode(Long orgId, String categoryCode) {
|
||||
OrganizationLocation organizationLocation = baseMapper
|
||||
.selectOne(new LambdaQueryWrapper<OrganizationLocation>().eq(OrganizationLocation::getOrganizationId, orgId)
|
||||
.eq(OrganizationLocation::getDistributionCategoryCode, categoryCode)
|
||||
.lt(OrganizationLocation::getStartTime, new Date()).gt(OrganizationLocation::getEndTime, new Date()));
|
||||
return organizationLocation;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -82,9 +82,14 @@ public class MedicationRequest extends HisBaseEntity {
|
||||
/** 开方医生 */
|
||||
private Long practitionerId;
|
||||
|
||||
/** 发放药房 */
|
||||
/** 所在位置 */
|
||||
private Long locationId;
|
||||
|
||||
/**
|
||||
* 发放药房
|
||||
*/
|
||||
private Long performLocation;
|
||||
|
||||
/** 发放科室 */
|
||||
private Long orgId;
|
||||
|
||||
|
||||
@@ -82,6 +82,9 @@ public class DeviceRequest extends HisBaseEntity {
|
||||
/** 默认器材房 */
|
||||
private Long locationId;
|
||||
|
||||
/** 发放耗材房 */
|
||||
private Long performLocation;
|
||||
|
||||
/** 就诊id */
|
||||
private Long encounterId;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user