@awell-health/awell-extensions 1.0.240 → 1.0.242
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/extensions/awell/v1/sdk/graphql/addIdentifier.mutation.d.ts +1 -1
- package/dist/extensions/awell/v1/sdk/graphql/addIdentifier.mutation.js +1 -1
- package/dist/extensions/index.js +2 -9
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/markdown.json +0 -4
- package/package.json +1 -1
- package/dist/extensions/avaAi/common/sdk/openAiSdk.d.ts +0 -2
- package/dist/extensions/avaAi/common/sdk/openAiSdk.js +0 -5
- package/dist/extensions/avaAi/common/sdk/openAiSdk.js.map +0 -1
- package/dist/extensions/avaAi/index.d.ts +0 -2
- package/dist/extensions/avaAi/index.js +0 -21
- package/dist/extensions/avaAi/index.js.map +0 -1
- package/dist/extensions/avaAi/settings.d.ts +0 -18
- package/dist/extensions/avaAi/settings.js +0 -22
- package/dist/extensions/avaAi/settings.js.map +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/dataPoints.d.ts +0 -10
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/dataPoints.js +0 -15
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/dataPoints.js.map +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/fields.d.ts +0 -29
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/fields.js +0 -46
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/fields.js.map +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/index.d.ts +0 -2
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/index.js +0 -9
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/index.js.map +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.d.ts +0 -4
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.js +0 -83
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.js.map +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.test.d.ts +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.test.js +0 -27
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.test.js.map +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/index.d.ts +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/index.js +0 -6
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/index.js.map +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.d.ts +0 -3
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.js +0 -43
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.js.map +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.test.d.ts +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.test.js +0 -133
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.test.js.map +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/index.d.ts +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/index.js +0 -6
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/index.js.map +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/index.d.ts +0 -1
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/index.js +0 -6
- package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/index.js.map +0 -1
- package/dist/extensions/avaAi/v1/actions/index.d.ts +0 -1
- package/dist/extensions/avaAi/v1/actions/index.js +0 -6
- package/dist/extensions/avaAi/v1/actions/index.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
export declare const addIdentifierToPatientMutation = "\nmutation AddIdentifierToPatient(input: AddIdentifierToPatientInput!) {\n addIdentifierToPatient(input: $input) {\n patient {\n id\n }\n }\n }\n";
|
1
|
+
export declare const addIdentifierToPatientMutation = "\nmutation AddIdentifierToPatient($input: AddIdentifierToPatientInput!) {\n addIdentifierToPatient(input: $input) {\n patient {\n id\n }\n }\n }\n";
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.addIdentifierToPatientMutation = void 0;
|
4
4
|
exports.addIdentifierToPatientMutation = `
|
5
|
-
mutation AddIdentifierToPatient(input: AddIdentifierToPatientInput!) {
|
5
|
+
mutation AddIdentifierToPatient($input: AddIdentifierToPatientInput!) {
|
6
6
|
addIdentifierToPatient(input: $input) {
|
7
7
|
patient {
|
8
8
|
id
|
package/dist/extensions/index.js
CHANGED
@@ -24,7 +24,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
26
|
exports.extensions = exports.markdown = void 0;
|
27
|
-
// import { AvaAi } from './avaAi'
|
28
27
|
const awell_1 = require("./awell");
|
29
28
|
const calDotCom_1 = require("./calDotCom");
|
30
29
|
const calendly_1 = require("./calendly");
|
@@ -42,7 +41,6 @@ const math_1 = require("./math");
|
|
42
41
|
const messagebird_1 = require("./messagebird");
|
43
42
|
const metriport_1 = require("./metriport");
|
44
43
|
const twilio_1 = require("./twilio");
|
45
|
-
// import { Wellinks } from './wellinks-public'
|
46
44
|
const sendgrid_extension_1 = require("./sendgrid-extension");
|
47
45
|
const cmDotCom_1 = require("./cmDotCom");
|
48
46
|
const talkDesk_1 = require("./talkDesk");
|
@@ -63,9 +61,6 @@ const json = __importStar(require("./markdown.json"));
|
|
63
61
|
const external_server_1 = require("./external-server");
|
64
62
|
exports.markdown = json;
|
65
63
|
exports.extensions = [
|
66
|
-
// AvaAi, Best to disable this until we cleared out data privacy & HIPAA with OpenAI
|
67
|
-
// ZusHealth is not ready for public use yet
|
68
|
-
// ZusHealth,
|
69
64
|
awell_1.Awell,
|
70
65
|
athenahealth_1.athenahealth,
|
71
66
|
calDotCom_1.CalDotCom,
|
@@ -89,18 +84,16 @@ exports.extensions = [
|
|
89
84
|
mailgun_1.Mailgun,
|
90
85
|
math_1.MathExtension,
|
91
86
|
messagebird_1.MessageBird,
|
87
|
+
medplum_1.Medplum,
|
92
88
|
metriport_1.Metriport,
|
93
89
|
nexuzhealth_1.nexuzhealth,
|
94
90
|
sendbird_1.Sendbird,
|
95
91
|
sendgrid_extension_1.Sendgrid,
|
96
|
-
cmDotCom_1.CmDotCom,
|
97
92
|
talkDesk_1.TalkDesk,
|
93
|
+
textline_1.TextLine,
|
98
94
|
transform_1.Transform,
|
99
95
|
twilio_1.Twilio,
|
100
|
-
// Wellinks,
|
101
96
|
zendesk_1.Zendesk,
|
102
97
|
westFax_1.WestFax,
|
103
|
-
textline_1.TextLine,
|
104
|
-
medplum_1.Medplum,
|
105
98
|
];
|
106
99
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA+B;AAC/B,2CAAuC;AACvC,yCAAqC;AACrC,mDAA+C;AAC/C,6CAAyC;AACzC,+CAA2C;AAC3C,uCAAmC;AACnC,iDAA6C;AAC7C,yCAAqC;AACrC,yCAAqC;AACrC,+CAA0C;AAC1C,2CAAuC;AACvC,uCAAmC;AACnC,iCAAsC;AACtC,+CAA2C;AAC3C,2CAAuC;AACvC,qCAAiC;AACjC,6DAA+C;AAC/C,yCAAqC;AACrC,yCAAqC;AACrC,yCAAqC;AACrC,yCAAqC;AACrC,2CAAuC;AACvC,yCAAqC;AACrC,uCAAmC;AACnC,uCAAmC;AACnC,uCAAmC;AACnC,+CAA2C;AAC3C,+CAA2C;AAC3C,iDAA6C;AAC7C,+BAA2B;AAC3B,yCAAqC;AACrC,uCAAmC;AAEnC,sDAAuC;AACvC,uDAAkD;AAGrC,QAAA,QAAQ,GAAa,IAAI,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,aAAK;IACL,2BAAY;IACZ,qBAAS;IACT,mBAAQ;IACR,6BAAa;IACb,uBAAU;IACV,mBAAQ;IACR,yBAAW;IACX,mBAAQ;IACR,yBAAW;IACX,iBAAO;IACP,2BAAY;IACZ,gCAAc;IACd,mBAAQ;IACR,mBAAQ;IACR,wBAAU;IACV,SAAG;IACH,iBAAO;IACP,mBAAQ;IACR,qBAAS;IACT,iBAAO;IACP,oBAAa;IACb,yBAAW;IACX,iBAAO;IACP,qBAAS;IACT,yBAAW;IACX,mBAAQ;IACR,6BAAQ;IACR,mBAAQ;IACR,mBAAQ;IACR,qBAAS;IACT,eAAM;IACN,iBAAO;IACP,iBAAO;CACR,CAAA"}
|
@@ -3,10 +3,6 @@
|
|
3
3
|
"readme": "---\ntitle: Athena\ndescription: Athena offers medical groups, hospitals, and health systems cloud-based EHR, practice management, and patient engagement services that seamlessly connect care and drive results for every client. \n---\n\n## Athenahealth\n\nAthena offers medical groups, hospitals, and health systems cloud-based EHR, practice management, and patient engagement services that seamlessly connect care and drive results for every client.\n\n## Extension settings\n\nFor the extension to function correctly, you must configure the following settings:\n\n- Auth server URL (e.g. https://api.preview.platform.athenahealth.com/oauth2/v1/token)\n- Client ID\n- Client secret\n- API URL (https://api.preview.platform.athenahealth.com)\n- Scope\n- Practice ID\n\n\n## Actions\n\n### Create patient\n\nCreates a patient in athenahealth. First name, last name, date of birth, email, and department ID are required. If a patient with the same name, date of birth, and email already exists, a new patient record will not be created. Instead, the existing patient's ID will be returned.\n\n### Get patient\n\nRetrieve the details of a given patient within a given practice.\n\n### Get appointment\n\nRetrieve the details of an appointment.\n\n### Create appointment note\n\nCreate a note which will be appended to an appointment",
|
4
4
|
"changelog": "# Athena changelog"
|
5
5
|
},
|
6
|
-
"avaAi": {
|
7
|
-
"readme": "---\ntitle: AvaAI\ndescription: Experimental extension to introduce AI actions in care flows.\n---\n# Awell Virtual (AI) Assistant - Ava\n\n## Extension settings\n\nIn order to set up this extension, you will need to provide an Open AI API key.\n\n## Custom Actions\n\n### Generate patient summary\n\nGenerates a human-readable summary about the patient based on the characteristics in the patient's profile.\n\nYou can specify which characteristics of the patient you would like to include by providing a comma-separated string with the below possible options:\n\n- first_name\n- last_name\n- street\n- city\n- country\n- state\n- zip\n- birth_date\n- email\n- mobile_phone\n- phone\n- national_registry_number\n- patient_code\n- preferred_language\n- sex\n\nIf no characteristics are passed, by default a summary will be generated that includes all characteristics.",
|
8
|
-
"changelog": "# Ava changelog"
|
9
|
-
},
|
10
6
|
"awell": {
|
11
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 process. This check ensures whether a patient with that identifier is already present or not.\n\n### Add identifier to patient\n\nThis action enables adding an identifier to the current patient. We recommend using the \"Retrieve Patient by Identifier\" action first to verify if a patient with that identifier already exists. If the identifier isn't already associated with another patient, it's safe to link it to the current patient. If a match is found, implementing a strategy for deduplication is advisable.\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",
|
12
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"
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"openAiSdk.js","sourceRoot":"","sources":["../../../../../extensions/avaAi/common/sdk/openAiSdk.ts"],"names":[],"mappings":";;AAAA,mCAA+C;AAE/C,kBAAe,kBAAS,CAAA"}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.AvaAi = void 0;
|
4
|
-
const extensions_core_1 = require("@awell-health/extensions-core");
|
5
|
-
const actions_1 = require("./v1/actions");
|
6
|
-
const settings_1 = require("./settings");
|
7
|
-
exports.AvaAi = {
|
8
|
-
key: 'avaAi',
|
9
|
-
title: 'Ava - Awell Virtual (AI) Assistant',
|
10
|
-
icon_url: 'https://res.cloudinary.com/da7x4rzl4/image/upload/v1681032937/Awell%20Extensions/Avatar.png',
|
11
|
-
description: `Ava is "Awell's Virtual (AI) Assistant that can help you automate simple tasks in your care flow.`,
|
12
|
-
category: extensions_core_1.Category.AI,
|
13
|
-
author: {
|
14
|
-
authorType: extensions_core_1.AuthorType.AWELL,
|
15
|
-
},
|
16
|
-
actions: {
|
17
|
-
generatePatientSummary: actions_1.generatePatientSummary,
|
18
|
-
},
|
19
|
-
settings: settings_1.settings,
|
20
|
-
};
|
21
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/avaAi/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,0CAAqD;AACrD,yCAAqC;AAExB,QAAA,KAAK,GAAc;IAC9B,GAAG,EAAE,OAAO;IACZ,KAAK,EAAE,oCAAoC;IAC3C,QAAQ,EACN,6FAA6F;IAC/F,WAAW,EAAE,mGAAmG;IAChH,QAAQ,EAAE,0BAAQ,CAAC,EAAE;IACrB,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,OAAO,EAAE;QACP,sBAAsB,EAAtB,gCAAsB;KACvB;IACD,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
export declare const settings: {
|
3
|
-
openAiApiKey: {
|
4
|
-
key: string;
|
5
|
-
label: string;
|
6
|
-
obfuscated: true;
|
7
|
-
required: true;
|
8
|
-
description: string;
|
9
|
-
};
|
10
|
-
};
|
11
|
-
export declare const SettingsValidationSchema: z.ZodObject<{
|
12
|
-
openAiApiKey: z.ZodString;
|
13
|
-
}, "strip", z.ZodTypeAny, {
|
14
|
-
openAiApiKey: string;
|
15
|
-
}, {
|
16
|
-
openAiApiKey: string;
|
17
|
-
}>;
|
18
|
-
export declare const validateSettings: (settings: unknown) => z.infer<typeof SettingsValidationSchema>;
|
@@ -1,22 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.validateSettings = exports.SettingsValidationSchema = exports.settings = void 0;
|
4
|
-
const zod_1 = require("zod");
|
5
|
-
exports.settings = {
|
6
|
-
openAiApiKey: {
|
7
|
-
key: 'openAiApiKey',
|
8
|
-
label: 'Open AI API Key',
|
9
|
-
obfuscated: true,
|
10
|
-
required: true,
|
11
|
-
description: 'The OpenAI API uses API keys for authentication',
|
12
|
-
},
|
13
|
-
};
|
14
|
-
exports.SettingsValidationSchema = zod_1.z.object({
|
15
|
-
openAiApiKey: zod_1.z.string(),
|
16
|
-
});
|
17
|
-
const validateSettings = (settings) => {
|
18
|
-
const parsedData = exports.SettingsValidationSchema.parse(settings);
|
19
|
-
return parsedData;
|
20
|
-
};
|
21
|
-
exports.validateSettings = validateSettings;
|
22
|
-
//# sourceMappingURL=settings.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../extensions/avaAi/settings.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,QAAQ,GAAG;IACtB,YAAY,EAAE;QACZ,GAAG,EAAE,cAAc;QACnB,KAAK,EAAE,iBAAiB;QACxB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,iDAAiD;KAC/D;CACgC,CAAA;AAEtB,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;CAC2B,CAAC,CAAA;AAE/C,MAAM,gBAAgB,GAAG,CAC9B,QAAiB,EACyB,EAAE;IAC5C,MAAM,UAAU,GAAG,gCAAwB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IAE3D,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AANY,QAAA,gBAAgB,oBAM5B"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.dataPoints = void 0;
|
4
|
-
exports.dataPoints = {
|
5
|
-
prompt: {
|
6
|
-
// Comes in handy for debugging purposes - should be removed at some point
|
7
|
-
key: 'prompt',
|
8
|
-
valueType: 'string',
|
9
|
-
},
|
10
|
-
patientSummary: {
|
11
|
-
key: 'patientSummary',
|
12
|
-
valueType: 'string',
|
13
|
-
},
|
14
|
-
};
|
15
|
-
//# sourceMappingURL=dataPoints.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../../extensions/avaAi/v1/actions/generatePatientSummary/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE;QACN,0EAA0E;QAC1E,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;IACD,cAAc,EAAE;QACd,GAAG,EAAE,gBAAgB;QACrB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import { FieldType } from '@awell-health/extensions-core';
|
2
|
-
import { z } from 'zod';
|
3
|
-
export declare const fields: {
|
4
|
-
characteristics: {
|
5
|
-
id: string;
|
6
|
-
label: string;
|
7
|
-
description: string;
|
8
|
-
type: FieldType.STRING;
|
9
|
-
required: false;
|
10
|
-
};
|
11
|
-
language: {
|
12
|
-
id: string;
|
13
|
-
label: string;
|
14
|
-
description: string;
|
15
|
-
type: FieldType.STRING;
|
16
|
-
required: false;
|
17
|
-
};
|
18
|
-
};
|
19
|
-
export declare const FieldsValidationSchema: z.ZodObject<{
|
20
|
-
characteristics: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string[], string>, string[], string>>;
|
21
|
-
language: z.ZodEffects<z.ZodOptional<z.ZodString>, string, string | undefined>;
|
22
|
-
}, "strip", z.ZodTypeAny, {
|
23
|
-
language: string;
|
24
|
-
characteristics?: string[] | undefined;
|
25
|
-
}, {
|
26
|
-
language?: string | undefined;
|
27
|
-
characteristics?: string | undefined;
|
28
|
-
}>;
|
29
|
-
export declare const validateActionFields: (fields: unknown) => z.infer<typeof FieldsValidationSchema>;
|
@@ -1,46 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.validateActionFields = exports.FieldsValidationSchema = exports.fields = void 0;
|
4
|
-
const extensions_core_1 = require("@awell-health/extensions-core");
|
5
|
-
const zod_1 = require("zod");
|
6
|
-
const lodash_1 = require("lodash");
|
7
|
-
exports.fields = {
|
8
|
-
characteristics: {
|
9
|
-
id: 'characteristics',
|
10
|
-
label: 'Characteristics to include in summary',
|
11
|
-
description: 'A comma-separated list of patient characteristics you would like to include in the summary (eg: first_name, last_name, birth_date). If left blank, all patient profile characteristics will be included.',
|
12
|
-
type: extensions_core_1.FieldType.STRING,
|
13
|
-
required: false,
|
14
|
-
},
|
15
|
-
language: {
|
16
|
-
id: 'language',
|
17
|
-
label: 'Language of the summary',
|
18
|
-
description: 'The language the summary will be written in. Defaults to "English".',
|
19
|
-
type: extensions_core_1.FieldType.STRING,
|
20
|
-
required: false,
|
21
|
-
},
|
22
|
-
};
|
23
|
-
exports.FieldsValidationSchema = zod_1.z.object({
|
24
|
-
characteristics: zod_1.z.optional(zod_1.z
|
25
|
-
.string()
|
26
|
-
// Make sure all white spaces are stripped
|
27
|
-
.transform((chars) => chars.replace(/\s/g, ''))
|
28
|
-
.transform((chars) => chars.split(','))
|
29
|
-
// Make sure there are no undefined or empty characteristics
|
30
|
-
.transform((charsArray) => charsArray.filter((chars) => {
|
31
|
-
if ((0, lodash_1.isNil)(chars) || (0, lodash_1.isEmpty)(chars))
|
32
|
-
return false;
|
33
|
-
return true;
|
34
|
-
}))),
|
35
|
-
language: zod_1.z.optional(zod_1.z.string()).transform((lang) => {
|
36
|
-
if ((0, lodash_1.isNil)(lang) || (0, lodash_1.isEmpty)(lang))
|
37
|
-
return 'English';
|
38
|
-
return lang;
|
39
|
-
}),
|
40
|
-
});
|
41
|
-
const validateActionFields = (fields) => {
|
42
|
-
const parsedData = exports.FieldsValidationSchema.parse(fields);
|
43
|
-
return parsedData;
|
44
|
-
};
|
45
|
-
exports.validateActionFields = validateActionFields;
|
46
|
-
//# sourceMappingURL=fields.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/avaAi/v1/actions/generatePatientSummary/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,6BAAwC;AACxC,mCAAuC;AAE1B,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,EAAE,EAAE,iBAAiB;QACrB,KAAK,EAAE,uCAAuC;QAC9C,WAAW,EACT,0MAA0M;QAC5M,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,QAAQ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
|
@@ -1,9 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.dataPoints = exports.validateActionFields = exports.fields = void 0;
|
4
|
-
var fields_1 = require("./fields");
|
5
|
-
Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
|
6
|
-
Object.defineProperty(exports, "validateActionFields", { enumerable: true, get: function () { return fields_1.validateActionFields; } });
|
7
|
-
var dataPoints_1 = require("./dataPoints");
|
8
|
-
Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return dataPoints_1.dataPoints; } });
|
9
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/avaAi/v1/actions/generatePatientSummary/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAuD;AAA9C,gGAAA,MAAM,OAAA;AAAE,8GAAA,oBAAoB,OAAA;AACrC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
|
@@ -1,83 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.generatePatientSummary = void 0;
|
7
|
-
const config_1 = require("./config");
|
8
|
-
const extensions_core_1 = require("@awell-health/extensions-core");
|
9
|
-
const settings_1 = require("../../../settings");
|
10
|
-
const zod_validation_error_1 = require("zod-validation-error");
|
11
|
-
const zod_1 = require("zod");
|
12
|
-
const openAiSdk_1 = __importDefault(require("../../../common/sdk/openAiSdk"));
|
13
|
-
const openai_1 = require("openai");
|
14
|
-
const utils_1 = require("./utils");
|
15
|
-
exports.generatePatientSummary = {
|
16
|
-
key: 'generatePatientSummary',
|
17
|
-
title: 'Generate patient summary',
|
18
|
-
description: "Generates a human-readable and brief summary about the patient based on the characteristics in the patient's profile.",
|
19
|
-
category: extensions_core_1.Category.AI,
|
20
|
-
fields: config_1.fields,
|
21
|
-
dataPoints: config_1.dataPoints,
|
22
|
-
previewable: false,
|
23
|
-
onActivityCreated: async (payload, onComplete, onError) => {
|
24
|
-
var _a, _b;
|
25
|
-
try {
|
26
|
-
const { patient } = payload;
|
27
|
-
const { openAiApiKey } = (0, settings_1.validateSettings)(payload.settings);
|
28
|
-
const { characteristics, language } = (0, config_1.validateActionFields)(payload.fields);
|
29
|
-
const configuration = new openai_1.Configuration({
|
30
|
-
apiKey: openAiApiKey,
|
31
|
-
});
|
32
|
-
const openai = new openAiSdk_1.default(configuration);
|
33
|
-
const prompt = (0, utils_1.generatePrompt)(patient, characteristics, language);
|
34
|
-
const TOKENS_FOR_PROMPT = 400;
|
35
|
-
const TOKENS_FOR_COMPLETION = 100;
|
36
|
-
const result = await openai.createCompletion({
|
37
|
-
model: 'text-davinci-003',
|
38
|
-
prompt,
|
39
|
-
temperature: 0,
|
40
|
-
max_tokens: TOKENS_FOR_PROMPT + TOKENS_FOR_COMPLETION,
|
41
|
-
n: 1, // Only generate one completion per prompt
|
42
|
-
});
|
43
|
-
await onComplete({
|
44
|
-
data_points: {
|
45
|
-
prompt,
|
46
|
-
patientSummary: String((_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.choices[0]) === null || _b === void 0 ? void 0 : _b.text),
|
47
|
-
},
|
48
|
-
});
|
49
|
-
}
|
50
|
-
catch (err) {
|
51
|
-
if (err instanceof zod_1.ZodError) {
|
52
|
-
const error = (0, zod_validation_error_1.fromZodError)(err);
|
53
|
-
await onError({
|
54
|
-
events: [
|
55
|
-
{
|
56
|
-
date: new Date().toISOString(),
|
57
|
-
text: { en: error.name },
|
58
|
-
error: {
|
59
|
-
category: 'WRONG_INPUT',
|
60
|
-
message: `${error.message}`,
|
61
|
-
},
|
62
|
-
},
|
63
|
-
],
|
64
|
-
});
|
65
|
-
return;
|
66
|
-
}
|
67
|
-
const error = err;
|
68
|
-
await onError({
|
69
|
-
events: [
|
70
|
-
{
|
71
|
-
date: new Date().toISOString(),
|
72
|
-
text: { en: 'Something went wrong while orchestration the action' },
|
73
|
-
error: {
|
74
|
-
category: 'SERVER_ERROR',
|
75
|
-
message: error.message,
|
76
|
-
},
|
77
|
-
},
|
78
|
-
],
|
79
|
-
});
|
80
|
-
}
|
81
|
-
},
|
82
|
-
};
|
83
|
-
//# sourceMappingURL=generatePatientSummary.js.map
|
package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"generatePatientSummary.js","sourceRoot":"","sources":["../../../../../../extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.ts"],"names":[],"mappings":";;;;;;AACA,qCAAmE;AACnE,mEAAwD;AACxD,gDAAmE;AACnE,+DAAmD;AACnD,6BAA8B;AAC9B,8EAAqD;AACrD,mCAAsC;AACtC,mCAAwC;AAE3B,QAAA,sBAAsB,GAA2C;IAC5E,GAAG,EAAE,wBAAwB;IAC7B,KAAK,EAAE,0BAA0B;IACjC,WAAW,EACT,uHAAuH;IACzH,QAAQ,EAAE,0BAAQ,CAAC,EAAE;IACrB,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;;QACxD,IAAI;YACF,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;YAC3B,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,2BAAgB,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;YAC3D,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,IAAA,6BAAoB,EAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YAE1E,MAAM,aAAa,GAAG,IAAI,sBAAa,CAAC;gBACtC,MAAM,EAAE,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I,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,qDAAqD,EAAE;wBACnE,KAAK,EAAE;4BACL,QAAQ,EAAE,cAAc;4BACxB,OAAO,EAAE,KAAK,CAAC,OAAO;yBACvB;qBACF;iBACF;aACF,CAAC,CAAA;SACH;IACH,CAAC;CACF,CAAA"}
|
package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.test.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.test.js
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const __1 = require("..");
|
4
|
-
const tests_1 = require("../../../../../src/tests");
|
5
|
-
jest.mock('../../../common/sdk/openAiSdk');
|
6
|
-
describe('Generate patient summary with Open AI', () => {
|
7
|
-
const onComplete = jest.fn();
|
8
|
-
const onError = jest.fn();
|
9
|
-
beforeEach(() => {
|
10
|
-
onComplete.mockClear();
|
11
|
-
onError.mockClear();
|
12
|
-
});
|
13
|
-
test('Should call the onComplete callback', async () => {
|
14
|
-
await __1.generatePatientSummary.onActivityCreated((0, tests_1.generateTestPayload)({
|
15
|
-
fields: {
|
16
|
-
characteristics: '',
|
17
|
-
language: 'English',
|
18
|
-
},
|
19
|
-
settings: {
|
20
|
-
openAiApiKey: 'an-api-key',
|
21
|
-
},
|
22
|
-
}), onComplete, onError);
|
23
|
-
expect(onComplete).toHaveBeenCalled();
|
24
|
-
expect(onError).not.toHaveBeenCalled();
|
25
|
-
});
|
26
|
-
});
|
27
|
-
//# sourceMappingURL=generatePatientSummary.test.js.map
|
package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.test.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"generatePatientSummary.test.js","sourceRoot":"","sources":["../../../../../../extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.test.ts"],"names":[],"mappings":";;AAAA,0BAA2C;AAC3C,oDAA8D;AAE9D,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAA;AAE1C,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACrD,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,UAAU,CAAC,SAAS,EAAE,CAAA;QACtB,OAAO,CAAC,SAAS,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,0BAAsB,CAAC,iBAAiB,CAC5C,IAAA,2BAAmB,EAAC;YAClB,MAAM,EAAE;gBACN,eAAe,EAAE,EAAE;gBACnB,QAAQ,EAAE,SAAS;aACpB;YACD,QAAQ,EAAE;gBACR,YAAY,EAAE,YAAY;aAC3B;SACF,CAAC,EACF,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAA;QACrC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;IACxC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export { generatePatientSummary } from './generatePatientSummary';
|
@@ -1,6 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.generatePatientSummary = void 0;
|
4
|
-
var generatePatientSummary_1 = require("./generatePatientSummary");
|
5
|
-
Object.defineProperty(exports, "generatePatientSummary", { enumerable: true, get: function () { return generatePatientSummary_1.generatePatientSummary; } });
|
6
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/avaAi/v1/actions/generatePatientSummary/index.ts"],"names":[],"mappings":";;;AAAA,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA"}
|
@@ -1,43 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.generatePrompt = exports.promptQuestion = void 0;
|
4
|
-
const lodash_1 = require("lodash");
|
5
|
-
const promptQuestion = (language) => `Create a human-readable summary of a person that only includes the below characteristics. The text should be written in the present tense. Write it in ${language}.`;
|
6
|
-
exports.promptQuestion = promptQuestion;
|
7
|
-
const generatePrompt = (patient, characteristics, language = 'English') => {
|
8
|
-
var _a;
|
9
|
-
const flattenedProfile = {
|
10
|
-
...(0, lodash_1.omit)(patient.profile, ['address']),
|
11
|
-
...(_a = patient.profile) === null || _a === void 0 ? void 0 : _a.address,
|
12
|
-
};
|
13
|
-
const getCharacteristicsForPrompt = () => {
|
14
|
-
if ((0, lodash_1.isNil)(characteristics) || (0, lodash_1.isEmpty)(characteristics))
|
15
|
-
return flattenedProfile;
|
16
|
-
return (0, lodash_1.pick)(flattenedProfile, characteristics);
|
17
|
-
};
|
18
|
-
const characteristicsForPrompt = getCharacteristicsForPrompt();
|
19
|
-
const characteristicsArray = Object.entries(characteristicsForPrompt)
|
20
|
-
.map((e) => ({ [e[0]]: e[1] }))
|
21
|
-
.filter((chars) => {
|
22
|
-
if ((0, lodash_1.isNil)(chars) || (0, lodash_1.isEmpty)(chars))
|
23
|
-
return false;
|
24
|
-
return true;
|
25
|
-
});
|
26
|
-
const characteristicsPrompt = characteristicsArray
|
27
|
-
.filter((char) => {
|
28
|
-
const value = Object.values(char)[0];
|
29
|
-
if ((0, lodash_1.isNil)(value) || (0, lodash_1.isEmpty)(value))
|
30
|
-
return false;
|
31
|
-
return true;
|
32
|
-
})
|
33
|
-
.map((char) => {
|
34
|
-
return `Characteristic: ${(0, lodash_1.startCase)(String(Object.keys(char)[0]))}
|
35
|
-
Value: ${String(Object.values(char)[0]).trim()}`;
|
36
|
-
})
|
37
|
-
.join('\n\n');
|
38
|
-
return `${(0, exports.promptQuestion)(language)}
|
39
|
-
|
40
|
-
${characteristicsPrompt}`;
|
41
|
-
};
|
42
|
-
exports.generatePrompt = generatePrompt;
|
43
|
-
//# sourceMappingURL=generatePrompt.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"generatePrompt.js","sourceRoot":"","sources":["../../../../../../../../extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.ts"],"names":[],"mappings":";;;AAAA,mCAA8D;AAGvD,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAU,EAAE,CACzD,0JAA0J,QAAQ,GAAG,CAAA;AAD1J,QAAA,cAAc,kBAC4I;AAEhK,MAAM,cAAc,GAAG,CAC5B,OAAgB,EAChB,eAA0B,EAC1B,WAAmB,SAAS,EACpB,EAAE;;IACV,MAAM,gBAAgB,GAAG;QACvB,GAAG,IAAA,aAAI,EAAC,OAAO,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC;QACrC,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,OAAO;KAC5B,CAAA;IAED,MAAM,2BAA2B,GAAG,GAA4B,EAAE;QAChE,IAAI,IAAA,cAAK,EAAC,eAAe,CAAC,IAAI,IAAA,gBAAO,EAAC,eAAe,CAAC;YACpD,OAAO,gBAAgB,CAAA;QAEzB,OAAO,IAAA,aAAI,EAAC,gBAAgB,EAAE,eAAe,CAAC,CAAA;IAChD,CAAC,CAAA;IAED,MAAM,wBAAwB,GAAG,2BAA2B,EAAE,CAAA;IAC9D,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,CAAC,wBAAwB,CAAC;SAClE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC9B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAChB,IAAI,IAAA,cAAK,EAAC,KAAK,CAAC,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAA;QAEhD,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;IAEJ,MAAM,qBAAqB,GAAG,oBAAoB;SAC/C,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;QAEpC,IAAI,IAAA,cAAK,EAAC,KAAK,CAAC,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAA;QAEhD,OAAO,IAAI,CAAA;IACb,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,OAAO,mBAAmB,IAAA,kBAAS,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC9D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAA;IAC5C,CAAC,CAAC;SACD,IAAI,CAAC,MAAM,CAAC,CAAA;IAEf,OAAO,GAAG,IAAA,sBAAc,EAAC,QAAQ,CAAC;;EAElC,qBAAqB,EAAE,CAAA;AACzB,CAAC,CAAA;AA3CY,QAAA,cAAc,kBA2C1B"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,133 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const graphql_1 = require("../../../../../../awell/v1/gql/graphql");
|
4
|
-
const generatePrompt_1 = require("./generatePrompt");
|
5
|
-
const language = 'English';
|
6
|
-
describe('Generate prompt for patient summary', () => {
|
7
|
-
test('Should generate a prompt with all characteristics', async () => {
|
8
|
-
const result = (0, generatePrompt_1.generatePrompt)({
|
9
|
-
id: 'patient-id',
|
10
|
-
profile: {
|
11
|
-
first_name: 'Nick',
|
12
|
-
last_name: 'Hellemans',
|
13
|
-
address: {
|
14
|
-
street: 'John Doe Street 20',
|
15
|
-
city: 'Kontich',
|
16
|
-
country: 'Belgium',
|
17
|
-
state: 'Antwerp',
|
18
|
-
zip: '2550',
|
19
|
-
},
|
20
|
-
birth_date: '1993-11-30',
|
21
|
-
email: 'john.doe@awellhealth.com',
|
22
|
-
mobile_phone: '+32 xxx xx xx xx',
|
23
|
-
phone: '+32 xxx xx xx xx',
|
24
|
-
national_registry_number: '123456789',
|
25
|
-
patient_code: '98765',
|
26
|
-
preferred_language: 'en',
|
27
|
-
sex: graphql_1.Sex.Male,
|
28
|
-
},
|
29
|
-
}, [], language);
|
30
|
-
expect(result).toBe(`${(0, generatePrompt_1.promptQuestion)(language)}
|
31
|
-
|
32
|
-
Characteristic: First Name
|
33
|
-
Value: Nick
|
34
|
-
|
35
|
-
Characteristic: Last Name
|
36
|
-
Value: Hellemans
|
37
|
-
|
38
|
-
Characteristic: Birth Date
|
39
|
-
Value: 1993-11-30
|
40
|
-
|
41
|
-
Characteristic: Email
|
42
|
-
Value: john.doe@awellhealth.com
|
43
|
-
|
44
|
-
Characteristic: Mobile Phone
|
45
|
-
Value: +32 xxx xx xx xx
|
46
|
-
|
47
|
-
Characteristic: Phone
|
48
|
-
Value: +32 xxx xx xx xx
|
49
|
-
|
50
|
-
Characteristic: National Registry Number
|
51
|
-
Value: 123456789
|
52
|
-
|
53
|
-
Characteristic: Patient Code
|
54
|
-
Value: 98765
|
55
|
-
|
56
|
-
Characteristic: Preferred Language
|
57
|
-
Value: en
|
58
|
-
|
59
|
-
Characteristic: Sex
|
60
|
-
Value: MALE
|
61
|
-
|
62
|
-
Characteristic: Street
|
63
|
-
Value: John Doe Street 20
|
64
|
-
|
65
|
-
Characteristic: City
|
66
|
-
Value: Kontich
|
67
|
-
|
68
|
-
Characteristic: Country
|
69
|
-
Value: Belgium
|
70
|
-
|
71
|
-
Characteristic: State
|
72
|
-
Value: Antwerp
|
73
|
-
|
74
|
-
Characteristic: Zip
|
75
|
-
Value: 2550`);
|
76
|
-
});
|
77
|
-
test('Should generate a prompt with only a subset of characteristics', async () => {
|
78
|
-
const result = (0, generatePrompt_1.generatePrompt)({
|
79
|
-
id: 'patient-id',
|
80
|
-
profile: {
|
81
|
-
first_name: 'Nick',
|
82
|
-
last_name: 'Hellemans',
|
83
|
-
address: {
|
84
|
-
street: 'John Doe Street 20',
|
85
|
-
city: 'Kontich',
|
86
|
-
country: 'Belgium',
|
87
|
-
state: 'Antwerp',
|
88
|
-
zip: '2550',
|
89
|
-
},
|
90
|
-
birth_date: '1993-11-30',
|
91
|
-
email: 'john.doe@awellhealth.com',
|
92
|
-
mobile_phone: '+32 xxx xx xx xx',
|
93
|
-
phone: '+32 xxx xx xx xx',
|
94
|
-
national_registry_number: '123456789',
|
95
|
-
patient_code: '98765',
|
96
|
-
preferred_language: 'en',
|
97
|
-
sex: graphql_1.Sex.Male,
|
98
|
-
},
|
99
|
-
}, ['first_name', 'email', 'street', 'non_existing_char', ''], language);
|
100
|
-
expect(result).toBe(`${(0, generatePrompt_1.promptQuestion)(language)}
|
101
|
-
|
102
|
-
Characteristic: First Name
|
103
|
-
Value: Nick
|
104
|
-
|
105
|
-
Characteristic: Email
|
106
|
-
Value: john.doe@awellhealth.com
|
107
|
-
|
108
|
-
Characteristic: Street
|
109
|
-
Value: John Doe Street 20`);
|
110
|
-
});
|
111
|
-
test('Should generate a prompt only with characteristics that are defined', async () => {
|
112
|
-
const result = (0, generatePrompt_1.generatePrompt)({
|
113
|
-
id: 'patient-id',
|
114
|
-
profile: {
|
115
|
-
first_name: 'Nick',
|
116
|
-
// last_name: 'Hellemans'
|
117
|
-
sex: undefined,
|
118
|
-
email: 'john.doe@awellhealth.com',
|
119
|
-
address: {
|
120
|
-
street: undefined,
|
121
|
-
},
|
122
|
-
},
|
123
|
-
}, ['first_name', 'last_name', 'sex', 'email', 'street'], language);
|
124
|
-
expect(result).toBe(`${(0, generatePrompt_1.promptQuestion)(language)}
|
125
|
-
|
126
|
-
Characteristic: First Name
|
127
|
-
Value: Nick
|
128
|
-
|
129
|
-
Characteristic: Email
|
130
|
-
Value: john.doe@awellhealth.com`);
|
131
|
-
});
|
132
|
-
});
|
133
|
-
//# sourceMappingURL=generatePrompt.test.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"generatePrompt.test.js","sourceRoot":"","sources":["../../../../../../../../extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.test.ts"],"names":[],"mappings":";;AAAA,oEAA4D;AAC5D,qDAAiE;AAEjE,MAAM,QAAQ,GAAG,SAAS,CAAA;AAE1B,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;IACnD,IAAI,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,MAAM,GAAG,IAAA,+BAAc,EAC3B;YACE,EAAE,EAAE,YAAY;YAChB,OAAO,EAAE;gBACP,UAAU,EAAE,MAAM;gBAClB,SAAS,EAAE,WAAW;gBACtB,OAAO,EAAE;oBACP,MAAM,EAAE,oBAAoB;oBAC5B,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,SAAS;oBAClB,KAAK,EAAE,SAAS;oBAChB,GAAG,EAAE,MAAM;iBACZ;gBACD,UAAU,EAAE,YAAY;gBACxB,KAAK,EAAE,0BAA0B;gBACjC,YAAY,EAAE,kBAAkB;gBAChC,KAAK,EAAE,kBAAkB;gBACzB,wBAAwB,EAAE,WAAW;gBACrC,YAAY,EAAE,OAAO;gBACrB,kBAAkB,EAAE,IAAI;gBACxB,GAAG,EAAE,aAAG,CAAC,IAAI;aACd;SACF,EACD,EAAE,EACF,QAAQ,CACT,CAAA;QAED,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,IAA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AAC,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EACrD,QAAQ,CACT,CAAA;QAED,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,IAAA,+BAAc,EAAC,QAAQ,CAAC;;;;;;gCAMnB,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export { generatePrompt } from './generatePrompt';
|
package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/index.js
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.generatePrompt = void 0;
|
4
|
-
var generatePrompt_1 = require("./generatePrompt");
|
5
|
-
Object.defineProperty(exports, "generatePrompt", { enumerable: true, get: function () { return generatePrompt_1.generatePrompt; } });
|
6
|
-
//# sourceMappingURL=index.js.map
|
package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/index.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAAxC,gHAAA,cAAc,OAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export { generatePrompt } from './generatePromp';
|
@@ -1,6 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.generatePrompt = void 0;
|
4
|
-
var generatePromp_1 = require("./generatePromp");
|
5
|
-
Object.defineProperty(exports, "generatePrompt", { enumerable: true, get: function () { return generatePromp_1.generatePrompt; } });
|
6
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/avaAi/v1/actions/generatePatientSummary/utils/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAAvC,+GAAA,cAAc,OAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export { generatePatientSummary } from './generatePatientSummary';
|
@@ -1,6 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.generatePatientSummary = void 0;
|
4
|
-
var generatePatientSummary_1 = require("./generatePatientSummary");
|
5
|
-
Object.defineProperty(exports, "generatePatientSummary", { enumerable: true, get: function () { return generatePatientSummary_1.generatePatientSummary; } });
|
6
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/avaAi/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA"}
|