@metriport/shared 0.20.0 → 0.20.1-alpha.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.
Files changed (134) hide show
  1. package/dist/common/string.d.ts +1 -0
  2. package/dist/common/string.d.ts.map +1 -1
  3. package/dist/common/string.js +5 -1
  4. package/dist/common/string.js.map +1 -1
  5. package/dist/domain/address/__tests__/country.test.d.ts +2 -0
  6. package/dist/domain/address/__tests__/country.test.d.ts.map +1 -0
  7. package/dist/domain/address/__tests__/country.test.js +51 -0
  8. package/dist/domain/address/__tests__/country.test.js.map +1 -0
  9. package/dist/domain/address/country.d.ts +4 -0
  10. package/dist/domain/address/country.d.ts.map +1 -0
  11. package/dist/domain/address/country.js +31 -0
  12. package/dist/domain/address/country.js.map +1 -0
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/interface/external/athenahealth/index.d.ts +1 -0
  18. package/dist/interface/external/athenahealth/index.d.ts.map +1 -1
  19. package/dist/interface/external/athenahealth/index.js +1 -0
  20. package/dist/interface/external/athenahealth/index.js.map +1 -1
  21. package/dist/interface/external/athenahealth/patient.d.ts +41 -388
  22. package/dist/interface/external/athenahealth/patient.d.ts.map +1 -1
  23. package/dist/interface/external/athenahealth/patient.js +11 -30
  24. package/dist/interface/external/athenahealth/patient.js.map +1 -1
  25. package/dist/interface/external/canvas/appointment.d.ts +132 -48
  26. package/dist/interface/external/canvas/appointment.d.ts.map +1 -1
  27. package/dist/interface/external/canvas/appointment.js +16 -8
  28. package/dist/interface/external/canvas/appointment.js.map +1 -1
  29. package/dist/interface/external/canvas/jwt-token.d.ts +14 -0
  30. package/dist/interface/external/canvas/jwt-token.d.ts.map +1 -1
  31. package/dist/interface/external/canvas/jwt-token.js +6 -1
  32. package/dist/interface/external/canvas/jwt-token.js.map +1 -1
  33. package/dist/interface/external/ehr/athenahealth/appointment.d.ts +79 -0
  34. package/dist/interface/external/ehr/athenahealth/appointment.d.ts.map +1 -0
  35. package/dist/interface/external/ehr/athenahealth/appointment.js +20 -0
  36. package/dist/interface/external/ehr/athenahealth/appointment.js.map +1 -0
  37. package/dist/interface/external/ehr/athenahealth/cx-mapping.d.ts +13 -0
  38. package/dist/interface/external/ehr/athenahealth/cx-mapping.d.ts.map +1 -0
  39. package/dist/interface/external/ehr/athenahealth/cx-mapping.js +9 -0
  40. package/dist/interface/external/ehr/athenahealth/cx-mapping.js.map +1 -0
  41. package/dist/interface/external/ehr/athenahealth/department.d.ts +28 -0
  42. package/dist/interface/external/ehr/athenahealth/department.d.ts.map +1 -0
  43. package/dist/interface/external/ehr/athenahealth/department.js +11 -0
  44. package/dist/interface/external/ehr/athenahealth/department.js.map +1 -0
  45. package/dist/interface/external/ehr/athenahealth/index.d.ts +10 -0
  46. package/dist/interface/external/ehr/athenahealth/index.d.ts.map +1 -0
  47. package/dist/interface/external/ehr/athenahealth/index.js +26 -0
  48. package/dist/interface/external/ehr/athenahealth/index.js.map +1 -0
  49. package/dist/interface/external/ehr/athenahealth/jwt-token.d.ts +46 -0
  50. package/dist/interface/external/ehr/athenahealth/jwt-token.d.ts.map +1 -0
  51. package/dist/interface/external/ehr/athenahealth/jwt-token.js +26 -0
  52. package/dist/interface/external/ehr/athenahealth/jwt-token.js.map +1 -0
  53. package/dist/interface/external/ehr/athenahealth/medication.d.ts +50 -0
  54. package/dist/interface/external/ehr/athenahealth/medication.d.ts.map +1 -0
  55. package/dist/interface/external/ehr/athenahealth/medication.js +19 -0
  56. package/dist/interface/external/ehr/athenahealth/medication.js.map +1 -0
  57. package/dist/interface/external/ehr/athenahealth/patient.d.ts +44 -0
  58. package/dist/interface/external/ehr/athenahealth/patient.d.ts.map +1 -0
  59. package/dist/interface/external/ehr/athenahealth/patient.js +15 -0
  60. package/dist/interface/external/ehr/athenahealth/patient.js.map +1 -0
  61. package/dist/interface/external/ehr/athenahealth/problem.d.ts +27 -0
  62. package/dist/interface/external/ehr/athenahealth/problem.d.ts.map +1 -0
  63. package/dist/interface/external/ehr/athenahealth/problem.js +14 -0
  64. package/dist/interface/external/ehr/athenahealth/problem.js.map +1 -0
  65. package/dist/interface/external/ehr/athenahealth/subscription.d.ts +20 -0
  66. package/dist/interface/external/ehr/athenahealth/subscription.d.ts.map +1 -0
  67. package/dist/interface/external/ehr/athenahealth/subscription.js +11 -0
  68. package/dist/interface/external/ehr/athenahealth/subscription.js.map +1 -0
  69. package/dist/interface/external/ehr/athenahealth/vitals.d.ts +82 -0
  70. package/dist/interface/external/ehr/athenahealth/vitals.d.ts.map +1 -0
  71. package/dist/interface/external/ehr/athenahealth/vitals.js +15 -0
  72. package/dist/interface/external/ehr/athenahealth/vitals.js.map +1 -0
  73. package/dist/interface/external/ehr/canvas/appointment.d.ts +152 -0
  74. package/dist/interface/external/ehr/canvas/appointment.d.ts.map +1 -0
  75. package/dist/interface/external/ehr/canvas/appointment.js +23 -0
  76. package/dist/interface/external/ehr/canvas/appointment.js.map +1 -0
  77. package/dist/interface/external/ehr/canvas/index.d.ts +3 -0
  78. package/dist/interface/external/ehr/canvas/index.d.ts.map +1 -0
  79. package/dist/interface/external/ehr/canvas/index.js +19 -0
  80. package/dist/interface/external/ehr/canvas/index.js.map +1 -0
  81. package/dist/interface/external/ehr/canvas/jwt-token.d.ts +58 -0
  82. package/dist/interface/external/ehr/canvas/jwt-token.d.ts.map +1 -0
  83. package/dist/interface/external/ehr/canvas/jwt-token.js +31 -0
  84. package/dist/interface/external/ehr/canvas/jwt-token.js.map +1 -0
  85. package/dist/interface/external/ehr/elation/appointment.d.ts +68 -0
  86. package/dist/interface/external/ehr/elation/appointment.d.ts.map +1 -0
  87. package/dist/interface/external/ehr/elation/appointment.js +15 -0
  88. package/dist/interface/external/ehr/elation/appointment.js.map +1 -0
  89. package/dist/interface/external/ehr/elation/index.d.ts +4 -0
  90. package/dist/interface/external/ehr/elation/index.d.ts.map +1 -0
  91. package/dist/interface/external/ehr/elation/index.js +20 -0
  92. package/dist/interface/external/ehr/elation/index.js.map +1 -0
  93. package/dist/interface/external/ehr/elation/jwt-token.d.ts +45 -0
  94. package/dist/interface/external/ehr/elation/jwt-token.d.ts.map +1 -0
  95. package/dist/interface/external/ehr/elation/jwt-token.js +26 -0
  96. package/dist/interface/external/ehr/elation/jwt-token.js.map +1 -0
  97. package/dist/interface/external/ehr/elation/patient.d.ts +96 -0
  98. package/dist/interface/external/ehr/elation/patient.d.ts.map +1 -0
  99. package/dist/interface/external/ehr/elation/patient.js +33 -0
  100. package/dist/interface/external/ehr/elation/patient.js.map +1 -0
  101. package/dist/interface/external/ehr/index.d.ts +3 -0
  102. package/dist/interface/external/ehr/index.d.ts.map +1 -0
  103. package/dist/interface/external/ehr/index.js +19 -0
  104. package/dist/interface/external/ehr/index.js.map +1 -0
  105. package/dist/interface/external/ehr/patient.d.ts +250 -0
  106. package/dist/interface/external/ehr/patient.d.ts.map +1 -0
  107. package/dist/interface/external/ehr/patient.js +35 -0
  108. package/dist/interface/external/ehr/patient.js.map +1 -0
  109. package/dist/interface/external/ehr/source.d.ts +13 -0
  110. package/dist/interface/external/ehr/source.d.ts.map +1 -0
  111. package/dist/interface/external/ehr/source.js +25 -0
  112. package/dist/interface/external/ehr/source.js.map +1 -0
  113. package/dist/interface/external/elation/jwt-token.d.ts +14 -0
  114. package/dist/interface/external/elation/jwt-token.d.ts.map +1 -1
  115. package/dist/interface/external/elation/jwt-token.js +6 -1
  116. package/dist/interface/external/elation/jwt-token.js.map +1 -1
  117. package/dist/interface/external/index.d.ts +2 -0
  118. package/dist/interface/external/index.d.ts.map +1 -0
  119. package/dist/interface/external/index.js +18 -0
  120. package/dist/interface/external/index.js.map +1 -0
  121. package/dist/interface/external/shared/ehr/patient.d.ts +12 -12
  122. package/dist/interface/index.d.ts +1 -0
  123. package/dist/interface/index.d.ts.map +1 -1
  124. package/dist/interface/index.js +1 -0
  125. package/dist/interface/index.js.map +1 -1
  126. package/package.json +2 -2
  127. package/dist/domain/address/__tests__/normalize-zip.test.d.ts +0 -2
  128. package/dist/domain/address/__tests__/normalize-zip.test.d.ts.map +0 -1
  129. package/dist/domain/address/__tests__/normalize-zip.test.js +0 -83
  130. package/dist/domain/address/__tests__/normalize-zip.test.js.map +0 -1
  131. package/dist/interface/external/elation/subscription.d.ts +0 -2
  132. package/dist/interface/external/elation/subscription.d.ts.map +0 -1
  133. package/dist/interface/external/elation/subscription.js +0 -3
  134. package/dist/interface/external/elation/subscription.js.map +0 -1
