v0.2
This commit is contained in:
@@ -12,11 +12,34 @@
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
|
||||
<description>
|
||||
|
||||
领域
|
||||
</description>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>16</source>
|
||||
<target>16</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>2.0.43</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
<!-- 共通-->
|
||||
<dependency>
|
||||
<groupId>com.openhis</groupId>
|
||||
|
||||
@@ -30,14 +30,18 @@ public class Account extends HisBaseEntity {
|
||||
private Long id;
|
||||
|
||||
/** 状态枚举 */
|
||||
private AccountStatus statusEnum;
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 结账状态枚举 */
|
||||
private AccountBillingStatus billingStatusEnum;
|
||||
private Integer billingStatusEnum;
|
||||
|
||||
// 2025.04.10 经确认此处原有的【1 CASH 个人现金账户 | 2 医保账户】改为【01医保电子凭证 | 02 居民身份证 | 03 社会保障卡 | 04 个人现金账户】
|
||||
/** 账户类型编码 */
|
||||
private String typeCode;
|
||||
|
||||
/** 编码 */
|
||||
private String no;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
@@ -59,5 +63,7 @@ public class Account extends HisBaseEntity {
|
||||
/** 欠费限制额度 */
|
||||
private BigDecimal limitAccount;
|
||||
|
||||
/** 是否为就诊登记使用 */
|
||||
private Integer encounterFlag;
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,11 @@ public class ChargeItem extends HisBaseEntity {
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/**
|
||||
* 账单生成来源
|
||||
*/
|
||||
private Integer generateSourceEnum;
|
||||
|
||||
/** 层级 */
|
||||
private String busNo;
|
||||
|
||||
@@ -122,9 +127,24 @@ public class ChargeItem extends HisBaseEntity {
|
||||
private Long accountId;
|
||||
|
||||
/** 机构 */
|
||||
private Integer orgId;
|
||||
private Long orgId;
|
||||
|
||||
/** 退费ID */
|
||||
private Long refundId;
|
||||
|
||||
/**
|
||||
* 子项json
|
||||
*/
|
||||
private String childrenJson;
|
||||
|
||||
/**
|
||||
* 诊断id
|
||||
*/
|
||||
private Long conditionId;
|
||||
|
||||
/**
|
||||
* 就诊诊断id
|
||||
*/
|
||||
private Long encounterDiagnosisId;
|
||||
|
||||
}
|
||||
|
||||
@@ -86,6 +86,9 @@ public class DeviceDefinition extends HisBaseEntity {
|
||||
/** 医保对码标记 */
|
||||
private Integer ybMatchFlag;
|
||||
|
||||
/** 医保等级 */
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
@@ -113,4 +116,7 @@ public class DeviceDefinition extends HisBaseEntity {
|
||||
/** 过敏标记 */
|
||||
private Integer allergenFlag;
|
||||
|
||||
/** 处方标志 */
|
||||
private Integer rxFlag;
|
||||
|
||||
}
|
||||
|
||||
@@ -60,6 +60,11 @@ public class Encounter extends HisBaseEntity {
|
||||
*/
|
||||
private Integer ybClassEnum;
|
||||
|
||||
/**
|
||||
* 类别医保文本
|
||||
*/
|
||||
private String ybClassText;
|
||||
|
||||
/**
|
||||
* 类别编码补充
|
||||
*/
|
||||
@@ -95,6 +100,11 @@ public class Encounter extends HisBaseEntity {
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 接诊时间
|
||||
*/
|
||||
private Date receptionTime;
|
||||
|
||||
/**
|
||||
* 机构id
|
||||
*/
|
||||
@@ -110,4 +120,14 @@ public class Encounter extends HisBaseEntity {
|
||||
*/
|
||||
private Integer firstEnum;
|
||||
|
||||
/**
|
||||
* 入院类型
|
||||
*/
|
||||
private String admitSourceCode;
|
||||
|
||||
/**
|
||||
* 入院方式
|
||||
*/
|
||||
private String inWayCode;
|
||||
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ public class EncounterDiagnosis extends HisBaseEntity {
|
||||
/** 入院疾病病情代码 */
|
||||
private Integer admDiseCondCode;
|
||||
|
||||
/** 特殊病种标志 */
|
||||
private Integer spDiseFlag;
|
||||
/** 医疗类型 */
|
||||
private String medTypeCode;// 2025/05/23 该字段改为med_type 与医保同步
|
||||
|
||||
/** 主诊断标记 */
|
||||
private Integer maindiseFlag;
|
||||
@@ -49,4 +49,17 @@ public class EncounterDiagnosis extends HisBaseEntity {
|
||||
/** 最高诊断依据标记 */
|
||||
private Integer highDiseEvidFlag;
|
||||
|
||||
/** 诊断排序(医保文档要求数值型字符长度为2) */
|
||||
private Integer diagSrtNo;
|
||||
|
||||
/**
|
||||
* 中医证候组号
|
||||
*/
|
||||
private String syndromeGroupNo;
|
||||
|
||||
/**
|
||||
* 中医标识
|
||||
*/
|
||||
private Integer tcmFlag;
|
||||
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class EncounterParticipant extends HisBaseEntity {
|
||||
private String typeCode;
|
||||
|
||||
/** 开始时间 */
|
||||
private Date startTiem;
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private Date endTime;
|
||||
|
||||
@@ -60,5 +60,7 @@ public class HealthcareService extends HisBaseEntity {
|
||||
/** 预约要求 */
|
||||
private Integer appointmentRequiredFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
}
|
||||
@@ -32,6 +32,9 @@ public class Invoice extends HisBaseEntity {
|
||||
/** 患者ID */
|
||||
private Long patientId;
|
||||
|
||||
/** 付款ID */
|
||||
private Long reconciliationId;
|
||||
|
||||
/** 状态 */
|
||||
private InvoiceStatus statusEnum;
|
||||
|
||||
@@ -53,17 +56,27 @@ public class Invoice extends HisBaseEntity {
|
||||
/** 付款详情 */
|
||||
private String paymentTerms;
|
||||
|
||||
/** 账单批次号 */
|
||||
private String batchCode;
|
||||
/** 发票编号 */
|
||||
private String busNo;
|
||||
|
||||
/** 结算批次号 */
|
||||
private String qrCode;
|
||||
|
||||
/** 图片网络路径 */
|
||||
private String pictureNetUrl;
|
||||
|
||||
/** 图片路径 */
|
||||
/** 开票员 */
|
||||
private Long invoicingStaffId;
|
||||
/** 电子票据代码 */
|
||||
private String billBatchCode;
|
||||
/** 电子票据号码 */
|
||||
private String billNo;
|
||||
/** 电子校验码 */
|
||||
private String random;
|
||||
/** 电子票据生成时间 */
|
||||
private String billCreateTime;
|
||||
/** 电子票据二维码图片数据 */
|
||||
private String billQrCode;
|
||||
/** 电子票据H5页面URL */
|
||||
private String pictureUrl;
|
||||
|
||||
|
||||
/** 电子票据外网H5页面URL */
|
||||
private String pictureNetUrl;
|
||||
/** 微信插卡URL */
|
||||
private String wxCardUrl;
|
||||
/** 票据营业日期 */
|
||||
private Date billBusDate;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import com.openhis.common.enums.LocationMode;
|
||||
import com.openhis.common.enums.LocationOperational;
|
||||
import com.openhis.common.enums.LocationStatus;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -32,20 +35,15 @@ public class Location extends HisBaseEntity {
|
||||
private String name;
|
||||
|
||||
/** 状态编码 */
|
||||
// private LocationStatus statusEnum;
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 操作状态 */
|
||||
// private LocationBedStatus operationalEnum;
|
||||
private Integer operationalEnum;
|
||||
|
||||
/** 模式编码 */
|
||||
// private LocationMode modeEnum;
|
||||
private Integer modeEnum;
|
||||
|
||||
/** 模式编码 */
|
||||
private String typeCode;
|
||||
|
||||
/** 功能编码 */
|
||||
private String typeJson;
|
||||
|
||||
@@ -56,7 +54,6 @@ public class Location extends HisBaseEntity {
|
||||
private String wbStr;
|
||||
|
||||
/** 物理形式枚举 */
|
||||
// private LocationForm formEnum;
|
||||
private Integer formEnum;
|
||||
|
||||
/** 机构编码 */
|
||||
@@ -65,22 +62,9 @@ public class Location extends HisBaseEntity {
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
// public Location(Long id, String busNo, String name, Integer statusEnum, Integer operationalEnum,
|
||||
// Integer modeEnum, String typeCode, String typeJson, String pyStr, String wbStr, Integer formEnum,
|
||||
// Long organizationId, Integer displayOrder) {
|
||||
// this.id = id;
|
||||
// this.busNo = busNo;
|
||||
// this.name = name;
|
||||
// this.statusEnum = statusEnum;
|
||||
// this.operationalEnum = operationalEnum;
|
||||
// this.modeEnum = modeEnum;
|
||||
// this.typeCode = typeCode;
|
||||
// this.typeJson = typeJson;
|
||||
// this.pyStr = pyStr;
|
||||
// this.wbStr = wbStr;
|
||||
// this.formEnum = formEnum;
|
||||
// this.organizationId = organizationId;
|
||||
// this.displayOrder = displayOrder;
|
||||
// }
|
||||
public Location() {
|
||||
this.statusEnum = LocationStatus.ACTIVE.getValue();
|
||||
this.modeEnum = LocationMode.INSTANCE.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ public class Organization extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
@@ -39,10 +40,10 @@ public class Organization extends HisBaseEntity {
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 机构类型枚举 */
|
||||
private OrganizationType typeEnum;
|
||||
private Integer typeEnum;
|
||||
|
||||
/** 机构分类枚举 */
|
||||
private OrganizationClass classEnum;
|
||||
private Integer classEnum;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
@@ -56,7 +57,24 @@ public class Organization extends HisBaseEntity {
|
||||
/** 医保名称 */
|
||||
private String ybName;
|
||||
|
||||
/** 科别 */
|
||||
private String caty;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
/** 医疗服务机构标识 */
|
||||
private String medinsId;
|
||||
|
||||
/** 医疗机构行政区划编码 */
|
||||
private String medinsAdmdvs;
|
||||
|
||||
/** 医疗服务机构类型 */
|
||||
private String medinsType;
|
||||
|
||||
/** 医疗机构等级 */
|
||||
private String medinsLv;
|
||||
|
||||
/** 默认挂号医生 */
|
||||
private Long defDoctorId;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.openhis.administration.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Time;
|
||||
import java.util.Date;
|
||||
|
||||
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.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -30,26 +30,32 @@ public class OrganizationLocation extends HisBaseEntity {
|
||||
private Long id;
|
||||
|
||||
/** 机构编码 */
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
private Long organizationId;
|
||||
|
||||
/** 位置编码 */
|
||||
private Long locationId;
|
||||
|
||||
/** 默认发药药房 */
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
private Long defLocationId;
|
||||
|
||||
/** 默认执行科室 */
|
||||
private Long defOrganizationId;
|
||||
|
||||
/** 发放类别 */
|
||||
@Dict(dictCode = "distribution_category_code")
|
||||
private String distributionCategoryCode;
|
||||
|
||||
/**
|
||||
* 诊疗定义id
|
||||
*/
|
||||
private Long activityDefinitionId;
|
||||
|
||||
/**
|
||||
* 诊疗类型
|
||||
*/
|
||||
private String activityCategoryCode;
|
||||
|
||||
/** 开始时间 */
|
||||
private Date startTime;
|
||||
private Time startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private Date endTime;
|
||||
private Time endTime;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
@@ -28,6 +28,9 @@ public class PatientIdentifier extends HisBaseEntity {
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 患者ID */
|
||||
private Long patientId;
|
||||
|
||||
/** 标识类型编码 */
|
||||
private String typeCode;
|
||||
|
||||
@@ -35,7 +38,7 @@ public class PatientIdentifier extends HisBaseEntity {
|
||||
private String identifierNo;
|
||||
|
||||
/** 标识状态枚举 */
|
||||
private IdentifierUse stateEnum;
|
||||
private Integer stateEnum;
|
||||
|
||||
/** 有效时间Start */
|
||||
private Date startTime;
|
||||
|
||||
@@ -8,6 +8,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 com.openhis.common.enums.AdministrativeGender;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -27,6 +29,7 @@ public class Practitioner extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 活动标记 */
|
||||
@@ -86,5 +89,15 @@ public class Practitioner extends HisBaseEntity {
|
||||
/** 系统用户id */
|
||||
private Long userId;
|
||||
|
||||
/** 医生职称 */
|
||||
private String drProfttlCode ;
|
||||
|
||||
/** 证件类型 */
|
||||
private String prscDrCertCode;
|
||||
|
||||
/** 职业证件编号 */
|
||||
private String pharPracCertNo;
|
||||
|
||||
/** 开票点编码 */
|
||||
private String kpdCode;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.openhis.administration.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@@ -14,4 +15,18 @@ import com.openhis.administration.domain.EncounterDiagnosis;
|
||||
@Repository
|
||||
public interface EncounterDiagnosisMapper extends BaseMapper<EncounterDiagnosis> {
|
||||
|
||||
/**
|
||||
* 删除就诊信息
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
*/
|
||||
void deleteByEncounterId(@Param("encounterId") Long encounterId);
|
||||
|
||||
/**
|
||||
* 删除中医就诊信息
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
*/
|
||||
void deleteTcmByEncounterId(@Param("encounterId") Long encounterId);
|
||||
|
||||
}
|
||||
@@ -33,4 +33,20 @@ public interface IAccountService extends IService<Account> {
|
||||
* @return 账户id
|
||||
*/
|
||||
Long getMedicalInsuranceAccount(Long encounterId);
|
||||
|
||||
/**
|
||||
* 插入或更新 Account 实体
|
||||
*
|
||||
* @param account 实体对象
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean saveOrUpdateAccount(Account account);
|
||||
|
||||
/**
|
||||
* 插入或更新 Account 实体
|
||||
*
|
||||
* @param account 实体对象
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean isSelfPay(Account account);
|
||||
}
|
||||
@@ -15,14 +15,14 @@ public interface IChargeItemService extends IService<ChargeItem> {
|
||||
|
||||
/**
|
||||
* 创建已计费的采购账单
|
||||
*
|
||||
*
|
||||
* @param chargeItemList 采购账单
|
||||
*/
|
||||
void createBilledPurchaseCharge(List<ChargeItem> chargeItemList);
|
||||
|
||||
/**
|
||||
* 门诊挂号时保存 费用项
|
||||
*
|
||||
*
|
||||
* @param chargeItem 费用项
|
||||
*/
|
||||
void saveChargeItemByRegister(ChargeItem chargeItem);
|
||||
@@ -45,9 +45,39 @@ public interface IChargeItemService extends IService<ChargeItem> {
|
||||
List<ChargeItem> getChargeItemInfo(List<Long> chargeItemIdList);
|
||||
|
||||
/**
|
||||
* 更新收费状态:已退费
|
||||
* 更新收费状态:退费中
|
||||
*
|
||||
* @param chargeItemIdList 收费id列表
|
||||
*/
|
||||
void updateRefundChargeStatus(List<Long> chargeItemIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据集合更改收费状态
|
||||
* @param chargeItemIdList 实体集合
|
||||
* @param value 状态值
|
||||
*/
|
||||
void updatePaymentStatus(List<Long> chargeItemIdList, Integer value);
|
||||
|
||||
/**
|
||||
* 根据表名和id删除费用项
|
||||
* @param tableName 表名
|
||||
* @param serviceId id
|
||||
*/
|
||||
void deleteByServiceTableAndId(String tableName,Long serviceId);
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者因退费重新生成的账单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 重新生成的账单列表
|
||||
*/
|
||||
List<String> getRegenerateCharge(Long encounterId);
|
||||
|
||||
/**
|
||||
* 根据请求编号列表查询收费项目信息
|
||||
*
|
||||
* @param requestIdList 请求id列表
|
||||
* @return 收费项目信息
|
||||
*/
|
||||
List<ChargeItem> getChargeItemInfoByReqId(List<Long> requestIdList);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.openhis.administration.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.EncounterDiagnosis;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 就诊诊断管理Service接口
|
||||
*
|
||||
@@ -11,4 +13,39 @@ import com.openhis.administration.domain.EncounterDiagnosis;
|
||||
*/
|
||||
public interface IEncounterDiagnosisService extends IService<EncounterDiagnosis> {
|
||||
|
||||
/**
|
||||
* 删除就诊信息
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
*/
|
||||
void deleteEncounterDiagnosisInfos(Long encounterId);
|
||||
|
||||
/**
|
||||
* 删除中医诊断
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
*/
|
||||
void deleteTcmEncounterDiagnosisInfos(Long encounterId);
|
||||
|
||||
/**
|
||||
* 查询 med_type 类型
|
||||
* @param encounterId
|
||||
* @return
|
||||
*/
|
||||
List<String> getMetTypeList(Long encounterId);
|
||||
|
||||
/**
|
||||
* 查询 EncounterDiagnosis
|
||||
* @param encounterId
|
||||
* @return
|
||||
*/
|
||||
List<EncounterDiagnosis> getDiagnosisList(Long encounterId);
|
||||
|
||||
/**
|
||||
* 查询 EncounterDiagnosis
|
||||
* @param diaIdList
|
||||
* @return
|
||||
*/
|
||||
List<EncounterDiagnosis> getDiagnosisList(List<Long> diaIdList);
|
||||
|
||||
}
|
||||
@@ -18,4 +18,11 @@ public interface IEncounterLocationService extends IService<EncounterLocation> {
|
||||
*/
|
||||
void saveEncounterLocationByRegister(EncounterLocation encounterLocation);
|
||||
|
||||
/**
|
||||
* 自定义插入或更新方法,根据就诊id,病区,判断是更新还是插入
|
||||
* @param encounterLocation 实体对象
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean saveOrUpdateEncounterLocation(EncounterLocation encounterLocation);
|
||||
|
||||
}
|
||||
@@ -18,4 +18,28 @@ public interface IEncounterService extends IService<Encounter> {
|
||||
*/
|
||||
Long saveEncounterByRegister(Encounter encounter);
|
||||
|
||||
/**
|
||||
* 退号
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
*/
|
||||
void returnRegister(Long encounterId);
|
||||
|
||||
/**
|
||||
* 更新就诊管理
|
||||
*
|
||||
* @param encounter 就诊管理实体
|
||||
*/
|
||||
boolean saveOrUpdateEncounter(Encounter encounter);
|
||||
|
||||
|
||||
/**
|
||||
* 通过 id 更新 priorityEnum 字段
|
||||
*
|
||||
* @param id Encounter 的 id
|
||||
* @param priorityEnum 要更新的 priorityEnum 值
|
||||
* @return 更新是否成功
|
||||
*/
|
||||
boolean updatePriorityEnumById(Long id, Integer priorityEnum);
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.openhis.administration.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Invoice;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
|
||||
/**
|
||||
* 发票管理Service接口
|
||||
@@ -10,5 +11,11 @@ import com.openhis.administration.domain.Invoice;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IInvoiceService extends IService<Invoice> {
|
||||
|
||||
/**
|
||||
* 新增发票
|
||||
*
|
||||
* @param invoice 发票实体
|
||||
* @return
|
||||
*/
|
||||
Long addInvoice(Invoice invoice);
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.openhis.administration.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Location;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 位置管理Service接口
|
||||
*
|
||||
@@ -26,4 +26,77 @@ public interface ILocationService extends IService<Location> {
|
||||
* @return 药库列表
|
||||
*/
|
||||
List<Location> getCabinetList();
|
||||
|
||||
/**
|
||||
* 获取药房药库列表
|
||||
*
|
||||
* @return 药房药库列表
|
||||
*/
|
||||
List<Location> getPharmacyCabinetList();
|
||||
|
||||
/**
|
||||
* 获取病区列表
|
||||
*
|
||||
* @return 病区列表
|
||||
*/
|
||||
List<Location> getWardList();
|
||||
|
||||
/**
|
||||
* 获取科室对应的病区列表
|
||||
*
|
||||
* @param id 科室id
|
||||
* @return 病区列表
|
||||
*/
|
||||
List<Location> getWardList(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 获取病区下对应的病床列表
|
||||
*
|
||||
* @param id 病区id
|
||||
* @return 病床列表
|
||||
*/
|
||||
List<Location> getBedList(Long id);
|
||||
|
||||
/**
|
||||
* 依据id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Location getLocationById(Long id);
|
||||
|
||||
/**
|
||||
* 新增位置信息
|
||||
*
|
||||
* @param location 位置信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean addLocation(Location location);
|
||||
|
||||
/**
|
||||
* 编辑位置信息
|
||||
*
|
||||
* @param location 位置信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean updateLocation(Location location);
|
||||
|
||||
/**
|
||||
* 根据科室ID集合,查询对应信息
|
||||
*
|
||||
* @param ids 科室ID集合
|
||||
* @return 科室信息列表
|
||||
*/
|
||||
List<Location> getLocationList(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据locationId,更新状态
|
||||
*
|
||||
* @param id 位置Id
|
||||
* @param status 操作状态
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean updateStatusById(Long id, Integer status);
|
||||
|
||||
}
|
||||
@@ -12,12 +12,20 @@ import com.openhis.administration.domain.OrganizationLocation;
|
||||
public interface IOrganizationLocationService extends IService<OrganizationLocation> {
|
||||
|
||||
/**
|
||||
* 查询机构位置关系
|
||||
* 查询药品和耗材发放的科室
|
||||
*
|
||||
* @param orgId 机构id
|
||||
* @param categoryCode 发放类型
|
||||
* @return机构位置关系
|
||||
* @return 药品和耗材发放的科室
|
||||
*/
|
||||
OrganizationLocation getOrgLocByOrgIdAndCategoryCode(Long orgId, String categoryCode);
|
||||
|
||||
/**
|
||||
* 查询诊疗的执行科室
|
||||
*
|
||||
* @param activityDefinitionId 诊疗定义id
|
||||
* @return 诊疗的执行科室
|
||||
*/
|
||||
OrganizationLocation getOrgLocByOrgIdAndActivityDefinitionId(Long activityDefinitionId);
|
||||
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.openhis.administration.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机构管理Service接口
|
||||
*
|
||||
@@ -32,8 +32,9 @@ public interface IOrganizationService extends IService<Organization> {
|
||||
/**
|
||||
* 获取机构下拉列表
|
||||
*
|
||||
* @param classEnum 机构分类
|
||||
* @param organizationType 机构类型
|
||||
* @param organizationClass 机构分类
|
||||
* @return 机构下拉列表
|
||||
*/
|
||||
List<Organization> getList(Integer classEnum);
|
||||
List<Organization> getList(Integer organizationType, Integer organizationClass);
|
||||
}
|
||||
@@ -11,4 +11,19 @@ import com.openhis.administration.domain.PatientIdentifier;
|
||||
*/
|
||||
public interface IPatientIdentifierService extends IService<PatientIdentifier> {
|
||||
|
||||
/**
|
||||
* 查询病人标识
|
||||
*
|
||||
* @param patientId 患者Id
|
||||
*/
|
||||
PatientIdentifier selectByPatientId(Long patientId);
|
||||
|
||||
/**
|
||||
* 查询病人标识
|
||||
*
|
||||
* @param patientId 患者Id
|
||||
* @param typeCode 患者标识
|
||||
*/
|
||||
boolean updateTypeByPatientId(Long patientId, String typeCode);
|
||||
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.openhis.administration.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Encounter;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
|
||||
import java.util.Date;
|
||||
import com.openhis.administration.domain.PatientIdentifier;
|
||||
|
||||
/**
|
||||
* 患者管理Service接口
|
||||
@@ -14,4 +13,33 @@ import java.util.Date;
|
||||
*/
|
||||
public interface IPatientService extends IService<Patient> {
|
||||
|
||||
/**
|
||||
* 更新或者插入患者管理
|
||||
*
|
||||
* @param patient 患者实体
|
||||
*/
|
||||
boolean saveOrUpdatePatient(Patient patient);
|
||||
|
||||
/**
|
||||
* 更新或者插入患者管理
|
||||
*
|
||||
* @param patient 患者实体
|
||||
*/
|
||||
boolean savePatient(Patient patient);
|
||||
|
||||
/**
|
||||
* 添加病人
|
||||
*
|
||||
* @param patient 患者实体
|
||||
*/
|
||||
boolean addPatient(Patient patient);
|
||||
|
||||
/**
|
||||
* 更新病人
|
||||
*
|
||||
* @param patient 患者实体
|
||||
*/
|
||||
boolean updatePatient(Patient patient);
|
||||
|
||||
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.administration.domain.PractitionerRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 岗位管理Service接口
|
||||
*
|
||||
@@ -20,4 +22,36 @@ public interface IPractitionerRoleService extends IService<PractitionerRole> {
|
||||
*/
|
||||
PractitionerRole getPractitionerRoleById(long practitionerId);
|
||||
|
||||
}
|
||||
/**
|
||||
* 根据参与者Id,查询其权限下所有科室id
|
||||
*
|
||||
* @param practitionerId 参与者Id
|
||||
* @return 科室id
|
||||
*/
|
||||
List<Long> getOrgIdsByPractitionerId(Long practitionerId);
|
||||
|
||||
/**
|
||||
* 根据参与者Id,查询其权限下所有位置id
|
||||
*
|
||||
* @param practitionerId 参与者Id
|
||||
* @return 位置id
|
||||
*/
|
||||
List<Long> getLocationIdsByPractitionerId(Long practitionerId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据科室Id,查询医生列表
|
||||
*
|
||||
* @param orgId 科室Id
|
||||
* @return 医生列表
|
||||
*/
|
||||
List<PractitionerRole> getDoctorList(Long orgId);
|
||||
|
||||
/**
|
||||
* 根据科室Id,查询护士列表
|
||||
*
|
||||
* @return 护士列表
|
||||
*/
|
||||
List<PractitionerRole> getNurseList(Long orgId);
|
||||
|
||||
}
|
||||
|
||||
@@ -32,4 +32,14 @@ public interface ISupplierService extends IService<Supplier> {
|
||||
* @return 供应商下拉列表
|
||||
*/
|
||||
List<Supplier> getList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供应商信息
|
||||
*
|
||||
* @param name 名字
|
||||
* @param address 地址
|
||||
* @param typeEnum 类型
|
||||
* @return 供应商信息
|
||||
*/
|
||||
List<Supplier> getsupplierList(String name,String address,Integer typeEnum);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -9,6 +11,8 @@ import com.openhis.administration.mapper.AccountMapper;
|
||||
import com.openhis.administration.service.IAccountService;
|
||||
import com.openhis.common.enums.AccountType;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 就诊账户管理Service业务层处理
|
||||
*
|
||||
@@ -25,6 +29,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
*/
|
||||
@Override
|
||||
public Long saveAccountByRegister(Account account) {
|
||||
account.setEncounterFlag(Whether.YES.getValue());
|
||||
baseMapper.insert(account);
|
||||
return account.getId();
|
||||
}
|
||||
@@ -37,8 +42,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
*/
|
||||
@Override
|
||||
public Long getSelfPayAccount(Long encounterId) {
|
||||
Account account = baseMapper.selectOne(new LambdaQueryWrapper<Account>().select(Account::getId)
|
||||
.eq(Account::getEncounterId, encounterId).eq(Account::getTypeCode, AccountType.SELF_PAY.getCode()));
|
||||
Account account = baseMapper
|
||||
.selectOne(new LambdaQueryWrapper<Account>().select(Account::getId).eq(Account::getEncounterId, encounterId)
|
||||
.eq(Account::getTypeCode, AccountType.PERSONAL_CASH_ACCOUNT.getCode()));
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
@@ -55,11 +61,48 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
public Long getMedicalInsuranceAccount(Long encounterId) {
|
||||
Account account = baseMapper
|
||||
.selectOne(new LambdaQueryWrapper<Account>().select(Account::getId).eq(Account::getEncounterId, encounterId)
|
||||
.eq(Account::getTypeCode, AccountType.MEDICAL_INSURANCE.getCode()));
|
||||
.eq(Account::getTypeCode, AccountType.MEDICAL_ELECTRONIC_CERTIFICATE.getCode()));
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入或更新 Account 实体
|
||||
*
|
||||
* @param account 实体对象
|
||||
* @return 是否成功
|
||||
*/
|
||||
/**
|
||||
* 插入或更新 Account 实体
|
||||
*
|
||||
* @param account 实体对象
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean saveOrUpdateAccount(Account account) {
|
||||
// 创建 LambdaQueryWrapper
|
||||
LambdaQueryWrapper<Account> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Account::getPatientId, account.getPatientId())
|
||||
.eq(Account::getEncounterId, account.getEncounterId())
|
||||
// 账户状态是有效的
|
||||
.eq(Account::getStatusEnum, AccountStatus.ACTIVE.getValue());
|
||||
|
||||
// 查询是否存在记录
|
||||
Account existingAccount = baseMapper.selectOne(queryWrapper);
|
||||
if (existingAccount != null) {
|
||||
// 如果记录存在,更新记录
|
||||
account.setId(existingAccount.getId()); // 设置主键
|
||||
return baseMapper.updateById(account) > 0;
|
||||
} else {
|
||||
// 如果记录不存在,插入新记录
|
||||
return baseMapper.insert(account) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfPay(@NotNull Account account) {
|
||||
return "0000".equals(account.getContractNo());
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,18 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.mapper.ChargeItemMapper;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.enums.ChargeItemContext;
|
||||
import com.openhis.common.enums.ChargeItemStatus;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -45,6 +49,7 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
||||
*/
|
||||
@Override
|
||||
public void saveChargeItemByRegister(ChargeItem chargeItem) {
|
||||
chargeItem.setContextEnum(ChargeItemContext.REGISTER.getValue());// 挂号
|
||||
baseMapper.insert(chargeItem);
|
||||
}
|
||||
|
||||
@@ -74,13 +79,61 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新收费状态:已退费
|
||||
* 更新收费状态:退费中
|
||||
*
|
||||
* @param chargeItemIdList 收费id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateRefundChargeStatus(List<Long> chargeItemIdList) {
|
||||
baseMapper.update(new ChargeItem().setStatusEnum(ChargeItemStatus.REFUNDED.getValue()),
|
||||
baseMapper.update(new ChargeItem().setStatusEnum(ChargeItemStatus.REFUNDING.getValue()),
|
||||
new LambdaUpdateWrapper<ChargeItem>().in(ChargeItem::getId, chargeItemIdList));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePaymentStatus(List<Long> chargeItemIdList, Integer value) {
|
||||
baseMapper.update(new ChargeItem().setStatusEnum(value),
|
||||
new LambdaUpdateWrapper<ChargeItem>().in(ChargeItem::getId, chargeItemIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据表名和id删除费用项
|
||||
*
|
||||
* @param tableName 表名
|
||||
* @param serviceId id
|
||||
*/
|
||||
@Override
|
||||
public void deleteByServiceTableAndId(String tableName, Long serviceId) {
|
||||
baseMapper.delete(new LambdaQueryWrapper<ChargeItem>().eq(ChargeItem::getServiceTable, tableName)
|
||||
.eq(ChargeItem::getServiceId, serviceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者因退费重新生成的账单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 重新生成的账单列表
|
||||
*/
|
||||
@Override
|
||||
public List<String> getRegenerateCharge(Long encounterId) {
|
||||
List<ChargeItem> chargeItemList =
|
||||
baseMapper.selectList(new LambdaUpdateWrapper<ChargeItem>().eq(ChargeItem::getEncounterId, encounterId)
|
||||
.eq(ChargeItem::getStatusEnum, ChargeItemStatus.PLANNED.getValue()).isNotNull(ChargeItem::getRefundId));
|
||||
List<String> chargeItemIdList = new ArrayList<>();
|
||||
if (chargeItemList != null) {
|
||||
chargeItemIdList =
|
||||
chargeItemList.stream().map(item -> item.getId().toString()).collect(Collectors.toList());
|
||||
}
|
||||
return chargeItemIdList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据请求编号列表查询收费项目信息
|
||||
*
|
||||
* @param requestIdList 请求id列表
|
||||
* @return 收费项目信息
|
||||
*/
|
||||
@Override
|
||||
public List<ChargeItem> getChargeItemInfoByReqId(List<Long> requestIdList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<ChargeItem>().in(ChargeItem::getServiceId, requestIdList));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.EncounterDiagnosis;
|
||||
import com.openhis.administration.mapper.EncounterDiagnosisMapper;
|
||||
import com.openhis.administration.service.IEncounterDiagnosisService;
|
||||
import com.openhis.clinical.mapper.ConditionMapper;
|
||||
|
||||
/**
|
||||
* 就诊诊断管理Service业务层处理
|
||||
@@ -14,6 +22,74 @@ import com.openhis.administration.service.IEncounterDiagnosisService;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class EncounterDiagnosisServiceImpl extends ServiceImpl<EncounterDiagnosisMapper, EncounterDiagnosis> implements IEncounterDiagnosisService {
|
||||
public class EncounterDiagnosisServiceImpl extends ServiceImpl<EncounterDiagnosisMapper, EncounterDiagnosis>
|
||||
implements IEncounterDiagnosisService {
|
||||
|
||||
@Resource
|
||||
ConditionMapper conditionMapper;
|
||||
|
||||
/**
|
||||
* 删除就诊信息
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
*/
|
||||
@Override
|
||||
public void deleteEncounterDiagnosisInfos(Long encounterId) {
|
||||
// 不删除中医
|
||||
conditionMapper.deleteByEncounterId(encounterId);
|
||||
baseMapper.deleteByEncounterId(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除中医诊断
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
*/
|
||||
@Override
|
||||
public void deleteTcmEncounterDiagnosisInfos(Long encounterId) {
|
||||
// 删除中医
|
||||
conditionMapper.deleteTcmByEncounterId(encounterId);
|
||||
baseMapper.deleteTcmByEncounterId(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回med_type类型
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return med_type集合
|
||||
*/
|
||||
@Override
|
||||
public List<String> getMetTypeList(Long encounterId) {
|
||||
|
||||
List<EncounterDiagnosis> encounterDiagnoses = baseMapper.selectList(
|
||||
new LambdaQueryWrapper<EncounterDiagnosis>().eq(EncounterDiagnosis::getEncounterId, encounterId));
|
||||
if (encounterDiagnoses == null) {
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
return encounterDiagnoses.stream().distinct().map(EncounterDiagnosis::getMedTypeCode)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回med_type类型
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return EncounterDiagnosis 集合
|
||||
*/
|
||||
@Override
|
||||
public List<EncounterDiagnosis> getDiagnosisList(Long encounterId) {
|
||||
return baseMapper.selectList(
|
||||
new LambdaQueryWrapper<EncounterDiagnosis>().eq(EncounterDiagnosis::getEncounterId, encounterId));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param diaIdList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<EncounterDiagnosis> getDiagnosisList(List<Long> diaIdList) {
|
||||
return baseMapper
|
||||
.selectList(new LambdaQueryWrapper<EncounterDiagnosis>().in(EncounterDiagnosis::getId, diaIdList));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.openhis.common.enums.EncounterLocationStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -27,4 +29,29 @@ public class EncounterLocationServiceImpl extends ServiceImpl<EncounterLocationM
|
||||
baseMapper.insert(encounterLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义插入或更新方法,根据就诊id,病区,判断是更新还是插入
|
||||
* @param encounterLocation 实体对象
|
||||
* @return 是否成功
|
||||
*/
|
||||
public boolean saveOrUpdateEncounterLocation(EncounterLocation encounterLocation) {
|
||||
// 创建 LambdaQueryWrapper
|
||||
LambdaQueryWrapper<EncounterLocation> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(EncounterLocation::getEncounterId, encounterLocation.getEncounterId())
|
||||
.eq(EncounterLocation::getFormEnum,encounterLocation.getFormEnum())
|
||||
// 状态为使用中
|
||||
.eq(EncounterLocation::getStatusEnum, EncounterLocationStatus.ACTIVE.getValue());
|
||||
|
||||
// 查询是否存在记录
|
||||
EncounterLocation existingRecord = baseMapper.selectOne(queryWrapper);
|
||||
if (existingRecord != null) {
|
||||
// 如果记录存在,更新记录
|
||||
encounterLocation.setId(existingRecord.getId());
|
||||
return baseMapper.updateById(encounterLocation) > 0;
|
||||
} else {
|
||||
// 如果记录不存在,插入新记录
|
||||
return baseMapper.insert(encounterLocation) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,10 @@ package com.openhis.administration.service.impl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.administration.domain.Account;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -11,6 +14,8 @@ import com.core.common.utils.AssignSeqUtil;
|
||||
import com.openhis.administration.domain.Encounter;
|
||||
import com.openhis.administration.mapper.EncounterMapper;
|
||||
import com.openhis.administration.service.IEncounterService;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.EncounterStatus;
|
||||
import com.openhis.common.enums.EncounterType;
|
||||
|
||||
/**
|
||||
@@ -33,8 +38,10 @@ public class EncounterServiceImpl extends ServiceImpl<EncounterMapper, Encounter
|
||||
*/
|
||||
@Override
|
||||
public Long saveEncounterByRegister(Encounter encounter) {
|
||||
// 生成就诊编码
|
||||
encounter.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.ENCOUNTER_NUM.getPrefix(), 8));
|
||||
if(StringUtils.isEmpty(encounter.getBusNo())){
|
||||
// 生成就诊编码 医保挂号时是先生成码后生成实体
|
||||
encounter.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.ENCOUNTER_NUM.getPrefix(), 8));
|
||||
}
|
||||
// 生成就诊序号 (患者ID + 科室ID 作为当日就诊号的唯一标识)
|
||||
String preFix = encounter.getPatientId() + String.valueOf(encounter.getOrganizationId());
|
||||
encounter.setDisplayOrder(assignSeqUtil.getSeqNoByDay(preFix));
|
||||
@@ -49,4 +56,62 @@ public class EncounterServiceImpl extends ServiceImpl<EncounterMapper, Encounter
|
||||
return encounter.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 退号
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
*/
|
||||
@Override
|
||||
public void returnRegister(Long encounterId) {
|
||||
Encounter encounter = new Encounter();
|
||||
encounter.setStatusEnum(EncounterStatus.CANCELLED.getValue());
|
||||
encounter.setId(encounterId);
|
||||
baseMapper.updateById(encounter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新或者插入就诊管理
|
||||
*
|
||||
* @param encounter 就诊管理实体
|
||||
*/
|
||||
@Override
|
||||
public boolean saveOrUpdateEncounter(Encounter encounter) {
|
||||
|
||||
// 创建 LambdaQueryWrapper
|
||||
LambdaQueryWrapper<Encounter> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Encounter::getPatientId, encounter.getPatientId())
|
||||
.eq(Encounter::getId, encounter.getId());
|
||||
|
||||
// 查询是否存在记录
|
||||
Encounter existingEncounter = baseMapper.selectOne(queryWrapper);
|
||||
if (existingEncounter != null) {
|
||||
// 如果记录存在,更新记录
|
||||
encounter.setId(existingEncounter.getId()); // 设置主键
|
||||
return baseMapper.updateById(encounter) > 0;
|
||||
} else {
|
||||
// 使用基础采番,设置住院ID,10位数
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.ADMISSION_NUM.getPrefix(), 10);
|
||||
encounter.setBusNo(code);
|
||||
// 如果记录不存在,插入新记录
|
||||
return baseMapper.insert(encounter) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 id 更新 priorityEnum 字段
|
||||
*
|
||||
* @param id Encounter 的 id
|
||||
* @param priorityEnum 要更新的 priorityEnum 值
|
||||
* @return 更新是否成功
|
||||
*/
|
||||
public boolean updatePriorityEnumById(Long id, Integer priorityEnum) {
|
||||
// 创建更新条件
|
||||
LambdaUpdateWrapper<Encounter> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(Encounter::getId, id)
|
||||
.set(Encounter::getPriorityEnum, priorityEnum);
|
||||
|
||||
// 执行更新
|
||||
return update(updateWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -7,6 +13,9 @@ import com.openhis.administration.domain.Invoice;
|
||||
import com.openhis.administration.mapper.InvoiceMapper;
|
||||
import com.openhis.administration.service.IInvoiceService;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发票管理Service业务层处理
|
||||
*
|
||||
@@ -15,5 +24,26 @@ import com.openhis.administration.service.IInvoiceService;
|
||||
*/
|
||||
@Service
|
||||
public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> implements IInvoiceService {
|
||||
/**
|
||||
* 新增发票
|
||||
*
|
||||
* @param invoice 发票实体
|
||||
* @return
|
||||
*/
|
||||
public Long addInvoice(Invoice invoice){
|
||||
// 根据编码判断发票是否存在
|
||||
List<Invoice> invoices =
|
||||
baseMapper.selectList(new LambdaQueryWrapper<Invoice>().eq(Invoice::getBusNo, invoice.getBusNo()));
|
||||
if (invoices.size() > 0) {
|
||||
return null;
|
||||
}
|
||||
// 新增发票
|
||||
int insert = baseMapper.insert(invoice);
|
||||
if (insert != 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return invoice.getId();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,20 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.mapper.LocationMapper;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.common.enums.LocationBedStatus;
|
||||
import com.openhis.common.enums.LocationForm;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
|
||||
/**
|
||||
* 位置管理Service业务层处理
|
||||
@@ -41,4 +46,150 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i
|
||||
return baseMapper
|
||||
.selectList(new LambdaQueryWrapper<Location>().eq(Location::getFormEnum, LocationForm.CABINET.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取药房药库列表
|
||||
*
|
||||
* @return 药房药库列表
|
||||
*/
|
||||
@Override
|
||||
public List<Location> getPharmacyCabinetList() {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<Location>().in(Location::getFormEnum,
|
||||
LocationForm.CABINET.getValue(), LocationForm.PHARMACY.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取病区列表
|
||||
*
|
||||
* @return 病区列表
|
||||
*/
|
||||
@Override
|
||||
public List<Location> getWardList() {
|
||||
return baseMapper
|
||||
.selectList(new LambdaQueryWrapper<Location>().eq(Location::getFormEnum, LocationForm.WARD.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 依据id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public Location getLocationById(Long id) {
|
||||
|
||||
return baseMapper.selectById(id);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取科室对应的病区列表
|
||||
*
|
||||
* @param id 科室id
|
||||
* @return 病区列表
|
||||
*/
|
||||
@Override
|
||||
public List<Location> getWardList(Long id) {
|
||||
|
||||
LambdaQueryWrapper<Location> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(Location::getId, Location::getName) // 只查询 id 和 name 字段
|
||||
.eq(Location::getOrganizationId, id) // 科室id
|
||||
.eq(Location::getFormEnum, LocationForm.WARD.getValue()); // form 值为 4:病区
|
||||
|
||||
// 查询满足条件的 Location 对象列表
|
||||
List<Location> locations = baseMapper.selectList(queryWrapper);
|
||||
|
||||
return locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取病区下对应的病床列表
|
||||
*
|
||||
* @param id 病区id
|
||||
* @return 病床列表
|
||||
*/
|
||||
@Override
|
||||
public List<Location> getBedList(Long id) {
|
||||
|
||||
Location location = baseMapper.selectById(id);
|
||||
if (location == null || location.getBusNo() == null) {
|
||||
return null;
|
||||
}
|
||||
LambdaQueryWrapper<Location> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(Location::getId, Location::getName) // 只查询 id 和 name 字段
|
||||
.likeRight(Location::getBusNo, location.getBusNo()) // 查询病区busNo开头的
|
||||
.eq(Location::getFormEnum, LocationForm.BED.getValue()) // form 值为 8:病床
|
||||
.eq(Location::getOperationalEnum, LocationBedStatus.U.getValue());// 空闲状态
|
||||
|
||||
// 查询满足条件的 Location 对象列表
|
||||
List<Location> locations = baseMapper.selectList(queryWrapper);
|
||||
|
||||
return locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增位置信息
|
||||
*
|
||||
* @param location 位置信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean addLocation(Location location) {
|
||||
return baseMapper.insert(location) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑位置信息
|
||||
*
|
||||
* @param location 位置信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean updateLocation(Location location) {
|
||||
return baseMapper.update(location,
|
||||
new LambdaUpdateWrapper<Location>().eq(Location::getId, location.getId())) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据科室ID集合,查询对应信息
|
||||
*
|
||||
* @param ids 科室ID集合
|
||||
* @return 科室信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<Location> getLocationList(List<Long> ids) {
|
||||
// 如果 ids 是空的,获取当前登录用户的 orgId
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
if (orgId != null) {
|
||||
ids = Collections.singletonList(orgId); // 将 orgId 转换为单元素列表
|
||||
}
|
||||
}
|
||||
|
||||
// 创建查询条件
|
||||
LambdaQueryWrapper<Location> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(Location::getId, Location::getName) // 指定只查询 id 和 name 字段
|
||||
.in(Location::getId, ids)// 条件:id 在传入的 ids 集合中
|
||||
.eq(Location::getStatusEnum, PublicationStatus.ACTIVE.getValue()); // 状态有效的
|
||||
|
||||
// 查询满足条件的 Supplier 对象列表
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据locationId,更新状态
|
||||
*
|
||||
* @param id 位置Id
|
||||
* @param status 操作状态
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean updateStatusById(Long id, Integer status) {
|
||||
|
||||
Location location = new Location();
|
||||
location.setId(id);
|
||||
location.setOperationalEnum(status);
|
||||
|
||||
return baseMapper.updateById(location) > 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.sql.Time;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -21,19 +21,33 @@ public class OrganizationLocationServiceImpl extends ServiceImpl<OrganizationLoc
|
||||
implements IOrganizationLocationService {
|
||||
|
||||
/**
|
||||
* 查询机构位置关系
|
||||
* 查询药品和耗材发放的科室
|
||||
*
|
||||
* @param orgId 机构id
|
||||
* @param categoryCode 发放类型
|
||||
* @return机构位置关系
|
||||
* @return 药品和耗材发放的科室
|
||||
*/
|
||||
@Override
|
||||
public OrganizationLocation getOrgLocByOrgIdAndCategoryCode(Long orgId, String categoryCode) {
|
||||
OrganizationLocation organizationLocation = baseMapper
|
||||
Time time = new Time(System.currentTimeMillis());
|
||||
return 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;
|
||||
.lt(OrganizationLocation::getStartTime, time).gt(OrganizationLocation::getEndTime, time));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询诊疗的执行科室
|
||||
*
|
||||
* @param activityDefinitionId 诊疗定义id
|
||||
* @return 诊疗的执行科室
|
||||
*/
|
||||
@Override
|
||||
public OrganizationLocation getOrgLocByOrgIdAndActivityDefinitionId(Long activityDefinitionId) {
|
||||
Time time = new Time(System.currentTimeMillis());
|
||||
return baseMapper.selectOne(new LambdaQueryWrapper<OrganizationLocation>()
|
||||
.eq(OrganizationLocation::getActivityDefinitionId, activityDefinitionId)
|
||||
.lt(OrganizationLocation::getStartTime, time).gt(OrganizationLocation::getEndTime, time));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -51,12 +51,14 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
|
||||
/**
|
||||
* 获取机构下拉列表
|
||||
*
|
||||
* @param classEnum 机构分类
|
||||
* @param organizationType 机构类型
|
||||
* @param organizationClass 机构分类
|
||||
* @return 机构下拉列表
|
||||
*/
|
||||
@Override
|
||||
public List<Organization> getList(Integer classEnum) {
|
||||
public List<Organization> getList(Integer organizationType, Integer organizationClass) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<Organization>()
|
||||
.select(Organization::getId, Organization::getName).eq(Organization::getClassEnum, classEnum));
|
||||
.select(Organization::getId, Organization::getName).eq(Organization::getTypeEnum, organizationType)
|
||||
.eq(organizationClass != null, Organization::getClassEnum, organizationClass));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.PatientIdentifier;
|
||||
import com.openhis.administration.mapper.PatientIdentifierMapper;
|
||||
@@ -14,6 +17,45 @@ import com.openhis.administration.service.IPatientIdentifierService;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class PatientIdentifierServiceImpl extends ServiceImpl<PatientIdentifierMapper, PatientIdentifier> implements IPatientIdentifierService {
|
||||
public class PatientIdentifierServiceImpl extends ServiceImpl<PatientIdentifierMapper, PatientIdentifier>
|
||||
implements IPatientIdentifierService {
|
||||
|
||||
@Autowired
|
||||
PatientIdentifierMapper patientIdentifierMapper;
|
||||
|
||||
/**
|
||||
* 根据患者Id查询病人标识
|
||||
*
|
||||
* @param patientId 患者Id
|
||||
*/
|
||||
@Override
|
||||
public PatientIdentifier selectByPatientId(Long patientId) {
|
||||
// 构造查询条件
|
||||
LambdaQueryWrapper<PatientIdentifier> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PatientIdentifier::getPatientId, patientId);
|
||||
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询病人标识
|
||||
*
|
||||
* @param patientId 患者Id
|
||||
*/
|
||||
public boolean updateTypeByPatientId(Long patientId, String typeCode) {
|
||||
|
||||
// 创建LambdaUpdateWrapper实例
|
||||
LambdaUpdateWrapper<PatientIdentifier> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
|
||||
// 设置更新条件:根据patientId更新
|
||||
updateWrapper.eq(PatientIdentifier::getPatientId, patientId);
|
||||
|
||||
// 设置要更新的字段和值
|
||||
updateWrapper.set(PatientIdentifier::getTypeCode, typeCode);
|
||||
|
||||
// 执行更新操作
|
||||
return patientIdentifierMapper.update(null, updateWrapper) > 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,18 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.ChineseConvertUtils;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.administration.mapper.PatientMapper;
|
||||
import com.openhis.administration.service.IPatientService;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
|
||||
/**
|
||||
* 患者管理Service业务层处理
|
||||
@@ -26,4 +23,167 @@ import java.util.HashSet;
|
||||
@Service
|
||||
public class PatientServiceImpl extends ServiceImpl<PatientMapper, Patient> implements IPatientService {
|
||||
|
||||
@Autowired(required = false)
|
||||
AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 更新或者插入患者管理
|
||||
*
|
||||
* @param patient 患者实体
|
||||
*/
|
||||
@Override
|
||||
public boolean saveOrUpdatePatient(Patient patient) {
|
||||
|
||||
// 身份证ID,患者ID,确定唯一患者
|
||||
LambdaQueryWrapper<Patient> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Patient::getId, patient.getId()).eq(Patient::getIdCard, patient.getIdCard());
|
||||
|
||||
Patient existingPatient = baseMapper.selectOne(queryWrapper);
|
||||
if (existingPatient != null) {
|
||||
// 如果记录存在,更新记录
|
||||
patient.setId(existingPatient.getId());
|
||||
return baseMapper.updateById(patient) > 0;
|
||||
} else {
|
||||
// 如果记录不存在,插入新记录
|
||||
return baseMapper.insert(patient) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean savePatient(Patient patient) {
|
||||
|
||||
// 使用基础采番,设置病人ID,10位数
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.PATIENT_NUM.getPrefix(), 10);
|
||||
patient.setBusNo(code);
|
||||
|
||||
Long organizationId = SecurityUtils.getLoginUser().getOrgId();
|
||||
// 设置机构ID
|
||||
patient.setOrganizationId(organizationId);
|
||||
|
||||
// 设置拼音首拼
|
||||
patient.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(patient.getName()));
|
||||
// 设置五笔首拼
|
||||
patient.setWbStr(ChineseConvertUtils.toWBFirstLetter(patient.getName()));
|
||||
// 死亡时间不为空,check死亡时间
|
||||
if (patient.getDeceasedDate() != null) {
|
||||
// 设置死亡时间,死亡时间未来时报错
|
||||
if (DateUtils.isFuture(patient.getDeceasedDate())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 身份证号存在check
|
||||
if (existsByIdCard(patient.getIdCard(), patient.getId())) {
|
||||
// 身份证号存在
|
||||
return false;
|
||||
}
|
||||
saveOrUpdatePatient(patient);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断身份证号是否存在
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @param patientId 患者ID
|
||||
* @return 是/否
|
||||
*/
|
||||
public boolean existsByIdCard(String idCard, Long patientId) {
|
||||
// 构造查询条件
|
||||
LambdaQueryWrapper<Patient> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Patient::getIdCard, idCard);
|
||||
Patient patient = baseMapper.selectOne(queryWrapper);
|
||||
// 记录不存在
|
||||
if (patient == null) {
|
||||
return false;
|
||||
}
|
||||
// 新增时病人的身份证号已存在
|
||||
if (patientId == null) {
|
||||
return true;
|
||||
}
|
||||
// 记录存在时,患者ID相同,即为该患者未修改其身份证号码
|
||||
if (patient.getId().compareTo(patientId) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据证件号查询,查询患者存在否
|
||||
*
|
||||
* @param patient 患者实体
|
||||
* @return
|
||||
*/
|
||||
public Patient idCardExists(Patient patient) {
|
||||
// 根据证件号查询,查询患者存在否
|
||||
LambdaQueryWrapper<Patient> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Patient::getIdCard, patient.getIdCard());
|
||||
Patient patientExists = baseMapper.selectOne(queryWrapper);
|
||||
|
||||
return patientExists;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加病人
|
||||
*
|
||||
* @param patient 患者实体
|
||||
*/
|
||||
@Override
|
||||
public boolean addPatient(Patient patient) {
|
||||
|
||||
patientCommonSet(patient);
|
||||
|
||||
// 不存在重复的证件号,新增患者
|
||||
if (idCardExists(patient) == null) {
|
||||
// 添加患者
|
||||
return baseMapper.insert(patient) > 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新病人
|
||||
*
|
||||
* @param patient 患者实体
|
||||
*/
|
||||
@Override
|
||||
public boolean updatePatient(Patient patient) {
|
||||
|
||||
Patient patientExists = idCardExists(patient);
|
||||
patientCommonSet(patient);
|
||||
|
||||
// 根据证件号查询,不存在重复的证件号
|
||||
if (patientExists == null) {
|
||||
// 患者修改了证件号码且不重复,更新患者
|
||||
return baseMapper.updateById(patient) > 0;
|
||||
} else if (patientExists.getId().compareTo(patient.getId()) == 0) {
|
||||
// 患者未修改证件号码,更新患者
|
||||
return baseMapper.updateById(patient) > 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置病人共通项目赋值
|
||||
*
|
||||
* @param patient 患者实体
|
||||
*/
|
||||
public Patient patientCommonSet(Patient patient) {
|
||||
|
||||
// 使用基础采番,设置病人ID,10位数
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.PATIENT_NUM.getPrefix(), 10);
|
||||
patient.setBusNo(code);
|
||||
Long organizationId = SecurityUtils.getLoginUser().getOrgId();
|
||||
// 设置机构ID
|
||||
patient.setOrganizationId(organizationId);
|
||||
// 设置拼音首拼
|
||||
patient.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(patient.getName()));
|
||||
// 设置五笔首拼
|
||||
patient.setWbStr(ChineseConvertUtils.toWBFirstLetter(patient.getName()));
|
||||
|
||||
return patient;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,18 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.administration.domain.PractitionerRole;
|
||||
import com.openhis.administration.mapper.PractitionerRoleMapper;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.common.enums.PractitionerRoles;
|
||||
|
||||
/**
|
||||
* 岗位管理Service业务层处理
|
||||
@@ -36,4 +40,79 @@ public class PractitionerRoleServiceImpl extends ServiceImpl<PractitionerRoleMap
|
||||
return practitionerRoleMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 根据参与者Id,查询其权限下所有科室id
|
||||
*
|
||||
* @param practitionerId 参与者Id
|
||||
* @return 科室ID的集合
|
||||
*/
|
||||
@Override
|
||||
public List<Long> getOrgIdsByPractitionerId(Long practitionerId) {
|
||||
// 创建查询条件
|
||||
LambdaQueryWrapper<PractitionerRole> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PractitionerRole::getPractitionerId, practitionerId); // 条件:practitionerId 等于指定值
|
||||
|
||||
// 使用 selectList 方法查询所有符合条件的 PractitionerRole 对象
|
||||
List<PractitionerRole> practitionerRoleList = practitionerRoleMapper.selectList(queryWrapper);
|
||||
|
||||
// 使用 Stream 提取 orgId 字段
|
||||
List<Long> orgIds = practitionerRoleList.stream().map(PractitionerRole::getOrgId) // 提取 orgId 字段
|
||||
.collect(Collectors.toList()); // 收集到 List 中
|
||||
// 返回科室ID的集合
|
||||
return orgIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参与者Id,查询其权限下所有位置id
|
||||
*
|
||||
* @param practitionerId 参与者Id
|
||||
* @return 位置ID的集合
|
||||
*/
|
||||
@Override
|
||||
public List<Long> getLocationIdsByPractitionerId(Long practitionerId) {
|
||||
// 创建查询条件
|
||||
LambdaQueryWrapper<PractitionerRole> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PractitionerRole::getPractitionerId, practitionerId); // 条件:practitionerId 等于指定值
|
||||
|
||||
// 使用 selectList 方法查询所有符合条件的 PractitionerRole 对象
|
||||
List<PractitionerRole> practitionerRoleList = practitionerRoleMapper.selectList(queryWrapper);
|
||||
|
||||
// 使用 Stream 提取 locationId 字段
|
||||
List<Long> locationIds = practitionerRoleList.stream().map(PractitionerRole::getLocationId) // 提取 locationId 字段
|
||||
.collect(Collectors.toList()); // 收集到 List 中
|
||||
// 返回位置ID的集合
|
||||
return locationIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据科室Id,查询医生列表
|
||||
*
|
||||
* @return 医生列表
|
||||
*/
|
||||
@Override
|
||||
public List<PractitionerRole> getDoctorList(Long orgId) {
|
||||
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<PractitionerRole>()
|
||||
.select(PractitionerRole::getPractitionerId, PractitionerRole::getName)
|
||||
.eq(PractitionerRole::getOrgId, orgId)
|
||||
// 身份类型是医生
|
||||
.eq(PractitionerRole::getRoleCode, PractitionerRoles.DOCTOR.getCode()));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据科室Id,查询护士列表
|
||||
*
|
||||
* @return 护士列表
|
||||
*/
|
||||
@Override
|
||||
public List<PractitionerRole> getNurseList(Long orgId) {
|
||||
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<PractitionerRole>()
|
||||
.select(PractitionerRole::getPractitionerId, PractitionerRole::getName)
|
||||
.eq(PractitionerRole::getOrgId, orgId)
|
||||
// 身份类型是护士
|
||||
.eq(PractitionerRole::getRoleCode, PractitionerRoles.NURSE.getCode()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.openhis.administration.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -57,6 +59,21 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
|
||||
@Override
|
||||
public List<Supplier> getList() {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<Supplier>().select(Supplier::getId, Supplier::getName)
|
||||
.eq(Supplier::getTypeEnum, SupplierType.ACTIVE.getValue()));
|
||||
.eq(Supplier::getTypeEnum, SupplierType.ACTIVE.getValue())
|
||||
.eq(Supplier::getDeleteFlag, DelFlag.NO.getCode()).eq(Supplier::getActiveFlag, Whether.YES.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供应商信息
|
||||
*
|
||||
* @param name 名字
|
||||
* @param address 地址
|
||||
* @param typeEnum 类型
|
||||
* @return 供应商信息
|
||||
*/
|
||||
@Override
|
||||
public List<Supplier> getsupplierList(String name, String address, Integer typeEnum) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<Supplier>().eq(Supplier::getName, name)
|
||||
.eq(Supplier::getAddress, address).eq(Supplier::getTypeEnum, typeEnum));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,4 +90,9 @@ public class Condition extends HisBaseEntity {
|
||||
/** 诊断定义Id */
|
||||
private Long definitionId;
|
||||
|
||||
/**
|
||||
* 中医标识
|
||||
*/
|
||||
private Integer tcmFlag;
|
||||
|
||||
}
|
||||
|
||||
@@ -52,6 +52,9 @@ public class ConditionDefinition extends HisBaseEntity {
|
||||
/** 医保标记 */
|
||||
private Integer ybFlag;
|
||||
|
||||
/** 特慢病编码(选填) */
|
||||
private String diseaseCode;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ProcedurePerformer extends HisBaseEntity {
|
||||
private String functionCode;
|
||||
|
||||
/** 开始时间 */
|
||||
private Date startTiem;
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private Date endTime;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.openhis.clinical.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@@ -14,4 +15,19 @@ import com.openhis.clinical.domain.Condition;
|
||||
@Repository
|
||||
public interface ConditionMapper extends BaseMapper<Condition> {
|
||||
|
||||
/**
|
||||
* 删除诊断管理
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
*/
|
||||
void deleteByEncounterId(@Param("encounterId") Long encounterId);
|
||||
|
||||
|
||||
/**
|
||||
* 删除中医诊断管理
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
*/
|
||||
void deleteTcmByEncounterId(@Param("encounterId") Long encounterId);
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Encounter;
|
||||
import com.openhis.clinical.domain.AllergyIntolerance;
|
||||
|
||||
/**
|
||||
@@ -11,4 +12,11 @@ import com.openhis.clinical.domain.AllergyIntolerance;
|
||||
*/
|
||||
public interface IAllergyIntoleranceService extends IService<AllergyIntolerance> {
|
||||
|
||||
/**
|
||||
* 更新或者保存过敏与不耐受
|
||||
*
|
||||
* @param allergyIntolerance 过敏与不耐受实体
|
||||
*/
|
||||
boolean saveOrUpdateAllergyIntolerance(AllergyIntolerance allergyIntolerance);
|
||||
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.openhis.clinical.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.openhis.administration.domain.Encounter;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -14,6 +17,32 @@ import com.openhis.clinical.service.IAllergyIntoleranceService;
|
||||
* @date 2025-03-07
|
||||
*/
|
||||
@Service
|
||||
public class AllergyIntoleranceServiceImpl extends ServiceImpl<AllergyIntoleranceMapper, AllergyIntolerance> implements IAllergyIntoleranceService {
|
||||
public class AllergyIntoleranceServiceImpl extends ServiceImpl<AllergyIntoleranceMapper, AllergyIntolerance>
|
||||
implements IAllergyIntoleranceService {
|
||||
|
||||
/**
|
||||
* 更新或者保存过敏与不耐受
|
||||
*
|
||||
* @param allergyIntolerance 过敏与不耐受实体
|
||||
*/
|
||||
@Override
|
||||
public boolean saveOrUpdateAllergyIntolerance(AllergyIntolerance allergyIntolerance) {
|
||||
|
||||
// 创建 LambdaQueryWrapper
|
||||
LambdaQueryWrapper<AllergyIntolerance> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AllergyIntolerance::getId, allergyIntolerance.getId())
|
||||
.eq(AllergyIntolerance::getPatientId, allergyIntolerance.getPatientId());
|
||||
|
||||
// 查询是否存在记录
|
||||
AllergyIntolerance existingEncounter = baseMapper.selectOne(queryWrapper);
|
||||
if (existingEncounter != null) {
|
||||
// 如果记录存在,更新记录
|
||||
allergyIntolerance.setId(existingEncounter.getId()); // 设置主键
|
||||
return baseMapper.updateById(allergyIntolerance) > 0;
|
||||
} else {
|
||||
// 如果记录不存在,插入新记录
|
||||
return baseMapper.insert(allergyIntolerance) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public class ConditionServiceImpl extends ServiceImpl<ConditionMapper, Condition
|
||||
@Override
|
||||
public Long saveConditionByDoctor(Condition condition) {
|
||||
condition.setRecordedDatetime(new Date());
|
||||
condition.setRecorderId(SecurityUtils.getLoginUser().getUserId());
|
||||
condition.setRecorderId(SecurityUtils.getLoginUser().getPractitionerId());// 记录人
|
||||
baseMapper.insert(condition);
|
||||
return condition.getId();
|
||||
}
|
||||
|
||||
@@ -43,5 +43,9 @@ public class Contract extends HisBaseEntity {
|
||||
/** 机构 */
|
||||
private Long orgId;
|
||||
|
||||
/** 是否医保 */
|
||||
private Integer ybFlag;
|
||||
|
||||
/** 医保区划 */
|
||||
private String admVs;
|
||||
}
|
||||
@@ -35,13 +35,13 @@ public class PaymentRecDetail extends HisBaseEntity {
|
||||
private Long reconciliationId;
|
||||
|
||||
/** 付款类型 */
|
||||
private Integer targetEnum;
|
||||
private Integer targetEnum;//暂时没用
|
||||
|
||||
/** 账户 */
|
||||
private Long accountId;
|
||||
|
||||
/** 账户类型 */
|
||||
private Integer accountEnum;
|
||||
private String accountCode;
|
||||
|
||||
/** 支付类型 */
|
||||
private Integer payEnum;
|
||||
@@ -58,10 +58,10 @@ public class PaymentRecDetail extends HisBaseEntity {
|
||||
/** 交款 */
|
||||
private BigDecimal chargeAmount;
|
||||
|
||||
/** 支付平台返回交易号 */
|
||||
/** 支付平台返回交易号 医保批次号*/
|
||||
private String payTransNo;
|
||||
|
||||
/** 支付平台返回交易信息 */
|
||||
/** 支付平台返回交易信息 医保结算ID*/
|
||||
private String payTransText;
|
||||
|
||||
/** 支付平台返回交易时间 */
|
||||
|
||||
@@ -80,7 +80,7 @@ public class PaymentReconciliation extends HisBaseEntity {
|
||||
private Integer printCount;
|
||||
|
||||
/** 合同编码 */
|
||||
private String contractNo;
|
||||
private String contractNo;//2025/05/08李:自付和医保同时付费时只生成一条payment,故此该字段在insert时先为null
|
||||
|
||||
/** 处方号集合 */
|
||||
private String chargeItemIds;
|
||||
@@ -90,4 +90,16 @@ public class PaymentReconciliation extends HisBaseEntity {
|
||||
|
||||
/** 结算时间 */
|
||||
private Date billDate;
|
||||
|
||||
/** 发票编号 */
|
||||
private Long invoiceId;
|
||||
|
||||
/** 关联账户Id */
|
||||
private Long accountId;//2025/05/08李:自付和医保同时付费时只生成一条payment,故此该字段在insert时先为null
|
||||
|
||||
/** 医保结算id */
|
||||
private String ybSettleIds;//记录医保结算id
|
||||
|
||||
/** 医保清算标志 */
|
||||
private Integer ybClearFlag;//默认值0 未清算
|
||||
}
|
||||
@@ -11,4 +11,10 @@ import com.openhis.financial.domain.Contract;
|
||||
*/
|
||||
public interface IContractService extends IService<Contract> {
|
||||
|
||||
/**
|
||||
* 根据医保码找合同信息
|
||||
* @param contractNo 医保码
|
||||
* @return 合同实体
|
||||
*/
|
||||
Contract getByContractNo(String contractNo);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.openhis.financial.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.common.enums.PaymentResult;
|
||||
import com.openhis.financial.domain.PaymentRecDetail;
|
||||
|
||||
/**
|
||||
@@ -11,4 +12,10 @@ import com.openhis.financial.domain.PaymentRecDetail;
|
||||
*/
|
||||
public interface IPaymentRecDetailService extends IService<PaymentRecDetail> {
|
||||
|
||||
/**
|
||||
* 根据paymentId更改结算结果
|
||||
* @param id
|
||||
* @param paid
|
||||
*/
|
||||
void updateResultByPaymentId(Long id, PaymentResult paid);
|
||||
}
|
||||
@@ -1,10 +1,15 @@
|
||||
package com.openhis.financial.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.common.enums.PaymentStatus;
|
||||
import com.openhis.common.enums.ybenums.YbMdtrtCertType;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.financial.model.PaymentResult;
|
||||
import com.openhis.financial.model.PaymentedItemModel;
|
||||
import com.openhis.financial.model.PrePaymentResult;
|
||||
|
||||
/**
|
||||
* 付款管理Service接口
|
||||
*
|
||||
@@ -20,4 +25,21 @@ public interface IPaymentReconciliationService extends IService<PaymentReconcili
|
||||
* @return 收费项目的id列表
|
||||
*/
|
||||
List<Long> getChargeItemIdListByPayment(List<Long> paymentIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新付款状态:退款中
|
||||
*
|
||||
* @param paymentIdList 支付id列表
|
||||
*/
|
||||
void updateRefundingStatus(List<Long> paymentIdList);
|
||||
|
||||
PrePaymentResult prePayment(YbMdtrtCertType ybMdtrtCertType, String busiCardInfo, String contractBusNo,
|
||||
List<PaymentedItemModel> paymentedItemList);
|
||||
|
||||
PaymentResult settle(String payTransNo, YbMdtrtCertType byValue, String busiCardInfo, Integer minpacuntDrugTracCnt,
|
||||
Integer mcsTracCnt);
|
||||
|
||||
void updatePaymentStatusById(Long id, PaymentStatus success);
|
||||
|
||||
void updatePaymentStatusAndSettleIdsById(Long id, PaymentStatus success, List<String> settleId);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.openhis.common.constant.YbCommonConstants;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -15,5 +17,13 @@ import com.openhis.financial.service.IContractService;
|
||||
*/
|
||||
@Service
|
||||
public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> implements IContractService {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param contractNo 医保码
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Contract getByContractNo(String contractNo) {
|
||||
return baseMapper.selectOne(new LambdaUpdateWrapper<Contract>().eq(Contract::getBusNo,contractNo).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.openhis.common.enums.PaymentResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -15,5 +17,8 @@ import com.openhis.financial.service.IPaymentRecDetailService;
|
||||
*/
|
||||
@Service
|
||||
public class PaymentRecDetailServiceImpl extends ServiceImpl<PaymentRecDetailMapper, PaymentRecDetail> implements IPaymentRecDetailService {
|
||||
|
||||
@Override
|
||||
public void updateResultByPaymentId(Long id, PaymentResult paid) {
|
||||
baseMapper.update(new PaymentRecDetail() .setResultEnum(PaymentResult.PAID.getValue()),new LambdaQueryWrapper<PaymentRecDetail>().eq(PaymentRecDetail::getReconciliationId,id));
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,39 @@
|
||||
package com.openhis.financial.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.PaymentStatus;
|
||||
import com.openhis.common.enums.ybenums.YbMdtrtCertType;
|
||||
import com.openhis.common.enums.ybenums.YbMedType;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.financial.mapper.PaymentReconciliationMapper;
|
||||
import com.openhis.financial.model.PaymentResult;
|
||||
import com.openhis.financial.model.PaymentedItemModel;
|
||||
import com.openhis.financial.model.PrePaymentResult;
|
||||
import com.openhis.financial.service.IPaymentReconciliationService;
|
||||
import com.openhis.yb.domain.ClinicSettle;
|
||||
import com.openhis.yb.dto.Clinic2206OrderOutput;
|
||||
import com.openhis.yb.dto.ClinicReg2201Output;
|
||||
import com.openhis.yb.model.Clinic2207OrderModel;
|
||||
import com.openhis.yb.service.YbManager;
|
||||
|
||||
/**
|
||||
* 付款管理Service业务层处理
|
||||
@@ -24,9 +44,12 @@ import com.openhis.financial.service.IPaymentReconciliationService;
|
||||
@Service
|
||||
public class PaymentReconciliationServiceImpl extends ServiceImpl<PaymentReconciliationMapper, PaymentReconciliation>
|
||||
implements IPaymentReconciliationService {
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
@Autowired
|
||||
private PaymentReconciliationMapper paymentReconciliationMapper;
|
||||
@Autowired
|
||||
private YbManager ybManager;
|
||||
|
||||
/**
|
||||
* 根据支付id获取对应收费项目的id列表
|
||||
@@ -49,10 +72,139 @@ public class PaymentReconciliationServiceImpl extends ServiceImpl<PaymentReconci
|
||||
.collect(Collectors.toList());
|
||||
List<Long> chargeItemIds = new ArrayList<>();
|
||||
for (String chargeItemId : chargeItemIdList) {
|
||||
chargeItemIds.addAll(Arrays.stream(chargeItemId.split(CommonConstants.Common.COMMA)).map(Long::parseLong)
|
||||
.collect(Collectors.toList()));
|
||||
if (StringUtils.isNotEmpty(chargeItemId)) {
|
||||
chargeItemIds.addAll(Arrays
|
||||
.stream(
|
||||
chargeItemId.replaceAll("\\[", "").replaceAll("\\]", "").split(CommonConstants.Common.COMMA))
|
||||
.map(Long::parseLong).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
// 将收费项目集合转换成列表
|
||||
return chargeItemIds;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新付款状态:退款中
|
||||
*
|
||||
* @param paymentIdList 支付id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateRefundingStatus(List<Long> paymentIdList) {
|
||||
baseMapper.update(new PaymentReconciliation().setStatusEnum(PaymentStatus.REFUNDING.getValue()),
|
||||
new LambdaUpdateWrapper<PaymentReconciliation>().in(PaymentReconciliation::getId, paymentIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* // 对chargeItem分付款方式 2025/05/23 ChargeItem分完付款方式之后,医保支付的ChargeItem还要分特慢病和普通门诊,特慢病等支付与常规门诊支付传参不一样
|
||||
*/
|
||||
@Override
|
||||
public PrePaymentResult prePayment(YbMdtrtCertType ybMdtrtCertType, String busiCardInfo, String contractBusNo,
|
||||
List<PaymentedItemModel> paymentedItemList) {
|
||||
|
||||
PrePaymentResult prePaymentResult = null;
|
||||
String ybSwitchFlag = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH);
|
||||
if (ybSwitchFlag.equals("0")) {
|
||||
contractBusNo = "0000";
|
||||
}
|
||||
switch (contractBusNo) {
|
||||
case "0000":
|
||||
prePaymentResult = new PrePaymentResult();
|
||||
BigDecimal sumAmount = BigDecimal.ZERO;
|
||||
for (PaymentedItemModel item : paymentedItemList) {
|
||||
sumAmount = sumAmount.add(item.getTotalPrice());
|
||||
}
|
||||
prePaymentResult.setMedfeeSumamt(sumAmount);
|
||||
prePaymentResult.setFulamtOwnpayAmt(sumAmount);
|
||||
prePaymentResult.setPsnPartAmt(sumAmount);
|
||||
prePaymentResult.setPsnCashPay(sumAmount);
|
||||
prePaymentResult.setChrgBchno("0000");
|
||||
break;
|
||||
case "229900":// 吉林省医保
|
||||
case "220199":// 长春市医保
|
||||
Map<String, List<PaymentedItemModel>> collect =
|
||||
paymentedItemList.stream().collect(Collectors.groupingBy(PaymentedItemModel::getMedType));
|
||||
PrePaymentResult result;
|
||||
for (Map.Entry<String, List<PaymentedItemModel>> medTypeKV : collect.entrySet()) {
|
||||
Clinic2206OrderOutput clinic2206OrderOutput = null;
|
||||
ClinicReg2201Output reg2201Output = null;
|
||||
if (!medTypeKV.getKey().equals(YbMedType.GENERAL_OUTPATIENT.getValue()) && "1".equals(
|
||||
SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH))) {
|
||||
// 不是普通门诊就诊类型,补充挂号信息
|
||||
reg2201Output = ybManager.createRegWithMedType(ybMdtrtCertType, busiCardInfo,
|
||||
medTypeKV.getValue().get(0).getEncounterId(),
|
||||
YbMedType.getByValue(medTypeKV.getValue().get(0).getMedType()));
|
||||
reg2201Output.setMedType(medTypeKV.getKey());//2025/06/05慢病挂号后上传2206信息报错,2201返回值没有medType,此处更正赋值
|
||||
} else {
|
||||
// 从数据库里取reg2201
|
||||
reg2201Output =
|
||||
ybManager.getClinicRegByEncounterId(medTypeKV.getValue().get(0).getEncounterId());
|
||||
}
|
||||
// 调用预结算
|
||||
clinic2206OrderOutput = ybManager.preSettle(medTypeKV.getValue().get(0).getEncounterId(),
|
||||
ybMdtrtCertType, busiCardInfo, reg2201Output, "01", medTypeKV.getValue().stream()
|
||||
.map(PaymentedItemModel::getChargeItemId).collect(Collectors.toList()));
|
||||
prePaymentResult = new PrePaymentResult();
|
||||
BeanUtils.copyProperties(clinic2206OrderOutput, prePaymentResult);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return prePaymentResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PaymentResult settle(String payTransNo, YbMdtrtCertType ybMdtrtCertType, String busiCardInfo,
|
||||
Integer minpacuntDrugTracCnt, Integer mcsTracCnt) {
|
||||
PaymentResult paymentResult = null;
|
||||
if (!"0000".equals(payTransNo)) {
|
||||
// 医保支付 todo:支付的详细信息在于结算中已经存好了,但是还没有存储卡余额
|
||||
Clinic2207OrderModel clinic2207OrderModel =
|
||||
ybManager.settle(payTransNo, busiCardInfo, ybMdtrtCertType, minpacuntDrugTracCnt, mcsTracCnt);
|
||||
paymentResult = new PaymentResult();
|
||||
BeanUtils.copyProperties(clinic2207OrderModel, paymentResult);
|
||||
} else {
|
||||
//自费返回new实体
|
||||
paymentResult = new PaymentResult();
|
||||
}
|
||||
return paymentResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePaymentStatusById(Long id, PaymentStatus success) {
|
||||
paymentReconciliationMapper.update(new PaymentReconciliation().setStatusEnum(success.getValue()),
|
||||
new LambdaQueryWrapper<PaymentReconciliation>().eq(PaymentReconciliation::getId, id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePaymentStatusAndSettleIdsById(Long id, PaymentStatus success, List<String> settleId) {
|
||||
if (settleId.isEmpty()) {
|
||||
paymentReconciliationMapper.update(new PaymentReconciliation().setStatusEnum(success.getValue()),
|
||||
new LambdaQueryWrapper<PaymentReconciliation>().eq(PaymentReconciliation::getId, id));
|
||||
} else {
|
||||
paymentReconciliationMapper.update(
|
||||
new PaymentReconciliation().setStatusEnum(success.getValue())
|
||||
.setYbSettleIds(String.join(",", settleId)),
|
||||
new LambdaQueryWrapper<PaymentReconciliation>().eq(PaymentReconciliation::getId, id));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化一个医保结算信息
|
||||
*
|
||||
* @return 预结算的参数
|
||||
*/
|
||||
private ClinicSettle initClinic2206OrderResult() {
|
||||
ClinicSettle clinicSettle = new ClinicSettle();
|
||||
return clinicSettle.setMedfeeSumamt(new BigDecimal("0.0")).setFulamtOwnpayAmt(new BigDecimal("0.0"))
|
||||
.setOverlmtSelfpay(new BigDecimal("0.0")).setPreselfpayAmt(new BigDecimal("0.0"))
|
||||
.setInscpScpAmt(new BigDecimal("0.0")).setActPayDedc(new BigDecimal("0.0"))
|
||||
.setHifpPay(new BigDecimal("0.0")).setPoolPropSelfpay(new BigDecimal("0.0"))
|
||||
.setCvlservPay(new BigDecimal("0.0")).setHifesPay(new BigDecimal("0.0")).setHifmiPay(new BigDecimal("0.0"))
|
||||
.setHifobPay(new BigDecimal("0.00")).setMafPay(new BigDecimal("0.0")).setOthPay(new BigDecimal("0.0"))
|
||||
.setFundPaySumamt(new BigDecimal("0.0")).setPsnPartAmt(new BigDecimal("0.0"))
|
||||
.setAcctPay(new BigDecimal("0.0")).setPsnCashPay(new BigDecimal("0.0"))
|
||||
.setHospPartAmt(new BigDecimal("0.0")).setBalc(new BigDecimal("0.0"))
|
||||
.setAcctMulaidPay(new BigDecimal("0.0")).setHifdmPay(new BigDecimal("0.0"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Medication extends HisBaseEntity {
|
||||
private Long medicationDefId;
|
||||
|
||||
/** 药品状态 */
|
||||
private PublicationStatus statusEnum;
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 所属科室 */
|
||||
private Long orgId;
|
||||
|
||||
@@ -159,4 +159,13 @@ public class MedicationDefinition extends HisBaseEntity {
|
||||
/** 住院临时医嘱拆分属性 */
|
||||
private Integer thoPartAttributeEnum;
|
||||
|
||||
/** 剂量单位换算比 */
|
||||
private BigDecimal unitConversionRatio;
|
||||
|
||||
/** 医保等级 */
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 处方标志 */
|
||||
private Integer rxFlag;
|
||||
|
||||
}
|
||||
@@ -14,6 +14,8 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 药品信息详情
|
||||
*
|
||||
@@ -200,4 +202,11 @@ public class MedicationDetail extends HisBaseEntity {
|
||||
private BigDecimal usageLimit;
|
||||
/** 住院临时医嘱拆分属性 */
|
||||
private Integer thoPartAttributeEnum;
|
||||
/** 剂量单位换算比 */
|
||||
private BigDecimal unitConversionRatio;
|
||||
/** 医保等级 */
|
||||
private Integer chrgitmLv;
|
||||
/** 处方标志 */
|
||||
private Integer rxFlag;
|
||||
|
||||
}
|
||||
|
||||
@@ -73,6 +73,9 @@ public class MedicationDispense extends HisBaseEntity {
|
||||
/** 发药频次 */
|
||||
private String dispenseFrequencyCode;
|
||||
|
||||
/** 配药人 */
|
||||
private Long preparerId;
|
||||
|
||||
/** 配药时间 */
|
||||
private Date prepareTime;
|
||||
|
||||
@@ -114,4 +117,7 @@ public class MedicationDispense extends HisBaseEntity {
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
}
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
}
|
||||
|
||||
@@ -101,6 +101,11 @@ public class MedicationRequest extends HisBaseEntity {
|
||||
*/
|
||||
private Long conditionId;
|
||||
|
||||
/**
|
||||
* 就诊诊断id
|
||||
*/
|
||||
private Long encounterDiagnosisId;
|
||||
|
||||
/** 支持用药信息 */
|
||||
private String supportInfo;
|
||||
|
||||
@@ -179,4 +184,38 @@ public class MedicationRequest extends HisBaseEntity {
|
||||
/** 输液速度 */
|
||||
private Integer speed;
|
||||
|
||||
}
|
||||
/** 退药id */
|
||||
private Long refundMedicineId;
|
||||
|
||||
/** 处方类别 */
|
||||
private String rxTypeCode;
|
||||
|
||||
/**
|
||||
* 请求内容json
|
||||
*/
|
||||
private String contentJson;
|
||||
|
||||
/**
|
||||
* 类别医保编码
|
||||
*/
|
||||
private Integer ybClassEnum;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/**
|
||||
* 中药付数
|
||||
*/
|
||||
private Integer chineseHerbsDoseQuantity;
|
||||
|
||||
/**
|
||||
* 代煎标识 | 0:否 , 1:是
|
||||
*/
|
||||
private Integer sufferingFlag;
|
||||
|
||||
/**
|
||||
* 中医标识
|
||||
*/
|
||||
private Integer tcmFlag;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.openhis.medication.service;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
|
||||
@@ -15,11 +16,19 @@ import com.openhis.medication.domain.MedicationRequest;
|
||||
public interface IMedicationDispenseService extends IService<MedicationDispense> {
|
||||
|
||||
/**
|
||||
* 新增草稿状态的药品发放信息
|
||||
* 处理药品发放信息
|
||||
*
|
||||
* @param medicationRequestList 药品请求信息
|
||||
* @param medicationRequest 药品请求信息
|
||||
* @param dbOpType db操作类型
|
||||
*/
|
||||
void addMedicationDispense(List<MedicationRequest> medicationRequestList);
|
||||
void handleMedicationDispense(MedicationRequest medicationRequest, String dbOpType);
|
||||
|
||||
/**
|
||||
* 删除药品发放信息
|
||||
*
|
||||
* @param medReqId 药品请求id
|
||||
*/
|
||||
void deleteMedicationDispense(Long medReqId);
|
||||
|
||||
/**
|
||||
* 更新未发放药品状态:停止发放
|
||||
@@ -28,4 +37,26 @@ public interface IMedicationDispenseService extends IService<MedicationDispense>
|
||||
* @param refund 停止原因:退费
|
||||
*/
|
||||
void updateStopDispenseStatus(List<Long> medDisIdList, Integer refund);
|
||||
|
||||
/**
|
||||
* 更新药品状态:待配药
|
||||
*
|
||||
* @param medicationRequestIdList 请求id列表
|
||||
*/
|
||||
void updatePreparationDispenseStatus(List<Long> medicationRequestIdList);
|
||||
|
||||
/**
|
||||
* 更新药品状态:暂停
|
||||
*
|
||||
* @param medReqIdList 请求id列表
|
||||
*/
|
||||
void updateOnHoldDispenseStatus(List<Long> medReqIdList);
|
||||
|
||||
/**
|
||||
* 验证是否发过药
|
||||
*
|
||||
* @param medicationDefId 药品定义id
|
||||
* @return 验证结果
|
||||
*/
|
||||
boolean verifyAbleEdit(Long medicationDefId);
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.openhis.medication.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
|
||||
@@ -11,4 +13,19 @@ import com.openhis.medication.domain.MedicationRequest;
|
||||
*/
|
||||
public interface IMedicationRequestService extends IService<MedicationRequest> {
|
||||
|
||||
}
|
||||
/**
|
||||
* 更新请求状态:已完成
|
||||
*
|
||||
* @param requestIdList 药品请求id列表
|
||||
*/
|
||||
void updateCompletedStatusBatch(List<Long> requestIdList);
|
||||
|
||||
/**
|
||||
* 更新请求状态:待发送
|
||||
*
|
||||
* @param requestIdList 药品请求id列表
|
||||
*/
|
||||
void updateDraftStatusBatch(List<Long> requestIdList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -50,6 +50,8 @@ public class MedicationDefinitionServiceImpl extends ServiceImpl<MedicationDefin
|
||||
}
|
||||
// 新增药品目录
|
||||
int insert = medicationDefinitionMapper.insert(medicationDefinition);
|
||||
medicationDetail.setId(medicationDefinition.getId());
|
||||
|
||||
if (insert != 1) {
|
||||
return false;
|
||||
}
|
||||
@@ -60,5 +62,4 @@ public class MedicationDefinitionServiceImpl extends ServiceImpl<MedicationDefin
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,11 +2,18 @@ package com.openhis.medication.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.DbOpType;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
@@ -23,59 +30,77 @@ import com.openhis.medication.service.IMedicationDispenseService;
|
||||
public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispenseMapper, MedicationDispense>
|
||||
implements IMedicationDispenseService {
|
||||
|
||||
@Resource
|
||||
AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 新增草稿状态的药品发放信息
|
||||
* 处理药品发放信息
|
||||
*
|
||||
* @param medicationRequestList 药品请求信息
|
||||
* @param medicationRequest 药品请求信息
|
||||
* @param dbOpType db操作类型
|
||||
*/
|
||||
@Override
|
||||
public void addMedicationDispense(List<MedicationRequest> medicationRequestList) {
|
||||
for (MedicationRequest medicationRequest : medicationRequestList) {
|
||||
MedicationDispense medicationDispense = new MedicationDispense();
|
||||
// 药品发放id
|
||||
medicationDispense.setBusNo(medicationRequest.getBusNo());
|
||||
// 药品发放状态
|
||||
medicationDispense.setStatusEnum(DispenseStatus.DRAFT.getValue());
|
||||
// 状态变更时间
|
||||
medicationDispense.setStatusChangedTime(DateUtils.getNowDate());
|
||||
// 发药类型
|
||||
medicationDispense.setDispenseEnum(medicationRequest.getCategoryEnum());
|
||||
// 药品编码
|
||||
medicationDispense.setMedicationId(medicationRequest.getMedicationId());
|
||||
// 请求数量
|
||||
medicationDispense.setQuantity(medicationRequest.getQuantity());
|
||||
// 请求单位编码
|
||||
medicationDispense.setUnitCode(medicationRequest.getUnitCode());
|
||||
// 产品批号
|
||||
medicationDispense.setLotNumber(medicationRequest.getLotNumber());
|
||||
// 患者id
|
||||
medicationDispense.setPatientId(medicationRequest.getPatientId());
|
||||
// 就诊id
|
||||
medicationDispense.setEncounterId(medicationRequest.getEncounterId());
|
||||
// 支持用药信息
|
||||
medicationDispense.setSupportInfo(medicationRequest.getSupportInfo());
|
||||
// 发药人
|
||||
medicationDispense.setPractitionerId(medicationRequest.getPractitionerId());
|
||||
// 发放药房
|
||||
medicationDispense.setLocationId(medicationRequest.getPerformOrg());
|
||||
// 药品请求id
|
||||
medicationDispense.setMedReqId(medicationRequest.getId());
|
||||
// 已发药数量
|
||||
medicationDispense.setDispenseQuantity(0);
|
||||
// 用法
|
||||
medicationDispense.setMethodCode(medicationRequest.getMethodCode());
|
||||
// 用药频次
|
||||
medicationDispense.setFrequencyCode(medicationRequest.getRateCode());
|
||||
// 单次剂量
|
||||
medicationDispense.setDose(medicationRequest.getDose());
|
||||
// 剂量单位
|
||||
medicationDispense.setDoseUnitCode(medicationRequest.getDoseUnitCode());
|
||||
// 单次最大剂量
|
||||
medicationDispense.setMaxUnit(medicationRequest.getMaxDose());
|
||||
public void handleMedicationDispense(MedicationRequest medicationRequest, String dbOpType) {
|
||||
MedicationDispense medicationDispense = new MedicationDispense();
|
||||
// 药品发放id
|
||||
medicationDispense.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 10));
|
||||
// 药品发放状态
|
||||
medicationDispense.setStatusEnum(DispenseStatus.DRAFT.getValue());
|
||||
// 状态变更时间
|
||||
medicationDispense.setStatusChangedTime(DateUtils.getNowDate());
|
||||
// 发药类型
|
||||
medicationDispense.setDispenseEnum(medicationRequest.getCategoryEnum());
|
||||
// 药品编码
|
||||
medicationDispense.setMedicationId(medicationRequest.getMedicationId());
|
||||
// 请求数量
|
||||
medicationDispense.setQuantity(medicationRequest.getQuantity());
|
||||
// 请求单位编码
|
||||
medicationDispense.setUnitCode(medicationRequest.getUnitCode());
|
||||
// 产品批号
|
||||
medicationDispense.setLotNumber(medicationRequest.getLotNumber());
|
||||
// 患者id
|
||||
medicationDispense.setPatientId(medicationRequest.getPatientId());
|
||||
// 就诊id
|
||||
medicationDispense.setEncounterId(medicationRequest.getEncounterId());
|
||||
// 支持用药信息
|
||||
medicationDispense.setSupportInfo(medicationRequest.getSupportInfo());
|
||||
// 发药人
|
||||
medicationDispense.setPractitionerId(medicationRequest.getPractitionerId());
|
||||
// 发放药房
|
||||
medicationDispense.setLocationId(medicationRequest.getPerformLocation());
|
||||
// 药品请求id
|
||||
medicationDispense.setMedReqId(medicationRequest.getId());
|
||||
// 已发药数量
|
||||
medicationDispense.setDispenseQuantity(0);
|
||||
// 用法
|
||||
medicationDispense.setMethodCode(medicationRequest.getMethodCode());
|
||||
// 用药频次
|
||||
medicationDispense.setFrequencyCode(medicationRequest.getRateCode());
|
||||
// 单次剂量
|
||||
medicationDispense.setDose(medicationRequest.getDose());
|
||||
// 剂量单位
|
||||
medicationDispense.setDoseUnitCode(medicationRequest.getDoseUnitCode());
|
||||
// 单次最大剂量
|
||||
medicationDispense.setMaxUnit(medicationRequest.getMaxDose());
|
||||
|
||||
if (DbOpType.INSERT.getCode().equals(dbOpType)) {
|
||||
baseMapper.insert(medicationDispense);
|
||||
} else if (DbOpType.UPDATE.getCode().equals(dbOpType)) {
|
||||
baseMapper.update(medicationDispense, new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.eq(MedicationDispense::getMedReqId, medicationRequest.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除药品发放信息
|
||||
*
|
||||
* @param medReqId 药品请求id
|
||||
*/
|
||||
@Override
|
||||
public void deleteMedicationDispense(Long medReqId) {
|
||||
baseMapper.delete(new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getMedReqId, medReqId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新未发放药品状态:停止发放
|
||||
*
|
||||
@@ -88,4 +113,47 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
new MedicationDispense().setStatusEnum(DispenseStatus.STOPPED.getValue()).setNotPerformedReasonEnum(refund),
|
||||
new LambdaUpdateWrapper<MedicationDispense>().in(MedicationDispense::getId, medDisIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新药品状态:待配药
|
||||
*
|
||||
* @param medicationRequestIdList 请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updatePreparationDispenseStatus(List<Long> medicationRequestIdList) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.set(MedicationDispense::getStatusChangedTime, DateUtils.getNowDate())
|
||||
.in(MedicationDispense::getMedReqId, medicationRequestIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新药品状态:暂停
|
||||
*
|
||||
* @param medReqIdList 请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateOnHoldDispenseStatus(List<Long> medReqIdList) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.ON_HOLD.getValue())
|
||||
.set(MedicationDispense::getStatusChangedTime, DateUtils.getNowDate())
|
||||
.in(MedicationDispense::getMedReqId, medReqIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证是否发过药
|
||||
*
|
||||
* @param medicationDefId 药品定义id
|
||||
* @return 验证结果
|
||||
*/
|
||||
@Override
|
||||
public boolean verifyAbleEdit(Long medicationDefId) {
|
||||
return baseMapper.exists(
|
||||
new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getMedicationId, medicationDefId)
|
||||
.and(q -> q.eq(MedicationDispense::getStatusEnum, DispenseStatus.COMPLETED.getValue()).or()
|
||||
.eq(MedicationDispense::getStatusEnum, DispenseStatus.REFUNDED.getValue()))
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.openhis.medication.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.medication.mapper.MedicationRequestMapper;
|
||||
import com.openhis.medication.service.IMedicationRequestService;
|
||||
@@ -14,6 +18,29 @@ import com.openhis.medication.service.IMedicationRequestService;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class MedicationRequestServiceImpl extends ServiceImpl<MedicationRequestMapper, MedicationRequest> implements IMedicationRequestService {
|
||||
public class MedicationRequestServiceImpl extends ServiceImpl<MedicationRequestMapper, MedicationRequest>
|
||||
implements IMedicationRequestService {
|
||||
|
||||
}
|
||||
/**
|
||||
* 更新请求状态:已完成
|
||||
*
|
||||
* @param requestIdList 药品请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateCompletedStatusBatch(List<Long> requestIdList) {
|
||||
baseMapper.update(new MedicationRequest().setStatusEnum(RequestStatus.COMPLETED.getValue()),
|
||||
new LambdaUpdateWrapper<MedicationRequest>().in(MedicationRequest::getId, requestIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新请求状态:待发送
|
||||
*
|
||||
* @param requestIdList 药品请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateDraftStatusBatch(List<Long> requestIdList) {
|
||||
baseMapper.update(null, new LambdaUpdateWrapper<MedicationRequest>().in(MedicationRequest::getId, requestIdList)
|
||||
.set(MedicationRequest::getStatusEnum, RequestStatus.DRAFT.getValue()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -76,4 +76,12 @@ public class ActivityDefinition extends HisBaseEntity {
|
||||
/** 规则id */
|
||||
private Integer ruleId;
|
||||
|
||||
/** 医保等级 */
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 子项json */
|
||||
private String childrenJson;
|
||||
|
||||
/** 划价标记 */
|
||||
private Integer pricingFlag;
|
||||
}
|
||||
@@ -1,17 +1,15 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 器材发放管理Entity实体
|
||||
*
|
||||
@@ -32,11 +30,17 @@ public class DeviceDispense extends HisBaseEntity {
|
||||
private String busNo;
|
||||
|
||||
/** 器材请求id */
|
||||
private String deviceReqId;
|
||||
private Long deviceReqId;
|
||||
|
||||
/** 器材发放状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 请求基于什么 */
|
||||
private String basedOnTable;
|
||||
|
||||
/** 请求基于什么的ID */
|
||||
private Long basedOnId;
|
||||
|
||||
/** 未发药原因 */
|
||||
private Integer notPerformedReasonEnum;
|
||||
|
||||
@@ -97,5 +101,7 @@ public class DeviceDispense extends HisBaseEntity {
|
||||
/** 使用说明 */
|
||||
private String usageInstruction;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,9 @@ public class DeviceRequest extends HisBaseEntity {
|
||||
/** 是否停止执行 */
|
||||
private Integer performFlag;
|
||||
|
||||
/** 分组编号 */
|
||||
private String groupNo;
|
||||
|
||||
/** 器材类型 */
|
||||
private String deviceTypeCode;
|
||||
|
||||
@@ -136,4 +139,30 @@ public class DeviceRequest extends HisBaseEntity {
|
||||
/** 支持用药信息 */
|
||||
private String supportInfo;
|
||||
|
||||
}
|
||||
/** 退药id */
|
||||
private Long refundDeviceId;
|
||||
|
||||
/**
|
||||
* 请求内容json
|
||||
*/
|
||||
private String contentJson;
|
||||
|
||||
/**
|
||||
* 类别医保编码
|
||||
*/
|
||||
private Integer ybClassEnum;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/**
|
||||
* 诊断id
|
||||
*/
|
||||
private Long conditionId;
|
||||
|
||||
/**
|
||||
* 就诊诊断id
|
||||
*/
|
||||
private Long encounterDiagnosisId;
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ 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.PublicationStatus;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -29,7 +30,7 @@ public class InventoryItem extends HisBaseEntity {
|
||||
private Long id;
|
||||
|
||||
/** 物品类别 */
|
||||
private Integer categoryEnum;
|
||||
private String categoryCode;
|
||||
|
||||
/** 项目 */
|
||||
private String itemTable;
|
||||
@@ -55,17 +56,11 @@ public class InventoryItem extends HisBaseEntity {
|
||||
/** 说明书 */
|
||||
private String descriptionText;
|
||||
|
||||
/** 常规单位 */
|
||||
private String baseUnitCode;
|
||||
|
||||
/** 当前库存数量(常规单位) */
|
||||
private BigDecimal baseQuantity;
|
||||
|
||||
/** 最小单位 */
|
||||
private String minUnitCode;
|
||||
private String unitCode;
|
||||
|
||||
/** 当前库存数量(最小单位数量) */
|
||||
private BigDecimal minQuantity;
|
||||
/** 当前库存数量(最小单位) */
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 特征 */
|
||||
private String characteristicJson;
|
||||
@@ -94,4 +89,12 @@ public class InventoryItem extends HisBaseEntity {
|
||||
/** 追溯码包装层级 */
|
||||
private Integer packagingLevels;
|
||||
|
||||
/** 采购单价(包装单位) */
|
||||
private BigDecimal price;
|
||||
|
||||
public InventoryItem() {
|
||||
// 库存状态:启用
|
||||
this.inventoryStatusEnum = PublicationStatus.ACTIVE.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
@@ -52,6 +51,9 @@ public class ServiceRequest extends HisBaseEntity {
|
||||
/** 请求类型 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 分组编号 */
|
||||
private Long groupId;
|
||||
|
||||
/** 优先权 */
|
||||
private Integer priorityEnum;
|
||||
|
||||
@@ -91,6 +93,11 @@ public class ServiceRequest extends HisBaseEntity {
|
||||
/** 执行位置 */
|
||||
private Long locationId;
|
||||
|
||||
/**
|
||||
* 执行科室
|
||||
*/
|
||||
private Long orgId;
|
||||
|
||||
/** 理由 */
|
||||
private String reasonText;
|
||||
|
||||
@@ -106,4 +113,32 @@ public class ServiceRequest extends HisBaseEntity {
|
||||
/** 历史请求 */
|
||||
private Long relevantHistoryId;
|
||||
|
||||
}
|
||||
/** 取消服务id */
|
||||
private Long refundServiceId;
|
||||
|
||||
/**
|
||||
* 请求内容json
|
||||
*/
|
||||
private String contentJson;
|
||||
|
||||
/**
|
||||
* 类别医保编码
|
||||
*/
|
||||
private Integer ybClassEnum;
|
||||
|
||||
/**
|
||||
* 打印次数
|
||||
*/
|
||||
private Integer printCount;
|
||||
|
||||
/**
|
||||
* 诊断id
|
||||
*/
|
||||
private Long conditionId;
|
||||
|
||||
/**
|
||||
* 就诊诊断id
|
||||
*/
|
||||
private Long encounterDiagnosisId;
|
||||
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class SupplyDelivery extends HisBaseEntity {
|
||||
private Long itemId;
|
||||
|
||||
/** 计量单位 */
|
||||
private String unitIdCode;
|
||||
private String unitCode;
|
||||
|
||||
/** 数量 */
|
||||
private BigDecimal quantity;
|
||||
@@ -94,6 +94,6 @@ public class SupplyDelivery extends HisBaseEntity {
|
||||
// 默认发放状态:进行中
|
||||
this.statusEnum = EventStatus.IN_PROGRESS.getValue();
|
||||
// 默认发放类型:
|
||||
this.typeEnum = SupplyType.PRODUCT_ALLOCATION.getValue();
|
||||
this.typeEnum = SupplyType.PRODUCT_TRANSFER.getValue();
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.openhis.common.enums.ActPriority;
|
||||
import com.openhis.common.enums.SupplyCategory;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -35,6 +34,9 @@ public class SupplyRequest extends HisBaseEntity {
|
||||
/** 单据号 */
|
||||
private String busNo;
|
||||
|
||||
/** 原始单据号 */
|
||||
private String originalBusNo;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
@@ -140,15 +142,10 @@ public class SupplyRequest extends HisBaseEntity {
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 售价 */
|
||||
private BigDecimal sellPrice;
|
||||
|
||||
/** 拆零售价 */
|
||||
private BigDecimal minSellPrice;
|
||||
/** 备注 */
|
||||
private String remake;
|
||||
|
||||
public SupplyRequest() {
|
||||
// 默认单据类型:商品调拨
|
||||
this.typeEnum = SupplyType.PRODUCT_ALLOCATION.getValue();
|
||||
// 默认单据状态:待审核
|
||||
this.statusEnum = SupplyStatus.PENDING_APPROVAL.getValue();
|
||||
// 默认单据分类:库存供应
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@@ -14,4 +15,13 @@ import com.openhis.workflow.domain.ActivityDefinition;
|
||||
@Repository
|
||||
public interface ActivityDefinitionMapper extends BaseMapper<ActivityDefinition> {
|
||||
|
||||
/**
|
||||
* 查询指定诊疗的-诊疗定义id
|
||||
*
|
||||
* @param activityName 诊疗名称
|
||||
* @return 诊疗定义id
|
||||
*/
|
||||
Long getAppointActivityDefinitionId(@Param("skinTestInspection") String skinTestInspection,
|
||||
@Param("status") Integer status);
|
||||
|
||||
}
|
||||
@@ -26,4 +26,13 @@ public interface IActivityDefinitionService extends IService<ActivityDefinition>
|
||||
* @return
|
||||
*/
|
||||
boolean addYbDiagnosisTreatment(ActivityDefinition activityDefinition);
|
||||
|
||||
/**
|
||||
* 查询指定诊疗的-诊疗定义id
|
||||
*
|
||||
* @param activityName 诊疗名称
|
||||
* @return 皮试检查-诊疗定义id
|
||||
*/
|
||||
Long getAppointActivityDefinitionId(String activityName);
|
||||
|
||||
}
|
||||
@@ -1,9 +1,15 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
|
||||
/**
|
||||
* 器材发放管理Service接口
|
||||
@@ -13,6 +19,21 @@ import com.openhis.workflow.domain.DeviceDispense;
|
||||
*/
|
||||
public interface IDeviceDispenseService extends IService<DeviceDispense> {
|
||||
|
||||
/**
|
||||
* 处理器材发放信息
|
||||
*
|
||||
* @param deviceRequest 器材请求信息
|
||||
* @param dbOpType db操作类型
|
||||
*/
|
||||
void handleDeviceDispense(DeviceRequest deviceRequest, String dbOpType);
|
||||
|
||||
/**
|
||||
* 删除器材发放信息
|
||||
*
|
||||
* @param deviceReqId 器材请求id
|
||||
*/
|
||||
void deleteDeviceDispense(Long deviceReqId);
|
||||
|
||||
/**
|
||||
* 更新未发放耗材状态:停止发放
|
||||
*
|
||||
@@ -20,4 +41,64 @@ public interface IDeviceDispenseService extends IService<DeviceDispense> {
|
||||
* @param refund 停止原因:退费
|
||||
*/
|
||||
void updateStopDispenseStatus(List<Long> devDisIdList, Integer refund);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取执行过的器材数据
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
*/
|
||||
List<DeviceDispense> selectDeviceDispenseByBasedOnId(Long basedOnId);
|
||||
|
||||
/**
|
||||
* 执行器材发放
|
||||
*
|
||||
* @param deviceDispense 器材发放信息
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
* @param step 执行次数
|
||||
* @param quantity 发药数量
|
||||
*/
|
||||
DeviceDispense createCompletedDeviceDispense(DeviceDispense deviceDispense, Date now, Practitioner loginUser,
|
||||
String step, Integer quantity);
|
||||
|
||||
/**
|
||||
* 器材发放状态:已发药
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean completedStatusEnum(Long id, Date now, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 器材发放状态:撤回
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean cancelledStatusEnum(Long id, Date now, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 器材发放状态:待发药
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean inProgressStatusEnum(Long id, Date now, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 更新耗材状态:待配药
|
||||
*
|
||||
* @param deviceRequestIdList 请求id列表
|
||||
*/
|
||||
void updatePreparationDispenseStatus(List<Long> deviceRequestIdList);
|
||||
|
||||
/**
|
||||
* 更新耗材状态:暂停
|
||||
*
|
||||
* @param devReqIdList 请求id列表
|
||||
*/
|
||||
void updateOnHoldDispenseStatus(List<Long> devReqIdList);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 器材请求管理Service接口
|
||||
*
|
||||
@@ -11,4 +16,33 @@ import com.openhis.workflow.domain.DeviceRequest;
|
||||
*/
|
||||
public interface IDeviceRequestService extends IService<DeviceRequest> {
|
||||
|
||||
/**
|
||||
* 器材请求状态:已完成
|
||||
*
|
||||
* @param id ID
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean completedStatusEnum(Long id, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 服务申请状态:已发送
|
||||
*
|
||||
* @param id ID
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean activeStatusEnum(Long id, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 更新请求状态:已完成
|
||||
*
|
||||
* @param devRequestIdList 耗材请求id列表
|
||||
*/
|
||||
void updateCompletedStatusBatch(List<Long> devRequestIdList);
|
||||
|
||||
/**
|
||||
* 更新请求状态:待发送
|
||||
*
|
||||
* @param devReqIdList 耗材请求id列表
|
||||
*/
|
||||
void updateDraftStatusBatch(List<Long> devReqIdList);
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
|
||||
/**
|
||||
* 库存项目管理Service接口
|
||||
*
|
||||
@@ -29,20 +28,20 @@ public interface IInventoryItemService extends IService<InventoryItem> {
|
||||
* @param id 主键
|
||||
* @param baseQuantity 常规单位库存数量
|
||||
* @param minQuantity 最小单位库存数量
|
||||
* @param loginUser 登录用户信息
|
||||
* @param now 当前时间
|
||||
* @return 更新件数
|
||||
*/
|
||||
Boolean updateInventoryQuantity(Long id, BigDecimal baseQuantity, BigDecimal minQuantity, LoginUser loginUser, Date now);
|
||||
Boolean updateInventoryQuantity(Long id, BigDecimal baseQuantity, BigDecimal minQuantity, Date now);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param itemId 项目编号
|
||||
* @param lotNumber 产品批号
|
||||
* @param locationId 仓库
|
||||
* @param locationStoreId 库位
|
||||
* @param tenantId 租户id
|
||||
* @return 单据详情
|
||||
*/
|
||||
InventoryItem selectInventoryByLotNumber(String lotNumber, Long locationId, Long locationStoreId);
|
||||
List<InventoryItem> selectInventoryByItemId(Long itemId, String lotNumber, Long locationId,Integer tenantId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
* 服务申请管理Service接口
|
||||
@@ -23,8 +30,79 @@ public interface IServiceRequestService extends IService<ServiceRequest> {
|
||||
|
||||
/**
|
||||
* 更新执行诊疗状态:停止
|
||||
*
|
||||
*
|
||||
* @param serReqIdList 服务请求id列表
|
||||
*/
|
||||
void updateStopRequestStatus(List<Long> serReqIdList);
|
||||
|
||||
/**
|
||||
* 获取执行过的诊疗数据
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
*/
|
||||
List<ServiceRequest> selectServiceRequestByBasedOnId(Long basedOnId);
|
||||
|
||||
/**
|
||||
* 执行诊疗
|
||||
*
|
||||
* @param serviceRequest 服务申请信息
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
* @param step 执行次数
|
||||
*/
|
||||
ServiceRequest createCompletedServiceRequest(ServiceRequest serviceRequest, Date now, Practitioner loginUser,
|
||||
String step);
|
||||
|
||||
/**
|
||||
* 服务申请状态:已完成
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean completedStatusEnum(Long id, Date now, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 更新服务申请状态:取消
|
||||
*
|
||||
* @param serviceReqId 服务请求id
|
||||
* @param now 更新时间
|
||||
* @param practitionerId 执行人
|
||||
* @param orgId 执行科室
|
||||
* @return 更新结果
|
||||
*/
|
||||
boolean updateCancelledStatus(Long serviceReqId, Date now, Long practitionerId,Long orgId);
|
||||
|
||||
/**
|
||||
* 服务申请状态:已发送
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean activeStatusEnum(Long id, Date now, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 更新服务状态:待执行
|
||||
*
|
||||
* @param serviceRequestIdList 请求id列表
|
||||
*/
|
||||
void updatePreparationStatus(List<Long> serviceRequestIdList);
|
||||
|
||||
/**
|
||||
* 更新服务状态:待发送
|
||||
*
|
||||
* @param serReqIdList 请求id列表
|
||||
*/
|
||||
void updateDraftStatusBatch(List<Long> serReqIdList);
|
||||
|
||||
/**
|
||||
* 更新服务申请里的打印次数字段
|
||||
*
|
||||
* @param id 服务申请id
|
||||
* @param num 打印次数
|
||||
* @return 更新结果
|
||||
*/
|
||||
void updateCountPint(Long id,Integer num);
|
||||
|
||||
}
|
||||
@@ -24,4 +24,11 @@ public interface ISupplyDeliveryService extends IService<SupplyDelivery> {
|
||||
* @param now 当前时间
|
||||
*/
|
||||
List<SupplyDelivery> createCompletedSupplyDelivery(List<SupplyRequest> supplyRequestList, Date now);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过)
|
||||
*
|
||||
* @param supplyReqIdList 供应申请id列表
|
||||
*/
|
||||
boolean supplyDeliveryValidation(List<Long> supplyReqIdList);
|
||||
}
|
||||
|
||||
@@ -25,17 +25,16 @@ public interface ISupplyRequestService extends IService<SupplyRequest> {
|
||||
|
||||
/**
|
||||
* 同意申请
|
||||
*
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param loginUser 登录用户信息
|
||||
* @param now 当前时间
|
||||
* @return 单据详情
|
||||
*/
|
||||
List<SupplyRequest> agreeRequest(String busNo, LoginUser loginUser, Date now);
|
||||
List<SupplyRequest> agreeRequest(String busNo,Date now);
|
||||
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@@ -53,10 +52,8 @@ public interface ISupplyRequestService extends IService<SupplyRequest> {
|
||||
* 驳回申请
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param loginUser 登录用户信息
|
||||
* @param now 当前时间
|
||||
*/
|
||||
boolean rejectRequest(String busNo, LoginUser loginUser, Date now);
|
||||
boolean rejectRequest(String busNo);
|
||||
|
||||
/**
|
||||
* 获取供应项目所在表
|
||||
@@ -73,4 +70,19 @@ public interface ISupplyRequestService extends IService<SupplyRequest> {
|
||||
* @return 物品id
|
||||
*/
|
||||
List<Long> getItem(List<SupplyRequest> agreedList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验(已经审批通过的单号(请求状态是同意),不能再重复编辑请求)
|
||||
*
|
||||
* @param busNo 单据号
|
||||
*/
|
||||
boolean supplyRequestValidation(String busNo);
|
||||
|
||||
/**
|
||||
* 验证是否发生过业务
|
||||
*
|
||||
* @param itemId 项目id
|
||||
* @return 校验结果
|
||||
*/
|
||||
boolean verifyAbleEdit(Long itemId);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.mapper.ActivityDefinitionMapper;
|
||||
import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
@@ -55,4 +56,16 @@ public class ActivityDefinitionServiceImpl extends ServiceImpl<ActivityDefinitio
|
||||
public boolean addYbDiagnosisTreatment(ActivityDefinition activityDefinition) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定诊疗的-诊疗定义id
|
||||
*
|
||||
* @param activityName 诊疗名称
|
||||
* @return 诊疗定义id
|
||||
*/
|
||||
@Override
|
||||
public Long getAppointActivityDefinitionId(String activityName) {
|
||||
return baseMapper.getAppointActivityDefinitionId(activityName, PublicationStatus.ACTIVE.getValue());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,23 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.DbOpType;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.mapper.DeviceDispenseMapper;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
|
||||
@@ -21,6 +31,67 @@ import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
public class DeviceDispenseServiceImpl extends ServiceImpl<DeviceDispenseMapper, DeviceDispense>
|
||||
implements IDeviceDispenseService {
|
||||
|
||||
@Resource
|
||||
AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 处理器材发放信息
|
||||
*
|
||||
* @param deviceRequest 器材请求信息
|
||||
* @param dbOpType db操作类型
|
||||
*/
|
||||
@Override
|
||||
public void handleDeviceDispense(DeviceRequest deviceRequest, String dbOpType) {
|
||||
DeviceDispense deviceDispense = new DeviceDispense();
|
||||
// 器材发放id
|
||||
deviceDispense.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 10));
|
||||
// 器材请求id
|
||||
deviceDispense.setDeviceReqId(deviceRequest.getId());
|
||||
// 器材发放状态
|
||||
deviceDispense.setStatusEnum(DispenseStatus.DRAFT.getValue());
|
||||
// 发药类型
|
||||
deviceDispense.setDispenseCategoryEnum(deviceRequest.getCategoryEnum());
|
||||
// 器材编码
|
||||
deviceDispense.setDeviceDefId(deviceRequest.getDeviceDefId());
|
||||
// 领药患者
|
||||
deviceDispense.setPatientId(deviceRequest.getPatientId());
|
||||
// 相关诊疗
|
||||
deviceDispense.setEncounterId(deviceRequest.getEncounterId());
|
||||
// 发放数量
|
||||
deviceDispense.setQuantity(deviceRequest.getQuantity());
|
||||
// 发放单位
|
||||
deviceDispense.setUnitCode(deviceRequest.getUnitCode());
|
||||
// 产品批号
|
||||
deviceDispense.setLotNumber(deviceRequest.getLotNumber());
|
||||
// 发药人
|
||||
deviceDispense.setPerformerId(deviceRequest.getPerformerId());
|
||||
// 发放器材房
|
||||
deviceDispense.setLocationId(deviceRequest.getPerformLocation());
|
||||
// 支持用药信息
|
||||
deviceDispense.setSupportInfo(deviceRequest.getSupportInfo());
|
||||
// 已发药数量
|
||||
deviceDispense.setDispenseQuantity(0);
|
||||
// 发药频次
|
||||
deviceDispense.setDispenseFrequencyCode(deviceRequest.getRateCode());
|
||||
|
||||
if (DbOpType.INSERT.getCode().equals(dbOpType)) {
|
||||
baseMapper.insert(deviceDispense);
|
||||
} else if (DbOpType.UPDATE.getCode().equals(dbOpType)) {
|
||||
baseMapper.update(deviceDispense,
|
||||
new LambdaUpdateWrapper<DeviceDispense>().eq(DeviceDispense::getDeviceReqId, deviceRequest.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除器材发放信息
|
||||
*
|
||||
* @param deviceReqId 器材请求id
|
||||
*/
|
||||
@Override
|
||||
public void deleteDeviceDispense(Long deviceReqId) {
|
||||
baseMapper.delete(new LambdaQueryWrapper<DeviceDispense>().eq(DeviceDispense::getDeviceReqId, deviceReqId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新未发放耗材状态:停止发放
|
||||
*
|
||||
@@ -33,4 +104,130 @@ public class DeviceDispenseServiceImpl extends ServiceImpl<DeviceDispenseMapper,
|
||||
new DeviceDispense().setStatusEnum(DispenseStatus.STOPPED.getValue()).setNotPerformedReasonEnum(refund),
|
||||
new LambdaUpdateWrapper<DeviceDispense>().in(DeviceDispense::getId, devDisIdList));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取执行过的器材数据
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceDispense> selectDeviceDispenseByBasedOnId(Long basedOnId) {
|
||||
return (baseMapper
|
||||
.selectList(new LambdaQueryWrapper<DeviceDispense>().eq(DeviceDispense::getBasedOnId, basedOnId)
|
||||
.eq(DeviceDispense::getStatusEnum, DispenseStatus.COMPLETED.getValue())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行器材发放
|
||||
*
|
||||
* @param deviceDispense 器材发放信息
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
* @param step 执行次数
|
||||
* @param quantity 发药数量
|
||||
*/
|
||||
@Override
|
||||
public DeviceDispense createCompletedDeviceDispense(DeviceDispense deviceDispense, Date now, Practitioner loginUser,
|
||||
String step, Integer quantity) {
|
||||
// 服务请求编码
|
||||
deviceDispense.setBusNo(deviceDispense.getBusNo() + "." + step);
|
||||
// 请求基于什么
|
||||
deviceDispense.setBasedOnTable(CommonConstants.TableName.WOR_DEVICE_DISPENSE);
|
||||
// 请求基于什么的ID
|
||||
deviceDispense.setBasedOnId(deviceDispense.getId());
|
||||
// 已发药数量
|
||||
deviceDispense.setDispenseQuantity(quantity);
|
||||
// 状态
|
||||
deviceDispense.setStatusEnum(DispenseStatus.COMPLETED.getValue());
|
||||
// 发药人
|
||||
deviceDispense.setPerformerId(loginUser.getId());
|
||||
// 发放科室
|
||||
deviceDispense.setLocationId(loginUser.getOrgId());
|
||||
// 发药时间
|
||||
deviceDispense.setDispenseTime(now);
|
||||
// id
|
||||
deviceDispense.setId(null);
|
||||
// 新增器材发放
|
||||
baseMapper.insert(deviceDispense);
|
||||
|
||||
return deviceDispense;
|
||||
}
|
||||
|
||||
/**
|
||||
* 器材发放状态:已发药
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean completedStatusEnum(Long id, Date now, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>().eq(DeviceDispense::getId, id)
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.COMPLETED.getValue())
|
||||
.set(DeviceDispense::getPerformerId, loginUser.getId())
|
||||
.set(DeviceDispense::getLocationId, loginUser.getOrgId()).set(DeviceDispense::getDispenseTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 器材发放状态:撤回
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean cancelledStatusEnum(Long id, Date now, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>().eq(DeviceDispense::getId, id)
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.CANCELLED.getValue())
|
||||
.set(DeviceDispense::getPerformerId, loginUser.getId())
|
||||
.set(DeviceDispense::getLocationId, loginUser.getOrgId()).set(DeviceDispense::getDispenseTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 器材发放状态:待发药
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean inProgressStatusEnum(Long id, Date now, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>().eq(DeviceDispense::getId, id)
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.IN_PROGRESS.getValue())
|
||||
.set(DeviceDispense::getPerformerId, loginUser.getId())
|
||||
.set(DeviceDispense::getLocationId, loginUser.getOrgId()).set(DeviceDispense::getDispenseTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新耗材状态:待配药
|
||||
*
|
||||
* @param deviceRequestIdList 请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updatePreparationDispenseStatus(List<Long> deviceRequestIdList) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>()
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.in(DeviceDispense::getDeviceReqId, deviceRequestIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新耗材状态:暂停
|
||||
*
|
||||
* @param devReqIdList 请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateOnHoldDispenseStatus(List<Long> devReqIdList) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>()
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.ON_HOLD.getValue())
|
||||
.in(DeviceDispense::getDeviceDefId, devReqIdList));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.mapper.DeviceRequestMapper;
|
||||
import com.openhis.workflow.service.IDeviceRequestService;
|
||||
@@ -14,6 +19,60 @@ import com.openhis.workflow.service.IDeviceRequestService;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class DeviceRequestServiceImpl extends ServiceImpl<DeviceRequestMapper, DeviceRequest> implements IDeviceRequestService {
|
||||
public class DeviceRequestServiceImpl extends ServiceImpl<DeviceRequestMapper, DeviceRequest>
|
||||
implements IDeviceRequestService {
|
||||
|
||||
/**
|
||||
* 器材请求状态:已完成
|
||||
*
|
||||
* @param id ID
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean completedStatusEnum(Long id, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceRequest>().eq(DeviceRequest::getId, id)
|
||||
.set(DeviceRequest::getStatusEnum, RequestStatus.COMPLETED.getValue())
|
||||
.set(DeviceRequest::getPerformerId, loginUser.getId())
|
||||
.set(DeviceRequest::getLocationId, loginUser.getOrgId()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 器材请求状态:已发送
|
||||
*
|
||||
* @param id ID
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean activeStatusEnum(Long id, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceRequest>().eq(DeviceRequest::getId, id)
|
||||
.set(DeviceRequest::getStatusEnum, RequestStatus.ACTIVE.getValue())
|
||||
.set(DeviceRequest::getPerformerId, loginUser.getId())
|
||||
.set(DeviceRequest::getLocationId, loginUser.getOrgId()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新请求状态:已完成
|
||||
*
|
||||
* @param devRequestIdList 耗材请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateCompletedStatusBatch(List<Long> devRequestIdList) {
|
||||
baseMapper.update(new DeviceRequest().setStatusEnum(RequestStatus.COMPLETED.getValue()),
|
||||
new LambdaUpdateWrapper<DeviceRequest>().in(DeviceRequest::getId, devRequestIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新请求状态:待发送
|
||||
*
|
||||
* @param devReqIdList 耗材请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateDraftStatusBatch(List<Long> devReqIdList) {
|
||||
baseMapper.update(null, new LambdaUpdateWrapper<DeviceRequest>().in(DeviceRequest::getId, devReqIdList)
|
||||
.set(DeviceRequest::getStatusEnum, RequestStatus.DRAFT.getValue()));
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,18 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.mapper.InventoryItemMapper;
|
||||
import com.openhis.workflow.service.IInventoryItemService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.mapper.InventoryItemMapper;
|
||||
import com.openhis.workflow.service.IInventoryItemService;
|
||||
|
||||
/**
|
||||
* 库存项目管理Service业务层处理
|
||||
*
|
||||
@@ -21,7 +20,8 @@ import java.util.List;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class InventoryItemServiceImpl extends ServiceImpl<InventoryItemMapper, InventoryItem> implements IInventoryItemService {
|
||||
public class InventoryItemServiceImpl extends ServiceImpl<InventoryItemMapper, InventoryItem>
|
||||
implements IInventoryItemService {
|
||||
|
||||
/**
|
||||
* 入库
|
||||
@@ -44,46 +44,36 @@ public class InventoryItemServiceImpl extends ServiceImpl<InventoryItemMapper, I
|
||||
* @param id 主键
|
||||
* @param baseQuantity 常规单位库存数量
|
||||
* @param minQuantity 最小单位库存数量
|
||||
* @param loginUser 登录用户信息
|
||||
* @param now 当前时间
|
||||
* @return 更新件数
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateInventoryQuantity(Long id, BigDecimal baseQuantity,BigDecimal minQuantity, LoginUser loginUser, Date now) {
|
||||
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<InventoryItem>().eq(InventoryItem::getId, id)
|
||||
.set(InventoryItem::getUpdateTime, now)
|
||||
.set(InventoryItem::getUpdateBy, loginUser.getUserId())
|
||||
.set(InventoryItem::getBaseQuantity, baseQuantity)
|
||||
.set(InventoryItem::getMinQuantity, minQuantity));
|
||||
|
||||
public Boolean updateInventoryQuantity(Long id, BigDecimal baseQuantity, BigDecimal minQuantity, Date now) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<InventoryItem>().eq(InventoryItem::getId, id)
|
||||
.set(InventoryItem::getUpdateTime, now).set(InventoryItem::getQuantity, minQuantity));
|
||||
return updateCount > 0;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询库房信息
|
||||
* 查询
|
||||
*
|
||||
* @param itemId 项目编号
|
||||
* @param lotNumber 产品批号
|
||||
* @param locationId 仓库
|
||||
* @param locationStoreId 库位
|
||||
* @param tenantId 租户id
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public InventoryItem selectInventoryByLotNumber(String lotNumber, Long locationId, Long locationStoreId) {
|
||||
|
||||
// 查询取库房信息
|
||||
InventoryItem inventoryItem =
|
||||
baseMapper.selectOne(new LambdaQueryWrapper<InventoryItem>()
|
||||
.eq(InventoryItem::getLotNumber, lotNumber)
|
||||
.eq(InventoryItem::getLocationId, locationId)
|
||||
.eq(InventoryItem::getLocationStoreId, locationStoreId));
|
||||
if (inventoryItem == null) {
|
||||
return null;
|
||||
public List<InventoryItem> selectInventoryByItemId(Long itemId, String lotNumber, Long locationId,
|
||||
Integer tenantId) {
|
||||
LambdaQueryWrapper<InventoryItem> queryWrapper =
|
||||
new LambdaQueryWrapper<InventoryItem>().eq(InventoryItem::getItemId, itemId)
|
||||
.eq(InventoryItem::getLotNumber, lotNumber).eq(InventoryItem::getTenantId, tenantId);
|
||||
if (locationId != null) {
|
||||
queryWrapper.eq(InventoryItem::getLocationId, locationId);
|
||||
}
|
||||
|
||||
return inventoryItem;
|
||||
|
||||
// 查询取库房信息
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -7,6 +8,8 @@ import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import com.openhis.workflow.mapper.ServiceRequestMapper;
|
||||
@@ -45,4 +48,150 @@ public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper,
|
||||
baseMapper.update(new ServiceRequest().setStatusEnum(RequestStatus.STOPPED.getValue()),
|
||||
new LambdaUpdateWrapper<ServiceRequest>().in(ServiceRequest::getId, serReqIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取执行过的诊疗数据
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
*/
|
||||
@Override
|
||||
public List<ServiceRequest> selectServiceRequestByBasedOnId(Long basedOnId) {
|
||||
return (baseMapper
|
||||
.selectList(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getBasedOnId, basedOnId)
|
||||
.eq(ServiceRequest::getStatusEnum, RequestStatus.COMPLETED.getValue())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行诊疗
|
||||
*
|
||||
* @param serviceRequest 服务申请信息
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
* @param step 执行次数
|
||||
*/
|
||||
@Override
|
||||
public ServiceRequest createCompletedServiceRequest(ServiceRequest serviceRequest, Date now, Practitioner loginUser,
|
||||
String step) {
|
||||
// 服务请求编码
|
||||
serviceRequest.setBusNo(serviceRequest.getBusNo() + "." + step);
|
||||
// 请求基于什么
|
||||
serviceRequest.setBasedOnTable(CommonConstants.TableName.WOR_SERVICE_REQUEST);
|
||||
// 请求基于什么的ID
|
||||
serviceRequest.setBasedOnId(serviceRequest.getId());
|
||||
// 数量
|
||||
serviceRequest.setQuantity(1);
|
||||
// 状态
|
||||
serviceRequest.setStatusEnum(RequestStatus.COMPLETED.getValue());
|
||||
// 执行人
|
||||
serviceRequest.setPerformerId(loginUser.getId());
|
||||
// 执行位置
|
||||
serviceRequest.setLocationId(loginUser.getOrgId());
|
||||
// 预计执行时间
|
||||
serviceRequest.setOccurrenceStartTime(now);
|
||||
// id
|
||||
serviceRequest.setId(null);
|
||||
// 新增服务申请
|
||||
baseMapper.insert(serviceRequest);
|
||||
|
||||
return serviceRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务申请状态:已完成
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean completedStatusEnum(Long id, Date now, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<ServiceRequest>()
|
||||
.eq(ServiceRequest::getId, id).set(ServiceRequest::getStatusEnum, RequestStatus.COMPLETED.getValue())
|
||||
.set(ServiceRequest::getPerformerId, loginUser.getId())
|
||||
.set(ServiceRequest::getLocationId, loginUser.getOrgId()).set(ServiceRequest::getOccurrenceStartTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新服务申请状态:取消
|
||||
*
|
||||
* @param serviceReqId 服务请求id
|
||||
* @param now 更新时间
|
||||
* @param practitionerId 执行人
|
||||
* @param orgId 执行科室
|
||||
* @return 更新结果
|
||||
*/
|
||||
@Override
|
||||
public boolean updateCancelledStatus(Long serviceReqId, Date now, Long practitionerId, Long orgId) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<ServiceRequest>().eq(ServiceRequest::getId, serviceReqId)
|
||||
.set(ServiceRequest::getStatusEnum, RequestStatus.CANCELLED.getValue())
|
||||
.set(ServiceRequest::getPerformerId, practitionerId).set(ServiceRequest::getOrgId, orgId)
|
||||
.set(ServiceRequest::getOccurrenceStartTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务申请状态:已发送
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean activeStatusEnum(Long id, Date now, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<ServiceRequest>()
|
||||
.eq(ServiceRequest::getId, id).set(ServiceRequest::getStatusEnum, RequestStatus.ACTIVE.getValue())
|
||||
.set(ServiceRequest::getPerformerId, loginUser.getId())
|
||||
.set(ServiceRequest::getLocationId, loginUser.getOrgId()).set(ServiceRequest::getOccurrenceStartTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新服务状态:待执行
|
||||
*
|
||||
* @param serviceRequestIdList 请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updatePreparationStatus(List<Long> serviceRequestIdList) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<ServiceRequest>()
|
||||
.set(ServiceRequest::getStatusEnum, RequestStatus.IN_PROGRESS.getValue())
|
||||
.in(ServiceRequest::getId, serviceRequestIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新服务状态:待发送
|
||||
*
|
||||
* @param serReqIdList 请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateDraftStatusBatch(List<Long> serReqIdList) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<ServiceRequest>().set(ServiceRequest::getStatusEnum, RequestStatus.DRAFT.getValue())
|
||||
.in(ServiceRequest::getId, serReqIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新服务申请里的打印次数字段
|
||||
*
|
||||
* @param id 服务申请id
|
||||
* @param num 打印次数
|
||||
* @return 更新结果
|
||||
*/
|
||||
@Override
|
||||
public void updateCountPint(Long id, Integer num) {
|
||||
// 根据 id 查询实体
|
||||
ServiceRequest serviceRequest = baseMapper.selectById(id);
|
||||
if (serviceRequest != null) {
|
||||
// 获取当前的 countPrint 值,如果为 null,默认为 0L
|
||||
int currentPrintCount = serviceRequest.getPrintCount();
|
||||
// 对 countPrint 字段进行加法操作
|
||||
int newPrintCount = currentPrintCount + num;
|
||||
// 更新实体
|
||||
serviceRequest.setPrintCount(newPrintCount);
|
||||
baseMapper.updateById(serviceRequest);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,12 +3,13 @@ package com.openhis.workflow.service.impl;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.common.enums.EventStatus;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.SupplyDeliveryMapper;
|
||||
@@ -43,14 +44,14 @@ public class SupplyDeliveryServiceImpl extends ServiceImpl<SupplyDeliveryMapper,
|
||||
.setRequestId(supplyRequest.getId())
|
||||
// 发放状态:已完成
|
||||
.setStatusEnum(EventStatus.COMPLETED.getValue())
|
||||
// 单据类型:采购入库
|
||||
.setTypeEnum(SupplyType.PURCHASE_INVENTORY.getValue())
|
||||
// 单据类型
|
||||
.setTypeEnum(supplyRequest.getTypeEnum())
|
||||
// 发放项目所在表
|
||||
.setItemTable(supplyRequest.getItemTable())
|
||||
// 发放物品id
|
||||
.setItemId(supplyRequest.getItemId())
|
||||
// 物品单位
|
||||
.setUnitIdCode(supplyRequest.getUnitCode())
|
||||
.setUnitCode(supplyRequest.getUnitCode())
|
||||
// 发放数量
|
||||
.setQuantity(supplyRequest.getItemQuantity())
|
||||
// 批次号
|
||||
@@ -77,4 +78,23 @@ public class SupplyDeliveryServiceImpl extends ServiceImpl<SupplyDeliveryMapper,
|
||||
}
|
||||
return deliveryList;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过)
|
||||
*
|
||||
* @param supplyReqIdList 供应申请id列表
|
||||
*/
|
||||
@Override
|
||||
public boolean supplyDeliveryValidation(List<Long> supplyReqIdList) {
|
||||
|
||||
// 根据请求id查询发放状态
|
||||
List<SupplyDelivery> deliveryList = baseMapper
|
||||
.selectList(new LambdaQueryWrapper<SupplyDelivery>().in(SupplyDelivery::getRequestId, supplyReqIdList));
|
||||
if (!deliveryList.isEmpty()) {
|
||||
List<Integer> deliveryStatusList =
|
||||
deliveryList.stream().map(SupplyDelivery::getStatusEnum).collect(Collectors.toList());
|
||||
return deliveryStatusList.stream().anyMatch(x -> x.equals(EventStatus.COMPLETED.getValue()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,9 @@ import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
||||
@@ -46,17 +47,17 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
* 同意申请
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param loginUser 登录用户信息
|
||||
* @param now 当前时间
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> agreeRequest(String busNo, LoginUser loginUser, Date now) {
|
||||
public List<SupplyRequest> agreeRequest(String busNo, Date now) {
|
||||
// 更新单据状态
|
||||
baseMapper.update(
|
||||
new SupplyRequest().setApprovalTime(now).setApproverId(loginUser.getPractitionerId())
|
||||
.setStatusEnum(SupplyStatus.AGREE.getValue()),
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getApprovalTime, now)
|
||||
.set(SupplyRequest::getApproverId, SecurityUtils.getLoginUser().getPractitionerId())
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.AGREE.getValue()));
|
||||
// 返回单据详情
|
||||
return this.getSupplyByBusNo(busNo);
|
||||
}
|
||||
@@ -69,9 +70,10 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
*/
|
||||
@Override
|
||||
public boolean submitApproval(String busNo) {
|
||||
int updateCount = baseMapper.update(
|
||||
new SupplyRequest().setApplyTime(DateUtils.getNowDate()).setStatusEnum(SupplyStatus.APPROVAL.getValue()),
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getApplyTime, DateUtils.getNowDate())
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.APPROVAL.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
@@ -83,8 +85,10 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
*/
|
||||
@Override
|
||||
public boolean withdrawApproval(String busNo) {
|
||||
int updateCount = baseMapper.update(new SupplyRequest().setStatusEnum(SupplyStatus.WITHDRAW.getValue()),
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getApplyTime, DateUtils.getNowDate())
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.WITHDRAW.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
@@ -92,16 +96,15 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
* 驳回申请
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param loginUser 登录用户信息
|
||||
* @param now 当前时间
|
||||
*/
|
||||
@Override
|
||||
public boolean rejectRequest(String busNo, LoginUser loginUser, Date now) {
|
||||
public boolean rejectRequest(String busNo) {
|
||||
// 更新单据状态
|
||||
int updateCount = baseMapper.update(
|
||||
new SupplyRequest().setApprovalTime(now).setApproverId(loginUser.getPractitionerId())
|
||||
.setStatusEnum(SupplyStatus.REJECT.getValue()),
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getApprovalTime, DateUtils.getNowDate())
|
||||
.set(SupplyRequest::getApproverId, SecurityUtils.getLoginUser().getPractitionerId())
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.REJECT.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
@@ -126,4 +129,37 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
public List<Long> getItem(List<SupplyRequest> agreedList) {
|
||||
return agreedList.stream().map(SupplyRequest::getItemId).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验(已经审批通过的单号(请求状态是同意),不能再重复编辑请求)
|
||||
*
|
||||
* @param busNo 单据号
|
||||
*/
|
||||
@Override
|
||||
public boolean supplyRequestValidation(String busNo) {
|
||||
|
||||
// 根据单据号查询请求状态
|
||||
List<SupplyRequest> requestList =
|
||||
baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
if (!requestList.isEmpty()) {
|
||||
for (SupplyRequest supplyRequest : requestList) {
|
||||
if (SupplyStatus.AGREE.getValue().equals(supplyRequest.getStatusEnum())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证是否发生过业务
|
||||
*
|
||||
* @param itemId 项目id
|
||||
* @return 校验结果
|
||||
*/
|
||||
@Override
|
||||
public boolean verifyAbleEdit(Long itemId) {
|
||||
return baseMapper.exists(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getItemId, itemId)
|
||||
.eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,4 +4,18 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.administration.mapper.EncounterDiagnosisMapper">
|
||||
|
||||
<delete id="deleteByEncounterId">
|
||||
DELETE
|
||||
FROM adm_encounter_diagnosis
|
||||
WHERE encounter_id = #{encounterId}
|
||||
AND tcm_flag = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTcmByEncounterId">
|
||||
DELETE
|
||||
FROM adm_encounter_diagnosis
|
||||
WHERE encounter_id = #{encounterId}
|
||||
AND tcm_flag = 0
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -4,4 +4,18 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.clinical.mapper.ConditionMapper">
|
||||
|
||||
<delete id="deleteByEncounterId">
|
||||
DELETE
|
||||
FROM cli_condition
|
||||
WHERE ID IN (SELECT condition_id FROM adm_encounter_diagnosis WHERE encounter_id = #{encounterId})
|
||||
AND tcm_flag = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTcmByEncounterId">
|
||||
DELETE
|
||||
FROM cli_condition
|
||||
WHERE ID IN (SELECT condition_id FROM adm_encounter_diagnosis WHERE encounter_id = #{encounterId})
|
||||
AND tcm_flag = 1
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -4,4 +4,12 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.workflow.mapper.ActivityDefinitionMapper">
|
||||
|
||||
<select id="getAppointActivityDefinitionId" resultType="long">
|
||||
SELECT ID
|
||||
FROM wor_activity_definition
|
||||
WHERE delete_flag = '0'
|
||||
AND status_enum = #{status}
|
||||
AND NAME = #{skinTestInspection} LIMIT 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user