@metriport/shared 0.19.5 → 0.20.0-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 (121) hide show
  1. package/dist/common/__tests__/date.test.js +27 -0
  2. package/dist/common/__tests__/date.test.js.map +1 -1
  3. package/dist/common/date.d.ts +3 -0
  4. package/dist/common/date.d.ts.map +1 -1
  5. package/dist/common/date.js +14 -3
  6. package/dist/common/date.js.map +1 -1
  7. package/dist/domain/__tests__/dob.test.d.ts +2 -0
  8. package/dist/domain/__tests__/dob.test.d.ts.map +1 -0
  9. package/dist/domain/__tests__/dob.test.js +37 -0
  10. package/dist/domain/__tests__/dob.test.js.map +1 -0
  11. package/dist/domain/address/__tests__/normalize-zip.test.d.ts +1 -1
  12. package/dist/domain/address/__tests__/zip.test.d.ts +2 -0
  13. package/dist/domain/address/__tests__/zip.test.d.ts.map +1 -0
  14. package/dist/domain/address/__tests__/zip.test.js +83 -0
  15. package/dist/domain/address/__tests__/zip.test.js.map +1 -0
  16. package/dist/domain/address/city.d.ts +2 -0
  17. package/dist/domain/address/city.d.ts.map +1 -0
  18. package/dist/domain/address/city.js +9 -0
  19. package/dist/domain/address/city.js.map +1 -0
  20. package/dist/domain/contact/__tests__/email.test.js +41 -0
  21. package/dist/domain/contact/__tests__/email.test.js.map +1 -1
  22. package/dist/domain/contact/email.d.ts +20 -0
  23. package/dist/domain/contact/email.d.ts.map +1 -1
  24. package/dist/domain/contact/email.js +45 -1
  25. package/dist/domain/contact/email.js.map +1 -1
  26. package/dist/domain/dob.d.ts +2 -2
  27. package/dist/domain/dob.d.ts.map +1 -1
  28. package/dist/domain/dob.js +11 -15
  29. package/dist/domain/dob.js.map +1 -1
  30. package/dist/domain/jwt-token.d.ts +5 -0
  31. package/dist/domain/jwt-token.d.ts.map +1 -0
  32. package/dist/domain/jwt-token.js +3 -0
  33. package/dist/domain/jwt-token.js.map +1 -0
  34. package/dist/domain/patient/__tests__/ssn.test.d.ts +2 -0
  35. package/dist/domain/patient/__tests__/ssn.test.d.ts.map +1 -0
  36. package/dist/domain/patient/__tests__/ssn.test.js +54 -0
  37. package/dist/domain/patient/__tests__/ssn.test.js.map +1 -0
  38. package/dist/domain/patient/patient-import.js +1 -1
  39. package/dist/domain/patient/patient-import.js.map +1 -1
  40. package/dist/domain/patient/ssn.d.ts +3 -0
  41. package/dist/domain/patient/ssn.d.ts.map +1 -0
  42. package/dist/domain/patient/ssn.js +29 -0
  43. package/dist/domain/patient/ssn.js.map +1 -0
  44. package/dist/index.d.ts +4 -2
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +4 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/interface/external/athenahealth/appointment.d.ts +16 -3
  49. package/dist/interface/external/athenahealth/appointment.d.ts.map +1 -1
  50. package/dist/interface/external/athenahealth/appointment.js +5 -5
  51. package/dist/interface/external/athenahealth/appointment.js.map +1 -1
  52. package/dist/interface/external/athenahealth/department.d.ts +2 -1
  53. package/dist/interface/external/athenahealth/department.d.ts.map +1 -1
  54. package/dist/interface/external/athenahealth/department.js +2 -2
  55. package/dist/interface/external/athenahealth/department.js.map +1 -1
  56. package/dist/interface/external/athenahealth/index.d.ts +0 -1
  57. package/dist/interface/external/athenahealth/index.d.ts.map +1 -1
  58. package/dist/interface/external/athenahealth/index.js +0 -1
  59. package/dist/interface/external/athenahealth/index.js.map +1 -1
  60. package/dist/interface/external/athenahealth/jwt-token.d.ts +11 -6
  61. package/dist/interface/external/athenahealth/jwt-token.d.ts.map +1 -1
  62. package/dist/interface/external/athenahealth/jwt-token.js +7 -2
  63. package/dist/interface/external/athenahealth/jwt-token.js.map +1 -1
  64. package/dist/interface/external/athenahealth/medication.d.ts +15 -3
  65. package/dist/interface/external/athenahealth/medication.d.ts.map +1 -1
  66. package/dist/interface/external/athenahealth/medication.js +8 -4
  67. package/dist/interface/external/athenahealth/medication.js.map +1 -1
  68. package/dist/interface/external/athenahealth/patient.d.ts +376 -540
  69. package/dist/interface/external/athenahealth/patient.d.ts.map +1 -1
  70. package/dist/interface/external/athenahealth/patient.js +10 -34
  71. package/dist/interface/external/athenahealth/patient.js.map +1 -1
  72. package/dist/interface/external/athenahealth/problem.d.ts +13 -2
  73. package/dist/interface/external/athenahealth/problem.d.ts.map +1 -1
  74. package/dist/interface/external/athenahealth/problem.js +6 -2
  75. package/dist/interface/external/athenahealth/problem.js.map +1 -1
  76. package/dist/interface/external/athenahealth/subscription.d.ts +10 -1
  77. package/dist/interface/external/athenahealth/subscription.d.ts.map +1 -1
  78. package/dist/interface/external/athenahealth/subscription.js +5 -2
  79. package/dist/interface/external/athenahealth/subscription.js.map +1 -1
  80. package/dist/interface/external/athenahealth/vitals.d.ts +62 -6
  81. package/dist/interface/external/athenahealth/vitals.d.ts.map +1 -1
  82. package/dist/interface/external/athenahealth/vitals.js +8 -3
  83. package/dist/interface/external/athenahealth/vitals.js.map +1 -1
  84. package/dist/interface/external/canvas/appointment.d.ts +68 -0
  85. package/dist/interface/external/canvas/appointment.d.ts.map +1 -0
  86. package/dist/interface/external/canvas/appointment.js +15 -0
  87. package/dist/interface/external/canvas/appointment.js.map +1 -0
  88. package/dist/interface/external/canvas/index.d.ts +3 -0
  89. package/dist/interface/external/canvas/index.d.ts.map +1 -0
  90. package/dist/interface/external/canvas/index.js +19 -0
  91. package/dist/interface/external/canvas/index.js.map +1 -0
  92. package/dist/interface/external/canvas/jwt-token.d.ts +31 -0
  93. package/dist/interface/external/canvas/jwt-token.d.ts.map +1 -0
  94. package/dist/interface/external/canvas/jwt-token.js +17 -0
  95. package/dist/interface/external/canvas/jwt-token.js.map +1 -0
  96. package/dist/interface/external/elation/appointment.d.ts +11 -3
  97. package/dist/interface/external/elation/appointment.d.ts.map +1 -1
  98. package/dist/interface/external/elation/appointment.js +8 -9
  99. package/dist/interface/external/elation/appointment.js.map +1 -1
  100. package/dist/interface/external/elation/index.d.ts +1 -1
  101. package/dist/interface/external/elation/index.d.ts.map +1 -1
  102. package/dist/interface/external/elation/index.js +1 -1
  103. package/dist/interface/external/elation/index.js.map +1 -1
  104. package/dist/interface/external/elation/jwt-token.d.ts +20 -0
  105. package/dist/interface/external/elation/jwt-token.d.ts.map +1 -0
  106. package/dist/interface/external/elation/jwt-token.js +13 -0
  107. package/dist/interface/external/elation/jwt-token.js.map +1 -0
  108. package/dist/interface/external/elation/patient.d.ts +47 -47
  109. package/dist/interface/external/elation/patient.d.ts.map +1 -1
  110. package/dist/interface/external/elation/patient.js +12 -12
  111. package/dist/interface/external/elation/patient.js.map +1 -1
  112. package/dist/interface/external/elation/subscription.d.ts +1 -1
  113. package/dist/interface/external/shared/ehr/patient.d.ts +250 -0
  114. package/dist/interface/external/shared/ehr/patient.d.ts.map +1 -0
  115. package/dist/interface/external/shared/ehr/patient.js +35 -0
  116. package/dist/interface/external/shared/ehr/patient.js.map +1 -0
  117. package/dist/medical/webhook/webhook-request.d.ts +543 -0
  118. package/dist/medical/webhook/webhook-request.d.ts.map +1 -1
  119. package/dist/medical/webhook/webhook-request.js +36 -23
  120. package/dist/medical/webhook/webhook-request.js.map +1 -1
  121. package/package.json +10 -2
