@medplum/core 0.9.0 → 0.9.1

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 (48) hide show
  1. package/dist/cjs/index.js +174 -3
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/index.min.js +1 -15
  4. package/dist/cjs/index.min.js.map +1 -1
  5. package/dist/esm/index.js +165 -4
  6. package/dist/esm/index.js.map +1 -1
  7. package/dist/esm/index.min.js +1 -15
  8. package/dist/esm/index.min.js.map +1 -1
  9. package/dist/types/client.d.ts +1 -1
  10. package/dist/types/hl7.d.ts +43 -0
  11. package/dist/types/index.d.ts +1 -0
  12. package/dist/types/utils.d.ts +26 -1
  13. package/package.json +2 -2
  14. package/docs/.nojekyll +0 -1
  15. package/docs/assets/highlight.css +0 -92
  16. package/docs/assets/icons.css +0 -1043
  17. package/docs/assets/icons.png +0 -0
  18. package/docs/assets/icons@2x.png +0 -0
  19. package/docs/assets/main.js +0 -52
  20. package/docs/assets/search.js +0 -1
  21. package/docs/assets/style.css +0 -1414
  22. package/docs/assets/widgets.png +0 -0
  23. package/docs/assets/widgets@2x.png +0 -0
  24. package/docs/classes/LegacyRepositoryClient.html +0 -71
  25. package/docs/classes/MedplumClient.html +0 -324
  26. package/docs/classes/OperationOutcomeError.html +0 -6
  27. package/docs/enums/Operator.html +0 -5
  28. package/docs/enums/PropertyType.html +0 -5
  29. package/docs/enums/SearchParameterType.html +0 -1
  30. package/docs/index.html +0 -89
  31. package/docs/interfaces/AddressFormatOptions.html +0 -1
  32. package/docs/interfaces/FetchLike.html +0 -1
  33. package/docs/interfaces/Filter.html +0 -1
  34. package/docs/interfaces/GoogleCredentialResponse.html +0 -1
  35. package/docs/interfaces/HumanNameFormatOptions.html +0 -1
  36. package/docs/interfaces/IndexedStructureDefinition.html +0 -19
  37. package/docs/interfaces/LoginAuthenticationResponse.html +0 -1
  38. package/docs/interfaces/LoginProfileResponse.html +0 -1
  39. package/docs/interfaces/LoginScopeResponse.html +0 -1
  40. package/docs/interfaces/LoginState.html +0 -1
  41. package/docs/interfaces/MedplumClientOptions.html +0 -33
  42. package/docs/interfaces/RegisterRequest.html +0 -1
  43. package/docs/interfaces/SearchParameterDetails.html +0 -1
  44. package/docs/interfaces/SearchRequest.html +0 -1
  45. package/docs/interfaces/SortRule.html +0 -1
  46. package/docs/interfaces/TokenResponse.html +0 -1
  47. package/docs/interfaces/TypeSchema.html +0 -10
  48. package/docs/modules.html +0 -138
@@ -1,5 +1,5 @@
1
1
  import { Binary, Bundle, Project, ProjectMembership, Reference, Resource, UserConfiguration, ValueSet } from '@medplum/fhirtypes';
2
- import { Operation } from 'fast-json-patch';
2
+ import type { Operation } from 'fast-json-patch';
3
3
  import { EventTarget } from './eventtarget';
4
4
  import { SearchRequest } from './search';
5
5
  import { IndexedStructureDefinition } from './types';
