Compare commits
4 Commits
bugfix/518
...
288f2133ca
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
288f2133ca | ||
|
|
d60eedf6a8 | ||
|
|
15daf26f6d | ||
|
|
b05dcab1e3 |
@@ -231,29 +231,49 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
// 费用定价主表ID集合
|
// 费用定价主表ID集合
|
||||||
List<Long> chargeItemDefinitionIdList = adviceBaseDtoList.stream().map(AdviceBaseDto::getChargeItemDefinitionId)
|
List<Long> chargeItemDefinitionIdList = adviceBaseDtoList.stream().map(AdviceBaseDto::getChargeItemDefinitionId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
// 医嘱库存集合
|
|
||||||
List<AdviceInventoryDto> adviceInventoryList = doctorStationAdviceAppMapper.getAdviceInventory(locationId,
|
// 判断是否包含药品或耗材类型(只有这些类型才需要库存相关查询)
|
||||||
adviceDefinitionIdList,
|
boolean hasMedOrDevice = adviceTypes != null
|
||||||
CommonConstants.SqlCondition.ABOUT_INVENTORY_TABLE_STR, PublicationStatus.ACTIVE.getValue());
|
&& (adviceTypes.contains(1) || adviceTypes.contains(2));
|
||||||
// 待发放个数信息
|
|
||||||
List<AdviceInventoryDto> adviceDraftInventoryList = doctorStationAdviceAppMapper.getAdviceDraftInventory(
|
// 医嘱库存集合 — 仅药品/耗材需要库存查询,手术/诊疗(3,6)无库存概念,跳过以减少数据库开销
|
||||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
List<AdviceInventoryDto> adviceInventoryList;
|
||||||
DispenseStatus.DRAFT.getValue(), DispenseStatus.PREPARATION.getValue());
|
List<AdviceInventoryDto> adviceDraftInventoryList;
|
||||||
// 预减库存
|
List<AdviceInventoryDto> adviceInventory;
|
||||||
List<AdviceInventoryDto> adviceInventory = adviceUtils.subtractInventory(adviceInventoryList,
|
if (hasMedOrDevice) {
|
||||||
adviceDraftInventoryList);
|
adviceInventoryList = doctorStationAdviceAppMapper.getAdviceInventory(locationId,
|
||||||
// 查询取药科室配置
|
adviceDefinitionIdList,
|
||||||
List<AdviceInventoryDto> medLocationConfig = doctorStationAdviceAppMapper.getMedLocationConfig(organizationId);
|
CommonConstants.SqlCondition.ABOUT_INVENTORY_TABLE_STR, PublicationStatus.ACTIVE.getValue());
|
||||||
// 将配置转为 {categoryCode -> 允许的locationId集合}
|
// 待发放个数信息
|
||||||
Map<String, Set<Long>> allowedLocByCategory = new HashMap<>();
|
adviceDraftInventoryList = doctorStationAdviceAppMapper.getAdviceDraftInventory(
|
||||||
if (medLocationConfig != null && !medLocationConfig.isEmpty()) {
|
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||||
for (AdviceInventoryDto cfg : medLocationConfig) {
|
DispenseStatus.DRAFT.getValue(), DispenseStatus.PREPARATION.getValue());
|
||||||
if (cfg.getCategoryCode() == null || cfg.getLocationId() == null) {
|
// 预减库存
|
||||||
continue;
|
adviceInventory = adviceUtils.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
|
||||||
|
} else {
|
||||||
|
adviceInventoryList = Collections.emptyList();
|
||||||
|
adviceDraftInventoryList = Collections.emptyList();
|
||||||
|
adviceInventory = Collections.emptyList();
|
||||||
|
}
|
||||||
|
// 查询取药科室配置 — 仅药品开单场景需要
|
||||||
|
List<AdviceInventoryDto> medLocationConfig;
|
||||||
|
Map<String, Set<Long>> allowedLocByCategory;
|
||||||
|
if (hasMedOrDevice) {
|
||||||
|
medLocationConfig = doctorStationAdviceAppMapper.getMedLocationConfig(organizationId);
|
||||||
|
// 将配置转为 {categoryCode -> 允许的locationId集合}
|
||||||
|
allowedLocByCategory = new HashMap<>();
|
||||||
|
if (medLocationConfig != null && !medLocationConfig.isEmpty()) {
|
||||||
|
for (AdviceInventoryDto cfg : medLocationConfig) {
|
||||||
|
if (cfg.getCategoryCode() == null || cfg.getLocationId() == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
allowedLocByCategory.computeIfAbsent(String.valueOf(cfg.getCategoryCode()), k -> new HashSet<>())
|
||||||
|
.add(cfg.getLocationId());
|
||||||
}
|
}
|
||||||
allowedLocByCategory.computeIfAbsent(String.valueOf(cfg.getCategoryCode()), k -> new HashSet<>())
|
|
||||||
.add(cfg.getLocationId());
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
medLocationConfig = Collections.emptyList();
|
||||||
|
allowedLocByCategory = Collections.emptyMap();
|
||||||
}
|
}
|
||||||
// 费用定价子表信息 - 使用分批处理避免大量参数问题
|
// 费用定价子表信息 - 使用分批处理避免大量参数问题
|
||||||
List<AdvicePriceDto> childCharge = new ArrayList<>();
|
List<AdvicePriceDto> childCharge = new ArrayList<>();
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ const finishCallPatient = async () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await completeEncounter(currentCallPatient.value.encounterId);
|
await completeEncounter({ encounterId: currentCallPatient.value.encounterId, firstEnum: currentCallPatient.value.firstEnum || 1 });
|
||||||
emit('finish');
|
emit('finish');
|
||||||
emit('update:dialogVisible', false);
|
emit('update:dialogVisible', false);
|
||||||
ElMessage.success('患者已完诊');
|
ElMessage.success('患者已完诊');
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const encounterId = ref();
|
const encounterId = ref();
|
||||||
|
const firstEnum = ref(1); // 初复诊标识:1=初诊,2=复诊
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getPatientList();
|
getPatientList();
|
||||||
});
|
});
|
||||||
@@ -127,6 +128,7 @@ function getPatientList() {
|
|||||||
|
|
||||||
function clickRow(row) {
|
function clickRow(row) {
|
||||||
encounterId.value = row.encounterId;
|
encounterId.value = row.encounterId;
|
||||||
|
firstEnum.value = row.firstEnum ?? row.first_enum ?? 1;
|
||||||
emits('cellClick', row);
|
emits('cellClick', row);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +184,7 @@ function handleComplete() {
|
|||||||
}
|
}
|
||||||
proxy.$modal.confirm('是否完成该患者问诊?').then(() => {
|
proxy.$modal.confirm('是否完成该患者问诊?').then(() => {
|
||||||
proxy.$modal.loading();
|
proxy.$modal.loading();
|
||||||
completeEncounter(encounterId.value).then(() => {
|
completeEncounter({ encounterId: encounterId.value, firstEnum: firstEnum.value }).then(() => {
|
||||||
proxy.$modal.closeLoading();
|
proxy.$modal.closeLoading();
|
||||||
proxy.$modal.msgSuccess('完成问诊成功');
|
proxy.$modal.msgSuccess('完成问诊成功');
|
||||||
getPatientList();
|
getPatientList();
|
||||||
|
|||||||
@@ -829,7 +829,7 @@
|
|||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding: 10px">
|
<div style="padding: 10px">
|
||||||
<prescriptionlist :patientInfo="chargePatientInfo" ref="prescriptionRef" />
|
<prescriptionlist v-if="showChargeDialog" :patientInfo="chargePatientInfo" ref="prescriptionRef" />
|
||||||
<div class="overlay" v-if="disabled"></div>
|
<div class="overlay" v-if="disabled"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user