@@ -0,0 +1,250 @@
1
+ import { z } from "zod";
2
+ export declare const patientSchema: z.ZodObject<{
3
+ gender: z.ZodString;
4
+ name: z.ZodOptional<z.ZodArray<z.ZodObject<{
5
+ family: z.ZodOptional<z.ZodString>;
6
+ given: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ family?: string | undefined;
9
+ given?: string[] | undefined;
10
+ }, {
11
+ family?: string | undefined;
12
+ given?: string[] | undefined;
13
+ }>, "many">>;
14
+ address: z.ZodOptional<z.ZodArray<z.ZodObject<{
15
+ state: z.ZodOptional<z.ZodString>;
16
+ line: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
17
+ city: z.ZodOptional<z.ZodString>;
18
+ postalCode: z.ZodOptional<z.ZodString>;
19
+ country: z.ZodOptional<z.ZodString>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ state?: string | undefined;
22
+ country?: string | undefined;
23
+ city?: string | undefined;
24
+ line?: string[] | undefined;
25
+ postalCode?: string | undefined;
26
+ }, {
27
+ state?: string | undefined;
28
+ country?: string | undefined;
29
+ city?: string | undefined;
30
+ line?: string[] | undefined;
31
+ postalCode?: string | undefined;
32
+ }>, "many">>;
33
+ birthDate: z.ZodString;
34
+ telecom: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
+ value: z.ZodOptional<z.ZodString>;
36
+ system: z.ZodOptional<z.ZodEnum<["phone", "email"]>>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ value?: string | undefined;
39
+ system?: "phone" | "email" | undefined;
40
+ }, {
41
+ value?: string | undefined;
42
+ system?: "phone" | "email" | undefined;
43
+ }>, "many">>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ gender: string;
46
+ birthDate: string;
47
+ name?: {
48
+ family?: string | undefined;
49
+ given?: string[] | undefined;
50
+ }[] | undefined;
51
+ address?: {
52
+ state?: string | undefined;
53
+ country?: string | undefined;
54
+ city?: string | undefined;
55
+ line?: string[] | undefined;
56
+ postalCode?: string | undefined;
57
+ }[] | undefined;
58
+ telecom?: {
59
+ value?: string | undefined;
60
+ system?: "phone" | "email" | undefined;
61
+ }[] | undefined;
62
+ }, {
63
+ gender: string;
64
+ birthDate: string;
65
+ name?: {
66
+ family?: string | undefined;
67
+ given?: string[] | undefined;
68
+ }[] | undefined;
69
+ address?: {
70
+ state?: string | undefined;
71
+ country?: string | undefined;
72
+ city?: string | undefined;
73
+ line?: string[] | undefined;
74
+ postalCode?: string | undefined;
75
+ }[] | undefined;
76
+ telecom?: {
77
+ value?: string | undefined;
78
+ system?: "phone" | "email" | undefined;
79
+ }[] | undefined;
80
+ }>;
81
+ export type Patient = z.infer<typeof patientSchema>;
82
+ export declare const patientSearchSchema: z.ZodObject<{
83
+ entry: z.ZodOptional<z.ZodArray<z.ZodObject<{
84
+ resource: z.ZodObject<{
85
+ gender: z.ZodString;
86
+ name: z.ZodOptional<z.ZodArray<z.ZodObject<{
87
+ family: z.ZodOptional<z.ZodString>;
88
+ given: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ family?: string | undefined;
91
+ given?: string[] | undefined;
92
+ }, {
93
+ family?: string | undefined;
94
+ given?: string[] | undefined;
95
+ }>, "many">>;
96
+ address: z.ZodOptional<z.ZodArray<z.ZodObject<{
97
+ state: z.ZodOptional<z.ZodString>;
98
+ line: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
99
+ city: z.ZodOptional<z.ZodString>;
100
+ postalCode: z.ZodOptional<z.ZodString>;
101
+ country: z.ZodOptional<z.ZodString>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ state?: string | undefined;
104
+ country?: string | undefined;
105
+ city?: string | undefined;
106
+ line?: string[] | undefined;
107
+ postalCode?: string | undefined;
108
+ }, {
109
+ state?: string | undefined;
110
+ country?: string | undefined;
111
+ city?: string | undefined;
112
+ line?: string[] | undefined;
113
+ postalCode?: string | undefined;
114
+ }>, "many">>;
115
+ birthDate: z.ZodString;
116
+ telecom: z.ZodOptional<z.ZodArray<z.ZodObject<{
117
+ value: z.ZodOptional<z.ZodString>;
118
+ system: z.ZodOptional<z.ZodEnum<["phone", "email"]>>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ value?: string | undefined;
121
+ system?: "phone" | "email" | undefined;
122
+ }, {
123
+ value?: string | undefined;
124
+ system?: "phone" | "email" | undefined;
125
+ }>, "many">>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ gender: string;
128
+ birthDate: string;
129
+ name?: {
130
+ family?: string | undefined;
131
+ given?: string[] | undefined;
132
+ }[] | undefined;
133
+ address?: {
134
+ state?: string | undefined;
135
+ country?: string | undefined;
136
+ city?: string | undefined;
137
+ line?: string[] | undefined;
138
+ postalCode?: string | undefined;
139
+ }[] | undefined;
140
+ telecom?: {
141
+ value?: string | undefined;
142
+ system?: "phone" | "email" | undefined;
143
+ }[] | undefined;
144
+ }, {
145
+ gender: string;
146
+ birthDate: string;
147
+ name?: {
148
+ family?: string | undefined;
149
+ given?: string[] | undefined;
150
+ }[] | undefined;
151
+ address?: {
152
+ state?: string | undefined;
153
+ country?: string | undefined;
154
+ city?: string | undefined;
155
+ line?: string[] | undefined;
156
+ postalCode?: string | undefined;
157
+ }[] | undefined;
158
+ telecom?: {
159
+ value?: string | undefined;
160
+ system?: "phone" | "email" | undefined;
161
+ }[] | undefined;
162
+ }>;
163
+ }, "strip", z.ZodTypeAny, {
164
+ resource: {
165
+ gender: string;
166
+ birthDate: string;
167
+ name?: {
168
+ family?: string | undefined;
169
+ given?: string[] | undefined;
170
+ }[] | undefined;
171
+ address?: {
172
+ state?: string | undefined;
173
+ country?: string | undefined;
174
+ city?: string | undefined;
175
+ line?: string[] | undefined;
176
+ postalCode?: string | undefined;
177
+ }[] | undefined;
178
+ telecom?: {
179
+ value?: string | undefined;
180
+ system?: "phone" | "email" | undefined;
181
+ }[] | undefined;
182
+ };
183
+ }, {
184
+ resource: {
185
+ gender: string;
186
+ birthDate: string;
187
+ name?: {
188
+ family?: string | undefined;
189
+ given?: string[] | undefined;
190
+ }[] | undefined;
191
+ address?: {
192
+ state?: string | undefined;
193
+ country?: string | undefined;
194
+ city?: string | undefined;
195
+ line?: string[] | undefined;
196
+ postalCode?: string | undefined;
197
+ }[] | undefined;
198
+ telecom?: {
199
+ value?: string | undefined;
200
+ system?: "phone" | "email" | undefined;
201
+ }[] | undefined;
202
+ };
203
+ }>, "many">>;
204
+ }, "strip", z.ZodTypeAny, {
205
+ entry?: {
206
+ resource: {
207
+ gender: string;
208
+ birthDate: string;
209
+ name?: {
210
+ family?: string | undefined;
211
+ given?: string[] | undefined;
212
+ }[] | undefined;
213
+ address?: {
214
+ state?: string | undefined;
215
+ country?: string | undefined;
216
+ city?: string | undefined;
217
+ line?: string[] | undefined;
218
+ postalCode?: string | undefined;
219
+ }[] | undefined;
220
+ telecom?: {
221
+ value?: string | undefined;
222
+ system?: "phone" | "email" | undefined;
223
+ }[] | undefined;
224
+ };
225
+ }[] | undefined;
226
+ }, {
227
+ entry?: {
228
+ resource: {
229
+ gender: string;
230
+ birthDate: string;
231
+ name?: {
232
+ family?: string | undefined;
233
+ given?: string[] | undefined;
234
+ }[] | undefined;
235
+ address?: {
236
+ state?: string | undefined;
237
+ country?: string | undefined;
238
+ city?: string | undefined;
239
+ line?: string[] | undefined;
240
+ postalCode?: string | undefined;
241
+ }[] | undefined;
242
+ telecom?: {
243
+ value?: string | undefined;
244
+ system?: "phone" | "email" | undefined;
245
+ }[] | undefined;
246
+ };
247
+ }[] | undefined;
248
+ }>;
249
+ export type PatientSearch = z.infer<typeof patientSearchSchema>;
250
+ //# sourceMappingURL=patient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patient.d.ts","sourceRoot":"","sources":["../../../../src/interface/external/ehr/patient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.patientSearchSchema = exports.patientSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const address = zod_1.z.object({
6
+ state: zod_1.z.string().optional(),
7
+ line: zod_1.z.string().array().optional(),
8
+ city: zod_1.z.string().optional(),
9
+ postalCode: zod_1.z.string().optional(),
10
+ country: zod_1.z.string().optional(),
11
+ });
12
+ const telecome = zod_1.z.object({
13
+ value: zod_1.z.string().optional(),
14
+ system: zod_1.z.enum(["phone", "email"]).optional(),
15
+ });
16
+ const name = zod_1.z.object({
17
+ family: zod_1.z.string().optional(),
18
+ given: zod_1.z.string().array().optional(),
19
+ });
20
+ exports.patientSchema = zod_1.z.object({
21
+ gender: zod_1.z.string(),
22
+ name: name.array().optional(),
23
+ address: address.array().optional(),
24
+ birthDate: zod_1.z.string(),
25
+ telecom: telecome.array().optional(),
26
+ });
27
+ exports.patientSearchSchema = zod_1.z.object({
28
+ entry: zod_1.z
29
+ .object({
30
+ resource: exports.patientSchema,
31
+ })
32
+ .array()
33
+ .optional(),
34
+ });
35
+ //# sourceMappingURL=patient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patient.js","sourceRoot":"","sources":["../../../../src/interface/external/ehr/patient.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,OAAO,GAAG,OAAC,CAAC,MAAM,CAAC;IACvB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACnC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,OAAC,CAAC,MAAM,CAAC;IACxB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,OAAC,CAAC,MAAM,CAAC;IACpB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAC7B,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAGU,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,OAAC;SACL,MAAM,CAAC;QACN,QAAQ,EAAE,qBAAa;KACxB,CAAC;SACD,KAAK,EAAE;SACP,QAAQ,EAAE;CACd,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare enum EhrSources {
2
+ athena = "athenahealth",
3
+ elation = "elation",
4
+ canvas = "canvas"
5
+ }
6
+ export declare const ehrSources: readonly EhrSources[];
7
+ export type EhrSource = (typeof ehrSources)[number];
8
+ export declare function isEhrSource(source: string): source is EhrSource;
9
+ export declare const clientSourceSuffix = "-client";
10
+ export declare const webhookSourceSuffix = "-webhook";
11
+ export declare function removeClientSource(source: string): EhrSource;
12
+ export declare function removeWebhookSource(source: string): EhrSource;
13
+ //# sourceMappingURL=source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../../src/interface/external/ehr/source.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,MAAM,iBAAiB;IACvB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AACD,eAAO,MAAM,UAAU,uBAA0C,CAAC;AAClE,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AACpD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,SAAS,CAE/D;AAED,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAC5C,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAE5D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAE7D"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeWebhookSource = exports.removeClientSource = exports.webhookSourceSuffix = exports.clientSourceSuffix = exports.isEhrSource = exports.ehrSources = exports.EhrSources = void 0;
4
+ var EhrSources;
5
+ (function (EhrSources) {
6
+ EhrSources["athena"] = "athenahealth";
7
+ EhrSources["elation"] = "elation";
8
+ EhrSources["canvas"] = "canvas";
9
+ })(EhrSources = exports.EhrSources || (exports.EhrSources = {}));
10
+ exports.ehrSources = [...Object.values(EhrSources)];
11
+ function isEhrSource(source) {
12
+ return exports.ehrSources.includes(source);
13
+ }
14
+ exports.isEhrSource = isEhrSource;
15
+ exports.clientSourceSuffix = "-client";
16
+ exports.webhookSourceSuffix = "-webhook";
17
+ function removeClientSource(source) {
18
+ return source.replace(exports.clientSourceSuffix, "");
19
+ }
20
+ exports.removeClientSource = removeClientSource;
21
+ function removeWebhookSource(source) {
22
+ return source.replace(exports.webhookSourceSuffix, "");
23
+ }
24
+ exports.removeWebhookSource = removeWebhookSource;
25
+ //# sourceMappingURL=source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.js","sourceRoot":"","sources":["../../../../src/interface/external/ehr/source.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,qCAAuB,CAAA;IACvB,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;AACnB,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB;AACY,QAAA,UAAU,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAU,CAAC;AAElE,SAAgB,WAAW,CAAC,MAAc;IACxC,OAAO,kBAAU,CAAC,QAAQ,CAAC,MAAmB,CAAC,CAAC;AAClD,CAAC;AAFD,kCAEC;AAEY,QAAA,kBAAkB,GAAG,SAAS,CAAC;AAC/B,QAAA,mBAAmB,GAAG,UAAU,CAAC;AAE9C,SAAgB,kBAAkB,CAAC,MAAc;IAC/C,OAAO,MAAM,CAAC,OAAO,CAAC,0BAAkB,EAAE,EAAE,CAAc,CAAC;AAC7D,CAAC;AAFD,gDAEC;AAED,SAAgB,mBAAmB,CAAC,MAAc;IAChD,OAAO,MAAM,CAAC,OAAO,CAAC,2BAAmB,EAAE,EAAE,CAAc,CAAC;AAC9D,CAAC;AAFD,kDAEC"}
@@ -4,6 +4,20 @@ export type ElationClientJwtTokenData = {
4
4
  cxId: string;
5
5
  source: "elation-client";
6
6
  };
