@medplum/react 2.2.2 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,7 @@ import { ContainerProps } from '@mantine/core';
16
16
  import { Context } from 'react';
17
17
  import { CSSProperties } from 'react';
18
18
  import { DiagnosticReport } from '@medplum/fhirtypes';
19
+ import { ElementDefinitionBinding } from '@medplum/fhirtypes';
19
20
  import { ElementDefinitionType } from '@medplum/fhirtypes';
20
21
  import { Encounter } from '@medplum/fhirtypes';
21
22
  import { ErrorInfo } from 'react';
@@ -63,6 +64,7 @@ import { SearchRequest } from '@medplum/core';
63
64
  import { SelectItem } from '@mantine/core';
64
65
  import { ServiceRequest } from '@medplum/fhirtypes';
65
66
  import { Slot } from '@medplum/fhirtypes';
67
+ import { StructureDefinition } from '@medplum/fhirtypes';
66
68
  import { Task } from '@medplum/fhirtypes';
67
69
  import { TextProps } from '@mantine/core';
68
70
  import { Timing } from '@medplum/fhirtypes';
@@ -131,11 +133,7 @@ export declare interface AddressDisplayProps {
131
133
 
132
134
  export declare function AddressInput(props: AddressInputProps): JSX.Element;
133
135
 
134
- export declare interface AddressInputProps {
135
- name: string;
136
- defaultValue?: Address;
137
- onChange?: (value: Address) => void;
138
- }
136
+ export declare type AddressInputProps = ComplexTypeInputProps<Address>;
139
137
 
140
138
  /**
141
139
  * Adds a filter that constrains the specified field to "this month".
@@ -271,10 +269,16 @@ export declare interface BackboneElementDisplayProps {
271
269
  export declare function BackboneElementInput(props: BackboneElementInputProps): JSX.Element;
272
270
 
273
271
  export declare interface BackboneElementInputProps {
272
+ /** Type name the backbone element represents */
274
273
  typeName: string;
274
+ /** (optional) The contents of the resource represented by the backbone element */
275
275
  defaultValue?: any;
276
+ /** (optional) OperationOutcome from the last attempted system action*/
276
277
  outcome?: OperationOutcome;
278
+ /** (optional) callback function that is called when the value of the backbone element changes */
277
279
  onChange?: (value: any) => void;
280
+ /** (optional) Profile URL of the structure definition represented by the backbone element */
281
+ profileUrl?: string;
278
282
  }
279
283
 
