feature: Backend as Single Source of Truth for Batch-Type Field Requirements

This commit is contained in:
voltsrage
2026-06-27 23:47:56 +08:00
parent 4c28bffcc9
commit 5039dbb979
10 changed files with 245 additions and 44 deletions
@@ -270,16 +270,10 @@ const departments = [
'Anesthesiology',
]
const batchType = computed(() => props.batch?.batchType ?? '')
const showAllergies = computed(() =>
['ALLERGY_UPDATE', 'MIXED'].includes(batchType.value)
)
const showMedications = computed(() =>
['MEDICATION_LIST', 'MIXED'].includes(batchType.value)
)
const showEncounterSummary = computed(() =>
['ENCOUNTER_SUMMARY', 'MIXED'].includes(batchType.value)
)
const fieldReqs = computed(() => batchStore.currentDraft?.fieldRequirements)
const showAllergies = computed(() => fieldReqs.value?.showAllergies ?? false)
const showMedications = computed(() => fieldReqs.value?.showMedications ?? false)
const showEncounterSummary = computed(() => fieldReqs.value?.showEncounterSummaryFields ?? false)
const patient = reactive({
fullName: '',
@@ -220,10 +220,10 @@ const allergyFields = ref<FieldInfo[]>([])
const medicationFields = ref<FieldInfo[]>([])
const encounterFields = ref<FieldInfo[]>([])
const batchType = computed(() => props.batch?.batchType ?? '')
const showAllergies = computed(() => ['ALLERGY_UPDATE', 'MIXED'].includes(batchType.value))
const showMedications = computed(() => ['MEDICATION_LIST', 'MIXED'].includes(batchType.value))
const showEncounterSummary = computed(() => ['ENCOUNTER_SUMMARY', 'MIXED'].includes(batchType.value))
const fieldReqs = computed(() => batchStore.currentDraft?.fieldRequirements)
const showAllergies = computed(() => fieldReqs.value?.showAllergies ?? false)
const showMedications = computed(() => fieldReqs.value?.showMedications ?? false)
const showEncounterSummary = computed(() => fieldReqs.value?.showEncounterSummaryFields ?? false)
function parseJsonList(json: string | null): string[] {
if (!json) return []