7
+ export declare const elationWebhookJwtTokenDataSchema: z.ZodObject<{
8
+ practiceId: z.ZodString;
9
+ cxId: z.ZodString;
10
+ source: z.ZodLiteral<"elation-webhook">;
11
+ }, "strip", z.ZodTypeAny, {
12
+ cxId: string;
13
+ source: "elation-webhook";
14
+ practiceId: string;
15
+ }, {
16
+ cxId: string;
17
+ source: "elation-webhook";
18
+ practiceId: string;
19
+ }>;
20
+ export type ElationWebhookJwtTokenData = z.infer<typeof elationWebhookJwtTokenDataSchema>;
7
21
  export declare const elationClientJwtTokenResponseSchema: z.ZodObject<{
8
22
  scope: z.ZodString;
9
23
  access_token: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"jwt-token.d.ts","sourceRoot":"","sources":["../../../../src/interface/external/elation/jwt-token.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;EAI9C,CAAC"}
1
+ {"version":3,"file":"jwt-token.d.ts","sourceRoot":"","sources":["../../../../src/interface/external/elation/jwt-token.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;EAI3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,mCAAmC;;;;;;;;;;;;EAI9C,CAAC"}
@@ -3,8 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.elationClientJwtTokenResponseSchema = void 0;
6
+ exports.elationClientJwtTokenResponseSchema = exports.elationWebhookJwtTokenDataSchema = void 0;
7
7
  const zod_1 = __importDefault(require("zod"));
8
+ exports.elationWebhookJwtTokenDataSchema = zod_1.default.object({
9
+ practiceId: zod_1.default.string(),
10
+ cxId: zod_1.default.string(),
11
+ source: zod_1.default.literal("elation-webhook"),
12
+ });
8
13
  exports.elationClientJwtTokenResponseSchema = zod_1.default.object({
9
14
  scope: zod_1.default.string(),
10
15
  access_token: zod_1.default.string(),
@@ -1 +1 @@
1
- {"version":3,"file":"jwt-token.js","sourceRoot":"","sources":["../../../../src/interface/external/elation/jwt-token.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAQP,QAAA,mCAAmC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC1D,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE;IACjB,YAAY,EAAE,aAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,aAAC,CAAC,MAAM,CAAC,MAAM,EAAE;CAC9B,CAAC,CAAC"}
1
+ {"version":3,"file":"jwt-token.js","sourceRoot":"","sources":["../../../../src/interface/external/elation/jwt-token.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAQP,QAAA,gCAAgC,GAAG,aAAC,CAAC,MAAM,CAAC;IACvD,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE;IACtB,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,aAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC;CACrC,CAAC,CAAC;AAIU,QAAA,mCAAmC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC1D,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE;IACjB,YAAY,EAAE,aAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,aAAC,CAAC,MAAM,CAAC,MAAM,EAAE;CAC9B,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./ehr";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/external/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ehr"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interface/external/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB"}
@@ -19,16 +19,16 @@ export declare const patientSchema: z.ZodObject<{
19
19
  country: z.ZodOptional<z.ZodString>;
20
20
  }, "strip", z.ZodTypeAny, {
21
21
  state?: string | undefined;
22
+ country?: string | undefined;
22
23
  city?: string | undefined;
23
24
  line?: string[] | undefined;
24
25
  postalCode?: string | undefined;
25
- country?: string | undefined;
26
26
  }, {
27
27
  state?: string | undefined;
28
+ country?: string | undefined;
28
29
  city?: string | undefined;
29
30
  line?: string[] | undefined;
30
31
  postalCode?: string | undefined;
31
- country?: string | undefined;
32
32
  }>, "many">>;
33
33
  birthDate: z.ZodString;
34
34
  telecom: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -50,10 +50,10 @@ export declare const patientSchema: z.ZodObject<{
50
50
  }[] | undefined;
51
51
  address?: {
52
52
  state?: string | undefined;
53
+ country?: string | undefined;
53
54
  city?: string | undefined;
54
55
  line?: string[] | undefined;
55
56
  postalCode?: string | undefined;
56
- country?: string | undefined;
57
57
  }[] | undefined;
58
58
  telecom?: {
59
59
  value?: string | undefined;
@@ -68,10 +68,10 @@ export declare const patientSchema: z.ZodObject<{
68
68
  }[] | undefined;
69
69
  address?: {
70
70
  state?: string | undefined;
71
+ country?: string | undefined;
71
72
  city?: string | undefined;
72
73
  line?: string[] | undefined;
73
74
  postalCode?: string | undefined;
74
- country?: string | undefined;
75
75
  }[] | undefined;
76
76
  telecom?: {
77
77
  value?: string | undefined;
@@ -101,16 +101,16 @@ export declare const patientSearchSchema: z.ZodObject<{
101
101
  country: z.ZodOptional<z.ZodString>;
102
102
  }, "strip", z.ZodTypeAny, {
103
103
  state?: string | undefined;
104
+ country?: string | undefined;
104
105
  city?: string | undefined;
105
106
  line?: string[] | undefined;
106
107
  postalCode?: string | undefined;
107
- country?: string | undefined;
108
108
  }, {
109
109
  state?: string | undefined;
110
+ country?: string | undefined;
110
111
  city?: string | undefined;
111
112
  line?: string[] | undefined;
112
113
  postalCode?: string | undefined;
113
- country?: string | undefined;
114
114
  }>, "many">>;
115
115
  birthDate: z.ZodString;
116
116
  telecom: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -132,10 +132,10 @@ export declare const patientSearchSchema: z.ZodObject<{
132
132
  }[] | undefined;
133
133
  address?: {
134
134
  state?: string | undefined;
135
+ country?: string | undefined;
135
136
  city?: string | undefined;
136
137
  line?: string[] | undefined;
137
138
  postalCode?: string | undefined;
138
- country?: string | undefined;
139
139
  }[] | undefined;
140
140
  telecom?: {
141
141
  value?: string | undefined;
@@ -150,10 +150,10 @@ export declare const patientSearchSchema: z.ZodObject<{
150
150
  }[] | undefined;
151
151
  address?: {
152
152
  state?: string | undefined;
153
+ country?: string | undefined;
153
154
  city?: string | undefined;
154
155
  line?: string[] | undefined;
155
156
  postalCode?: string | undefined;
156
- country?: string | undefined;
157
157
  }[] | undefined;
158
158
  telecom?: {
159
159
  value?: string | undefined;
@@ -170,10 +170,10 @@ export declare const patientSearchSchema: z.ZodObject<{
170
170
  }[] | undefined;
171
171
  address?: {
172
172
  state?: string | undefined;
173
+ country?: string | undefined;
173
174
  city?: string | undefined;
174
175
  line?: string[] | undefined;
175
176
  postalCode?: string | undefined;
176
- country?: string | undefined;
177
177
  }[] | undefined;
178
178
  telecom?: {
179
179
  value?: string | undefined;
@@ -190,10 +190,10 @@ export declare const patientSearchSchema: z.ZodObject<{
190
190
  }[] | undefined;
191
191
  address?: {
192
192
  state?: string | undefined;
193
+ country?: string | undefined;
193
194
  city?: string | undefined;
194
195
  line?: string[] | undefined;
195
196
  postalCode?: string | undefined;
196
- country?: string | undefined;
197
197
  }[] | undefined;
198
198
  telecom?: {
199
199
  value?: string | undefined;
@@ -212,10 +212,10 @@ export declare const patientSearchSchema: z.ZodObject<{
212
212
  }[] | undefined;
213
213
  address?: {
214
214
  state?: string | undefined;
215
+ country?: string | undefined;
215
216
  city?: string | undefined;
216
217
  line?: string[] | undefined;
217
218
  postalCode?: string | undefined;
218
- country?: string | undefined;
219
219
  }[] | undefined;
220
220
  telecom?: {
221
221
  value?: string | undefined;
@@ -234,10 +234,10 @@ export declare const patientSearchSchema: z.ZodObject<{
234
234
  }[] | undefined;
235
235
  address?: {
236
236
  state?: string | undefined;
237
+ country?: string | undefined;
237
238
  city?: string | undefined;
238
239
  line?: string[] | undefined;
239
240
  postalCode?: string | undefined;
240
- country?: string | undefined;
241
241
  }[] | undefined;
242
242
  telecom?: {
243
243
  value?: string | undefined;
@@ -1,3 +1,4 @@
1
1
  export * from "./internal";
2
2
  export * from "./schema";
3
+ export * from "./external";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./internal"), exports);
18
18
  __exportStar(require("./schema"), exports);
19
+ __exportStar(require("./external"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,2CAAyB;AACzB,6CAA2B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metriport/shared",
3
- "version": "0.20.0",
3
+ "version": "0.20.1-alpha.0",
4
4
  "description": "Common code shared across packages - by Metriport Inc.",
5
5
  "author": "Metriport Inc. <contact@metriport.com>",
6
6
  "homepage": "https://metriport.com/",
@@ -101,5 +101,5 @@
101
101
  "ts-jest": "29.1.1",
102
102
  "typescript": "^4.9.5"
103
103
  },
104
- "gitHead": "9028181266415b73b714ec93785db7b09dd73b91"
104
+ "gitHead": "c305d40edd46d40233198199cf2f4b70531604b6"
105
105
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=normalize-zip.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalize-zip.test.d.ts","sourceRoot":"","sources":["../../../../src/domain/address/__tests__/normalize-zip.test.ts"],"names":[],"mappings":""}