门诊收费部分代码上传
This commit is contained in:
@@ -3,11 +3,11 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.web.chargemanage.appservice;
|
package com.openhis.web.chargemanage.appservice;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 门诊收费 service
|
* 门诊收费 service
|
||||||
*
|
*
|
||||||
@@ -28,4 +28,28 @@ public interface IOutpatientChargeAppService {
|
|||||||
*/
|
*/
|
||||||
R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo,
|
R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo,
|
||||||
Integer pageSize, HttpServletRequest request);
|
Integer pageSize, HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据就诊id查询患者处方列表
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 患者处方列表
|
||||||
|
*/
|
||||||
|
R<?> getEncounterPatientPrescription(Long encounterId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保转自费
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
R<?> changeToSelfPay(Long encounterId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自费转医保
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
R<?> changeToMedicalInsurance(Long encounterId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
import com.core.common.utils.AgeCalculatorUtil;
|
import com.core.common.utils.AgeCalculatorUtil;
|
||||||
|
import com.core.common.utils.MessageUtils;
|
||||||
|
import com.openhis.administration.service.IAccountService;
|
||||||
|
import com.openhis.administration.service.IChargeItemService;
|
||||||
import com.openhis.common.constant.CommonConstants;
|
import com.openhis.common.constant.CommonConstants;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
import com.openhis.common.enums.AdministrativeGender;
|
import com.openhis.common.enums.AdministrativeGender;
|
||||||
|
import com.openhis.common.enums.ChargeItemContext;
|
||||||
|
import com.openhis.common.enums.ChargeItemStatus;
|
||||||
import com.openhis.common.utils.EnumUtils;
|
import com.openhis.common.utils.EnumUtils;
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService;
|
import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService;
|
||||||
@@ -35,6 +41,10 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private OutpatientChargeAppMapper outpatientChargeAppMapper;
|
private OutpatientChargeAppMapper outpatientChargeAppMapper;
|
||||||
|
@Autowired
|
||||||
|
private IChargeItemService chargeItemService;
|
||||||
|
@Autowired
|
||||||
|
private IAccountService accountService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询就诊患者分页列表
|
* 查询就诊患者分页列表
|
||||||
@@ -63,9 +73,66 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
|||||||
encounterPatientPage.getRecords().forEach(e -> {
|
encounterPatientPage.getRecords().forEach(e -> {
|
||||||
// 性别枚举
|
// 性别枚举
|
||||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||||
|
// 收费状态枚举
|
||||||
|
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||||
// 计算年龄
|
// 计算年龄
|
||||||
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||||
});
|
});
|
||||||
return R.ok(encounterPatientPage);
|
return R.ok(encounterPatientPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据就诊id查询患者处方列表
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 患者处方列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> getEncounterPatientPrescription(Long encounterId) {
|
||||||
|
return R.ok(outpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
|
||||||
|
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
|
||||||
|
ChargeItemContext.DEVICE.getValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保转自费
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> changeToSelfPay(Long encounterId) {
|
||||||
|
// 获取就诊患者的自费账户id
|
||||||
|
Long accountId = accountService.getSelfPayAccount(encounterId);
|
||||||
|
if (accountId == null) {
|
||||||
|
R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||||
|
}
|
||||||
|
// 医保转自费
|
||||||
|
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||||
|
if (!result) {
|
||||||
|
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自费转医保
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> changeToMedicalInsurance(Long encounterId) {
|
||||||
|
// 获取就诊患者的医保账户id
|
||||||
|
Long accountId = accountService.getMedicalInsuranceAccount(encounterId);
|
||||||
|
if (accountId == null) {
|
||||||
|
R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||||
|
}
|
||||||
|
// 自费转医保
|
||||||
|
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||||
|
if (!result) {
|
||||||
|
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,7 @@ package com.openhis.web.chargemanage.controller;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService;
|
import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService;
|
||||||
@@ -51,4 +48,37 @@ public class OutpatientChargeController {
|
|||||||
return R.ok(outpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo,
|
return R.ok(outpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo,
|
||||||
pageSize, request));
|
pageSize, request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据就诊id查询患者处方列表
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 患者处方列表
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/patient-prescription")
|
||||||
|
public R<?> getEncounterPatientPrescription(@RequestParam Long encounterId) {
|
||||||
|
return R.ok(outpatientChargeAppService.getEncounterPatientPrescription(encounterId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保转自费
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PutMapping("/self-pay")
|
||||||
|
public R<?> changeToSelfPay(@RequestParam Long encounterId) {
|
||||||
|
return outpatientChargeAppService.changeToSelfPay(encounterId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自费转医保
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PutMapping("/medical-insurance")
|
||||||
|
public R<?> changeToMedicalInsurance(@RequestParam Long encounterId) {
|
||||||
|
return outpatientChargeAppService.changeToMedicalInsurance(encounterId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,4 +91,8 @@ public class EncounterPatientPageDto implements Serializable {
|
|||||||
* 年龄
|
* 年龄
|
||||||
*/
|
*/
|
||||||
private String age;
|
private String age;
|
||||||
|
|
||||||
|
/** 收费状态 */
|
||||||
|
private Integer statusEnum;
|
||||||
|
private String statusEnum_enumText;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,4 +55,9 @@ public class EncounterPatientPageParam implements Serializable {
|
|||||||
* 开始时间
|
* 开始时间
|
||||||
*/
|
*/
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费状态
|
||||||
|
*/
|
||||||
|
private Integer statusEnum;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.chargemanage.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊患者处方 dto
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class EncounterPatientPrescriptionDto implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 收费项目类型 */
|
||||||
|
private Integer contextEnum;
|
||||||
|
private String contextEnum_enumText;
|
||||||
|
|
||||||
|
/** 收费状态 */
|
||||||
|
private Integer statusEnum;
|
||||||
|
private String statusEnum_enumText;
|
||||||
|
|
||||||
|
/** 就诊ID */
|
||||||
|
private Long encounterId;
|
||||||
|
|
||||||
|
/** 开立科室 */
|
||||||
|
private Long requestingOrgId;
|
||||||
|
|
||||||
|
/** 数量 */
|
||||||
|
private Long quantityValue;
|
||||||
|
|
||||||
|
/** 单位 */
|
||||||
|
private String quantityUnit;
|
||||||
|
|
||||||
|
/** 单价 */
|
||||||
|
private BigDecimal unitPrice;
|
||||||
|
|
||||||
|
/** 总价 */
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
/** 处方号 */
|
||||||
|
private String prescriptionNo;
|
||||||
|
|
||||||
|
/** 开立人ID */
|
||||||
|
private Long entererId;
|
||||||
|
|
||||||
|
/** 开立时间 */
|
||||||
|
private Date enteredDate;
|
||||||
|
|
||||||
|
/** 关联账户ID */
|
||||||
|
private Long accountId;
|
||||||
|
|
||||||
|
/** 物品编码 */
|
||||||
|
private Long itemId;
|
||||||
|
|
||||||
|
/** 物品名称 */
|
||||||
|
private String itemName;
|
||||||
|
}
|
||||||
@@ -3,6 +3,8 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.web.chargemanage.mapper;
|
package com.openhis.web.chargemanage.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@@ -11,6 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageDto;
|
import com.openhis.web.chargemanage.dto.EncounterPatientPageDto;
|
||||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||||
|
import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 门诊收费 appMapper
|
* 门诊收费 appMapper
|
||||||
@@ -30,4 +33,16 @@ public interface OutpatientChargeAppMapper {
|
|||||||
*/
|
*/
|
||||||
Page<EncounterPatientPageDto> selectEncounterPatientPage(@Param("page") Page<EncounterPatientPageDto> page,
|
Page<EncounterPatientPageDto> selectEncounterPatientPage(@Param("page") Page<EncounterPatientPageDto> page,
|
||||||
@Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper);
|
@Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据就诊id查询患者处方列表
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @param activity 项目
|
||||||
|
* @param medication 药品
|
||||||
|
* @param device 耗材
|
||||||
|
* @return 患者处方列表
|
||||||
|
*/
|
||||||
|
List<EncounterPatientPrescriptionDto> selectEncounterPatientPrescription(@Param("encounterId") Long encounterId,
|
||||||
|
@Param("activity") Integer activity, @Param("medication") Integer medication, @Param("device") Integer device);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class InventoryManageAssembler {
|
|||||||
// 收费状态:已结算
|
// 收费状态:已结算
|
||||||
.setStatusEnum(ChargeItemStatus.BILLED.getValue())
|
.setStatusEnum(ChargeItemStatus.BILLED.getValue())
|
||||||
// 收费类型:采购
|
// 收费类型:采购
|
||||||
.setContextEnum(ChargeItemContext.PRESCRIPTION.getValue())
|
.setContextEnum(ChargeItemContext.PURCHASE.getValue())
|
||||||
// 发生时间
|
// 发生时间
|
||||||
.setOccurrenceTime(now)
|
.setOccurrenceTime(now)
|
||||||
// 开立人
|
// 开立人
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package com.openhis.web.inventorymanage.controller;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import com.openhis.web.inventorymanage.dto.InventoryReceiptInitDto;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.openhis.administration.domain.Location;
|
|||||||
import com.openhis.administration.domain.Supplier;
|
import com.openhis.administration.domain.Supplier;
|
||||||
import com.openhis.medication.domain.MedicationDetail;
|
import com.openhis.medication.domain.MedicationDetail;
|
||||||
|
|
||||||
|
import com.openhis.web.basedatamanage.dto.LocationQueryDto;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
T3.birth_date,
|
T3.birth_date,
|
||||||
T3.id_card,
|
T3.id_card,
|
||||||
T3.patient_py_str,
|
T3.patient_py_str,
|
||||||
T3.patient_wb_str
|
T3.patient_wb_str,
|
||||||
|
T3.status_enum
|
||||||
FROM (
|
FROM (
|
||||||
SELECT T1.id AS encounter_id,
|
SELECT T1.id AS encounter_id,
|
||||||
T1.bus_no AS encounter_bus_no,
|
T1.bus_no AS encounter_bus_no,
|
||||||
@@ -25,13 +26,52 @@
|
|||||||
T2.birth_date,
|
T2.birth_date,
|
||||||
T2.id_card,
|
T2.id_card,
|
||||||
T2.py_str AS patient_py_str,
|
T2.py_str AS patient_py_str,
|
||||||
T2.wb_str AS patient_wb_str
|
T2.wb_str AS patient_wb_str,
|
||||||
|
T3.status_enum
|
||||||
FROM adm_encounter AS T1
|
FROM adm_encounter AS T1
|
||||||
LEFT JOIN adm_patient AS T2
|
LEFT JOIN adm_patient AS T2
|
||||||
ON T1.patient_id = T2.id
|
ON T1.patient_id = T2.id
|
||||||
|
LEFT JOIN adm_charge_item AS T3
|
||||||
|
ON T3.encounter_id = T1.id
|
||||||
WHERE T1.delete_flag = '0'
|
WHERE T1.delete_flag = '0'
|
||||||
ORDER BY T1.encounter_bus_no DESC
|
ORDER BY T1.encounter_bus_no DESC
|
||||||
) AS T3
|
) AS T3
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectEncounterPatientPrescription"
|
||||||
|
resultType="com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto">
|
||||||
|
SELECT T1.encounter_id,
|
||||||
|
T1.context_enum,
|
||||||
|
T1.status_enum,
|
||||||
|
T1.requesting_org_id,
|
||||||
|
T1.quantity_value,
|
||||||
|
T1.quantity_unit,
|
||||||
|
T1.unit_price,
|
||||||
|
T1.total_price,
|
||||||
|
T1.prescription_no,
|
||||||
|
T1.enterer_id,
|
||||||
|
T1.entered_date,
|
||||||
|
T1.account_id,
|
||||||
|
CASE WHEN T1.context_enum = #{activity} THEN T2."name"
|
||||||
|
WHEN T1.context_enum = #{medication} THEN T3."name"
|
||||||
|
WHEN T1.context_enum = #{device} THEN T4."name"
|
||||||
|
END AS item_name,
|
||||||
|
CASE WHEN T1.context_enum = #{activity} THEN T2.id
|
||||||
|
WHEN T1.context_enum = #{medication} THEN T3.id
|
||||||
|
WHEN T1.context_enum = #{device} THEN T4.id
|
||||||
|
END AS item_id
|
||||||
|
FROM adm_charge_item AS T1
|
||||||
|
LEFT JOIN wor_activity_definition AS T2
|
||||||
|
ON T1.context_enum = #{activity}
|
||||||
|
AND T1.product_id = T2.id
|
||||||
|
LEFT JOIN med_medication_definition AS T3
|
||||||
|
ON T1.context_enum = #{medication}
|
||||||
|
AND T1.product_id = T3.id
|
||||||
|
LEFT JOIN adm_device_definition AS T4
|
||||||
|
ON T1.context_enum = #{device}
|
||||||
|
AND T1.product_id = T4.id
|
||||||
|
WHERE T1.encounter_id = #{encounterId}
|
||||||
|
AND T1.delete_flag = '0'
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账户类型
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-14
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum AccountType implements HisEnumInterface {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自费
|
||||||
|
*/
|
||||||
|
SELF_PAY(1, "1", "自费"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保
|
||||||
|
*/
|
||||||
|
MEDICAL_INSURANCE(2, "2", "医保");
|
||||||
|
|
||||||
|
private Integer value;
|
||||||
|
private String code;
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
public static AccountType getByValue(Integer value) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (AccountType val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,9 +22,19 @@ public enum ChargeItemContext {
|
|||||||
PURCHASE(1, "采购"),
|
PURCHASE(1, "采购"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处方
|
* 药品
|
||||||
*/
|
*/
|
||||||
PRESCRIPTION(2, "处方");
|
MEDICATION(2, "药品"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耗材
|
||||||
|
*/
|
||||||
|
DEVICE(3, "耗材"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目
|
||||||
|
*/
|
||||||
|
ACTIVITY(4, "项目");
|
||||||
|
|
||||||
private Integer value;
|
private Integer value;
|
||||||
private String info;
|
private String info;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.core.common.core.domain.HisBaseEntity;
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
|
||||||
import liquibase.pro.packaged.S;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
@@ -35,6 +34,9 @@ public class ChargeItem extends HisBaseEntity {
|
|||||||
/** 层级 */
|
/** 层级 */
|
||||||
private String busNo;
|
private String busNo;
|
||||||
|
|
||||||
|
/** 处方号 */
|
||||||
|
private String prescriptionNo;
|
||||||
|
|
||||||
/** 患者ID */
|
/** 患者ID */
|
||||||
private Long patientId;
|
private Long patientId;
|
||||||
|
|
||||||
@@ -122,4 +124,7 @@ public class ChargeItem extends HisBaseEntity {
|
|||||||
/** 机构 */
|
/** 机构 */
|
||||||
private Integer orgId;
|
private Integer orgId;
|
||||||
|
|
||||||
|
/** 退费ID */
|
||||||
|
private Long refundId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,4 +18,19 @@ public interface IAccountService extends IService<Account> {
|
|||||||
*/
|
*/
|
||||||
Long saveAccountByRegister(Account account);
|
Long saveAccountByRegister(Account account);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取就诊患者的自费账户id
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 账户id
|
||||||
|
*/
|
||||||
|
Long getSelfPayAccount(Long encounterId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取就诊患者的医保账户id
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 账户id
|
||||||
|
*/
|
||||||
|
Long getMedicalInsuranceAccount(Long encounterId);
|
||||||
}
|
}
|
||||||
@@ -26,4 +26,13 @@ public interface IChargeItemService extends IService<ChargeItem> {
|
|||||||
* @param chargeItem 费用项
|
* @param chargeItem 费用项
|
||||||
*/
|
*/
|
||||||
void saveChargeItemByRegister(ChargeItem chargeItem);
|
void saveChargeItemByRegister(ChargeItem chargeItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更改就诊患者账户类型
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊患者
|
||||||
|
* @param accountId 账户id
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
boolean updateAccountType(Long encounterId, Long accountId);
|
||||||
}
|
}
|
||||||
@@ -2,10 +2,12 @@ package com.openhis.administration.service.impl;
|
|||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.openhis.administration.domain.Account;
|
import com.openhis.administration.domain.Account;
|
||||||
import com.openhis.administration.mapper.AccountMapper;
|
import com.openhis.administration.mapper.AccountMapper;
|
||||||
import com.openhis.administration.service.IAccountService;
|
import com.openhis.administration.service.IAccountService;
|
||||||
|
import com.openhis.common.enums.AccountType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 就诊账户管理Service业务层处理
|
* 就诊账户管理Service业务层处理
|
||||||
@@ -27,4 +29,37 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
return account.getId();
|
return account.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取就诊患者的自费账户id
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 账户id
|
||||||
|
*/
|
||||||
|
@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()));
|
||||||
|
if (account != null) {
|
||||||
|
return account.getId();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取就诊患者的医保账户id
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 账户id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
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()));
|
||||||
|
if (account != null) {
|
||||||
|
return account.getId();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.openhis.administration.domain.ChargeItem;
|
import com.openhis.administration.domain.ChargeItem;
|
||||||
import com.openhis.administration.mapper.ChargeItemMapper;
|
import com.openhis.administration.mapper.ChargeItemMapper;
|
||||||
@@ -45,4 +46,18 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
|||||||
public void saveChargeItemByRegister(ChargeItem chargeItem) {
|
public void saveChargeItemByRegister(ChargeItem chargeItem) {
|
||||||
baseMapper.insert(chargeItem);
|
baseMapper.insert(chargeItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更改就诊患者账户类型
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊患者
|
||||||
|
* @param accountId 账户id
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean updateAccountType(Long encounterId, Long accountId) {
|
||||||
|
int update = baseMapper.update(null, new LambdaUpdateWrapper<ChargeItem>()
|
||||||
|
.eq(ChargeItem::getEncounterId, encounterId).set(ChargeItem::getAccountId, accountId));
|
||||||
|
return update > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,8 @@ import java.util.Date;
|
|||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
import com.core.common.core.domain.HisBaseEntity;
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
@@ -28,6 +28,9 @@ public class ServiceRequest extends HisBaseEntity {
|
|||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/** 服务编码 */
|
||||||
|
private String busNo;
|
||||||
|
|
||||||
/** 处方号 */
|
/** 处方号 */
|
||||||
private String prescriptionNo;
|
private String prescriptionNo;
|
||||||
|
|
||||||
@@ -103,5 +106,4 @@ public class ServiceRequest extends HisBaseEntity {
|
|||||||
/** 历史请求 */
|
/** 历史请求 */
|
||||||
private Long relevantHistoryId;
|
private Long relevantHistoryId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user