@@ -0,0 +1,43 @@
1
+ export declare const SEGMENT_SEPARATOR = "\r";
2
+ export declare const FIELD_SEPARATOR = "|";
3
+ export declare const COMPONENT_SEPARATOR = "^";
4
+ /**
5
+ * The Hl7Message class represents one HL7 message.
6
+ * A message is a collection of segments.
7
+ * Note that we do not strictly parse messages, and only use default delimeters.
8
+ */
9
+ export declare class Hl7Message {
10
+ readonly segments: Hl7Segment[];
11
+ constructor(segments: Hl7Segment[]);
12
+ get(index: number | string): Hl7Segment | undefined;
13
+ getAll(name: string): Hl7Segment[];
14
+ toString(): string;
15
+ buildAck(): Hl7Message;
16
+ static parse(text: string): Hl7Message;
17
+ }
18
+ /**
19
+ * The Hl7Segment class represents one HL7 segment.
20
+ * A segment is a collection of fields.
21
+ * The name field is the first field.
22
+ * Note that we do not strictly parse messages, and only use default delimeters.
23
+ */
24
+ export declare class Hl7Segment {
25
+ readonly name: string;
26
+ readonly fields: Hl7Field[];
27
+ constructor(fields: Hl7Field[] | string[]);
28
+ get(index: number): Hl7Field;
29
+ toString(): string;
30
+ static parse(text: string): Hl7Segment;
31
+ }
32
+ /**
33
+ * The Hl7Field class represents one HL7 field.
34
+ * A field is a collection of components.
35
+ * Note that we do not strictly parse messages, and only use default delimeters.
36
+ */
37
+ export declare class Hl7Field {
38
+ readonly components: string[];
39
+ constructor(components: string[]);
40
+ get(index: number): string;
41
+ toString(): string;
42
+ static parse(text: string): Hl7Field;
43
+ }
@@ -1,5 +1,6 @@
1
1
  export * from './client';
2
2
  export * from './format';
3
+ export * from './hl7';
3
4
  export * from './outcomes';
4
5
  export * from './repo';
5
6
  export * from './search';
@@ -1,4 +1,4 @@
1
- import { Patient, Practitioner, Reference, RelatedPerson, Resource } from '@medplum/fhirtypes';
1
+ import { Patient, Practitioner, QuestionnaireResponse, QuestionnaireResponseItemAnswer, Reference, RelatedPerson, Resource } from '@medplum/fhirtypes';
2
2
  export declare type ProfileResource = Patient | Practitioner | RelatedPerson;
3
3
  /**
4
4
  * Creates a reference resource.
@@ -65,6 +65,19 @@ export declare function calculateAge(birthDateStr: string, endDateStr?: string):
65
65
  * @returns The age string.
66
66
  */
67
67
  export declare function calculateAgeString(birthDateStr: string, endDateStr?: string): string | undefined;
68
+ /**
69
+ * Returns all questionnaire answers as a map by link ID.
70
+ * @param response The questionnaire response resource.
71
+ * @returns Questionnaire answers mapped by link ID.
72
+ */
73
+ export declare function getQuestionnaireAnswers(response: QuestionnaireResponse): Record<string, QuestionnaireResponseItemAnswer>;
74
+ /**
75
+ * Returns an extension value by extension URLs.
76
+ * @param resource The base resource.
77
+ * @param urls Array of extension URLs. Each entry represents a nested extension.
78
+ * @returns The extension value if found; undefined otherwise.
79
+ */
80
+ export declare function getExtensionValue(resource: Resource, ...urls: string[]): string | undefined;
68
81
  /**
69
82
  * FHIR JSON stringify.
70
83
  * Removes properties with empty string values.
@@ -84,6 +97,18 @@ export declare function stringify(value: any, pretty?: boolean): string;
84
97
  * @returns True if the objects are equal.
85
98
  */
86
99
  export declare function deepEquals(object1: any, object2: any, path?: string): boolean;