@@ -97,6 +97,7 @@ export declare const filtersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodSt
97
97
  export declare const consolidatedWebhookPatientSchema: z.ZodObject<{
98
98
  patientId: z.ZodString;
99
99
  externalId: z.ZodOptional<z.ZodString>;
100
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
100
101
  status: z.ZodEnum<["completed", "failed"]>;
101
102
  bundle: z.ZodType<SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined, z.ZodTypeDef, SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined>;
102
103
  filters: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodOptional<z.ZodNullable<z.ZodBoolean>>]>>>>;
@@ -104,12 +105,14 @@ export declare const consolidatedWebhookPatientSchema: z.ZodObject<{
104
105
  status: "completed" | "failed";
105
106
  patientId: string;
106
107
  externalId?: string | undefined;
108
+ additionalIds?: Record<string, string[]> | undefined;
107
109
  bundle?: SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined;
108
110
  filters?: Record<string, string | boolean | null | undefined> | null | undefined;
109
111
  }, {
110
112
  status: "completed" | "failed";
111
113
  patientId: string;
112
114
  externalId?: string | undefined;
115
+ additionalIds?: Record<string, string[]> | undefined;
113
116
  bundle?: SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined;
114
117
  filters?: Record<string, string | boolean | null | undefined> | null | undefined;
115
118
  }>;