280
284
  /**
@@ -304,6 +308,8 @@ export declare interface CheckboxFormSectionProps {
304
308
  description?: string;
305
309
  withAsterisk?: boolean;
306
310
  children?: ReactNode;
311
+ testId?: string;
312
+ fhirPath?: string;
307
313
  }
308
314
 
309
315
  /**
@@ -367,6 +373,14 @@ export declare interface CodingInputProps {
367
373
  onChange?: (value: Coding | undefined) => void;
368
374
  }
369
375
 
376
+ export declare interface ComplexTypeInputProps<ValueType> {
377
+ name: string;
378
+ path: string;
379
+ defaultValue?: ValueType;
380
+ onChange: ((value: ValueType, propName?: string) => void) | undefined;
381
+ outcome: OperationOutcome | undefined;
382
+ }
383
+
370
384
  export declare function ContactDetailDisplay(props: ContactDetailDisplayProps): JSX.Element | null;
371
385
 
372
386
  export declare interface ContactDetailDisplayProps {
@@ -375,11 +389,7 @@ export declare interface ContactDetailDisplayProps {
375
389
 
376
390
  export declare function ContactDetailInput(props: ContactDetailInputProps): JSX.Element;
377
391
 
378
- export declare interface ContactDetailInputProps {
379
- name: string;
380
- defaultValue?: ContactDetail;
381
- onChange?: (value: ContactDetail) => void;
382
- }
392
+ export declare type ContactDetailInputProps = ComplexTypeInputProps<ContactDetail>;
383
393
 
384
394
  export declare function ContactPointDisplay(props: ContactPointDisplayProps): JSX.Element | null;
385
395
 
@@ -389,11 +399,9 @@ export declare interface ContactPointDisplayProps {
389
399
 
390
400
  export declare function ContactPointInput(props: ContactPointInputProps): JSX.Element;
391
401
 
392
- export declare interface ContactPointInputProps {
393
- name: string;
394
- defaultValue?: ContactPoint;
395
- onChange?: (value: ContactPoint | undefined) => void;
396
- }
402
+ export declare type ContactPointInputProps = ComplexTypeInputProps<ContactPoint> & {
403
+ onChange: ((value: ContactPoint | undefined) => void) | undefined;
404
+ };
397
405
 
398
406
  export declare function Container(props: ContainerProps): JSX.Element;
399
407
 
@@ -489,9 +497,17 @@ export declare interface ElementDefinitionSelectorProps extends ResourceProperty
489
497
 
490
498
  export declare function ElementDefinitionTypeInput(props: ElementDefinitionTypeInputProps): JSX.Element;
491
499
 
492
- export declare interface ElementDefinitionTypeInputProps extends ResourcePropertyInputProps {
500
+ export declare type ElementDefinitionTypeInputProps = {
501
+ name: ResourcePropertyInputProps['name'];
502
+ path: string;
503
+ defaultValue: ResourcePropertyInputProps['defaultValue'];
504
+ onChange: ResourcePropertyInputProps['onChange'];
505
+ outcome: ResourcePropertyInputProps['outcome'];
493
506
  elementDefinitionType: ElementDefinitionType;
494
- }
507
+ min: number;
508
+ max: number;
509
+ binding: ElementDefinitionBinding | undefined;
510
+ };
495
511
 
496
512
  export declare function EncounterTimeline(props: EncounterTimelineProps): JSX.Element;
497
513
 
@@ -562,6 +578,8 @@ export declare interface FormSectionProps {
562
578
  withAsterisk?: boolean;
563
579
  outcome?: OperationOutcome;
564
580
  children?: ReactNode;
581
+ testId?: string;
582
+ fhirPath?: string;
565
583
  }
566
584
 
567
585
  export declare function getErrorsForInput(outcome: OperationOutcome | undefined, expression: string | undefined): string | undefined;
@@ -646,11 +664,7 @@ export declare interface HumanNameDisplayProps {
646
664
 
647
665
  export declare function HumanNameInput(props: HumanNameInputProps): JSX.Element;
648
666
 
649
- export declare interface HumanNameInputProps {
650
- name: string;
651
- defaultValue?: HumanName;
652
- onChange?: (value: HumanName) => void;
653
- }
667
+ export declare type HumanNameInputProps = ComplexTypeInputProps<HumanName>;
654
668
 
655
669
  export declare function IdentifierDisplay(props: IdentifierDisplayProps): JSX.Element;
656
670
 
@@ -660,11 +674,7 @@ export declare interface IdentifierDisplayProps {
660
674
 
661
675
  export declare function IdentifierInput(props: IdentifierInputProps): JSX.Element;
662
676
 
663
- export declare interface IdentifierInputProps {
664
- name: string;
665
- defaultValue?: Identifier;
666
- onChange?: (value: Identifier) => void;
667
- }
677
+ export declare type IdentifierInputProps = ComplexTypeInputProps<Identifier>;
668
678
 
669
679
  /**
670
680
  * Dynamically loads the recaptcha script.
@@ -685,6 +695,8 @@ export declare function isQuestionEnabled(item: QuestionnaireItem, responseItems
685
695
 
686
696
  export declare function isSortDescending(definition: SearchRequest): boolean;
687
697
 
698
+ export declare function isSupportedProfileStructureDefinition(profile?: StructureDefinition): profile is SupportedProfileStructureDefinition;
699
+
688
700
  export declare function Loading(): JSX.Element;
689
701
 
690
702
  export declare function Logo(props: LogoProps): JSX.Element;
@@ -988,8 +1000,11 @@ export declare interface ResourceArrayInputProps {
988
1000
  property: InternalSchemaElement;
989
1001
  name: string;
990
1002
  defaultValue?: any[];
1003
+ indent?: boolean;
991
1004
  arrayElement?: boolean;
1005
+ outcome: OperationOutcome | undefined;
992
1006
  onChange?: (value: any[]) => void;
1007
+ hideNonSliceValues?: boolean;
993
1008
  }
994
1009
 
995
1010
  export declare function ResourceAvatar(props: ResourceAvatarProps): JSX.Element;
@@ -1029,6 +1044,9 @@ export declare interface ResourceFormProps {
1029
1044
  outcome?: OperationOutcome;
1030
1045
  onSubmit: (resource: Resource) => void;
1031
1046
  onDelete?: (resource: Resource) => void;
1047
+ schemaName?: string;
1048
+ /** (optional) URL of the resource profile used to display the form. Takes priority over schemaName. */
1049
+ profileUrl?: string;
1032
1050
  }
1033
1051
 
