@awell-health/awell-extensions 2.0.207 → 2.0.209
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/extensions/markdown.json +1 -1
- package/dist/extensions/shelly/actions/index.d.ts +8 -1
- package/dist/extensions/shelly/actions/summarizeForm/config/fields.d.ts +10 -0
- package/dist/extensions/shelly/actions/summarizeForm/config/fields.js +8 -2
- package/dist/extensions/shelly/actions/summarizeForm/config/fields.js.map +1 -1
- package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.js +21 -4
- package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.js.map +1 -1
- package/dist/extensions/shelly/actions/summarizeTrackOutcome/config/fields.d.ts +1 -1
- package/dist/extensions/shelly/actions/summarizeTrackOutcome/config/fields.js +1 -1
- package/dist/extensions/shelly/actions/summarizeTrackOutcome/config/fields.js.map +1 -1
- package/dist/extensions/shelly/actions/summarizeTrackOutcome/lib/summarizeTrackOutcomeWithLLM/prompt.d.ts +1 -1
- package/dist/extensions/shelly/actions/summarizeTrackOutcome/lib/summarizeTrackOutcomeWithLLM/prompt.js +10 -2
- package/dist/extensions/shelly/actions/summarizeTrackOutcome/lib/summarizeTrackOutcomeWithLLM/prompt.js.map +1 -1
- package/dist/extensions/shelly/actions/summarizeTrackOutcome/summarizeTrackOutcome.js +1 -4
- package/dist/extensions/shelly/actions/summarizeTrackOutcome/summarizeTrackOutcome.js.map +1 -1
- package/dist/extensions/shelly/lib/getFormResponseText/getFormResponseText.js +6 -6
- package/dist/extensions/shelly/lib/getFormResponseText/getFormResponseText.js.map +1 -1
- package/dist/extensions/shelly/lib/getTrackData/getTrackData.js +17 -38
- package/dist/extensions/shelly/lib/getTrackData/getTrackData.js.map +1 -1
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/prompt.d.ts +2 -2
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/prompt.js +6 -0
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/prompt.js.map +1 -1
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/summarizeFormWithLLM.d.ts +3 -1
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/summarizeFormWithLLM.js +3 -1
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/summarizeFormWithLLM.js.map +1 -1
- package/package.json +1 -1
@@ -152,7 +152,7 @@
|
|
152
152
|
"changelog": "# Salesforce changelog"
|
153
153
|
},
|
154
154
|
"shelly": {
|
155
|
-
"readme": "---\ntitle: Shelly\ndescription: Library of AI-powered actions\n---\n\n# Shelly\n\nShelly is a library of AI-powered actions for enhancing workflow automation and data processing. It
|
155
|
+
"readme": "---\ntitle: Shelly\ndescription: Library of AI-powered actions\n---\n\n# Shelly\n\nShelly is a library of AI-powered actions for enhancing workflow automation and data processing. It leverages advanced language models and specialized APIs to provide intelligent automation capabilities.\n\n## Actions\n\n### Categorize Message\nUses AI to classify messages into predefined categories.\n\n- Analyzes message content using LLM\n- Matches against provided categories\n- Provides explanation for the categorization\n\nFeatures:\n- Supports custom category lists\n- Handles multiple languages\n- Returns \"None\" if no category matches\n- Includes detailed explanation of the classification\n\n### Generate Message\nCreates personalized messages using AI.\n\n- Takes communication objective and context\n- Generates appropriate message content\n- Formats according to stakeholder needs\n\nFeatures:\n- Customizable tone and style\n- Multi-language support\n- Personalization based on recipient data\n- Context-aware message generation\n\n### Medication From Image\nExtracts structured medication information from images.\n\n- Processes uploaded medication images\n- Uses specialized API for text extraction\n- Returns structured medication data\n\nFeatures:\n- Extracts medication names, dosages, and instructions\n- Supports various image formats\n- Returns both structured data and text summary\n- Includes error handling for unclear images\n\n### Review Medication Extraction\nAllows stakeholders to review and validate extracted medication information.\n\n- Displays extracted medication data\n- Provides interface for validation\n- Captures reviewer feedback\n\nFeatures:\n- Side-by-side image and data comparison\n- Validation workflow\n- Support for corrections and annotations\n\n### Summarize Care Flow\nProvides an AI-generated summary of the entire care flow progress.\n\n- Collects all relevant care flow data\n- Analyzes activities and outcomes\n- Generates a comprehensive summary\n\nFeatures:\n- Customizable for different stakeholders (e.g., clinicians, patients)\n- Optional focus areas through additional instructions\n- Includes relevant context and disclaimers\n\n### Summarize Form\nUses AI to generate concise summaries of form responses.\n\n- Retrieves the latest form data from the current step\n- Processes form responses with an LLM\n- Generates a structured summary in the specified format\n\nFeatures:\n- Supports bullet-point or paragraph format\n- Customizable language selection\n- Optional additional instructions for focused summaries\n- Includes context-aware disclaimers\n\n### Summarize Forms in Step\nSimilar to summarizeForm but processes all forms within a step.\n\nFeatures:\n- Combines data from multiple forms\n- Maintains context between form responses\n- Same formatting options as single form summaries\n\n### Summarize Track Outcome\nGenerates comprehensive summaries of track activities and outcomes.\n\n- Analyzes track data and activities\n- Identifies key outcomes and decisions\n- Creates structured summary\n\nFeatures:\n- Customizable focus areas\n- Support for specific outcome analysis\n- Flexible formatting options\n- Context-aware summaries",
|
156
156
|
"changelog": "# Shelly changelog"
|
157
157
|
},
|
158
158
|
"stripe": {
|
@@ -107,6 +107,13 @@ declare const actions: {
|
|
107
107
|
type: import("@awell-health/extensions-core").FieldType.STRING;
|
108
108
|
required: false;
|
109
109
|
};
|
110
|
+
additionalInstructions: {
|
111
|
+
id: string;
|
112
|
+
label: string;
|
113
|
+
description: string;
|
114
|
+
type: import("@awell-health/extensions-core").FieldType.TEXT;
|
115
|
+
required: false;
|
116
|
+
};
|
110
117
|
}, Record<string, never>, "summary">;
|
111
118
|
summarizeFormsInStep: import("@awell-health/extensions-core").Action<{
|
112
119
|
summaryFormat: {
|
@@ -129,7 +136,7 @@ declare const actions: {
|
|
129
136
|
id: string;
|
130
137
|
label: string;
|
131
138
|
description: string;
|
132
|
-
type: import("@awell-health/extensions-core").FieldType.
|
139
|
+
type: import("@awell-health/extensions-core").FieldType.TEXT;
|
133
140
|
required: false;
|
134
141
|
};
|
135
142
|
}, Record<string, never>, "outcomeSummary">;
|
@@ -25,14 +25,24 @@ export declare const fields: {
|
|
25
25
|
type: FieldType.STRING;
|
26
26
|
required: false;
|
27
27
|
};
|
28
|
+
additionalInstructions: {
|
29
|
+
id: string;
|
30
|
+
label: string;
|
31
|
+
description: string;
|
32
|
+
type: FieldType.TEXT;
|
33
|
+
required: false;
|
34
|
+
};
|
28
35
|
};
|
29
36
|
export declare const FieldsValidationSchema: z.ZodObject<{
|
30
37
|
summaryFormat: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodEnum<[SummaryFormatEnum.BULLET_POINTS, SummaryFormatEnum.TEXT_PARAGRAPH]>>>, SummaryFormatEnum, SummaryFormatEnum | undefined>;
|
31
38
|
language: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
39
|
+
additionalInstructions: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
32
40
|
}, "strip", z.ZodTypeAny, {
|
33
41
|
language: string;
|
42
|
+
additionalInstructions: string;
|
34
43
|
summaryFormat: SummaryFormatEnum;
|
35
44
|
}, {
|
36
45
|
language?: string | undefined;
|
46
|
+
additionalInstructions?: string | undefined;
|
37
47
|
summaryFormat?: SummaryFormatEnum | undefined;
|
38
48
|
}>;
|
@@ -6,13 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FieldsValidationSchema = exports.fields = exports.SummaryFormatEnum = void 0;
|
7
7
|
const extensions_core_1 = require("@awell-health/extensions-core");
|
8
8
|
const zod_1 = __importDefault(require("zod"));
|
9
|
-
// Step 1: Define the enum
|
10
9
|
var SummaryFormatEnum;
|
11
10
|
(function (SummaryFormatEnum) {
|
12
11
|
SummaryFormatEnum["BULLET_POINTS"] = "Bullet-points";
|
13
12
|
SummaryFormatEnum["TEXT_PARAGRAPH"] = "Text paragraph";
|
14
13
|
})(SummaryFormatEnum || (exports.SummaryFormatEnum = SummaryFormatEnum = {}));
|
15
|
-
// Step 2: Define the fields object
|
16
14
|
exports.fields = {
|
17
15
|
summaryFormat: {
|
18
16
|
id: 'summaryFormat',
|
@@ -34,6 +32,13 @@ exports.fields = {
|
|
34
32
|
type: extensions_core_1.FieldType.STRING,
|
35
33
|
required: false,
|
36
34
|
},
|
35
|
+
additionalInstructions: {
|
36
|
+
id: 'additionalInstructions',
|
37
|
+
label: 'Additional Instructions',
|
38
|
+
description: '[Optional] Specify additional instructions for the AI to generate the form summary. You can include details about: specific questions to focus on, desired level of detail, information to emphasize or exclude, etc.',
|
39
|
+
type: extensions_core_1.FieldType.TEXT,
|
40
|
+
required: false,
|
41
|
+
},
|
37
42
|
};
|
38
43
|
// Step 3: Define the validation schema using zod
|
39
44
|
exports.FieldsValidationSchema = zod_1.default.object({
|
@@ -45,5 +50,6 @@ exports.FieldsValidationSchema = zod_1.default.object({
|
|
45
50
|
? value
|
46
51
|
: SummaryFormatEnum.BULLET_POINTS),
|
47
52
|
language: zod_1.default.string().optional().default('Default'),
|
53
|
+
additionalInstructions: zod_1.default.string().optional().default('No additional instructions'),
|
48
54
|
});
|
49
55
|
//# sourceMappingURL=fields.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/shelly/actions/summarizeForm/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AAExC,
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/shelly/actions/summarizeForm/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AAExC,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oDAA+B,CAAA;IAC/B,sDAAiC,CAAA;AACnC,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAEY,QAAA,MAAM,GAAG;IACpB,aAAa,EAAE;QACb,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,+GAA+G;QACjH,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE;YACP,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBACjE,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,MAAM;aACd,CAAC,CAAC;SACJ;KACF;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,UAAU;QACjB,WAAW,EACT,iFAAiF;QACnF,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,sBAAsB,EAAE;QACtB,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE,yBAAyB;QAChC,WAAW,EACT,uNAAuN;QACzN,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEjC,iDAAiD;AACpC,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,aAAa,EAAE,aAAC;SACb,IAAI,CAAC,CAAC,iBAAiB,CAAC,aAAa,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;SACzE,QAAQ,EAAE;SACV,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAC;SACxC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CACnB,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,KAA0B,CAAC;QACnE,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,iBAAiB,CAAC,aAAa,CACpC;IACH,QAAQ,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC;IAClD,sBAAsB,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,4BAA4B,CAAC;CAClC,CAAC,CAAA"}
|
@@ -9,7 +9,6 @@ const config_1 = require("./config");
|
|
9
9
|
const getFormResponseText_1 = require("../../lib/getFormResponseText");
|
10
10
|
const awell_1 = require("../../../../src/lib/awell");
|
11
11
|
const utils_1 = require("../../../../src/utils");
|
12
|
-
const constants_2 = require("../../lib/constants");
|
13
12
|
/**
|
14
13
|
* Awell Action: Form Summarization
|
15
14
|
*
|
@@ -28,8 +27,9 @@ exports.summarizeForm = {
|
|
28
27
|
previewable: false,
|
29
28
|
dataPoints: config_1.dataPoints,
|
30
29
|
onEvent: async ({ payload, onComplete, onError, helpers }) => {
|
30
|
+
var _a, _b, _c, _d, _e, _f;
|
31
31
|
// 1. Validate input fields
|
32
|
-
const { summaryFormat, language } = config_1.FieldsValidationSchema.parse(payload.fields);
|
32
|
+
const { summaryFormat, language, additionalInstructions } = config_1.FieldsValidationSchema.parse(payload.fields);
|
33
33
|
// 2. Initialize OpenAI model with metadata
|
34
34
|
const { model, metadata, callbacks } = await (0, createOpenAIModel_1.createOpenAIModel)({
|
35
35
|
settings: {}, // we use built-in API key for OpenAI
|
@@ -38,9 +38,25 @@ exports.summarizeForm = {
|
|
38
38
|
modelType: constants_1.OPENAI_MODELS.GPT4o,
|
39
39
|
hideDataForTracing: true, // Hide input and output data when tracing
|
40
40
|
});
|
41
|
+
const awellSdk = await helpers.awellSdk();
|
42
|
+
// Get pathway details for the disclaimer
|
43
|
+
const pathwayDetails = await awellSdk.orchestration.query({
|
44
|
+
pathway: {
|
45
|
+
__args: {
|
46
|
+
id: payload.pathway.id,
|
47
|
+
},
|
48
|
+
code: true,
|
49
|
+
success: true,
|
50
|
+
pathway: {
|
51
|
+
id: true,
|
52
|
+
title: true,
|
53
|
+
pathway_definition_id: true,
|
54
|
+
},
|
55
|
+
},
|
56
|
+
});
|
41
57
|
// 3. Get form data
|
42
58
|
const { formDefinition, formResponse } = await (0, awell_1.getLatestFormInCurrentStep)({
|
43
|
-
awellSdk
|
59
|
+
awellSdk,
|
44
60
|
pathwayId: payload.pathway.id,
|
45
61
|
activityId: payload.activity.id,
|
46
62
|
});
|
@@ -54,7 +70,8 @@ exports.summarizeForm = {
|
|
54
70
|
formData,
|
55
71
|
summaryFormat,
|
56
72
|
language,
|
57
|
-
disclaimerMessage:
|
73
|
+
disclaimerMessage: `Important Notice: The content provided is an AI-generated summary of form responses in Care Flow "${(_c = (_b = (_a = pathwayDetails.pathway) === null || _a === void 0 ? void 0 : _a.pathway) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : 'Unknown'}" (ID: ${(_f = (_e = (_d = pathwayDetails.pathway) === null || _d === void 0 ? void 0 : _d.pathway) === null || _e === void 0 ? void 0 : _e.pathway_definition_id) !== null && _f !== void 0 ? _f : 'Unknown'}).`,
|
74
|
+
additionalInstructions,
|
58
75
|
metadata,
|
59
76
|
callbacks,
|
60
77
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"summarizeForm.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/summarizeForm/summarizeForm.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,yEAAqE;AACrE,wFAAoF;AACpF,wEAAwE;AACxE,qCAAqE;AACrE,uEAAmE;AACnE,qDAAsE;AACtE,iDAAsD;
|
1
|
+
{"version":3,"file":"summarizeForm.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/summarizeForm/summarizeForm.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,yEAAqE;AACrE,wFAAoF;AACpF,wEAAwE;AACxE,qCAAqE;AACrE,uEAAmE;AACnE,qDAAsE;AACtE,iDAAsD;AAEtD;;;;;;;;GAQG;AACU,QAAA,aAAa,GAItB;IACF,GAAG,EAAE,eAAe;IACpB,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,0DAA0D;IACvE,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IAEV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAiB,EAAE;;QAC1E,2BAA2B;QAC3B,MAAM,EAA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,qGAAqG,MAAA,MAAA,MAAA,cAAc,CAAC,OAAO,0CAAE,OAAO,0CAAE,KAAK,mCAAI,SAAS,UAAU,MAAA,MAAA,MAAA,cAAc,CAAC,OAAO,0CAAE,OAAO,0CAAE,qBAAqB,mCAAI,SAAS,IAAI;YAC5P,sBAAsB;YACtB,QAAQ;YACR,SAAS;SACV,CAAC,CAAA;QAEF,+BAA+B;QAC/B,MAAM,WAAW,GAAG,MAAM,IAAA,sBAAc,EAAC,OAAO,CAAC,CAAA;QACjD,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,OAAO,EAAE,WAAW;aACrB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
@@ -11,7 +11,7 @@ exports.fields = {
|
|
11
11
|
id: 'instructions',
|
12
12
|
label: 'Instructions',
|
13
13
|
description: 'Specify instructions for the AI to generate the track outcome summary. You can include details about: what outcome to focus on, where to find it in the track, specific forms to analyze, desired length and format, parts of the track to exclude, level of detail for decision paths, etc.',
|
14
|
-
type: extensions_core_1.FieldType.
|
14
|
+
type: extensions_core_1.FieldType.TEXT,
|
15
15
|
required: false,
|
16
16
|
},
|
17
17
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/shelly/actions/summarizeTrackOutcome/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,8RAA8R;QAChS,IAAI,EAAE,2BAAS,CAAC,
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/shelly/actions/summarizeTrackOutcome/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,8RAA8R;QAChS,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,YAAY,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACE,CAAC,CAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { ChatPromptTemplate } from '@langchain/core/prompts';
|
2
|
-
export declare const systemPrompt: ChatPromptTemplate<import("@langchain/core/prompts").ParamsFromFString<"# Role\nYou are a specialized healthcare AI assistant tasked with analyzing and summarizing clinical care flow track outcomes and decision paths for healthcare professionals.\n\n# Context\nIn healthcare systems, a care flow represents a patient's journey through a clinical process:\n- Care flow: The overall clinical pathway designed to achieve or maintain a desired health state\n- Track: A specific phase of care that can run sequentially (e.g., Diagnosis > Treatment > Follow-up) or in parallel\n- Step: A container of actions that happen at a given moment for a specific patient group\n- Action: Individual elements within a step that stakeholders interact with (forms, messages) or system actions (calculations, API calls)\n- Stakeholder: Participants involved in the care flow (patients, clinicians, care coordinators, etc.)\n\n# Task\nYour task is to analyze the provided track data and generate a clear, concise summary of:\n1. The final outcome of the track\n2. The decision path and reasoning that led to this outcome\n3. Key activities and decision points that influenced the outcome\n\n# Input Data Structure\nYou will receive structured data containing:\n- Track information: title, status, start/end dates\n- Steps: sequential clinical stages with names, labels, and statuses\n- Activities: actions performed within steps, including:\n * Timestamps (when actions occurred)\n * Actors (who performed the actions - patients, clinicians, etc.)\n * Action types (forms, messages, system events)\n * Form responses (questions and answers)\n * Data points (clinical measurements, observations, form responses or other data collected in the track) \n\n# Let's take it step by step:\n1. First, carefully examine all track information to understand the clinical context\n2. Next, analyze the activities in chronological order to trace the decision path\n3. Identify key decision points and their outcomes\n4. Determine the final track outcome (e.g., approved, alternative treatment, pre-certification)\n5. Extract the logical reasoning that led to this outcome\n6. Organize findings into a coherent narrative\n7. Double check the output for accuracy and completeness. It is critical your reasoning is supported by the data and in line with final outcome.\n\n# Output Guidelines\nStructure your summary as follows:\n- Begin with a clear outcome statement\n- Follow with 3-5 bullet points explaining the supporting evidence and reasoning\n- Present information chronologically to show progression\n- Use clinical terminology appropriate for healthcare professionals\n- Maintain brevity while preserving critical details\n\n# Important Constraints\n- Focus primarily on what patients and human stakeholders have done in the track\n- Only include information explicitly present in the input data\n- Absolutely refrain from making clinical assumptions beyond what is provided in data\n- Exclude technical details like IDs, internal codes, or system language\n- NEVER use Awell-specific terminology in your summary (avoid terms like \"track\", \"step\", \"action\")\n- Always use proper markdown formatting with clear section headers
|
2
|
+
export declare const systemPrompt: ChatPromptTemplate<import("@langchain/core/prompts").ParamsFromFString<"# Role\nYou are a specialized healthcare AI assistant tasked with analyzing and summarizing clinical care flow track outcomes and decision paths for healthcare professionals.\n\n----------\n# Context\nIn healthcare systems, a care flow represents a patient's journey through a clinical process:\n- Care flow: The overall clinical pathway designed to achieve or maintain a desired health state\n- Track: A specific phase of care that can run sequentially (e.g., Diagnosis > Treatment > Follow-up) or in parallel\n- Step: A container of actions that happen at a given moment for a specific patient group\n- Action: Individual elements within a step that stakeholders interact with (forms, messages) or system actions (calculations, API calls)\n- Stakeholder: Participants involved in the care flow (patients, clinicians, care coordinators, etc.)\n\n----------\n# Task\nYour task is to analyze the provided track data and generate a clear, concise summary of:\n1. The final outcome of the track\n2. The decision path and reasoning that led to this outcome\n3. Key activities and decision points that influenced the outcome\n\n----------\n# Input Data Structure\nYou will receive structured data containing:\n- Track information: title, status, start/end dates\n- Steps: sequential clinical stages with names, labels, and statuses\n- Activities: actions performed within steps, including:\n * Timestamps (when actions occurred)\n * Actors (who performed the actions - patients, clinicians, etc.)\n * Action types (forms, messages, system events)\n * Form responses (questions and answers)\n * Data points (clinical measurements, observations, form responses or other data collected in the track) \n\n# Let's take it step by step:\n1. First, carefully examine all track information to understand the clinical context\n2. Next, analyze the activities in chronological order to trace the decision path\n3. Identify key decision points and their outcomes\n4. Determine the final track outcome (e.g., approved, alternative treatment, pre-certification)\n5. Extract the logical reasoning that led to this outcome\n6. Organize findings into a coherent narrative\n7. Double check the output for accuracy and completeness. It is critical your reasoning is supported by the data and in line with final outcome.\n\n----------\n# Output Guidelines\nStructure your summary as follows:\n- Begin with a clear outcome statement\n- Follow with 3-5 bullet points explaining the supporting evidence and reasoning\n- Present information chronologically to show progression\n- Use clinical terminology appropriate for healthcare professionals\n- Maintain brevity while preserving critical details\n\n# Important Constraints\n- Focus primarily on what patients and human stakeholders have done in the track\n- Only include information explicitly present in the input data\n- Absolutely refrain from making clinical assumptions beyond what is provided in data\n- Exclude technical details like IDs, internal codes, or system language\n- NEVER use Awell-specific terminology in your summary (avoid terms like \"track\", \"step\", \"action\")\n- Always use proper markdown formatting with clear section headers\n- Remember your audience is clinical - use language that healthcare professionals will understand. Keep it concise and to the point.\n- It is critical to keep Details supporting the outcome section concise and to the point. Write them in a paragraph format, unless otherwise specified in the instructions.\n\n----------\n# Example Output Format\n## Outcome: \nThe patient was approved for spinal surgery\n\n## Details supporting the outcome:\n- Patient reported severe back pain (8/10) with radiating symptoms and failed conservative treatment for 6 months, meeting criteria for surgical intervention\n- Imaging confirmed L4-L5 herniation with nerve compression, and insurance pre-authorization was obtained on 05/15/2023\n\n----------\nInstructions:\n{instructions}\n\n----------\nTrack Data:\n{input}">, any>;
|
@@ -6,6 +6,7 @@ const prompts_1 = require("@langchain/core/prompts");
|
|
6
6
|
exports.systemPrompt = prompts_1.ChatPromptTemplate.fromTemplate(`# Role
|
7
7
|
You are a specialized healthcare AI assistant tasked with analyzing and summarizing clinical care flow track outcomes and decision paths for healthcare professionals.
|
8
8
|
|
9
|
+
----------
|
9
10
|
# Context
|
10
11
|
In healthcare systems, a care flow represents a patient's journey through a clinical process:
|
11
12
|
- Care flow: The overall clinical pathway designed to achieve or maintain a desired health state
|
@@ -14,12 +15,14 @@ In healthcare systems, a care flow represents a patient's journey through a clin
|
|
14
15
|
- Action: Individual elements within a step that stakeholders interact with (forms, messages) or system actions (calculations, API calls)
|
15
16
|
- Stakeholder: Participants involved in the care flow (patients, clinicians, care coordinators, etc.)
|
16
17
|
|
18
|
+
----------
|
17
19
|
# Task
|
18
20
|
Your task is to analyze the provided track data and generate a clear, concise summary of:
|
19
21
|
1. The final outcome of the track
|
20
22
|
2. The decision path and reasoning that led to this outcome
|
21
23
|
3. Key activities and decision points that influenced the outcome
|
22
24
|
|
25
|
+
----------
|
23
26
|
# Input Data Structure
|
24
27
|
You will receive structured data containing:
|
25
28
|
- Track information: title, status, start/end dates
|
@@ -40,6 +43,7 @@ You will receive structured data containing:
|
|
40
43
|
6. Organize findings into a coherent narrative
|
41
44
|
7. Double check the output for accuracy and completeness. It is critical your reasoning is supported by the data and in line with final outcome.
|
42
45
|
|
46
|
+
----------
|
43
47
|
# Output Guidelines
|
44
48
|
Structure your summary as follows:
|
45
49
|
- Begin with a clear outcome statement
|
@@ -54,9 +58,11 @@ Structure your summary as follows:
|
|
54
58
|
- Absolutely refrain from making clinical assumptions beyond what is provided in data
|
55
59
|
- Exclude technical details like IDs, internal codes, or system language
|
56
60
|
- NEVER use Awell-specific terminology in your summary (avoid terms like "track", "step", "action")
|
57
|
-
- Always use proper markdown formatting with clear section headers
|
61
|
+
- Always use proper markdown formatting with clear section headers
|
58
62
|
- Remember your audience is clinical - use language that healthcare professionals will understand. Keep it concise and to the point.
|
59
|
-
- It is critical to keep Details supporting the outcome section concise and to the point.
|
63
|
+
- It is critical to keep Details supporting the outcome section concise and to the point. Write them in a paragraph format, unless otherwise specified in the instructions.
|
64
|
+
|
65
|
+
----------
|
60
66
|
# Example Output Format
|
61
67
|
## Outcome:
|
62
68
|
The patient was approved for spinal surgery
|
@@ -65,9 +71,11 @@ The patient was approved for spinal surgery
|
|
65
71
|
- Patient reported severe back pain (8/10) with radiating symptoms and failed conservative treatment for 6 months, meeting criteria for surgical intervention
|
66
72
|
- Imaging confirmed L4-L5 herniation with nerve compression, and insurance pre-authorization was obtained on 05/15/2023
|
67
73
|
|
74
|
+
----------
|
68
75
|
Instructions:
|
69
76
|
{instructions}
|
70
77
|
|
78
|
+
----------
|
71
79
|
Track Data:
|
72
80
|
{input}`);
|
73
81
|
//# sourceMappingURL=prompt.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../../../extensions/shelly/actions/summarizeTrackOutcome/lib/summarizeTrackOutcomeWithLLM/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAE5D,sEAAsE;AACzD,QAAA,YAAY,GAAG,4BAAkB,CAAC,YAAY,CACzD
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../../../extensions/shelly/actions/summarizeTrackOutcome/lib/summarizeTrackOutcomeWithLLM/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAE5D,sEAAsE;AACzD,QAAA,YAAY,GAAG,4BAAkB,CAAC,YAAY,CACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0EM,CACP,CAAA"}
|
@@ -62,10 +62,6 @@ exports.summarizeTrackOutcome = {
|
|
62
62
|
},
|
63
63
|
},
|
64
64
|
},
|
65
|
-
})
|
66
|
-
.catch((error) => {
|
67
|
-
console.error(`Failed to fetch activity ${activityId}`, error);
|
68
|
-
throw new Error(`Failed to fetch activity ${activityId}`);
|
69
65
|
});
|
70
66
|
const currentActivity = (_a = activityDetails === null || activityDetails === void 0 ? void 0 : activityDetails.activity) === null || _a === void 0 ? void 0 : _a.activity;
|
71
67
|
if ((0, lodash_1.isNil)(currentActivity) || !activityDetails.activity.success) {
|
@@ -82,6 +78,7 @@ exports.summarizeTrackOutcome = {
|
|
82
78
|
trackId,
|
83
79
|
currentActivityId: payload.activity.id,
|
84
80
|
});
|
81
|
+
// 4. Generate summary with LLM
|
85
82
|
const summary = await (0, summarizeTrackOutcomeWithLLM_1.summarizeTrackOutcomeWithLLM)({
|
86
83
|
model,
|
87
84
|
trackActivities: JSON.stringify(trackData, null, 2),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"summarizeTrackOutcome.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/summarizeTrackOutcome/summarizeTrackOutcome.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,iDAAsD;AACtD,qFAAiF;AACjF,2DAAkE;AAClE,wEAAwE;AACxE,wDAA2D;AAC3D,mCAA8B;AAEjB,QAAA,qBAAqB,GAI9B;IACF,GAAG,EAAE,uBAAuB;IAC5B,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,gCAAgC;IACvC,WAAW,EAAE,8EAA8E;IAC3F,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IAEV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAiB,EAAE;;
|
1
|
+
{"version":3,"file":"summarizeTrackOutcome.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/summarizeTrackOutcome/summarizeTrackOutcome.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,iDAAsD;AACtD,qFAAiF;AACjF,2DAAkE;AAClE,wEAAwE;AACxE,wDAA2D;AAC3D,mCAA8B;AAEjB,QAAA,qBAAqB,GAI9B;IACF,GAAG,EAAE,uBAAuB;IAC5B,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,gCAAgC;IACvC,WAAW,EAAE,8EAA8E;IAC3F,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IAEV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,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WAAW;aAC5B;SACF,CAAC,CAAA;IACN,CAAC;CACF,CAAA"}
|
@@ -71,12 +71,12 @@ exports.getFormTitle = getFormTitle;
|
|
71
71
|
const getFormResponseText = (opts) => {
|
72
72
|
const formAnswers = [];
|
73
73
|
const omittedFormAnswers = [];
|
74
|
-
opts.
|
75
|
-
const
|
76
|
-
if (
|
74
|
+
opts.formDefinition.questions.forEach((questionDefinition) => {
|
75
|
+
const questionResponse = opts.formResponse.answers.find((a) => a.question_id === questionDefinition.id);
|
76
|
+
if (questionResponse === undefined) {
|
77
77
|
omittedFormAnswers.push({
|
78
|
-
questionId:
|
79
|
-
reason: 'No corresponding
|
78
|
+
questionId: questionDefinition.id,
|
79
|
+
reason: 'No corresponding answer found in the form response',
|
80
80
|
});
|
81
81
|
return;
|
82
82
|
}
|
@@ -87,7 +87,7 @@ const getFormResponseText = (opts) => {
|
|
87
87
|
catch (error) {
|
88
88
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
89
89
|
omittedFormAnswers.push({
|
90
|
-
questionId:
|
90
|
+
questionId: questionDefinition.id,
|
91
91
|
reason: `Error processing answer: ${errorMessage}`,
|
92
92
|
});
|
93
93
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getFormResponseText.js","sourceRoot":"","sources":["../../../../../extensions/shelly/lib/getFormResponseText/getFormResponseText.ts"],"names":[],"mappings":";;;AAOA,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAU,EAAE;IAClD,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,YAAY,CAAA;IAEvC,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,aAAa,CAAA;IAExC,OAAO,iBAAiB,CAAA;AAC1B,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,CAC5B,kBAA4B,EAC5B,gBAAwB,EAChB,EAAE;;IACV,MAAM,WAAW,GAAG,gBAAgB,CAAC,KAAK,CAAA;IAC1C,MAAM,aAAa,GAAG,MAAA,kBAAkB,CAAC,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M,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACtE,KAAK,YAAY;YACf,OAAO,gBAAgB,CAAC,WAAW,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACtE,KAAK,WAAW;YACd,OAAO,gBAAgB,CAAC,WAAW,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACtE;YACE,OAAO,gBAAgB,CAAC,WAAW,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACxE,CAAC;AACH,CAAC,CAAA;AAOM,MAAM,YAAY,GAAG,CAAC,IAE5B,EAAU,EAAE;IACX,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAA;AAClC,CAAC,CAAA;AAJY,QAAA,YAAY,gBAIxB;AAEM,MAAM,mBAAmB,GAAG,CAAC,IAGnC,EAGC,EAAE;IACF,MAAM,WAAW,GAAa,EAAE,CAAA;IAChC,MAAM,kBAAkB,GAAwB,EAAE,CAAA;IAElD,IAAI,CAAC,
|
1
|
+
{"version":3,"file":"getFormResponseText.js","sourceRoot":"","sources":["../../../../../extensions/shelly/lib/getFormResponseText/getFormResponseText.ts"],"names":[],"mappings":";;;AAOA,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAU,EAAE;IAClD,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,YAAY,CAAA;IAEvC,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,aAAa,CAAA;IAExC,OAAO,iBAAiB,CAAA;AAC1B,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,CAC5B,kBAA4B,EAC5B,gBAAwB,EAChB,EAAE;;IACV,MAAM,WAAW,GAAG,gBAAgB,CAAC,KAAK,CAAA;IAC1C,MAAM,aAAa,GAAG,MAAA,kBAAkB,CAAC,OAAO,mCAAI,EAAE,CAAA;IAEtD,MAAM,gBAAgB,GAAG,aAAa,aAAb,aAAa,uBAAb,a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AC1C,CAAC;IAEF,OAAO;QACL,MAAM,EAAE,qBAAqB;QAC7B,kBAAkB,EAAE,iBAAiB;KACtC,CAAC;AACJ,CAAC,CAAC;AApCW,QAAA,uBAAuB,2BAoClC"}
|
@@ -148,7 +148,7 @@ const cleanDataForLLM = async (data, awellSdk, pathwayId) => {
|
|
148
148
|
};
|
149
149
|
};
|
150
150
|
const getTrackData = async ({ awellSdk, pathwayId, trackId, currentActivityId, }) => {
|
151
|
-
var _a;
|
151
|
+
var _a, _b, _c, _d, _e;
|
152
152
|
// 1. Query pathway to get track information
|
153
153
|
const pathwayQuery = await awellSdk.orchestration.query({
|
154
154
|
pathway: {
|
@@ -276,30 +276,12 @@ const getTrackData = async ({ awellSdk, pathwayId, trackId, currentActivityId, }
|
|
276
276
|
const currentActivityDate = (_a = currentActivity === null || currentActivity === void 0 ? void 0 : currentActivity.date) !== null && _a !== void 0 ? _a : '';
|
277
277
|
// Get the track IDs we need to match against
|
278
278
|
const relevantTrackIds = new Set();
|
279
|
-
|
280
|
-
var _a;
|
281
|
-
if (((_a = activity.track) === null || _a === void 0 ? void 0 : _a.id) === trackId) {
|
282
|
-
relevantTrackIds.add(activity.track.id);
|
283
|
-
// Find the corresponding track element to get its ID
|
284
|
-
const trackElement = elementsQuery.pathwayElements.elements.find(element => {
|
285
|
-
var _a, _b;
|
286
|
-
return element.type === 'TRACK' &&
|
287
|
-
(((_a = element.context) === null || _a === void 0 ? void 0 : _a.track_id) === ((_b = activity.context) === null || _b === void 0 ? void 0 : _b.track_id));
|
288
|
-
});
|
289
|
-
if ((trackElement === null || trackElement === void 0 ? void 0 : trackElement.id) !== undefined) {
|
290
|
-
relevantTrackIds.add(trackElement.id);
|
291
|
-
}
|
292
|
-
}
|
293
|
-
});
|
279
|
+
relevantTrackIds.add(trackId);
|
294
280
|
// Filter activities by track and date
|
295
281
|
const trackActivities = activitiesQuery.pathwayActivities.activities
|
296
282
|
.filter(activity => {
|
297
|
-
var _a
|
298
|
-
|
299
|
-
// 1. Its track.id matches any of the relevant track IDs, or
|
300
|
-
// 2. Its context.track_id matches any of the relevant track IDs
|
301
|
-
const isInTrack = (((_a = activity.track) === null || _a === void 0 ? void 0 : _a.id) !== undefined && relevantTrackIds.has(activity.track.id)) ||
|
302
|
-
(((_b = activity.context) === null || _b === void 0 ? void 0 : _b.track_id) !== undefined && relevantTrackIds.has(activity.context.track_id));
|
283
|
+
var _a;
|
284
|
+
const isInTrack = ((_a = activity.context) === null || _a === void 0 ? void 0 : _a.track_id) === trackId;
|
303
285
|
const isBeforeOrEqualDate = currentActivityDate.length === 0 || activity.date <= currentActivityDate;
|
304
286
|
return isInTrack && isBeforeOrEqualDate;
|
305
287
|
})
|
@@ -327,11 +309,9 @@ const getTrackData = async ({ awellSdk, pathwayId, trackId, currentActivityId, }
|
|
327
309
|
// 6. Enhance activities with data points
|
328
310
|
const activitiesWithDataPoints = trackActivities.map(activity => {
|
329
311
|
var _a;
|
330
|
-
// Find data points for this activity
|
331
312
|
const activityDataPoints = dataPointsQuery.pathwayDataPoints.dataPoints
|
332
313
|
.filter(dp => dp.activity_id === activity.id)
|
333
314
|
.map(dp => {
|
334
|
-
// Special handling for activation data points
|
335
315
|
if (dp.data_point_definition_id.endsWith('-ACTIVATION')) {
|
336
316
|
return {
|
337
317
|
...dp,
|
@@ -341,7 +321,6 @@ const getTrackData = async ({ awellSdk, pathwayId, trackId, currentActivityId, }
|
|
341
321
|
}
|
342
322
|
return dp;
|
343
323
|
});
|
344
|
-
// Map form responses to data points if they exist
|
345
324
|
const questions = (_a = activity.form) === null || _a === void 0 ? void 0 : _a.questions;
|
346
325
|
if (questions !== undefined && questions !== null) {
|
347
326
|
const formResponses = questions.map(question => {
|
@@ -370,11 +349,9 @@ const getTrackData = async ({ awellSdk, pathwayId, trackId, currentActivityId, }
|
|
370
349
|
// 8. Get steps from the elements query and filter by track ID and type STEP
|
371
350
|
const steps = elementsQuery.pathwayElements.elements
|
372
351
|
.filter(element => {
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
const isInTrack = parentId !== undefined && relevantTrackIds.has(parentId);
|
377
|
-
// Only include STEP elements
|
352
|
+
var _a;
|
353
|
+
const elementTrackId = (_a = element.context) === null || _a === void 0 ? void 0 : _a.track_id;
|
354
|
+
const isInTrack = elementTrackId === trackId;
|
378
355
|
const isStep = element.type === 'STEP';
|
379
356
|
return isInTrack && isStep;
|
380
357
|
})
|
@@ -401,7 +378,6 @@ const getTrackData = async ({ awellSdk, pathwayId, trackId, currentActivityId, }
|
|
401
378
|
});
|
402
379
|
// 9. Associate activities with steps
|
403
380
|
const stepsWithActivities = steps.map(step => {
|
404
|
-
// Find all activities that belong to this step
|
405
381
|
const stepActivities = activitiesWithDataPoints.filter(activity => { var _a; return ((_a = activity.context) === null || _a === void 0 ? void 0 : _a.step_id) === step.id; });
|
406
382
|
return {
|
407
383
|
...step,
|
@@ -409,13 +385,15 @@ const getTrackData = async ({ awellSdk, pathwayId, trackId, currentActivityId, }
|
|
409
385
|
};
|
410
386
|
});
|
411
387
|
// 10. Process the track data
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
388
|
+
// First try to get track title from activities
|
389
|
+
const trackFromActivities = (_b = trackActivities.find(activity => { var _a; return ((_a = activity.track) === null || _a === void 0 ? void 0 : _a.id) === trackId; })) === null || _b === void 0 ? void 0 : _b.track;
|
390
|
+
// If not found in activities, try to get from elements
|
391
|
+
const trackElement = elementsQuery.pathwayElements.elements.find(element => { var _a; return element.type === 'TRACK' && ((_a = element.context) === null || _a === void 0 ? void 0 : _a.track_id) === trackId; });
|
392
|
+
// Finally check pathway tracks
|
393
|
+
const trackFromPathway = pathwayQuery.pathway.pathway.tracks.find((t) => t.id === trackId);
|
394
|
+
const finalTrack = {
|
418
395
|
id: trackId,
|
396
|
+
title: (_e = (_d = (_c = trackFromActivities === null || trackFromActivities === void 0 ? void 0 : trackFromActivities.title) !== null && _c !== void 0 ? _c : trackElement === null || trackElement === void 0 ? void 0 : trackElement.name) !== null && _d !== void 0 ? _d : trackFromPathway === null || trackFromPathway === void 0 ? void 0 : trackFromPathway.title) !== null && _e !== void 0 ? _e : 'Untitled Track'
|
419
397
|
};
|
420
398
|
const rawTrackData = {
|
421
399
|
track: finalTrack,
|
@@ -423,7 +401,8 @@ const getTrackData = async ({ awellSdk, pathwayId, trackId, currentActivityId, }
|
|
423
401
|
steps: stepsWithActivities,
|
424
402
|
};
|
425
403
|
// Clean the data for LLM consumption and return only cleaned data
|
426
|
-
|
404
|
+
const cleanedData = await cleanDataForLLM(rawTrackData, awellSdk, pathwayId);
|
405
|
+
return cleanedData;
|
427
406
|
};
|
428
407
|
exports.getTrackData = getTrackData;
|
429
408
|
//# sourceMappingURL=getTrackData.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getTrackData.js","sourceRoot":"","sources":["../../../../../extensions/shelly/lib/getTrackData/getTrackData.ts"],"names":[],"mappings":";;;AAiUA,MAAM,eAAe,GAAG,KAAK,EAC3B,IAAe,EACf,QAAkB,EAClB,SAAiB,EACQ,EAAE;;IAC3B,OAAO;QACL,KAAK,EAAE;YACL,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,mCAAI,gBAAgB;SAC5C;QACD,KAAK,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAC,IAAI,EAAC,EAAE;;YACnD,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAC3C,QAAQ,CAAC,EAAE,WAAC,OAAA,CAAA,MAAA,QAAQ,CAAC,OAAO,0CAAE,OAAO,MAAK,IAAI,CAAC,EAAE,CAAA,EAAA,CAClD,CAAA;YAED,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,UAAU,EAAE,IAAI,CAAC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Points: ChatPromptTemplate<import("@langchain/core/prompts").ParamsFromFString<"\n You are an assistant tasked with summarizing forms completed by patients. Each form contains a title, questions, answers, possibly answer labels and answer options. Your objective is to create a concise summary of the patient's responses, tailored for a team of clinicians involved in patient care. The summary must cover all patient questions and provide an easy-to-review overview.\n\n First, write the disclaimer message \"{disclaimerMessage}\" in specified language: {language}, following these rules:\n - If specified language is Default or not specified: translate all parts of {disclaimerMessage} into the language of the form. If you cannot determine language use English.\n - If specified language is other than Default (French, Spanish, bosnian, ...): translate all parts of {disclaimerMessage} into specified language: {language} It is critical that the entire disclaimer message is written in the same language as specified language: {language}.\n For example if the disclaimer message is \"Important Notice: The content provided is an AI-generated summary.\" and specified language is Spanish, the disclaimer message in Spanish would be \"Aviso Importante: El contenido proporcionado es un resumen generado por IA de las respuestas del formulario\".\n If the specified language is French than the same disclaimer message should be: \"Avis Important : Le contenu fourni est un résumé généré par IA des réponses du formulaire\"\n Then add two new lines after the disclaimer message.\n\n Then adhere strictly to these step-by-step instructions:\n 1. **Begin the summary with the form title if available.**\n - Use title as is without alteration. Format is as title. \n - Then add an empty line for separation. \n\n - *For example:*\n - **General Health Questionnaire**\n - *Empty Line*\n \n 2. **Identify all questions and their corresponding answers.**\n\n 3. **Structure the summary using bullet points in clear and correct Markdown format:**\n\n - Use the format: `• **Question** - Answer`\n - **Ensure the answer is informative:**\n - For multiple-choice questions where the raw answer may be a code (e.g., 0, 1) that lacks meaning on its own, use the associated **answer label** instead.\n - For other questions, use the raw answer if it is clear and informative.\n\n 4. **Enhance conciseness and readability:**\n\n - **Shorten lengthy questions and answers to their essential meaning for easier inspection, while preserving all essential context.**\n - *For example:*\n - **Before**: \"Can you describe the nature of your back pain?\"\n - **After**: \"Nature of back pain\"\n - **Before**: \"Please list any medications you are currently taking, including dosages and frequency.\"\n - **After**: \"Current medications (dosage and frequency)\"\n - **Before**: \"Have you experienced any side effects from your current treatment in the last 3 months?\"\n - **After**: \"Side effects from current treatment in the last 3 months\"\n - **Avoid omitting any key information** that might alter the meaning. It is critical to preserve all time frames (e.g., \"last week,\" \"yesterday\") and specific details (e.g., \"right leg,\" \"morning\").\n\n 5. **If there are multiple forms provided, add a new line and proceed with the next form.**\n\n **Important Notes:**\n\n - Absolutely refrain from making any suggestions, interpretations, or provide additional comments.\n\n **Style and Format Guidelines:**\n\n - Use **professional and informative language**, avoiding colloquialisms and overly technical terms.\n - Ensure the summary is **clear**, **concise**, and **easy to read**.\n\n **Language:**\n\n - It is critical to summarize in the language specified below. If Default or not specified, use the language of the form.\n\n **Specified Language:**\n\n {language}\n\n ---\n\n **Content to Summarize:**\n\n {input}\n">, any>;
|
3
|
-
export declare const systemPromptTextParagraph: ChatPromptTemplate<import("@langchain/core/prompts").ParamsFromFString<"\n You are an assistant tasked with summarizing forms completed by patients. Each form contains a title, questions, answers, answer labels, and possible answer options. Your objective is to create a concise summary of the patient's responses, tailored for a team of clinicians involved in patient care. The summary must provide an easy-to-review overview.\n\n First, write the disclaimer message \"{disclaimerMessage}\" in specified language: {language}, following these rules:\n - If specified language is Default or not specified: translate all parts of {disclaimerMessage} into the language of the form. If you cannot determine language use English.\n - If specified language is other than Default (French, Spanish, bosnian, ...): translate all parts of {disclaimerMessage} into specified language: {language} It is critical that the entire disclaimer message is written in the same language as specified language: {language}.\n For example if the disclaimer message is \"Important Notice: The content provided is an AI-generated summary.\" and specified language is Spanish, the disclaimer message in Spanish would be \"Aviso Importante: El contenido proporcionado es un resumen generado por IA de las respuestas del formulario\".\n If the specified language is French than the same disclaimer message should be: \"Avis Important : Le contenu fourni est un résumé généré par IA des réponses du formulaire\"\n Then add two new lines after the disclaimer message.\n \n Then adhere strictly to these step-by-step instructions:\n\n 1. **Begin the summary with the form title if available.**\n - Use title as is without alteration. Format is as title. \n - Then add an empty line for separation. \n\n - *For example:*\n - **General Health Questionnaire**\n - *Empty Line*\n\n 2. **Identify all questions and their corresponding answers.**\n\n 3. **Compose the summary as an informative, easy-to-read paragraph:**\n\n - Cover all important aspects of the patient's responses.\n - Ensure the summary is **concise** and **to the point** while preserving all essential information.\n - **Write everything in one paragraph**, maintaining a logical flow of information.\n - For multiple-choice questions where the raw answer may be a code (e.g., 0, 1) that lacks meaning on its own, use the associated **answer label** instead. \n\n\n **Important Notes:**\n\n - Do not make any conclusions, suggestions, interpretations, or provide additional comments. Only summarize the information provided in the form.\n\n **Style and Format Guidelines:**\n\n - Use **professional and informative language**, avoiding colloquialisms and overly technical terms.\n - Ensure the summary is **clear**, **concise**, and **easy to read**.\n\n **Language:**\n\n - It is critical to summarize in the language specified below. If Default or not specified, use the language of the form.\n\n **Specified Language:**\n\n {language}\n\n ---\n\n **Content to Summarize:**\n\n {input}\n">, any>;
|
2
|
+
export declare const systemPromptBulletPoints: ChatPromptTemplate<import("@langchain/core/prompts").ParamsFromFString<"\n You are an assistant tasked with summarizing forms completed by patients. Each form contains a title, questions, answers, possibly answer labels and answer options. Your objective is to create a concise summary of the patient's responses, tailored for a team of clinicians involved in patient care. The summary must cover all patient questions and provide an easy-to-review overview.\n\n First, write the disclaimer message \"{disclaimerMessage}\" in specified language: {language}, following these rules:\n - If specified language is Default or not specified: translate all parts of {disclaimerMessage} into the language of the form. If you cannot determine language use English.\n - If specified language is other than Default (French, Spanish, bosnian, ...): translate all parts of {disclaimerMessage} into specified language: {language} It is critical that the entire disclaimer message is written in the same language as specified language: {language}.\n For example if the disclaimer message is \"Important Notice: The content provided is an AI-generated summary.\" and specified language is Spanish, the disclaimer message in Spanish would be \"Aviso Importante: El contenido proporcionado es un resumen generado por IA de las respuestas del formulario\".\n If the specified language is French than the same disclaimer message should be: \"Avis Important : Le contenu fourni est un résumé généré par IA des réponses du formulaire\"\n Then add two new lines after the disclaimer message.\n\n Then adhere strictly to these step-by-step instructions:\n 1. **Begin the summary with the form title if available.**\n - Use title as is without alteration. Format is as title. \n - Then add an empty line for separation. \n\n - *For example:*\n - **General Health Questionnaire**\n - *Empty Line*\n \n 2. **Identify all questions and their corresponding answers.**\n\n 3. **Structure the summary using bullet points in clear and correct Markdown format:**\n\n - Use the format: `• **Question** - Answer`\n - **Ensure the answer is informative:**\n - For multiple-choice questions where the raw answer may be a code (e.g., 0, 1) that lacks meaning on its own, use the associated **answer label** instead.\n - For other questions, use the raw answer if it is clear and informative.\n\n 4. **Enhance conciseness and readability:**\n\n - **Shorten lengthy questions and answers to their essential meaning for easier inspection, while preserving all essential context.**\n - *For example:*\n - **Before**: \"Can you describe the nature of your back pain?\"\n - **After**: \"Nature of back pain\"\n - **Before**: \"Please list any medications you are currently taking, including dosages and frequency.\"\n - **After**: \"Current medications (dosage and frequency)\"\n - **Before**: \"Have you experienced any side effects from your current treatment in the last 3 months?\"\n - **After**: \"Side effects from current treatment in the last 3 months\"\n - **Avoid omitting any key information** that might alter the meaning. It is critical to preserve all time frames (e.g., \"last week,\" \"yesterday\") and specific details (e.g., \"right leg,\" \"morning\").\n\n 5. **If there are multiple forms provided, add a new line and proceed with the next form.**\n\n **Important Notes:**\n\n - Absolutely refrain from making any suggestions, interpretations, or provide additional comments.\n\n **Style and Format Guidelines:**\n\n - Use **professional and informative language**, avoiding colloquialisms and overly technical terms.\n - Ensure the summary is **clear**, **concise**, and **easy to read**.\n\n **Language:**\n\n - It is critical to summarize in the language specified below. If Default or not specified, use the language of the form.\n\n **Specified Language:**\n\n {language}\n\n **Additional Instructions:**\n {additionalInstructions}\n\n ---\n\n **Content to Summarize:**\n\n {input}\n">, any>;
|
3
|
+
export declare const systemPromptTextParagraph: ChatPromptTemplate<import("@langchain/core/prompts").ParamsFromFString<"\n You are an assistant tasked with summarizing forms completed by patients. Each form contains a title, questions, answers, answer labels, and possible answer options. Your objective is to create a concise summary of the patient's responses, tailored for a team of clinicians involved in patient care. The summary must provide an easy-to-review overview.\n\n First, write the disclaimer message \"{disclaimerMessage}\" in specified language: {language}, following these rules:\n - If specified language is Default or not specified: translate all parts of {disclaimerMessage} into the language of the form. If you cannot determine language use English.\n - If specified language is other than Default (French, Spanish, bosnian, ...): translate all parts of {disclaimerMessage} into specified language: {language} It is critical that the entire disclaimer message is written in the same language as specified language: {language}.\n For example if the disclaimer message is \"Important Notice: The content provided is an AI-generated summary.\" and specified language is Spanish, the disclaimer message in Spanish would be \"Aviso Importante: El contenido proporcionado es un resumen generado por IA de las respuestas del formulario\".\n If the specified language is French than the same disclaimer message should be: \"Avis Important : Le contenu fourni est un résumé généré par IA des réponses du formulaire\"\n Then add two new lines after the disclaimer message.\n \n Then adhere strictly to these step-by-step instructions:\n\n 1. **Begin the summary with the form title if available.**\n - Use title as is without alteration. Format is as title. \n - Then add an empty line for separation. \n\n - *For example:*\n - **General Health Questionnaire**\n - *Empty Line*\n\n 2. **Identify all questions and their corresponding answers.**\n\n 3. **Compose the summary as an informative, easy-to-read paragraph:**\n\n - Cover all important aspects of the patient's responses.\n - Ensure the summary is **concise** and **to the point** while preserving all essential information.\n - **Write everything in one paragraph**, maintaining a logical flow of information.\n - For multiple-choice questions where the raw answer may be a code (e.g., 0, 1) that lacks meaning on its own, use the associated **answer label** instead. \n\n\n **Important Notes:**\n\n - Do not make any conclusions, suggestions, interpretations, or provide additional comments. Only summarize the information provided in the form.\n\n **Style and Format Guidelines:**\n\n - Use **professional and informative language**, avoiding colloquialisms and overly technical terms.\n - Ensure the summary is **clear**, **concise**, and **easy to read**.\n\n **Language:**\n\n - It is critical to summarize in the language specified below. If Default or not specified, use the language of the form.\n\n **Specified Language:**\n\n {language}\n\n **Additional Instructions:**\n {additionalInstructions}\n\n ---\n\n **Content to Summarize:**\n\n {input}\n">, any>;
|
@@ -61,6 +61,9 @@ exports.systemPromptBulletPoints = prompts_1.ChatPromptTemplate.fromTemplate(`
|
|
61
61
|
|
62
62
|
{language}
|
63
63
|
|
64
|
+
**Additional Instructions:**
|
65
|
+
{additionalInstructions}
|
66
|
+
|
64
67
|
---
|
65
68
|
|
66
69
|
**Content to Summarize:**
|
@@ -114,6 +117,9 @@ exports.systemPromptTextParagraph = prompts_1.ChatPromptTemplate.fromTemplate(`
|
|
114
117
|
|
115
118
|
{language}
|
116
119
|
|
120
|
+
**Additional Instructions:**
|
121
|
+
{additionalInstructions}
|
122
|
+
|
117
123
|
---
|
118
124
|
|
119
125
|
**Content to Summarize:**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../extensions/shelly/lib/summarizeFormWithLLM/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAE/C,QAAA,wBAAwB,GAAG,4BAAkB,CAAC,YAAY,CAAC
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../extensions/shelly/lib/summarizeFormWithLLM/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAE/C,QAAA,wBAAwB,GAAG,4BAAkB,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEvE,CAAC,CAAA;AAEW,QAAA,yBAAyB,GAAG,4BAAkB,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDxE,CAAC,CAAA"}
|
@@ -15,15 +15,17 @@ import type { BaseCallbackHandler } from "@langchain/core/callbacks/base";
|
|
15
15
|
* summaryFormat: "Bullet-points",
|
16
16
|
* language: "English",
|
17
17
|
* disclaimerMessage: "AI generated...",
|
18
|
+
* additionalInstructions: "Focus on medication details",
|
18
19
|
* metadata: { ... }
|
19
20
|
* })
|
20
21
|
*/
|
21
|
-
export declare const summarizeFormWithLLM: ({ model, formData, summaryFormat, language, disclaimerMessage, metadata, callbacks, }: {
|
22
|
+
export declare const summarizeFormWithLLM: ({ model, formData, summaryFormat, language, disclaimerMessage, additionalInstructions, metadata, callbacks, }: {
|
22
23
|
model: ChatOpenAI;
|
23
24
|
formData: string;
|
24
25
|
summaryFormat: string;
|
25
26
|
language: string;
|
26
27
|
disclaimerMessage: string;
|
28
|
+
additionalInstructions?: string;
|
27
29
|
metadata: AIActionMetadata;
|
28
30
|
callbacks?: BaseCallbackHandler[];
|
29
31
|
}) => Promise<string>;
|
@@ -16,10 +16,11 @@ const prompt_1 = require("./prompt");
|
|
16
16
|
* summaryFormat: "Bullet-points",
|
17
17
|
* language: "English",
|
18
18
|
* disclaimerMessage: "AI generated...",
|
19
|
+
* additionalInstructions: "Focus on medication details",
|
19
20
|
* metadata: { ... }
|
20
21
|
* })
|
21
22
|
*/
|
22
|
-
const summarizeFormWithLLM = async ({ model, formData, summaryFormat, language, disclaimerMessage, metadata, callbacks, }) => {
|
23
|
+
const summarizeFormWithLLM = async ({ model, formData, summaryFormat, language, disclaimerMessage, additionalInstructions, metadata, callbacks, }) => {
|
23
24
|
const systemPrompt = summaryFormat === 'Bullet-points' ? prompt_1.systemPromptBulletPoints :
|
24
25
|
summaryFormat === 'Text paragraph' ? prompt_1.systemPromptTextParagraph :
|
25
26
|
prompt_1.systemPromptBulletPoints; // Default to bullet points if unknown format
|
@@ -27,6 +28,7 @@ const summarizeFormWithLLM = async ({ model, formData, summaryFormat, language,
|
|
27
28
|
language,
|
28
29
|
input: formData,
|
29
30
|
disclaimerMessage,
|
31
|
+
additionalInstructions: additionalInstructions !== null && additionalInstructions !== void 0 ? additionalInstructions : 'No additional instructions',
|
30
32
|
});
|
31
33
|
try {
|
32
34
|
const result = await model.invoke(prompt, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"summarizeFormWithLLM.js","sourceRoot":"","sources":["../../../../../extensions/shelly/lib/summarizeFormWithLLM/summarizeFormWithLLM.ts"],"names":[],"mappings":";;;AAAA,qCAA8E;AAK9E
|
1
|
+
{"version":3,"file":"summarizeFormWithLLM.js","sourceRoot":"","sources":["../../../../../extensions/shelly/lib/summarizeFormWithLLM/summarizeFormWithLLM.ts"],"names":[],"mappings":";;;AAAA,qCAA8E;AAK9E;;;;;;;;;;;;;;;;;GAiBG;AACI,MAAM,oBAAoB,GAAG,KAAK,EAAE,EACzC,KAAK,EACL,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,iBAAiB,EACjB,sBAAsB,EACtB,QAAQ,EACR,SAAS,GAUV,EAAmB,EAAE;IACpB,MAAM,YAAY,GAAG,aAAa,KAAK,eAAe,CAAC,CAAC,CAAC,iCAAwB,CAAC,CAAC;QAC/D,aAAa,KAAK,gBAAgB,CAAC,CAAC,CAAC,kCAAyB,CAAC,CAAC;YAChE,iCAAwB,CAAA,CAAC,6CAA6C;IAE1F,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC;QACvC,QAAQ;QACR,KAAK,EAAE,QAAQ;QACf,iBAAiB;QACjB,sBAAsB,EAAE,sBAAsB,aAAtB,sBAAsB,cAAtB,sBAAsB,GAAI,4BAA4B;KAC/E,CAAC,CAAA;IAEF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM,CAC/B,MAAM,EACN;YACE,QAAQ;YACR,OAAO,EAAE,qBAAqB;YAC9B,SAAS;SACV,CACF,CAAA;QAED,OAAO,MAAM,CAAC,OAAiB,CAAA;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACpD,CAAC;AACH,CAAC,CAAA;AA5CY,QAAA,oBAAoB,wBA4ChC"}
|