@hipnation-truth/sdk 0.1.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.
- package/dist/index.d.mts +858 -0
- package/dist/index.d.ts +858 -0
- package/dist/index.js +927 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +882 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react.d.mts +493 -0
- package/dist/react.d.ts +493 -0
- package/dist/react.js +367 -0
- package/dist/react.js.map +1 -0
- package/dist/react.mjs +332 -0
- package/dist/react.mjs.map +1 -0
- package/package.json +53 -0
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { ConvexReactClient } from 'convex/react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* React hooks for Truth SDK — real-time Convex-backed data access.
|
|
7
|
+
*
|
|
8
|
+
* These hooks use Convex React subscriptions for live-updating data.
|
|
9
|
+
* Must be used within a ConvexProvider (see TruthProvider).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { usePatients, useAppointments } from '@hipnation-truth/sdk/react';
|
|
14
|
+
*
|
|
15
|
+
* function PatientList() {
|
|
16
|
+
* const patients = usePatients({ limit: 20 });
|
|
17
|
+
* return patients?.map(p => <div key={p._id}>{p.firstName} {p.lastName}</div>);
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
interface UsePatientListOptions {
|
|
22
|
+
search?: string;
|
|
23
|
+
lastName?: string;
|
|
24
|
+
limit?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Subscribe to a list of patients with optional search and filtering.
|
|
28
|
+
* Returns undefined while loading, then an array of patients.
|
|
29
|
+
*/
|
|
30
|
+
declare function usePatients(options?: UsePatientListOptions): any;
|
|
31
|
+
/**
|
|
32
|
+
* Subscribe to a single patient by Convex document ID.
|
|
33
|
+
*/
|
|
34
|
+
declare function usePatient(id: string): any;
|
|
35
|
+
/**
|
|
36
|
+
* Subscribe to a patient by their Elation ID.
|
|
37
|
+
*/
|
|
38
|
+
declare function usePatientByElationId(elationId: string): any;
|
|
39
|
+
/**
|
|
40
|
+
* Subscribe to a patient by their Hint ID.
|
|
41
|
+
*/
|
|
42
|
+
declare function usePatientByHintId(hintId: string): any;
|
|
43
|
+
interface UseAppointmentListOptions {
|
|
44
|
+
patientId?: string;
|
|
45
|
+
status?: string;
|
|
46
|
+
startDate?: string;
|
|
47
|
+
endDate?: string;
|
|
48
|
+
limit?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Subscribe to a list of appointments with optional filtering.
|
|
52
|
+
*/
|
|
53
|
+
declare function useAppointments(options?: UseAppointmentListOptions): any;
|
|
54
|
+
/**
|
|
55
|
+
* Subscribe to a single appointment by Convex document ID.
|
|
56
|
+
*/
|
|
57
|
+
declare function useAppointment(id: string): any;
|
|
58
|
+
/**
|
|
59
|
+
* Subscribe to an appointment by its Elation ID.
|
|
60
|
+
*/
|
|
61
|
+
declare function useAppointmentByElationId(elationId: string): any;
|
|
62
|
+
|
|
63
|
+
interface TruthProviderProps {
|
|
64
|
+
/** Truth environment — determines which Convex deployment to connect to */
|
|
65
|
+
environment?: string;
|
|
66
|
+
/** Override the Convex URL directly */
|
|
67
|
+
convexUrl?: string;
|
|
68
|
+
children: ReactNode;
|
|
69
|
+
}
|
|
70
|
+
declare function TruthProvider({ environment, convexUrl, children, }: TruthProviderProps): react.FunctionComponentElement<{
|
|
71
|
+
client: ConvexReactClient;
|
|
72
|
+
children?: React.ReactNode;
|
|
73
|
+
}>;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Typed event definitions for the Truth Platform event store.
|
|
77
|
+
*
|
|
78
|
+
* All 26 event types from the Communication Hub -> Truth Event Store Contract.
|
|
79
|
+
* Events are grouped by domain and include typed payload interfaces.
|
|
80
|
+
*/
|
|
81
|
+
declare const CONVERSATION_EVENTS: {
|
|
82
|
+
readonly created: "conversation.created.v1";
|
|
83
|
+
readonly messageSent: "conversation.message_sent.v1";
|
|
84
|
+
readonly messageReceived: "conversation.message_received.v1";
|
|
85
|
+
readonly markedRead: "conversation.marked_read.v1";
|
|
86
|
+
readonly attachmentUploaded: "conversation.attachment_uploaded.v1";
|
|
87
|
+
readonly attachmentDownloaded: "conversation.attachment_downloaded.v1";
|
|
88
|
+
};
|
|
89
|
+
declare const CALL_EVENTS: {
|
|
90
|
+
readonly initiated: "call.initiated.v1";
|
|
91
|
+
readonly connected: "call.connected.v1";
|
|
92
|
+
readonly ended: "call.ended.v1";
|
|
93
|
+
readonly missed: "call.missed.v1";
|
|
94
|
+
};
|
|
95
|
+
declare const TASK_EVENTS: {
|
|
96
|
+
readonly created: "task.created.v1";
|
|
97
|
+
readonly assigned: "task.assigned.v1";
|
|
98
|
+
readonly statusChanged: "task.status_changed.v1";
|
|
99
|
+
};
|
|
100
|
+
declare const REMINDER_EVENTS: {
|
|
101
|
+
readonly scheduled: "reminder.scheduled.v1";
|
|
102
|
+
readonly triggered: "reminder.triggered.v1";
|
|
103
|
+
};
|
|
104
|
+
declare const TRANSLATION_EVENTS: {
|
|
105
|
+
readonly requested: "translation.requested.v1";
|
|
106
|
+
readonly completed: "translation.completed.v1";
|
|
107
|
+
};
|
|
108
|
+
declare const NOTIFICATION_EVENTS: {
|
|
109
|
+
readonly sent: "notification.sent.v1";
|
|
110
|
+
readonly delivered: "notification.delivered.v1";
|
|
111
|
+
readonly opened: "notification.opened.v1";
|
|
112
|
+
};
|
|
113
|
+
declare const PROVIDER_EVENTS: {
|
|
114
|
+
readonly syncStarted: "provider.sync_started.v1";
|
|
115
|
+
readonly syncSucceeded: "provider.sync_succeeded.v1";
|
|
116
|
+
readonly syncFailed: "provider.sync_failed.v1";
|
|
117
|
+
};
|
|
118
|
+
declare const AUTH_EVENTS: {
|
|
119
|
+
readonly loginSucceeded: "auth.login_succeeded.v1";
|
|
120
|
+
readonly loginFailed: "auth.login_failed.v1";
|
|
121
|
+
};
|
|
122
|
+
declare const SECURITY_EVENTS: {
|
|
123
|
+
readonly accessDenied: "security.access_denied.v1";
|
|
124
|
+
};
|
|
125
|
+
type ConversationEventType = (typeof CONVERSATION_EVENTS)[keyof typeof CONVERSATION_EVENTS];
|
|
126
|
+
type CallEventType = (typeof CALL_EVENTS)[keyof typeof CALL_EVENTS];
|
|
127
|
+
type TaskEventType = (typeof TASK_EVENTS)[keyof typeof TASK_EVENTS];
|
|
128
|
+
type ReminderEventType = (typeof REMINDER_EVENTS)[keyof typeof REMINDER_EVENTS];
|
|
129
|
+
type TranslationEventType = (typeof TRANSLATION_EVENTS)[keyof typeof TRANSLATION_EVENTS];
|
|
130
|
+
type NotificationEventType = (typeof NOTIFICATION_EVENTS)[keyof typeof NOTIFICATION_EVENTS];
|
|
131
|
+
type ProviderEventType = (typeof PROVIDER_EVENTS)[keyof typeof PROVIDER_EVENTS];
|
|
132
|
+
type AuthEventType = (typeof AUTH_EVENTS)[keyof typeof AUTH_EVENTS];
|
|
133
|
+
type SecurityEventType = (typeof SECURITY_EVENTS)[keyof typeof SECURITY_EVENTS];
|
|
134
|
+
/**
|
|
135
|
+
* Union of all 26 registered event type strings.
|
|
136
|
+
*/
|
|
137
|
+
type EventType = ConversationEventType | CallEventType | TaskEventType | ReminderEventType | TranslationEventType | NotificationEventType | ProviderEventType | AuthEventType | SecurityEventType;
|
|
138
|
+
interface ConversationCreatedPayload {
|
|
139
|
+
channel: string;
|
|
140
|
+
origin_system: string;
|
|
141
|
+
participant_count: number;
|
|
142
|
+
}
|
|
143
|
+
interface ConversationMessageSentPayload {
|
|
144
|
+
channel: string;
|
|
145
|
+
direction: string;
|
|
146
|
+
message_chars: number;
|
|
147
|
+
has_attachment: boolean;
|
|
148
|
+
provider_system: string;
|
|
149
|
+
}
|
|
150
|
+
interface ConversationMessageReceivedPayload {
|
|
151
|
+
channel: string;
|
|
152
|
+
direction: string;
|
|
153
|
+
message_chars: number;
|
|
154
|
+
provider_system: string;
|
|
155
|
+
}
|
|
156
|
+
interface ConversationMarkedReadPayload {
|
|
157
|
+
read_by_actor_id: string;
|
|
158
|
+
unread_count_before: number;
|
|
159
|
+
unread_count_after: number;
|
|
160
|
+
}
|
|
161
|
+
interface ConversationAttachmentUploadedPayload {
|
|
162
|
+
attachment_id: string;
|
|
163
|
+
mime_type: string;
|
|
164
|
+
size_bytes: number;
|
|
165
|
+
storage_class: string;
|
|
166
|
+
}
|
|
167
|
+
interface ConversationAttachmentDownloadedPayload {
|
|
168
|
+
attachment_id: string;
|
|
169
|
+
download_actor_type: string;
|
|
170
|
+
access_path: string;
|
|
171
|
+
}
|
|
172
|
+
interface CallInitiatedPayload {
|
|
173
|
+
direction: string;
|
|
174
|
+
provider_system: string;
|
|
175
|
+
from_number_ref: string;
|
|
176
|
+
to_number_ref: string;
|
|
177
|
+
}
|
|
178
|
+
interface CallConnectedPayload {
|
|
179
|
+
provider_system: string;
|
|
180
|
+
ring_duration_ms: number;
|
|
181
|
+
}
|
|
182
|
+
interface CallEndedPayload {
|
|
183
|
+
provider_system: string;
|
|
184
|
+
duration_ms: number;
|
|
185
|
+
end_reason: string;
|
|
186
|
+
disposition: string;
|
|
187
|
+
}
|
|
188
|
+
interface CallMissedPayload {
|
|
189
|
+
provider_system: string;
|
|
190
|
+
miss_reason: string;
|
|
191
|
+
}
|
|
192
|
+
interface TaskCreatedPayload {
|
|
193
|
+
task_id: string;
|
|
194
|
+
created_by: string;
|
|
195
|
+
assigned_to: string;
|
|
196
|
+
priority: string;
|
|
197
|
+
due_at: string;
|
|
198
|
+
}
|
|
199
|
+
interface TaskAssignedPayload {
|
|
200
|
+
task_id: string;
|
|
201
|
+
assigned_to: string;
|
|
202
|
+
assigned_by: string;
|
|
203
|
+
}
|
|
204
|
+
interface TaskStatusChangedPayload {
|
|
205
|
+
task_id: string;
|
|
206
|
+
status_from: string;
|
|
207
|
+
status_to: string;
|
|
208
|
+
changed_by: string;
|
|
209
|
+
}
|
|
210
|
+
interface ReminderScheduledPayload {
|
|
211
|
+
reminder_id: string;
|
|
212
|
+
conversation_id: string;
|
|
213
|
+
scheduled_for: string;
|
|
214
|
+
scheduled_by: string;
|
|
215
|
+
}
|
|
216
|
+
interface ReminderTriggeredPayload {
|
|
217
|
+
reminder_id: string;
|
|
218
|
+
trigger_result: string;
|
|
219
|
+
notification_attempted: boolean;
|
|
220
|
+
}
|
|
221
|
+
interface TranslationRequestedPayload {
|
|
222
|
+
target_language: string;
|
|
223
|
+
source_language: string;
|
|
224
|
+
char_count: number;
|
|
225
|
+
mode: string;
|
|
226
|
+
}
|
|
227
|
+
interface TranslationCompletedPayload {
|
|
228
|
+
target_language: string;
|
|
229
|
+
provider: string;
|
|
230
|
+
latency_ms: number;
|
|
231
|
+
success: boolean;
|
|
232
|
+
error_code?: string;
|
|
233
|
+
}
|
|
234
|
+
interface NotificationSentPayload {
|
|
235
|
+
notification_id: string;
|
|
236
|
+
channel: string;
|
|
237
|
+
platform: string;
|
|
238
|
+
recipient_ref: string;
|
|
239
|
+
success: boolean;
|
|
240
|
+
}
|
|
241
|
+
interface NotificationDeliveredPayload {
|
|
242
|
+
notification_id: string;
|
|
243
|
+
platform: string;
|
|
244
|
+
delivered_at: string;
|
|
245
|
+
}
|
|
246
|
+
interface NotificationOpenedPayload {
|
|
247
|
+
notification_id: string;
|
|
248
|
+
platform: string;
|
|
249
|
+
opened_at: string;
|
|
250
|
+
}
|
|
251
|
+
interface ProviderSyncStartedPayload {
|
|
252
|
+
provider_system: string;
|
|
253
|
+
operation: string;
|
|
254
|
+
scope: string;
|
|
255
|
+
batch_id: string;
|
|
256
|
+
}
|
|
257
|
+
interface ProviderSyncSucceededPayload {
|
|
258
|
+
provider_system: string;
|
|
259
|
+
operation: string;
|
|
260
|
+
batch_id: string;
|
|
261
|
+
records_processed: number;
|
|
262
|
+
duration_ms: number;
|
|
263
|
+
}
|
|
264
|
+
interface ProviderSyncFailedPayload {
|
|
265
|
+
provider_system: string;
|
|
266
|
+
operation: string;
|
|
267
|
+
batch_id: string;
|
|
268
|
+
error_code: string;
|
|
269
|
+
retryable: boolean;
|
|
270
|
+
}
|
|
271
|
+
interface AuthLoginSucceededPayload {
|
|
272
|
+
auth_provider: string;
|
|
273
|
+
platform: string;
|
|
274
|
+
session_ref: string;
|
|
275
|
+
}
|
|
276
|
+
interface AuthLoginFailedPayload {
|
|
277
|
+
auth_provider: string;
|
|
278
|
+
platform: string;
|
|
279
|
+
failure_code: string;
|
|
280
|
+
}
|
|
281
|
+
interface SecurityAccessDeniedPayload {
|
|
282
|
+
resource: string;
|
|
283
|
+
policy: string;
|
|
284
|
+
reason_code: string;
|
|
285
|
+
actor_id: string;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Maps each event type string to its required payload interface.
|
|
289
|
+
*/
|
|
290
|
+
interface EventPayloadMap {
|
|
291
|
+
"conversation.created.v1": ConversationCreatedPayload;
|
|
292
|
+
"conversation.message_sent.v1": ConversationMessageSentPayload;
|
|
293
|
+
"conversation.message_received.v1": ConversationMessageReceivedPayload;
|
|
294
|
+
"conversation.marked_read.v1": ConversationMarkedReadPayload;
|
|
295
|
+
"conversation.attachment_uploaded.v1": ConversationAttachmentUploadedPayload;
|
|
296
|
+
"conversation.attachment_downloaded.v1": ConversationAttachmentDownloadedPayload;
|
|
297
|
+
"call.initiated.v1": CallInitiatedPayload;
|
|
298
|
+
"call.connected.v1": CallConnectedPayload;
|
|
299
|
+
"call.ended.v1": CallEndedPayload;
|
|
300
|
+
"call.missed.v1": CallMissedPayload;
|
|
301
|
+
"task.created.v1": TaskCreatedPayload;
|
|
302
|
+
"task.assigned.v1": TaskAssignedPayload;
|
|
303
|
+
"task.status_changed.v1": TaskStatusChangedPayload;
|
|
304
|
+
"reminder.scheduled.v1": ReminderScheduledPayload;
|
|
305
|
+
"reminder.triggered.v1": ReminderTriggeredPayload;
|
|
306
|
+
"translation.requested.v1": TranslationRequestedPayload;
|
|
307
|
+
"translation.completed.v1": TranslationCompletedPayload;
|
|
308
|
+
"notification.sent.v1": NotificationSentPayload;
|
|
309
|
+
"notification.delivered.v1": NotificationDeliveredPayload;
|
|
310
|
+
"notification.opened.v1": NotificationOpenedPayload;
|
|
311
|
+
"provider.sync_started.v1": ProviderSyncStartedPayload;
|
|
312
|
+
"provider.sync_succeeded.v1": ProviderSyncSucceededPayload;
|
|
313
|
+
"provider.sync_failed.v1": ProviderSyncFailedPayload;
|
|
314
|
+
"auth.login_succeeded.v1": AuthLoginSucceededPayload;
|
|
315
|
+
"auth.login_failed.v1": AuthLoginFailedPayload;
|
|
316
|
+
"security.access_denied.v1": SecurityAccessDeniedPayload;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Subject references for the event. Uses tokenized references only -- no PHI.
|
|
320
|
+
*/
|
|
321
|
+
interface EventSubject {
|
|
322
|
+
patient_ref?: string;
|
|
323
|
+
conversation_id?: string;
|
|
324
|
+
task_id?: string;
|
|
325
|
+
call_id?: string;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Actor who triggered the event.
|
|
329
|
+
*/
|
|
330
|
+
interface EventActor {
|
|
331
|
+
actor_id: string;
|
|
332
|
+
actor_type: "user" | "system" | "webhook";
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Compliance metadata for the event.
|
|
336
|
+
*/
|
|
337
|
+
interface EventCompliance {
|
|
338
|
+
pii_level: "none" | "limited" | "full";
|
|
339
|
+
contains_phi: boolean;
|
|
340
|
+
consent_context: string;
|
|
341
|
+
retention_class: string;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Optional overrides when calling truth.track().
|
|
345
|
+
*/
|
|
346
|
+
interface TrackOptions {
|
|
347
|
+
/** Override the default actor for this event */
|
|
348
|
+
actor?: EventActor;
|
|
349
|
+
/** Subject references for this event */
|
|
350
|
+
subject?: EventSubject;
|
|
351
|
+
/** Compliance metadata for this event */
|
|
352
|
+
compliance?: EventCompliance;
|
|
353
|
+
/** Override the default tenant ID for this event */
|
|
354
|
+
tenantId?: string;
|
|
355
|
+
/** Override the occurred_at timestamp (ISO 8601) */
|
|
356
|
+
occurredAt?: string;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Actor context attached to tracked events.
|
|
361
|
+
*/
|
|
362
|
+
interface ActorContext {
|
|
363
|
+
actorId: string;
|
|
364
|
+
actorType: "user" | "system" | "webhook";
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
interface TruthTrackingContextValue {
|
|
368
|
+
track: <T extends EventType>(eventType: T, payload: EventPayloadMap[T], options?: TrackOptions) => void;
|
|
369
|
+
identify: (actorId: string, actorType: ActorContext["actorType"]) => void;
|
|
370
|
+
}
|
|
371
|
+
interface TruthTrackingProviderProps {
|
|
372
|
+
/** Truth environment — determines API URL for event delivery */
|
|
373
|
+
environment?: string;
|
|
374
|
+
/** Event source identifier */
|
|
375
|
+
source?: string;
|
|
376
|
+
/** Source version (git SHA) */
|
|
377
|
+
sourceVersion?: string;
|
|
378
|
+
/** Default tenant ID */
|
|
379
|
+
tenantId?: string;
|
|
380
|
+
/** API key for authentication */
|
|
381
|
+
apiKey?: string;
|
|
382
|
+
children: ReactNode;
|
|
383
|
+
}
|
|
384
|
+
declare function TruthTrackingProvider({ environment, source, sourceVersion, tenantId, apiKey, children, }: TruthTrackingProviderProps): react.FunctionComponentElement<react.ProviderProps<TruthTrackingContextValue | null>>;
|
|
385
|
+
/**
|
|
386
|
+
* Access the Truth tracking context. Must be within a TruthTrackingProvider.
|
|
387
|
+
* Returns `{ track, identify }` for emitting events to Kinesis.
|
|
388
|
+
*/
|
|
389
|
+
declare function useTruth(): TruthTrackingContextValue;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Appointment interfaces for the Truth SDK.
|
|
393
|
+
*/
|
|
394
|
+
/**
|
|
395
|
+
* Normalized appointment record from the Truth platform.
|
|
396
|
+
*/
|
|
397
|
+
interface Appointment {
|
|
398
|
+
/** Truth platform appointment ID */
|
|
399
|
+
id: string;
|
|
400
|
+
/** Associated patient ID */
|
|
401
|
+
patientId: string;
|
|
402
|
+
/** Provider/practitioner ID */
|
|
403
|
+
providerId?: string;
|
|
404
|
+
/** Provider/practitioner name */
|
|
405
|
+
providerName?: string;
|
|
406
|
+
/** Appointment start time (ISO 8601) */
|
|
407
|
+
startTime: string;
|
|
408
|
+
/** Appointment end time (ISO 8601) */
|
|
409
|
+
endTime: string;
|
|
410
|
+
/** Appointment status */
|
|
411
|
+
status: string;
|
|
412
|
+
/** Appointment type or reason */
|
|
413
|
+
appointmentType?: string;
|
|
414
|
+
/** Visit reason or chief complaint */
|
|
415
|
+
reason?: string;
|
|
416
|
+
/** Location or facility name */
|
|
417
|
+
location?: string;
|
|
418
|
+
/** Source EHR system (e.g. "elation", "hint") */
|
|
419
|
+
sourceSystem?: string;
|
|
420
|
+
/** ID in the source EHR system */
|
|
421
|
+
sourceId?: string;
|
|
422
|
+
/** Associated organization/tenant ID */
|
|
423
|
+
tenantId: string;
|
|
424
|
+
/** ISO 8601 timestamp of record creation */
|
|
425
|
+
createdAt: string;
|
|
426
|
+
/** ISO 8601 timestamp of last update */
|
|
427
|
+
updatedAt: string;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Options for listing appointments.
|
|
431
|
+
*/
|
|
432
|
+
interface AppointmentListOptions {
|
|
433
|
+
/** Filter by patient ID */
|
|
434
|
+
patientId?: string;
|
|
435
|
+
/** Filter by start date (ISO 8601 date string) */
|
|
436
|
+
startDate?: string;
|
|
437
|
+
/** Filter by end date (ISO 8601 date string) */
|
|
438
|
+
endDate?: string;
|
|
439
|
+
/** Filter by appointment status */
|
|
440
|
+
status?: string;
|
|
441
|
+
/** Maximum number of results to return */
|
|
442
|
+
limit?: number;
|
|
443
|
+
/** Cursor for pagination */
|
|
444
|
+
cursor?: string;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Patient interfaces for the Truth SDK.
|
|
449
|
+
*/
|
|
450
|
+
/**
|
|
451
|
+
* Normalized patient record from the Truth platform.
|
|
452
|
+
*/
|
|
453
|
+
interface Patient {
|
|
454
|
+
/** Truth platform patient ID */
|
|
455
|
+
id: string;
|
|
456
|
+
/** Elation EHR patient ID (if linked) */
|
|
457
|
+
elationId?: string;
|
|
458
|
+
/** Hint EHR patient ID (if linked) */
|
|
459
|
+
hintId?: string;
|
|
460
|
+
/** Patient first name */
|
|
461
|
+
firstName: string;
|
|
462
|
+
/** Patient last name */
|
|
463
|
+
lastName: string;
|
|
464
|
+
/** Date of birth (ISO 8601 date string, e.g. "1990-01-15") */
|
|
465
|
+
dateOfBirth?: string;
|
|
466
|
+
/** Patient sex */
|
|
467
|
+
sex?: string;
|
|
468
|
+
/** Primary email address */
|
|
469
|
+
email?: string;
|
|
470
|
+
/** Primary phone number */
|
|
471
|
+
phone?: string;
|
|
472
|
+
/** Patient status in the system */
|
|
473
|
+
status: string;
|
|
474
|
+
/** Associated organization/tenant ID */
|
|
475
|
+
tenantId: string;
|
|
476
|
+
/** ISO 8601 timestamp of record creation */
|
|
477
|
+
createdAt: string;
|
|
478
|
+
/** ISO 8601 timestamp of last update */
|
|
479
|
+
updatedAt: string;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Options for listing patients.
|
|
483
|
+
*/
|
|
484
|
+
interface PatientListOptions {
|
|
485
|
+
/** Search patients by name, email, or phone */
|
|
486
|
+
search?: string;
|
|
487
|
+
/** Maximum number of results to return */
|
|
488
|
+
limit?: number;
|
|
489
|
+
/** Cursor for pagination */
|
|
490
|
+
cursor?: string;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export { type Appointment, type AppointmentListOptions, type EventPayloadMap, type EventType, type Patient, type PatientListOptions, type TrackOptions, TruthProvider, type TruthProviderProps, type TruthTrackingContextValue, TruthTrackingProvider, type TruthTrackingProviderProps, type UseAppointmentListOptions, type UsePatientListOptions, useAppointment, useAppointmentByElationId, useAppointments, usePatient, usePatientByElationId, usePatientByHintId, usePatients, useTruth };
|