1034
1052
  export declare function ResourceHistoryTable(props: ResourceHistoryTableProps): JSX.Element;
@@ -1081,11 +1099,11 @@ export declare function ResourcePropertyInput(props: ResourcePropertyInputProps)
1081
1099
  export declare interface ResourcePropertyInputProps {
1082
1100
  property: InternalSchemaElement;
1083
1101
  name: string;
1084
- defaultPropertyType?: string;
1085
- defaultValue?: any;
1086
- arrayElement?: boolean;
1087
- onChange?: (value: any, propName?: string) => void;
1088
- outcome?: OperationOutcome;
1102
+ defaultPropertyType?: string | undefined;
1103
+ defaultValue: any;
1104
+ arrayElement?: boolean | undefined;
1105
+ onChange: ((value: any, propName?: string) => void) | undefined;
1106
+ outcome: OperationOutcome | undefined;
1089
1107
  }
1090
1108
 
1091
1109
  export declare function ResourceTable(props: ResourceTableProps): JSX.Element | null;
@@ -1249,6 +1267,8 @@ export declare function setOffset(definition: SearchRequest, offset: number): Se
1249
1267
  */
1250
1268
  export declare function setPage(definition: SearchRequest, page: number): SearchRequest;
1251
1269
 
1270
+ export declare function setPropertyValue(obj: any, key: string, propName: string, elementDefinition: InternalSchemaElement, value: any): any;
1271
+
1252
1272
  export declare function setQuestionnaireItemReferenceTargetTypes(item: QuestionnaireItem, targetTypes: ResourceType[] | undefined): QuestionnaireItem;
1253
1273
 
1254
1274
  /**
@@ -1306,6 +1326,11 @@ export declare interface StatusBadgeProps {
1306
1326
  readonly status: string;
1307
1327
  }
1308
1328
 
1329
+ export declare type SupportedProfileStructureDefinition = StructureDefinition & {
1330
+ url: NonNullable<StructureDefinition['url']>;
1331
+ name: NonNullable<StructureDefinition['name']>;
1332
+ };
1333
+
1309
1334
  export declare function Timeline(props: TimelineProps): JSX.Element;
1310
1335
 
1311
1336
  export declare function TimelineItem(props: TimelineItemProps): JSX.Element;
@@ -16,6 +16,7 @@ import { ContainerProps } from '@mantine/core';
16
16
  import { Context } from 'react';
17
17
  import { CSSProperties } from 'react';
18
18
  import { DiagnosticReport } from '@medplum/fhirtypes';
19
+ import { ElementDefinitionBinding } from '@medplum/fhirtypes';
19
20
  import { ElementDefinitionType } from '@medplum/fhirtypes';
20
21
  import { Encounter } from '@medplum/fhirtypes';
21
22
  import { ErrorInfo } from 'react';
@@ -63,6 +64,7 @@ import { SearchRequest } from '@medplum/core';
63
64
  import { SelectItem } from '@mantine/core';
64
65
  import { ServiceRequest } from '@medplum/fhirtypes';
65
66
  import { Slot } from '@medplum/fhirtypes';
67
+ import { StructureDefinition } from '@medplum/fhirtypes';
66
68
  import { Task } from '@medplum/fhirtypes';
67
69
  import { TextProps } from '@mantine/core';
68
70
  import { Timing } from '@medplum/fhirtypes';
@@ -131,11 +133,7 @@ export declare interface AddressDisplayProps {
131
133
 
132
134
  export declare function AddressInput(props: AddressInputProps): JSX.Element;
133
135
 
134
- export declare interface AddressInputProps {
135
- name: string;
136
- defaultValue?: Address;
137
- onChange?: (value: Address) => void;
138
- }
136
+ export declare type AddressInputProps = ComplexTypeInputProps<Address>;
139
137
 
140
138
  /**
141
139
  * Adds a filter that constrains the specified field to "this month".
@@ -271,10 +269,16 @@ export declare interface BackboneElementDisplayProps {
271
269
  export declare function BackboneElementInput(props: BackboneElementInputProps): JSX.Element;
272
270
 
273
271
  export declare interface BackboneElementInputProps {
272
+ /** Type name the backbone element represents */
274
273
  typeName: string;
274
+ /** (optional) The contents of the resource represented by the backbone element */
275
275
  defaultValue?: any;
276
+ /** (optional) OperationOutcome from the last attempted system action*/
276
277
  outcome?: OperationOutcome;
278
+ /** (optional) callback function that is called when the value of the backbone element changes */
277
279
  onChange?: (value: any) => void;
