import React from 'react'; import { Schedule } from 'fhir/r4'; import { FhirCodeableConceptDisplay } from '../../utils/fhirCodeableConcept'; import { FhirPeriodDisplay } from '../../utils/fhirPeriod'; import { FhirIdentifierDisplay } from '../../utils/fhirIdentifier'; import { FhirReferenceDisplay } from '../../utils/fhirReference'; import { renderField } from '../../utils/renderField'; import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/dialog'; import { Card, CardHeader } from '../ui/card'; import { FieldHistoryProvider, FieldHistoryScope } from '../FieldHistory/FieldHistoryProvider'; import { ShowFieldHistoryToggle } from '../FieldHistory/ShowFieldHistoryToggle'; import { RecordEditedMarker } from '../FieldHistory/RecordEditedMarker'; import { FieldGroup, Section } from '../FieldHistory/FieldLayout'; interface FhirScheduleDisplayProps { schedule: Schedule; isOpen: boolean; onClose: () => void; title?: string; } export const FhirScheduleDisplay: React.FC = ({ schedule, isOpen, onClose, title = "Schedule Details" }) => { const renderActiveValue = () => { if (schedule?.active === true) { return 'Yes'; } if (schedule?.active === false) { return 'No'; } return '-'; }; const renderCommentValue = () => { if (!schedule?.comment) { return '-'; } return (
{schedule.comment}
); }; if (!isOpen) return null; return ( { if (!next) onClose(); }} >
{title}

{schedule?.actor?.[0]?.display || 'Schedule'}

{schedule?.resourceType}

{renderField('Practitioner Role', )} {renderField('Schedule is in active use', renderActiveValue(), 'active')} {renderField('Comment', renderCommentValue(), 'comment')} {renderField('Identifiers', )}
{renderField('Period of time covered by schedule', )}
{renderField('Service category', )} {renderField('Service type', )} {renderField('Type of specialty needed', )}
); }; export default FhirScheduleDisplay;