@@ -138,6 +141,7 @@ export declare const consolidatedWebhookRequestSchema: z.ZodObject<{
138
141
  patients: z.ZodArray<z.ZodObject<{
139
142
  patientId: z.ZodString;
140
143
  externalId: z.ZodOptional<z.ZodString>;
144
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
141
145
  status: z.ZodEnum<["completed", "failed"]>;
142
146
  bundle: z.ZodType<SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined, z.ZodTypeDef, SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined>;
143
147
  filters: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodOptional<z.ZodNullable<z.ZodBoolean>>]>>>>;
@@ -145,12 +149,14 @@ export declare const consolidatedWebhookRequestSchema: z.ZodObject<{
145
149
  status: "completed" | "failed";
146
150
  patientId: string;
147
151
  externalId?: string | undefined;
152
+ additionalIds?: Record<string, string[]> | undefined;
148
153
  bundle?: SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined;
149
154
  filters?: Record<string, string | boolean | null | undefined> | null | undefined;
150
155
  }, {
151
156
  status: "completed" | "failed";
152
157
  patientId: string;
153
158
  externalId?: string | undefined;
159
+ additionalIds?: Record<string, string[]> | undefined;
154
160
  bundle?: SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined;
155
161
  filters?: Record<string, string | boolean | null | undefined> | null | undefined;
156
162
  }>, "many">;
@@ -159,6 +165,7 @@ export declare const consolidatedWebhookRequestSchema: z.ZodObject<{
159
165
  status: "completed" | "failed";
160
166
  patientId: string;
161
167
  externalId?: string | undefined;
168
+ additionalIds?: Record<string, string[]> | undefined;
162
169
  bundle?: SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined;
163
170
  filters?: Record<string, string | boolean | null | undefined> | null | undefined;
164
171
  }[];
@@ -173,6 +180,7 @@ export declare const consolidatedWebhookRequestSchema: z.ZodObject<{
173
180
  status: "completed" | "failed";
174
181
  patientId: string;
175
182
  externalId?: string | undefined;
183
+ additionalIds?: Record<string, string[]> | undefined;
176
184
  bundle?: SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined;
177
185
  filters?: Record<string, string | boolean | null | undefined> | null | undefined;
178
186
  }[];
@@ -186,6 +194,8 @@ export declare const consolidatedWebhookRequestSchema: z.ZodObject<{
186
194
  export type ConsolidatedWebhookRequest = z.infer<typeof consolidatedWebhookRequestSchema>;
187
195
  export declare const documentDownloadWebhookPatientSchema: z.ZodObject<{
188
196
  patientId: z.ZodString;
197
+ externalId: z.ZodOptional<z.ZodString>;
198
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
189
199
  status: z.ZodEnum<["completed", "failed"]>;
190
200
  documents: z.ZodArray<z.ZodObject<{
191
201
  id: z.ZodString;
@@ -278,6 +288,8 @@ export declare const documentDownloadWebhookPatientSchema: z.ZodObject<{
278
288
  mimeType?: string | undefined;
279
289
  size?: number | undefined;
280
290
  }[];
291
+ externalId?: string | undefined;
292
+ additionalIds?: Record<string, string[]> | undefined;
281
293
  }, {
282
294
  status: "completed" | "failed";
283
295
  patientId: string;
@@ -298,6 +310,8 @@ export declare const documentDownloadWebhookPatientSchema: z.ZodObject<{
298
310
  mimeType?: string | undefined;
299
311
  size?: number | undefined;
300
312
  }[];
313
+ externalId?: string | undefined;
314
+ additionalIds?: Record<string, string[]> | undefined;
301
315
  }>;
302
316
  export type DocumentDownloadWebhookPatient = z.infer<typeof documentDownloadWebhookPatientSchema>;
303
317
  export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
@@ -323,6 +337,8 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
323
337
  }>;
324
338
  patients: z.ZodArray<z.ZodObject<{
325
339
  patientId: z.ZodString;
340
+ externalId: z.ZodOptional<z.ZodString>;
341
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
326
342
  status: z.ZodEnum<["completed", "failed"]>;
327
343
  documents: z.ZodArray<z.ZodObject<{
328
344
  id: z.ZodString;
@@ -415,6 +431,8 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
415
431
  mimeType?: string | undefined;
416
432
  size?: number | undefined;
417
433
  }[];
434
+ externalId?: string | undefined;
435
+ additionalIds?: Record<string, string[]> | undefined;
418
436
  }, {
419
437
  status: "completed" | "failed";
420
438
  patientId: string;
@@ -435,6 +453,8 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
435
453
  mimeType?: string | undefined;
436
454
  size?: number | undefined;
437
455
  }[];
456
+ externalId?: string | undefined;
457
+ additionalIds?: Record<string, string[]> | undefined;
438
458
  }>, "many">;
439
459
  }, "strip", z.ZodTypeAny, {
440
460
  patients: {
@@ -457,6 +477,8 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
457
477
  mimeType?: string | undefined;
458
478
  size?: number | undefined;
459
479
  }[];
480
+ externalId?: string | undefined;
481
+ additionalIds?: Record<string, string[]> | undefined;
460
482
  }[];
461
483
  meta: {
462
484
  type: "medical.document-download";
@@ -485,6 +507,8 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
485
507
  mimeType?: string | undefined;
486
508
  size?: number | undefined;
487
509
  }[];
510
+ externalId?: string | undefined;
511
+ additionalIds?: Record<string, string[]> | undefined;
488
512
  }[];
