Merge branch 'master' of https://codeup.aliyun.com/61c0318acd8b75daa5a125f7/medical/openhis
This commit is contained in:
@@ -83,7 +83,7 @@ public interface ISupplierManagementAppService {
|
||||
* @param id 查询条件
|
||||
* @return 厂商/产地查询结果
|
||||
*/
|
||||
R<?> getSupplierDetail(@PathVariable("id") Long id);
|
||||
R<?> getSupplierDetail(Long id);
|
||||
|
||||
/**
|
||||
* 厂商/产地停用
|
||||
|
||||
@@ -25,7 +25,9 @@ import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.core.common.utils.poi.ExcelUtil;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.ApplicableScope;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.medication.domain.MedicationDefinition;
|
||||
@@ -118,16 +120,6 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()));
|
||||
// 适用范围
|
||||
e.setDomainEnum_enumText(EnumUtils.getInfoByValue(ApplicableScope.class, e.getDomainEnum()));
|
||||
// 药品分类
|
||||
e.setCategoryCode_enumText(EnumUtils.getInfoByValue(ItemCategory.class, e.getCategoryCode()));
|
||||
// 是否皮试
|
||||
e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag()));
|
||||
// 是否为注射药物
|
||||
e.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getInjectFlag()));
|
||||
// 是否限制使用
|
||||
e.setRestrictedFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getRestrictedFlag()));
|
||||
// 儿童用药标志
|
||||
e.setChildrenFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getChildrenFlag()));
|
||||
});
|
||||
|
||||
// 返回【药品录列表DTO】分页
|
||||
@@ -135,9 +127,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑供应商信息
|
||||
* 编辑药品目录信息
|
||||
*
|
||||
* @param medicationManageUpDto 供应商信息
|
||||
* @param medicationManageUpDto 药品目录信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> editMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||
@@ -222,9 +214,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加供应商信息
|
||||
* 添加药品目录信息
|
||||
*
|
||||
* @param medicationManageUpDto 供应商信息
|
||||
* @param medicationManageUpDto 药品目录信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> addMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||
|
||||
@@ -144,7 +144,7 @@ public class SupplierManagementAppServiceImpl implements ISupplierManagementAppS
|
||||
* @return 厂商/产地查询结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> getSupplierDetail(@PathVariable("id") Long id) {
|
||||
public R<?> getSupplierDetail(Long id) {
|
||||
SupplierDto supplierDto = new SupplierDto();
|
||||
// 根据ID查询【供应商信息】
|
||||
Supplier supplier = supplierService.getById(id);
|
||||
|
||||
@@ -117,7 +117,7 @@ public class DeviceManageController {
|
||||
* @param id 器材ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-one/{id}")
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getDeviceOne(@PathVariable("id") Long id) {
|
||||
|
||||
return deviceManageAppService.getDeviceOne(id);
|
||||
|
||||
@@ -157,7 +157,7 @@ public class DiagnosisTreatmentController {
|
||||
* @param id 诊疗ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-one/{id}")
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getDiseaseTreatmentOne(@PathVariable("id") Long id) {
|
||||
DiagnosisTreatmentDto diagnosisTreatmentDto = new DiagnosisTreatmentDto();
|
||||
// 根据ID查询【诊疗目录】
|
||||
|
||||
@@ -101,7 +101,7 @@ public class DiseaseManageController {
|
||||
* @param id 疾病ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-one/{id}")
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getDiseaseOne(@PathVariable("id") Long id) {
|
||||
DiseaseManageDto diseaseManageDto = new DiseaseManageDto();
|
||||
// 根据ID查询【病种目录】
|
||||
|
||||
@@ -28,10 +28,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@AllArgsConstructor
|
||||
public class MedicationManageController {
|
||||
|
||||
// private final IMedicationDefinitionService iMedicationDefinitionService;
|
||||
// private final IMedicationService iMedicationService;
|
||||
// private final MedicationManageSearchMapper medicationManageSearchMapper;
|
||||
|
||||
@Autowired
|
||||
private IMedicationManageAppService medicationManageAppService;
|
||||
|
||||
@@ -42,16 +38,7 @@ public class MedicationManageController {
|
||||
*/
|
||||
@GetMapping("/information-init")
|
||||
public R<?> getMedicationInit() {
|
||||
|
||||
return medicationManageAppService.getMedicationInit();
|
||||
|
||||
// MedicationManageInitDto medicationManageInitDto = new MedicationManageInitDto();
|
||||
// // 获取状态
|
||||
// List<MedicationManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
// .map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
// .collect(Collectors.toList());
|
||||
// medicationManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
// return R.ok(medicationManageInitDto);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,25 +59,8 @@ public class MedicationManageController {
|
||||
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return medicationManageAppService.getMedicationList(searchKey, ybMatchFlag, statusEnum, categoryCode, pageNo,
|
||||
pageSize, request);
|
||||
|
||||
// // 分页设置
|
||||
// Integer offset = (pageNo - 1) * pageSize;
|
||||
// // 获取租户ID
|
||||
// Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
// // 查询药品目录列表
|
||||
// List<MedicationManageDto> medicationDetailList = medicationManageSearchMapper.getPage(searchKey, ybMatchFlag,
|
||||
// statusEnum, categoryCode, tenantId, pageSize, offset);
|
||||
// // 查询总记录数
|
||||
// long total =
|
||||
// medicationManageSearchMapper.getPageCount(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||
// // 创建Page对象并设置属性
|
||||
// Page<MedicationManageDto> medicationManageDtoPage = new Page<>(pageNo, pageSize, total);
|
||||
// medicationManageDtoPage.setRecords(medicationDetailList);
|
||||
// // 返回【药品录列表DTO】分页
|
||||
// return R.ok(medicationManageDtoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,39 +69,15 @@ public class MedicationManageController {
|
||||
* @param id 药品ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-one/{id}")
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getMedicationOne(@PathVariable("id") Long id) {
|
||||
|
||||
return medicationManageAppService.getMedicationOne(id);
|
||||
|
||||
// // 获取租户ID
|
||||
// Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
// // 查询药品目录列表
|
||||
// MedicationManageDto medicationManageDto = medicationManageSearchMapper.getOne(id, tenantId);
|
||||
// // 返回【药品录列表DTO】列表
|
||||
// return R.ok(medicationManageDto);
|
||||
}
|
||||
|
||||
// 药品目录编辑
|
||||
@PutMapping("/information")
|
||||
public R<?> editMedication(@RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||
|
||||
return medicationManageAppService.editMedication(medicationManageUpDto);
|
||||
|
||||
// MedicationDefinition medicationDefinition = new MedicationDefinition();
|
||||
// Medication medication = new Medication();
|
||||
// BeanUtils.copyProperties(medicationManageUpDto, medication); // 子表信息
|
||||
// BeanUtils.copyProperties(medicationManageUpDto, medicationDefinition);// 主表信息
|
||||
//
|
||||
// // 更新子表药品信息
|
||||
// if (iMedicationService.updateById(medication)) {
|
||||
// // 更新主表药品信息
|
||||
// return iMedicationDefinitionService.updateById(medicationDefinition)
|
||||
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
// } else {
|
||||
// return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,19 +88,6 @@ public class MedicationManageController {
|
||||
*/
|
||||
@PutMapping("/information-stop")
|
||||
public R<?> editMedicationStop(@RequestBody List<Long> ids) {
|
||||
// List<Medication> medicationList = new ArrayList<>();
|
||||
// // 取得更新值
|
||||
// for (Long detail : ids) {
|
||||
// Medication medication = new Medication();
|
||||
// medication.setId(detail);
|
||||
// medication.setStatusEnum(PublicationStatus.RETIRED);
|
||||
// medicationList.add(medication);
|
||||
// }
|
||||
// // 更新药品信息
|
||||
// return iMedicationService.updateBatchById(medicationList)
|
||||
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
return medicationManageAppService.editMedicationStop(ids);
|
||||
}
|
||||
|
||||
@@ -166,20 +99,7 @@ public class MedicationManageController {
|
||||
*/
|
||||
@PutMapping("/information-start")
|
||||
public R<?> editMedicationStart(@RequestBody List<Long> ids) {
|
||||
|
||||
return medicationManageAppService.editMedicationStart(ids);
|
||||
// List<Medication> medicationList = new ArrayList<>();
|
||||
// // 取得更新值
|
||||
// for (Long detail : ids) {
|
||||
// Medication medication = new Medication();
|
||||
// medication.setId(detail);
|
||||
// medication.setStatusEnum(PublicationStatus.ACTIVE);
|
||||
// medicationList.add(medication);
|
||||
// }
|
||||
// // 更新药品信息
|
||||
// return iMedicationService.updateBatchById(medicationList)
|
||||
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,20 +110,7 @@ public class MedicationManageController {
|
||||
*/
|
||||
@PostMapping("/information")
|
||||
public R<?> addMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||
|
||||
return medicationManageAppService.addMedication(medicationManageUpDto);
|
||||
|
||||
// MedicationDetail medicationDetail = new MedicationDetail();
|
||||
// BeanUtils.copyProperties(medicationManageUpDto, medicationDetail);
|
||||
// // 新增主表外来药品目录
|
||||
// if (iMedicationDefinitionService.addMedication(medicationDetail)) {
|
||||
// // 新增子表外来药品目录
|
||||
// return iMedicationService.addMedication(medicationDetail)
|
||||
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
// } else {
|
||||
// return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,15 +139,6 @@ public class MedicationManageController {
|
||||
@RequestParam(value = "ybMatchFlag", defaultValue = "-1") Integer ybMatchFlag,
|
||||
@RequestParam(value = "statusEnum", defaultValue = "-1") Integer statusEnum,
|
||||
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode, HttpServletResponse response) {
|
||||
|
||||
return medicationManageAppService.exportMedication(searchKey, ybMatchFlag, statusEnum, categoryCode, response);
|
||||
|
||||
// // 获取租户ID
|
||||
// Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
// List<MedicationManageDto> list =
|
||||
// medicationManageSearchMapper.getList(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||
// ExcelUtil<MedicationManageDto> util = new ExcelUtil<>(MedicationManageDto.class);
|
||||
// util.exportExcel(response, list, "药品目录");
|
||||
// return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ public class SupplierManagementController {
|
||||
* @param id 查询条件
|
||||
* @return 厂商/产地查询结果
|
||||
*/
|
||||
@GetMapping(value = "/get-supplier-detail/{id}")
|
||||
public R<?> getSupplierDetail(@PathVariable("id") Long id) {
|
||||
@GetMapping(value = "/get-supplier-detail")
|
||||
public R<?> getSupplierDetail(@RequestParam Long id) {
|
||||
return supplierManagementAppService.getSupplierDetail(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -99,8 +100,8 @@ public class MedicationManageDto {
|
||||
private String wbStr;
|
||||
|
||||
/** 药品分类 */
|
||||
@Dict(dictCode = "medicine_category")
|
||||
private Integer categoryCode;
|
||||
private String categoryCode_enumText;
|
||||
|
||||
/** 商品名称 */
|
||||
private String merchandiseName;
|
||||
@@ -142,12 +143,12 @@ public class MedicationManageDto {
|
||||
private String pharmacologyCategoryCode;
|
||||
|
||||
/** 是否皮试 */
|
||||
@Dict(dictCode = "sys_yes_no")
|
||||
private Integer skinTestFlag;
|
||||
private String skinTestFlag_enumText;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
@Dict(dictCode = "sys_yes_no")
|
||||
private Integer injectFlag;
|
||||
private String injectFlag_enumText;
|
||||
|
||||
/** 生产厂家 */
|
||||
private Long manufacturerId;
|
||||
@@ -156,15 +157,15 @@ public class MedicationManageDto {
|
||||
private Long supplyId;
|
||||
|
||||
/** 是否限制使用 */
|
||||
@Dict(dictCode = "sys_yes_no")
|
||||
private Integer restrictedFlag;
|
||||
private String restrictedFlag_enumText;
|
||||
|
||||
/** 限制使用范围 */
|
||||
private String restrictedScope;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
@Dict(dictCode = "sys_yes_no")
|
||||
private Integer childrenFlag;
|
||||
private String childrenFlag_enumText;
|
||||
|
||||
/** 产品特性 */
|
||||
private Integer characteristic;
|
||||
|
||||
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
|
||||
public class AdviceBaseDto {
|
||||
|
||||
/** 医嘱类型 */
|
||||
private String adviceType; // 1:药品 , 2: 耗材 , 3:检查检验
|
||||
private String adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
||||
|
||||
/** 医嘱定义ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@@ -107,6 +107,12 @@ public class AdviceBaseDto {
|
||||
*/
|
||||
private String adviceTableName;
|
||||
|
||||
/** 所属科室 */
|
||||
private Long orgId;
|
||||
|
||||
/** 所在位置 */
|
||||
private Long locationId;
|
||||
|
||||
/**
|
||||
* 医嘱库存集合
|
||||
*/
|
||||
|
||||
@@ -42,6 +42,10 @@ public class AdviceInventoryDto {
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 库位 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationStoreId;
|
||||
|
||||
/** 库房id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.openhis.web.doctorstation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.enums.EncounterClass;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 医嘱保存 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdviceSaveDto {
|
||||
|
||||
/** 医嘱类型 */
|
||||
private String adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
||||
|
||||
/** 执行次数 */
|
||||
private Integer executeNum; // 当医嘱类型为药品时,选填
|
||||
|
||||
/** 处方号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 请求单位编码 */
|
||||
private String unitCode;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/**
|
||||
* 请求状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 请求类型 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 医嘱定义ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long adviceDefinitionId;
|
||||
|
||||
/** 患者 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 开方医生 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerId;
|
||||
|
||||
/** 所属位置 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 所属科室 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 就诊id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 组套id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long packageId; // 该参数先预留出来
|
||||
|
||||
/** 活动(项目)定义id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long activityId; // 该参数先预留出来
|
||||
|
||||
/**
|
||||
* 设置默认值
|
||||
*/
|
||||
public AdviceSaveDto() {
|
||||
this.statusEnum = RequestStatus.DRAFT.getValue();
|
||||
this.categoryEnum = EncounterClass.AMB.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.openhis.web.doctorstation.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 医嘱保存参数类
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdviceSaveParam {
|
||||
|
||||
/**
|
||||
* 保存医嘱 dto
|
||||
*/
|
||||
private List<AdviceSaveDto> adviceSaveList;
|
||||
|
||||
}
|
||||
@@ -1,16 +1,12 @@
|
||||
package com.openhis.web.outpatientmanage.appservice;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionInitDto;
|
||||
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto;
|
||||
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto;
|
||||
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionSearchParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 门诊管理——输液实现类
|
||||
@@ -27,7 +23,6 @@ public interface IOutpatientInfusionRecordService {
|
||||
*/
|
||||
OutpatientInfusionInitDto getOutpatientInfusionInit();
|
||||
|
||||
|
||||
/**
|
||||
* 获取门诊输液记录的患者列表
|
||||
*
|
||||
@@ -39,23 +34,22 @@ public interface IOutpatientInfusionRecordService {
|
||||
IPage<OutpatientInfusionPatientDto> getOutpatientInfusionPatient(
|
||||
OutpatientInfusionSearchParam outpatientInfusionSearchParam, Integer pageNo, Integer pageSize);
|
||||
|
||||
|
||||
/**
|
||||
* 查询单个患者门诊输液记录查询
|
||||
*
|
||||
* @param outpatientInfusionPatientDto 患者输液信息
|
||||
* @return 门诊输液记录列表
|
||||
*/
|
||||
List<OutpatientInfusionRecordDto> getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto);
|
||||
List<OutpatientInfusionRecordDto>
|
||||
getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto);
|
||||
|
||||
/**
|
||||
* 执行单个患者门诊输液
|
||||
*
|
||||
* @param exeCount 执行记录数
|
||||
* @param outpatientInfusionRecordDto 患者输液信息
|
||||
* @param outpatientInfusionRecordDtoList 输液记录
|
||||
* @return 修改成功/失败
|
||||
*/
|
||||
boolean editPatientInfusionRecord(OutpatientInfusionRecordDto outpatientInfusionRecordDto,Long exeCount);
|
||||
boolean batchEditPatientInfusionRecord(List<OutpatientInfusionRecordDto> outpatientInfusionRecordDtoList);
|
||||
|
||||
/**
|
||||
* 执行输液后,修改执行结束时间
|
||||
@@ -66,12 +60,13 @@ public interface IOutpatientInfusionRecordService {
|
||||
boolean editPatientInfusionTime(OutpatientInfusionRecordDto outpatientInfusionRecordDto);
|
||||
|
||||
/**
|
||||
* 显示门诊输液执行记录查询
|
||||
* 门诊输液执行历史记录查询
|
||||
*
|
||||
* @param beginTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param historyFlag 查询的是否为执行履历
|
||||
* @return 门诊输液记录列表
|
||||
*/
|
||||
List<OutpatientInfusionRecordDto> getPatientInfusionPerformRecord(String beginTime,String endTime);
|
||||
List<OutpatientInfusionRecordDto> getPatientInfusionPerformRecord(String beginTime, String endTime,boolean historyFlag);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.openhis.web.outpatientmanage.appservice.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -12,9 +9,11 @@ import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.utils.AgeCalculatorUtil;
|
||||
@@ -25,9 +24,11 @@ import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.administration.domain.PractitionerRole;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.enums.ClinicalStatus;
|
||||
import com.openhis.common.enums.EventStatus;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.outpatientmanage.appservice.IOutpatientInfusionRecordService;
|
||||
@@ -39,7 +40,6 @@ import com.openhis.web.outpatientmanage.mapper.OutpatientManageMapper;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import com.openhis.workflow.mapper.ServiceRequestMapper;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 门诊管理——输液实现类
|
||||
@@ -76,34 +76,10 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
|
||||
OutpatientInfusionInitDto initDto = new OutpatientInfusionInitDto();
|
||||
|
||||
// 获取皮试结果
|
||||
List<OutpatientInfusionInitDto.statusEnumOption> statusEnumOptions2 = Stream.of(ClinicalStatus.values())
|
||||
List<OutpatientInfusionInitDto.statusEnumOption> statusEnumOptions = Stream.of(ClinicalStatus.values())
|
||||
.map(status -> new OutpatientInfusionInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setClinicalStatus(statusEnumOptions2);
|
||||
|
||||
// 获取当天日期
|
||||
LocalDateTime beginTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), true);
|
||||
LocalDateTime endTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), false);
|
||||
// 创建查询包装器
|
||||
QueryWrapper<OutpatientInfusionRecordDto> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.ge("occurrence_start_time", beginTime);
|
||||
queryWrapper.le("occurrence_end_time", endTime);
|
||||
|
||||
// 从数据库获取输液记录列表
|
||||
List<OutpatientInfusionRecordDto> infusionList =
|
||||
outpatientManageMapper.getOutpatientInfusionRecord(queryWrapper);
|
||||
// 遍历列表并处理每个记录
|
||||
infusionList.forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 药品状态
|
||||
e.setClinicalStatusEnum_enumText(EnumUtils.getInfoByValue(EventStatus.class, e.getMedicationStatusEnum()));
|
||||
// 皮试结果
|
||||
e.setMedicationStatusEnum_enumText(
|
||||
EnumUtils.getInfoByValue(ClinicalStatus.class, e.getClinicalStatusEnum()));
|
||||
});
|
||||
|
||||
initDto.setInfusionList(infusionList);
|
||||
initDto.setClinicalStatus(statusEnumOptions);
|
||||
|
||||
return initDto;
|
||||
}
|
||||
@@ -122,27 +98,37 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
|
||||
|
||||
LocalDateTime beginTime;
|
||||
LocalDateTime endTime;
|
||||
if (outpatientInfusionSearchParam == null || outpatientInfusionSearchParam.getBeginTime() == null
|
||||
String searchKey;
|
||||
// 搜索key为空
|
||||
if (outpatientInfusionSearchParam == null) {
|
||||
searchKey = null;
|
||||
} else {
|
||||
searchKey = outpatientInfusionSearchParam.getSearchKey();
|
||||
}
|
||||
// 任意开始结束时间为空,默认查询当天日期记录
|
||||
if (outpatientInfusionSearchParam.getBeginTime() == null
|
||||
|| outpatientInfusionSearchParam.getEndTime() == null) {
|
||||
beginTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), true);
|
||||
endTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), false);
|
||||
} else {
|
||||
} else {// 时间不空,删选时间
|
||||
beginTime = DateUtils.startDayOrEndDay(outpatientInfusionSearchParam.getBeginTime(), true);
|
||||
endTime = DateUtils.startDayOrEndDay(outpatientInfusionSearchParam.getEndTime(), false);
|
||||
}
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<OutpatientInfusionPatientDto> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(null, outpatientInfusionSearchParam.getSearchKey(),
|
||||
new HashSet<>(Arrays.asList("patient_bus_no", "encounter_bus_no", "patient_name")), null);
|
||||
QueryWrapper<OutpatientInfusionPatientDto> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.PatientName)),
|
||||
null);
|
||||
// based_on_id 是为空的
|
||||
queryWrapper.eq("based_on_id", null);
|
||||
queryWrapper.eq(CommonConstants.FieldName.basedOnId, null);
|
||||
// 状态是未完成的
|
||||
queryWrapper.in("status_enum", EventStatus.IN_PROGRESS.getValue(), EventStatus.NOT_DONE.getValue());
|
||||
queryWrapper.in(CommonConstants.FieldName.requestStatus, EventStatus.IN_PROGRESS.getValue(),
|
||||
EventStatus.NOT_DONE.getValue());
|
||||
// 添加时间段查询条件
|
||||
if (beginTime != null && endTime != null) {
|
||||
queryWrapper.ge("begin_time", beginTime);
|
||||
queryWrapper.le("end_time", endTime);
|
||||
queryWrapper.ge(CommonConstants.FieldName.createTime, beginTime);
|
||||
queryWrapper.le(CommonConstants.FieldName.createTime, endTime);
|
||||
}
|
||||
|
||||
IPage<OutpatientInfusionPatientDto> outpatientInfusionPatientDto =
|
||||
@@ -159,10 +145,10 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单个患者门诊输液记录查询
|
||||
* 查询单个患者门诊输液待执行记录
|
||||
*
|
||||
* @param outpatientInfusionPatientDto 患者输液信息
|
||||
* @return 门诊输液记录列表
|
||||
* @return 患者待输液记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<OutpatientInfusionRecordDto>
|
||||
@@ -172,12 +158,13 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
|
||||
return null;
|
||||
}
|
||||
// 创建查询包装器
|
||||
QueryWrapper<OutpatientInfusionRecordDto> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("patient_id", outpatientInfusionPatientDto.getPatientId());
|
||||
LambdaQueryWrapper<OutpatientInfusionRecordDto> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(OutpatientInfusionRecordDto::getPatientId, outpatientInfusionPatientDto.getPatientId());
|
||||
// based_on_id 是为空的
|
||||
queryWrapper.eq("based_on_id", null);
|
||||
queryWrapper.eq(OutpatientInfusionRecordDto::getBasedOnId, null);
|
||||
// 状态是未完成的
|
||||
queryWrapper.in("status_enum", EventStatus.IN_PROGRESS.getValue(), EventStatus.NOT_DONE.getValue());
|
||||
queryWrapper.in(OutpatientInfusionRecordDto::getRequestStatus, EventStatus.IN_PROGRESS.getValue(),
|
||||
EventStatus.NOT_DONE.getValue());
|
||||
// 从数据库获取输液记录列表
|
||||
List<OutpatientInfusionRecordDto> infusionList =
|
||||
outpatientManageMapper.getOutpatientInfusionRecord(queryWrapper);
|
||||
@@ -186,74 +173,96 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行单个患者门诊输液
|
||||
* 执行患者门诊输液
|
||||
*
|
||||
* @param exeCount 执行记录数
|
||||
* @param outpatientInfusionRecordDto 患者输液信息
|
||||
* @return 门诊输液记录列表
|
||||
* @param outpatientInfusionRecordDtoList 输液记录列表
|
||||
* @return 执行成功/失败
|
||||
*/
|
||||
@Override
|
||||
public boolean editPatientInfusionRecord(OutpatientInfusionRecordDto outpatientInfusionRecordDto, Long exeCount) {
|
||||
|
||||
public boolean batchEditPatientInfusionRecord(List<OutpatientInfusionRecordDto> outpatientInfusionRecordDtoList) {
|
||||
// 根据执行人ID,通过登录userId获取
|
||||
Practitioner practitioner =
|
||||
practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId());
|
||||
// 以执行人ID,获取执行人的身份类别
|
||||
// 根据执行人ID,获取执行人身份类型
|
||||
PractitionerRole practitionerRole = practitionerRoleService.getPractitionerRoleById(practitioner.getId());
|
||||
if (practitioner == null || practitionerRole == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String busNo = AssignSeqUtil.formatString(outpatientInfusionRecordDto.getBusNo(), exeCount, 3);
|
||||
// 当输液未被全部执行时,可以修改继续执行,生成一条执行记录
|
||||
if ((BigDecimal.valueOf(exeCount)).compareTo(outpatientInfusionRecordDto.getMedicationAntity()) < 0) {
|
||||
// 当 exeCount 小于 medicationAntity 时,执行这里的代码
|
||||
ServiceRequest serviceRequest = new ServiceRequest();
|
||||
serviceRequest.setPrescriptionNo(outpatientInfusionRecordDto.getPrescriptionNo())
|
||||
// 设置busNo,原来的服务请求编码为基础.执行次数
|
||||
.setBusNo(busNo)
|
||||
// 基于service_request的id
|
||||
.setBasedOnId(outpatientInfusionRecordDto.getServiceId())
|
||||
// 设置状态完成
|
||||
.setStatusEnum(EventStatus.COMPLETED.getValue())
|
||||
// 设置请求code 和原来一致
|
||||
.setActivityId(outpatientInfusionRecordDto.getActivityId())
|
||||
// 患者id
|
||||
.setPatientId(outpatientInfusionRecordDto.getPatientId())
|
||||
// 就诊id
|
||||
.setEncounterId(outpatientInfusionRecordDto.getEncounterId())
|
||||
// 执行人id,通过登录userId获取
|
||||
.setPerformerId(practitioner.getId())
|
||||
// 设置执行人身份类别
|
||||
.setPerformerTypeCode(practitionerRole.getRoleCode())
|
||||
// 设置执行日期为当前时间
|
||||
.setOccurrenceStartTime(DateUtils.getNowDate())
|
||||
// 默认30结束
|
||||
.setOccurrenceEndTime(DateUtils.addDateMinute(DateUtils.getNowDate(), 30));
|
||||
// 按 groupId 分组
|
||||
Map<Long, List<OutpatientInfusionRecordDto>> groupedRecords = outpatientInfusionRecordDtoList.stream()
|
||||
.collect(Collectors.groupingBy(OutpatientInfusionRecordDto::getGroupId));
|
||||
|
||||
boolean result = serviceRequestService.save(serviceRequest);
|
||||
if (!result) {
|
||||
// 遍历每个分组
|
||||
for (Map.Entry<Long, List<OutpatientInfusionRecordDto>> entry : groupedRecords.entrySet()) {
|
||||
List<OutpatientInfusionRecordDto> groupRecords = entry.getValue();
|
||||
|
||||
// 获取组内药品个数
|
||||
Long groupCount = outpatientManageMapper.countMedicationExecuteNum(groupRecords.get(0).getServiceId(), null,
|
||||
groupRecords.get(0).getGroupId(), false);
|
||||
// 检查组内药品是否全部选中
|
||||
if (groupCount != groupRecords.size()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 判断如果是执行该患者最后一次记录,更新原来的服请求状态
|
||||
if ((BigDecimal.valueOf(exeCount + 1)).compareTo(outpatientInfusionRecordDto.getMedicationAntity()) == 0) {
|
||||
// 以id为主条件更新服务申请管理表
|
||||
UpdateWrapper<ServiceRequest> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("id", outpatientInfusionRecordDto.getServiceId())
|
||||
.set("status_enum", EventStatus.COMPLETED.getValue())
|
||||
.set("performer_type_code", practitionerRole.getRoleCode())
|
||||
.set("performer_id", practitioner.getId()).set("occurrence_start_time", DateUtils.getNowDate())
|
||||
.set("occurrence_end_time", DateUtils.getNowDate());
|
||||
int countUpdate = serviceRequestMapper.update(null, updateWrapper);
|
||||
if (countUpdate < 0) {
|
||||
return false;
|
||||
// 构造批量插入的 ServiceRequest 列表
|
||||
List<ServiceRequest> serviceRequests = new ArrayList<>();
|
||||
for (OutpatientInfusionRecordDto record : groupRecords) {
|
||||
String prefixBusNo = record.getBusNo() + "." + record.getGroupId() + "." + record.getMedicationId();
|
||||
// 获取执行次数
|
||||
Long exeCount =
|
||||
outpatientManageMapper.countMedicationExecuteNum(record.getServiceId(), prefixBusNo, null, true);
|
||||
|
||||
if (exeCount < record.getExecuteNum()) {
|
||||
ServiceRequest serviceRequest = new ServiceRequest();
|
||||
serviceRequest.setPrescriptionNo(record.getPrescriptionNo())
|
||||
.setBusNo(AssignSeqUtil.formatString(prefixBusNo, exeCount, 3))
|
||||
.setBasedOnId(record.getServiceId()).setStatusEnum(EventStatus.COMPLETED.getValue())
|
||||
.setActivityId(record.getActivityId()).setPatientId(record.getPatientId())
|
||||
.setEncounterId(record.getEncounterId()).setPerformerId(practitioner.getId())
|
||||
.setPerformerTypeCode(practitionerRole.getRoleCode())
|
||||
.setOccurrenceStartTime(DateUtils.getNowDate())
|
||||
.setOccurrenceEndTime(DateUtils.addDateMinute(DateUtils.getNowDate(), 30));
|
||||
|
||||
serviceRequests.add(serviceRequest);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// 使用 MyBatis-Plus 的 saveBatch 方法批量插入
|
||||
if (!serviceRequestService.saveBatch(serviceRequests)) {
|
||||
return false; // 如果批量插入失败,返回 false
|
||||
}
|
||||
// 更新分组中每个记录的状态
|
||||
for (OutpatientInfusionRecordDto record : groupRecords) {
|
||||
String prefixBusNo = record.getBusNo() + "." + record.getGroupId() + "." + record.getMedicationId();
|
||||
// 获取执行次数
|
||||
Long exeCount =
|
||||
outpatientManageMapper.countMedicationExecuteNum(record.getServiceId(), prefixBusNo, null, true);
|
||||
|
||||
return false;
|
||||
// 执行完毕后,更新执行服务请求表的状态
|
||||
if (exeCount.equals(record.getExecuteNum())) {
|
||||
if (!updateRecordStatus(record.getServiceId())) {
|
||||
return false; // 如果更新状态失败,返回 false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 所有分组都执行成功
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新执行状态
|
||||
*
|
||||
* @param serviceId 服务请求ID
|
||||
* @return 修改成功/失败
|
||||
*/
|
||||
public boolean updateRecordStatus(Long serviceId) {
|
||||
LambdaUpdateWrapper<ServiceRequest> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(ServiceRequest::getId, serviceId).set(ServiceRequest::getStatusEnum,
|
||||
EventStatus.COMPLETED.getValue());
|
||||
|
||||
int countUpdate = serviceRequestMapper.update(null, updateWrapper);
|
||||
return countUpdate > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -265,15 +274,14 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
|
||||
@Override
|
||||
public boolean editPatientInfusionTime(OutpatientInfusionRecordDto outpatientInfusionRecordDto) {
|
||||
// 以id为主条件更新服务申请管理表
|
||||
UpdateWrapper<ServiceRequest> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("id", outpatientInfusionRecordDto.getServiceId()).set("occurrence_end_time",
|
||||
LambdaUpdateWrapper<ServiceRequest> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(ServiceRequest::getId, outpatientInfusionRecordDto.getServiceId()).set(
|
||||
ServiceRequest::getOccurrenceEndTime,
|
||||
DateUtils.parseDate(outpatientInfusionRecordDto.getOccurrenceEndTime()));
|
||||
int countUpdate = serviceRequestMapper.update(null, updateWrapper);
|
||||
if (countUpdate < 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
return countUpdate < 0 ? false : true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -281,10 +289,11 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
|
||||
*
|
||||
* @param beginTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 门诊输液记录列表
|
||||
* @param historyFlag 查询的是否为执行履历
|
||||
* @return 门诊输液执行记录查询
|
||||
*/
|
||||
@Override
|
||||
public List<OutpatientInfusionRecordDto> getPatientInfusionPerformRecord(String beginTime, String endTime) {
|
||||
public List<OutpatientInfusionRecordDto> getPatientInfusionPerformRecord(String beginTime, String endTime,boolean historyFlag) {
|
||||
|
||||
LocalDateTime beginDateTime;
|
||||
LocalDateTime endDateTime;
|
||||
@@ -298,18 +307,45 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
|
||||
}
|
||||
|
||||
// 创建查询包装器
|
||||
QueryWrapper<OutpatientInfusionRecordDto> queryWrapper = new QueryWrapper<>();
|
||||
// based_on_id 不为空
|
||||
queryWrapper.isNotNull("based_on_id");
|
||||
// 状态是已完成
|
||||
queryWrapper.eq("status_enum", EventStatus.COMPLETED.getValue());
|
||||
LambdaQueryWrapper<OutpatientInfusionRecordDto> queryWrapper = new LambdaQueryWrapper<>();
|
||||
//执行历史查询的条件
|
||||
if(historyFlag){
|
||||
// based_on_id 不为空,此条件筛选出执行履历
|
||||
queryWrapper.isNotNull(OutpatientInfusionRecordDto::getBasedOnId);
|
||||
// 状态是已完成
|
||||
queryWrapper.eq(OutpatientInfusionRecordDto::getRequestStatus, EventStatus.COMPLETED.getValue());
|
||||
|
||||
//门诊输液待执行记录查询
|
||||
}else{
|
||||
// based_on_id 为空,此条件筛选控制不显示执行履历
|
||||
queryWrapper.isNull(OutpatientInfusionRecordDto::getBasedOnId);
|
||||
// 状态是进行中
|
||||
queryWrapper.eq(OutpatientInfusionRecordDto::getRequestStatus, EventStatus.IN_PROGRESS.getValue());
|
||||
}
|
||||
// 时间筛选
|
||||
queryWrapper.ge("begin_time", beginDateTime);
|
||||
queryWrapper.le("end_time", endDateTime);
|
||||
queryWrapper.ge(OutpatientInfusionRecordDto::getCreateTime, beginDateTime);
|
||||
queryWrapper.le(OutpatientInfusionRecordDto::getCreateTime, endDateTime);
|
||||
|
||||
// 从数据库获取输液记录列表
|
||||
List<OutpatientInfusionRecordDto> infusionPerformList =
|
||||
outpatientManageMapper.getOutpatientInfusionRecord(queryWrapper);
|
||||
|
||||
// 遍历列表并处理每个记录
|
||||
infusionPerformList.forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 药品状态
|
||||
e.setClinicalStatusEnum_enumText(EnumUtils.getInfoByValue(EventStatus.class, e.getMedicationStatusEnum()));
|
||||
// 皮试标志
|
||||
e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag()));
|
||||
// 只有皮试药品才显示皮试结果
|
||||
if (e.getSkinTestFlag() == Whether.YES.getValue()) {
|
||||
// 皮试结果
|
||||
e.setMedicationStatusEnum_enumText(
|
||||
EnumUtils.getInfoByValue(ClinicalStatus.class, e.getClinicalStatusEnum()));
|
||||
}
|
||||
});
|
||||
|
||||
return infusionPerformList;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@ import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.web.outpatientmanage.appservice.IOutpatientInfusionRecordService;
|
||||
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto;
|
||||
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto;
|
||||
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionSearchParam;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -25,7 +23,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
* @date 2025/3/12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/outpatientmanage/infusion")
|
||||
@RequestMapping("/outpatient-manage/infusion")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OutpatientInfusionRecordController {
|
||||
@@ -33,9 +31,6 @@ public class OutpatientInfusionRecordController {
|
||||
@Autowired
|
||||
IOutpatientInfusionRecordService outpatientInfusionRecordService;
|
||||
|
||||
@Autowired
|
||||
IServiceRequestService serviceRequestService;
|
||||
|
||||
/**
|
||||
* 门诊输液记录初期数据
|
||||
*
|
||||
@@ -48,24 +43,7 @@ public class OutpatientInfusionRecordController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门诊输液患者列表
|
||||
*
|
||||
* @param outpatientInfusionSearchParam 查询参数
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 就诊患者信息
|
||||
*/
|
||||
@GetMapping(value = "/patients")
|
||||
public R<?> getOutpatientInfusionPatient(OutpatientInfusionSearchParam outpatientInfusionSearchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
|
||||
return R.ok(outpatientInfusionRecordService.getOutpatientInfusionPatient(outpatientInfusionSearchParam, pageNo,
|
||||
pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单个患者门诊输液记录查询
|
||||
* 查询单个患者的门诊输液记录
|
||||
*
|
||||
* @param outpatientInfusionPatientDto 患者输液信息
|
||||
* @return 门诊输液记录列表
|
||||
@@ -76,25 +54,6 @@ public class OutpatientInfusionRecordController {
|
||||
return R.ok(outpatientInfusionRecordService.getPatientInfusionRecord(outpatientInfusionPatientDto));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 执行单个患者门诊输液
|
||||
// *
|
||||
// * @param outpatientInfusionRecordDto 患者输液信息
|
||||
// * @return 门诊输液记录列表
|
||||
// */
|
||||
// @PutMapping("/infusion-perform")
|
||||
// public R<?>
|
||||
// editPatientInfusionRecord(@Validated @RequestBody OutpatientInfusionRecordDto outpatientInfusionRecordDto) {
|
||||
// // 获取执行次数
|
||||
// Long exeCount =
|
||||
// serviceRequestService.countServiceRequestByBasedOnId(outpatientInfusionRecordDto.getServiceId());
|
||||
// boolean res = outpatientInfusionRecordService.editPatientInfusionRecord(outpatientInfusionRecordDto, exeCount);
|
||||
// if (!res) {
|
||||
// return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
// }
|
||||
// return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"患者门诊输液执行"}));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 批量执行患者门诊输液
|
||||
*
|
||||
@@ -104,14 +63,11 @@ public class OutpatientInfusionRecordController {
|
||||
@PutMapping("/infusion-perform/batch")
|
||||
public R<?> batchEditPatientInfusionRecord(
|
||||
@Validated @RequestBody List<OutpatientInfusionRecordDto> outpatientInfusionRecordDtoList) {
|
||||
// 获取执行次数
|
||||
for (OutpatientInfusionRecordDto dto : outpatientInfusionRecordDtoList) {
|
||||
Long exeCount = serviceRequestService.countServiceRequestByBasedOnId(dto.getServiceId());
|
||||
boolean res = outpatientInfusionRecordService.editPatientInfusionRecord(dto, exeCount);
|
||||
if (!res) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
if (!outpatientInfusionRecordService.batchEditPatientInfusionRecord(outpatientInfusionRecordDtoList)) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"患者门诊输液执行"}));
|
||||
}
|
||||
|
||||
@@ -131,17 +87,31 @@ public class OutpatientInfusionRecordController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示门诊输液执行记录查询
|
||||
* 门诊输液待执行记录查询
|
||||
*
|
||||
* @param beginTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 门诊输液记录列表
|
||||
* @return 门诊输液待执行记录列表
|
||||
*/
|
||||
@GetMapping(value = "/infusion-perform-Record")
|
||||
@GetMapping(value = "/infusion-wait-perform-record")
|
||||
public R<?> getPatientInfusionRecords(@RequestParam(required = false) String beginTime,
|
||||
@RequestParam(required = false) String endTime) {
|
||||
|
||||
return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord(beginTime, endTime, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 门诊输液执行历史记录查询
|
||||
*
|
||||
* @param beginTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 门诊输液执行历史记录列表
|
||||
*/
|
||||
@GetMapping(value = "/infusion-perform-record")
|
||||
public R<?> getPatientInfusionPerformRecord(@RequestParam(required = false) String beginTime,
|
||||
@RequestParam(required = false) String endTime) {
|
||||
|
||||
return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord(beginTime,endTime));
|
||||
return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord(beginTime, endTime, true));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
* @date 2025/3/5
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/outpatientmanage/skintest")
|
||||
@RequestMapping("/outpatient-manage/skin-test")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OutpatientSkinTestRecordController {
|
||||
@@ -46,7 +46,7 @@ public class OutpatientSkinTestRecordController {
|
||||
*
|
||||
* @param outpatientSkinTestRecordDto 皮试记录信息
|
||||
*/
|
||||
@PutMapping("/outpatient-record-skintest")
|
||||
@PutMapping("/outpatient-record-skin-test")
|
||||
public R<?> editSkinTestRecord(@Validated @RequestBody OutpatientSkinTestRecordDto outpatientSkinTestRecordDto) {
|
||||
|
||||
if (!OutpatientSkinTestRecordService.editSkinTestRecord(outpatientSkinTestRecordDto)) {
|
||||
@@ -60,7 +60,7 @@ public class OutpatientSkinTestRecordController {
|
||||
*
|
||||
* @param outpatientSkinTestRecordDto 皮试记录信息
|
||||
*/
|
||||
@PutMapping("/outpatient-record-signcheck")
|
||||
@PutMapping("/outpatient-record-sign-check")
|
||||
public R<?> nurseSignChkPs(@Validated @RequestBody OutpatientSkinTestRecordDto outpatientSkinTestRecordDto) {
|
||||
|
||||
if (!OutpatientSkinTestRecordService.nurseSignChkPs(outpatientSkinTestRecordDto)) {
|
||||
|
||||
@@ -19,8 +19,6 @@ public class OutpatientInfusionInitDto {
|
||||
|
||||
//皮试结果
|
||||
private List<statusEnumOption> clinicalStatus;
|
||||
//当天位执行的输液记录
|
||||
private List<OutpatientInfusionRecordDto> infusionList;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.openhis.web.outpatientmanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 门诊输液记录Dto
|
||||
*
|
||||
@@ -22,6 +24,9 @@ public class OutpatientInfusionRecordDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long serviceId;
|
||||
|
||||
/** 服务申请状态 */
|
||||
private Integer requestStatus;
|
||||
|
||||
/** 请求基于什么的ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long basedOnId;
|
||||
@@ -56,9 +61,8 @@ public class OutpatientInfusionRecordDto {
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 已执行数量 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long executionCount;
|
||||
/** 住院执行次数 */
|
||||
private Integer executeNum;
|
||||
|
||||
/** 分组id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@@ -88,6 +92,9 @@ public class OutpatientInfusionRecordDto {
|
||||
/** 预计结束时间 */
|
||||
private String occurrenceEndTime;
|
||||
|
||||
/** 药品ID */
|
||||
private Long medicationId;
|
||||
|
||||
/** 药品信息 */
|
||||
private String medicationInformation;
|
||||
|
||||
@@ -108,10 +115,14 @@ public class OutpatientInfusionRecordDto {
|
||||
private String medicationStatusEnum_enumText;
|
||||
|
||||
/** 皮试标志(是/否) */
|
||||
private String flagText;
|
||||
private Integer skinTestFlag;
|
||||
private String skinTestFlag_enumText;
|
||||
|
||||
/** 皮试结果 */
|
||||
private Integer clinicalStatusEnum;
|
||||
private String clinicalStatusEnum_enumText;
|
||||
|
||||
/** 开单时间 */
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
@@ -59,8 +60,19 @@ public interface OutpatientManageMapper {
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 门诊输液记录列表
|
||||
*/
|
||||
List<OutpatientInfusionRecordDto>
|
||||
getOutpatientInfusionRecord(@Param(Constants.WRAPPER) QueryWrapper<OutpatientInfusionRecordDto> queryWrapper);
|
||||
List<OutpatientInfusionRecordDto> getOutpatientInfusionRecord(
|
||||
@Param(Constants.WRAPPER) LambdaQueryWrapper<OutpatientInfusionRecordDto> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询药品已执行数量/查询同组内药品数量
|
||||
*
|
||||
* @param paramId baseOnId/服务请求ID
|
||||
* @param prefixBusNo 服务请求编码
|
||||
* @param groupId 分组ID
|
||||
* @param flag 控制查询条件
|
||||
* @return 查询个数
|
||||
*/
|
||||
long countMedicationExecuteNum(@Param("paramId") Long paramId, @Param("prefixBusNo") String prefixBusNo,
|
||||
@Param("groupId") Long groupId, @Param("flag") boolean flag);
|
||||
|
||||
}
|
||||
|
||||
@@ -95,6 +95,18 @@ public class PatientInformationServiceImpl implements IPatientInformationService
|
||||
.collect(Collectors.toList());
|
||||
initDto.setFamilyRelationshipType(statusEnumOptions6);
|
||||
|
||||
// 获取证件类型
|
||||
List<PatientInfoInitDto.statusEnumOption> statusEnumOptions7 = Stream.of(IdentityDocumentType.values())
|
||||
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setIdentityDocumentType(statusEnumOptions7);
|
||||
|
||||
// 获取是/否状态
|
||||
List<PatientInfoInitDto.statusEnumOption> statusEnumOptions8 = Stream.of(Whether.values())
|
||||
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setWhetherStatus(statusEnumOptions8);
|
||||
|
||||
return initDto;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
* @date 2025/2/28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/patientmanage/records")
|
||||
@RequestMapping("/patient-manage/records")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OutpatientRecordController {
|
||||
|
||||
@@ -18,7 +18,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
* @date 2025/2/22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/patientmanage/information")
|
||||
@RequestMapping("/patient-manage/information")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class PatientInformationController {
|
||||
|
||||
@@ -28,6 +28,10 @@ public class PatientInfoInitDto {
|
||||
private List<PatientInfoInitDto.statusEnumOption> bloodTypeRH;
|
||||
//获取家庭关系列表
|
||||
private List<PatientInfoInitDto.statusEnumOption> familyRelationshipType;
|
||||
//身份证件类型
|
||||
private List<PatientInfoInitDto.statusEnumOption> identityDocumentType;
|
||||
//是/否 状态
|
||||
private List<PatientInfoInitDto.statusEnumOption> whetherStatus;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
abi.volume,
|
||||
abi.method_code,
|
||||
abi.rate_code,
|
||||
abi.org_id,
|
||||
abi.location_id,
|
||||
abi.dose,
|
||||
abi.dose_unit_code,
|
||||
abi.supplier,
|
||||
@@ -42,6 +44,8 @@
|
||||
T2.total_volume AS volume,
|
||||
T2.method_code AS method_code,
|
||||
T2.rate_code AS rate_code,
|
||||
T2.org_id AS org_id,
|
||||
T2.location_id AS location_id,
|
||||
CAST(T2.dose AS TEXT) AS dose,
|
||||
T2.dose_unit_code AS dose_unit_code,
|
||||
T3.NAME AS supplier,
|
||||
@@ -75,6 +79,8 @@
|
||||
T1.SIZE AS volume,
|
||||
'' AS method_code,
|
||||
'' AS rate_code,
|
||||
T1.org_id AS org_id,
|
||||
T1.location_id AS location_id,
|
||||
'' AS dose,
|
||||
'' AS dose_unit_code,
|
||||
T2.NAME AS supplier,
|
||||
@@ -106,6 +112,8 @@
|
||||
'' AS volume,
|
||||
'' AS method_code,
|
||||
'' AS rate_code,
|
||||
T1.org_id AS org_id,
|
||||
T1.location_id AS location_id,
|
||||
'' AS dose,
|
||||
'' AS dose_unit_code,
|
||||
'' AS supplier,
|
||||
@@ -131,6 +139,7 @@
|
||||
T1.lot_number,
|
||||
T1.price,
|
||||
T1.location_id,
|
||||
T1.location_store_id,
|
||||
T2.NAME AS location_name
|
||||
FROM
|
||||
wor_inventory_item AS T1
|
||||
|
||||
@@ -179,8 +179,9 @@
|
||||
resultType="com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto">
|
||||
SELECT
|
||||
T1.service_id,
|
||||
T1.request_status,
|
||||
T1.bus_no,
|
||||
T1.execution_count,
|
||||
T1.execute_num,
|
||||
T1.based_on_id,
|
||||
T1.activity_id,
|
||||
T1.prescription_no,
|
||||
@@ -194,7 +195,7 @@
|
||||
T1.medication_status_Enum,
|
||||
T1.group_id,
|
||||
T1.clinical_status_enum,
|
||||
T1.flag_text,
|
||||
T1.skin_test_flag,
|
||||
T1.speed,
|
||||
T1.method_code,
|
||||
T1.dose,
|
||||
@@ -209,25 +210,27 @@
|
||||
SELECT
|
||||
sr.id AS service_id, --服务申请管理ID
|
||||
sr.bus_no, -- 服务请求编码
|
||||
(SELECT COUNT(*) FROM wor_service_request wsr WHERE wsr.based_on_id = sr.based_on_id) AS execution_count,
|
||||
sr.based_on_id, -- 请求基于什么的ID
|
||||
sr.execute_num, -- 执行次数
|
||||
sr.activity_id,--请求code,输液
|
||||
sr.prescription_no, --处方号
|
||||
sr.encounter_id , --就诊ID
|
||||
sr.tenant_id,
|
||||
sr.status_enum AS request_status, --服务请求状态
|
||||
e.bus_no AS encounter_busNo, --就诊ID(前台显示用)
|
||||
pt.name AS patient_name, --病人姓名
|
||||
pt.bus_no AS patient_busNo, --病人ID(前台显示用)
|
||||
sr.patient_id, --病人ID
|
||||
ad.name AS medication_information, --药品信息
|
||||
md.id AS medication_id, --药品ID
|
||||
md.name AS medication_information, --药品信息
|
||||
mr.antity AS medication_antity,--药品数量
|
||||
mr.status_enum AS medication_status_Enum, --药品状态
|
||||
mr.group_id, --注射药品组号
|
||||
CASE mr.skin_test_flag
|
||||
WHEN 1 THEN 1
|
||||
ELSE 0
|
||||
END AS skin_test_flag ,--皮试标志
|
||||
ai.clinical_status_enum, --皮试检查结果
|
||||
CASE mr.skin_test_flag--皮试标志
|
||||
WHEN 1 THEN '是'
|
||||
ELSE '否'
|
||||
END AS flag_text,
|
||||
mr.speed, --输液速度
|
||||
mr.method_code,--用法
|
||||
mr.dose || ' '|| mr.dose_unit_code AS dose,--单次剂量,剂量单位
|
||||
@@ -247,7 +250,7 @@
|
||||
LEFT JOIN med_medication_definition md ON md.id = m.medication_def_id
|
||||
LEFT JOIN cli_allergy_intolerance ai ON ai.request_id = sr.id
|
||||
<where>
|
||||
ad.bus_no = 'sy001' -- 皮试检查的编号,todo:编号未定,后期修改
|
||||
ad.bus_no = 'sy001' -- 输液检查的编号,todo:编号未定,后期修改
|
||||
AND mr.infusion_flag = 1
|
||||
AND md.infusion_flag = 1
|
||||
|
||||
@@ -258,4 +261,40 @@
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 查询药品已执行数量/查询同组内药品数量 -->
|
||||
<select id="countMedicationExecuteNum" resultType="long">
|
||||
|
||||
SELECT COUNT(*)
|
||||
FROM
|
||||
wor_service_request sr
|
||||
LEFT JOIN adm_encounter e ON e.id = sr.encounter_id
|
||||
LEFT JOIN adm_patient pt ON pt.id = sr.patient_id
|
||||
LEFT JOIN wor_activity_definition ad ON ad.id = sr.activity_id
|
||||
LEFT JOIN med_medication_request mr ON mr.prescription_no = sr.prescription_no
|
||||
LEFT JOIN med_medication m ON m.id = mr.medication_id
|
||||
LEFT JOIN med_medication_definition md ON md.id = m.medication_def_id
|
||||
LEFT JOIN cli_allergy_intolerance ai ON ai.request_id = sr.id
|
||||
<where>
|
||||
ad.bus_no = 'sy001' -- 输液检查的编号,todo:编号未定,后期修改
|
||||
AND mr.infusion_flag = 1
|
||||
AND md.infusion_flag = 1
|
||||
|
||||
<!-- 药品已执行数量 条件筛选 -->
|
||||
<if test="flag and paramId != null and paramId != '' and prefixBusNo != null and prefixBusNo != '' ">
|
||||
AND sr.base_on_id = #{paramId}
|
||||
AND sr.bus_no LIKE CONCAT(#{prefixBusNo}, '%')
|
||||
AND sr.status_enum = 6 --服务状态是已完成
|
||||
</if>
|
||||
|
||||
<!-- 同组内药品数量 条件筛选 -->
|
||||
<if test="!flag and paramId != null and paramId != '' and groupId != null and groupId != ''">
|
||||
AND sr.id = #{paramId}
|
||||
AND mr.group_id = #{groupId}
|
||||
AND sr.status_enum = 2 --服务状态是进行中
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -137,6 +137,21 @@ public class CommonConstants {
|
||||
* 患者姓名
|
||||
*/
|
||||
String PatientName = "patient_name";
|
||||
|
||||
/**
|
||||
* 请求状态
|
||||
*/
|
||||
String requestStatus = "request_status";
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
String createTime = "create_time";
|
||||
|
||||
/**
|
||||
* 请求基于什么的ID
|
||||
*/
|
||||
String basedOnId = "based_on_id";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,40 +14,29 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ChargeItemContext {
|
||||
public enum ChargeItemContext implements HisEnumInterface {
|
||||
|
||||
/**
|
||||
* 采购
|
||||
*/
|
||||
PURCHASE(1, "采购"),
|
||||
PURCHASE(1, "1", "采购"),
|
||||
|
||||
/**
|
||||
* 药品
|
||||
*/
|
||||
MEDICATION(2, "药品"),
|
||||
MEDICATION(2, "2", "药品"),
|
||||
|
||||
/**
|
||||
* 耗材
|
||||
*/
|
||||
DEVICE(3, "耗材"),
|
||||
DEVICE(3, "3", "耗材"),
|
||||
|
||||
/**
|
||||
* 项目
|
||||
*/
|
||||
ACTIVITY(4, "项目");
|
||||
ACTIVITY(4, "4", "项目");
|
||||
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public static ChargeItemContext getByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (ChargeItemContext val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private final Integer value;
|
||||
private final String code;
|
||||
private final String info;
|
||||
}
|
||||
|
||||
@@ -46,15 +46,4 @@ public enum ChargeItemStatus implements HisEnumInterface {
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
public static ChargeItemStatus getByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (ChargeItemStatus val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 身份证件类型
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/3/18
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum IdentityDocumentType implements HisEnumInterface {
|
||||
|
||||
RESIDENT_ID_CARD(1, "residentIdCard", "居民身份证"),
|
||||
HOUSEHOLD_REGISTER(2, "householdRegister", "居民户口簿"),
|
||||
PASSPORT(3, "passport", "护照"),
|
||||
OFFICER_CERTIFICATE(4, "officerCertificate", "军官证"),
|
||||
DRIVING_LICENSE(5, "drivingLicense", "驾驶证"),
|
||||
HONGKONG_MACAO_PASS(6, "hongkongMacaoPass", "港澳居民来往内地通行证"),
|
||||
TAIWAN_PASS(7, "taiwanPass", "台湾居民来往内地通行证"),
|
||||
OTHER(99, "other", "其他身份证件");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String code;
|
||||
private final String info;
|
||||
}
|
||||
@@ -59,6 +59,12 @@ public class DeviceDefinition extends HisBaseEntity {
|
||||
/** 最小使用单位 */
|
||||
private String minUnitCode;
|
||||
|
||||
/** 所属科室 */
|
||||
private Long orgId;
|
||||
|
||||
/** 所在位置 */
|
||||
private Long locationId;
|
||||
|
||||
/** 产品型号 */
|
||||
private String modelNumber;
|
||||
|
||||
|
||||
@@ -38,6 +38,9 @@ public class Medication extends HisBaseEntity {
|
||||
/** 所属科室 */
|
||||
private Long orgId;
|
||||
|
||||
/** 所在位置 */
|
||||
private Long locationId;
|
||||
|
||||
/** 剂型 */
|
||||
private String doseFormCode;
|
||||
|
||||
@@ -77,4 +80,16 @@ public class Medication extends HisBaseEntity {
|
||||
/** 药品定义 */
|
||||
private String definition;
|
||||
|
||||
/** 删除状态 */
|
||||
private String deleteFlag;
|
||||
|
||||
/** 用量限定 */
|
||||
private BigDecimal usageLimit;
|
||||
|
||||
/** DDD值 */
|
||||
private String dddCode;
|
||||
|
||||
/** DDD单位 */
|
||||
private String dddUnitCode;
|
||||
|
||||
}
|
||||
@@ -108,9 +108,18 @@ public class MedicationDefinition extends HisBaseEntity {
|
||||
/** 限制使用范围 */
|
||||
private String restrictedScope;
|
||||
|
||||
/** 是否使用 */
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
private Integer childrenFlag;
|
||||
|
||||
/** 产品特性 */
|
||||
private Integer characteristic;
|
||||
|
||||
/** 删除状态 */
|
||||
private String deleteFlag;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
@@ -123,4 +132,25 @@ public class MedicationDefinition extends HisBaseEntity {
|
||||
/** 默认住院单位 */
|
||||
private String defInhospitalUnitCode;
|
||||
|
||||
/** 贯标国家编码 */
|
||||
private String nationalDrugCode;
|
||||
|
||||
/** 拆分属性 */
|
||||
private String partAttribute;
|
||||
|
||||
/** 抗生素分类 */
|
||||
private String antibioticCode;
|
||||
|
||||
/** 权限限制 */
|
||||
private Integer restrictedEnum;
|
||||
|
||||
/** 是否自制 */
|
||||
private Integer selfFlag;
|
||||
|
||||
/** 是否抗生素 */
|
||||
private Integer antibioticFlag;
|
||||
|
||||
/** 基药标识 */
|
||||
private Integer basicFlag;
|
||||
|
||||
}
|
||||
@@ -43,15 +43,15 @@ public class MedicationRequest extends HisBaseEntity {
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 执行次数 */
|
||||
private Integer executeNum;
|
||||
|
||||
/** 请求单位编码 */
|
||||
private String unitCode;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 请求合计(元) */
|
||||
private BigDecimal displayAmount;
|
||||
|
||||
/** 药品请求状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ 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.openhis.common.enums.ActivityDefCategory;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -48,6 +46,12 @@ public class ActivityDefinition extends HisBaseEntity {
|
||||
/** 使用单位 */
|
||||
private String permittedUnitCode;
|
||||
|
||||
/** 所属科室 */
|
||||
private Long orgId;
|
||||
|
||||
/** 所在位置 */
|
||||
private Long locationId;
|
||||
|
||||
/** 医保标记 */
|
||||
private Integer ybFlag;
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ public class DeviceRequest extends HisBaseEntity {
|
||||
/** 请求意图 */
|
||||
private String intentCode;
|
||||
|
||||
/** 请求类型 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 优先级 */
|
||||
private Integer priorityEnum;
|
||||
|
||||
@@ -67,9 +70,6 @@ public class DeviceRequest extends HisBaseEntity {
|
||||
/** 耗材定义id */
|
||||
private Long deviceDefId;
|
||||
|
||||
/** 请求合计(元) */
|
||||
private BigDecimal displayAmount;
|
||||
|
||||
/** 器材规格 */
|
||||
private String deviceSpecifications;
|
||||
|
||||
@@ -85,6 +85,9 @@ public class DeviceRequest extends HisBaseEntity {
|
||||
/** 就诊id */
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者ID */
|
||||
private Long patientId;
|
||||
|
||||
/** 用药频次 */
|
||||
private String rateCode;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ServiceRequest extends HisBaseEntity {
|
||||
/** 意图 */
|
||||
private Integer intentEnum;
|
||||
|
||||
/** 服务分类 */
|
||||
/** 请求类型 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 优先权 */
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -30,8 +31,8 @@ public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper,
|
||||
*/
|
||||
@Override
|
||||
public Long countServiceRequestByBasedOnId(Long basedOnId) {
|
||||
QueryWrapper<ServiceRequest> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("based_on_id", basedOnId);
|
||||
LambdaQueryWrapper<ServiceRequest> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ServiceRequest::getBasedOnId, basedOnId);
|
||||
return serviceRequestMapper.selectCount(queryWrapper);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user