@metriport/shared 0.32.2 → 0.32.4

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/common/__tests__/string.test.js +63 -0
  2. package/dist/common/__tests__/string.test.js.map +1 -1
  3. package/dist/common/demographics.d.ts +1 -1
  4. package/dist/common/merge-settings.js.map +1 -1
  5. package/dist/common/string.d.ts +6 -0
  6. package/dist/common/string.d.ts.map +1 -1
  7. package/dist/common/string.js +22 -1
  8. package/dist/common/string.js.map +1 -1
  9. package/dist/domain/tcm-encounter.d.ts +2 -2
  10. package/dist/error/__tests__/shared.test.js +458 -0
  11. package/dist/error/__tests__/shared.test.js.map +1 -1
  12. package/dist/error/shared.d.ts +1 -0
  13. package/dist/error/shared.d.ts.map +1 -1
  14. package/dist/error/shared.js +44 -1
  15. package/dist/error/shared.js.map +1 -1
  16. package/dist/external/hl7v2/constants.d.ts +31 -9
  17. package/dist/external/hl7v2/constants.d.ts.map +1 -1
  18. package/dist/external/hl7v2/constants.js +33 -10
  19. package/dist/external/hl7v2/constants.js.map +1 -1
  20. package/dist/interface/external/ehr/salesforce/patient.d.ts +232 -88
  21. package/dist/interface/external/ehr/salesforce/patient.d.ts.map +1 -1
  22. package/dist/interface/external/ehr/salesforce/patient.js +43 -5
  23. package/dist/interface/external/ehr/salesforce/patient.js.map +1 -1
  24. package/dist/medical/fhir/specialty-codes.d.ts +79 -0
  25. package/dist/medical/fhir/specialty-codes.d.ts.map +1 -0
  26. package/dist/medical/fhir/specialty-codes.js +1722 -0
  27. package/dist/medical/fhir/specialty-codes.js.map +1 -0
  28. package/dist/util/__tests__/concurrency.test.d.ts +2 -0
  29. package/dist/util/__tests__/concurrency.test.d.ts.map +1 -0
  30. package/dist/util/__tests__/concurrency.test.js +162 -0
  31. package/dist/util/__tests__/concurrency.test.js.map +1 -0
  32. package/dist/util/__tests__/null-to-undefined.test.d.ts +2 -0
  33. package/dist/util/__tests__/null-to-undefined.test.d.ts.map +1 -0
  34. package/dist/util/__tests__/null-to-undefined.test.js +60 -0
  35. package/dist/util/__tests__/null-to-undefined.test.js.map +1 -0
  36. package/dist/util/concurrency.d.ts +72 -0
  37. package/dist/util/concurrency.d.ts.map +1 -0
  38. package/dist/util/concurrency.js +87 -0
  39. package/dist/util/concurrency.js.map +1 -0
  40. package/dist/util/index.d.ts +2 -0
  41. package/dist/util/index.d.ts.map +1 -1
  42. package/dist/util/index.js +2 -0
  43. package/dist/util/index.js.map +1 -1
  44. package/dist/util/null-to-undefined.d.ts +2 -0
  45. package/dist/util/null-to-undefined.d.ts.map +1 -0
  46. package/dist/util/null-to-undefined.js +31 -0
  47. package/dist/util/null-to-undefined.js.map +1 -0
  48. package/package.json +5 -2