280
+ /** (optional) Profile URL of the structure definition represented by the backbone element */
281
+ profileUrl?: string;
278
282
  }
279
283
 
280
284
  /**
@@ -304,6 +308,8 @@ export declare interface CheckboxFormSectionProps {
304
308
  description?: string;
305
309
  withAsterisk?: boolean;
306
310
  children?: ReactNode;
311
+ testId?: string;
312
+ fhirPath?: string;
307
313
  }
308
314
 
309
315
  /**
@@ -367,6 +373,14 @@ export declare interface CodingInputProps {
367
373
  onChange?: (value: Coding | undefined) => void;
368
374
  }
369
375
 
376
+ export declare interface ComplexTypeInputProps<ValueType> {
377
+ name: string;
378
+ path: string;
379
+ defaultValue?: ValueType;
380
+ onChange: ((value: ValueType, propName?: string) => void) | undefined;
381
+ outcome: OperationOutcome | undefined;
382
+ }
383
+
370
384
  export declare function ContactDetailDisplay(props: ContactDetailDisplayProps): JSX.Element | null;
371
385
 
372
386
  export declare interface ContactDetailDisplayProps {
@@ -375,11 +389,7 @@ export declare interface ContactDetailDisplayProps {
375
389
 
376
390
  export declare function ContactDetailInput(props: ContactDetailInputProps): JSX.Element;
377
391
 
378
- export declare interface ContactDetailInputProps {
379
- name: string;
380
- defaultValue?: ContactDetail;
381
- onChange?: (value: ContactDetail) => void;
382
- }
392
+ export declare type ContactDetailInputProps = ComplexTypeInputProps<ContactDetail>;
383
393
 
384
394
  export declare function ContactPointDisplay(props: ContactPointDisplayProps): JSX.Element | null;
385
395
 
@@ -389,11 +399,9 @@ export declare interface ContactPointDisplayProps {
389
399
 
390
400
  export declare function ContactPointInput(props: ContactPointInputProps): JSX.Element;
391
401
 
392
- export declare interface ContactPointInputProps {
393
- name: string;
394
- defaultValue?: ContactPoint;
395
- onChange?: (value: ContactPoint | undefined) => void;
396
- }
402
+ export declare type ContactPointInputProps = ComplexTypeInputProps<ContactPoint> & {
403
+ onChange: ((value: ContactPoint | undefined) => void) | undefined;
404
+ };
397
405
 
398
406
  export declare function Container(props: ContainerProps): JSX.Element;
399
407
 
@@ -489,9 +497,17 @@ export declare interface ElementDefinitionSelectorProps extends ResourceProperty
489
497
 
490
498
  export declare function ElementDefinitionTypeInput(props: ElementDefinitionTypeInputProps): JSX.Element;
491
499
 
492
- export declare interface ElementDefinitionTypeInputProps extends ResourcePropertyInputProps {
500
+ export declare type ElementDefinitionTypeInputProps = {
501
+ name: ResourcePropertyInputProps['name'];
502
+ path: string;
503
+ defaultValue: ResourcePropertyInputProps['defaultValue'];
504
+ onChange: ResourcePropertyInputProps['onChange'];
505
+ outcome: ResourcePropertyInputProps['outcome'];
493
506
  elementDefinitionType: ElementDefinitionType;
494
- }
507
+ min: number;
508
+ max: number;
509
+ binding: ElementDefinitionBinding | undefined;
510
+ };
495
511
 
496
512
  export declare function EncounterTimeline(props: EncounterTimelineProps): JSX.Element;
497
513
 
@@ -562,6 +578,8 @@ export declare interface FormSectionProps {
562
578
  withAsterisk?: boolean;
563
579
  outcome?: OperationOutcome;
564
580
  children?: ReactNode;
581
+ testId?: string;
582
+ fhirPath?: string;
565
583
  }
566
584
 
567
585
  export declare function getErrorsForInput(outcome: OperationOutcome | undefined, expression: string | undefined): string | undefined;
@@ -646,11 +664,7 @@ export declare interface HumanNameDisplayProps {
646
664
 
647
665
  export declare function HumanNameInput(props: HumanNameInputProps): JSX.Element;
648
666
 
649
- export declare interface HumanNameInputProps {
650
- name: string;
651
- defaultValue?: HumanName;
652
- onChange?: (value: HumanName) => void;
653
- }
667
+ export declare type HumanNameInputProps = ComplexTypeInputProps<HumanName>;
654
668
 
655
669
  export declare function IdentifierDisplay(props: IdentifierDisplayProps): JSX.Element;
656
670
 
@@ -660,11 +674,7 @@ export declare interface IdentifierDisplayProps {
660
674
 
661
675
  export declare function IdentifierInput(props: IdentifierInputProps): JSX.Element;
662
676
 
663
- export declare interface IdentifierInputProps {
664
- name: string;
665
- defaultValue?: Identifier;
666
- onChange?: (value: Identifier) => void;
667
- }
677
+ export declare type IdentifierInputProps = ComplexTypeInputProps<Identifier>;
668
678
 
669
679
  /**
670
680
  * Dynamically loads the recaptcha script.
@@ -685,6 +695,8 @@ export declare function isQuestionEnabled(item: QuestionnaireItem, responseItems
685
695
 
686
696
  export declare function isSortDescending(definition: SearchRequest): boolean;
687
697
 
698
+ export declare function isSupportedProfileStructureDefinition(profile?: StructureDefinition): profile is SupportedProfileStructureDefinition;
699
+
688
700
  export declare function Loading(): JSX.Element;
689
701
 
690
702
  export declare function Logo(props: LogoProps): JSX.Element;
@@ -988,8 +1000,11 @@ export declare interface ResourceArrayInputProps {
988
1000
  property: InternalSchemaElement;
989
1001
  name: string;
990
1002
  defaultValue?: any[];
1003
+ indent?: boolean;
991
1004
  arrayElement?: boolean;
1005
+ outcome: OperationOutcome | undefined;
992
1006
  onChange?: (value: any[]) => void;
1007
+ hideNonSliceValues?: boolean;
993
1008
  }
994
1009
 
995
1010
  export declare function ResourceAvatar(props: ResourceAvatarProps): JSX.Element;
@@ -1029,6 +1044,9 @@ export declare interface ResourceFormProps {
1029
1044
  outcome?: OperationOutcome;
1030
1045
  onSubmit: (resource: Resource) => void;
1031
1046
  onDelete?: (resource: Resource) => void;
1047
+ schemaName?: string;
1048
+ /** (optional) URL of the resource profile used to display the form. Takes priority over schemaName. */
1049
+ profileUrl?: string;
1032
1050
  }
