@oystehr/sdk 3.0.1 → 3.0.3

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.
Files changed (47) hide show
  1. package/dist/cjs/client/client.d.ts +2 -1
  2. package/dist/cjs/index.cjs +106 -1
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/cjs/index.min.cjs +1 -1
  5. package/dist/cjs/index.min.cjs.map +1 -1
  6. package/dist/cjs/resources/classes/fhir-ext.d.ts +13 -0
  7. package/dist/cjs/resources/classes/fhir.d.ts +2 -0
  8. package/dist/cjs/resources/classes/z3-ext.d.ts +22 -0
  9. package/dist/cjs/resources/classes/z3.d.ts +15 -0
  10. package/dist/cjs/resources/types/ZambdaCreateParams.d.ts +1 -1
  11. package/dist/cjs/resources/types/fhir.d.ts +6 -3
  12. package/dist/esm/client/client.d.ts +2 -1
  13. package/dist/esm/client/client.js +1 -1
  14. package/dist/esm/client/client.js.map +1 -1
  15. package/dist/esm/index.min.js +1 -1
  16. package/dist/esm/index.min.js.map +1 -1
  17. package/dist/esm/resources/classes/fhir-ext.d.ts +13 -0
  18. package/dist/esm/resources/classes/fhir-ext.js +44 -2
  19. package/dist/esm/resources/classes/fhir-ext.js.map +1 -1
  20. package/dist/esm/resources/classes/fhir.d.ts +2 -0
  21. package/dist/esm/resources/classes/fhir.js +3 -1
  22. package/dist/esm/resources/classes/fhir.js.map +1 -1
  23. package/dist/esm/resources/classes/z3-ext.d.ts +22 -0
  24. package/dist/esm/resources/classes/z3-ext.js +49 -1
  25. package/dist/esm/resources/classes/z3-ext.js.map +1 -1
  26. package/dist/esm/resources/classes/z3.d.ts +15 -0
  27. package/dist/esm/resources/classes/z3.js +16 -1
  28. package/dist/esm/resources/classes/z3.js.map +1 -1
  29. package/dist/esm/resources/types/ZambdaCreateParams.d.ts +1 -1
  30. package/dist/esm/resources/types/fhir.d.ts +6 -3
  31. package/package.json +1 -1
  32. package/src/client/client.ts +2 -2
  33. package/src/resources/classes/fhir-ext.ts +69 -1
  34. package/src/resources/classes/fhir.ts +2 -0
  35. package/src/resources/classes/z3-ext.ts +48 -1
  36. package/src/resources/classes/z3.ts +15 -0
  37. package/src/resources/types/ZambdaCreateParams.ts +1 -1
  38. package/src/resources/types/fhir.ts +4 -3
  39. package/dist/cjs/fhir/fhir-types.d.ts +0 -9
  40. package/dist/cjs/fhir/index.d.ts +0 -2
  41. package/dist/cjs/fhir/utils.d.ts +0 -14
  42. package/dist/esm/fhir/fhir-types.d.ts +0 -9
  43. package/dist/esm/fhir/index.d.ts +0 -2
  44. package/dist/esm/fhir/utils.d.ts +0 -14
  45. package/src/fhir/fhir-types.ts +0 -15
  46. package/src/fhir/index.ts +0 -2
  47. package/src/fhir/utils.ts +0 -68
@@ -10,6 +10,6 @@ export interface ZambdaCreateParams {
10
10
  /**
11
11
  * The trigger method for the Zambda Function determines how the Function is invoked. Learn more about the different types here, https://docs.oystehr.com/services/zambda/#types-of-zambdas.
12
12
  */
13
- triggerMethod: 'http_auth' | 'http_open' | 'subscription' | 'cron';
13
+ triggerMethod?: 'http_auth' | 'http_open' | 'subscription' | 'cron';
14
14
  schedule?: ZambdaSchedule;
15
15
  }
@@ -26,12 +26,13 @@ export type FhirResource = FhirResourceR4B | FhirResourceR5;
26
26
  // entry: (BundleEntry<Patient> | BundleEntry<Practitioner>)[] | undefined
27
27
  //
28
28
  // The latter can be used with array functions like `.find()`.
29
- export type FhirBundle<F extends FhirResource> = F extends FhirResourceR4B
29
+ export type FhirBundle<F extends FhirResource> = F extends FhirResourceR4B ? BundleR4B<F> : BundleR5<F>;
30
+ export type EntrylessFhirBundle<F extends FhirResource> = F extends FhirResourceR4B
30
31
  ? Omit<BundleR4B<F>, 'entry'>
31
32
  : Omit<BundleR5<F>, 'entry'>;
