Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3049bd1d7 | ||
|
|
4b0c3a6016 | ||
|
|
8951f1b0b2 | ||
|
|
28f313bd90 | ||
|
|
030b011e44 | ||
|
|
d529590978 | ||
|
|
2c560ab8b3 | ||
|
|
d7bcb2f171 | ||
|
|
2d60e3991e |
@@ -7,6 +7,7 @@ import com.core.common.utils.MessageUtils;
|
|||||||
import com.openhis.administration.domain.Location;
|
import com.openhis.administration.domain.Location;
|
||||||
import com.openhis.administration.domain.Organization;
|
import com.openhis.administration.domain.Organization;
|
||||||
import com.openhis.administration.domain.OrganizationLocation;
|
import com.openhis.administration.domain.OrganizationLocation;
|
||||||
|
import com.openhis.workflow.domain.ActivityDefinition;
|
||||||
import com.openhis.administration.mapper.OrganizationLocationMapper;
|
import com.openhis.administration.mapper.OrganizationLocationMapper;
|
||||||
import com.openhis.administration.service.ILocationService;
|
import com.openhis.administration.service.ILocationService;
|
||||||
import com.openhis.administration.service.IOrganizationLocationService;
|
import com.openhis.administration.service.IOrganizationLocationService;
|
||||||
@@ -70,6 +71,7 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
|||||||
// 获取科室下拉选列表
|
// 获取科室下拉选列表
|
||||||
List<Organization> organizationList = organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null);
|
List<Organization> organizationList = organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null);
|
||||||
List<OrgLocInitDto.departmentOption> organizationOptions = organizationList.stream()
|
List<OrgLocInitDto.departmentOption> organizationOptions = organizationList.stream()
|
||||||
|
.filter(organization -> organization != null && organization.getName() != null)
|
||||||
.map(organization -> new OrgLocInitDto.departmentOption(organization.getId(), organization.getName()))
|
.map(organization -> new OrgLocInitDto.departmentOption(organization.getId(), organization.getName()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
initDto.setLocationFormOptions(chargeItemStatusOptions).setDepartmentOptions(organizationOptions);
|
initDto.setLocationFormOptions(chargeItemStatusOptions).setDepartmentOptions(organizationOptions);
|
||||||
@@ -131,12 +133,18 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
|||||||
@Override
|
@Override
|
||||||
public R<?> addOrEditOrgLoc(OrgLocQueryDto orgLocQueryDto) {
|
public R<?> addOrEditOrgLoc(OrgLocQueryDto orgLocQueryDto) {
|
||||||
|
|
||||||
|
// Validate required fields before processing
|
||||||
|
if (orgLocQueryDto.getOrganizationId() == null) {
|
||||||
|
return R.fail("请选择执行科室");
|
||||||
|
}
|
||||||
|
|
||||||
OrganizationLocation orgLoc = new OrganizationLocation();
|
OrganizationLocation orgLoc = new OrganizationLocation();
|
||||||
BeanUtils.copyProperties(orgLocQueryDto, orgLoc);
|
BeanUtils.copyProperties(orgLocQueryDto, orgLoc);
|
||||||
|
|
||||||
Long activityDefinitionId = orgLoc.getActivityDefinitionId();
|
Long activityDefinitionId = orgLoc.getActivityDefinitionId();
|
||||||
String activityName = activityDefinitionId != null
|
ActivityDefinition activityDef = activityDefinitionId != null
|
||||||
? activityDefinitionMapper.selectById(activityDefinitionId).getName() : "";
|
? activityDefinitionMapper.selectById(activityDefinitionId) : null;
|
||||||
|
String activityName = activityDef != null ? activityDef.getName() : "";
|
||||||
|
|
||||||
List<OrganizationLocation> organizationLocationList =
|
List<OrganizationLocation> organizationLocationList =
|
||||||
organizationLocationService.getOrgLocListByOrgIdAndActivityDefinitionId(orgLoc.getActivityDefinitionId());
|
organizationLocationService.getOrgLocListByOrgIdAndActivityDefinitionId(orgLoc.getActivityDefinitionId());
|
||||||
|
|||||||
@@ -341,6 +341,28 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
&& (DbOpType.INSERT.getCode().equals(e.getDbOpType()) || DbOpType.UPDATE.getCode().equals(e.getDbOpType())))
|
&& (DbOpType.INSERT.getCode().equals(e.getDbOpType()) || DbOpType.UPDATE.getCode().equals(e.getDbOpType())))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 防重复保存:对新增医嘱进行去重,避免签发单条长期医嘱时产生重复记录
|
||||||
|
Set<String> longUniqueKeySet = new HashSet<>();
|
||||||
|
List<RegAdviceSaveDto> longUniqueList = new ArrayList<>();
|
||||||
|
for (RegAdviceSaveDto adviceSaveDto : longInsertOrUpdateList) {
|
||||||
|
String uniqueKey = adviceSaveDto.getPatientId() + "_"
|
||||||
|
+ adviceSaveDto.getEncounterId() + "_"
|
||||||
|
+ adviceSaveDto.getAdviceDefinitionId() + "_"
|
||||||
|
+ adviceSaveDto.getDose() + "_"
|
||||||
|
+ adviceSaveDto.getMethodCode() + "_"
|
||||||
|
+ adviceSaveDto.getRateCode();
|
||||||
|
if (DbOpType.INSERT.getCode().equals(adviceSaveDto.getDbOpType()) && longUniqueKeySet.contains(uniqueKey)) {
|
||||||
|
log.warn("防重复保存:检测到重复长期医嘱,跳过保存 - patientId={}, encounterId={}, adviceDefinitionId={}, dose={}",
|
||||||
|
adviceSaveDto.getPatientId(), adviceSaveDto.getEncounterId(),
|
||||||
|
adviceSaveDto.getAdviceDefinitionId(), adviceSaveDto.getDose());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
longUniqueKeySet.add(uniqueKey);
|
||||||
|
longUniqueList.add(adviceSaveDto);
|
||||||
|
}
|
||||||
|
log.info("防重复保存(长期):去重前{}条,去重后{}条", longInsertOrUpdateList.size(), longUniqueList.size());
|
||||||
|
longInsertOrUpdateList = longUniqueList;
|
||||||
|
|
||||||
for (RegAdviceSaveDto regAdviceSaveDto : longInsertOrUpdateList) {
|
for (RegAdviceSaveDto regAdviceSaveDto : longInsertOrUpdateList) {
|
||||||
boolean firstTimeSave = false;// 第一次保存
|
boolean firstTimeSave = false;// 第一次保存
|
||||||
longMedicationRequest = new MedicationRequest();
|
longMedicationRequest = new MedicationRequest();
|
||||||
@@ -406,6 +428,29 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
.getValue().equals(e.getTherapyEnum())
|
.getValue().equals(e.getTherapyEnum())
|
||||||
&& (DbOpType.INSERT.getCode().equals(e.getDbOpType()) || DbOpType.UPDATE.getCode().equals(e.getDbOpType())))
|
&& (DbOpType.INSERT.getCode().equals(e.getDbOpType()) || DbOpType.UPDATE.getCode().equals(e.getDbOpType())))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 防重复保存:对新增医嘱进行去重
|
||||||
|
Set<String> tempUniqueKeySet = new HashSet<>();
|
||||||
|
List<RegAdviceSaveDto> tempUniqueList = new ArrayList<>();
|
||||||
|
for (RegAdviceSaveDto adviceSaveDto : tempInsertOrUpdateList) {
|
||||||
|
String uniqueKey = adviceSaveDto.getPatientId() + "_"
|
||||||
|
+ adviceSaveDto.getEncounterId() + "_"
|
||||||
|
+ adviceSaveDto.getAdviceDefinitionId() + "_"
|
||||||
|
+ adviceSaveDto.getDose() + "_"
|
||||||
|
+ adviceSaveDto.getMethodCode() + "_"
|
||||||
|
+ adviceSaveDto.getRateCode();
|
||||||
|
if (DbOpType.INSERT.getCode().equals(adviceSaveDto.getDbOpType()) && tempUniqueKeySet.contains(uniqueKey)) {
|
||||||
|
log.warn("防重复保存:检测到重复临时医嘱,跳过保存 - patientId={}, encounterId={}, adviceDefinitionId={}, dose={}",
|
||||||
|
adviceSaveDto.getPatientId(), adviceSaveDto.getEncounterId(),
|
||||||
|
adviceSaveDto.getAdviceDefinitionId(), adviceSaveDto.getDose());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
tempUniqueKeySet.add(uniqueKey);
|
||||||
|
tempUniqueList.add(adviceSaveDto);
|
||||||
|
}
|
||||||
|
log.info("防重复保存(临时):去重前{}条,去重后{}条", tempInsertOrUpdateList.size(), tempUniqueList.size());
|
||||||
|
tempInsertOrUpdateList = tempUniqueList;
|
||||||
|
|
||||||
for (RegAdviceSaveDto regAdviceSaveDto : tempInsertOrUpdateList) {
|
for (RegAdviceSaveDto regAdviceSaveDto : tempInsertOrUpdateList) {
|
||||||
boolean firstTimeSave = false;// 第一次保存
|
boolean firstTimeSave = false;// 第一次保存
|
||||||
tempMedicationRequest = new MedicationRequest();
|
tempMedicationRequest = new MedicationRequest();
|
||||||
|
|||||||
@@ -231,7 +231,7 @@
|
|||||||
ae.priority_enum,
|
ae.priority_enum,
|
||||||
ae.organization_id,
|
ae.organization_id,
|
||||||
ae.start_time AS in_hos_time,
|
ae.start_time AS in_hos_time,
|
||||||
bed.start_time,
|
COALESCE(bed.start_time, ae.start_time) AS start_time,
|
||||||
bed.location_id AS bed_id,
|
bed.location_id AS bed_id,
|
||||||
bed.location_name AS bed_name,
|
bed.location_name AS bed_name,
|
||||||
house.location_id AS house_id,
|
house.location_id AS house_id,
|
||||||
|
|||||||
@@ -1318,7 +1318,11 @@ async function show(diagnosisData) {
|
|||||||
// 系统关联信息
|
// 系统关联信息
|
||||||
encounterId: patientInfo.encounterId || '', // 就诊ID
|
encounterId: patientInfo.encounterId || '', // 就诊ID
|
||||||
patientId: patientInfo.patientId || '', // 患者ID
|
patientId: patientInfo.patientId || '', // 患者ID
|
||||||
diagnosisId: diagnosisData?.conditionId || diagnosisData?.definitionId || '', // 诊断ID
|
diagnosisId: (diagnosisData?.conditionId != null && diagnosisData?.conditionId !== '')
|
||||||
|
? diagnosisData.conditionId
|
||||||
|
: (diagnosisData?.definitionId != null && diagnosisData?.definitionId !== '')
|
||||||
|
? diagnosisData.definitionId
|
||||||
|
: '', // 诊断ID
|
||||||
};
|
};
|
||||||
|
|
||||||
// 更新selectedDiseases数组
|
// 更新selectedDiseases数组
|
||||||
@@ -1373,7 +1377,7 @@ async function buildSubmitData() {
|
|||||||
const submitData = {
|
const submitData = {
|
||||||
cardNo: formData.cardNo,
|
cardNo: formData.cardNo,
|
||||||
visitId: props.patientInfo?.encounterId || formData.encounterId || null,
|
visitId: props.patientInfo?.encounterId || formData.encounterId || null,
|
||||||
diagId: formData.diagnosisId || null,
|
diagId: formData.diagnosisId ? Number(formData.diagnosisId) : null,
|
||||||
patId: formData.patientId || null,
|
patId: formData.patientId || null,
|
||||||
idType: 1, // 默认身份证
|
idType: 1, // 默认身份证
|
||||||
idNo: formData.idNo,
|
idNo: formData.idNo,
|
||||||
@@ -1539,6 +1543,12 @@ async function handleSubmit() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查诊断ID是否有效(后端 @NotNull 校验要求)
|
||||||
|
if (!form.value.diagnosisId) {
|
||||||
|
proxy.$modal.msgError('诊断信息不完整,请重新选择诊断后重试');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 开始加载状态,防止重复提交
|
// 开始加载状态,防止重复提交
|
||||||
submitLoading.value = true;
|
submitLoading.value = true;
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ import {computed, getCurrentInstance, ref, watch} from 'vue';
|
|||||||
import {Refresh, Search} from '@element-plus/icons-vue';
|
import {Refresh, Search} from '@element-plus/icons-vue';
|
||||||
import {patientInfo} from '../../store/patient.js';
|
import {patientInfo} from '../../store/patient.js';
|
||||||
import {getCheck} from './api';
|
import {getCheck} from './api';
|
||||||
import {getOrgList} from '@/views/doctorstation/components/api.js';
|
import {getDepartmentList} from '@/api/public.js';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
@@ -293,8 +293,8 @@ const hasMatchedFields = computed(() => {
|
|||||||
|
|
||||||
/** 查询科室 */
|
/** 查询科室 */
|
||||||
const getLocationInfo = () => {
|
const getLocationInfo = () => {
|
||||||
getOrgList().then((res) => {
|
getDepartmentList().then((res) => {
|
||||||
orgOptions.value = res.data.records;
|
orgOptions.value = res.data || [];
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -306,17 +306,19 @@ const recursionFun = (targetDepartment) => {
|
|||||||
name = obj.name;
|
name = obj.name;
|
||||||
}
|
}
|
||||||
const subObjArray = obj['children'];
|
const subObjArray = obj['children'];
|
||||||
for (let index = 0; index < subObjArray.length; index++) {
|
if (subObjArray && subObjArray.length > 0) {
|
||||||
const item = subObjArray[index];
|
for (let index = 0; index < subObjArray.length; index++) {
|
||||||
if (item.id == targetDepartment) {
|
const item = subObjArray[index];
|
||||||
name = item.name;
|
if (item.id == targetDepartment) {
|
||||||
|
name = item.name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleViewDetail = (row) => {
|
const handleViewDetail = async (row) => {
|
||||||
console.log('targetDepartment========>', JSON.stringify(row));
|
console.log('targetDepartment========>', JSON.stringify(row));
|
||||||
|
|
||||||
currentDetail.value = row;
|
currentDetail.value = row;
|
||||||
@@ -324,6 +326,15 @@ const handleViewDetail = (row) => {
|
|||||||
if (row.descJson) {
|
if (row.descJson) {
|
||||||
try {
|
try {
|
||||||
const obj = JSON.parse(row.descJson);
|
const obj = JSON.parse(row.descJson);
|
||||||
|
// 确保科室数据已加载
|
||||||
|
if (!orgOptions.value || orgOptions.value.length === 0) {
|
||||||
|
await new Promise((resolve) => {
|
||||||
|
getDepartmentList().then((res) => {
|
||||||
|
orgOptions.value = res.data || [];
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
||||||
descJsonData.value = obj;
|
descJsonData.value = obj;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ onMounted(() => {
|
|||||||
* type(1:watch监听类型 2:点击保存类型)
|
* type(1:watch监听类型 2:点击保存类型)
|
||||||
* selectProjectIds(选中项目的id数组)
|
* selectProjectIds(选中项目的id数组)
|
||||||
* */
|
* */
|
||||||
const projectWithDepartment = (selectProjectIds) => {
|
const projectWithDepartment = (selectProjectIds, type) => {
|
||||||
//1.获取选中的项目 2.判断项目的执行科室是否相同 3.判断执行科室是否配置 4.将项目的执行科室复值到执行科室下拉选位置
|
//1.获取选中的项目 2.判断项目的执行科室是否相同 3.判断执行科室是否配置 4.将项目的执行科室复值到执行科室下拉选位置
|
||||||
let isRelease = true;
|
let isRelease = true;
|
||||||
// 选中项目的数组
|
// 选中项目的数组
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ const submit = () => {
|
|||||||
encounterId: patientInfo.value.encounterId,
|
encounterId: patientInfo.value.encounterId,
|
||||||
organizationId: patientInfo.value.inHospitalOrgId,
|
organizationId: patientInfo.value.inHospitalOrgId,
|
||||||
requestFormId: '',
|
requestFormId: '',
|
||||||
name: '检查申请单',
|
name: applicationListAllFilter.map(item => item.adviceName).join('、'),
|
||||||
descJson: JSON.stringify(submitForm),
|
descJson: JSON.stringify(submitForm),
|
||||||
categoryEnum: '2',
|
categoryEnum: '2',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
@@ -801,8 +801,8 @@ function clickRowDb(row, column, event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
row.showPopover = false;
|
row.showPopover = false;
|
||||||
// “待签发(已保存 requestId存在)”不允许再编辑;仅“待保存(无requestId)”允许编辑
|
// 仅”待签发(statusEnum==1)”允许编辑;”已签发(statusEnum==2)”及之后状态不允许编辑
|
||||||
if (row.statusEnum == 1 && !row.requestId) {
|
if (row.statusEnum == 1) {
|
||||||
// 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1')
|
// 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1')
|
||||||
row.therapyEnum = String(row.therapyEnum ?? '1');
|
row.therapyEnum = String(row.therapyEnum ?? '1');
|
||||||
row.isEdit = true;
|
row.isEdit = true;
|
||||||
|
|||||||
@@ -1416,9 +1416,12 @@ function closeChargeDialog() {
|
|||||||
if (prescriptionRef.value && prescriptionRef.value.closeAllPopovers) {
|
if (prescriptionRef.value && prescriptionRef.value.closeAllPopovers) {
|
||||||
prescriptionRef.value.closeAllPopovers()
|
prescriptionRef.value.closeAllPopovers()
|
||||||
}
|
}
|
||||||
showChargeDialog.value = false
|
// 等 Vue 完成 DOM 更新后再关闭弹窗,确保 popover 先消失
|
||||||
chargePatientInfo.value = {}
|
nextTick(() => {
|
||||||
chargeSurgeryInfo.value = {}
|
showChargeDialog.value = false
|
||||||
|
chargePatientInfo.value = {}
|
||||||
|
chargeSurgeryInfo.value = {}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔧 新增:标志位,用于区分是"打开"还是"刷新"
|
// 🔧 新增:标志位,用于区分是"打开"还是"刷新"
|
||||||
|
|||||||
Reference in New Issue
Block a user