1033
1051
 
1034
1052
  export declare function ResourceHistoryTable(props: ResourceHistoryTableProps): JSX.Element;
@@ -1081,11 +1099,11 @@ export declare function ResourcePropertyInput(props: ResourcePropertyInputProps)
1081
1099
  export declare interface ResourcePropertyInputProps {
1082
1100
  property: InternalSchemaElement;
1083
1101
  name: string;
1084
- defaultPropertyType?: string;
1085
- defaultValue?: any;
1086
- arrayElement?: boolean;
1087
- onChange?: (value: any, propName?: string) => void;
1088
- outcome?: OperationOutcome;
1102
+ defaultPropertyType?: string | undefined;
1103
+ defaultValue: any;
1104
+ arrayElement?: boolean | undefined;
1105
+ onChange: ((value: any, propName?: string) => void) | undefined;
1106
+ outcome: OperationOutcome | undefined;
1089
1107
  }
1090
1108
 
1091
1109
  export declare function ResourceTable(props: ResourceTableProps): JSX.Element | null;
@@ -1249,6 +1267,8 @@ export declare function setOffset(definition: SearchRequest, offset: number): Se
1249
1267
  */
1250
1268
  export declare function setPage(definition: SearchRequest, page: number): SearchRequest;
1251
1269
 
1270
+ export declare function setPropertyValue(obj: any, key: string, propName: string, elementDefinition: InternalSchemaElement, value: any): any;
1271
+
1252
1272
  export declare function setQuestionnaireItemReferenceTargetTypes(item: QuestionnaireItem, targetTypes: ResourceType[] | undefined): QuestionnaireItem;
1253
1273
 
1254
1274
  /**
@@ -1306,6 +1326,11 @@ export declare interface StatusBadgeProps {
1306
1326
  readonly status: string;
1307
1327
  }
1308
1328
 
1329
+ export declare type SupportedProfileStructureDefinition = StructureDefinition & {
1330
+ url: NonNullable<StructureDefinition['url']>;
1331
+ name: NonNullable<StructureDefinition['name']>;
1332
+ };
1333
+
1309
1334
  export declare function Timeline(props: TimelineProps): JSX.Element;
1310
1335
 
1311
1336
  export declare function TimelineItem(props: TimelineItemProps): JSX.Element;