@medplum/core 0.10.1 → 1.0.0

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.
@@ -142,6 +142,7 @@ export interface LoginRequest {
142
142
  readonly remember?: boolean;
143
143
  readonly projectId?: string;
144
144
  readonly clientId?: string;
145
+ readonly resourceType?: string;
145
146
  readonly scope?: string;
146
147
  readonly nonce?: string;
147
148
  readonly codeChallenge?: string;
@@ -174,6 +175,7 @@ export interface GoogleLoginRequest {
174
175
  readonly googleCredential: string;
175
176
  readonly projectId?: string;
176
177
  readonly clientId?: string;
178
+ readonly resourceType?: string;
177
179
  readonly scope?: string;
178
180
  readonly nonce?: string;
179
181
  readonly codeChallenge?: string;
@@ -544,7 +546,9 @@ export declare class MedplumClient extends EventTarget {
544
546
  * See FHIR search for full details: https://www.hl7.org/fhir/search.html
545
547
  *
546
548
  * @category Search
549
+ * @param resourceType The FHIR resource type.
547
550
  * @param query The search query as either a string or a structured search object.
551
+ * @param options Optional fetch options.
548
552
  * @returns Promise to the search result bundle.
549
553
  */
550
554
  search<K extends ResourceType>(resourceType: K, query?: URLSearchParams | string, options?: RequestInit): ReadablePromise<Bundle<ExtractResource<K>>>;
@@ -565,7 +569,9 @@ export declare class MedplumClient extends EventTarget {
565
569
  * See FHIR search for full details: https://www.hl7.org/fhir/search.html
566
570
  *
567
571
  * @category Search
572
+ * @param resourceType The FHIR resource type.
568
573
  * @param query The search query as either a string or a structured search object.
574
+ * @param options Optional fetch options.
569
575
  * @returns Promise to the search result bundle.
570
576
  */
571
577
  searchOne<K extends ResourceType>(resourceType: K, query?: URLSearchParams | string, options?: RequestInit): ReadablePromise<ExtractResource<K> | undefined>;
@@ -586,7 +592,9 @@ export declare class MedplumClient extends EventTarget {
586
592
  * See FHIR search for full details: https://www.hl7.org/fhir/search.html
587
593
  *
588
594
  * @category Search
595
+ * @param resourceType The FHIR resource type.
589
596
  * @param query The search query as either a string or a structured search object.
597
+ * @param options Optional fetch options.
590
598
  * @returns Promise to the search result bundle.
591
599
  */
592
600
  searchResources<K extends ResourceType>(resourceType: K, query?: URLSearchParams | string, options?: RequestInit): ReadablePromise<ExtractResource<K>[]>;
@@ -597,6 +605,7 @@ export declare class MedplumClient extends EventTarget {
597
605
  * @category Search
598
606
  * @param system The ValueSet system url.
599
607
  * @param filter The search string.
608
+ * @param options Optional fetch options.
600
609
  * @returns Promise to expanded ValueSet.
601
610
  */
602
611
  searchValueSet(system: string, filter: string, options?: RequestInit): ReadablePromise<ValueSet>;
@@ -631,6 +640,7 @@ export declare class MedplumClient extends EventTarget {
631
640
  * @category Read
632
641
  * @param resourceType The FHIR resource type.
633
642
  * @param id The resource ID.
643
+ * @param options Optional fetch options.
634
644
  * @returns The resource if available; undefined otherwise.
635
645
  */
636
646
  readResource<K extends ResourceType>(resourceType: K, id: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
@@ -651,6 +661,7 @@ export declare class MedplumClient extends EventTarget {
651
661
  *
652
662
  * @category Read
653
663
  * @param reference The FHIR reference object.
664
+ * @param options Optional fetch options.
654
665
  * @returns The resource if available; undefined otherwise.
655
666
  */
656
667
  readReference<T extends Resource>(reference: Reference<T>, options?: RequestInit): ReadablePromise<T>;
@@ -659,7 +670,6 @@ export declare class MedplumClient extends EventTarget {
659
670
  * If the schema is not cached, returns undefined.
660
671
  * It is assumed that a client will call requestSchema before using this method.
661
672
  * @category Schema
662
- * @param resourceType The FHIR resource type.
663
673
  * @returns The schema if immediately available, undefined otherwise.
664
674
  * @deprecated Use globalSchema instead.
665
675
  */
@@ -689,6 +699,7 @@ export declare class MedplumClient extends EventTarget {
689
699
  * @category Read
690
700
  * @param resourceType The FHIR resource type.
691
701
  * @param id The resource ID.
702
+ * @param options Optional fetch options.
692
703
  * @returns Promise to the resource history.
693
704
  */
694
705
  readHistory<K extends ResourceType>(resourceType: K, id: string, options?: RequestInit): ReadablePromise<Bundle<ExtractResource<K>>>;
@@ -707,6 +718,8 @@ export declare class MedplumClient extends EventTarget {
707
718
  * @category Read
708
719
  * @param resourceType The FHIR resource type.
709
720
  * @param id The resource ID.
721
+ * @param vid The version ID.
722
+ * @param options Optional fetch options.
710
723
  * @returns The resource if available; undefined otherwise.
711
724
  */
712
725
  readVersion<K extends ResourceType>(resourceType: K, id: string, vid: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
@@ -714,6 +727,7 @@ export declare class MedplumClient extends EventTarget {
714
727
  *
715
728
  * @category Read
716
729
  * @param id The Patient Id
730
+ * @param options Optional fetch options.
717
731
  * @returns A Bundle of all Resources related to the Patient
718
732
  */
719
733
  readPatientEverything(id: string, options?: RequestInit): ReadablePromise<Bundle>;
@@ -807,7 +821,8 @@ export declare class MedplumClient extends EventTarget {
807
821
  * @param contentType Content type for the binary.
808
822
  * @returns The result of the create operation.
809
823
  */
810
- createBinary(data: string | File | Blob | Uint8Array, filename: string | undefined, contentType: string): Promise<Binary>;
824
+ createBinary(data: string | File | Blob | Uint8Array, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Binary>;
825
+ uploadwithProgress(url: URL, data: string | File | Blob | Uint8Array, contentType: string, onProgress: (e: ProgressEvent) => void): Promise<any>;
811
826
  /**
812
827
  * Creates a PDF as a FHIR `Binary` resource based on pdfmake document definition.
813
828
  *
@@ -912,6 +927,24 @@ export declare class MedplumClient extends EventTarget {
912
927
  * @returns The result of the delete operation.
913
928
  */
914
929
  deleteResource(resourceType: ResourceType, id: string): Promise<any>;
930
+ /**
931
+ * Executes the validate operation with the provided resource.
932
+ *
933
+ * Example:
934
+ *
935
+ * ```typescript
936
+ * const result = await medplum.validateResource({
937
+ * resourceType: 'Patient',
938
+ * name: [{ given: ['Alice'], family: 'Smith' }],
939
+ * });
940
+ * ```
941
+ *
942
+ * See the FHIR "$validate" operation for full details: https://www.hl7.org/fhir/resource-operation-validate.html
943
+ *
944
+ * @param resource The FHIR resource.
945
+ * @returns The validate operation outcome.
946
+ */
947
+ validateResource<T extends Resource>(resource: T): Promise<OperationOutcome>;
915
948
  /**
916
949
  * Executes a batch or transaction of FHIR operations.
917
950
  *
@@ -4,6 +4,7 @@ export * from './fhirpath';
4
4
  export * from './format';
5
5
  export * from './hl7';
6
6
  export * from './jwt';
7
+ export * from './match';
7
8
  export * from './outcomes';
8
9
  export * from './readablepromise';
9
10
  export * from './search';