@metriport/shared 0.26.5 → 0.26.6

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 (97) hide show
  1. package/dist/common/__tests__/date.test.js +43 -7
  2. package/dist/common/__tests__/date.test.js.map +1 -1
  3. package/dist/common/__tests__/title-case.test.js +5 -0
  4. package/dist/common/__tests__/title-case.test.js.map +1 -1
  5. package/dist/common/date.d.ts +2 -2
  6. package/dist/common/date.d.ts.map +1 -1
  7. package/dist/common/date.js +5 -3
  8. package/dist/common/date.js.map +1 -1
  9. package/dist/common/error.d.ts +1 -15
  10. package/dist/common/error.d.ts.map +1 -1
  11. package/dist/common/error.js +4 -33
  12. package/dist/common/error.js.map +1 -1
  13. package/dist/common/title-case.d.ts +1 -0
  14. package/dist/common/title-case.d.ts.map +1 -1
  15. package/dist/common/title-case.js +12 -2
  16. package/dist/common/title-case.js.map +1 -1
  17. package/dist/domain/address/__tests__/zip.test.js +82 -3
  18. package/dist/domain/address/__tests__/zip.test.js.map +1 -1
  19. package/dist/domain/address/state.d.ts +1 -0
  20. package/dist/domain/address/state.d.ts.map +1 -1
  21. package/dist/domain/address/state.js +54 -1
  22. package/dist/domain/address/state.js.map +1 -1
  23. package/dist/domain/address/zip.d.ts +4 -0
  24. package/dist/domain/address/zip.d.ts.map +1 -1
  25. package/dist/domain/address/zip.js +31 -5
  26. package/dist/domain/address/zip.js.map +1 -1
  27. package/dist/domain/contact/__tests__/email.test.js +58 -2
  28. package/dist/domain/contact/__tests__/email.test.js.map +1 -1
  29. package/dist/domain/contact/email.d.ts +6 -0
  30. package/dist/domain/contact/email.d.ts.map +1 -1
  31. package/dist/domain/contact/email.js +30 -6
  32. package/dist/domain/contact/email.js.map +1 -1
  33. package/dist/domain/dob.d.ts.map +1 -1
  34. package/dist/domain/dob.js +0 -2
  35. package/dist/domain/dob.js.map +1 -1
  36. package/dist/domain/patient/patient-import/create.js +1 -1
  37. package/dist/domain/patient/patient-import/create.js.map +1 -1
  38. package/dist/domain/patient/patient-import/schemas.d.ts +13 -3
  39. package/dist/domain/patient/patient-import/schemas.d.ts.map +1 -1
  40. package/dist/domain/patient/patient-import/schemas.js +9 -1
  41. package/dist/domain/patient/patient-import/schemas.js.map +1 -1
  42. package/dist/domain/patient/patient-import/status.d.ts +2 -0
  43. package/dist/domain/patient/patient-import/status.d.ts.map +1 -1
  44. package/dist/domain/patient/patient-import/status.js +3 -2
  45. package/dist/domain/patient/patient-import/status.js.map +1 -1
  46. package/dist/domain/patient.d.ts +3 -3
  47. package/dist/domain/patient.js +1 -1
  48. package/dist/domain/patient.js.map +1 -1
  49. package/dist/domain/suspect.d.ts +5 -0
  50. package/dist/domain/suspect.d.ts.map +1 -0
  51. package/dist/domain/suspect.js +3 -0
  52. package/dist/domain/suspect.js.map +1 -0
  53. package/dist/error/__tests__/shared.test.d.ts +2 -0
  54. package/dist/error/__tests__/shared.test.d.ts.map +1 -0
  55. package/dist/error/__tests__/shared.test.js +81 -0
  56. package/dist/error/__tests__/shared.test.js.map +1 -0
  57. package/dist/error/shared.d.ts +2 -1
  58. package/dist/error/shared.d.ts.map +1 -1
  59. package/dist/error/shared.js +5 -4
  60. package/dist/error/shared.js.map +1 -1
  61. package/dist/index.d.ts +2 -1
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +3 -3
  64. package/dist/index.js.map +1 -1
  65. package/dist/interface/external/ehr/athenahealth/cx-mapping.d.ts +38 -0
  66. package/dist/interface/external/ehr/athenahealth/cx-mapping.d.ts.map +1 -1
  67. package/dist/interface/external/ehr/canvas/cx-mapping.d.ts +38 -0
  68. package/dist/interface/external/ehr/canvas/cx-mapping.d.ts.map +1 -1
  69. package/dist/interface/external/ehr/elation/cx-mapping.d.ts +38 -0
  70. package/dist/interface/external/ehr/elation/cx-mapping.d.ts.map +1 -1
  71. package/dist/interface/external/ehr/healthie/cx-mapping.d.ts +38 -0
  72. package/dist/interface/external/ehr/healthie/cx-mapping.d.ts.map +1 -1
  73. package/dist/interface/external/ehr/salesforce/index.d.ts +2 -0
  74. package/dist/interface/external/ehr/salesforce/index.d.ts.map +1 -0
  75. package/dist/interface/external/ehr/salesforce/index.js +18 -0
  76. package/dist/interface/external/ehr/salesforce/index.js.map +1 -0
  77. package/dist/interface/external/ehr/salesforce/jwt-token.d.ts +21 -0
  78. package/dist/interface/external/ehr/salesforce/jwt-token.d.ts.map +1 -0
  79. package/dist/interface/external/ehr/salesforce/jwt-token.js +16 -0
  80. package/dist/interface/external/ehr/salesforce/jwt-token.js.map +1 -0
  81. package/dist/interface/external/ehr/salesforce/patient.d.ts +182 -0
  82. package/dist/interface/external/ehr/salesforce/patient.d.ts.map +1 -0
  83. package/dist/interface/external/ehr/salesforce/patient.js +31 -0
  84. package/dist/interface/external/ehr/salesforce/patient.js.map +1 -0
  85. package/dist/interface/external/ehr/shared.d.ts +64 -0
  86. package/dist/interface/external/ehr/shared.d.ts.map +1 -1
  87. package/dist/interface/external/ehr/shared.js +10 -0
  88. package/dist/interface/external/ehr/shared.js.map +1 -1
  89. package/dist/interface/external/ehr/source.d.ts +2 -1
  90. package/dist/interface/external/ehr/source.d.ts.map +1 -1
  91. package/dist/interface/external/ehr/source.js +1 -0
  92. package/dist/interface/external/ehr/source.js.map +1 -1
  93. package/dist/medical/webhook/webhook-request.d.ts +106 -10
  94. package/dist/medical/webhook/webhook-request.d.ts.map +1 -1
  95. package/dist/medical/webhook/webhook-request.js +1 -0
  96. package/dist/medical/webhook/webhook-request.js.map +1 -1
  97. package/package.json +4 -3
