@awell-health/awell-extensions 2.0.130 → 2.0.132

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. package/dist/extensions/awellTasks/actions/getComments/__testdata__/comments.mock.d.ts +31 -0
  2. package/dist/extensions/awellTasks/actions/getComments/__testdata__/comments.mock.js +133 -0
  3. package/dist/extensions/awellTasks/actions/getComments/__testdata__/comments.mock.js.map +1 -0
  4. package/dist/extensions/awellTasks/actions/getComments/config/dataPoints.d.ts +6 -0
  5. package/dist/extensions/awellTasks/actions/getComments/config/dataPoints.js +10 -0
  6. package/dist/extensions/awellTasks/actions/getComments/config/dataPoints.js.map +1 -0
  7. package/dist/extensions/awellTasks/actions/getComments/config/fields.d.ts +3 -0
  8. package/dist/extensions/awellTasks/actions/getComments/config/fields.js +10 -0
  9. package/dist/extensions/awellTasks/actions/getComments/config/fields.js.map +1 -0
  10. package/dist/extensions/awellTasks/actions/getComments/config/index.d.ts +2 -0
  11. package/dist/extensions/awellTasks/actions/getComments/config/index.js +9 -0
  12. package/dist/extensions/awellTasks/actions/getComments/config/index.js.map +1 -0
  13. package/dist/extensions/awellTasks/actions/getComments/getComments.d.ts +4 -0
  14. package/dist/extensions/awellTasks/actions/getComments/getComments.js +51 -0
  15. package/dist/extensions/awellTasks/actions/getComments/getComments.js.map +1 -0
  16. package/dist/extensions/awellTasks/actions/getComments/index.d.ts +1 -0
  17. package/dist/extensions/awellTasks/actions/getComments/index.js +18 -0
  18. package/dist/extensions/awellTasks/actions/getComments/index.js.map +1 -0
  19. package/dist/extensions/awellTasks/actions/getComments/lib/htmlToEscapedJsString/htmlToEscapedJsString.d.ts +1 -0
  20. package/dist/extensions/awellTasks/actions/getComments/lib/htmlToEscapedJsString/htmlToEscapedJsString.js +68 -0
  21. package/dist/extensions/awellTasks/actions/getComments/lib/htmlToEscapedJsString/htmlToEscapedJsString.js.map +1 -0
  22. package/dist/extensions/awellTasks/actions/getComments/lib/htmlToEscapedJsString/index.d.ts +1 -0
  23. package/dist/extensions/awellTasks/actions/getComments/lib/htmlToEscapedJsString/index.js +6 -0
  24. package/dist/extensions/awellTasks/actions/getComments/lib/htmlToEscapedJsString/index.js.map +1 -0
  25. package/dist/extensions/awellTasks/actions/index.d.ts +18 -0
  26. package/dist/extensions/awellTasks/actions/index.js +8 -0
  27. package/dist/extensions/awellTasks/actions/index.js.map +1 -0
  28. package/dist/extensions/awellTasks/api/client.d.ts +10 -0
  29. package/dist/extensions/awellTasks/api/client.js +32 -0
  30. package/dist/extensions/awellTasks/api/client.js.map +1 -0
  31. package/dist/extensions/awellTasks/api/schema/GetCareflowComments.schema.d.ts +222 -0
  32. package/dist/extensions/awellTasks/api/schema/GetCareflowComments.schema.js +36 -0
  33. package/dist/extensions/awellTasks/api/schema/GetCareflowComments.schema.js.map +1 -0
  34. package/dist/extensions/awellTasks/api/schema/Pagination.schema.d.ts +14 -0
  35. package/dist/extensions/awellTasks/api/schema/Pagination.schema.js +10 -0
  36. package/dist/extensions/awellTasks/api/schema/Pagination.schema.js.map +1 -0
  37. package/dist/extensions/awellTasks/api/schema/User.schema.d.ts +17 -0
  38. package/dist/extensions/awellTasks/api/schema/User.schema.js +11 -0
  39. package/dist/extensions/awellTasks/api/schema/User.schema.js.map +1 -0
  40. package/dist/extensions/awellTasks/api/schema/index.d.ts +3 -0
  41. package/dist/extensions/awellTasks/api/schema/index.js +20 -0
  42. package/dist/extensions/awellTasks/api/schema/index.js.map +1 -0
  43. package/dist/extensions/awellTasks/index.d.ts +2 -0
  44. package/dist/extensions/awellTasks/index.js +19 -0
  45. package/dist/extensions/awellTasks/index.js.map +1 -0
  46. package/dist/extensions/awellTasks/lib/validatePayloadAndCreateSdk.d.ts +18 -0
  47. package/dist/extensions/awellTasks/lib/validatePayloadAndCreateSdk.js +31 -0
  48. package/dist/extensions/awellTasks/lib/validatePayloadAndCreateSdk.js.map +1 -0
  49. package/dist/extensions/awellTasks/settings.d.ts +27 -0
  50. package/dist/extensions/awellTasks/settings.js +25 -0
  51. package/dist/extensions/awellTasks/settings.js.map +1 -0
  52. package/dist/extensions/bland/api/schema/GetCallDetails.schema.d.ts +6 -6
  53. package/dist/extensions/calendly/schema.d.ts +112 -112
  54. package/dist/extensions/dockHealth/api/schema/task.schema.d.ts +2 -2
  55. package/dist/extensions/elation/actions/createCareGap/config/fields.d.ts +2 -2
  56. package/dist/extensions/elation/actions/updatePatientTags/updatePatientTags.js +48 -47
  57. package/dist/extensions/elation/actions/updatePatientTags/updatePatientTags.js.map +1 -1
  58. package/dist/extensions/elation/validation/careGap.zod.d.ts +2 -2
  59. package/dist/extensions/elation/validation/referralOrder.zod.d.ts +6 -6
  60. package/dist/extensions/index.js +2 -0
  61. package/dist/extensions/index.js.map +1 -1
  62. package/dist/extensions/infobip/v1/actions/sendSms/config/fields.d.ts +2 -2
  63. package/dist/extensions/markdown.json +4 -0
  64. package/dist/extensions/textline/client/schema.d.ts +10 -10
  65. package/package.json +3 -1
