Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -243,18 +243,18 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
MedicationRequest medicationRequest;
|
||||
for (AdviceSaveDto adviceSaveDto : medicineList) {
|
||||
medicationRequest = new MedicationRequest();
|
||||
medicationRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 8));
|
||||
medicationRequest.setPrescriptionNo(prescriptionNo);
|
||||
medicationRequest.setQuantity(adviceSaveDto.getQuantity());
|
||||
medicationRequest.setExecuteNum(adviceSaveDto.getExecuteNum());
|
||||
medicationRequest.setUnitCode(adviceSaveDto.getUnitCode());
|
||||
medicationRequest.setLotNumber(adviceSaveDto.getLotNumber());
|
||||
medicationRequest.setStatusEnum(adviceSaveDto.getStatusEnum());
|
||||
medicationRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum());
|
||||
medicationRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 10));
|
||||
medicationRequest.setPrescriptionNo(prescriptionNo); // 处方号
|
||||
medicationRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
||||
medicationRequest.setExecuteNum(adviceSaveDto.getExecuteNum()); // 执行次数
|
||||
medicationRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
||||
medicationRequest.setLotNumber(adviceSaveDto.getLotNumber()); // 产品批号
|
||||
medicationRequest.setStatusEnum(adviceSaveDto.getStatusEnum()); // 请求状态,默认-待发送
|
||||
medicationRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum()); // 请求类型,默认-门诊
|
||||
medicationRequest.setMedicationId(adviceSaveDto.getAdviceDefinitionId());// 医嘱定义id
|
||||
medicationRequest.setPatientId(adviceSaveDto.getPatientId());
|
||||
medicationRequest.setPractitionerId(adviceSaveDto.getPractitionerId());
|
||||
medicationRequest.setOrgId(adviceSaveDto.getOrgId());
|
||||
medicationRequest.setPatientId(adviceSaveDto.getPatientId()); // 患者
|
||||
medicationRequest.setPractitionerId(adviceSaveDto.getPractitionerId()); // 开方医生
|
||||
medicationRequest.setOrgId(adviceSaveDto.getOrgId()); // 开方人科室
|
||||
// 查询机构位置关系
|
||||
OrganizationLocation orgLocByOrgIdAndCategoryCode = iOrganizationLocationService
|
||||
.getOrgLocByOrgIdAndCategoryCode(adviceSaveDto.getOrgId(), adviceSaveDto.getCategoryCode());
|
||||
@@ -263,13 +263,13 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
medicationRequest.setPerformLocation(orgLocByOrgIdAndCategoryCode.getDefLocationId());
|
||||
}
|
||||
// medicationRequest.setLocationId(adviceSaveDto.getLocationId()); // 请求发起的位置
|
||||
medicationRequest.setEncounterId(adviceSaveDto.getEncounterId());
|
||||
medicationRequest.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id
|
||||
medicationRequest.setConditionId(adviceSaveDto.getConditionId()); // 诊断id
|
||||
medicationRequest.setTherapyEnum(adviceSaveDto.getTherapyEnum());
|
||||
medicationRequest.setMethodCode(adviceSaveDto.getMethodCode());
|
||||
medicationRequest.setRateCode(adviceSaveDto.getRateCode());
|
||||
medicationRequest.setDose(adviceSaveDto.getDose());
|
||||
medicationRequest.setDoseUnitCode(adviceSaveDto.getDoseUnitCode());
|
||||
medicationRequest.setTherapyEnum(adviceSaveDto.getTherapyEnum()); // 治疗类型,默认-临时
|
||||
medicationRequest.setMethodCode(adviceSaveDto.getMethodCode()); // 用法
|
||||
medicationRequest.setRateCode(adviceSaveDto.getRateCode()); // 用药频次
|
||||
medicationRequest.setDose(adviceSaveDto.getDose()); // 单次剂量
|
||||
medicationRequest.setDoseUnitCode(adviceSaveDto.getDoseUnitCode()); // 剂量单位
|
||||
medicationRequest.setSkinTestFlag(adviceSaveDto.getSkinTestFlag()); // 皮试标记
|
||||
medicationRequest.setGroupId(adviceSaveDto.getGroupId());// 分组id
|
||||
// medicationRequest.setPackageId(adviceSaveDto.getPackageId());
|
||||
@@ -283,17 +283,17 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
DeviceRequest deviceRequest;
|
||||
for (AdviceSaveDto adviceSaveDto : deviceList) {
|
||||
deviceRequest = new DeviceRequest();
|
||||
deviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 8));
|
||||
deviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 10));
|
||||
// deviceRequest.setPrescriptionNo(prescriptionNo); // 耗材不需要处方号
|
||||
deviceRequest.setQuantity(adviceSaveDto.getQuantity());
|
||||
deviceRequest.setUnitCode(adviceSaveDto.getUnitCode());
|
||||
deviceRequest.setLotNumber(adviceSaveDto.getLotNumber());
|
||||
deviceRequest.setStatusEnum(adviceSaveDto.getStatusEnum());
|
||||
deviceRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum());
|
||||
deviceRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
||||
deviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
||||
deviceRequest.setLotNumber(adviceSaveDto.getLotNumber());// 产品批号
|
||||
deviceRequest.setStatusEnum(adviceSaveDto.getStatusEnum()); // 请求状态,默认-待发送
|
||||
deviceRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum()); // 请求类型,默认-门诊
|
||||
deviceRequest.setDeviceDefId(adviceSaveDto.getAdviceDefinitionId());// 耗材定义id
|
||||
deviceRequest.setPatientId(adviceSaveDto.getPatientId());
|
||||
deviceRequest.setRequesterId(adviceSaveDto.getPractitionerId());
|
||||
deviceRequest.setOrgId(adviceSaveDto.getOrgId());
|
||||
deviceRequest.setPatientId(adviceSaveDto.getPatientId()); // 患者
|
||||
deviceRequest.setRequesterId(adviceSaveDto.getPractitionerId()); // 开方医生
|
||||
deviceRequest.setOrgId(adviceSaveDto.getOrgId());// 开方人科室
|
||||
// 查询机构位置关系
|
||||
OrganizationLocation orgLocByOrgIdAndCategoryCode = iOrganizationLocationService
|
||||
.getOrgLocByOrgIdAndCategoryCode(adviceSaveDto.getOrgId(), adviceSaveDto.getCategoryCode());
|
||||
@@ -302,7 +302,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
deviceRequest.setPerformLocation(orgLocByOrgIdAndCategoryCode.getDefLocationId());
|
||||
}
|
||||
// deviceRequest.setLocationId(adviceSaveDto.getLocationId()); 请求发起的位置
|
||||
deviceRequest.setEncounterId(adviceSaveDto.getEncounterId());
|
||||
deviceRequest.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id
|
||||
// deviceRequest.setPackageId(adviceSaveDto.getPackageId());
|
||||
// deviceRequest.setActivityId(adviceSaveDto.getActivityId());
|
||||
|
||||
@@ -315,19 +315,18 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
ServiceRequest serviceRequest;
|
||||
for (AdviceSaveDto adviceSaveDto : activityList) {
|
||||
serviceRequest = new ServiceRequest();
|
||||
serviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 8));
|
||||
serviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 10));
|
||||
// serviceRequest.setPrescriptionNo(prescriptionNo); // 诊疗不需要处方号
|
||||
serviceRequest.setBasedOnTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);
|
||||
serviceRequest.setBasedOnId(adviceSaveDto.getAdviceDefinitionId());
|
||||
serviceRequest.setQuantity(adviceSaveDto.getQuantity());
|
||||
serviceRequest.setUnitCode(adviceSaveDto.getUnitCode());
|
||||
serviceRequest.setStatusEnum(adviceSaveDto.getStatusEnum());
|
||||
serviceRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum());
|
||||
serviceRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum());
|
||||
serviceRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
||||
serviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
||||
serviceRequest.setStatusEnum(adviceSaveDto.getStatusEnum());// 请求状态,默认-待发送
|
||||
serviceRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum()); // 请求类型,默认-门诊
|
||||
serviceRequest.setActivityId(adviceSaveDto.getAdviceDefinitionId());// 诊疗定义id
|
||||
serviceRequest.setPatientId(adviceSaveDto.getPatientId());
|
||||
serviceRequest.setRequesterId(adviceSaveDto.getPractitionerId());
|
||||
serviceRequest.setEncounterId(adviceSaveDto.getEncounterId());
|
||||
serviceRequest.setPatientId(adviceSaveDto.getPatientId()); // 患者
|
||||
serviceRequest.setRequesterId(adviceSaveDto.getPractitionerId()); // 开方医生
|
||||
serviceRequest.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id
|
||||
|
||||
serviceRequestList.add(serviceRequest);
|
||||
}
|
||||
@@ -338,20 +337,22 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
ChargeItem chargeItem;
|
||||
for (AdviceSaveDto adviceSaveDto : adviceSaveList) {
|
||||
chargeItem = new ChargeItem();
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());
|
||||
chargeItem.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix(), 8));
|
||||
chargeItem.setPrescriptionNo(prescriptionNo);
|
||||
chargeItem.setPatientId(adviceSaveDto.getPatientId());
|
||||
chargeItem.setContextEnum(adviceSaveDto.getAdviceType());
|
||||
chargeItem.setEncounterId(adviceSaveDto.getEncounterId());
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue()); // 默认-代收费
|
||||
chargeItem.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix(), 10));
|
||||
chargeItem.setPrescriptionNo(prescriptionNo); // 处方号
|
||||
chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者
|
||||
chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型
|
||||
chargeItem.setEncounterId(adviceSaveDto.getEncounterId()); // 诊疗定义id
|
||||
|
||||
chargeItem.setQuantityValue(adviceSaveDto.getQuantity()); // 数量
|
||||
chargeItem.setQuantityUnit(adviceSaveDto.getUnitCode()); // 单位
|
||||
chargeItem.setUnitPrice(adviceSaveDto.getUnitPrice()); // 单价
|
||||
chargeItem
|
||||
.setTotalPrice((new BigDecimal(adviceSaveDto.getQuantity()).multiply(adviceSaveDto.getUnitPrice()))
|
||||
.setScale(4, RoundingMode.HALF_UP)); // 总价
|
||||
chargeItem.setDefinitionId(adviceSaveDto.getDefinitionId());
|
||||
chargeItem.setDefDetailId(adviceSaveDto.getDefinitionDetailId());
|
||||
|
||||
chargeItem.setDefinitionId(adviceSaveDto.getDefinitionId()); // 费用定价ID
|
||||
chargeItem.setDefDetailId(adviceSaveDto.getDefinitionDetailId()); // 定价子表主键
|
||||
|
||||
chargeItemList.add(chargeItem);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public class AdviceSaveDto {
|
||||
this.categoryEnum = EncounterClass.AMB.getValue();
|
||||
this.therapyEnum = TherapyTimeType.TEMPORARY.getValue();
|
||||
this.practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
this.orgId = SecurityUtils.getLoginUser().getOrgId(); // 开发人科室
|
||||
this.orgId = SecurityUtils.getLoginUser().getOrgId(); // 开方人科室
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,15 +3,12 @@ package com.openhis.web.pharmacymanage.appservice.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.*;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.common.enums.NotPerformedReasonEnum;
|
||||
import com.openhis.common.enums.OrganizationClass;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
@@ -27,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -97,7 +95,7 @@ public class IWesternMedicineDispenseAppServiceImpl implements IWesternMedicineD
|
||||
|
||||
// 查询条件设定
|
||||
String condition = encounterInfoSearchParam.getCondition();
|
||||
if (!condition.isEmpty()){
|
||||
if (StringUtils.isNotEmpty(condition)){
|
||||
Pattern pattern = Pattern.compile(".*\\d.*");
|
||||
Matcher matcher = pattern.matcher(encounterInfoSearchParam.getCondition());
|
||||
encounterInfoSearchParam.setIdCard(matcher.find() ? condition:"");
|
||||
@@ -126,11 +124,19 @@ public class IWesternMedicineDispenseAppServiceImpl implements IWesternMedicineD
|
||||
// 患者基本信息查询
|
||||
PrescriptionPatientInfoDto prescriptionPatientInfoDto = westernMedicineDispenseMapper.
|
||||
selectPrescriptionPatientInfo(encounterId);
|
||||
|
||||
// 年龄
|
||||
prescriptionPatientInfoDto.setAge(AgeCalculatorUtil.getAge(prescriptionPatientInfoDto.getBirth_date()));
|
||||
// 性别
|
||||
prescriptionPatientInfoDto.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class,
|
||||
prescriptionPatientInfoDto.getGenderEnum()));
|
||||
// 合同类型
|
||||
if (StringUtils.isNull(prescriptionPatientInfoDto.getCategoryEnum())){
|
||||
prescriptionPatientInfoDto.setCategoryEnum_enumText(EnumUtils.getInfoByValue(FinCategory.class,
|
||||
prescriptionPatientInfoDto.getCategoryEnum()));
|
||||
}
|
||||
// 处方单信息查询
|
||||
List<PrescriptionMedicineInfoDto> prescriptionMedicineInfoList = westernMedicineDispenseMapper.
|
||||
selectPrescriptionMedicineInfoList(encounterId);
|
||||
|
||||
// 计算合计金额
|
||||
if(!prescriptionMedicineInfoList.isEmpty()) {
|
||||
BigDecimal totalPrice = new BigDecimal(0);
|
||||
@@ -139,11 +145,9 @@ public class IWesternMedicineDispenseAppServiceImpl implements IWesternMedicineD
|
||||
}
|
||||
prescriptionPatientInfoDto.setTotalPrice(totalPrice);
|
||||
}
|
||||
|
||||
PrescriptionInfoDto prescriptionInfoDto = new PrescriptionInfoDto();
|
||||
prescriptionInfoDto.setPrescriptionPatientInfoDto(prescriptionPatientInfoDto);
|
||||
prescriptionInfoDto.setPrescriptionMedicineInfoDtoList(prescriptionMedicineInfoList);
|
||||
|
||||
return R.ok(prescriptionInfoDto);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,9 +48,6 @@ public class PrescriptionPatientInfoDto implements Serializable {
|
||||
/** 就诊日期 */
|
||||
private String encounterDate;
|
||||
|
||||
/** 门诊诊断 */
|
||||
private String diagnoseName;
|
||||
|
||||
/** 总金额 */
|
||||
private BigDecimal totalPrice;
|
||||
}
|
||||
@@ -4,132 +4,116 @@
|
||||
<select id="selectEncounterInfoListPage" resultType="com.openhis.web.pharmacymanage.dto.EncounterInfoPageDto">
|
||||
SELECT
|
||||
encounter_id,
|
||||
organization_id,
|
||||
department_name,
|
||||
id_card,
|
||||
patient_name,
|
||||
gender_enum,
|
||||
encounter_date
|
||||
|
||||
encounter_date,
|
||||
organization_id,
|
||||
id_card,
|
||||
start_time
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
DISTINCT
|
||||
T2.id AS encounter_id,
|
||||
TO_CHAR(T2.start_time,'YYYY-MM-DD') AS encounter_date,
|
||||
T2.organization_id,
|
||||
T3.gender_enum,
|
||||
T3.name AS patient_name,
|
||||
T3.id_card,
|
||||
T6.name AS department_name
|
||||
|
||||
FROM med_medication_dispense AS T1
|
||||
|
||||
INNER JOIN adm_encounter AS T2
|
||||
ON T1.encounter_id = T2.id
|
||||
|
||||
INNER JOIN adm_patient AS T3
|
||||
ON T1.patient_id = T3.id
|
||||
|
||||
INNER JOIN med_medication AS T4
|
||||
ON T1.medication_id = T4.id
|
||||
|
||||
INNER JOIN med_medication_definition AS T5
|
||||
ON T4.medication_def_id = T5.id
|
||||
AND T5.category_code IN ('1','2')
|
||||
|
||||
INNER JOIN adm_organization AS T6
|
||||
ON T2.organization_id = T6.id
|
||||
|
||||
WHERE
|
||||
T1.status_enum = 3
|
||||
|
||||
T1.id AS encounter_id,
|
||||
T1.start_time,
|
||||
TO_CHAR(T1.start_time,'YYYY-MM-DD') AS encounter_date,
|
||||
T1.organization_id,
|
||||
T2.gender_enum,
|
||||
T2.name AS patient_name,
|
||||
T2.id_card,
|
||||
T3.name AS department_name
|
||||
FROM adm_encounter AS T1
|
||||
INNER JOIN adm_patient AS T2
|
||||
ON T1.patient_id = T2.id
|
||||
LEFT OUTER JOIN adm_organization AS T3
|
||||
ON T1.organization_id = T3.id
|
||||
GROUP BY
|
||||
T1.id,
|
||||
T1.start_time,
|
||||
T1.organization_id,
|
||||
T2.gender_enum,
|
||||
T2.name,
|
||||
T2.id_card,
|
||||
T3.name
|
||||
ORDER BY
|
||||
T2.start_time desc,
|
||||
T2.organization_id
|
||||
)
|
||||
T1.start_time desc,
|
||||
T1.organization_id,
|
||||
T1.patient_id
|
||||
)
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="selectPrescriptionPatientInfo" resultType="com.openhis.web.pharmacymanage.dto.PrescriptionPatientInfoDto">
|
||||
SELECT
|
||||
DISTINCT
|
||||
T1.name AS patient_name,
|
||||
T1.gender_enum,
|
||||
T1.birth_date,
|
||||
T4.category_enum,
|
||||
T1.id_card,
|
||||
T5.name AS organization_name,
|
||||
TO_CHAR(T2.start_time,'YYYY-MM-DD') AS encounter_date
|
||||
|
||||
T2.name AS patient_name,
|
||||
T2.gender_enum,
|
||||
T2.birth_date,
|
||||
T4.category_enum,
|
||||
T2.id_card,
|
||||
T5.name AS organization_name,
|
||||
TO_CHAR(T1.start_time,'YYYY-MM-DD') AS encounter_date
|
||||
FROM adm_encounter AS T1
|
||||
|
||||
INNER JOIN adm_patient AS T2
|
||||
ON T1.id = T2.encounter_id
|
||||
|
||||
INNER JOIN med_medication_request AS T3
|
||||
ON T1.patient_id = T2.id
|
||||
LEFT OUTER JOIN med_medication_request AS T3
|
||||
ON T1.id = T3.encounter_id
|
||||
|
||||
INNER JOIN fin_contract AS T4
|
||||
LEFT OUTER JOIN fin_contract AS T4
|
||||
ON T3.contract_no = T4.bus_no
|
||||
|
||||
INNER JOIN adm_organization AS T5
|
||||
LEFT OUTER JOIN adm_organization AS T5
|
||||
ON T1.organization_id = T5.id
|
||||
|
||||
WHERE
|
||||
T1.id = #{encounterId}
|
||||
GROUP BY
|
||||
T2.name,
|
||||
T2.gender_enum,
|
||||
T2.birth_date,
|
||||
T4.category_enum,
|
||||
T2.id_card,
|
||||
T5.name,
|
||||
T1.start_time
|
||||
</select>
|
||||
<select id="selectPrescriptionMedicineInfoList" resultType="com.openhis.web.pharmacymanage.dto.PrescriptionMedicineInfoDto">
|
||||
SELECT
|
||||
T7.name AS department_name,
|
||||
T8.name AS doctor_name,
|
||||
T1.prescription_no,
|
||||
T3.name AS medicine_name,
|
||||
T2.total_volume,
|
||||
T1.dose,
|
||||
T1.rate_code,
|
||||
T1.method_code,
|
||||
T1.dose_unit_code,
|
||||
T1.max_dose,
|
||||
T1.first_dose,
|
||||
T1.first_duration,
|
||||
T1.dispense_interval,
|
||||
T1.dispense_per_quantity,
|
||||
T1.dispense_per_duration,
|
||||
T1.quantity,
|
||||
T4.unit_price,
|
||||
T4.total_price
|
||||
|
||||
FROM med_medication_request AS T1
|
||||
|
||||
INNER JOIN med_medication AS T2
|
||||
ON T1.medication_id = T2.id
|
||||
|
||||
INNER JOIN med_medication_definition AS T3
|
||||
ON T2.medication_def_id = T3.id
|
||||
AND T3.category_code IN ('1','2')
|
||||
|
||||
INNER JOIN adm_charge_item AS T4
|
||||
ON T1.id = T4.service_id
|
||||
|
||||
INNER JOIN med_medication_dispense AS T5
|
||||
ON T1.id = T5.med_req_id
|
||||
|
||||
DISTINCT
|
||||
T7.name AS department_name,
|
||||
T8.name AS doctor_name,
|
||||
T2.prescription_no,
|
||||
T4.name AS medicine_name,
|
||||
T3.total_volume,
|
||||
T1.dose,
|
||||
T2.rate_code,
|
||||
T1.method_code,
|
||||
T1.dose_unit_code,
|
||||
T2.max_dose,
|
||||
T2.first_dose,
|
||||
T2.first_duration,
|
||||
T2.dispense_interval,
|
||||
T2.dispense_per_quantity,
|
||||
T2.dispense_per_duration,
|
||||
T1.quantity,
|
||||
T5.unit_price,
|
||||
T5.total_price
|
||||
FROM med_medication_dispense AS T1
|
||||
INNER JOIN med_medication_request AS T2
|
||||
ON T1.med_req_id = T2.id
|
||||
INNER JOIN med_medication AS T3
|
||||
ON T1.medication_id = T3.id
|
||||
INNER JOIN med_medication_definition AS T4
|
||||
ON T3.medication_def_id = T4.id
|
||||
AND T4.category_code IN ('1','2')
|
||||
INNER JOIN adm_charge_item AS T5
|
||||
ON T1.med_req_id = T5.service_id
|
||||
INNER JOIN adm_encounter AS T6
|
||||
ON T1.encounter_id = T6.id
|
||||
|
||||
INNER JOIN adm_organization AS T7
|
||||
LEFT OUTER JOIN adm_organization AS T7
|
||||
ON T6.organization_id = T7.id
|
||||
|
||||
INNER JOIN adm_practitioner AS T8
|
||||
LEFT OUTER JOIN adm_practitioner AS T8
|
||||
ON T1.practitioner_id = T8.id
|
||||
|
||||
WHERE
|
||||
T1.encountId = #{encounterId}
|
||||
AND T5.status_enum = 3
|
||||
|
||||
T1.encounter_id = #{encounterId}
|
||||
AND T1.status_enum = 2
|
||||
ORDER BY
|
||||
T1.prescription_no,
|
||||
T1.medication_id
|
||||
prescription_no,
|
||||
medicine_name
|
||||
</select>
|
||||
<select id="selectDispenseInventoryInfoByPrescriptionNo" resultType="com.openhis.web.pharmacymanage.dto.DispenseInventoryDto">
|
||||
SELECT
|
||||
@@ -142,22 +126,16 @@
|
||||
T3.min_unit_code AS inventory_min_unit_code,
|
||||
T3.min_quantity AS inventory_min_quantity,
|
||||
T5.part_percent
|
||||
|
||||
FROM med_medication_dispense AS T1
|
||||
|
||||
INNER JOIN med_medication_request AS T2
|
||||
ON T1.med_req_id = T2.id
|
||||
|
||||
INNER JOIN wor_inventory_item AS T3
|
||||
ON T1.medication_id = T3.item_id
|
||||
AND T1.item_table = 'med_medication_definition'
|
||||
|
||||
AND T3.item_table = 'med_medication_definition'
|
||||
INNER JOIN med_medication AS T4
|
||||
ON T1.medication_id = T4.id
|
||||
|
||||
ON T1.medication_id = T4.id
|
||||
INNER JOIN med_medication_definition AS T5
|
||||
ON T4.medication_def_id = T5.id
|
||||
|
||||
ON T4.medication_def_id = T5.id
|
||||
WHERE
|
||||
T2.prescription_no = #{prescriptionNo}
|
||||
</select>
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum FinCategory implements HisEnumInterface {
|
||||
|
||||
/**
|
||||
* 自费
|
||||
*/
|
||||
SELF_PAY(1, "1", "自费"),
|
||||
|
||||
/**
|
||||
* 省医保
|
||||
*/
|
||||
PROVINCIAL_MEDICAL_INSURANCE(2, "2", "省医保"),
|
||||
|
||||
/**
|
||||
* 市医保
|
||||
*/
|
||||
MUNICIPAL_MEDICAL_INSURANCE(3, "3", "市医保");
|
||||
|
||||
private Integer value;
|
||||
private String code;
|
||||
private String info;
|
||||
|
||||
public static FinCategory getByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (FinCategory val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class MedicationRequest extends HisBaseEntity {
|
||||
*/
|
||||
private Long performLocation;
|
||||
|
||||
/** 发放科室 */
|
||||
/** 开方人科室 */
|
||||
private Long orgId;
|
||||
|
||||
/** 就诊id */
|
||||
|
||||
Reference in New Issue
Block a user