@tellescope/types-models 1.220.0 → 1.222.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/CLAUDE.md ADDED
@@ -0,0 +1,30 @@
1
+ # Tellescope Types - Models
2
+
3
+ ## Purpose
4
+ Core TypeScript type definitions for Tellescope's healthcare data models, defining structure and relationships for all healthcare entities.
5
+
6
+ ## Key Features
7
+ - Patient management types (Enduser, relationships, observations, medications)
8
+ - Care management types (CarePlan, tasks, journeys, automation calendar events)
9
+ - Clinical data types (Vital, forms, encounters, diagnoses)
10
+ - Provider types (User, Organization, teams, roles)
11
+ - Communication types (Email, SMS, chat)
12
+
13
+ ## Entry Points
14
+ - **Main**: `src/` - All healthcare data model type definitions
15
+ - **Core Models**: Patient-centric data architecture with required audit fields
16
+
17
+ ## Critical Safety Notes
18
+ - 🔒 Patient-centric design - most data links to `enduserId`
19
+ - ✅ Safe to add new type definitions and extend existing interfaces
20
+
21
+ ## Usage Example
22
+ ```typescript
23
+ import { Enduser, EnduserObservation, CarePlan } from '@tellescope/types-models'
24
+
25
+ const patient: Enduser = {
26
+ id: '...',
27
+ fname: 'John',
28
+ lname: 'Doe',
29
+ dateOfBirth: '12-20-2001', // MM-DD-YYYY
30
+ }
@@ -13,7 +13,8 @@ export type StripeCheckoutInfo = {
13
13
  stripeAccount: string;
14
14
  businessName: string;
15
15
  };
16
- export type SortBy = 'updatedAt' | 'dueDateInMS' | 'closedAt';
16
+ export type SortBy = 'updatedAt' | 'dueDateInMS' | 'closedAt' | 'timestamp';
17
+ export declare const SORT_BY_OPTIONS: SortBy[];
17
18
  export type AccessType = "All" | "Default" | "Assigned" | null;
18
19
  export type AccessAction = "create" | "read" | "update" | "delete";
19
20
  export type AccessResources = ModelName | 'apiKeys';
@@ -323,6 +324,8 @@ export interface Organization_updatesDisabled {
323
324
  subdomain: string;
324
325
  }
325
326
  export interface Organization extends Organization_readonly, Organization_required, Organization_updatesDisabled {
327
+ inboxThreadsBuiltFrom?: Date | '';
328
+ inboxThreadsBuiltTo?: Date | '';
326
329
  bedrockAIAllowed?: boolean;
327
330
  subdomains?: string[];
328
331
  owner?: string;
@@ -1198,9 +1201,7 @@ export type ChatRoomType = 'internal' | 'external' | 'Group Chat';
1198
1201
  export interface ChatRoom_readonly extends ClientRecord {
1199
1202
  recentMessage?: string;
1200
1203
  recentEnduserMessage?: string;
1201
- recentEnduserMessageSentAt?: number;
1202
1204
  recentSender?: string;
1203
- recentMessageSentAt?: number;
1204
1205
  numMessages: number;
1205
1206
  }
1206
1207
  export type ChatRoomUserInfo = {
@@ -1212,6 +1213,8 @@ export interface ChatRoom_required {
1212
1213
  export interface ChatRoom_updatesDisabled {
1213
1214
  }
1214
1215
  export interface ChatRoom extends ChatRoom_readonly, ChatRoom_required, ChatRoom_updatesDisabled {
1216
+ recentMessageSentAt?: number;
1217
+ recentEnduserMessageSentAt?: number;
1215
1218
  markedUnreadForAll?: boolean;
1216
1219
  inboxStatus?: string;
1217
1220
  description?: string;
@@ -1728,6 +1731,7 @@ export type FormCustomization = {
1728
1731
  multiPagePublicQuestions?: boolean;
1729
1732
  hideBg?: boolean;
1730
1733
  portalShowThanksAfterSubmission?: boolean;
1734
+ maxWidth?: number;
1731
1735
  };
1732
1736
  export interface Form_readonly extends ClientRecord {
1733
1737
  numFields: number;
@@ -1797,6 +1801,7 @@ export interface Form extends Form_readonly, Form_required, Form_updatesDisabled
1797
1801
  matchCareTeamTagsForCanvasPractitionerResolution?: ListOfStringsWithQualifier;
1798
1802
  dontSyncToCanvasOnSubmission?: boolean;
1799
1803
  belugaVisitType?: string;
1804
+ showByUserTags?: string[];
1800
1805
  }
1801
1806
  export interface FormGroup_readonly extends ClientRecord {
1802
1807
  }
@@ -3174,6 +3179,7 @@ export interface EnduserObservation extends EnduserObservation_readonly, Enduser
3174
3179
  classification: string;
3175
3180
  }[];
3176
3181
  beforeMeal?: boolean;
3182
+ medStatus?: string;
3177
3183
  timestampIsEstimated?: boolean;
3178
3184
  dontTrigger?: boolean;
3179
3185
  showWithPlotsByUnit?: string[];
@@ -3840,6 +3846,10 @@ export type AnalyticsQueryOptions = {
3840
3846
  overrideGlobalRange?: boolean;
3841
3847
  groupByCareTeam?: boolean;
3842
3848
  };
3849
+ export type AnalyticsAggregationRequest = {
3850
+ modelName: string;
3851
+ aggregation: any[];
3852
+ };
3843
3853
  export type AnalyticsFrameGroupingCategory = {
3844
3854
  category: string;
3845
3855
  keys: string[];
@@ -4119,6 +4129,7 @@ export type AutomationTriggerEvents = {
4119
4129
  'Vital Update': AutomationTriggerEventBuilder<"Vital Update", {
4120
4130
  configurationIds: string[];
4121
4131
  classifications: string[];
4132
+ ignoreDelayedReadings?: boolean;
4122
4133
  }, {}>;
4123
4134
  'SMS Reply': AutomationTriggerEventBuilder<"SMS Reply", {
4124
4135
  templateIds: string[];
@@ -4908,7 +4919,34 @@ export interface AIConversation_updatesDisabled {
4908
4919
  }
4909
4920
  export interface AIConversation extends AIConversation_readonly, AIConversation_required, AIConversation_updatesDisabled {
4910
4921
  }
4922
+ export interface InboxThread_readonly extends ClientRecord {
4923
+ }
4924
+ export interface InboxThread_required {
4925
+ type: "Email" | "SMS" | "Chat" | "GroupMMS" | "Phone";
4926
+ title: string;
4927
+ preview: string;
4928
+ timestamp: Date;
4929
+ assignedTo: string[];
4930
+ userIds: string[];
4931
+ enduserIds: string[];
4932
+ inboxStatus: string;
4933
+ threadId: string;
4934
+ }
4935
+ export interface InboxThread_updatesDisabled {
4936
+ }
4937
+ export interface InboxThread extends InboxThread_readonly, InboxThread_required, InboxThread_updatesDisabled {
4938
+ tags?: string[];
4939
+ phoneNumber?: string;
4940
+ enduserPhoneNumber?: string;
4941
+ emailMessageId?: string | null;
4942
+ readBy?: {
4943
+ [index: string]: Date | '';
4944
+ };
4945
+ outboundTimestamp?: Date | '';
4946
+ outboundPreview?: string;
4947
+ }
4911
4948
  export type ModelForName_required = {
4949
+ inbox_threads: InboxThread_required;
4912
4950
  ai_conversations: AIConversation_required;
4913
4951
  waitlists: Waitlist_required;
4914
4952
  agent_records: AgentRecord_required;
@@ -4999,6 +5037,7 @@ export type ModelForName_required = {
4999
5037
  };
5000
5038
  export type ClientModel_required = ModelForName_required[keyof ModelForName_required];
5001
5039
  export interface ModelForName_readonly {
5040
+ inbox_threads: InboxThread_readonly;
5002
5041
  ai_conversations: AIConversation_readonly;
5003
5042
  waitlists: Waitlist_readonly;
5004
5043
  agent_records: AgentRecord_readonly;
@@ -5089,6 +5128,7 @@ export interface ModelForName_readonly {
5089
5128
  }
5090
5129
  export type ClientModel_readonly = ModelForName_readonly[keyof ModelForName_readonly];
5091
5130
  export interface ModelForName_updatesDisabled {
5131
+ inbox_threads: InboxThread_updatesDisabled;
5092
5132
  ai_conversations: AIConversation_updatesDisabled;
5093
5133
  waitlists: Waitlist_updatesDisabled;
5094
5134
  agent_records: AgentRecord_updatesDisabled;
@@ -5179,6 +5219,7 @@ export interface ModelForName_updatesDisabled {
5179
5219
  }
5180
5220
  export type ClientModel_updatesDisabled = ModelForName_updatesDisabled[keyof ModelForName_updatesDisabled];
5181
5221
  export interface ModelForName extends ModelForName_required, ModelForName_readonly {
5222
+ inbox_threads: InboxThread;
5182
5223
  ai_conversations: AIConversation;
5183
5224
  waitlists: Waitlist;
5184
5225
  agent_records: AgentRecord;