@@ -200,6 +200,7 @@ export declare const TaskSchema: z.ZodObject<{
200
200
  location?: string | undefined;
201
201
  } | undefined;
202
202
  identifier?: string | undefined;
203
+ comments?: any;
203
204
  details?: string | undefined;
204
205
  assignedBy?: {
205
206
  id?: string | undefined;
@@ -216,7 +217,6 @@ export declare const TaskSchema: z.ZodObject<{
216
217
  identifier?: string | undefined;
217
218
  location?: string | undefined;
218
219
  }[] | undefined;
219
- comments?: any;
220
220
  completedBy?: {
221
221
  id?: string | undefined;
222
222
  identifier?: string | undefined;
@@ -288,6 +288,7 @@ export declare const TaskSchema: z.ZodObject<{
288
288
  location?: string | undefined;
289
289
  } | undefined;
290
290
  identifier?: string | undefined;
291
+ comments?: any;
291
292
  details?: string | undefined;
292
293
  assignedBy?: {
293
294
  id?: string | undefined;
@@ -304,7 +305,6 @@ export declare const TaskSchema: z.ZodObject<{
304
305
  identifier?: string | undefined;
305
306
  location?: string | undefined;
306
307
  }[] | undefined;
307
- comments?: any;
308
308
  completedBy?: {
309
309
  id?: string | undefined;
310
310
  identifier?: string | undefined;
@@ -66,7 +66,7 @@ export declare const FieldsValidationSchema: z.ZodObject<{
66
66
  status: z.ZodEnum<["open", "closed"]>;
67
67
  detail: z.ZodOptional<z.ZodString>;
68
68
  }, "strip", z.ZodTypeAny, {
69
- status: "open" | "closed";
69
+ status: "closed" | "open";
70
70
  definition_id: string;
71
71
  patient_id: string;
72
72
  practice_id: string;
@@ -74,7 +74,7 @@ export declare const FieldsValidationSchema: z.ZodObject<{
74
74
  quality_program: string;
75
75
  detail?: string | undefined;
76
76
  }, {
77
- status: "open" | "closed";
77
+ status: "closed" | "open";
78
78
  definition_id: string;
79
79
  patient_id: string;
80
80
  practice_id: string;
@@ -11,7 +11,7 @@ const addEventLog_1 = require("../../../../src/lib/awell/addEventLog");
11
11
  exports.updatePatientTags = {
12
12
  key: 'updatePatientTags',
13
13
  category: extensions_core_1.Category.EHR_INTEGRATIONS,
14
- title: 'Update patient tags',
14
+ title: '🪄 Update patient tags',
15
15
  description: 'Update patient tags in Elation.',
16
16
  fields: config_1.fields,
17
17
  previewable: false,
@@ -35,19 +35,18 @@ exports.updatePatientTags = {
35
35
  });
36
36
  return;
37
37
  }
38
- try {
39
- const { tags } = await api.getPatient(patientId);
40
- const existingTags = tags !== null && tags !== void 0 ? tags : [];
41
- const ChatModelGPT4o = new openai_1.ChatOpenAI({
42
- modelName: 'gpt-4o',
43
- openAIApiKey: openAiApiKey,
44
- temperature: 0,
45
- maxRetries: 3,
46
- timeout: 10000,
47
- });
48
- const systemPrompt = `You are a helpful assistant. You will receive a list of patient tags and an instruction in natural language about which tags to add, update, or remove. Your output should always be the updated list of tags (as an array). An empty array is also a valid output.
49
-
50
- Important Instructions:
38
+ const { tags } = await api.getPatient(patientId);
39
+ const existingTags = tags !== null && tags !== void 0 ? tags : [];
40
+ const ChatModelGPT4o = new openai_1.ChatOpenAI({
41
+ modelName: 'gpt-4o-2024-08-06',
42
+ openAIApiKey: openAiApiKey,
43
+ temperature: 0,
44
+ maxRetries: 3,
45
+ timeout: 10000,
46
+ });
47
+ const systemPrompt = `You are a clinical data manager. You will receive a list (array) of patient tags for a single patient and instructions about which tags to add, update, or remove. These tags are used to assign particular attributes to patients which can help with patient care, like grouping of patients, categorizing patients for reporting, or identifying patients for care.
48
+
49
+ Important instructions:
51
50
  - The maximum number of tags is 10.
52
51
  - The max length of a single tag is 100 characters.
53
52
  - Ensure tags are unique.
@@ -56,43 +55,45 @@ Input array: ${JSON.stringify(existingTags)}
56
55
  Instruction: ${prompt}
57
56
 
58
57
  Output a JSON object with two keys:
59
- 1. updatedTags: The updated array of tags
58
+ 1. updatedTags: The updated array of tags. If the input array is empty, the output should be an empty array.
60
59
  2. explanation: A readable explanation of the changes made to the tags and why`;
61
- const parser = output_parsers_1.StructuredOutputParser.fromZodSchema(zod_1.z.object({
62
- updatedTags: zod_1.z.array(zod_1.z.string()),
63
- explanation: zod_1.z.string(),
64
- }));
60
+ const SingleTagSchema = zod_1.z.string().max(100).describe('A single tag');
61
+ const TagsSchema = zod_1.z
62
+ .array(SingleTagSchema)
63
+ .max(10)
64
+ .refine((items) => new Set(items).size === items.length, {
65
+ message: 'All items must be unique, no duplicate values allowed',
66
+ })
67
+ .describe('The updated array of tags');
68
+ const parser = output_parsers_1.StructuredOutputParser.fromZodSchema(zod_1.z.object({
69
+ updatedTags: TagsSchema,
70
+ explanation: zod_1.z
71
+ .string()
72
+ .describe('A readable explanation of the changes made to the tags and why'),
73
+ }));
74
+ let result;
75
+ try {
65
76
  const chain = ChatModelGPT4o.pipe(parser);
66
- const result = await chain.invoke(systemPrompt);
67
- await api.updatePatient(patientId, {
68
- tags: result.updatedTags,
69
- });
70
- await onComplete({
71
- data_points: {
72
- updatedTags: result.updatedTags.join(', '),
73
- },
74
- events: [
75
- (0, addEventLog_1.addActivityEventLog)({
76
- message: `Previous patient tags: ${(existingTags === null || existingTags === void 0 ? void 0 : existingTags.length) > 0 ? existingTags === null || existingTags === void 0 ? void 0 : existingTags.join(', ') : 'No tags'}\nUpdated patient tags: ${result.updatedTags.join(', ')}\nExplanation: ${result.explanation}`,
77
- }),
78
- ],
79
- });
77
+ result = await chain.invoke(systemPrompt);
80
78
  }
81
- catch (error) {
82
- console.error(error);
83
- await onError({
84
- events: [
85
- {
86
- date: new Date().toISOString(),
87
- text: { en: 'Unable to update patient tags' },
88
- error: {
89
- category: 'SERVER_ERROR',
90
- message: 'Unable to update patient tags',
91
- },
92
- },
93
- ],
94
- });
79
+ catch (invokeError) {
80
+ console.error('Error invoking ChatModelGPT4o for updatePatientTags:', invokeError);
81
+ throw new Error('Failed to update patient tags.');
95
82
  }
83
+ const validatedTags = TagsSchema.parse(result.updatedTags);
84
+ await api.updatePatient(patientId, {
85
+ tags: validatedTags,
86
+ });
87
+ await onComplete({
88
+ data_points: {
89
+ updatedTags: validatedTags.join(', '),
90
+ },
91
+ events: [
92
+ (0, addEventLog_1.addActivityEventLog)({
93
+ message: `Previous patient tags: ${(existingTags === null || existingTags === void 0 ? void 0 : existingTags.length) > 0 ? existingTags === null || existingTags === void 0 ? void 0 : existingTags.join(', ') : 'No tags'}\nUpdated patient tags: ${validatedTags.join(', ')}\nExplanation: ${result.explanation}`,
94
+ }),
95
+ ],
96
+ });
96
97
  },
97
98
  };
98
99
  //# sourceMappingURL=updatePatientTags.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"updatePatientTags.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/updatePatientTags/updatePatientTags.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,yCAA4C;AAC5C,qCAAqE;AACrE,mEAAuE;AACvE,6BAAuB;AACvB,8CAA8C;AAC9C,uEAA2E;AAE9D,QAAA,iBAAiB,GAI1B;IACF,GAAG,EAAE,mBAAmB;IACxB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,iCAAiC;IAC9C,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,OAAO,EA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}
1
+ {"version":3,"file":"updatePatientTags.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/updatePatientTags/updatePatientTags.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,yCAA4C;AAC5C,qCAAqE;AACrE,mEAAuE;AACvE,6BAAuB;AACvB,8CAA8C;AAC9C,uEAA2E;AAE9D,QAAA,iBAAiB,GAI1B;IACF,GAAG,EAAE,mBAAmB;IACxB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,iCAAiC;IAC9C,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAiB,EAAE;QACjE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,+BAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC1E,MAAM,GAAG,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;QAE3C,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAA;QAElD,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,EAAE,EAAE,CAAC;YACtD,MAAM,OAAO,CAAC;gBACZ,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,6CAA6C,EAAE;wBAC3D,KAAK,EAAE;4BACL,QAAQ,EAAE,cAAc;4BACxB,OAAO,EAAE,6CAA6C;yBACvD;qBACF;iBACF;aACF,CAAC,CAAA;YACF,OAAM;QACR,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;QAChD,MAAM,YAAY,GAAG,IAAI,aAAJ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,gCAAgC,CAAC,CAAA;QACnD,CAAC;QAED,MAAM,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;QAE1D,MAAM,GAAG,CAAC,aAAa,CAAC,SAAS,EAAE;YACjC,IAAI,EAAE,aAAa;SACpB,CAAC,CAAA;QAEF,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,WAAW,EAAE,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;aACtC;YACD,MAAM,EAAE;gBACN,IAAA,iCAAmB,EAAC;oBAClB,OAAO,EAAE,0BAA0B,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,IAAG,CAAC,CAAC,CAAC,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,2BAA2B,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,MAAM,CAAC,WAAW,EAAE;iBAC5L,CAAC;aACH;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -11,7 +11,7 @@ export declare const careGapSchema: z.ZodObject<{
11
11
  id: z.ZodString;
12
12
  quality_program: z.ZodString;
13
13
  }, "strip", z.ZodTypeAny, {
14
- status: "open" | "closed";
14
+ status: "closed" | "open";
15
15
  id: string;
16
16
  definition_id: string;
17
17
  patient_id: string;
@@ -22,7 +22,7 @@ export declare const careGapSchema: z.ZodObject<{
22
22
  closed_date?: string | undefined;
23
23
  closed_by?: "API" | "condition-saved" | "feedback" | undefined;
24
24
  }, {
25
- status: "open" | "closed";
25
+ status: "closed" | "open";
26
26
  id: string;
27
27
  definition_id: string;
28
28
  patient_id: string;
@@ -13,17 +13,17 @@ export declare const resolutionSchema: z.ZodObject<{
13
13
  }, "strip", z.ZodTypeAny, {
14
14
  id: number;
15
15
  state: "cancelled" | "outstanding" | "fulfilled";
16
+ document: number;
16
17
  note: string | null;
17
18
  created_date: string;
18
- document: number;
19
19
  resolving_document: number | null;
20
20
  deleted_date: string | null;
21
21
  }, {
22
22
  id: number;
23
23
  state: "cancelled" | "outstanding" | "fulfilled";
24
+ document: number;
24
25
  note: string | null;
25
26
  created_date: string;
26
- document: number;
27
27
  resolving_document: number | null;
28
28
  deleted_date: string | null;
29
29
  }>;
@@ -48,17 +48,17 @@ export declare const referralOrderSchema: z.ZodObject<{
48
48
  }, "strip", z.ZodTypeAny, {
49
49
  id: number;
50
50
  state: "cancelled" | "outstanding" | "fulfilled";
51
+ document: number;
51
52
  note: string | null;
52
53
  created_date: string;
53
- document: number;
54
54
  resolving_document: number | null;
55
55
  deleted_date: string | null;
56
56
  }, {
57
57
  id: number;
58
58
  state: "cancelled" | "outstanding" | "fulfilled";
59
+ document: number;
59
60
  note: string | null;
60
61
  created_date: string;
61
- document: number;
62
62
  resolving_document: number | null;
63
63
  deleted_date: string | null;
64
64
  }>;
@@ -93,9 +93,9 @@ export declare const referralOrderSchema: z.ZodObject<{
93
93
  resolution: {
94
94
  id: number;
95
95
  state: "cancelled" | "outstanding" | "fulfilled";
96
+ document: number;
96
97
  note: string | null;
97
98
  created_date: string;
98
- document: number;
99
99
  resolving_document: number | null;
100
100
  deleted_date: string | null;
101
101
  };
@@ -118,9 +118,9 @@ export declare const referralOrderSchema: z.ZodObject<{
118
118
  resolution: {
119
119
  id: number;
120
120
  state: "cancelled" | "outstanding" | "fulfilled";
121
+ document: number;
121
122
  note: string | null;
122
123
  created_date: string;
123
- document: number;
124
124
  resolving_document: number | null;
125
125
  deleted_date: string | null;
126
126
  };
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.extensions = exports.markdown = void 0;
37
37
  const athenahealth_1 = require("./athenahealth");
38
38
  const awell_1 = require("./awell");
39
+ const awellTasks_1 = require("./awellTasks");
39
40
  const bland_1 = require("./bland");
40
41
  const calDotCom_1 = require("./calDotCom");
41
42
  const calendly_1 = require("./calendly");
@@ -85,6 +86,7 @@ exports.extensions = [
85
86
  bland_1.bland,
86
87
  athenahealth_1.athenahealth,
87
88
  awell_1.Awell,
89
+ awellTasks_1.awellTasks,
88
90
  calDotCom_1.CalDotCom,
89
91
  calendly_1.Calendly,
90
92
  canvasMedical_1.CanvasMedical,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA6C;AAC7C,mCAA+B;AAC/B,mCAA+B;AAC/B,2CAAuC;AACvC,yCAAqC;AACrC,mDAA+C;AAC/C,qCAAiC;AACjC,6CAAyC;AACzC,yCAAqC;AACrC,+CAA2C;AAC3C,6CAAyC;AACzC,yCAAqC;AACrC,+CAA2C;AAC3C,uCAAmC;AACnC,iCAA4B;AAC5B,iDAA6C;AAC7C,uDAAkD;AAClD,yCAAqC;AACrC,2CAAuC;AACvC,yCAAqC;AACrC,+CAA0C;AAC1C,uCAAmC;AACnC,iEAA6D;AAC7D,uCAAmC;AACnC,yCAAqC;AACrC,2CAAuC;AACvC,uCAAmC;AACnC,iCAAsC;AACtC,uCAAmC;AACnC,+CAA2C;AAC3C,2CAAuC;AACvC,+CAA2C;AAC3C,iCAA6B;AAC7B,yCAAqC;AACrC,6DAA+C;AAC/C,iCAA6B;AAC7B,qCAAiC;AACjC,qCAAiC;AACjC,yCAAqC;AACrC,yCAAqC;AACrC,2CAAuC;AACvC,qCAAiC;AACjC,uCAAmC;AACnC,yCAAqC;AACrC,uCAAmC;AAEnC,sDAAuC;AAG1B,QAAA,QAAQ,GAAa,IAAI,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,aAAK;IACL,2BAAY;IACZ,aAAK;IACL,qBAAS;IACT,mBAAQ;IACR,6BAAa;IACb,eAAM;IACN,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,iBAAO;IACP,WAAI;IACJ,2BAAY;IACZ,gCAAc;IACd,mBAAQ;IACR,qBAAS;IACT,mBAAQ;IACR,wBAAU;IACV,iBAAO;IACP,2CAAoB;IACpB,iBAAO;IACP,mBAAQ;IACR,qBAAS;IACT,iBAAO;IACP,oBAAa;IACb,yBAAW;IACX,iBAAO;IACP,qBAAS;IACT,yBAAW;IACX,WAAI;IACJ,mBAAQ;IACR,6BAAQ;IACR,WAAI;IACJ,eAAM;IACN,eAAM;IACN,mBAAQ;IACR,mBAAQ;IACR,qBAAS;IACT,eAAM;IACN,iBAAO;IACP,mBAAQ;IACR,iBAAO;CACR,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA6C;AAC7C,mCAA+B;AAC/B,6CAAyC;AACzC,mCAA+B;AAC/B,2CAAuC;AACvC,yCAAqC;AACrC,mDAA+C;AAC/C,qCAAiC;AACjC,6CAAyC;AACzC,yCAAqC;AACrC,+CAA2C;AAC3C,6CAAyC;AACzC,yCAAqC;AACrC,+CAA2C;AAC3C,uCAAmC;AACnC,iCAA6B;AAC7B,iDAA6C;AAC7C,uDAAkD;AAClD,yCAAqC;AACrC,2CAAuC;AACvC,yCAAqC;AACrC,+CAA0C;AAC1C,uCAAmC;AACnC,iEAA6D;AAC7D,uCAAmC;AACnC,yCAAqC;AACrC,2CAAuC;AACvC,uCAAmC;AACnC,iCAAsC;AACtC,uCAAmC;AACnC,+CAA2C;AAC3C,2CAAuC;AACvC,+CAA2C;AAC3C,iCAA6B;AAC7B,yCAAqC;AACrC,6DAA+C;AAC/C,iCAA6B;AAC7B,qCAAiC;AACjC,qCAAiC;AACjC,yCAAqC;AACrC,yCAAqC;AACrC,2CAAuC;AACvC,qCAAiC;AACjC,uCAAmC;AACnC,yCAAqC;AACrC,uCAAmC;AAEnC,sDAAuC;AAG1B,QAAA,QAAQ,GAAa,IAAI,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,aAAK;IACL,2BAAY;IACZ,aAAK;IACL,uBAAU;IACV,qBAAS;IACT,mBAAQ;IACR,6BAAa;IACb,eAAM;IACN,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,iBAAO;IACP,WAAI;IACJ,2BAAY;IACZ,gCAAc;IACd,mBAAQ;IACR,qBAAS;IACT,mBAAQ;IACR,wBAAU;IACV,iBAAO;IACP,2CAAoB;IACpB,iBAAO;IACP,mBAAQ;IACR,qBAAS;IACT,iBAAO;IACP,oBAAa;IACb,yBAAW;IACX,iBAAO;IACP,qBAAS;IACT,yBAAW;IACX,WAAI;IACJ,mBAAQ;IACR,6BAAQ;IACR,WAAI;IACJ,eAAM;IACN,eAAM;IACN,mBAAQ;IACR,mBAAQ;IACR,qBAAS;IACT,eAAM;IACN,iBAAO;IACP,mBAAQ;IACR,iBAAO;CACR,CAAA"}
@@ -30,11 +30,11 @@ export declare const FieldsValidationSchema: z.ZodObject<{
30
30
  to: z.ZodString;
31
31
  text: z.ZodString;
32
32
  }, "strip", z.ZodTypeAny, {
33
- to: string;
34
33
  text: string;
34
+ to: string;
35
35
  from?: string | undefined;
36
36
  }, {
37
- to: string;
38
37
  text: string;
38
+ to: string;
39
39
  from?: string | undefined;
40
40
  }>;
@@ -7,6 +7,10 @@
7
7
  "readme": "---\ntitle: Awell Workflow\ndescription: Enrich your care flows with powerful Awell actions.\n---\n\n# Awell API extension\n\n## Extension settings\n\nYou will need to provide the [API URL](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/endpoints) and an [API key](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/authorization).\n\n## Custom Actions\n\n### Start care flow\n\nStarts a new care flow for the patient enrolled in your current care flow.\n\n**Passing baseline info:**\nPlease read the documentation on [our developer hub](https://developers.awellhealth.com/awell-orchestration/api-reference/mutations/start-pathway) to learn more about how to pass baseline info.\n\n**Example of how to configure a value for the baseline info action field:**\n\n```json\n[\n {\n \"data_point_definition_id\": \"age\",\n \"value\": \"29\"\n },\n {\n \"data_point_definition_id\": \"dob\",\n \"value\": \"1993-11-30\"\n }\n]\n```\n\n### Stop care flow\n\nStops the care flow the patient is currently enrolled in. A reason is why you are stopping the care flow is mandatory.\n\n### Update patient\n\nAllows updating patient data for the patient currently enrolled in the care flow.\n\n### Is patient already enrolled in care flow\n\nChecks whether the patient is already enrolled in a care flow definition. The care flow the patient is currently enrolled in does not count and is excluded from the results.\n\n**Action fields:**\n\n- pathwayStatus: a comma-separated string of care flow statuses that will be used when looking for care flows the patient is already enrolled in. By default, we only look at active care flows. Options: \"active\", \"completed\", \"missing_baseline_info\", \"starting\", and \"stopped\".\n- careFlowDefinitionIds: a comma-separated string of care flow definition ids that will be used when looking for care flows the patient is already enrolled in. By default, we only search for care flows that match the current care flow definition id (i.e. is the patient already included in the current care flow?).\n\n**Data points:**\n\n- result: a boolean indicating whether the patient is already enrolled in another care flow that matches your criteria (status & care flow definition id)\n- nbrOfResults: the number of care flows found for the patient that match the criteria.\n- careFlowIds: a comma-separated string of care flow ids that matched your search criteria. It will be empty when the result is `false` because then there are no other care flow ids that match your criteria.\n\n### Search patients by patient code\n\nNote that this action is deprecated and we recommend using [identifiers](https://developers.awellhealth.com/awell-orchestration/docs/misc/patient-identifiers) instead.\n\nSearch whether, apart from the patient currently enrolled in the care flow, another patient with the same `patient_code` already exists.\n\n**Data points:**\n\n1. patientAlreadyExists: a boolean which will be true if minimum one patient with the patient code already exists.\n2. numberOfPatientsFound: the number of patients found with the same patient code.\n3. awellPatientIds: a comma-separated string of all Awell patient ids (except the current patient) that have the same patient code as the patient currently enrolled in the care flow. Will return an empty string when there are no other patients with the same patient code.\n\n### Get patient by identifier\n\nThis action lets you check if a patient with a specific identifier already exists in Awell. It's particularly useful when a patient's identity is initially anonymous during the start of the care flow, but later becomes identifiable through the identifiers collected during the care flow. This check ensures whether a patient with that identifier is already present or not.\n\n### Add identifier to patient\n\nThis action allows you to add a unique identifier to the current patient's profile. If the patient already has an identifier with the same system but a different value, this action will update the existing identifier with the new value provided. \n\nFirst, it checks if this identifier (system and value) is already associated with another patient. If it's safe to proceed, it will add or update the identifier as needed. However, if another patient already has this identifier, the action will stop and notify you, preventing duplicates. To avoid conflicts, we recommend first running the \"Get patient by identifier\" action to check for any existing matches.\n\n## Webhooks\n\nWebhooks in the Awell extension offer ways to trigger a care flow based on the end of another care flow, or from any event that happens in your system (via the pathwayStart webhook).\n",
8
8
  "changelog": "# Awell changelog\n\n## April 2024\n\nTwo new action were added: \"Get patient by identifier\" and \"Add identifier to patient\".\n\n## October 26, 2023\n\nGeneric webhook to start a care flow added\n\n## April 19, 2023\n\nStop care flow action added.\nSearch patients by patient code action was added.\n\"Is patient enrolled in care flow\" action added.\n"
9
9
  },
10
+ "awellTasks": {
11
+ "readme": "---\ntitle: Awell Tasks\ndescription: Awell Tasks is an extension that allows communication with the Task Service module.\n---\n\n# Awell Tasks\n\nAwell Tasks is an extension that allows communication with the Task Service module.\n",
12
+ "changelog": "# CHANGELOG"
13
+ },
10
14
  "bland": {
11
15
  "readme": "---\ntitle: Bland.ai\ndescription: To do\n---\n\n# Bland.ai\n\nWith Bland.ai you can build, test, and deploy AI phone calling agents. \n\n## Extension settings\n\nTo set up this extension, you will need to provide an API key for Bland.\n\n## Actions\n\n### Send call (with Pathway)\n\nSend an AI phone call using a simple prompt or a conversational pathway agent you've built in the Bland platform. **The action is completed when Awell receives a callback from the Bland platform.**\n\nAwell lets you specify both the data you want to send to Bland and the structured data you’d like to receive in return. This is achieved by defining the request data for outgoing information and an analysis schema for the structured data you’ll get back.\n\n#### Request data\n\nAny JSON you put in here will be visible to the AI agent during the call - and can also be referenced with Prompt Variables.\n\nFor example, let’s say in the action you want to programmatically set the name of the person you’re calling. You could set request data to:\n\n```json\n{\n \"name\": \"John Doe\",\n}\n```\n\n[Also see Bland documentation.](https://docs.bland.ai/api-v1/post/calls)\n\n#### Analysis schema\n\nDefine a JSON schema for how you want to get information about the call - information like email addresses, names, appointment times or any other type of custom data.\n\nFor example, if you wanted to retrieve this information from the call:\n\n```json\n{\n \"email_address\": \"email\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"wants_to_book_appointment\": \"boolean\",\n \"appointment_time\": \"YYYY-MM-DD HH:MM:SS\"\n}\n```\n\nWhen retrieving the call details, Bland will return data about the call in the following format:\n\n```json\n{\n \"analysis\": {\n \"email_address\": \"johndoe@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"wants_to_book_appointment\": true,\n \"appointment_time\": \"2024-01-01 12:00:00\"\n }\n}\n```\n\n[Also see Bland documentation.](https://docs.bland.ai/api-v1/post/calls)\n\n\n\n### Get call details\n\nRetrieve the details of a call based on the provider call ID.",
12
16
  "changelog": "# CHANGELOG"
@@ -19,8 +19,8 @@ declare const PostSchema: z.ZodObject<{
19
19
  uuid: z.ZodString;
20
20
  }, "strip", z.ZodTypeAny, {
21
21
  body: string;
22
- uuid: string;
23
22
  created_at: number;
23
+ uuid: string;
24
24
  creator: {
25
25
  type: string;
26
26
  name: string;
@@ -29,8 +29,8 @@ declare const PostSchema: z.ZodObject<{
29
29
  conversation_uuid: string;
30
30
  }, {
31
31
  body: string;
32
- uuid: string;
33
32
  created_at: number;
33
+ uuid: string;
34
34
  creator: {
35
35
  type: string;
36
36
  name: string;
@@ -59,8 +59,8 @@ export declare const GetMessagesSchema: z.ZodObject<{
59
59
  uuid: z.ZodString;
60
60
  }, "strip", z.ZodTypeAny, {
61
61
  body: string;
62
- uuid: string;
63
62
  created_at: number;
63
+ uuid: string;
64
64
  creator: {
65
65
  type: string;
66
66
  name: string;
@@ -69,8 +69,8 @@ export declare const GetMessagesSchema: z.ZodObject<{
69
69
  conversation_uuid: string;
70
70
  }, {
71
71
  body: string;
72
- uuid: string;
73
72
  created_at: number;
73
+ uuid: string;
74
74
  creator: {
75
75
  type: string;
76
76
  name: string;
@@ -81,8 +81,8 @@ export declare const GetMessagesSchema: z.ZodObject<{
81
81
  }, "strip", z.ZodTypeAny, {
82
82
  posts?: {
83
83
  body: string;
84
- uuid: string;
85
84
  created_at: number;
85
+ uuid: string;
86
86
  creator: {
87
87
  type: string;
88
88
  name: string;
@@ -93,8 +93,8 @@ export declare const GetMessagesSchema: z.ZodObject<{
93
93
  }, {
94
94
  posts?: {
95
95
  body: string;
96
- uuid: string;
97
96
  created_at: number;
97
+ uuid: string;
98
98
  creator: {
99
99
  type: string;
100
100
  name: string;
@@ -124,8 +124,8 @@ declare const SendMessageResponseSchema: z.ZodObject<{
124
124
  uuid: z.ZodString;
125
125
  }, "strip", z.ZodTypeAny, {
126
126
  body: string;
127
- uuid: string;
128
127
  created_at: number;
128
+ uuid: string;
129
129
  creator: {
130
130
  type: string;
131
131
  name: string;
@@ -134,8 +134,8 @@ declare const SendMessageResponseSchema: z.ZodObject<{
134
134
  conversation_uuid: string;
135
135
  }, {
136
136
  body: string;
137
- uuid: string;
138
137
  created_at: number;
138
+ uuid: string;
139
139
  creator: {
140
140
  type: string;
141
141
  name: string;
@@ -146,8 +146,8 @@ declare const SendMessageResponseSchema: z.ZodObject<{
146
146
  }, "strip", z.ZodTypeAny, {
147
147
  post: {
148
148
  body: string;
149
- uuid: string;
150
149
  created_at: number;
150
+ uuid: string;
151
151
  creator: {
152
152
  type: string;
153
153
  name: string;
@@ -158,8 +158,8 @@ declare const SendMessageResponseSchema: z.ZodObject<{
158
158
  }, {
159
159
  post: {
160
160
  body: string;
161
- uuid: string;
162
161
  created_at: number;
162
+ uuid: string;
163
163
  creator: {
164
164
  type: string;
165
165
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "2.0.130",
3
+ "version": "2.0.132",
4
4
  "packageManager": "yarn@4.5.3",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {
@@ -43,6 +43,7 @@
43
43
  "@types/docusign-esign": "^5.19.0",
44
44
  "@types/express": "^4.17.19",
45
45
  "@types/jest": "^29.5.14",
46
+ "@types/jsdom": "^21.1.7",
46
47
  "@types/jsonpath": "^0.2.4",
47
48
  "@types/lodash": "^4.17.7",
48
49
  "@types/mailchimp__mailchimp_transactional": "^1.0.5",
@@ -102,6 +103,7 @@
102
103
  "graphql": "^16.8.1",
103
104
  "graphql-request": "5.1.0",
104
105
  "graphql-tag": "^2.12.6",
106
+ "jsdom": "^26.0.0",
105
107
  "jsonpath": "^1.1.1",
106
108
  "langchain": "^0.3.2",
107
109
  "libphonenumber-js": "^1.10.26",