489
513
  meta: {
490
514
  type: "medical.document-download";
@@ -496,13 +520,19 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
496
520
  export type DocumentDownloadWebhookRequest = z.infer<typeof documentDownloadWebhookRequestSchema>;
497
521
  export declare const documentConversionWebhookPatientSchema: z.ZodObject<{
498
522
  patientId: z.ZodString;
523
+ externalId: z.ZodOptional<z.ZodString>;
524
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
499
525
  status: z.ZodEnum<["completed", "failed"]>;
500
526
  }, "strip", z.ZodTypeAny, {
501
527
  status: "completed" | "failed";
502
528
  patientId: string;
529
+ externalId?: string | undefined;
530
+ additionalIds?: Record<string, string[]> | undefined;
503
531
  }, {
504
532
  status: "completed" | "failed";
505
533
  patientId: string;
534
+ externalId?: string | undefined;
535
+ additionalIds?: Record<string, string[]> | undefined;
506
536
  }>;
507
537
  export type DocumentConversionWebhookPatient = z.infer<typeof documentConversionWebhookPatientSchema>;
508
538
  export declare const documentConversionWebhookRequestSchema: z.ZodObject<{
@@ -528,18 +558,26 @@ export declare const documentConversionWebhookRequestSchema: z.ZodObject<{
528
558
  }>;
529
559
  patients: z.ZodArray<z.ZodObject<{
530
560
  patientId: z.ZodString;
561
+ externalId: z.ZodOptional<z.ZodString>;
562
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
531
563
  status: z.ZodEnum<["completed", "failed"]>;
532
564
  }, "strip", z.ZodTypeAny, {
533
565
  status: "completed" | "failed";
534
566
  patientId: string;
567
+ externalId?: string | undefined;
568
+ additionalIds?: Record<string, string[]> | undefined;
535
569
  }, {
536
570
  status: "completed" | "failed";
537
571
  patientId: string;
572
+ externalId?: string | undefined;
573
+ additionalIds?: Record<string, string[]> | undefined;
538
574
  }>, "many">;
539
575
  }, "strip", z.ZodTypeAny, {
540
576
  patients: {
541
577
  status: "completed" | "failed";
542
578
  patientId: string;
579
+ externalId?: string | undefined;
580
+ additionalIds?: Record<string, string[]> | undefined;
543
581
  }[];
544
582
  meta: {
545
583
  type: "medical.document-conversion";
@@ -551,6 +589,8 @@ export declare const documentConversionWebhookRequestSchema: z.ZodObject<{
551
589
  patients: {
552
590
  status: "completed" | "failed";
553
591
  patientId: string;
592
+ externalId?: string | undefined;
593
+ additionalIds?: Record<string, string[]> | undefined;
554
594
  }[];
555
595
  meta: {
556
596
  type: "medical.document-conversion";
@@ -560,6 +600,134 @@ export declare const documentConversionWebhookRequestSchema: z.ZodObject<{
560
600
  };
561
601
  }>;
562
602
  export type DocumentConversionWebhookRequest = z.infer<typeof documentConversionWebhookRequestSchema>;
603
+ export declare const documentBulkDownloadWebhookPatientSchema: z.ZodObject<{
604
+ patientId: z.ZodString;
605
+ externalId: z.ZodOptional<z.ZodString>;
606
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
607
+ status: z.ZodEnum<["completed", "failed"]>;
608
+ documents: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
609
+ id: z.ZodString;
610
+ fileName: z.ZodString;
611
+ description: z.ZodOptional<z.ZodString>;
612
+ status: z.ZodOptional<z.ZodString>;
613
+ indexed: z.ZodOptional<z.ZodString>;
614
+ mimeType: z.ZodOptional<z.ZodString>;
615
+ size: z.ZodOptional<z.ZodNumber>;
616
+ type: z.ZodOptional<z.ZodObject<{
617
+ coding: z.ZodOptional<z.ZodArray<z.ZodObject<{
618
+ system: z.ZodNullable<z.ZodOptional<z.ZodString>>;
619
+ code: z.ZodNullable<z.ZodOptional<z.ZodString>>;
620
+ display: z.ZodNullable<z.ZodOptional<z.ZodString>>;
621
+ }, "strip", z.ZodTypeAny, {
622
+ code?: string | null | undefined;
623
+ system?: string | null | undefined;
624
+ display?: string | null | undefined;
625
+ }, {
626
+ code?: string | null | undefined;
627
+ system?: string | null | undefined;
628
+ display?: string | null | undefined;
629
+ }>, "many">>;
630
+ text: z.ZodOptional<z.ZodString>;
631
+ }, "strip", z.ZodTypeAny, {
632
+ coding?: {
633
+ code?: string | null | undefined;
634
+ system?: string | null | undefined;
635
+ display?: string | null | undefined;
636
+ }[] | undefined;
637
+ text?: string | undefined;
638
+ }, {
639
+ coding?: {
640
+ code?: string | null | undefined;
641
+ system?: string | null | undefined;
642
+ display?: string | null | undefined;
643
+ }[] | undefined;
644
+ text?: string | undefined;
645
+ }>>;
646
+ }, {
647
+ url: z.ZodString;
648
+ }>, "strip", z.ZodTypeAny, {
649
+ url: string;
650
+ id: string;
651
+ fileName: string;
652
+ type?: {
653
+ coding?: {
654
+ code?: string | null | undefined;
655
+ system?: string | null | undefined;
656
+ display?: string | null | undefined;
657
+ }[] | undefined;
658
+ text?: string | undefined;
659
+ } | undefined;
660
+ status?: string | undefined;
661
+ description?: string | undefined;
662
+ indexed?: string | undefined;
663
+ mimeType?: string | undefined;
664
+ size?: number | undefined;
665
+ }, {
666
+ url: string;
667
+ id: string;
668
+ fileName: string;
669
+ type?: {
670
+ coding?: {
671
+ code?: string | null | undefined;
672
+ system?: string | null | undefined;
673
+ display?: string | null | undefined;
674
+ }[] | undefined;
675
+ text?: string | undefined;
676
+ } | undefined;
677
+ status?: string | undefined;
678
+ description?: string | undefined;
679
+ indexed?: string | undefined;
680
+ mimeType?: string | undefined;
681
+ size?: number | undefined;
682
+ }>, "many">;
683
+ }, "strip", z.ZodTypeAny, {
684
+ status: "completed" | "failed";
685
+ patientId: string;
686
+ documents: {
687
+ url: string;
688
+ id: string;
689
+ fileName: string;
690
+ type?: {
691
+ coding?: {
692
+ code?: string | null | undefined;
693
+ system?: string | null | undefined;
694
+ display?: string | null | undefined;
695
+ }[] | undefined;
696
+ text?: string | undefined;
697
+ } | undefined;
698
+ status?: string | undefined;
699
+ description?: string | undefined;
700
+ indexed?: string | undefined;
701
+ mimeType?: string | undefined;
702
+ size?: number | undefined;
703
+ }[];
704
+ externalId?: string | undefined;
705
+ additionalIds?: Record<string, string[]> | undefined;
706
+ }, {
707
+ status: "completed" | "failed";
708
+ patientId: string;
709
+ documents: {
710
+ url: string;
711
+ id: string;
712
+ fileName: string;
713
+ type?: {
714
+ coding?: {
715
+ code?: string | null | undefined;
716
+ system?: string | null | undefined;
717
+ display?: string | null | undefined;
718
+ }[] | undefined;
719
+ text?: string | undefined;
720
+ } | undefined;
721
+ status?: string | undefined;
722
+ description?: string | undefined;
723
+ indexed?: string | undefined;
724
+ mimeType?: string | undefined;
725
+ size?: number | undefined;
726
+ }[];
727
+ externalId?: string | undefined;
728
+ additionalIds?: Record<string, string[]> | undefined;
729
+ }>;
730
+ export type DocumentBulkDownloadWebhookPatient = z.infer<typeof documentBulkDownloadWebhookPatientSchema>;
563
731
  export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
564
732
  meta: z.ZodObject<z.objectUtil.extendShape<{
565
733
  messageId: z.ZodString;
@@ -581,7 +749,158 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
581
749
  when: string;
582
750
  data?: unknown;
583
751
  }>;
752
+ patients: z.ZodArray<z.ZodObject<{
753
+ patientId: z.ZodString;
754
+ externalId: z.ZodOptional<z.ZodString>;
755
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
756
+ status: z.ZodEnum<["completed", "failed"]>;
757
+ documents: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
758
+ id: z.ZodString;
759
+ fileName: z.ZodString;
760
+ description: z.ZodOptional<z.ZodString>;
761
+ status: z.ZodOptional<z.ZodString>;
762
+ indexed: z.ZodOptional<z.ZodString>;
763
+ mimeType: z.ZodOptional<z.ZodString>;
764
+ size: z.ZodOptional<z.ZodNumber>;
765
+ type: z.ZodOptional<z.ZodObject<{
766
+ coding: z.ZodOptional<z.ZodArray<z.ZodObject<{
767
+ system: z.ZodNullable<z.ZodOptional<z.ZodString>>;
768
+ code: z.ZodNullable<z.ZodOptional<z.ZodString>>;
769
+ display: z.ZodNullable<z.ZodOptional<z.ZodString>>;
770
+ }, "strip", z.ZodTypeAny, {
771
+ code?: string | null | undefined;
772
+ system?: string | null | undefined;
773
+ display?: string | null | undefined;
774
+ }, {
775
+ code?: string | null | undefined;
776
+ system?: string | null | undefined;
777
+ display?: string | null | undefined;
778
+ }>, "many">>;
779
+ text: z.ZodOptional<z.ZodString>;
780
+ }, "strip", z.ZodTypeAny, {
781
+ coding?: {
782
+ code?: string | null | undefined;
783
+ system?: string | null | undefined;
784
+ display?: string | null | undefined;
785
+ }[] | undefined;
786
+ text?: string | undefined;
787
+ }, {
788
+ coding?: {
789
+ code?: string | null | undefined;
790
+ system?: string | null | undefined;
791
+ display?: string | null | undefined;
792
+ }[] | undefined;
793
+ text?: string | undefined;
794
+ }>>;
795
+ }, {
796
+ url: z.ZodString;
797
+ }>, "strip", z.ZodTypeAny, {
798
+ url: string;
799
+ id: string;
800
+ fileName: string;
801
+ type?: {
802
+ coding?: {
803
+ code?: string | null | undefined;
804
+ system?: string | null | undefined;
805
+ display?: string | null | undefined;
806
+ }[] | undefined;
807
+ text?: string | undefined;
808
+ } | undefined;
809
+ status?: string | undefined;
810
+ description?: string | undefined;
811
+ indexed?: string | undefined;
812
+ mimeType?: string | undefined;
813
+ size?: number | undefined;
814
+ }, {
815
+ url: string;
816
+ id: string;
817
+ fileName: string;
818
+ type?: {
819
+ coding?: {
820
+ code?: string | null | undefined;
821
+ system?: string | null | undefined;
822
+ display?: string | null | undefined;
823
+ }[] | undefined;
824
+ text?: string | undefined;
825
+ } | undefined;
826
+ status?: string | undefined;
827
+ description?: string | undefined;
828
+ indexed?: string | undefined;
829
+ mimeType?: string | undefined;
830
+ size?: number | undefined;
831
+ }>, "many">;
832
+ }, "strip", z.ZodTypeAny, {
833
+ status: "completed" | "failed";
834
+ patientId: string;
835
+ documents: {
836
+ url: string;
837
+ id: string;
838
+ fileName: string;
839
+ type?: {
840
+ coding?: {
841
+ code?: string | null | undefined;
842
+ system?: string | null | undefined;
843
+ display?: string | null | undefined;
844
+ }[] | undefined;
845
+ text?: string | undefined;
846
+ } | undefined;
847
+ status?: string | undefined;
848
+ description?: string | undefined;
849
+ indexed?: string | undefined;
850
+ mimeType?: string | undefined;
851
+ size?: number | undefined;
852
+ }[];
853
+ externalId?: string | undefined;
854
+ additionalIds?: Record<string, string[]> | undefined;
855
+ }, {
856
+ status: "completed" | "failed";
857
+ patientId: string;
858
+ documents: {
859
+ url: string;
860
+ id: string;
861
+ fileName: string;
862
+ type?: {
863
+ coding?: {
864
+ code?: string | null | undefined;
865
+ system?: string | null | undefined;
866
+ display?: string | null | undefined;
867
+ }[] | undefined;
868
+ text?: string | undefined;
869
+ } | undefined;
870
+ status?: string | undefined;
871
+ description?: string | undefined;
872
+ indexed?: string | undefined;
873
+ mimeType?: string | undefined;
874
+ size?: number | undefined;
875
+ }[];
876
+ externalId?: string | undefined;
877
+ additionalIds?: Record<string, string[]> | undefined;
878
+ }>, "many">;
584
879
  }, "strip", z.ZodTypeAny, {
880
+ patients: {
881
+ status: "completed" | "failed";
882
+ patientId: string;
883
+ documents: {
884
+ url: string;
885
+ id: string;
886
+ fileName: string;
887
+ type?: {
888
+ coding?: {
889
+ code?: string | null | undefined;
890
+ system?: string | null | undefined;
891
+ display?: string | null | undefined;
892
+ }[] | undefined;
893
+ text?: string | undefined;
894
+ } | undefined;
895
+ status?: string | undefined;
896
+ description?: string | undefined;
897
+ indexed?: string | undefined;
898
+ mimeType?: string | undefined;
899
+ size?: number | undefined;
900
+ }[];
901
+ externalId?: string | undefined;
902
+ additionalIds?: Record<string, string[]> | undefined;
903
+ }[];
585
904
  meta: {
586
905
  type: "medical.document-bulk-download-urls";
587
906
  messageId: string;
@@ -589,6 +908,30 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
589
908
  data?: unknown;
590
909
  };
591
910
  }, {
911
+ patients: {
912
+ status: "completed" | "failed";
913
+ patientId: string;
914
+ documents: {
915
+ url: string;
916
+ id: string;
917
+ fileName: string;
918
+ type?: {
919
+ coding?: {
920
+ code?: string | null | undefined;
921
+ system?: string | null | undefined;
922
+ display?: string | null | undefined;
923
+ }[] | undefined;
924
+ text?: string | undefined;
925
+ } | undefined;
926
+ status?: string | undefined;
927
+ description?: string | undefined;
928
+ indexed?: string | undefined;
929
+ mimeType?: string | undefined;
930
+ size?: number | undefined;
931
+ }[];
932
+ externalId?: string | undefined;
933
+ additionalIds?: Record<string, string[]> | undefined;
934
+ }[];
592
935
  meta: {
593
936
  type: "medical.document-bulk-download-urls";
594
937
  messageId: string;
@@ -659,6 +1002,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
659
1002
  patients: z.ZodArray<z.ZodObject<{
660
1003
  patientId: z.ZodString;
661
1004
  externalId: z.ZodOptional<z.ZodString>;
1005
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
662
1006
  status: z.ZodEnum<["completed", "failed"]>;
663
1007
  bundle: z.ZodType<SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined, z.ZodTypeDef, SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined>;
664
1008
  filters: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodOptional<z.ZodNullable<z.ZodBoolean>>]>>>>;
@@ -666,12 +1010,14 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
666
1010
  status: "completed" | "failed";
667
1011
  patientId: string;
668
1012
  externalId?: string | undefined;
1013
+ additionalIds?: Record<string, string[]> | undefined;
669
1014
  bundle?: SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined;
670
1015
  filters?: Record<string, string | boolean | null | undefined> | null | undefined;
671
1016
  }, {
672
1017
  status: "completed" | "failed";
673
1018
  patientId: string;
674
1019
  externalId?: string | undefined;
1020
+ additionalIds?: Record<string, string[]> | undefined;
675
1021
  bundle?: SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined;
676
1022
  filters?: Record<string, string | boolean | null | undefined> | null | undefined;
677
1023
  }>, "many">;
@@ -680,6 +1026,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
680
1026
  status: "completed" | "failed";
681
1027
  patientId: string;
682
1028
  externalId?: string | undefined;
1029
+ additionalIds?: Record<string, string[]> | undefined;
683
1030
  bundle?: SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined;
684
1031
  filters?: Record<string, string | boolean | null | undefined> | null | undefined;
685
1032
  }[];
@@ -694,6 +1041,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
694
1041
  status: "completed" | "failed";
695
1042
  patientId: string;
696
1043
  externalId?: string | undefined;
1044
+ additionalIds?: Record<string, string[]> | undefined;
697
1045
  bundle?: SearchSetBundle<import("@medplum/fhirtypes").Resource> | undefined;
698
1046
  filters?: Record<string, string | boolean | null | undefined> | null | undefined;
699
1047
  }[];