32
- export type Bundle<F extends FhirResource> = FhirBundle<F> & {
33
+ export type Bundle<F extends FhirResource> = EntrylessFhirBundle<F> & {
33
34
  entry?: Array<BundleEntry<F>> | undefined;
34
- unbundle: (this: Bundle<F>) => F[];
35
+ unbundle: (this: { entry?: Array<BundleEntry<F>> }) => F[];
35
36
  };
36
37
  export type BundleEntry<F extends FhirResource> = F extends FhirResourceR4B ? BundleEntryR4B<F> : BundleEntryR5<F>;
37
38
  export type Binary<F extends FhirResource> = F extends FhirResourceR4B ? BinaryR4B : BinaryR5;
@@ -1,9 +0,0 @@
1
- import * as R4B from 'fhir/r4b';
2
- import * as R5 from 'fhir/r5';
3
- export type Binary = R4B.Binary | R5.Binary;
4
- export type FhirResource = R4B.FhirResource | R5.FhirResource;
5
- export type Resource = R4B.Resource | R5.Resource;
6
- export type Bundle<BundleContentType = FhirResource> = R4B.Bundle<BundleContentType> | R5.Bundle<BundleContentType>;
7
- export type BundleEntry<BundleContentType = FhirResource> = R4B.BundleEntry<BundleContentType> | R5.BundleEntry<BundleContentType>;
8
- export type Address = R4B.Address | R5.Address;
9
- export type HumanName = R4B.HumanName | R5.HumanName;
@@ -1,2 +0,0 @@
1
- export * from './utils';
2
- export * from './fhir-types';
@@ -1,14 +0,0 @@
1
- import { Address, HumanName } from './fhir-types';
2
- export interface AddressFormatOptions {
3
- all?: boolean;
4
- use?: boolean;
5
- lineSeparator?: string;
6
- }
7
- export interface HumanNameFormatOptions {
8
- all?: boolean;
9
- prefix?: boolean;
10
- suffix?: boolean;
11
- use?: boolean;
12
- }
13
- export declare function formatAddress(address: Address, options?: AddressFormatOptions): string;
14
- export declare function formatHumanName(name: HumanName, options?: HumanNameFormatOptions): string;
@@ -1,9 +0,0 @@
1
- import * as R4B from 'fhir/r4b';
2
- import * as R5 from 'fhir/r5';
3
- export type Binary = R4B.Binary | R5.Binary;
4
- export type FhirResource = R4B.FhirResource | R5.FhirResource;
5
- export type Resource = R4B.Resource | R5.Resource;
6
- export type Bundle<BundleContentType = FhirResource> = R4B.Bundle<BundleContentType> | R5.Bundle<BundleContentType>;
7
- export type BundleEntry<BundleContentType = FhirResource> = R4B.BundleEntry<BundleContentType> | R5.BundleEntry<BundleContentType>;
8
- export type Address = R4B.Address | R5.Address;
9
- export type HumanName = R4B.HumanName | R5.HumanName;
@@ -1,2 +0,0 @@
1
- export * from './utils';
2
- export * from './fhir-types';
@@ -1,14 +0,0 @@
1
- import { Address, HumanName } from './fhir-types';
2
- export interface AddressFormatOptions {
3
- all?: boolean;
4
- use?: boolean;
5
- lineSeparator?: string;
6
- }
7
- export interface HumanNameFormatOptions {
8
- all?: boolean;
9
- prefix?: boolean;
10
- suffix?: boolean;
11
- use?: boolean;
12
- }
13
- export declare function formatAddress(address: Address, options?: AddressFormatOptions): string;
14
- export declare function formatHumanName(name: HumanName, options?: HumanNameFormatOptions): string;
@@ -1,15 +0,0 @@
1
- import * as R4B from 'fhir/r4b';
2
- import * as R5 from 'fhir/r5';
3
-
4
- // Resources
5
- export type Binary = R4B.Binary | R5.Binary;
6
- export type FhirResource = R4B.FhirResource | R5.FhirResource;
7
- export type Resource = R4B.Resource | R5.Resource;
8
- export type Bundle<BundleContentType = FhirResource> = R4B.Bundle<BundleContentType> | R5.Bundle<BundleContentType>;
9
- export type BundleEntry<BundleContentType = FhirResource> =
10
- | R4B.BundleEntry<BundleContentType>
11
- | R5.BundleEntry<BundleContentType>;
12
-
13
- // DataTypes
14
- export type Address = R4B.Address | R5.Address;
15
- export type HumanName = R4B.HumanName | R5.HumanName;
package/src/fhir/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './utils';
2
- export * from './fhir-types';
package/src/fhir/utils.ts DELETED
@@ -1,68 +0,0 @@
1
- import { Address, HumanName } from './fhir-types';
2
-
3
- export interface AddressFormatOptions {
4
- all?: boolean;
5
- use?: boolean;
6
- lineSeparator?: string;
7
- }
8
-
9
- export interface HumanNameFormatOptions {
10
- all?: boolean;
11
- prefix?: boolean;
12
- suffix?: boolean;
13
- use?: boolean;
14
- }
15
-
16
- export function formatAddress(address: Address, options?: AddressFormatOptions): string {
17
- const builder = [];
18
-
19
- if (address.line) {
20
- builder.push(...address.line);
21
- }
22
-
23
- if (address.city || address.state || address.postalCode) {
24
- const cityStateZip = [];
25
- if (address.city) {
26
- cityStateZip.push(address.city);
27
- }
28
- if (address.state) {
29
- cityStateZip.push(address.state);
30
- }
31
- if (address.postalCode) {
32
- cityStateZip.push(address.postalCode);
33
- }
34
- builder.push(cityStateZip.join(', '));
35
- }
36
-
37
- if (address.use && (options?.all || options?.use)) {
38
- builder.push('[' + address.use + ']');
39
- }
40
-
41
- return builder.join(options?.lineSeparator || ', ').trim();
42
- }
43
-
44
- export function formatHumanName(name: HumanName, options?: HumanNameFormatOptions): string {
45
- const builder = [];
46
-
47
- if (name.prefix && options?.prefix !== false) {
48
- builder.push(...name.prefix);
49
- }
50
-
51
- if (name.given) {
52
- builder.push(...name.given);
53
- }
54
-
55
- if (name.family) {
56
- builder.push(name.family);
57
- }
58
-
59
- if (name.suffix && options?.suffix !== false) {
60
- builder.push(...name.suffix);
61
- }
62
-
63
- if (name.use && (options?.all || options?.use)) {
64
- builder.push('[' + name.use + ']');
65
- }
66
-
67
- return builder.join(' ').trim();
68
- }