@medplum/react 2.1.6 → 2.1.8
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.
- package/dist/cjs/index.cjs +5 -5
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/index.mjs.map +4 -4
- package/dist/types/QuantityInput/QuantityInput.d.ts +1 -0
- package/dist/types/ReferenceInput/ReferenceInput.d.ts +1 -0
- package/dist/types/ResourceInput/ResourceInput.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/useSearch/useSearch.d.ts +32 -0
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ export interface ReferenceInputProps {
|
|
|
6
6
|
defaultValue?: Reference;
|
|
7
7
|
targetTypes?: string[];
|
|
8
8
|
autoFocus?: boolean;
|
|
9
|
+
required?: boolean;
|
|
9
10
|
onChange?: (value: Reference | undefined) => void;
|
|
10
11
|
}
|
|
11
12
|
export declare function ReferenceInput(props: ReferenceInputProps): JSX.Element;
|
|
@@ -6,6 +6,7 @@ export interface ResourceInputProps<T extends Resource = Resource> {
|
|
|
6
6
|
readonly defaultValue?: T | Reference<T>;
|
|
7
7
|
readonly placeholder?: string;
|
|
8
8
|
readonly loadOnFocus?: boolean;
|
|
9
|
+
readonly required?: boolean;
|
|
9
10
|
readonly onChange?: (value: T | undefined) => void;
|
|
10
11
|
}
|
|
11
12
|
export declare function ResourceInput<T extends Resource = Resource>(props: ResourceInputProps<T>): JSX.Element | null;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -87,6 +87,7 @@ export * from './StatusBadge/StatusBadge';
|
|
|
87
87
|
export * from './Timeline/Timeline';
|
|
88
88
|
export * from './TimingInput/TimingInput';
|
|
89
89
|
export * from './useResource/useResource';
|
|
90
|
+
export * from './useSearch/useSearch';
|
|
90
91
|
export * from './utils/date';
|
|
91
92
|
export * from './utils/outcomes';
|
|
92
93
|
export * from './utils/questionnaire';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { QueryTypes, ResourceArray } from '@medplum/core';
|
|
2
|
+
import { Bundle, ExtractResource, OperationOutcome, ResourceType } from '@medplum/fhirtypes';
|
|
3
|
+
/**
|
|
4
|
+
* React hook for searching FHIR resources.
|
|
5
|
+
*
|
|
6
|
+
* This is a convenience hook for calling the MedplumClient.search() method.
|
|
7
|
+
*
|
|
8
|
+
* @param resourceType The FHIR resource type to search.
|
|
9
|
+
* @param query Optional search parameters.
|
|
10
|
+
* @returns A 3-element tuple containing the search result, loading flag, and operation outcome.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useSearch<K extends ResourceType>(resourceType: K, query?: QueryTypes): [Bundle<ExtractResource<K>> | undefined, boolean, OperationOutcome | undefined];
|
|
13
|
+
/**
|
|
14
|
+
* React hook for searching for a single FHIR resource.
|
|
15
|
+
*
|
|
16
|
+
* This is a convenience hook for calling the MedplumClient.searchOne() method.
|
|
17
|
+
*
|
|
18
|
+
* @param resourceType The FHIR resource type to search.
|
|
19
|
+
* @param query Optional search parameters.
|
|
20
|
+
* @returns A 3-element tuple containing the search result, loading flag, and operation outcome.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useSearchOne<K extends ResourceType>(resourceType: K, query?: QueryTypes): [ExtractResource<K> | undefined, boolean, OperationOutcome | undefined];
|
|
23
|
+
/**
|
|
24
|
+
* React hook for searching for an array of FHIR resources.
|
|
25
|
+
*
|
|
26
|
+
* This is a convenience hook for calling the MedplumClient.searchResources() method.
|
|
27
|
+
*
|
|
28
|
+
* @param resourceType The FHIR resource type to search.
|
|
29
|
+
* @param query Optional search parameters.
|
|
30
|
+
* @returns A 3-element tuple containing the search result, loading flag, and operation outcome.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useSearchResources<K extends ResourceType>(resourceType: K, query?: QueryTypes): [ResourceArray<ExtractResource<K>> | undefined, boolean, OperationOutcome | undefined];
|