@@ -1,10 +1,32 @@
1
- export declare const BAMBOO_HIE_NAME = "Bamboo";
2
- export declare const KONZA_HIE_NAME = "Konza";
3
- export declare const HEALTH_CONNECT_TEXAS_HIE_NAME = "HealthConnectTexas";
4
- export declare const HIXNY_HIE_NAME = "Hixny";
5
- export declare const HIE_TEXAS_PCC = "HieTexasPcc";
6
- export declare const ALOHR_HIE_NAME = "Alohr";
7
- export declare const LAHIE_HIE_NAME = "Lahie";
8
- export declare const FLHIE_HIE_NAME = "Flhie";
9
- export declare const NUMBER_OF_HIEs = 8;
1
+ export declare enum HieName {
2
+ Bamboo = "Bamboo",
3
+ Konza = "Konza",
4
+ HealthConnectTexas = "HealthConnectTexas",
5
+ Hixny = "Hixny",
6
+ HieTexasPcc = "HieTexasPcc",
7
+ Alohr = "Alohr",
8
+ Lahie = "Lahie",
9
+ Flhie = "Flhie",
10
+ Riqi = "Riqi"
11
+ }
12
+ export declare const ALL_HIES: HieName[];
13
+ export declare const NUMBER_OF_HIEs: number;
14
+ /** @deprecated Use HieName.Bamboo */
15
+ export declare const BAMBOO_HIE_NAME = HieName.Bamboo;
16
+ /** @deprecated Use HieName.Konza */
17
+ export declare const KONZA_HIE_NAME = HieName.Konza;
18
+ /** @deprecated Use HieName.HealthConnectTexas */
19
+ export declare const HEALTH_CONNECT_TEXAS_HIE_NAME = HieName.HealthConnectTexas;
20
+ /** @deprecated Use HieName.Hixny */
21
+ export declare const HIXNY_HIE_NAME = HieName.Hixny;
22
+ /** @deprecated Use HieName.HieTexasPcc */
23
+ export declare const HIE_TEXAS_PCC = HieName.HieTexasPcc;
24
+ /** @deprecated Use HieName.Alohr */
25
+ export declare const ALOHR_HIE_NAME = HieName.Alohr;
26
+ /** @deprecated Use HieName.Lahie */
27
+ export declare const LAHIE_HIE_NAME = HieName.Lahie;
28
+ /** @deprecated Use HieName.Flhie */
29
+ export declare const FLHIE_HIE_NAME = HieName.Flhie;
30
+ /** @deprecated Use HieName.Riqi */
31
+ export declare const RIQI_HIE_NAME = HieName.Riqi;
10
32
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/external/hl7v2/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,WAAW,CAAC;AACxC,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,eAAO,MAAM,6BAA6B,uBAAuB,CAAC;AAClE,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,eAAO,MAAM,aAAa,gBAAgB,CAAC;AAC3C,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,eAAO,MAAM,cAAc,IAAI,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/external/hl7v2/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,OAAO;IACjB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,kBAAkB,uBAAuB;IACzC,KAAK,UAAU;IACf,WAAW,gBAAgB;IAC3B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,eAAO,MAAM,QAAQ,WAAyB,CAAC;AAC/C,eAAO,MAAM,cAAc,QAAkB,CAAC;AAE9C,qCAAqC;AACrC,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAC9C,oCAAoC;AACpC,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAC5C,iDAAiD;AACjD,eAAO,MAAM,6BAA6B,6BAA6B,CAAC;AACxE,oCAAoC;AACpC,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAC5C,0CAA0C;AAC1C,eAAO,MAAM,aAAa,sBAAsB,CAAC;AACjD,oCAAoC;AACpC,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAC5C,oCAAoC;AACpC,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAC5C,oCAAoC;AACpC,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAC5C,mCAAmC;AACnC,eAAO,MAAM,aAAa,eAAe,CAAC"}
@@ -1,13 +1,36 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NUMBER_OF_HIEs = exports.FLHIE_HIE_NAME = exports.LAHIE_HIE_NAME = exports.ALOHR_HIE_NAME = exports.HIE_TEXAS_PCC = exports.HIXNY_HIE_NAME = exports.HEALTH_CONNECT_TEXAS_HIE_NAME = exports.KONZA_HIE_NAME = exports.BAMBOO_HIE_NAME = void 0;
4
- exports.BAMBOO_HIE_NAME = "Bamboo";
5
- exports.KONZA_HIE_NAME = "Konza";
6
- exports.HEALTH_CONNECT_TEXAS_HIE_NAME = "HealthConnectTexas";
7
- exports.HIXNY_HIE_NAME = "Hixny";
8
- exports.HIE_TEXAS_PCC = "HieTexasPcc";
9
- exports.ALOHR_HIE_NAME = "Alohr";
10
- exports.LAHIE_HIE_NAME = "Lahie";
11
- exports.FLHIE_HIE_NAME = "Flhie";
12
- exports.NUMBER_OF_HIEs = 8;
3
+ exports.RIQI_HIE_NAME = exports.FLHIE_HIE_NAME = exports.LAHIE_HIE_NAME = exports.ALOHR_HIE_NAME = exports.HIE_TEXAS_PCC = exports.HIXNY_HIE_NAME = exports.HEALTH_CONNECT_TEXAS_HIE_NAME = exports.KONZA_HIE_NAME = exports.BAMBOO_HIE_NAME = exports.NUMBER_OF_HIEs = exports.ALL_HIES = exports.HieName = void 0;
4
+ var HieName;
5
+ (function (HieName) {
6
+ HieName["Bamboo"] = "Bamboo";
7
+ HieName["Konza"] = "Konza";
8
+ HieName["HealthConnectTexas"] = "HealthConnectTexas";
9
+ HieName["Hixny"] = "Hixny";
10
+ HieName["HieTexasPcc"] = "HieTexasPcc";
11
+ HieName["Alohr"] = "Alohr";
12
+ HieName["Lahie"] = "Lahie";
13
+ HieName["Flhie"] = "Flhie";
14
+ HieName["Riqi"] = "Riqi";
15
+ })(HieName = exports.HieName || (exports.HieName = {}));
16
+ exports.ALL_HIES = Object.values(HieName);
17
+ exports.NUMBER_OF_HIEs = exports.ALL_HIES.length;
18
+ /** @deprecated Use HieName.Bamboo */
19
+ exports.BAMBOO_HIE_NAME = HieName.Bamboo;
20
+ /** @deprecated Use HieName.Konza */
21
+ exports.KONZA_HIE_NAME = HieName.Konza;
22
+ /** @deprecated Use HieName.HealthConnectTexas */
23
+ exports.HEALTH_CONNECT_TEXAS_HIE_NAME = HieName.HealthConnectTexas;
24
+ /** @deprecated Use HieName.Hixny */
25
+ exports.HIXNY_HIE_NAME = HieName.Hixny;
26
+ /** @deprecated Use HieName.HieTexasPcc */
27
+ exports.HIE_TEXAS_PCC = HieName.HieTexasPcc;
28
+ /** @deprecated Use HieName.Alohr */
29
+ exports.ALOHR_HIE_NAME = HieName.Alohr;
30
+ /** @deprecated Use HieName.Lahie */
31
+ exports.LAHIE_HIE_NAME = HieName.Lahie;
32
+ /** @deprecated Use HieName.Flhie */
33
+ exports.FLHIE_HIE_NAME = HieName.Flhie;
34
+ /** @deprecated Use HieName.Riqi */
35
+ exports.RIQI_HIE_NAME = HieName.Riqi;
13
36
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/external/hl7v2/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,cAAc,GAAG,OAAO,CAAC;AACzB,QAAA,6BAA6B,GAAG,oBAAoB,CAAC;AACrD,QAAA,cAAc,GAAG,OAAO,CAAC;AACzB,QAAA,aAAa,GAAG,aAAa,CAAC;AAC9B,QAAA,cAAc,GAAG,OAAO,CAAC;AACzB,QAAA,cAAc,GAAG,OAAO,CAAC;AACzB,QAAA,cAAc,GAAG,OAAO,CAAC;AACzB,QAAA,cAAc,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/external/hl7v2/constants.ts"],"names":[],"mappings":";;;AAAA,IAAY,OAUX;AAVD,WAAY,OAAO;IACjB,4BAAiB,CAAA;IACjB,0BAAe,CAAA;IACf,oDAAyC,CAAA;IACzC,0BAAe,CAAA;IACf,sCAA2B,CAAA;IAC3B,0BAAe,CAAA;IACf,0BAAe,CAAA;IACf,0BAAe,CAAA;IACf,wBAAa,CAAA;AACf,CAAC,EAVW,OAAO,GAAP,eAAO,KAAP,eAAO,QAUlB;AAEY,QAAA,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAClC,QAAA,cAAc,GAAG,gBAAQ,CAAC,MAAM,CAAC;AAE9C,qCAAqC;AACxB,QAAA,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;AAC9C,oCAAoC;AACvB,QAAA,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;AAC5C,iDAAiD;AACpC,QAAA,6BAA6B,GAAG,OAAO,CAAC,kBAAkB,CAAC;AACxE,oCAAoC;AACvB,QAAA,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;AAC5C,0CAA0C;AAC7B,QAAA,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC;AACjD,oCAAoC;AACvB,QAAA,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;AAC5C,oCAAoC;AACvB,QAAA,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;AAC5C,oCAAoC;AACvB,QAAA,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;AAC5C,mCAAmC;AACtB,QAAA,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import { z } from "zod";
2
- export declare const patientSchema: z.ZodObject<{
2
+ /**
3
+ * Schema for Contact object
4
+ */
5
+ export declare const contactPatientSchema: z.ZodObject<{
3
6
  attributes: z.ZodObject<{
4
7
  type: z.ZodLiteral<"Contact">;
5
8
  url: z.ZodString;
@@ -63,12 +66,149 @@ export declare const patientSchema: z.ZodObject<{
63
66
  GenderIdentity: string | null;
64
67
  Birthdate: string | null;
65
68
  }>;
66
- export type Patient = z.infer<typeof patientSchema>;
69
+ export type ContactPatient = z.infer<typeof contactPatientSchema>;
70
+ /**
71
+ * Schema for Account object
72
+ */
73
+ export declare const accountPatientSchema: z.ZodObject<{
74
+ attributes: z.ZodObject<{
75
+ type: z.ZodLiteral<"Account">;
76
+ url: z.ZodString;
77
+ }, "strip", z.ZodTypeAny, {
78
+ type: "Account";
79
+ url: string;
80
+ }, {
81
+ type: "Account";
82
+ url: string;
83
+ }>;
84
+ Id: z.ZodString;
85
+ First_name__c: z.ZodNullable<z.ZodString>;
86
+ Last_name__c: z.ZodNullable<z.ZodString>;
87
+ BillingStreet: z.ZodNullable<z.ZodString>;
88
+ BillingCity: z.ZodNullable<z.ZodString>;
89
+ BillingState: z.ZodNullable<z.ZodString>;
90
+ BillingPostalCode: z.ZodNullable<z.ZodString>;
91
+ BillingCountry: z.ZodNullable<z.ZodString>;
92
+ Phone: z.ZodNullable<z.ZodString>;
93
+ PersonMobilePhone: z.ZodNullable<z.ZodString>;
94
+ PersonOtherPhone: z.ZodNullable<z.ZodString>;
95
+ PersonEmail: z.ZodNullable<z.ZodString>;
96
+ GenderIdentity__c: z.ZodNullable<z.ZodString>;
97
+ Date_of_Birth__c: z.ZodNullable<z.ZodString>;
98
+ }, "strip", z.ZodTypeAny, {
99
+ attributes: {
100
+ type: "Account";
101
+ url: string;
102
+ };
103
+ Id: string;
104
+ Phone: string | null;
105
+ First_name__c: string | null;
106
+ Last_name__c: string | null;
107
+ BillingStreet: string | null;
108
+ BillingCity: string | null;
109
+ BillingState: string | null;
110
+ BillingPostalCode: string | null;
111
+ BillingCountry: string | null;
112
+ PersonMobilePhone: string | null;
113
+ PersonOtherPhone: string | null;
114
+ PersonEmail: string | null;
115
+ GenderIdentity__c: string | null;
116
+ Date_of_Birth__c: string | null;
117
+ }, {
118
+ attributes: {
119
+ type: "Account";
120
+ url: string;
121
+ };
122
+ Id: string;
123
+ Phone: string | null;
124
+ First_name__c: string | null;
125
+ Last_name__c: string | null;
126
+ BillingStreet: string | null;
127
+ BillingCity: string | null;
128
+ BillingState: string | null;
129
+ BillingPostalCode: string | null;
130
+ BillingCountry: string | null;
131
+ PersonMobilePhone: string | null;
132
+ PersonOtherPhone: string | null;
133
+ PersonEmail: string | null;
134
+ GenderIdentity__c: string | null;
135
+ Date_of_Birth__c: string | null;
136
+ }>;
137
+ export type AccountPatient = z.infer<typeof accountPatientSchema>;
138
+ /**
139
+ * Generic patient schema that can be either Contact or Account
140
+ * Uses passthrough to allow additional fields beyond the defined ones
141
+ */
142
+ export declare const genericPatientSchema: z.ZodObject<{
143
+ attributes: z.ZodUnion<[z.ZodObject<{
144
+ type: z.ZodLiteral<"Contact">;
145
+ url: z.ZodString;
146
+ }, "strip", z.ZodTypeAny, {
147
+ type: "Contact";
148
+ url: string;
149
+ }, {
150
+ type: "Contact";
151
+ url: string;
152
+ }>, z.ZodObject<{
153
+ type: z.ZodLiteral<"Account">;
154
+ url: z.ZodString;
155
+ }, "strip", z.ZodTypeAny, {
156
+ type: "Account";
157
+ url: string;
158
+ }, {
159
+ type: "Account";
160
+ url: string;
161
+ }>]>;
162
+ Id: z.ZodString;
163
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
164
+ attributes: z.ZodUnion<[z.ZodObject<{
165
+ type: z.ZodLiteral<"Contact">;
166
+ url: z.ZodString;
167
+ }, "strip", z.ZodTypeAny, {
168
+ type: "Contact";
169
+ url: string;
170
+ }, {
171
+ type: "Contact";
172
+ url: string;
173
+ }>, z.ZodObject<{
174
+ type: z.ZodLiteral<"Account">;
175
+ url: z.ZodString;
176
+ }, "strip", z.ZodTypeAny, {
177
+ type: "Account";
178
+ url: string;
179
+ }, {
180
+ type: "Account";
181
+ url: string;
182
+ }>]>;
183
+ Id: z.ZodString;
184
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
185
+ attributes: z.ZodUnion<[z.ZodObject<{
186
+ type: z.ZodLiteral<"Contact">;
187
+ url: z.ZodString;
188
+ }, "strip", z.ZodTypeAny, {
189
+ type: "Contact";
190
+ url: string;
191
+ }, {
192
+ type: "Contact";
193
+ url: string;
194
+ }>, z.ZodObject<{
195
+ type: z.ZodLiteral<"Account">;
196
+ url: z.ZodString;
197
+ }, "strip", z.ZodTypeAny, {
198
+ type: "Account";
199
+ url: string;
200
+ }, {
201
+ type: "Account";
202
+ url: string;
203
+ }>]>;
204
+ Id: z.ZodString;
205
+ }, z.ZodTypeAny, "passthrough">>;
206
+ export type GenericPatient = z.infer<typeof genericPatientSchema>;
67
207
  export declare const patientSOQLSchema: z.ZodObject<{
68
208
  totalSize: z.ZodNumber;
69
209
  done: z.ZodBoolean;
70
210
  records: z.ZodArray<z.ZodObject<{
71
- attributes: z.ZodObject<{
211
+ attributes: z.ZodUnion<[z.ZodObject<{
72
212
  type: z.ZodLiteral<"Contact">;
73
213
  url: z.ZodString;
74
214
  }, "strip", z.ZodTypeAny, {
@@ -77,106 +217,110 @@ export declare const patientSOQLSchema: z.ZodObject<{
77
217
  }, {
78
218
  type: "Contact";
79
219
  url: string;
80
- }>;
220
+ }>, z.ZodObject<{
221
+ type: z.ZodLiteral<"Account">;
222
+ url: z.ZodString;
223
+ }, "strip", z.ZodTypeAny, {
224
+ type: "Account";
225
+ url: string;
226
+ }, {
227
+ type: "Account";
228
+ url: string;
229
+ }>]>;
81
230
  Id: z.ZodString;
82
- FirstName: z.ZodNullable<z.ZodString>;
83
- LastName: z.ZodNullable<z.ZodString>;
84
- MailingStreet: z.ZodNullable<z.ZodString>;
85
- MailingCity: z.ZodNullable<z.ZodString>;
86
- MailingState: z.ZodNullable<z.ZodString>;
87
- MailingPostalCode: z.ZodNullable<z.ZodString>;
88
- MailingCountry: z.ZodNullable<z.ZodString>;
89
- Phone: z.ZodNullable<z.ZodString>;
90
- MobilePhone: z.ZodNullable<z.ZodString>;
91
- OtherPhone: z.ZodNullable<z.ZodString>;
92
- Email: z.ZodNullable<z.ZodString>;
93
- GenderIdentity: z.ZodNullable<z.ZodString>;
94
- Birthdate: z.ZodNullable<z.ZodString>;
95
- }, "strip", z.ZodTypeAny, {
96
- attributes: {
231
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
232
+ attributes: z.ZodUnion<[z.ZodObject<{
233
+ type: z.ZodLiteral<"Contact">;
234
+ url: z.ZodString;
235
+ }, "strip", z.ZodTypeAny, {
97
236
  type: "Contact";
98
237
  url: string;
99
- };
100
- Id: string;
101
- FirstName: string | null;
102
- LastName: string | null;
103
- MailingStreet: string | null;
104
- MailingCity: string | null;
105
- MailingState: string | null;
106
- MailingPostalCode: string | null;
107
- MailingCountry: string | null;
108
- Phone: string | null;
109
- MobilePhone: string | null;
110
- OtherPhone: string | null;
111
- Email: string | null;
112
- GenderIdentity: string | null;
113
- Birthdate: string | null;
114
- }, {
115
- attributes: {
238
+ }, {
116
239
  type: "Contact";
117
240
  url: string;
118
- };
119
- Id: string;
120
- FirstName: string | null;
121
- LastName: string | null;
122
- MailingStreet: string | null;
123
- MailingCity: string | null;
124
- MailingState: string | null;
125
- MailingPostalCode: string | null;
126
- MailingCountry: string | null;
127
- Phone: string | null;
128
- MobilePhone: string | null;
129
- OtherPhone: string | null;
130
- Email: string | null;
131
- GenderIdentity: string | null;
132
- Birthdate: string | null;
133
- }>, "many">;
241
+ }>, z.ZodObject<{
242
+ type: z.ZodLiteral<"Account">;
243
+ url: z.ZodString;
244
+ }, "strip", z.ZodTypeAny, {
245
+ type: "Account";
246
+ url: string;
247
+ }, {
248
+ type: "Account";
249
+ url: string;
250
+ }>]>;
251
+ Id: z.ZodString;
252
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
253
+ attributes: z.ZodUnion<[z.ZodObject<{
254
+ type: z.ZodLiteral<"Contact">;
255
+ url: z.ZodString;
256
+ }, "strip", z.ZodTypeAny, {
257
+ type: "Contact";
258
+ url: string;
259
+ }, {
260
+ type: "Contact";
261
+ url: string;
262
+ }>, z.ZodObject<{
263
+ type: z.ZodLiteral<"Account">;
264
+ url: z.ZodString;
265
+ }, "strip", z.ZodTypeAny, {
266
+ type: "Account";
267
+ url: string;
268
+ }, {
269
+ type: "Account";
270
+ url: string;
271
+ }>]>;
272
+ Id: z.ZodString;
273
+ }, z.ZodTypeAny, "passthrough">>, "many">;
134
274
  }, "strip", z.ZodTypeAny, {
135
275
  done: boolean;
136
276
  totalSize: number;
137
- records: {
138
- attributes: {
277
+ records: z.objectOutputType<{
278
+ attributes: z.ZodUnion<[z.ZodObject<{
279
+ type: z.ZodLiteral<"Contact">;
280
+ url: z.ZodString;
281
+ }, "strip", z.ZodTypeAny, {
139
282
  type: "Contact";
140
283
  url: string;
141
- };
142
- Id: string;
143
- FirstName: string | null;
144
- LastName: string | null;
145
- MailingStreet: string | null;
146
- MailingCity: string | null;
147
- MailingState: string | null;
148
- MailingPostalCode: string | null;
149
- MailingCountry: string | null;
150
- Phone: string | null;
151
- MobilePhone: string | null;
152
- OtherPhone: string | null;
153
- Email: string | null;
154
- GenderIdentity: string | null;
155
- Birthdate: string | null;
156
- }[];
284
+ }, {
285
+ type: "Contact";
286
+ url: string;
287
+ }>, z.ZodObject<{
288
+ type: z.ZodLiteral<"Account">;
289
+ url: z.ZodString;
290
+ }, "strip", z.ZodTypeAny, {
291
+ type: "Account";
292
+ url: string;
293
+ }, {
294
+ type: "Account";
295
+ url: string;
296
+ }>]>;
297
+ Id: z.ZodString;
298
+ }, z.ZodTypeAny, "passthrough">[];
157
299
  }, {
158
300
  done: boolean;
159
301
  totalSize: number;
160
- records: {
161
- attributes: {
302
+ records: z.objectInputType<{
303
+ attributes: z.ZodUnion<[z.ZodObject<{
304
+ type: z.ZodLiteral<"Contact">;
305
+ url: z.ZodString;
306
+ }, "strip", z.ZodTypeAny, {
307
+ type: "Contact";
308
+ url: string;
309
+ }, {
162
310
  type: "Contact";
163
311
  url: string;
164
- };
165
- Id: string;
166
- FirstName: string | null;
167
- LastName: string | null;
168
- MailingStreet: string | null;
169
- MailingCity: string | null;
170
- MailingState: string | null;
171
- MailingPostalCode: string | null;
172
- MailingCountry: string | null;
173
- Phone: string | null;
174
- MobilePhone: string | null;
175
- OtherPhone: string | null;
176
- Email: string | null;
177
- GenderIdentity: string | null;
178
- Birthdate: string | null;
179
- }[];
312
+ }>, z.ZodObject<{
313
+ type: z.ZodLiteral<"Account">;
314
+ url: z.ZodString;
315
+ }, "strip", z.ZodTypeAny, {
316
+ type: "Account";
317
+ url: string;
318
+ }, {
319
+ type: "Account";
320
+ url: string;
321
+ }>]>;
322
+ Id: z.ZodString;
323
+ }, z.ZodTypeAny, "passthrough">[];
180
324
  }>;
181
325
  export type PatientSOQL = z.infer<typeof patientSOQLSchema>;
182
326
  //# sourceMappingURL=patient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"patient.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/salesforce/patient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,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CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -1,13 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patientSOQLSchema = exports.patientSchema = void 0;
3
+ exports.patientSOQLSchema = exports.genericPatientSchema = exports.accountPatientSchema = exports.contactPatientSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const attributesSchema = zod_1.z.object({
5
+ const contactAttributesSchema = zod_1.z.object({
6
6
  type: zod_1.z.literal("Contact"),
7
7
  url: zod_1.z.string(),
8
8
  });
9
- exports.patientSchema = zod_1.z.object({
10
- attributes: attributesSchema,
9
+ const accountAttributesSchema = zod_1.z.object({
10
+ type: zod_1.z.literal("Account"),
11
+ url: zod_1.z.string(),
12
+ });
13
+ const attributesSchema = zod_1.z.union([contactAttributesSchema, accountAttributesSchema]);
14
+ /**
15
+ * Schema for Contact object
16
+ */
17
+ exports.contactPatientSchema = zod_1.z.object({
18
+ attributes: contactAttributesSchema,
11
19
  Id: zod_1.z.string(),
12
20
  FirstName: zod_1.z.string().nullable(),
13
21
  LastName: zod_1.z.string().nullable(),
@@ -23,9 +31,39 @@ exports.patientSchema = zod_1.z.object({
23
31
  GenderIdentity: zod_1.z.string().nullable(),
24
32
  Birthdate: zod_1.z.string().nullable(),
25
33
  });
34
+ /**
35
+ * Schema for Account object
36
+ */
37
+ exports.accountPatientSchema = zod_1.z.object({
38
+ attributes: accountAttributesSchema,
39
+ Id: zod_1.z.string(),
40
+ First_name__c: zod_1.z.string().nullable(),
41
+ Last_name__c: zod_1.z.string().nullable(),
42
+ BillingStreet: zod_1.z.string().nullable(),
43
+ BillingCity: zod_1.z.string().nullable(),
44
+ BillingState: zod_1.z.string().nullable(),
45
+ BillingPostalCode: zod_1.z.string().nullable(),
46
+ BillingCountry: zod_1.z.string().nullable(),
47
+ Phone: zod_1.z.string().nullable(),
48
+ PersonMobilePhone: zod_1.z.string().nullable(),
49
+ PersonOtherPhone: zod_1.z.string().nullable(),
50
+ PersonEmail: zod_1.z.string().nullable(),
51
+ GenderIdentity__c: zod_1.z.string().nullable(),
52
+ Date_of_Birth__c: zod_1.z.string().nullable(),
53
+ });
54
+ /**
55
+ * Generic patient schema that can be either Contact or Account
56
+ * Uses passthrough to allow additional fields beyond the defined ones
57
+ */
58
+ exports.genericPatientSchema = zod_1.z
59
+ .object({
60
+ attributes: attributesSchema,
61
+ Id: zod_1.z.string(),
62
+ })
63
+ .passthrough();
26
64
  exports.patientSOQLSchema = zod_1.z.object({
27
65
  totalSize: zod_1.z.number(),
28
66
  done: zod_1.z.boolean(),
29
- records: zod_1.z.array(exports.patientSchema),
67
+ records: zod_1.z.array(exports.genericPatientSchema),
30
68
  });
31
69
  //# sourceMappingURL=patient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"patient.js","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/salesforce/patient.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;CAChB,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,UAAU,EAAE,gBAAgB;IAC5B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,iBA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a,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAIH;;;GAGG;AACU,QAAA,oBAAoB,GAAG,OAAC;KAClC,MAAM,CAAC;IACN,UAAU,EAAE,gBAAgB;IAC5B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC;KACD,WAAW,EAAE,CAAC;AAIJ,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,OAAC,CAAC,OAAO,EAAE;IACjB,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,4BAAoB,CAAC;CACvC,CAAC,CAAC"}
@@ -0,0 +1,79 @@
1
+ type SpecialtyCode = {
2
+ classification: string;
3
+ specialization: string;
4
+ };
5
+ /**
6
+ * NUCC Provider Taxonomy Code mappings for medical specialties
7
+ * Reference: https://nucc.org/index.php/code-sets-mainmenu-41/provider-taxonomy-mainmenu-40/csv-mainmenu-57
8
+ */
9
+ export declare const PRACTITIONER_SPECIALTY_CODES: Record<string, SpecialtyCode>;
10
+ /**
11
+ * Organization name keyword mappings for specialty detection
12
+ */
13
+ export declare const ORGANIZATION_SPECIALTY_KEYWORDS: {
14
+ readonly cardiology: "Cardiovascular";
15
+ readonly cardiac: "Cardiovascular";
16
+ readonly heart: "Cardiovascular";
17
+ readonly cardiovascular: "Cardiovascular";
18
+ readonly pulmonology: "Pulmonary";
19
+ readonly pulmonary: "Pulmonary";
20
+ readonly lung: "Pulmonary";
21
+ readonly respiratory: "Pulmonary";
22
+ readonly oncology: "Medical Oncology";
23
+ readonly cancer: "Medical Oncology";
24
+ readonly tumor: "Medical Oncology";
25
+ readonly hematology: "Hematology";
26
+ readonly emergency: "Emergency Medicine";
27
+ readonly trauma: "Emergency Medicine";
28
+ readonly urgent: "Emergency Medicine";
29
+ readonly surgery: "Orthopaedic Surgery";
30
+ readonly surgical: "Orthopaedic Surgery";
31
+ readonly orthopedic: "Orthopaedic Surgery";
32
+ readonly orthopaedic: "Orthopaedic Surgery";
33
+ readonly neurosurgery: "Neurological Surgery";
34
+ readonly internal: "Internal Medicine";
35
+ readonly medicine: "Internal Medicine";
36
+ readonly radiology: "Nuclear Medicine";
37
+ readonly imaging: "Nuclear Medicine";
38
+ readonly psychiatry: "Psychiatry";
39
+ readonly mental: "Psychiatry";
40
+ readonly behavioral: "Psychiatry";
41
+ readonly family: "Family Medicine";
42
+ readonly primary: "Family Medicine";
43
+ readonly dermatology: "Dermatology";
44
+ readonly skin: "Dermatology";
45
+ readonly anesthesiology: "Anesthesiology";
46
+ readonly anesthesia: "Anesthesiology";
47
+ readonly pathology: "Anatomic Pathology & Clinical Pathology";
48
+ readonly laboratory: "Anatomic Pathology & Clinical Pathology";
49
+ readonly pediatrics: "Pediatrics";
50
+ readonly pediatric: "Pediatrics";
51
+ readonly children: "Pediatrics";
52
+ readonly obstetrics: "Obstetrics & Gynecology";
53
+ readonly gynecology: "Obstetrics & Gynecology";
54
+ readonly women: "Obstetrics & Gynecology";
55
+ readonly ophthalmology: "Ophthalmology";
56
+ readonly eye: "Ophthalmology";
57
+ readonly vision: "Ophthalmology";
58
+ readonly otolaryngology: "Otolaryngology";
59
+ readonly ear: "Otolaryngology";
60
+ readonly nose: "Otolaryngology";
61
+ readonly throat: "Otolaryngology";
62
+ readonly pain: "Pain Medicine";
63
+ readonly allergy: "Allergy & Immunology";
64
+ readonly immunology: "Allergy & Immunology";
65
+ readonly gastroenterology: "Gastroenterology";
66
+ readonly gastro: "Gastroenterology";
67
+ readonly nephrology: "Nephrology";
68
+ readonly kidney: "Nephrology";
69
+ readonly endocrinology: "Endocrinology, Diabetes & Metabolism";
70
+ readonly diabetes: "Endocrinology, Diabetes & Metabolism";
71
+ readonly hormone: "Endocrinology, Diabetes & Metabolism";
72
+ readonly rheumatology: "Rheumatology";
73
+ readonly arthritis: "Rheumatology";
74
+ readonly joint: "Rheumatology";
75
+ readonly infectious: "Infectious Disease";
76
+ readonly infection: "Infectious Disease";
77
+ };
78
+ export {};
79
+ //# sourceMappingURL=specialty-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specialty-codes.d.ts","sourceRoot":"","sources":["../../../src/medical/fhir/specialty-codes.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAwlD7D,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6GlC,CAAC"}