100
+ /**
101
+ * Returns true if the input is an object.
102
+ * @param object The candidate object.
103
+ * @returns True if the input is a non-null non-undefined object.
104
+ */
105
+ export declare function isObject(obj: unknown): obj is object;
106
+ /**
107
+ * Returns true if the input array is an array of strings.
108
+ * @param arr Input array.
109
+ * @returns True if the input array is an array of strings.
110
+ */
111
+ export declare function isStringArray(arr: any[]): arr is string[];
87
112
  /**
88
113
  * Converts an ArrayBuffer to hex string.
89
114
  * See: https://stackoverflow.com/a/55200387
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medplum/core",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Medplum TS/JS Library",
5
5
  "author": "Medplum <hello@medplum.com>",
6
6
  "license": "Apache-2.0",
@@ -17,7 +17,7 @@
17
17
  "test": "jest"
18
18
  },
19
19
  "devDependencies": {
20
- "@medplum/fhirtypes": "0.9.0",
20
+ "@medplum/fhirtypes": "0.9.1",
21
21
  "fast-json-patch": "3.1.1"
22
22
  },
23
23
  "main": "dist/cjs/index.js",
package/docs/.nojekyll DELETED
@@ -1 +0,0 @@
1
- TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
@@ -1,92 +0,0 @@
1
- :root {
2
- --light-hl-0: #001080;
3
- --dark-hl-0: #9CDCFE;
4
- --light-hl-1: #000000;
5
- --dark-hl-1: #D4D4D4;
6
- --light-hl-2: #AF00DB;
7
- --dark-hl-2: #C586C0;
8
- --light-hl-3: #A31515;
9
- --dark-hl-3: #CE9178;
10
- --light-hl-4: #0000FF;
11
- --dark-hl-4: #569CD6;
12
- --light-hl-5: #0070C1;
13
- --dark-hl-5: #4FC1FF;
14
- --light-hl-6: #795E26;
15
- --dark-hl-6: #DCDCAA;
16
- --light-hl-7: #008000;
17
- --dark-hl-7: #6A9955;
18
- --light-hl-8: #098658;
19
- --dark-hl-8: #B5CEA8;
20
- --light-hl-9: #0451A5;
21
- --dark-hl-9: #9CDCFE;
22
- --light-code-background: #F5F5F5;
23
- --dark-code-background: #1E1E1E;
24
- }
25
-
26
- @media (prefers-color-scheme: light) { :root {
27
- --hl-0: var(--light-hl-0);
28
- --hl-1: var(--light-hl-1);
29
- --hl-2: var(--light-hl-2);
30
- --hl-3: var(--light-hl-3);
31
- --hl-4: var(--light-hl-4);
32
- --hl-5: var(--light-hl-5);
33
- --hl-6: var(--light-hl-6);
34
- --hl-7: var(--light-hl-7);
35
- --hl-8: var(--light-hl-8);
36
- --hl-9: var(--light-hl-9);
37
- --code-background: var(--light-code-background);
38
- } }
39
-
40
- @media (prefers-color-scheme: dark) { :root {
41
- --hl-0: var(--dark-hl-0);
42
- --hl-1: var(--dark-hl-1);
43
- --hl-2: var(--dark-hl-2);
44
- --hl-3: var(--dark-hl-3);
45
- --hl-4: var(--dark-hl-4);
46
- --hl-5: var(--dark-hl-5);
47
- --hl-6: var(--dark-hl-6);
48
- --hl-7: var(--dark-hl-7);
49
- --hl-8: var(--dark-hl-8);
50
- --hl-9: var(--dark-hl-9);
51
- --code-background: var(--dark-code-background);
52
- } }
53
-
54
- body.light {
55
- --hl-0: var(--light-hl-0);
56
- --hl-1: var(--light-hl-1);
57
- --hl-2: var(--light-hl-2);
58
- --hl-3: var(--light-hl-3);
59
- --hl-4: var(--light-hl-4);
60
- --hl-5: var(--light-hl-5);
61
- --hl-6: var(--light-hl-6);
62
- --hl-7: var(--light-hl-7);
63
- --hl-8: var(--light-hl-8);
64
- --hl-9: var(--light-hl-9);
65
- --code-background: var(--light-code-background);
66
- }
67
-
68
- body.dark {
69
- --hl-0: var(--dark-hl-0);
70
- --hl-1: var(--dark-hl-1);
71
- --hl-2: var(--dark-hl-2);
72
- --hl-3: var(--dark-hl-3);
73
- --hl-4: var(--dark-hl-4);
74
- --hl-5: var(--dark-hl-5);
75
- --hl-6: var(--dark-hl-6);
76
- --hl-7: var(--dark-hl-7);
77
- --hl-8: var(--dark-hl-8);
78
- --hl-9: var(--dark-hl-9);
79
- --code-background: var(--dark-code-background);
80
- }
81
-
82
- .hl-0 { color: var(--hl-0); }
83
- .hl-1 { color: var(--hl-1); }
84
- .hl-2 { color: var(--hl-2); }
85
- .hl-3 { color: var(--hl-3); }
86
- .hl-4 { color: var(--hl-4); }
87
- .hl-5 { color: var(--hl-5); }
88
- .hl-6 { color: var(--hl-6); }
89
- .hl-7 { color: var(--hl-7); }
90
- .hl-8 { color: var(--hl-8); }
91
- .hl-9 { color: var(--hl-9); }
92
- pre, code { background: var(--code-background); }