@@ -22,6 +22,7 @@ export declare const webhookRequestStatus: readonly ["processing", "success", "f
22
22
  export type WebhookRequestStatus = (typeof webhookRequestStatus)[number];
23
23
  export declare const baseWebhookMetadataSchema: z.ZodObject<{
24
24
  messageId: z.ZodString;
25
+ requestId: z.ZodOptional<z.ZodString>;
25
26
  when: z.ZodEffects<z.ZodString, string, string>;
26
27
  /**
27
28
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -30,14 +31,17 @@ export declare const baseWebhookMetadataSchema: z.ZodObject<{
30
31
  }, "strip", z.ZodTypeAny, {
31
32
  messageId: string;
32
33
  when: string;
34
+ requestId?: string | undefined;
33
35
  data?: unknown;
34
36
  }, {
35
37
  messageId: string;
36
38
  when: string;
39
+ requestId?: string | undefined;
37
40
  data?: unknown;
38
41
  }>;
39
42
  export declare const webhookMetadataSchema: z.ZodObject<z.objectUtil.extendShape<{
40
43
  messageId: z.ZodString;
44
+ requestId: z.ZodOptional<z.ZodString>;
41
45
  when: z.ZodEffects<z.ZodString, string, string>;
42
46
  /**
43
47
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -49,17 +53,20 @@ export declare const webhookMetadataSchema: z.ZodObject<z.objectUtil.extendShape
49
53
  type: string;
50
54
  messageId: string;
51
55
  when: string;
56
+ requestId?: string | undefined;
52
57
  data?: unknown;
53
58
  }, {
54
59
  type: string;
55
60
  messageId: string;
56
61
  when: string;
62
+ requestId?: string | undefined;
57
63
  data?: unknown;
58
64
  }>;
59
65
  export type WebhookMetadata = z.infer<typeof webhookMetadataSchema>;
60
66
  export declare const pingWebhookRequestDataSchema: z.ZodObject<{
61
67
  meta: z.ZodObject<z.objectUtil.extendShape<{
62
68
  messageId: z.ZodString;
69
+ requestId: z.ZodOptional<z.ZodString>;
63
70
  when: z.ZodEffects<z.ZodString, string, string>;
64
71
  /**
65
72
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -71,11 +78,13 @@ export declare const pingWebhookRequestDataSchema: z.ZodObject<{
71
78
  type: "ping";
72
79
  messageId: string;
73
80
  when: string;
81
+ requestId?: string | undefined;
74
82
  data?: unknown;
75
83
  }, {
76
84
  type: "ping";
77
85
  messageId: string;
78
86
  when: string;
87
+ requestId?: string | undefined;
79
88
  data?: unknown;
80
89
  }>;
81
90
  ping: z.ZodString;
@@ -84,6 +93,7 @@ export declare const pingWebhookRequestDataSchema: z.ZodObject<{
84
93
  type: "ping";
85
94
  messageId: string;
86
95
  when: string;
96
+ requestId?: string | undefined;
87
97
  data?: unknown;
88
98
  };
89
99
  ping: string;
@@ -92,6 +102,7 @@ export declare const pingWebhookRequestDataSchema: z.ZodObject<{
92
102
  type: "ping";
93
103
  messageId: string;
94
104
  when: string;
105
+ requestId?: string | undefined;
95
106
  data?: unknown;
96
107
  };
97
108
  ping: string;
@@ -124,6 +135,7 @@ export type ConsolidatedWebhookPatient = z.infer<typeof consolidatedWebhookPatie
124
135
  export declare const consolidatedWebhookRequestSchema: z.ZodObject<{
125
136
  meta: z.ZodObject<z.objectUtil.extendShape<{
126
137
  messageId: z.ZodString;
138
+ requestId: z.ZodOptional<z.ZodString>;
127
139
  when: z.ZodEffects<z.ZodString, string, string>;
128
140
  /**
129
141
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -135,11 +147,13 @@ export declare const consolidatedWebhookRequestSchema: z.ZodObject<{
135
147
  type: "medical.consolidated-data";
136
148
  messageId: string;
137
149
  when: string;
150
+ requestId?: string | undefined;
138
151
  data?: unknown;
139
152
  }, {
140
153
  type: "medical.consolidated-data";
141
154
  messageId: string;
142
155
  when: string;
156
+ requestId?: string | undefined;
143
157
  data?: unknown;
144
158
  }>;
145
159
  patients: z.ZodArray<z.ZodObject<{
@@ -169,6 +183,7 @@ export declare const consolidatedWebhookRequestSchema: z.ZodObject<{
169
183
  type: "medical.consolidated-data";
170
184
  messageId: string;
171
185
  when: string;
186
+ requestId?: string | undefined;
172
187
  data?: unknown;
173
188
  };
174
189
  patients: {
@@ -184,6 +199,7 @@ export declare const consolidatedWebhookRequestSchema: z.ZodObject<{
184
199
  type: "medical.consolidated-data";
185
200
  messageId: string;
186
201
  when: string;
202
+ requestId?: string | undefined;
187
203
  data?: unknown;
188
204
  };
189
205
  patients: {
@@ -321,6 +337,7 @@ export type DocumentDownloadWebhookPatient = z.infer<typeof documentDownloadWebh
321
337
  export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
322
338
  meta: z.ZodObject<z.objectUtil.extendShape<{
323
339
  messageId: z.ZodString;
340
+ requestId: z.ZodOptional<z.ZodString>;
324
341
  when: z.ZodEffects<z.ZodString, string, string>;
325
342
  /**
326
343
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -332,11 +349,13 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
332
349
  type: "medical.document-download";
333
350
  messageId: string;
334
351
  when: string;
352
+ requestId?: string | undefined;
335
353
  data?: unknown;
336
354
  }, {
337
355
  type: "medical.document-download";
338
356
  messageId: string;
339
357
  when: string;
358
+ requestId?: string | undefined;
340
359
  data?: unknown;
341
360
  }>;
342
361
  patients: z.ZodArray<z.ZodObject<{
@@ -465,6 +484,7 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
465
484
  type: "medical.document-download";
466
485
  messageId: string;
467
486
  when: string;
487
+ requestId?: string | undefined;
468
488
  data?: unknown;
469
489
  };
470
490
  patients: {
@@ -495,6 +515,7 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
495
515
  type: "medical.document-download";
496
516
  messageId: string;
497
517
  when: string;
518
+ requestId?: string | undefined;
498
519
  data?: unknown;
499
520
  };
500
521
  patients: {
@@ -542,6 +563,7 @@ export type DocumentConversionWebhookPatient = z.infer<typeof documentConversion
542
563
  export declare const documentConversionWebhookRequestSchema: z.ZodObject<{
543
564
  meta: z.ZodObject<z.objectUtil.extendShape<{
544
565
  messageId: z.ZodString;
566
+ requestId: z.ZodOptional<z.ZodString>;
545
567
  when: z.ZodEffects<z.ZodString, string, string>;
546
568
  /**
547
569
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -553,11 +575,13 @@ export declare const documentConversionWebhookRequestSchema: z.ZodObject<{
553
575
  type: "medical.document-conversion";
554
576
  messageId: string;
555
577
  when: string;
578
+ requestId?: string | undefined;
556
579
  data?: unknown;
557
580
  }, {
558
581
  type: "medical.document-conversion";
559
582
  messageId: string;
560
583
  when: string;
584
+ requestId?: string | undefined;
561
585
  data?: unknown;
562
586
  }>;
563
587
  patients: z.ZodArray<z.ZodObject<{
@@ -581,6 +605,7 @@ export declare const documentConversionWebhookRequestSchema: z.ZodObject<{
581
605
  type: "medical.document-conversion";
582
606
  messageId: string;
583
607
  when: string;
608
+ requestId?: string | undefined;
584
609
  data?: unknown;
585
610
  };
586
611
  patients: {
@@ -594,6 +619,7 @@ export declare const documentConversionWebhookRequestSchema: z.ZodObject<{
594
619
  type: "medical.document-conversion";
595
620
  messageId: string;
596
621
  when: string;
622
+ requestId?: string | undefined;
597
623
  data?: unknown;
598
624
  };
599
625
  patients: {
@@ -735,6 +761,7 @@ export type DocumentBulkDownloadWebhookPatient = z.infer<typeof documentBulkDown
735
761
  export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
736
762
  meta: z.ZodObject<z.objectUtil.extendShape<{
737
763
  messageId: z.ZodString;
764
+ requestId: z.ZodOptional<z.ZodString>;
738
765
  when: z.ZodEffects<z.ZodString, string, string>;
739
766
  /**
740
767
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -746,11 +773,13 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
746
773
  type: "medical.document-bulk-download-urls";
747
774
  messageId: string;
748
775
  when: string;
776
+ requestId?: string | undefined;
749
777
  data?: unknown;
750
778
  }, {
751
779
  type: "medical.document-bulk-download-urls";
752
780
  messageId: string;
753
781
  when: string;
782
+ requestId?: string | undefined;
754
783
  data?: unknown;
755
784
  }>;
756
785
  patients: z.ZodArray<z.ZodObject<{
@@ -885,6 +914,7 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
885
914
  type: "medical.document-bulk-download-urls";
886
915
  messageId: string;
887
916
  when: string;
917
+ requestId?: string | undefined;
888
918
  data?: unknown;
889
919
  };
890
920
  patients: {
@@ -916,6 +946,7 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
916
946
  type: "medical.document-bulk-download-urls";
917
947
  messageId: string;
918
948
  when: string;
949
+ requestId?: string | undefined;
919
950
  data?: unknown;
920
951
  };
921
952
  patients: {
@@ -949,11 +980,11 @@ export declare const bulkPatientImportWebhookEntrySchema: z.ZodObject<{
949
980
  status: z.ZodEnum<["waiting", "processing", "completed", "failed"]>;
950
981
  result: z.ZodOptional<z.ZodNullable<z.ZodString>>;
951
982
  }, "strip", z.ZodTypeAny, {
952
- status: "waiting" | "processing" | "completed" | "failed";
983
+ status: "processing" | "completed" | "failed" | "waiting";
953
984
  requestId: string;
954
985
  result?: string | null | undefined;
955
986
  }, {
956
- status: "waiting" | "processing" | "completed" | "failed";
987
+ status: "processing" | "completed" | "failed" | "waiting";
957
988
  requestId: string;
958
989
  result?: string | null | undefined;
959
990
  }>;
@@ -961,6 +992,7 @@ export type BulkPatientImportWebhookEntry = z.infer<typeof bulkPatientImportWebh
961
992
  export declare const bulkPatientImportWebhookRequestSchema: z.ZodObject<{
962
993
  meta: z.ZodObject<z.objectUtil.extendShape<{
963
994
  messageId: z.ZodString;
995
+ requestId: z.ZodOptional<z.ZodString>;
964
996
  when: z.ZodEffects<z.ZodString, string, string>;
965
997
  /**
966
998
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -972,11 +1004,13 @@ export declare const bulkPatientImportWebhookRequestSchema: z.ZodObject<{
972
1004
  type: "medical.bulk-patient-create";
973
1005
  messageId: string;
974
1006
  when: string;
1007
+ requestId?: string | undefined;
975
1008
  data?: unknown;
976
1009
  }, {
977
1010
  type: "medical.bulk-patient-create";
978
1011
  messageId: string;
979
1012
  when: string;
1013
+ requestId?: string | undefined;
980
1014
  data?: unknown;
981
1015
  }>;
982
1016
  bulkPatientCreate: z.ZodObject<{
@@ -984,11 +1018,11 @@ export declare const bulkPatientImportWebhookRequestSchema: z.ZodObject<{
984
1018
  status: z.ZodEnum<["waiting", "processing", "completed", "failed"]>;
985
1019
  result: z.ZodOptional<z.ZodNullable<z.ZodString>>;
986
1020
  }, "strip", z.ZodTypeAny, {
987
- status: "waiting" | "processing" | "completed" | "failed";
1021
+ status: "processing" | "completed" | "failed" | "waiting";
988
1022
  requestId: string;
989
1023
  result?: string | null | undefined;
990
1024
  }, {
991
- status: "waiting" | "processing" | "completed" | "failed";
1025
+ status: "processing" | "completed" | "failed" | "waiting";
992
1026
  requestId: string;
993
1027
  result?: string | null | undefined;
994
1028
  }>;
@@ -997,10 +1031,11 @@ export declare const bulkPatientImportWebhookRequestSchema: z.ZodObject<{
997
1031
  type: "medical.bulk-patient-create";
998
1032
  messageId: string;
999
1033
  when: string;
1034
+ requestId?: string | undefined;
1000
1035
  data?: unknown;
1001
1036
  };
1002
1037
  bulkPatientCreate: {
1003
- status: "waiting" | "processing" | "completed" | "failed";
1038
+ status: "processing" | "completed" | "failed" | "waiting";
1004
1039
  requestId: string;
1005
1040
  result?: string | null | undefined;
1006
1041
  };
@@ -1009,10 +1044,11 @@ export declare const bulkPatientImportWebhookRequestSchema: z.ZodObject<{
1009
1044
  type: "medical.bulk-patient-create";
1010
1045
  messageId: string;
1011
1046
  when: string;
1047
+ requestId?: string | undefined;
1012
1048
  data?: unknown;
1013
1049
  };
1014
1050
  bulkPatientCreate: {
1015
- status: "waiting" | "processing" | "completed" | "failed";
1051
+ status: "processing" | "completed" | "failed" | "waiting";
1016
1052
  requestId: string;
1017
1053
  result?: string | null | undefined;
1018
1054
  };
@@ -1158,6 +1194,7 @@ export type PatientDischargePayload = z.infer<typeof patientDischargeWebhookPayl
1158
1194
  export declare const patientAdmitWebhookRequestSchema: z.ZodObject<{
1159
1195
  meta: z.ZodObject<z.objectUtil.extendShape<{
1160
1196
  messageId: z.ZodString;
1197
+ requestId: z.ZodOptional<z.ZodString>;
1161
1198
  when: z.ZodEffects<z.ZodString, string, string>;
1162
1199
  /**
1163
1200
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -1169,11 +1206,13 @@ export declare const patientAdmitWebhookRequestSchema: z.ZodObject<{
1169
1206
  type: "patient.admit";
1170
1207
  messageId: string;
1171
1208
  when: string;
1209
+ requestId?: string | undefined;
1172
1210
  data?: unknown;
1173
1211
  }, {
1174
1212
  type: "patient.admit";
1175
1213
  messageId: string;
1176
1214
  when: string;
1215
+ requestId?: string | undefined;
1177
1216
  data?: unknown;
1178
1217
  }>;
1179
1218
  payload: z.ZodObject<{
@@ -1203,6 +1242,7 @@ export declare const patientAdmitWebhookRequestSchema: z.ZodObject<{
1203
1242
  type: "patient.admit";
1204
1243
  messageId: string;
1205
1244
  when: string;
1245
+ requestId?: string | undefined;
1206
1246
  data?: unknown;
1207
1247
  };
1208
1248
  payload: {
@@ -1218,6 +1258,7 @@ export declare const patientAdmitWebhookRequestSchema: z.ZodObject<{
1218
1258
  type: "patient.admit";
1219
1259
  messageId: string;
1220
1260
  when: string;
1261
+ requestId?: string | undefined;
1221
1262
  data?: unknown;
1222
1263
  };
1223
1264
  payload: {
@@ -1233,6 +1274,7 @@ export type PatientAdmitWebhookRequest = z.infer<typeof patientAdmitWebhookReque
1233
1274
  export declare const patientTransferWebhookRequestSchema: z.ZodObject<{
1234
1275
  meta: z.ZodObject<z.objectUtil.extendShape<{
1235
1276
  messageId: z.ZodString;
1277
+ requestId: z.ZodOptional<z.ZodString>;
1236
1278
  when: z.ZodEffects<z.ZodString, string, string>;
1237
1279
  /**
1238
1280
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -1244,11 +1286,13 @@ export declare const patientTransferWebhookRequestSchema: z.ZodObject<{
1244
1286
  type: "patient.transfer";
1245
1287
  messageId: string;
1246
1288
  when: string;
1289
+ requestId?: string | undefined;
1247
1290
  data?: unknown;
1248
1291
  }, {
1249
1292
  type: "patient.transfer";
1250
1293
  messageId: string;
1251
1294
  when: string;
1295
+ requestId?: string | undefined;
1252
1296
  data?: unknown;
1253
1297
  }>;
1254
1298
  payload: z.ZodObject<{
@@ -1343,6 +1387,7 @@ export declare const patientTransferWebhookRequestSchema: z.ZodObject<{
1343
1387
  type: "patient.transfer";
1344
1388
  messageId: string;
1345
1389
  when: string;
1390
+ requestId?: string | undefined;
1346
1391
  data?: unknown;
1347
1392
  };
1348
1393
  payload: {
@@ -1369,6 +1414,7 @@ export declare const patientTransferWebhookRequestSchema: z.ZodObject<{
1369
1414
  type: "patient.transfer";
1370
1415
  messageId: string;
1371
1416
  when: string;
1417
+ requestId?: string | undefined;
1372
1418
  data?: unknown;
1373
1419
  };
1374
1420
  payload: {
@@ -1395,6 +1441,7 @@ export type PatientTransferWebhookRequest = z.infer<typeof patientTransferWebhoo
1395
1441
  export declare const patientDischargeWebhookRequestSchema: z.ZodObject<{
1396
1442
  meta: z.ZodObject<z.objectUtil.extendShape<{
1397
1443
  messageId: z.ZodString;
1444
+ requestId: z.ZodOptional<z.ZodString>;
1398
1445
  when: z.ZodEffects<z.ZodString, string, string>;
1399
1446
  /**
1400
1447
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -1406,11 +1453,13 @@ export declare const patientDischargeWebhookRequestSchema: z.ZodObject<{
1406
1453
  type: "patient.discharge";
1407
1454
  messageId: string;
1408
1455
  when: string;
1456
+ requestId?: string | undefined;
1409
1457
  data?: unknown;
1410
1458
  }, {
1411
1459
  type: "patient.discharge";
1412
1460
  messageId: string;
1413
1461
  when: string;
1462
+ requestId?: string | undefined;
1414
1463
  data?: unknown;
1415
1464
  }>;
1416
1465
  payload: z.ZodObject<{
@@ -1443,6 +1492,7 @@ export declare const patientDischargeWebhookRequestSchema: z.ZodObject<{
1443
1492
  type: "patient.discharge";
1444
1493
  messageId: string;
1445
1494
  when: string;
1495
+ requestId?: string | undefined;
1446
1496
  data?: unknown;
1447
1497
  };
1448
1498
  payload: {
@@ -1459,6 +1509,7 @@ export declare const patientDischargeWebhookRequestSchema: z.ZodObject<{
1459
1509
  type: "patient.discharge";
1460
1510
  messageId: string;
1461
1511
  when: string;
1512
+ requestId?: string | undefined;
1462
1513
  data?: unknown;
1463
1514
  };
1464
1515
  payload: {
@@ -1475,6 +1526,7 @@ export type PatientDischargeWebhookRequest = z.infer<typeof patientDischargeWebh
1475
1526
  export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1476
1527
  meta: z.ZodObject<z.objectUtil.extendShape<{
1477
1528
  messageId: z.ZodString;
1529
+ requestId: z.ZodOptional<z.ZodString>;
1478
1530
  when: z.ZodEffects<z.ZodString, string, string>;
1479
1531
  /**
1480
1532
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -1486,11 +1538,13 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1486
1538
  type: "ping";
1487
1539
  messageId: string;
1488
1540
  when: string;
1541
+ requestId?: string | undefined;
1489
1542
  data?: unknown;
1490
1543
  }, {
1491
1544
  type: "ping";
1492
1545
  messageId: string;
1493
1546
  when: string;
1547
+ requestId?: string | undefined;
1494
1548
  data?: unknown;
1495
1549
  }>;
1496
1550
  ping: z.ZodString;
@@ -1499,6 +1553,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1499
1553
  type: "ping";
1500
1554
  messageId: string;
1501
1555
  when: string;
1556
+ requestId?: string | undefined;
1502
1557
  data?: unknown;
1503
1558
  };
1504
1559
  ping: string;
@@ -1507,12 +1562,14 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1507
1562
  type: "ping";
1508
1563
  messageId: string;
1509
1564
  when: string;
1565
+ requestId?: string | undefined;
1510
1566
  data?: unknown;
1511
1567
  };
1512
1568
  ping: string;
1513
1569
  }>, z.ZodObject<{
1514
1570
  meta: z.ZodObject<z.objectUtil.extendShape<{
1515
1571
  messageId: z.ZodString;
1572
+ requestId: z.ZodOptional<z.ZodString>;
1516
1573
  when: z.ZodEffects<z.ZodString, string, string>;
1517
1574
  /**
1518
1575
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -1524,11 +1581,13 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1524
1581
  type: "medical.consolidated-data";
1525
1582
  messageId: string;
1526
1583
  when: string;
1584
+ requestId?: string | undefined;
1527
1585
  data?: unknown;
1528
1586
  }, {
1529
1587
  type: "medical.consolidated-data";
1530
1588
  messageId: string;
1531
1589
  when: string;
1590
+ requestId?: string | undefined;
1532
1591
  data?: unknown;
1533
1592
  }>;
1534
1593
  patients: z.ZodArray<z.ZodObject<{
@@ -1558,6 +1617,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1558
1617
  type: "medical.consolidated-data";
1559
1618
  messageId: string;
1560
1619
  when: string;
1620
+ requestId?: string | undefined;
1561
1621
  data?: unknown;
1562
1622
  };
1563
1623
  patients: {
@@ -1573,6 +1633,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1573
1633
  type: "medical.consolidated-data";
1574
1634
  messageId: string;
1575
1635
  when: string;
1636
+ requestId?: string | undefined;
1576
1637
  data?: unknown;
1577
1638
  };
1578
1639
  patients: {
@@ -1586,6 +1647,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1586
1647
  }>, z.ZodObject<{
1587
1648
  meta: z.ZodObject<z.objectUtil.extendShape<{
1588
1649
  messageId: z.ZodString;
1650
+ requestId: z.ZodOptional<z.ZodString>;
1589
1651
  when: z.ZodEffects<z.ZodString, string, string>;
1590
1652
  /**
1591
1653
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -1597,11 +1659,13 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1597
1659
  type: "medical.document-download";
1598
1660
  messageId: string;
1599
1661
  when: string;
1662
+ requestId?: string | undefined;
1600
1663
  data?: unknown;
1601
1664
  }, {
1602
1665
  type: "medical.document-download";
1603
1666
  messageId: string;
1604
1667
  when: string;
1668
+ requestId?: string | undefined;
1605
1669
  data?: unknown;
1606
1670
  }>;
1607
1671
  patients: z.ZodArray<z.ZodObject<{
@@ -1730,6 +1794,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1730
1794
  type: "medical.document-download";
1731
1795
  messageId: string;
1732
1796
  when: string;
1797
+ requestId?: string | undefined;
1733
1798
  data?: unknown;
1734
1799
  };
1735
1800
  patients: {
@@ -1760,6 +1825,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1760
1825
  type: "medical.document-download";
1761
1826
  messageId: string;
1762
1827
  when: string;
1828
+ requestId?: string | undefined;
1763
1829
  data?: unknown;
1764
1830
  };
1765
1831
  patients: {
@@ -1788,6 +1854,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1788
1854
  }>, z.ZodObject<{
1789
1855
  meta: z.ZodObject<z.objectUtil.extendShape<{
1790
1856
  messageId: z.ZodString;
1857
+ requestId: z.ZodOptional<z.ZodString>;
1791
1858
  when: z.ZodEffects<z.ZodString, string, string>;
1792
1859
  /**
1793
1860
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -1799,11 +1866,13 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1799
1866
  type: "medical.document-conversion";
1800
1867
  messageId: string;
1801
1868
  when: string;
1869
+ requestId?: string | undefined;
1802
1870
  data?: unknown;
1803
1871
  }, {
1804
1872
  type: "medical.document-conversion";
1805
1873
  messageId: string;
1806
1874
  when: string;
1875
+ requestId?: string | undefined;
1807
1876
  data?: unknown;
1808
1877
  }>;
1809
1878
  patients: z.ZodArray<z.ZodObject<{
@@ -1827,6 +1896,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1827
1896
  type: "medical.document-conversion";
1828
1897
  messageId: string;
1829
1898
  when: string;
1899
+ requestId?: string | undefined;
1830
1900
  data?: unknown;
1831
1901
  };
1832
1902
  patients: {
@@ -1840,6 +1910,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1840
1910
  type: "medical.document-conversion";
1841
1911
  messageId: string;
1842
1912
  when: string;
1913
+ requestId?: string | undefined;
1843
1914
  data?: unknown;
1844
1915
  };
1845
1916
  patients: {
@@ -1851,6 +1922,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1851
1922
  }>, z.ZodObject<{
1852
1923
  meta: z.ZodObject<z.objectUtil.extendShape<{
1853
1924
  messageId: z.ZodString;
1925
+ requestId: z.ZodOptional<z.ZodString>;
1854
1926
  when: z.ZodEffects<z.ZodString, string, string>;
1855
1927
  /**
1856
1928
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -1862,11 +1934,13 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
1862
1934
  type: "medical.document-bulk-download-urls";
1863
1935
  messageId: string;
1864
1936
  when: string;
1937
+ requestId?: string | undefined;
1865
1938
  data?: unknown;
1866
1939
  }, {
1867
1940
  type: "medical.document-bulk-download-urls";
1868
1941
  messageId: string;
1869
1942
  when: string;
1943
+ requestId?: string | undefined;
1870
1944
  data?: unknown;
1871
1945
  }>;
1872
1946
  patients: z.ZodArray<z.ZodObject<{
@@ -2001,6 +2075,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2001
2075
  type: "medical.document-bulk-download-urls";
2002
2076
  messageId: string;
2003
2077
  when: string;
2078
+ requestId?: string | undefined;
2004
2079
  data?: unknown;
2005
2080
  };
2006
2081
  patients: {
@@ -2032,6 +2107,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2032
2107
  type: "medical.document-bulk-download-urls";
2033
2108
  messageId: string;
2034
2109
  when: string;
2110
+ requestId?: string | undefined;
2035
2111
  data?: unknown;
2036
2112
  };
2037
2113
  patients: {
@@ -2061,6 +2137,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2061
2137
  }>, z.ZodObject<{
2062
2138
  meta: z.ZodObject<z.objectUtil.extendShape<{
2063
2139
  messageId: z.ZodString;
2140
+ requestId: z.ZodOptional<z.ZodString>;
2064
2141
  when: z.ZodEffects<z.ZodString, string, string>;
2065
2142
  /**
2066
2143
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -2072,11 +2149,13 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2072
2149
  type: "medical.bulk-patient-create";
2073
2150
  messageId: string;
2074
2151
  when: string;
2152
+ requestId?: string | undefined;
2075
2153
  data?: unknown;
2076
2154
  }, {
2077
2155
  type: "medical.bulk-patient-create";
2078
2156
  messageId: string;
2079
2157
  when: string;
2158
+ requestId?: string | undefined;
2080
2159
  data?: unknown;
2081
2160
  }>;
2082
2161
  bulkPatientCreate: z.ZodObject<{
@@ -2084,11 +2163,11 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2084
2163
  status: z.ZodEnum<["waiting", "processing", "completed", "failed"]>;
2085
2164
  result: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2086
2165
  }, "strip", z.ZodTypeAny, {
2087
- status: "waiting" | "processing" | "completed" | "failed";
2166
+ status: "processing" | "completed" | "failed" | "waiting";
2088
2167
  requestId: string;
2089
2168
  result?: string | null | undefined;
2090
2169
  }, {
2091
- status: "waiting" | "processing" | "completed" | "failed";
2170
+ status: "processing" | "completed" | "failed" | "waiting";
2092
2171
  requestId: string;
2093
2172
  result?: string | null | undefined;
2094
2173
  }>;
@@ -2097,10 +2176,11 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2097
2176
  type: "medical.bulk-patient-create";
2098
2177
  messageId: string;
2099
2178
  when: string;
2179
+ requestId?: string | undefined;
2100
2180
  data?: unknown;
2101
2181
  };
2102
2182
  bulkPatientCreate: {
2103
- status: "waiting" | "processing" | "completed" | "failed";
2183
+ status: "processing" | "completed" | "failed" | "waiting";
2104
2184
  requestId: string;
2105
2185
  result?: string | null | undefined;
2106
2186
  };
@@ -2109,16 +2189,18 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2109
2189
  type: "medical.bulk-patient-create";
2110
2190
  messageId: string;
2111
2191
  when: string;
2192
+ requestId?: string | undefined;
2112
2193
  data?: unknown;
2113
2194
  };
2114
2195
  bulkPatientCreate: {
2115
- status: "waiting" | "processing" | "completed" | "failed";
2196
+ status: "processing" | "completed" | "failed" | "waiting";
2116
2197
  requestId: string;
2117
2198
  result?: string | null | undefined;
2118
2199
  };
2119
2200
  }>, z.ZodObject<{
2120
2201
  meta: z.ZodObject<z.objectUtil.extendShape<{
2121
2202
  messageId: z.ZodString;
2203
+ requestId: z.ZodOptional<z.ZodString>;
2122
2204
  when: z.ZodEffects<z.ZodString, string, string>;
2123
2205
  /**
2124
2206
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -2130,11 +2212,13 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2130
2212
  type: "patient.admit";
2131
2213
  messageId: string;
2132
2214
  when: string;
2215
+ requestId?: string | undefined;
2133
2216
  data?: unknown;
2134
2217
  }, {
2135
2218
  type: "patient.admit";
2136
2219
  messageId: string;
2137
2220
  when: string;
2221
+ requestId?: string | undefined;
2138
2222
  data?: unknown;
2139
2223
  }>;
2140
2224
  payload: z.ZodObject<{
@@ -2164,6 +2248,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2164
2248
  type: "patient.admit";
2165
2249
  messageId: string;
2166
2250
  when: string;
2251
+ requestId?: string | undefined;
2167
2252
  data?: unknown;
2168
2253
  };
2169
2254
  payload: {
@@ -2179,6 +2264,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2179
2264
  type: "patient.admit";
2180
2265
  messageId: string;
2181
2266
  when: string;
2267
+ requestId?: string | undefined;
2182
2268
  data?: unknown;
2183
2269
  };
2184
2270
  payload: {
@@ -2192,6 +2278,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2192
2278
  }>, z.ZodObject<{
2193
2279
  meta: z.ZodObject<z.objectUtil.extendShape<{
2194
2280
  messageId: z.ZodString;
2281
+ requestId: z.ZodOptional<z.ZodString>;
2195
2282
  when: z.ZodEffects<z.ZodString, string, string>;
2196
2283
  /**
2197
2284
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -2203,11 +2290,13 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2203
2290
  type: "patient.transfer";
2204
2291
  messageId: string;
2205
2292
  when: string;
2293
+ requestId?: string | undefined;
2206
2294
  data?: unknown;
2207
2295
  }, {
2208
2296
  type: "patient.transfer";
2209
2297
  messageId: string;
2210
2298
  when: string;
2299
+ requestId?: string | undefined;
2211
2300
  data?: unknown;
2212
2301
  }>;
2213
2302
  payload: z.ZodObject<{
@@ -2302,6 +2391,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2302
2391
  type: "patient.transfer";
2303
2392
  messageId: string;
2304
2393
  when: string;
2394
+ requestId?: string | undefined;
2305
2395
  data?: unknown;
2306
2396
  };
2307
2397
  payload: {
@@ -2328,6 +2418,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2328
2418
  type: "patient.transfer";
2329
2419
  messageId: string;
2330
2420
  when: string;
2421
+ requestId?: string | undefined;
2331
2422
  data?: unknown;
2332
2423
  };
2333
2424
  payload: {
@@ -2352,6 +2443,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2352
2443
  }>, z.ZodObject<{
2353
2444
  meta: z.ZodObject<z.objectUtil.extendShape<{
2354
2445
  messageId: z.ZodString;
2446
+ requestId: z.ZodOptional<z.ZodString>;
2355
2447
  when: z.ZodEffects<z.ZodString, string, string>;
2356
2448
  /**
2357
2449
  * The metadata sent by the customer when they triggered the operation that resulted in this webhook.
@@ -2363,11 +2455,13 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2363
2455
  type: "patient.discharge";
2364
2456
  messageId: string;
2365
2457
  when: string;
2458
+ requestId?: string | undefined;
2366
2459
  data?: unknown;
2367
2460
  }, {
2368
2461
  type: "patient.discharge";
2369
2462
  messageId: string;
2370
2463
  when: string;
2464
+ requestId?: string | undefined;
2371
2465
  data?: unknown;
2372
2466
  }>;
2373
2467
  payload: z.ZodObject<{
@@ -2400,6 +2494,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2400
2494
  type: "patient.discharge";
2401
2495
  messageId: string;
2402
2496
  when: string;
2497
+ requestId?: string | undefined;
2403
2498
  data?: unknown;
2404
2499
  };
2405
2500
  payload: {
@@ -2416,6 +2511,7 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2416
2511
  type: "patient.discharge";
2417
2512
  messageId: string;
2418
2513
  when: string;
2514
+ requestId?: string | undefined;
2419
2515
  data?: unknown;
2420
2516
  };
2421
2517
  payload: {