import React from 'react'; import type { AllergyIntolerance, Condition, FhirResource, Observation, QuestionnaireResponse } from 'fhir/r4'; import { Sheet, SheetContent } from '../ui/sheet'; import { FhirConditionDisplay } from '../FhirConditionDisplay/FhirConditionDisplay.tsx'; import { FhirAllergyIntoleranceDisplay } from '../FhirAllergyIntoleranceDisplay/FhirAllergyIntoleranceDisplay.tsx'; import { FhirObservationDisplay } from '../FhirObservationDisplay/FhirObservationDisplay.tsx'; import { FhirQuestionnaireResponseDisplay } from '../FhirQuestionnaireResponseDisplay/FhirQuestionnaireResponseDisplay.tsx'; import { ConditionModal } from '../../modals/ConditionModal.tsx'; import { ObservationModal } from '../../modals/ObservationModal.tsx'; import { AllergyIntoleranceModal } from '../../modals/AllergyIntoleranceModal.tsx'; /** The chosen linked record, opened read-only. */ export const LinkedRecordView: React.FC<{ record: FhirResource; onClose: () => void }> = ({ record, onClose }) => { switch (record.resourceType) { case 'Condition': return ; case 'AllergyIntolerance': return ; case 'QuestionnaireResponse': return ; case 'Observation': // The observation display is a sheet body, so it needs a host sheet. return ( { if (!open) onClose(); }}> ); default: return null; } }; /** A new record of the given kind, started from the picker. */ export const LinkedRecordCreate: React.FC<{ kind: string; onClose: () => void }> = ({ kind, onClose }) => { switch (kind) { case 'Condition': return ; case 'Observation': return ; case 'AllergyIntolerance': return ; default: return null; } }; /** Loaded on first use, so the patient's form never pulls in the clinical windows. */ const LinkedRecordWindow: React.FC<{ viewing?: FhirResource; creating?: string; onClose: () => void }> = ({ viewing, creating, onClose }) => ( <> {viewing && } {creating && } ); export default LinkedRecordWindow;