@@ -726,6 +1074,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
726
1074
  }>;
727
1075
  patients: z.ZodArray<z.ZodObject<{
728
1076
  patientId: z.ZodString;
1077
+ externalId: z.ZodOptional<z.ZodString>;
1078
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
729
1079
  status: z.ZodEnum<["completed", "failed"]>;
730
1080
  documents: z.ZodArray<z.ZodObject<{
731
1081
  id: z.ZodString;
@@ -818,6 +1168,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
818
1168
  mimeType?: string | undefined;
819
1169
  size?: number | undefined;
820
1170
  }[];
1171
+ externalId?: string | undefined;
1172
+ additionalIds?: Record<string, string[]> | undefined;
821
1173
  }, {
822
1174
  status: "completed" | "failed";
823
1175
  patientId: string;
@@ -838,6 +1190,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
838
1190
  mimeType?: string | undefined;
839
1191
  size?: number | undefined;
840
1192
  }[];
1193
+ externalId?: string | undefined;
1194
+ additionalIds?: Record<string, string[]> | undefined;
841
1195
  }>, "many">;
842
1196
  }, "strip", z.ZodTypeAny, {
843
1197
  patients: {
@@ -860,6 +1214,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
860
1214
  mimeType?: string | undefined;
861
1215
  size?: number | undefined;
862
1216
  }[];
1217
+ externalId?: string | undefined;
1218
+ additionalIds?: Record<string, string[]> | undefined;
863
1219
  }[];
