import type { AccessPolicyResource } from '@medplum/fhirtypes';
import { AddFavoriteParams } from '@medplum/core';
import { AddPharmacyResponse } from '@medplum/core';
import { addPreferredPharmacyToPatient } from '@medplum/core';
import type { Address } from '@medplum/fhirtypes';
import type { AddressFormatOptions } from '@medplum/core';
import type { AlertProps } from '@mantine/core';
import type { AnchorProps } from '@mantine/core';
import type { Annotation } from '@medplum/fhirtypes';
import type { Attachment } from '@medplum/fhirtypes';
import type { AvatarProps } from '@mantine/core';
import type { BadgeProps } from '@mantine/core';
import type { BaseLoginRequest } from '@medplum/core';
import type { Bundle } from '@medplum/fhirtypes';
import type { ButtonProps } from '@mantine/core';
import type { ClientApplication } from '@medplum/fhirtypes';
import type { CodeableConcept } from '@medplum/fhirtypes';
import type { Coding } from '@medplum/fhirtypes';
import type { ComboboxItem } from '@mantine/core';
import type { ComboboxProps } from '@mantine/core';
import type { Communication } from '@medplum/fhirtypes';
import { Component } from 'react';
import type { ComponentType } from 'react';
import type { ContactDetail } from '@medplum/fhirtypes';
import type { ContactPoint } from '@medplum/fhirtypes';
import type { ContainerProps } from '@mantine/core';
import { Context } from 'react';
import { createPreferredPharmacyExtension } from '@medplum/core';
import type { CSSProperties } from 'react';
import type { DiagnosticReport } from '@medplum/fhirtypes';
import type { DocumentReference } from '@medplum/fhirtypes';
import type { ElementDefinitionBinding } from '@medplum/fhirtypes';
import type { ElementDefinitionType } from '@medplum/fhirtypes';
import type { Encounter } from '@medplum/fhirtypes';
import type { ErrorInfo } from 'react';
import type { ExtendedInternalSchemaElement } from '@medplum/core';
import type { ExtractResource } from '@medplum/fhirtypes';
import type { Filter } from '@medplum/core';
import { ForwardRefExoticComponent } from 'react';
import { getPreferredPharmaciesFromPatient } from '@medplum/core';
import type { HumanName } from '@medplum/fhirtypes';
import type { HumanNameFormatOptions } from '@medplum/core';
import type { Identifier } from '@medplum/fhirtypes';
import type { InternalSchemaElement } from '@medplum/core';
import { isAddPharmacyResponse } from '@medplum/core';
import { isOrganizationArray } from '@medplum/core';
import type { JSX } from 'react';
import type { MeasureReport } from '@medplum/fhirtypes';
import type { Media } from '@medplum/fhirtypes';
import type { Medication } from '@medplum/fhirtypes';
import type { MedicationOrderRequest } from '@medplum/core';
import type { MedicationOrderResponse } from '@medplum/core';
import type { MedicationSearchParams } from '@medplum/core';
import type { MedplumClient } from '@medplum/core';
import { MemoExoticComponent } from 'react';
import type { Money } from '@medplum/fhirtypes';
import type { MouseEvent as MouseEvent_2 } from 'react';
import type { MouseEventHandler } from 'react';
import type { Observation } from '@medplum/fhirtypes';
import type { ObservationDefinition } from '@medplum/fhirtypes';
import type { ObservationDefinitionQualifiedInterval } from '@medplum/fhirtypes';
import type { OperationOutcome } from '@medplum/fhirtypes';
import type { OperationOutcomeIssue } from '@medplum/fhirtypes';
import { Operator } from '@medplum/core';
import type { Organization } from '@medplum/fhirtypes';
import type { PaperProps } from '@mantine/core';
import type { Patient } from '@medplum/fhirtypes';
import { PATIENT_PREFERRED_PHARMACY_URL } from '@medplum/core';
import type { Period } from '@medplum/fhirtypes';
import { PHARMACY_PREFERENCE_TYPE_SYSTEM } from '@medplum/core';
import { PHARMACY_TYPE_PREFERRED } from '@medplum/core';
import { PHARMACY_TYPE_PRIMARY } from '@medplum/core';
import { PharmacySearchParams } from '@medplum/core';
import type { PlanDefinition } from '@medplum/fhirtypes';
import type { Practitioner } from '@medplum/fhirtypes';
import { PreferredPharmacy } from '@medplum/core';
import type { ProfileResource } from '@medplum/core';
import type { Quantity } from '@medplum/fhirtypes';
import type { QueryTypes } from '@medplum/core';
import type { Questionnaire } from '@medplum/fhirtypes';
import type { QuestionnaireItem } from '@medplum/fhirtypes';
import type { QuestionnaireItemAnswerOption } from '@medplum/fhirtypes';
import type { QuestionnaireItemEnableWhen } from '@medplum/fhirtypes';
import type { QuestionnaireItemInitial } from '@medplum/fhirtypes';
import type { QuestionnaireResponse } from '@medplum/fhirtypes';
import type { QuestionnaireResponseItem } from '@medplum/fhirtypes';
import type { QuestionnaireResponseItemAnswer } from '@medplum/fhirtypes';
import type { Range as Range_2 } from '@medplum/fhirtypes';
import type { Ratio } from '@medplum/fhirtypes';
import type { ReactNode } from 'react';
import { RefAttributes } from 'react';
import type { Reference } from '@medplum/fhirtypes';
import { removePreferredPharmacyFromPatient } from '@medplum/core';
import type { RequestGroup } from '@medplum/fhirtypes';
import type { Resource } from '@medplum/fhirtypes';
import type { ResourceArray } from '@medplum/core';
import type { ResourceType } from '@medplum/fhirtypes';
import type { Schedule } from '@medplum/fhirtypes';
import type { SearchParameter } from '@medplum/fhirtypes';
import type { SearchRequest } from '@medplum/core';
import type { ServiceRequest } from '@medplum/fhirtypes';
import type { Signature } from '@medplum/fhirtypes';
import type { Slot } from '@medplum/fhirtypes';
import type { StructureDefinition } from '@medplum/fhirtypes';
import type { Subscription } from '@medplum/fhirtypes';
import type { SyntheticEvent } from 'react';
import type { TabsProps } from '@mantine/core';
import type { Task } from '@medplum/fhirtypes';
import type { TextProps } from '@mantine/core';
import type { Timing } from '@medplum/fhirtypes';
import type { TypedValue } from '@medplum/core';
import type { ValueSetExpandParams } from '@medplum/core';
import type { ValueSetExpansionContains } from '@medplum/fhirtypes';
import type { WithId } from '@medplum/core';
/**
* Adds a filter for a date between two dates (inclusive of both dates).
* @param definition - The original search request.
* @param field - The field key name.
* @param d1 - The start date.
* @param d2 - The end date.
* @returns The updated search request.
*/
export declare function addDateFilterBetween(definition: SearchRequest, field: string, d1: Date, d2: Date): SearchRequest;
export { AddFavoriteParams }
/**
* Adds a field.
* @param definition - The original search request.
* @param field - The field key name.
* @returns The updated search request.
*/
export declare function addField(definition: SearchRequest, field: string): SearchRequest;
/**
* Adds a filter.
* @param definition - The original search request.
* @param field - The field key name.
* @param op - The operation key name.
* @param value - The filter value.
* @param opt_clear - Optional flag to clear filters on the field.
* @returns The updated search request.
*/
export declare function addFilter(definition: SearchRequest, field: string, op: Operator, value?: string, opt_clear?: boolean): SearchRequest;
/**
* Adds a filter that constrains the specified field to "last month".
* @param definition - The original search request.
* @param field - The field key name.
* @returns The updated search request.
*/
export declare function addLastMonthFilter(definition: SearchRequest, field: string): SearchRequest;
/**
* Adds a filter that constrains the specified field to "missing".
* @param definition - The original search request.
* @param field - The field key name.
* @param value - Optional boolean value. Default is true.
* @returns The updated search request.
*/
export declare function addMissingFilter(definition: SearchRequest, field: string, value?: boolean): SearchRequest;
/**
* Adds a filter that constrains the specified field to "next 24 hours".
* @param definition - The original search request.
* @param field - The field key name.
* @returns The updated search request.
*/
export declare function addNext24HoursFilter(definition: SearchRequest, field: string): SearchRequest;
/**
* Adds a filter that constrains the specified field to "next month".
* @param definition - The original search request.
* @param field - The field key name.
* @returns The updated search request.
*/
export declare function addNextMonthFilter(definition: SearchRequest, field: string): SearchRequest;
export { AddPharmacyResponse }
export { addPreferredPharmacyToPatient }
export declare function AddressDisplay(props: AddressDisplayProps): JSX.Element | null;
export declare interface AddressDisplayProps {
readonly value?: Address;
readonly options?: AddressFormatOptions;
}
export declare function AddressInput(props: AddressInputProps): JSX.Element;
export declare type AddressInputProps = ComplexTypeInputProps
;
/**
* Adds a filter that constrains the specified field to "this month".
* @param definition - The original search request.
* @param field - The field key name.
* @returns The updated search request.
*/
export declare function addThisMonthFilter(definition: SearchRequest, field: string): SearchRequest;
/**
* Adds a filter that constrains the specified field to "today".
* @param definition - The original search request.
* @param field - The field key name.
* @returns The updated search request.
*/
export declare function addTodayFilter(definition: SearchRequest, field: string): SearchRequest;
/**
* Adds a filter that constrains the specified field to "tomorrow".
* @param definition - The original search request.
* @param field - The field key name.
* @returns The updated search request.
*/
export declare function addTomorrowFilter(definition: SearchRequest, field: string): SearchRequest;
/**
* Adds a filter that constrains the specified field to the year to date.
* @param definition - The original search request.
* @param field - The field key name.
* @returns The updated search request.
*/
export declare function addYearToDateFilter(definition: SearchRequest, field: string): SearchRequest;
/**
* Adds a filter that constrains the specified field to "yesterday".
* @param definition - The original search request.
* @param field - The field key name.
* @returns The updated search request.
*/
export declare function addYesterdayFilter(definition: SearchRequest, field: string): SearchRequest;
export declare function AIRealTimeQuestionnaireForm(props: AIRealTimeQuestionnaireFormProps): JSX.Element;
export declare interface AIRealTimeQuestionnaireFormProps extends QuestionnaireFormProps {
readonly aiModel?: string;
readonly onTranscript?: (fullTranscript: string, chunk: string) => void;
readonly voiceInstructions?: ReactNode;
}
/** Allergies section — searches for AllergyIntolerance resources. */
export declare const AllergiesSection: PatientSummarySectionConfig;
export declare function AnnotationInput(props: AnnotationInputProps): JSX.Element;
export declare interface AnnotationInputProps extends ComplexTypeInputProps {
}
export declare function AppShell(props: AppShellProps): JSX.Element;
export declare interface AppShellProps {
readonly logo: ReactNode;
readonly pathname?: string;
readonly searchParams?: URLSearchParams;
readonly headerSearchDisabled?: boolean;
readonly version?: string;
readonly menus?: NavbarMenu[];
readonly children: ReactNode;
readonly displayAddBookmark?: boolean;
readonly resourceTypeSearchDisabled?: boolean;
readonly notifications?: ReactNode;
readonly layoutVersion?: 'v1' | 'v2';
readonly showLayoutVersionToggle?: boolean;
readonly spotlightPatientsOnly?: boolean;
}
export declare function AsyncAutocomplete(props: AsyncAutocompleteProps): JSX.Element;
export declare interface AsyncAutocompleteOption extends ComboboxItem {
readonly active?: boolean;
readonly resource: T;
}
export declare interface AsyncAutocompleteProps extends Omit {
readonly name?: string;
readonly label?: ReactNode;
readonly description?: ReactNode;
readonly error?: ReactNode;
readonly defaultValue?: T | T[];
readonly toOption: (item: T) => AsyncAutocompleteOption;
readonly loadOptions: (input: string, signal: AbortSignal) => Promise;
readonly itemComponent?: (props: AsyncAutocompleteOption) => JSX.Element | ReactNode;
readonly pillComponent?: (props: {
item: AsyncAutocompleteOption;
disabled?: boolean;
onRemove: () => void;
}) => JSX.Element;
readonly emptyComponent?: (props: {
search: string;
}) => JSX.Element | ReactNode;
readonly onChange: (item: T[]) => void;
readonly onCreate?: (input: string) => T;
readonly creatable?: boolean;
readonly clearable?: boolean;
readonly required?: boolean;
readonly className?: string;
readonly placeholder?: string;
readonly leftSection?: ReactNode;
readonly maxValues?: number;
readonly optionsDropdownMaxHeight?: number;
readonly minInputLength?: number;
}
export declare function AttachmentArrayDisplay(props: AttachmentArrayDisplayProps): JSX.Element;
export declare interface AttachmentArrayDisplayProps {
readonly path?: string;
readonly values?: Attachment[];
readonly maxWidth?: number;
readonly includeDescriptionListEntry?: boolean;
readonly property?: InternalSchemaElement;
}
export declare function AttachmentArrayInput(props: AttachmentArrayInputProps): JSX.Element;
export declare interface AttachmentArrayInputProps {
readonly name: string;
readonly defaultValue?: Attachment[];
readonly arrayElement?: boolean;
readonly onChange?: (value: Attachment[]) => void;
readonly disabled?: boolean;
}
export declare function AttachmentButton(props: AttachmentButtonProps): JSX.Element;
export declare interface AttachmentButtonProps {
readonly securityContext?: Reference;
readonly onUpload: (attachment: Attachment) => void;
readonly onUploadStart?: () => void;
readonly onUploadProgress?: (e: ProgressEvent) => void;
readonly onUploadError?: (outcome: OperationOutcome) => void;
children(props: {
disabled?: boolean;
onClick(e: MouseEvent_2): void;
}): ReactNode;
readonly disabled?: boolean;
}
export declare function AttachmentDisplay(props: AttachmentDisplayProps): JSX.Element | null;
export declare interface AttachmentDisplayProps {
readonly value?: Attachment;
readonly maxWidth?: number;
}
export declare function AttachmentInput(props: AttachmentInputProps): JSX.Element;
export declare interface AttachmentInputProps extends ComplexTypeInputProps {
readonly arrayElement?: boolean;
readonly securityContext?: Reference;
readonly onChange?: (value: Attachment | undefined) => void;
}
export declare function BackboneElementDisplay(props: BackboneElementDisplayProps): JSX.Element | null;
export declare interface BackboneElementDisplayProps {
readonly value: TypedValue;
/** The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. */
readonly path: string;
readonly compact?: boolean;
readonly ignoreMissingValues?: boolean;
readonly link?: boolean;
/** (optional) Profile URL of the structure definition represented by the backbone element */
readonly profileUrl?: string;
/**
* (optional) If provided, inputs specified in `accessPolicyResource.hiddenFields` are not shown.
*/
readonly accessPolicyResource?: AccessPolicyResource;
}
export declare function BackboneElementInput(props: BackboneElementInputProps): JSX.Element;
export declare interface BackboneElementInputProps extends BaseInputProps {
/** Type name the backbone element represents */
readonly typeName: string;
/** (optional) The contents of the resource represented by the backbone element */
readonly defaultValue?: any;
/** (optional) callback function that is called when the value of the backbone element changes */
readonly onChange?: (value: any) => void;
/** (optional) Profile URL of the structure definition represented by the backbone element */
readonly profileUrl?: string;
/**
* (optional) If provided, inputs specified in `accessPolicyResource.readonlyFields` are not editable
* and inputs specified in `accessPolicyResource.hiddenFields` are not shown.
*/
readonly accessPolicyResource?: AccessPolicyResource;
}
/**
* BaseChat component for displaying and managing communications.
*
* **NOTE: The component automatically filters `Communication` resources where the `sent` property is `undefined`.**
*
* @param props - The BaseChat React props.
* @returns The BaseChat React node.
*/
export declare function BaseChat(props: BaseChatProps): JSX.Element | null;
export declare interface BaseChatProps extends PaperProps {
readonly title: string;
readonly communications: Communication[];
readonly setCommunications: (communications: Communication[]) => void;
readonly query: string;
readonly sendMessage: (content: string, file?: File, existingDocRef?: DocumentReference) => void;
readonly onMessageReceived?: (message: Communication) => void;
readonly onMessageUpdated?: (message: Communication) => void;
readonly inputDisabled?: boolean;
readonly excludeHeader?: boolean;
readonly onError?: (err: Error) => void;
readonly uploadEnabled?: boolean;
readonly attachmentSubjectRef?: Reference;
readonly onViewInDocuments?: (reference: Reference) => void;
}
export declare interface BaseInputProps {
/** The path identifying the related element definition and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. */
readonly path: string;
/** (optional) A FHIRPath expression that identifies the input more precisely than `path`, e.g. `Patient.identifier[0].system` versus `Patient.identifier.system` */
readonly valuePath?: string;
/** (optional) OperationOutcome from the last attempted system action*/
readonly outcome?: OperationOutcome;
}
/**
* A generic widget to choose an option by date/time. Renders a monthly
* calendar UI and lets the viewer drill down into options on a given day.
*
* @param props - The React props
* @returns the JSX Element
*/
export declare function BaseScheduler(props: BaseSchedulerProps): JSX.Element | null;
export declare interface BaseSchedulerProps {
/** A Reference or Resource to the actor being scheduled against (typically a Practitioner) */
readonly actor?: Reference | Resource;
/** A function that fetches SchedulingOption pairs. If this is not a stable function it can cause duplicate queries. */
readonly fetchOptions: FetchOptionsFunction;
/** React nodes to render inside the scheduler container */
readonly children?: React.ReactNode;
/** A callback invoked when a specific option is selected */
readonly onSelectOption?: (el: T, date: Date) => void;
}
/**
* Returns a field display name.
* @param key - The field key.
* @returns The field display name.
*/
export declare function buildFieldNameString(key: string): string;
export declare function buildInitialResponse(questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse): QuestionnaireResponse;
export declare function buildInitialResponseItem(item: QuestionnaireItem): QuestionnaireResponseItem;
export declare function CalendarDateInput(props: CalendarDateInputProps): JSX.Element;
export declare interface CalendarDateInputProps {
readonly availableDates: Date[];
readonly onChangeMonth: (date: Date) => void;
readonly onClick: (date: Date) => void;
}
export declare function CalendarInput(props: CalendarInputProps): JSX.Element;
export declare interface CalendarInputProps {
readonly slots: Slot[];
readonly onChangeMonth: (date: Date) => void;
readonly onClick: (date: Date) => void;
}
export declare function ChangePasswordForm(props: ChangePasswordFormProps): JSX.Element;
export declare interface ChangePasswordFormProps {
readonly onSuccess?: () => void;
}
export declare interface ChatBubbleSkeletonProps {
readonly alignment: 'left' | 'right';
readonly parentWidth: number;
}
export declare const ChatList: (props: ChatListProps) => JSX.Element;
export declare const ChatListItem: (props: ChatListItemProps) => JSX.Element;
export declare interface ChatListItemProps {
topic: Communication;
lastCommunication: Communication | undefined;
isSelected: boolean;
getThreadUri: (topic: Communication) => string;
}
export declare interface ChatListProps {
threads: [Communication, Communication | undefined][];
selectedCommunication: Communication | undefined;
getThreadUri: (topic: Communication) => string;
}
export declare function ChatModal(props: ChatModalProps): JSX.Element | null;
export declare interface ChatModalProps {
readonly open?: boolean;
readonly children: ReactNode;
}
export declare function CheckboxFormSection(props: CheckboxFormSectionProps): JSX.Element;
export declare interface CheckboxFormSectionProps {
readonly htmlFor?: string;
readonly title?: string;
readonly description?: string;
readonly withAsterisk?: boolean;
readonly children?: ReactNode;
readonly testId?: string;
readonly fhirPath?: string;
readonly readonly?: boolean;
}
/**
* Clears all of the filters.
* @param definition - The original search request.
* @returns The updated search request.
*/
export declare function clearFilters(definition: SearchRequest): SearchRequest;
/**
* Clears all of the filters on a certain field.
* @param definition - The original search request.
* @param code - The field key name to clear filters.
* @returns The updated search request.
*/
export declare function clearFiltersOnField(definition: SearchRequest, code: string): SearchRequest;
export declare function CodeableConceptDisplay(props: CodeableConceptDisplayProps): JSX.Element;
export declare interface CodeableConceptDisplayProps {
readonly value?: CodeableConcept;
}
export declare function CodeableConceptInput(props: CodeableConceptInputProps): JSX.Element;
export declare interface CodeableConceptInputProps extends Omit, ComplexTypeInputProps {
readonly onChange?: (value: CodeableConcept | undefined) => void;
}
export declare function CodeInput(props: CodeInputProps): JSX.Element;
export declare interface CodeInputProps extends Omit {
readonly defaultValue?: string;
readonly onChange: ((value: string | undefined) => void) | undefined;
}
export declare function CodingDisplay(props: CodingDisplayProps): JSX.Element;
export declare interface CodingDisplayProps {
readonly value?: Coding;
readonly includeCode?: boolean;
}
export declare function CodingInput(props: CodingInputProps): JSX.Element;
export declare interface CodingInputProps extends Omit, ComplexTypeInputProps {
readonly response?: QuestionnaireResponseItem;
}
export declare function codingToValueSetElement(coding: Coding): ValueSetExpansionContains;
export declare type Command = {
command: string;
value?: T;
};
export declare interface ComplexTypeInputProps extends BaseInputProps {
readonly name: string;
readonly defaultValue?: ValueType;
readonly onChange?: (value: ValueType, propName?: string) => void;
readonly disabled?: boolean;
}
export declare function ContactDetailDisplay(props: ContactDetailDisplayProps): JSX.Element | null;
export declare interface ContactDetailDisplayProps {
readonly value?: ContactDetail;
}
export declare function ContactDetailInput(props: ContactDetailInputProps): JSX.Element;
export declare type ContactDetailInputProps = ComplexTypeInputProps;
export declare function ContactPointDisplay(props: ContactPointDisplayProps): JSX.Element | null;
export declare interface ContactPointDisplayProps {
readonly value?: ContactPoint;
}
export declare function ContactPointInput(props: ContactPointInputProps): JSX.Element;
export declare type ContactPointInputProps = ComplexTypeInputProps & {
readonly onChange?: (value: ContactPoint | undefined) => void;
};
export declare function Container(props: ContainerProps): JSX.Element;
/**
* Converts an ISO-8601 date/time string to a local date/time string.
* @param isoString - The ISO-8601 date/time string to convert.
* @returns The local date/time string.
*/
export declare function convertIsoToLocal(isoString: string | undefined): string;
/**
* Converts a local date/time string to an ISO-8601 date/time string.
* @param localString - The local date/time string to convert.
* @returns The ISO-8601 date/time string.
*/
export declare function convertLocalToIso(localString: string | undefined): string;
export declare function convertToPCM16(float32Array: Float32Array): Uint8Array;
/**
* Labs section — searches for both ServiceRequest and DiagnosticReport resources.
* Accepts an optional `onRequestLabs` callback via closure.
* @param onRequestLabs - Optional callback invoked when the user requests labs.
* @returns A section config for labs.
*/
export declare function createLabsSection(onRequestLabs?: () => void): PatientSummarySectionConfig;
/**
* Pharmacies section — no FHIR searches; the Pharmacies component resolves its own data
* from patient extensions.
* Accepts an optional `pharmacyDialogComponent` via closure.
* @param pharmacyDialogComponent - Optional component for the pharmacy search dialog.
* @returns A section config for pharmacies.
*/
export declare function createPharmaciesSection(pharmacyDialogComponent?: ComponentType): PatientSummarySectionConfig;
export { createPreferredPharmacyExtension }
/**
* Dynamically creates a script tag for the specified JavaScript file.
* @param src - The JavaScript file URL.
* @param onload - Optional callback for the onload event.
*/
export declare function createScriptTag(src: string, onload?: () => void): void;
/**
* The DateTimeInput component is a wrapper around the HTML5 input type="datetime-local".
* The main purpose is to reconcile time zones.
* Most of our date/time values are in ISO-8601, which includes a time zone offset.
* The datetime-local input does not support the time zone offset.
* @param props - The Input props.
* @returns The JSX element to render.
*/
export declare function DateTimeInput(props: DateTimeInputProps): JSX.Element;
export declare interface DateTimeInputProps extends PrimitiveTypeInputProps {
readonly label?: string;
readonly placeholder?: string;
readonly defaultValue?: string;
readonly autoFocus?: boolean;
readonly outcome?: OperationOutcome;
readonly onChange?: (value: string) => void;
}
/**
* Default item component for resource autocomplete inputs.
* Displays the resource avatar, display name, and birth date or ID.
*/
export declare const DefaultResourceItemComponent: ForwardRefExoticComponent & RefAttributes>;
export declare function DefaultResourceTimeline(props: DefaultResourceTimelineProps): JSX.Element;
export declare interface DefaultResourceTimelineProps extends Pick, 'getMenu'> {
readonly resource: Resource | Reference;
}
/**
* Deletes a filter at the specified index.
* @param definition - The original search request.
* @param index - The filter index.
* @returns The updated search request.
*/
export declare function deleteFilter(definition: SearchRequest, index: number): SearchRequest;
/** Demographics section — no FHIR searches, renders patient info items directly. */
export declare const DemographicsSection: PatientSummarySectionConfig;
export declare function DescriptionList(props: DescriptionListProps): JSX.Element;
export declare function DescriptionListEntry(props: DescriptionListEntryProps): JSX.Element;
export declare interface DescriptionListEntryProps {
readonly term: string;
readonly children: ReactNode;
}
export declare interface DescriptionListProps {
readonly children: ReactNode;
readonly compact?: boolean;
}
export declare function DiagnosticReportDisplay(props: DiagnosticReportDisplayProps): JSX.Element | null;
export declare namespace DiagnosticReportDisplay {
var defaultProps: DiagnosticReportDisplayProps;
}
export declare interface DiagnosticReportDisplayProps {
readonly value?: DiagnosticReport | Reference;
readonly hideObservationNotes?: boolean;
readonly hideSpecimenInfo?: boolean;
readonly hideSubject?: boolean;
}
declare function Document_2(props: PanelProps): JSX.Element;
export { Document_2 as Document }
export declare function ElementDefinitionInputSelector(props: ElementDefinitionSelectorProps): JSX.Element;
export declare interface ElementDefinitionSelectorProps extends ResourcePropertyInputProps {
readonly elementDefinitionTypes: ElementDefinitionType[];
}
export declare function ElementDefinitionTypeInput(props: ElementDefinitionTypeInputProps): JSX.Element;
export declare interface ElementDefinitionTypeInputProps extends Pick {
readonly elementDefinitionType: ElementDefinitionType;
readonly min: number;
readonly max: number;
readonly binding: ElementDefinitionBinding | undefined;
readonly readOnly?: boolean;
}
export declare function EncounterTimeline(props: EncounterTimelineProps): JSX.Element;
export declare interface EncounterTimelineProps extends Pick, 'getMenu'> {
readonly encounter: Encounter | Reference;
}
/**
* ErrorBoundary is a React component that handles errors in its child components.
* See: https://reactjs.org/docs/error-boundaries.html
*/
export declare class ErrorBoundary extends Component {
readonly state: ErrorBoundaryState;
constructor(props: ErrorBoundaryProps);
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
componentDidUpdate(_prevProps: ErrorBoundaryProps, _prevState: ErrorBoundaryState): void;
shouldComponentUpdate(nextProps: ErrorBoundaryProps, nextState: ErrorBoundaryState): boolean;
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
render(): ReactNode;
}
export declare interface ErrorBoundaryProps {
readonly children: ReactNode;
}
export declare interface ErrorBoundaryState {
readonly error?: Error;
readonly lastLocation: string;
}
/**
* Evaluates the calculated expressions in a questionnaire.
* Updates response item answers in place with the calculated values.
*
* See: https://build.fhir.org/ig/HL7/sdc/StructureDefinition-sdc-questionnaire-calculatedExpression.html
*
* @param items - The questionnaire items to evaluate.
* @param response - The questionnaire response to evaluate against.
* @param responseItems - The response items to update.
*/
export declare function evaluateCalculatedExpressionsInQuestionnaire(items: QuestionnaireItem[], response: QuestionnaireResponse, responseItems?: QuestionnaireResponseItem[] | undefined): void;
/**
* Creates a Blob object from the JSON object given and downloads the object.
* @param jsonString - The JSON string.
* @param fileName - Optional file name. Default is based on current timestamp.
*/
export declare function exportJsonFile(jsonString: string, fileName?: string): void;
export declare type FetchOptionsFunction = (period: Period) => Promise[]>;
/**
* The FhirPathTable component represents the embeddable search table control.
* @param props - FhirPathTable React props.
* @returns FhirPathTable React node.
*/
export declare function FhirPathTable(props: FhirPathTableProps): JSX.Element;
export declare interface FhirPathTableField {
readonly propertyType: string;
readonly name: string;
readonly fhirPath: string;
}
export declare interface FhirPathTableProps {
readonly resourceType: string;
readonly query: string;
readonly fields: FhirPathTableField[];
readonly checkboxesEnabled?: boolean;
readonly onClick?: (e: SearchClickEvent) => void;
readonly onAuxClick?: (e: SearchClickEvent) => void;
readonly onBulk?: (ids: string[]) => void;
}
/** Descriptor for a single FHIR search that a section needs. */
export declare interface FhirSearchDescriptor {
/** Unique key used to access this search's results via `SectionResults[key]`. */
readonly key: string;
readonly resourceType: ResourceType;
/** Which search param references the patient. Defaults to 'subject'. Examples: 'patient', 'beneficiary'. */
readonly patientParam?: string;
/**
* Additional search params — same format as the 2nd arg to medplum.searchResources().
* When using a string, do not include _count or _sort; they are appended automatically.
*/
readonly query?: QueryTypes;
}
export declare function Form(props: FormProps): JSX.Element;
export declare interface FormProps {
readonly onSubmit?: (formData: Record) => Promise | void;
readonly style?: CSSProperties;
readonly children?: ReactNode;
readonly testid?: string;
}
export declare function FormSection(props: FormSectionProps): JSX.Element;
export declare interface FormSectionProps {
readonly title?: string;
readonly htmlFor?: string;
readonly description?: string;
readonly withAsterisk?: boolean;
readonly outcome?: OperationOutcome;
readonly children?: ReactNode;
readonly testId?: string;
readonly fhirPath?: string;
readonly errorExpression?: string;
readonly readonly?: boolean;
}
/**
* Returns the application name from environment variables or a default value.
* @returns The application name.
*/
export declare function getAppName(): string;
/**
* Returns the default set of sections, matching the original hardcoded PatientSummary layout.
* The `onRequestLabs` callback is threaded through to the Labs section.
* @param onRequestLabs - Optional callback invoked when the user requests labs.
* @returns The default array of section configs.
*/
export declare function getDefaultSections(onRequestLabs?: () => void): PatientSummarySectionConfig[];
export declare function getErrorsForInput(outcome: OperationOutcome | undefined, expression: string | undefined): string | undefined;
/**
* Returns the collection of field definitions for the search request.
* @param search - The search request definition.
* @returns An array of field definitions.
*/
export declare function getFieldDefinitions(search: SearchRequest): SearchControlField[];
export declare function getIssuesForExpression(outcome: OperationOutcome | undefined, expression: string | undefined): OperationOutcomeIssue[] | undefined;
export declare function getItemAnswerOptionValue(option: QuestionnaireItemAnswerOption): TypedValue;
export declare function getItemEnableWhenValueAnswer(enableWhen: QuestionnaireItemEnableWhen): TypedValue;
export declare function getItemInitialValue(initial: QuestionnaireItemInitial | undefined): TypedValue;
export declare function getNewMultiSelectValues(selected: string[], propertyName: string, item: QuestionnaireItem): QuestionnaireResponseItemAnswer[];
/**
* Returns a string representing the operation.
* @param op - The operation code.
* @returns A display string for the operation.
*/
export declare function getOpString(op: Operator): string;
/**
* Returns control properties for pagination controls.
* This is specifically for the Mantine Pagination component.
* See: https://v7.mantine.dev/core/pagination/?t=props
* @param controlName - The name of the pagination control (e.g., 'previous', 'next').
* @returns The properties for the pagination control.
*/
export declare function getPaginationControlProps(controlName: string): Record;
export { getPreferredPharmaciesFromPatient }
/**
* Returns the reference filter for the given questionnaire item.
* @see https://build.fhir.org/ig/HL7/fhir-extensions/StructureDefinition-questionnaire-referenceFilter-definitions.html
* @param item - The questionnaire item to get the reference filter for.
* @param subject - Optional subject reference.
* @param encounter - Optional encounter reference.
* @returns The reference filter as a map of key/value pairs.
*/
export declare function getQuestionnaireItemReferenceFilter(item: QuestionnaireItem, subject: Reference | undefined, encounter: Reference | undefined): Record | undefined;
export declare function getQuestionnaireItemReferenceTargetTypes(item: QuestionnaireItem): ResourceType[] | undefined;
/**
* Starts a request to generate a recapcha token.
* @param siteKey - The reCAPTCHA site key, available from the reCAPTCHA admin page.
* @returns Promise to a recaptcha token for the current user.
*/
export declare function getRecaptcha(siteKey: string): Promise;
export declare function getResponseItemAnswerValue(answer: QuestionnaireResponseItemAnswer): TypedValue | undefined;
/**
* Returns a list of operators for a search parameter.
* @param searchParam - The search parameter.
* @returns The list of operators that can be used for the search parameter.
*/
export declare function getSearchOperators(searchParam: SearchParameter): Operator[] | undefined;
export declare function getSortField(definition: SearchRequest): string | undefined;
export declare function getValuePath(elementPath: string, valuePath: string | undefined, arrayIndex?: number): string;
export declare function Header(props: HeaderProps): JSX.Element;
export declare interface HeaderProps {
readonly pathname?: string;
readonly searchParams?: URLSearchParams;
readonly headerSearchDisabled?: boolean;
readonly logo: ReactNode;
readonly version?: string;
readonly navbarOpen?: boolean;
readonly navbarToggle: () => void;
readonly notifications?: ReactNode;
}
export declare type HeaderSearchTypes = Patient | ServiceRequest;
export declare function HumanNameDisplay(props: HumanNameDisplayProps): JSX.Element | null;
export declare interface HumanNameDisplayProps {
readonly value?: HumanName;
readonly options?: HumanNameFormatOptions;
}
export declare function HumanNameInput(props: HumanNameInputProps): JSX.Element;
export declare type HumanNameInputProps = ComplexTypeInputProps;
export declare function IdentifierDisplay(props: IdentifierDisplayProps): JSX.Element;
export declare interface IdentifierDisplayProps {
readonly value?: Identifier;
}
export declare function IdentifierInput(props: IdentifierInputProps): JSX.Element;
export declare type IdentifierInputProps = ComplexTypeInputProps;
export declare function InfoBar(props: InfoBarProps): JSX.Element;
export declare namespace InfoBar {
var Entry: (props: InfoBarEntryProps) => JSX.Element;
var Key: (props: InfoBarKeyProps) => JSX.Element;
var Value: (props: InfoBarValueProps) => JSX.Element;
}
export declare interface InfoBarEntryProps {
readonly children: ReactNode;
}
export declare interface InfoBarKeyProps {
readonly children: ReactNode;
}
export declare interface InfoBarProps {
readonly children: ReactNode;
}
export declare interface InfoBarValueProps {
readonly children: ReactNode;
}
/**
* Dynamically loads the recaptcha script.
* We do not want to load the script on page load unless the user needs it.
* @param siteKey - The reCAPTCHA site key, available from the reCAPTCHA admin page.
*/
export declare function initRecaptcha(siteKey: string): void;
/** Insurance section — searches for Coverage resources. */
export declare const InsuranceSection: PatientSummarySectionConfig;
export declare type IntervalGroup = {
id: string;
filters: Record;
intervals: ObservationDefinitionQualifiedInterval[];
};
export { isAddPharmacyResponse }
/**
* Returns true if the event is an auxiliary click.
* @param e - The event.
* @returns True if the event is an auxiliary click.
*/
export declare function isAuxClick(e: MouseEvent_2): boolean;
/**
* Returns true if the element is a checkbox or a table cell containing a checkbox.
* Table cells containing checkboxes are commonly accidentally clicked.
* @param el - The HTML DOM element.
* @returns True if the element is a checkbox or a table cell containing a checkbox.
*/
export declare function isCheckboxCell(el: Element): boolean;
/**
* Returns true if the item is a choice question.
* @param item - The questionnaire item to check.
* @returns True if the item is a choice question, false otherwise.
*/
export declare function isChoiceQuestion(item: QuestionnaireItem): boolean;
export { isOrganizationArray }
/**
* Returns true if the questionnaire item is enabled based on the enableWhen conditions or expression.
* @param item - The questionnaire item to check.
* @param questionnaireResponse - The questionnaire response to check against.
* @returns True if the question is enabled, false otherwise.
*/
export declare function isQuestionEnabled(item: QuestionnaireItem, questionnaireResponse: QuestionnaireResponse | undefined): boolean;
export declare function isSortDescending(definition: SearchRequest): boolean;
export declare function isSupportedProfileStructureDefinition(profile?: StructureDefinition): profile is SupportedProfileStructureDefinition;
/**
* Kills a browser event.
* Prevents default behavior.
* Stops event propagation.
* @param e - The event.
*/
export declare function killEvent(e: Event | SyntheticEvent): void;
/** Default Labs section constant (no onRequestLabs callback). */
export declare const LabsSection: PatientSummarySectionConfig;
export declare function LinkTabs(props: LinkTabsProps): JSX.Element;
export declare interface LinkTabsProps extends Omit {
readonly baseUrl: string;
readonly tabs: string[] | TabDefinition[];
readonly children?: React.ReactNode;
}
export declare function Loading(): JSX.Element;
export declare function Logo(props: LogoProps): JSX.Element;
export declare interface LogoProps {
readonly size: number;
readonly fill?: string;
}
export declare function MeasureReportDisplay(props: MeasureReportDisplayProps): JSX.Element | null;
export declare interface MeasureReportDisplayProps {
readonly measureReport: MeasureReport | Reference;
}
export declare interface MedicationIFrameOptions {
readonly patientId?: string;
readonly onPatientSyncSuccess?: () => void;
readonly onIframeSuccess?: (url: string) => void;
readonly onError?: (err: unknown) => void;
}
/** Medications section — searches for MedicationRequest resources. */
export declare const MedicationsSection: PatientSummarySectionConfig;
export declare interface MedplumContext {
medplum: MedplumClient;
navigate: MedplumNavigateFunction;
profile?: ProfileResource;
loading: boolean;
}
export declare function MedplumLink(props: MedplumLinkProps): JSX.Element;
export declare interface MedplumLinkProps extends AnchorProps {
readonly to?: Resource | Reference | string;
readonly suffix?: string;
readonly label?: string;
readonly onClick?: MouseEventHandler;
readonly children: ReactNode;
}
export declare type MedplumNavigateFunction = (path: string) => void;
/**
* The MedplumProvider component provides Medplum context state.
*
* Medplum context includes:
* 1) medplum - Medplum client library
* 2) profile - The current user profile (if signed in)
* @param props - The MedplumProvider React props.
* @returns The MedplumProvider React node.
*/
export declare function MedplumProvider(props: MedplumProviderProps): JSX.Element;
export declare interface MedplumProviderProps {
readonly medplum: MedplumClient;
readonly navigate?: MedplumNavigateFunction;
readonly children: ReactNode;
}
export declare const MemoizedFhirPathTable: MemoExoticComponent;
export declare function MfaForm(props: MfaFormProps): JSX.Element;
export declare type MfaFormFields = 'token';
export declare interface MfaFormProps {
readonly title: string;
readonly buttonText: string;
readonly description?: string;
readonly qrCodeUrl?: string;
readonly onSubmit: (formData: Record) => void | Promise;
}
export declare function MoneyDisplay(props: MoneyDisplayProps): JSX.Element | null;
export declare interface MoneyDisplayProps {
readonly value?: Money;
}
export declare function MoneyInput(props: MoneyInputProps): JSX.Element;
export declare interface MoneyInputProps extends ComplexTypeInputProps {
readonly label?: string;
readonly placeholder?: string;
}
export declare function MultiResourceInput(props: MultiResourceInputProps): JSX.Element | null;
export declare interface MultiResourceInputProps {
readonly resourceType: T['resourceType'];
readonly name: string;
/**
* Initial selected values. Each entry may be a full resource or a reference that will be
* resolved on mount. Treated as uncontrolled — changes after mount are ignored.
*/
readonly defaultValue?: (T | Reference)[];
readonly searchCriteria?: Record;
readonly placeholder?: string;
readonly required?: boolean;
readonly itemComponent?: (props: AsyncAutocompleteOption) => JSX.Element | ReactNode;
/** Called whenever the selection changes. Receives the full array of selected resources. */
readonly onChange?: (value: T[]) => void;
readonly disabled?: boolean;
readonly label?: AsyncAutocompleteProps['label'];
readonly error?: AsyncAutocompleteProps['error'];
/** Maximum number of resources that can be selected. Defaults to uncapped. */
readonly maxValues?: number;
}
export declare function Navbar(props: NavbarProps): JSX.Element;
export declare interface NavbarLink {
readonly icon?: JSX.Element;
readonly label?: string;
readonly href: string;
/** Static count to display. Ignored if notificationCount is provided. */
readonly count?: number;
/** If true, shows red alert styling (red dot on collapsed icon, red count text when expanded). */
readonly alert?: boolean;
/** Live subscription-based count. Overrides static `count` when provided. */
readonly notificationCount?: {
readonly resourceType: ResourceType;
readonly countCriteria: string;
readonly subscriptionCriteria: string;
};
/** Callback fired when the dismiss button is clicked. When provided, a dismiss (X) button appears on hover. */
readonly onDismiss?: () => void;
}
export declare interface NavbarMenu {
readonly title?: string;
readonly links?: NavbarLink[];
}
export declare interface NavbarProps {
readonly pathname?: string;
readonly searchParams?: URLSearchParams;
readonly logo?: ReactNode;
readonly menus?: NavbarMenu[];
readonly navbarToggle: () => void;
readonly closeNavbar: () => void;
readonly spotlightEnabled?: boolean;
readonly patientsOnly?: boolean;
readonly userMenuEnabled?: boolean;
readonly displayAddBookmark?: boolean;
readonly resourceTypeSearchDisabled?: boolean;
readonly opened?: boolean;
readonly version?: string;
readonly showLayoutVersionToggle?: boolean;
}
export declare const NewTopicDialog: (props: NewTopicDialogProps) => JSX.Element;
/**
* Props for the NewTopicDialog component.
* @param subject - The patient to associate with the new thread. When provided and `allowPatientSelection` is false, the patient field is pre-filled and disabled.
* @param opened - Whether the dialog is open.
* @param onClose - Callback fired when the dialog is closed.
* @param onSubmit - Callback fired with the created Communication resource after successful submission.
* @param allowPatientSelection - When true, the patient field is an editable search input. When false (default), the field is pre-filled from `subject` and disabled. Use true for provider-facing contexts, false for patient-facing apps.
*/
export declare interface NewTopicDialogProps {
subject: Reference | Patient | undefined;
opened: boolean;
onClose: () => void;
onSubmit?: (communication: Communication) => void;
allowPatientSelection?: boolean;
}
export declare function NoteDisplay({ value }: NoteDisplayProps): JSX.Element | null;
export declare interface NoteDisplayProps {
readonly value?: Annotation[];
}
export declare function NotificationIcon(props: NotificationIconProps): JSX.Element;
export declare interface NotificationIconProps {
readonly iconComponent: JSX.Element;
readonly label?: string;
readonly tooltip?: string;
readonly resourceType: ResourceType;
readonly countCriteria: string;
readonly subscriptionCriteria: string;
readonly onClick?: () => void;
}
export declare function ObservationTable(props: ObservationTableProps): JSX.Element;
export declare interface ObservationTableProps {
readonly value?: Observation[] | Reference[];
readonly ancestorIds?: string[];
readonly hideObservationNotes?: boolean;
}
export declare function OperationOutcomeAlert(props: OperationOutcomeAlertProps): JSX.Element | null;
export declare interface OperationOutcomeAlertProps extends AlertProps {
readonly outcome?: OperationOutcome;
readonly issues?: OperationOutcomeIssue[];
}
export declare function Panel(props: PanelProps): JSX.Element;
export declare interface PanelProps extends PaperProps {
readonly width?: number;
readonly fill?: boolean;
readonly children?: ReactNode;
}
/**
* Parses an HTML form and returns the result as a JavaScript object.
* @param form - The HTML form element.
* @returns Form values in key value pairs.
*/
export declare function parseForm(form: HTMLFormElement): Record;
export declare function ParticipantFilter(props: ParticipantFilterProps): JSX.Element;
export declare interface ParticipantFilterProps {
readonly selectedParticipants: Reference[];
readonly onFilterChange: (participants: Reference[]) => void;
}
export { PATIENT_PREFERRED_PHARMACY_URL }
export declare function PatientAccountsForm(props: PatientAccountsFormProps): JSX.Element;
export declare interface PatientAccountsFormProps {
readonly patient: Patient;
readonly onSaved?: () => void;
}
export declare function PatientExportForm(props: PatientExportFormProps): JSX.Element;
export declare interface PatientExportFormProps {
readonly patient: Patient | Reference;
}
export declare function PatientHeader(props: PatientHeaderProps): JSX.Element | null;
export declare interface PatientHeaderProps {
readonly patient: Patient | Reference;
}
export declare function PatientSummary(props: PatientSummaryProps): JSX.Element | null;
export declare interface PatientSummaryData {
/** One SectionResults map per section, indexed to match the sections array. */
readonly sectionData: SectionResults[];
readonly loading: boolean;
readonly error: Error | undefined;
}
export declare interface PatientSummaryProps {
readonly patient: Patient | Reference;
readonly onClickResource?: (resource: Resource) => void;
readonly onRequestLabs?: () => void;
readonly sections?: PatientSummarySectionConfig[];
}
/**
* Configuration for a single section in the PatientSummary.
* The `searches` field is an array to support sections like Labs which need multiple resource types.
*/
export declare interface PatientSummarySectionConfig {
readonly key: string;
readonly title: string;
readonly searches?: FhirSearchDescriptor[];
/**
* React component that renders this section.
* Using ComponentType (rather than a render-prop function) ensures React treats it as a real
* component, so hooks inside custom sections work correctly.
*/
readonly component: ComponentType;
}
export declare function PatientTimeline(props: PatientTimelineProps): JSX.Element;
export declare interface PatientTimelineProps extends Pick, 'getMenu'> {
readonly patient: Patient | Reference;
}
export declare function Pharmacies(props: PharmaciesProps): JSX.Element;
export declare interface PharmaciesProps {
readonly patient: Patient;
readonly pharmacies?: Organization[];
readonly onClickResource?: (resource: Organization) => void;
readonly pharmacyDialogComponent?: ComponentType;
}
/** Default Pharmacies section constant (no pharmacy dialog component). */
export declare const PharmaciesSection: PatientSummarySectionConfig;
export { PHARMACY_PREFERENCE_TYPE_SYSTEM }
export { PHARMACY_TYPE_PREFERRED }
export { PHARMACY_TYPE_PRIMARY }
/**
* Renders a dialog for searching and adding pharmacies to a patient's favorites.
* This is a generic component that accepts search and add callbacks.
* @param props - The dialog props.
* @returns The pharmacy dialog component.
*/
export declare function PharmacyDialog(props: PharmacyDialogProps): JSX.Element;
/**
* Base props that any pharmacy dialog component must accept.
*/
export declare interface PharmacyDialogBaseProps {
readonly patient: Patient;
readonly onSubmit: (pharmacy: Organization) => void;
readonly onClose: () => void;
}
export declare interface PharmacyDialogProps {
readonly patient: Patient;
readonly onSubmit: (pharmacy: Organization) => void;
readonly onClose: () => void;
readonly onSearch: (params: PharmacySearchParams) => Promise;
readonly onAddToFavorites: (params: AddFavoriteParams) => Promise;
}
export { PharmacySearchParams }
export declare function PlanDefinitionBuilder(props: PlanDefinitionBuilderProps): JSX.Element | null;
export declare interface PlanDefinitionBuilderProps {
readonly value: Partial | Reference;
readonly onSubmit: (result: PlanDefinition) => void;
}
export { PreferredPharmacy }
export declare interface PrimitiveTypeInputProps {
readonly id?: string;
readonly name: string;
readonly 'data-testid'?: string;
readonly defaultValue?: any;
readonly required?: boolean;
readonly error?: string;
readonly disabled?: boolean;
}
/** Problem List section — searches for Condition resources. */
export declare const ProblemListSection: PatientSummarySectionConfig;
export declare function QuantityDisplay(props: QuantityDisplayProps): JSX.Element | null;
export declare interface QuantityDisplayProps {
readonly value?: Quantity;
readonly precision?: number;
}
export declare function QuantityInput(props: QuantityInputProps): JSX.Element;
export declare interface QuantityInputProps extends ComplexTypeInputProps {
readonly autoFocus?: boolean;
readonly required?: boolean;
readonly disableWheel?: boolean;
}
export declare const QUESTIONNAIRE_CALCULATED_EXPRESSION_URL = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression";
export declare const QUESTIONNAIRE_ENABLED_WHEN_EXPRESSION_URL = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression";
export declare const QUESTIONNAIRE_HIDDEN_URL = "http://hl7.org/fhir/StructureDefinition/questionnaire-hidden";
export declare const QUESTIONNAIRE_ITEM_CONTROL_URL = "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl";
export declare const QUESTIONNAIRE_REFERENCE_FILTER_URL = "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter";
export declare const QUESTIONNAIRE_REFERENCE_RESOURCE_URL = "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource";
export declare const QUESTIONNAIRE_SIGNATURE_REQUIRED_URL = "http://hl7.org/fhir/StructureDefinition/questionnaire-signatureRequired";
export declare const QUESTIONNAIRE_SIGNATURE_RESPONSE_URL = "http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature";
export declare const QUESTIONNAIRE_VALIDATION_ERROR_URL = "http://hl7.org/fhir/StructureDefinition/questionnaire-validationError";
export declare function QuestionnaireBuilder(props: QuestionnaireBuilderProps): JSX.Element | null;
export declare interface QuestionnaireBuilderProps {
readonly questionnaire: Partial | Reference;
readonly onSubmit: (result: Questionnaire) => void;
readonly autoSave?: boolean;
}
export declare function QuestionnaireForm(props: QuestionnaireFormProps): JSX.Element | null;
export declare interface QuestionnaireFormLoadedState {
/** Not loading */
readonly loading: false;
/** The loaded questionnaire */
questionnaire: Questionnaire;
/** The current draft questionnaire response */
questionnaireResponse: QuestionnaireResponse;
/** Optional questionnaire subject */
subject?: Reference;
/** Optional questionnaire encounter */
encounter?: Reference;
/** The top level items for the current page */
items: QuestionnaireItem[];
/** The response items for the current page */
responseItems: QuestionnaireResponseItem[];
/**
* Adds a new group item to the current context.
* @param context - The current context of the questionnaire response items.
* @param item - The questionnaire item that is being added to the group.
*/
onAddGroup: (context: QuestionnaireResponseItem[], item: QuestionnaireItem) => void;
/**
* Adds an answer to a repeating item.
* @param context - The current context of the questionnaire response items.
* @param item - The questionnaire item that is being answered.
*/
onAddAnswer: (context: QuestionnaireResponseItem[], item: QuestionnaireItem) => void;
/**
* Changes an answer value.
* @param context - The current context of the questionnaire response items.
* @param item - The questionnaire item that is being answered.
* @param answer - The answer(s) provided by the user for the questionnaire item.
*/
onChangeAnswer: (context: QuestionnaireResponseItem[], item: QuestionnaireItem, answer: QuestionnaireResponseItemAnswer[]) => void;
/**
* Sets or updates the signature for the questionnaire response.
* @param signature - The signature to set, or undefined to clear the signature.
*/
onChangeSignature: (signature: Signature | undefined) => void;
}
export declare interface QuestionnaireFormLoadingState {
/** Currently loading data such as the Questionnaire or the QuestionnaireResponse default value */
readonly loading: true;
}
export declare interface QuestionnaireFormPage {
readonly linkId: string;
readonly title: string;
readonly group: QuestionnaireItem & {
type: 'group';
};
}
export declare interface QuestionnaireFormPaginationState extends QuestionnaireFormLoadedState {
readonly pagination: true;
pages: QuestionnaireFormPage[];
activePage: number;
onNextPage: () => void;
onPrevPage: () => void;
}
export declare interface QuestionnaireFormProps {
readonly questionnaire: Questionnaire | Reference;
readonly questionnaireResponse?: QuestionnaireResponse | Reference;
readonly subject?: Reference;
readonly encounter?: Reference;
readonly source?: QuestionnaireResponse['source'];
readonly disablePagination?: boolean;
readonly excludeButtons?: boolean;
readonly submitButtonText?: string;
/** Optional content rendered immediately below the header row, before the form items. */
readonly afterHeader?: ReactNode;
readonly onChange?: (response: QuestionnaireResponse) => void;
readonly onSubmit?: (response: QuestionnaireResponse) => void;
}
export declare interface QuestionnaireFormSinglePageState extends QuestionnaireFormLoadedState {
readonly pagination: false;
}
export declare type QuestionnaireFormState = QuestionnaireFormLoadingState | QuestionnaireFormSinglePageState | QuestionnaireFormPaginationState;
export declare const QuestionnaireItemType: {
readonly group: "group";
readonly display: "display";
readonly question: "question";
readonly boolean: "boolean";
readonly decimal: "decimal";
readonly integer: "integer";
readonly date: "date";
readonly dateTime: "dateTime";
readonly time: "time";
readonly string: "string";
readonly text: "text";
readonly url: "url";
readonly choice: "choice";
readonly openChoice: "open-choice";
readonly attachment: "attachment";
readonly reference: "reference";
readonly quantity: "quantity";
};
export declare type QuestionnaireItemType = (typeof QuestionnaireItemType)[keyof typeof QuestionnaireItemType];
export declare function QuestionnaireResponseDisplay(props: QuestionnaireResponseDisplayProps): JSX.Element;
export declare interface QuestionnaireResponseDisplayProps {
readonly questionnaireResponse: QuestionnaireResponse | Reference;
}
export declare function RangeDisplay(props: RangeDisplayProps): JSX.Element | null;
export declare interface RangeDisplayProps {
readonly value?: Range_2;
readonly precision?: number;
readonly exclusive?: boolean;
}
/**
* Renders a Range input.
* See: https://www.hl7.org/fhir/datatypes.html#Range
* @param props - Range input properties.
* @returns Range input element.
*/
export declare function RangeInput(props: RangeInputProps): JSX.Element;
export declare interface RangeInputProps extends ComplexTypeInputProps {
}
/**
* Renders a Ratio input.
* See: https://www.hl7.org/fhir/datatypes.html#Ratio
* @param props - Ratio input properties.
* @returns Ratio input element.
*/
export declare function RatioInput(props: RatioInputProps): JSX.Element;
export declare interface RatioInputProps extends ComplexTypeInputProps {
}
export declare const reactContext: Context;
export declare function ReferenceDisplay(props: ReferenceDisplayProps): JSX.Element | null;
export declare interface ReferenceDisplayProps {
readonly value?: Reference;
readonly link?: boolean;
}
export declare function ReferenceInput(props: ReferenceInputProps): JSX.Element;
export declare interface ReferenceInputProps {
readonly name: string;
readonly placeholder?: string;
readonly defaultValue?: Reference;
readonly targetTypes?: string[];
readonly searchCriteria?: Record;
readonly autoFocus?: boolean;
readonly required?: boolean;
readonly onChange?: (value: Reference | undefined) => void;
readonly disabled?: boolean;
}
export declare function ReferenceRangeEditor(props: ReferenceRangeEditorProps): JSX.Element;
export declare interface ReferenceRangeEditorProps {
readonly definition: ObservationDefinition;
readonly onSubmit: (result: ObservationDefinition) => void;
}
export declare function ReferenceRangeGroupEditor(props: ReferenceRangeGroupEditorProps): JSX.Element;
/**
* Helper component that renders an "interval group", which is a set of ObservationDefinitionQualifiedIntervals
* that have the same filter values
*/
export declare interface ReferenceRangeGroupEditorProps {
readonly intervalGroup: IntervalGroup;
readonly unit: string | undefined;
readonly onChange: (groupId: string, changed: ObservationDefinitionQualifiedInterval) => void;
readonly onAdd: (groupId: string, added: ObservationDefinitionQualifiedInterval) => void;
readonly onRemove: (groupId: string, removed: ObservationDefinitionQualifiedInterval) => void;
readonly onRemoveGroup: (removedGroup: IntervalGroup) => void;
}
export declare function RegisterForm(props: RegisterFormProps): JSX.Element;
export declare interface RegisterFormProps {
readonly type: 'patient' | 'project';
readonly login?: string;
readonly projectId?: string;
readonly clientId?: string;
readonly googleClientId?: string;
readonly recaptchaSiteKey?: string;
readonly children?: ReactNode;
readonly onSuccess: () => void;
}
/**
* Returns a copy of the questionnaire response with response items for disabled
* questionnaire items removed.
*
* Per the FHIR R4 spec, a QuestionnaireResponse should not include answers for items
* whose `enableWhen` evaluates to false or whose `questionnaire-hidden` extension is
* true. The form preserves answers in local state so that re-enabling an item
* restores its previous value, so callers must strip disabled items before
* persisting or transmitting the response.
*
* @param questionnaire - The questionnaire defining the items.
* @param response - The current questionnaire response.
* @returns A new questionnaire response with disabled items removed.
*/
export declare function removeDisabledItems(questionnaire: Questionnaire, response: QuestionnaireResponse): QuestionnaireResponse;
export { removePreferredPharmacyFromPatient }
/**
* Returns a fragment to be displayed in the search table for the value.
* @param resource - The parent resource.
* @param field - The search code or FHIRPath expression.
* @returns The fragment to display.
*/
export declare function renderValue(resource: Resource, field: SearchControlField): string | JSX.Element | null | undefined;
export declare function RequestGroupDisplay(props: RequestGroupDisplayProps): JSX.Element | null;
export declare interface RequestGroupDisplayProps {
readonly value?: RequestGroup | Reference;
readonly onStart: (task: Task, input: Reference) => void;
readonly onEdit: (task: Task, input: Reference, output: Reference) => void;
}
export declare function ResetPasswordForm(props: ResetPasswordFormProps): JSX.Element;
export declare interface ResetPasswordFormProps {
readonly projectId?: string;
readonly recaptchaSiteKey?: string;
readonly onSuccess?: () => void;
readonly onSignIn?: () => void;
readonly onRegister?: () => void;
}
export declare function ResourceArrayDisplay(props: ResourceArrayDisplayProps): JSX.Element | null;
export declare interface ResourceArrayDisplayProps {
/** The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. */
readonly path?: string;
readonly property: InternalSchemaElement;
readonly propertyType: string;
readonly values: any[];
readonly ignoreMissingValues?: boolean;
readonly link?: boolean;
readonly includeDescriptionListEntry?: boolean;
}
export declare function ResourceArrayInput(props: ResourceArrayInputProps): JSX.Element | null;
export declare interface ResourceArrayInputProps extends BaseInputProps {
readonly property: ExtendedInternalSchemaElement;
readonly name: string;
readonly defaultValue?: any[];
readonly indent?: boolean;
readonly onChange?: (value: any[]) => void;
readonly hideNonSliceValues?: boolean;
}
export declare function ResourceAvatar(props: ResourceAvatarProps): JSX.Element;
export declare interface ResourceAvatarProps extends AvatarProps {
readonly value?: Reference | Resource;
readonly link?: boolean;
}
export declare function ResourceBadge(props: ResourceBadgeProps): JSX.Element;
export declare interface ResourceBadgeProps {
readonly value?: Reference | Resource;
readonly link?: boolean;
}
export declare function ResourceBlame(props: ResourceBlameProps): JSX.Element | null;
export declare interface ResourceBlameProps {
readonly history?: Bundle;
readonly resourceType?: ResourceType;
readonly id?: string;
}
export declare function ResourceDiff(props: ResourceDiffProps): JSX.Element;
export declare interface ResourceDiffProps {
readonly original: Resource;
readonly revised: Resource;
readonly ignoreMeta?: boolean;
}
export declare function ResourceDiffTable(props: ResourceDiffTableProps): JSX.Element | null;
export declare interface ResourceDiffTableProps {
readonly original: Resource;
readonly revised: Resource;
}
export declare function ResourceForm(props: ResourceFormProps): JSX.Element;
export declare interface ResourceFormProps {
readonly defaultValue: Partial | Reference;
readonly outcome?: OperationOutcome;
readonly onSubmit: (resource: Resource) => void;
readonly onPatch?: (resource: Resource) => void;
readonly onDelete?: (resource: Resource) => void;
/** (optional) URL of the resource profile used to display the form. Takes priority over schemaName. */
readonly profileUrl?: string;
}
export declare function ResourceHistoryTable(props: ResourceHistoryTableProps): JSX.Element;
export declare interface ResourceHistoryTableProps {
readonly history?: Bundle;
readonly resourceType?: string;
readonly id?: string;
}
/**
* @param props - The props for the ResourceInput component.
* @returns The ResourceInput component.
*/
export declare function ResourceInput(props: ResourceInputProps): JSX.Element | null;
/**
* @deprecated Use MultiResourceInput instead, which supports multiple default and selected values.
*/
export declare interface ResourceInputProps {
readonly resourceType: T['resourceType'];
readonly name: string;
readonly defaultValue?: T | Reference;
readonly searchCriteria?: Record;
readonly placeholder?: string;
readonly required?: boolean;
readonly itemComponent?: (props: AsyncAutocompleteOption) => JSX.Element | ReactNode;
readonly onChange?: (value: T | undefined) => void;
readonly disabled?: boolean;
readonly label?: AsyncAutocompleteProps['label'];
readonly error?: AsyncAutocompleteProps['error'];
}
export declare function ResourceName(props: ResourceNameProps): JSX.Element | null;
export declare interface ResourceNameProps extends TextProps {
readonly value?: Reference | Resource;
readonly link?: boolean;
}
/**
* Low-level component that renders a property from a given resource, given type information.
* @param props - The ResourcePropertyDisplay React props.
* @returns The ResourcePropertyDisplay React node.
*/
export declare function ResourcePropertyDisplay(props: ResourcePropertyDisplayProps): JSX.Element | null;
export declare interface ResourcePropertyDisplayProps {
readonly property?: InternalSchemaElement;
/** The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. */
readonly path?: string;
readonly propertyType: string;
readonly value: any;
readonly arrayElement?: boolean;
readonly maxWidth?: number;
readonly ignoreMissingValues?: boolean;
readonly link?: boolean;
/** (Optional) The `ElemendDefinitionType` to display the property against. Used when displaying extensions. */
readonly elementDefinitionType?: ElementDefinitionType;
/** (Optional) If true and `property` is an array, output is wrapped with a DescriptionListEntry */
readonly includeArrayDescriptionListEntry?: boolean;
}
export declare function ResourcePropertyInput(props: ResourcePropertyInputProps): JSX.Element;
export declare interface ResourcePropertyInputProps extends BaseInputProps {
readonly property: ExtendedInternalSchemaElement;
readonly name: string;
readonly defaultPropertyType?: string;
readonly defaultValue: any;
readonly arrayElement?: boolean;
readonly onChange?: (value: any, propName?: string) => void;
}
export declare function ResourceTable(props: ResourceTableProps): JSX.Element | null;
export declare interface ResourceTableProps {
/**
* The input value either as a resource or a reference.
*/
readonly value: Resource | Reference;
/**
* Optional flag to ignore missing values.
* By default, missing values are displayed as empty strings.
*/
readonly ignoreMissingValues?: boolean;
/**
* Optional flag to force use the input value.
* This is useful when you want to display a specific version of the resource,
* and not use the latest version.
*/
readonly forceUseInput?: boolean;
/** (optional) URL of the resource profile used to display the form. */
readonly profileUrl?: string;
}
export declare function ResourceTimeline(props: ResourceTimelineProps): JSX.Element;
export declare interface ResourceTimelineMenuItemContext {
readonly primaryResource: Resource;
readonly currentResource: Resource;
readonly reloadTimeline: () => void;
}
export declare interface ResourceTimelineProps {
readonly value: T | Reference;
readonly loadTimelineResources: (medplum: MedplumClient, resourceType: ResourceType, id: string) => Promise[]>;
readonly createCommunication?: (resource: T, sender: ProfileResource, text: string) => Communication;
readonly createMedia?: (resource: T, operator: ProfileResource, attachment: Attachment) => Media;
readonly getMenu?: (context: ResourceTimelineMenuItemContext) => ReactNode;
}
declare function Scheduler_2(props: SchedulerProps): JSX.Element | null;
export { Scheduler_2 as Scheduler }
export declare interface SchedulerProps {
readonly schedule?: Schedule | Reference | Schedule[] | Reference[];
fetchSlots?: SlotSearchFunction;
onSelectSlot?: (slot: Slot) => void;
children?: React.ReactNode;
}
export declare type SchedulingOption = [T, Date];
/**
* Component that scrolls the window to the top when the route changes.
* This is useful for maintaining a good user experience when navigating between pages.
* @returns Empty JSX fragment as this is a utility component with no visual representation
*/
export declare function ScrollToTop(): null;
export declare class SearchChangeEvent extends Event {
readonly definition: SearchRequest;
constructor(definition: SearchRequest);
}
export declare class SearchClickEvent extends Event {
readonly resource: Resource;
readonly browserEvent: MouseEvent_2;
constructor(resource: Resource, browserEvent: MouseEvent_2);
}
/**
* The SearchControl component represents the embeddable search table control.
* It includes the table, rows, headers, sorting, etc.
* It does not include the field editor, filter editor, pagination buttons.
* @param props - The SearchControl React props.
* @returns The SearchControl React node.
*/
export declare function SearchControl(props: SearchControlProps): JSX.Element;
/**
* The SearchControlField type describes a field in the search control.
*
* In a SearchRequest, a field is a simple string. Strings can be one of the following:
* 1) Simple property names, which refer to InternalSchemaElement objects
* 2) Search parameter names, which refer to SearchParameter resources
*
* Consider a few examples of how this becomes complicated.
*
* "name" (easy)
* - element definition path="Patient.name"
* - search parameter code="name"
*
* "birthDate" (medium)
* - refers to the element definition path="Patient.birthDate"
* - refers to the search parameter code="birthdate" (note the capitalization)
*
* "email" (hard)
* - refers to the search parameter code="email"
* - refers to the element definition path="Patient.telecom"
*
* In the last case, we start with the search parameter, and walk backwards to the
* element definition in order to get type details for rendering.
*
* Overall, we want columns, fields, properties, and search parameters to feel seamless,
* so we try our darndest to make this work.
*/
export declare interface SearchControlField {
readonly name: string;
readonly elementDefinition?: InternalSchemaElement;
readonly searchParams?: SearchParameter[];
}
export declare interface SearchControlProps {
readonly search: SearchRequest;
readonly checkboxesEnabled?: boolean;
readonly hideToolbar?: boolean;
readonly hideFilters?: boolean;
readonly onLoad?: (e: SearchLoadEvent) => void;
readonly onChange?: (e: SearchChangeEvent) => void;
readonly onClick?: (e: SearchClickEvent) => void;
readonly onAuxClick?: (e: SearchClickEvent) => void;
readonly onNew?: () => void;
readonly onExport?: () => void;
readonly onExportCsv?: () => void;
readonly onExportTransactionBundle?: () => void;
readonly onDelete?: (ids: string[]) => void;
readonly onBulk?: (ids: string[]) => void;
}
export declare function SearchFieldEditor(props: SearchFieldEditorProps): JSX.Element | null;
export declare interface SearchFieldEditorProps {
readonly visible: boolean;
readonly search: SearchRequest;
readonly onOk: (search: SearchRequest) => void;
readonly onCancel: () => void;
}
export declare function SearchFilterEditor(props: SearchFilterEditorProps): JSX.Element | null;
export declare interface SearchFilterEditorProps {
readonly visible: boolean;
readonly search: SearchRequest;
readonly onOk: (search: SearchRequest) => void;
readonly onCancel: () => void;
}
export declare class SearchLoadEvent extends Event {
readonly response: Bundle;
constructor(response: Bundle);
}
export declare type SearchOptions = {
debounceMs?: number;
enabled?: boolean;
};
/** Context passed to every section's component. */
export declare interface SectionRenderContext {
readonly patient: Patient;
readonly onClickResource?: (resource: Resource) => void;
/** Named results for each search in the section's `searches` array, keyed by `FhirSearchDescriptor.key`. */
readonly results: SectionResults;
}
/** Named map of FHIR results for a section: `results[searchKey]` returns the Resource[] for that search. */
export declare type SectionResults = Record;
/**
* Sends a structured command to the iframe using postMessage.
*
* Normally postMessage implies global event listeners. This method uses
* MessageChannel to create a message channel between the iframe and the parent.
* @param frame - The receiving IFrame.
* @param command - The command to send.
* @returns Promise to the response from the IFrame.
* @see https://advancedweb.hu/how-to-use-async-await-with-postmessage/
*/
export declare function sendCommand(frame: HTMLIFrameElement, command: Command): Promise;
export declare function ServiceRequestTimeline(props: ServiceRequestTimelineProps): JSX.Element;
export declare interface ServiceRequestTimelineProps extends Pick, 'getMenu'> {
readonly serviceRequest: ServiceRequest | Reference;
}
/**
* Sets the array of filters.
* @param definition - The original search request.
* @param filters - The new filters.
* @returns The updated search request.
*/
export declare function setFilters(definition: SearchRequest, filters: Filter[]): SearchRequest;
/**
* Sets the offset (starting at zero).
* @param definition - The original search request.
* @param offset - The offset number.
* @returns The updated search request.
*/
export declare function setOffset(definition: SearchRequest, offset: number): SearchRequest;
/**
* Creates a new search request with the search offset at the specified page.
* @param definition - The search definition.
* @param page - The new page number
* @returns The new search definition.
*/
export declare function setPage(definition: SearchRequest, page: number): SearchRequest;
export declare function SetPasswordForm(props: SetPasswordFormProps): JSX.Element;
export declare interface SetPasswordFormProps {
readonly id: string;
readonly secret: string;
readonly onSuccess?: () => void;
readonly onSignIn?: () => void;
}
export declare function setPropertyValue(obj: any, key: string, propName: string, elementDefinition: InternalSchemaElement, value: any): any;
export declare function setQuestionnaireItemReferenceTargetTypes(item: QuestionnaireItem, targetTypes: ResourceType[] | undefined): QuestionnaireItem;
/**
* Sorts the search by the specified key, and optional direction.
* Direction defaults to ascending ('asc') if not specified.
* @param definition - The original search request.
* @param sort - The sort key.
* @param desc - Optional descending flag. Default is false.
* @returns The updated search request.
*/
export declare function setSort(definition: SearchRequest, sort: string, desc?: boolean): SearchRequest;
/** Sexual Orientation section — searches for Observation resources by LOINC 76690-7. */
export declare const SexualOrientationSection: PatientSummarySectionConfig;
export declare function SignatureInput(props: SignatureInputProps): JSX.Element;
export declare interface SignatureInputProps extends PaperProps {
readonly width?: number;
readonly height?: number;
readonly defaultValue?: Signature;
readonly who?: Reference;
readonly onChange: ((value: Signature | undefined) => void) | undefined;
}
/**
* The SignInForm component allows users to sign in to Medplum.
*
* "Signing in" is a multi-step process:
* 1) Authentication - identify the user
* 2) MFA - If MFA is enabled, prompt for MFA code
* 3) Choose profile - If the user has multiple profiles, prompt to choose one
* 4) Choose scope - If the user has multiple scopes, prompt to choose one
* 5) Success - Return to the caller with either a code or a redirect
* @param props - The SignInForm React props.
* @returns The SignInForm React node.
*/
export declare function SignInForm(props: SignInFormProps): JSX.Element;
export declare interface SignInFormProps extends BaseLoginRequest {
readonly login?: string;
readonly chooseScopes?: boolean;
readonly disableEmailAuth?: boolean;
readonly disableGoogleAuth?: boolean;
readonly onSuccess?: () => void;
readonly onForgotPassword?: () => void;
readonly onRegister?: () => void;
readonly onCode?: (code: string) => void;
readonly children?: ReactNode;
}
/**
* Custom function to search for available slots within a given time period
* @param period - The time period to search within
* @returns Promise resolving to an array of available slots
*/
export declare type SlotSearchFunction = (period: Period) => Promise;
export declare function SmartAppLaunchLink(props: SmartAppLaunchLinkProps): JSX.Element | null;
export declare interface SmartAppLaunchLinkProps extends AnchorProps {
readonly client: ClientApplication;
readonly patient?: Reference;
readonly encounter?: Reference;
readonly fhirContext?: Reference[];
readonly children?: ReactNode;
}
export declare interface SmartSearchResponse {
readonly data: {
ResourceList: Resource[];
};
}
/** Smoking Status section — searches for Observation resources by LOINC 72166-2. */
export declare const SmokingStatusSection: PatientSummarySectionConfig;
/**
* Sorts an array of resources in place by meta.lastUpdated ascending.
* @param resources - Array of resources.
* @param timelineResource - Optional primary resource of a timeline view. If specified, the primary resource will be sorted by meta.lastUpdated descending.
*/
export declare function sortByDateAndPriority(resources: Resource[], timelineResource?: Resource): void;
export declare function Spotlight({ patientsOnly }: SpotlightProps): JSX.Element;
export declare interface SpotlightProps {
readonly patientsOnly?: boolean;
}
export declare function StatusBadge(props: StatusBadgeProps): JSX.Element;
export declare interface StatusBadgeProps extends Omit {
readonly status: string;
}
export declare function SubmitButton(props: ButtonProps): JSX.Element;
export declare type SubmitButtonProps = Omit;
export declare interface SummaryResourceListOptions {
/** Unique key for React reconciliation. */
readonly key: string;
/** Section title displayed in the collapsible header. */
readonly title: string;
/** FHIR search configuration. */
readonly search: {
readonly resourceType: ResourceType;
/** Which search param references the patient. Defaults to 'subject'. */
readonly patientParam?: string;
/** Additional search params. */
readonly query?: Record;
};
/** Override the default display string for each resource. */
readonly getDisplayString?: (resource: Resource) => string;
/** Return a status badge config, or undefined to show no badge. */
readonly getStatus?: (resource: Resource) => {
label: string;
color: string;
} | undefined;
/** Return secondary text (shown dimmed below the primary text). */
readonly getSecondaryText?: (resource: Resource) => string | undefined;
/** Filter resources before display. */
readonly filter?: (resource: Resource) => boolean;
/** Sort resources before display. */
readonly sort?: (a: Resource, b: Resource) => number;
/** Callback for the "+" add button. If omitted, no add button is shown. */
readonly onAdd?: () => void;
}
/**
* Creates a `PatientSummarySectionConfig` that renders a list of resources
* using the same visual pattern as built-in sections (CollapsibleSection + SummaryItem + StatusBadge).
* @param options - Configuration for the resource list section.
* @returns A section config that renders a generic resource list.
*/
export declare function summaryResourceListSection(options: SummaryResourceListOptions): PatientSummarySectionConfig;
export declare type SupportedProfileStructureDefinition = StructureDefinition & {
url: NonNullable;
name: NonNullable;
};
export declare interface TabDefinition {
readonly label: string;
readonly value: string;
}
export declare function ThreadChat(props: ThreadChatProps): JSX.Element | null;
export declare interface ThreadChatProps {
readonly thread: Communication;
readonly title?: string;
readonly onMessageSent?: (message: Communication) => void;
readonly inputDisabled?: boolean;
readonly excludeHeader?: boolean;
readonly uploadEnabled?: boolean;
readonly onError?: (err: Error) => void;
readonly onViewInDocuments?: (reference: Reference) => void;
}
export declare function ThreadInbox(props: ThreadInboxProps): JSX.Element;
/**
* ThreadInbox is a component that displays a list of threads and allows the user to select a thread to view.
* @param query - The query to fetch all communications.
* @param threadId - The id of the thread to select.
* @param subject - The default subject when creating a new thread.
* @param showPatientSummary - Whether to show the patient summary.
* @param sections - Optional sections configuration for the patient summary.
* @param onNew - A function to handle a new thread.
* @param getThreadUri - A function to build thread URIs.
* @param onChange - A function to handle search changes.
* @param inProgressUri - The URI for in-progress threads.
* @param completedUri - The URI for completed threads.
*/
export declare interface ThreadInboxProps {
readonly query: string;
readonly threadId: string | undefined;
readonly subject?: Reference | Patient;
readonly showPatientSummary?: boolean;
readonly sections?: PatientSummarySectionConfig[];
readonly onNew: (message: Communication) => void;
readonly getThreadUri: (topic: Communication) => string;
readonly onChange: (search: SearchRequest) => void;
readonly inProgressUri: string;
readonly completedUri: string;
readonly uploadEnabled?: boolean;
readonly onViewInDocuments?: (reference: Reference) => void;
readonly allowPatientSelection?: boolean;
}
export declare function Timeline(props: TimelineProps): JSX.Element;
export declare function TimelineItem(props: TimelineItemProps): JSX.Element;
export declare interface TimelineItemProps extends PanelProps {
readonly resource: T;
readonly profile?: Reference;
readonly dateTime?: string;
readonly padding?: boolean;
readonly popupMenuItems?: ReactNode;
}
export declare interface TimelineProps {
readonly children?: ReactNode;
}
export declare function TimingInput(props: TimingInputProps): JSX.Element;
export declare interface TimingInputProps extends ComplexTypeInputProps {
readonly defaultModalOpen?: boolean;
}
/**
* Toggles the sort of the search by key.
* If the search is already sorted by the key, reverses the direction.
* If the search is not sorted by the key, sort in ascending order.
* @param definition - The original search request.
* @param key - The field key name.
* @returns The updated search request.
*/
export declare function toggleSort(definition: SearchRequest, key: string): SearchRequest;
export declare type TranscriptItem = {
text: string;
timestamp: string;
};
export declare function typedValueToResponseItem(item: QuestionnaireItem, value: TypedValue): QuestionnaireResponseItemAnswer | undefined;
export declare const useCachedBinaryUrl: (binaryUrl: string | undefined) => string | undefined;
/**
* Generic React hook that syncs a patient to a medication-order vendor and
* returns the chart iframe URL.
*
* Executes the patient-sync bot first (if patientId is provided), then
* the iframe bot to obtain the prescribing UI URL.
*
* Uses an effect cleanup flag so React 18 Strict Mode double-mount does not
* trigger duplicate bot executions.
*
* @param syncBotIdentifier - Bot identifier for the patient sync bot.
* @param iframeBotIdentifier - Bot identifier for the iframe URL bot.
* @param options - Configuration and callback options.
* @returns The medication-order iframe URL, or undefined while loading.
*/
export declare function useMedicationIFrame(syncBotIdentifier: Identifier, iframeBotIdentifier: Identifier, options: MedicationIFrameOptions): string | undefined;
/**
* Vendor-neutral hook for e-prescribing drug search and order-medication via
* **FHIR custom operations** (no Bot identifiers required).
*
* Hits two project-scoped operations whose backing Bot is chosen at deploy time
* via an `OperationDefinition` resource carrying the
* `operationDefinition-implementation` extension — see
* [bot operations docs](https://www.medplum.com/docs/bots/custom-fhir-operations).
* The server's `tryCustomOperation` dispatch handles the OD → Bot lookup, so
* projects can swap vendors (ScriptSure today, DoseSpot tomorrow) by deploying
* a different bot under the same operation code.
*
* - `searchMedications`: `POST /fhir/R4/Medication/$drug-search` — expects the
* bot to return a `Bundle` (single-Resource `return` shortcut on
* the OperationDefinition).
* - `orderMedication`: `POST /fhir/R4/MedicationRequest/$order-medication` —
* expects the bot to return a `Parameters` envelope with named primitives;
* `parametersToMedicationOrderResponse` decodes it.
*
* @returns Callbacks to search medications and submit an order request.
*/
export declare function useMedicationOrder(): UseMedicationOrderReturn;
export declare interface UseMedicationOrderReturn {
searchMedications: (params: MedicationSearchParams) => Promise;
orderMedication: (input: MedicationOrderRequest) => Promise;
}
/**
* Vendor-neutral React hook that calls the `$order-set-url` custom FHIR
* operation and exposes the resulting iframe URL plus refresh/loading/error
* state.
*
* Hits the project-scoped operation whose backing bot is chosen at deploy time
* via an `OperationDefinition` resource carrying the
* `operationDefinition-implementation` extension — see
* [bot operations docs](https://www.medplum.com/docs/bots/custom-fhir-operations).
* The server's `tryCustomOperation` dispatch handles the OD → Bot lookup, so
* projects can swap vendors (ScriptSure today, DoseSpot tomorrow) by deploying
* a different bot under the same operation code.
*
* - URL: `POST /fhir/R4/PlanDefinition/$order-set-url`
* - Body: `Parameters` with `patientId` + (`planDefinitionId` XOR `vendorOrderSetId`) + optional `appId`.
* - Returns: `Parameters` whose `launchUrl` is exposed as `url` on the hook.
*
* The hook is a "build a URL" hook (mirrors {@link useMedicationIFrame}); it
* does not stamp Medplum resources or create vendor-side resources, so
* `refresh` is safe to call repeatedly (the operation is naturally idempotent).
*
* Re-runs whenever the input options change. In-flight calls are cancelled on
* input change and on unmount via a per-effect `cancelled` flag, so React 18
* Strict Mode double-mount does not surface stale URLs.
*
* @param options - Patient, picker (PD or vendor id), and optional appId.
* @returns `{ url, loading, error, refresh }`.
*/
export declare function useMedicationOrderSet(options: UseMedicationOrderSetOptions): UseMedicationOrderSetReturn;
export declare interface UseMedicationOrderSetOptions {
/** Patient to prescribe against. Hook stays idle (no operation call) until set. */
readonly patientId: string | undefined;
/** Medplum PlanDefinition id (vendor-neutral). Bot resolves it to the vendor's order set id. */
readonly planDefinitionId?: string;
/** Vendor-side order set id, when picked directly (escape hatch when no synced PD exists yet). */
readonly vendorOrderSetId?: number | string;
readonly appId?: string;
}
export declare interface UseMedicationOrderSetReturn {
/** Most recent successful URL from the order-set operation, or undefined while loading / on error. */
readonly url: string | undefined;
/** True while a request is in flight. */
readonly loading: boolean;
/** Last error from the operation call, or undefined. */
readonly error: unknown;
/**
* Force a re-fetch using the current options. Useful when wiring
* `PrescriptionIFrameModal.onRefreshLaunchUrl` so the session token in
* the returned widget URL is fresh on every modal open.
*/
readonly refresh: () => Promise;
}
/**
* Returns the MedplumClient instance.
* This is a shortcut for useMedplumContext().medplum.
* @returns The MedplumClient instance.
*/
export declare function useMedplum(): MedplumClient;
/**
* Returns the MedplumContext instance.
* @returns The MedplumContext instance.
*/
export declare function useMedplumContext(): MedplumContext;
/**
* Returns the Medplum navigate function.
* @returns The Medplum navigate function.
*/
export declare function useMedplumNavigate(): MedplumNavigateFunction;
/**
* Returns the current Medplum user profile (if signed in).
* This is a shortcut for useMedplumContext().profile.
* @returns The current user profile.
*/
export declare function useMedplumProfile(): ProfileResource | undefined;
/**
* Returns a live notification count for a given resource type.
*
* Uses `medplum.search()` for the initial count (with default cache policy) and
* subscribes to real-time updates via `useSubscription()`, re-fetching with
* `cache: 'reload'` whenever a matching event arrives.
*
* @param options - The resource type, count search criteria, and subscription criteria.
* @returns The current notification count.
*/
export declare function useNotificationCount(options: UseNotificationCountOptions): number;
export declare interface UseNotificationCountOptions {
readonly resourceType: ResourceType;
readonly countCriteria: string;
readonly subscriptionCriteria: string;
}
/**
* Hook that collects all FHIR searches from section configs, deduplicates them,
* executes them in parallel, and routes results back to each section.
* Uses Promise.allSettled so a single failing search does not block all sections —
* sections whose searches fail gracefully receive empty arrays.
* @param patient - The patient or patient reference to fetch data for.
* @param sections - The section configs defining which searches to execute.
* @returns Section data, loading state, and any error.
*/
export declare function usePatientSummaryData(patient: Patient | Reference, sections: {
readonly key: string;
readonly searches?: FhirSearchDescriptor[];
}[]): PatientSummaryData;
/**
* Generic React hook that provides pharmacy search and add-to-favorites
* functionality for any e-prescribing integration.
*
* Encapsulates calls to a search-pharmacy bot and an add-patient-pharmacy bot,
* and can be composed with the generic `PharmacyDialog` component from `@medplum/react`.
*
* @param searchBotIdentifier - Bot identifier for the pharmacy search bot.
* @param addPharmacyBotIdentifier - Bot identifier for the add-patient-pharmacy bot.
* @returns An object with `searchPharmacies` and `addToFavorites` callbacks.
*/
export declare function usePharmacySearch(searchBotIdentifier: Identifier, addPharmacyBotIdentifier: Identifier): UsePharmacySearchReturn;
export declare interface UsePharmacySearchReturn {
searchPharmacies: (params: PharmacySearchParams) => Promise;
addToFavorites: (params: AddFavoriteParams) => Promise;
}
/**
* React Hook to keep track of the passed-in value from the previous render of the containing component.
* @param value - The value to track.
* @returns The value passed in from the previous render.
*/
export declare function usePrevious(value: T): T | undefined;
export declare function useQuestionnaireForm(props: UseQuestionnaireFormProps): Readonly;
export declare interface UseQuestionnaireFormProps {
readonly questionnaire: Questionnaire | Reference;
readonly defaultValue?: QuestionnaireResponse | Reference;
readonly subject?: Reference;
readonly encounter?: Reference;
readonly source?: QuestionnaireResponse['source'];
readonly disablePagination?: boolean;
readonly onChange?: (response: QuestionnaireResponse) => void;
}
/**
* React Hook to use a FHIR reference.
* Handles the complexity of resolving references and caching resources.
* @param value - The resource or reference to resource.
* @param setOutcome - Optional callback to set the OperationOutcome.
* @returns The resolved resource.
*/
export declare function useResource(value: Reference | Partial | undefined, setOutcome?: (outcome: OperationOutcome) => void): WithId | undefined;
/**
* React hook for searching FHIR resources.
*
* This is a convenience hook for calling the MedplumClient.search() method.
*
* @param resourceType - The FHIR resource type to search.
* @param query - Optional search parameters.
* @param options - Optional options for configuring the search.
* @returns A 3-element tuple containing the search result, loading flag, and operation outcome.
*/
export declare function useSearch(resourceType: K, query?: QueryTypes, options?: SearchOptions): [Bundle>> | undefined, boolean, OperationOutcome | undefined];
/**
* React hook for searching for a single FHIR resource.
*
* This is a convenience hook for calling the MedplumClient.searchOne() method.
*
* @param resourceType - The FHIR resource type to search.
* @param query - Optional search parameters.
* @param options - Optional options for configuring the search.
* @returns A 3-element tuple containing the search result, loading flag, and operation outcome.
*/
export declare function useSearchOne(resourceType: K, query?: QueryTypes, options?: SearchOptions): [WithId> | undefined, boolean, OperationOutcome | undefined];
/**
* React hook for searching for an array of FHIR resources.
*
* This is a convenience hook for calling the MedplumClient.searchResources() method.
*
* @param resourceType - The FHIR resource type to search.
* @param query - Optional search parameters.
* @param options - Optional options for configuring the search.
* @returns A 3-element tuple containing the search result, loading flag, and operation outcome.
*/
export declare function useSearchResources(resourceType: K, query?: QueryTypes, options?: SearchOptions): [ResourceArray>> | undefined, boolean, OperationOutcome | undefined];
/**
* Creates an in-memory `Subscription` resource with the given criteria on the Medplum server and calls the given callback when an event notification is triggered by a resource interaction over a WebSocket connection.
*
* Subscriptions created with this hook are lightweight, share a single WebSocket connection, and are automatically untracked and cleaned up when the containing component is no longer mounted.
*
* @param criteria - The FHIR search criteria to subscribe to.
* @param callback - The callback to call when a notification event `Bundle` for this `Subscription` is received.
* @param options - Optional options used to configure the created `Subscription`. See {@link UseSubscriptionOptions}
*
* --------------------------------------------------------------------------------------------------------------------------------
*
* `options` contains the following properties, all of which are optional:
* - `subscriptionProps` - Allows the caller to pass a `Partial` to use as part of the creation
* of the `Subscription` resource for this subscription. It enables the user namely to pass things like the `extension` property and to create
* the `Subscription` with extensions such the {@link https://www.medplum.com/docs/subscriptions/subscription-extensions#interactions | Supported Interaction} extension which would enable to listen for `create` or `update` only events.
* - `onWebsocketOpen` - Called when the WebSocket connection is established with Medplum server.
* - `onWebsocketClose` - Called when the WebSocket connection disconnects.
* - `onSubscriptionConnect` - Called when the corresponding subscription starts to receive updates after the subscription has been initialized and connected to.
* - `onSubscriptionDisconnect` - Called when the corresponding subscription is destroyed and stops receiving updates from the server.
* - `onError` - Called whenever an error occurs during the lifecycle of the managed subscription.
*/
export declare function useSubscription(criteria: string | undefined, callback: (bundle: Bundle) => void, options?: UseSubscriptionOptions): void;
export declare type UseSubscriptionOptions = {
subscriptionProps?: Partial;
onWebSocketOpen?: () => void;
onWebSocketClose?: () => void;
onSubscriptionConnect?: (subscriptionId: string) => void;
onSubscriptionDisconnect?: (subscriptionId: string) => void;
onError?: (err: Error) => void;
};
/**
* Vendor-neutral React hook that syncs a Medplum `PlanDefinition` (type=order-set)
* to the configured e-prescribing vendor via the `$sync-orderset` custom FHIR operation
* (`POST /fhir/R4/PlanDefinition/$sync-orderset`).
*
* Silently no-ops when the operation is not deployed (i.e. no e-prescribing vendor
* is configured for the project), so callers do not need to guard against missing
* integrations.
*
* @returns A stable `syncOrderSet(planDefinitionId)` callback.
*/
export declare function useSyncOrderSet(): (planDefinitionId: string) => Promise;
export declare function useThreadInbox({ query, threadId }: UseThreadInboxOptions): UseThreadInboxReturn;
export declare interface UseThreadInboxOptions {
query: string;
threadId: string | undefined;
}
export declare interface UseThreadInboxReturn {
loading: boolean;
error: Error | null;
threadMessages: [Communication, Communication | undefined][];
selectedThread: Communication | undefined;
total: number | undefined;
addThreadMessage: (message: Communication) => void;
handleThreadStatusChange: (newStatus: Communication['status']) => void;
refreshThreadMessages: () => Promise;
}
export declare function useWhisper({ language, model, onTranscript, idleTimeoutMs, }: UseWhisperOptions): UseWhisperResult;
export declare type UseWhisperOptions = {
language?: string;
model?: string;
onTranscript?: (text: string) => void;
/**
* How long to keep the WebSocket warm after stop() before fully closing it, in milliseconds.
* Defaults to 120000 (2 minutes). Set to 0 or a non-finite value to keep the socket warm
* until unmount (the previous behavior).
*/
idleTimeoutMs?: number;
};
export declare type UseWhisperResult = {
status: WhisperStatus;
error: unknown;
transcripts: TranscriptItem[];
start: () => Promise;
stop: () => void;
isListening: boolean;
};
/**
* A low-level component to autocomplete based on a FHIR Valueset.
* This is the base component for CodeableConceptInput, CodingInput, and CodeInput.
* @param props - The ValueSetAutocomplete React props.
* @returns The ValueSetAutocomplete React node.
*/
export declare function ValueSetAutocomplete(props: ValueSetAutocompleteProps): JSX.Element;
export declare interface ValueSetAutocompleteProps extends Omit, 'loadOptions' | 'toKey' | 'toOption'> {
readonly binding: string | undefined;
readonly creatable?: boolean;
readonly clearable?: boolean;
readonly expandParams?: Partial;
readonly withHelpText?: boolean;
}
export declare function valueSetElementToCoding(element: ValueSetExpansionContains): Coding;
/** Vitals section — searches for Observation resources with category vital-signs. */
export declare const VitalsSection: PatientSummarySectionConfig;
export declare type WhisperStatus = 'idle' | 'requesting_microphone' | 'connecting' | 'connected' | 'listening' | 'speech_started' | 'speech_stopped' | 'disconnected' | 'error';
export { }