864
1220
  meta: {
865
1221
  type: "medical.document-download";
@@ -888,6 +1244,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
888
1244
  mimeType?: string | undefined;
889
1245
  size?: number | undefined;
890
1246
  }[];
1247
+ externalId?: string | undefined;
1248
+ additionalIds?: Record<string, string[]> | undefined;
891
1249
  }[];
892
1250
  meta: {
893
1251
  type: "medical.document-download";
@@ -918,18 +1276,26 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
918
1276
  }>;
919
1277
  patients: z.ZodArray<z.ZodObject<{
920
1278
  patientId: z.ZodString;
1279
+ externalId: z.ZodOptional<z.ZodString>;
1280
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
921
1281
  status: z.ZodEnum<["completed", "failed"]>;
922
1282
  }, "strip", z.ZodTypeAny, {
923
1283
  status: "completed" | "failed";
924
1284
  patientId: string;
1285
+ externalId?: string | undefined;
1286
+ additionalIds?: Record<string, string[]> | undefined;
925
1287
  }, {
926
1288
  status: "completed" | "failed";
927
1289
  patientId: string;
1290
+ externalId?: string | undefined;
1291
+ additionalIds?: Record<string, string[]> | undefined;
928
1292
  }>, "many">;
929
1293
  }, "strip", z.ZodTypeAny, {
930
1294
  patients: {
931
1295
  status: "completed" | "failed";
932
1296
  patientId: string;
1297
+ externalId?: string | undefined;
1298
+ additionalIds?: Record<string, string[]> | undefined;
933
1299
  }[];
934
1300
  meta: {
935
1301
  type: "medical.document-conversion";
@@ -941,6 +1307,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
941
1307
  patients: {
942
1308
  status: "completed" | "failed";
943
1309
  patientId: string;
1310
+ externalId?: string | undefined;
1311
+ additionalIds?: Record<string, string[]> | undefined;
944
1312
  }[];
945
1313
  meta: {
946
1314
  type: "medical.document-conversion";
@@ -969,7 +1337,158 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
969
1337
  when: string;
970
1338
  data?: unknown;
971
1339
  }>;
1340
+ patients: z.ZodArray<z.ZodObject<{
1341
+ patientId: z.ZodString;
1342
+ externalId: z.ZodOptional<z.ZodString>;
1343
+ additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
1344
+ status: z.ZodEnum<["completed", "failed"]>;
1345
+ documents: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
1346
+ id: z.ZodString;
1347
+ fileName: z.ZodString;
1348
+ description: z.ZodOptional<z.ZodString>;
1349
+ status: z.ZodOptional<z.ZodString>;
1350
+ indexed: z.ZodOptional<z.ZodString>;
1351
+ mimeType: z.ZodOptional<z.ZodString>;
1352
+ size: z.ZodOptional<z.ZodNumber>;
1353
+ type: z.ZodOptional<z.ZodObject<{
1354
+ coding: z.ZodOptional<z.ZodArray<z.ZodObject<{
1355
+ system: z.ZodNullable<z.ZodOptional<z.ZodString>>;
1356
+ code: z.ZodNullable<z.ZodOptional<z.ZodString>>;
1357
+ display: z.ZodNullable<z.ZodOptional<z.ZodString>>;
1358
+ }, "strip", z.ZodTypeAny, {
1359
+ code?: string | null | undefined;
1360
+ system?: string | null | undefined;
1361
+ display?: string | null | undefined;
1362
+ }, {
1363
+ code?: string | null | undefined;
1364
+ system?: string | null | undefined;
1365
+ display?: string | null | undefined;
1366
+ }>, "many">>;
1367
+ text: z.ZodOptional<z.ZodString>;
1368
+ }, "strip", z.ZodTypeAny, {
1369
+ coding?: {
1370
+ code?: string | null | undefined;
1371
+ system?: string | null | undefined;
1372
+ display?: string | null | undefined;
1373
+ }[] | undefined;
1374
+ text?: string | undefined;
1375
+ }, {
1376
+ coding?: {
1377
+ code?: string | null | undefined;
1378
+ system?: string | null | undefined;
1379
+ display?: string | null | undefined;
1380
+ }[] | undefined;
1381
+ text?: string | undefined;
1382
+ }>>;
1383
+ }, {
1384
+ url: z.ZodString;
1385
+ }>, "strip", z.ZodTypeAny, {
1386
+ url: string;
1387
+ id: string;
1388
+ fileName: string;
1389
+ type?: {
1390
+ coding?: {
1391
+ code?: string | null | undefined;
1392
+ system?: string | null | undefined;
1393
+ display?: string | null | undefined;
1394
+ }[] | undefined;
1395
+ text?: string | undefined;
1396
+ } | undefined;
1397
+ status?: string | undefined;
1398
+ description?: string | undefined;
1399
+ indexed?: string | undefined;
1400
+ mimeType?: string | undefined;
1401
+ size?: number | undefined;
1402
+ }, {
1403
+ url: string;
1404
+ id: string;
1405
+ fileName: string;
1406
+ type?: {
1407
+ coding?: {
1408
+ code?: string | null | undefined;
1409
+ system?: string | null | undefined;
1410
+ display?: string | null | undefined;
1411
+ }[] | undefined;
1412
+ text?: string | undefined;
1413
+ } | undefined;
1414
+ status?: string | undefined;
1415
+ description?: string | undefined;
1416
+ indexed?: string | undefined;
1417
+ mimeType?: string | undefined;
1418
+ size?: number | undefined;
1419
+ }>, "many">;
1420
+ }, "strip", z.ZodTypeAny, {
1421
+ status: "completed" | "failed";
1422
+ patientId: string;
1423
+ documents: {
1424
+ url: string;
1425
+ id: string;
1426
+ fileName: string;
1427
+ type?: {
1428
+ coding?: {
1429
+ code?: string | null | undefined;
1430
+ system?: string | null | undefined;
1431
+ display?: string | null | undefined;
1432
+ }[] | undefined;
1433
+ text?: string | undefined;
1434
+ } | undefined;
1435
+ status?: string | undefined;
1436
+ description?: string | undefined;
1437
+ indexed?: string | undefined;
1438
+ mimeType?: string | undefined;
1439
+ size?: number | undefined;
1440
+ }[];
1441
+ externalId?: string | undefined;
1442
+ additionalIds?: Record<string, string[]> | undefined;
1443
+ }, {
1444
+ status: "completed" | "failed";
1445
+ patientId: string;
1446
+ documents: {
1447
+ url: string;
1448
+ id: string;
1449
+ fileName: string;
1450
+ type?: {
1451
+ coding?: {
1452
+ code?: string | null | undefined;
1453
+ system?: string | null | undefined;
1454
+ display?: string | null | undefined;
1455
+ }[] | undefined;
1456
+ text?: string | undefined;
1457
+ } | undefined;
1458
+ status?: string | undefined;
1459
+ description?: string | undefined;
1460
+ indexed?: string | undefined;
1461
+ mimeType?: string | undefined;
1462
+ size?: number | undefined;
1463
+ }[];
1464
+ externalId?: string | undefined;
1465
+ additionalIds?: Record<string, string[]> | undefined;
1466
+ }>, "many">;
972
1467
  }, "strip", z.ZodTypeAny, {
1468
+ patients: {
1469
+ status: "completed" | "failed";
1470
+ patientId: string;
1471
+ documents: {
1472
+ url: string;
1473
+ id: string;
1474
+ fileName: string;
1475
+ type?: {
1476
+ coding?: {
1477
+ code?: string | null | undefined;
1478
+ system?: string | null | undefined;
1479
+ display?: string | null | undefined;
1480
+ }[] | undefined;
1481
+ text?: string | undefined;
1482
+ } | undefined;
1483
+ status?: string | undefined;
1484
+ description?: string | undefined;
1485
+ indexed?: string | undefined;
1486
+ mimeType?: string | undefined;
1487
+ size?: number | undefined;
1488
+ }[];
1489
+ externalId?: string | undefined;
1490
+ additionalIds?: Record<string, string[]> | undefined;
1491
+ }[];
973
1492
  meta: {
974
1493
  type: "medical.document-bulk-download-urls";
975
1494
  messageId: string;
@@ -977,6 +1496,30 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
977
1496
  data?: unknown;
978
1497
  };
979
1498
  }, {
1499
+ patients: {
1500
+ status: "completed" | "failed";
1501
+ patientId: string;
1502
+ documents: {
1503
+ url: string;
1504
+ id: string;
1505
+ fileName: string;
1506
+ type?: {
1507
+ coding?: {
1508
+ code?: string | null | undefined;
1509
+ system?: string | null | undefined;
1510
+ display?: string | null | undefined;
1511
+ }[] | undefined;
1512
+ text?: string | undefined;
1513
+ } | undefined;
1514
+ status?: string | undefined;
1515
+ description?: string | undefined;
1516
+ indexed?: string | undefined;
1517
+ mimeType?: string | undefined;
1518
+ size?: number | undefined;
1519
+ }[];
1520
+ externalId?: string | undefined;
1521
+ additionalIds?: Record<string, string[]> | undefined;
1522
+ }[];
980
1523
  meta: {
981
1524
  type: "medical.document-bulk-download-urls";
982
1525
  messageId: string;