@awell-health/awell-extensions 1.0.223 → 1.0.225

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/dist/extensions/athenahealth/actions/addClinicalDocument/addClinicalDocument.test.js +27 -0
  2. package/dist/extensions/athenahealth/actions/addClinicalDocument/addClinicalDocument.test.js.map +1 -1
  3. package/dist/extensions/athenahealth/helpers/htmlToBase64Pdf.js +25 -11
  4. package/dist/extensions/athenahealth/helpers/htmlToBase64Pdf.js.map +1 -1
  5. package/dist/extensions/experimental/index.js +1 -0
  6. package/dist/extensions/experimental/index.js.map +1 -1
  7. package/dist/extensions/experimental/v1/actions/index.d.ts +1 -0
  8. package/dist/extensions/experimental/v1/actions/index.js +3 -1
  9. package/dist/extensions/experimental/v1/actions/index.js.map +1 -1
  10. package/dist/extensions/experimental/v1/actions/patientRecommendation/config/datapoints.d.ts +6 -0
  11. package/dist/extensions/experimental/v1/actions/patientRecommendation/config/datapoints.js +10 -0
  12. package/dist/extensions/experimental/v1/actions/patientRecommendation/config/datapoints.js.map +1 -0
  13. package/dist/extensions/experimental/v1/actions/patientRecommendation/config/fields.d.ts +58 -0
  14. package/dist/extensions/experimental/v1/actions/patientRecommendation/config/fields.js +50 -0
  15. package/dist/extensions/experimental/v1/actions/patientRecommendation/config/fields.js.map +1 -0
  16. package/dist/extensions/experimental/v1/actions/patientRecommendation/config/index.d.ts +2 -0
  17. package/dist/extensions/experimental/v1/actions/patientRecommendation/config/index.js +9 -0
  18. package/dist/extensions/experimental/v1/actions/patientRecommendation/config/index.js.map +1 -0
  19. package/dist/extensions/experimental/v1/actions/patientRecommendation/index.d.ts +1 -0
  20. package/dist/extensions/experimental/v1/actions/patientRecommendation/index.js +6 -0
  21. package/dist/extensions/experimental/v1/actions/patientRecommendation/index.js.map +1 -0
  22. package/dist/extensions/experimental/v1/actions/patientRecommendation/patientRecommendation.d.ts +4 -0
  23. package/dist/extensions/experimental/v1/actions/patientRecommendation/patientRecommendation.js +32 -0
  24. package/dist/extensions/experimental/v1/actions/patientRecommendation/patientRecommendation.js.map +1 -0
  25. package/dist/extensions/experimental/v1/actions/patientRecommendation/patientRecommendation.test.d.ts +1 -0
  26. package/dist/extensions/experimental/v1/actions/patientRecommendation/patientRecommendation.test.js +20 -0
  27. package/dist/extensions/experimental/v1/actions/patientRecommendation/patientRecommendation.test.js.map +1 -0
  28. package/package.json +1 -2
@@ -1,12 +1,39 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  const _1 = require(".");
4
27
  const tests_1 = require("../../../../src/tests");
5
28
  const mockData_1 = require("../../api/__mocks__/mockData");
29
+ const helpers = __importStar(require("../../helpers"));
6
30
  jest.mock('../../api/client');
7
31
  describe('athenahealth - Add clinical document', () => {
8
32
  const onComplete = jest.fn();
9
33
  const onError = jest.fn();
34
+ jest
35
+ .spyOn(helpers, 'htmlToBase64Pdf')
36
+ .mockImplementation(async (_) => 'base64string');
10
37
  beforeEach(() => {
11
38
  jest.clearAllMocks();
12
39
  });
@@ -1 +1 @@
1
- {"version":3,"file":"addClinicalDocument.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/addClinicalDocument/addClinicalDocument.test.ts"],"names":[],"mappings":";;AACA,wBAAuC;AACvC,iDAA2D;AAC3D,2DAA2D;AAE3D,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAE7B,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;IACpD,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,IAAI,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QACjE,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,YAAY,EAAE,GAAG;gBACjB,SAAS,EAAE,OAAO;gBAClB,kBAAkB,EAAE,oBAAoB;aACzC;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,MAAM,sBAAmB,CAAC,iBAAiB,CACzC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAA;IACvC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;;QACxE,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,YAAY,EAAE,GAAG;gBACjB,SAAS,EAAE,aAAa;gBACxB,kBAAkB,EAAE,oBAAoB;aACzC;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,IAAI;YACF,MAAM,sBAAmB,CAAC,iBAAiB,CACzC,0BAA0B,EAC1B,UAAU,EACV,O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eAAe,EAAE,iCAAiC;aACnD,CAAC,CAAA;SACH;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"addClinicalDocument.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/addClinicalDocument/addClinicalDocument.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,wBAAuC;AACvC,iDAA2D;AAC3D,2DAA2D;AAC3D,uDAAwC;AAExC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAE7B,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;IACpD,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IACzB,IAAI;SACD,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC;SACjC,kBAAkB,CAAC,KAAK,EAAE,CAAS,EAAE,EAAE,CAAC,cAAc,CAAC,CAAA;IAE1D,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,IAAI,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QACjE,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,YAAY,EAAE,GAAG;gBACjB,SAAS,EAAE,OAAO;gBAClB,kBAAkB,EAAE,oBAAoB;aACzC;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,MAAM,sBAAmB,CAAC,iBAAiB,CACzC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAA;IACvC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,wDAA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AG,KAAmB,CAAA;YACtC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;YACzC,MAAM,CAAC,MAAA,UAAU,CAAC,QAAQ,0CAAE,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YAC7C,MAAM,CAAC,MAAA,UAAU,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAC,aAAa,CAAC;gBAC9C,KAAK,EAAE,mBAAmB;gBAC1B,eAAe,EAAE,iCAAiC;aACnD,CAAC,CAAA;SACH;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,19 +1,33 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.htmlToBase64Pdf = void 0;
7
- const puppeteer_1 = __importDefault(require("puppeteer"));
8
4
  const htmlToBase64Pdf = async (html) => {
9
- const browser = await puppeteer_1.default.launch();
10
- const page = await browser.newPage();
11
- await page.setContent(html, {
12
- waitUntil: 'networkidle0', // Waits for network connections to finish
5
+ const base64Html = Buffer.from(html).toString('base64');
6
+ const controller = new AbortController();
7
+ const timeoutinMS = async (ms) => {
8
+ // eslint-disable-next-line promise/param-names
9
+ return await new Promise((_, reject) => {
10
+ setTimeout(() => {
11
+ reject(new Error(`Request timed out after ${ms / 1000} seconds`));
12
+ }, ms);
13
+ });
14
+ };
15
+ const request = fetch('https://pdfserver-pqfwkqh3iq-uc.a.run.app', {
16
+ method: 'POST',
17
+ headers: {
18
+ 'Content-Type': 'application/json',
19
+ },
20
+ signal: controller.signal,
21
+ body: JSON.stringify({
22
+ html: base64Html,
23
+ }),
24
+ });
25
+ const response = await Promise.race([request, timeoutinMS(30000)]).catch((err) => {
26
+ controller.abort();
27
+ console.error(err);
28
+ throw err;
13
29
  });
14
- const pdfBuffer = await page.pdf({ format: 'A4' });
15
- const base64Pdf = pdfBuffer.toString('base64');
16
- await browser.close();
30
+ const { pdf: base64Pdf } = await response.json();
17
31
  return base64Pdf;
18
32
  };
19
33
  exports.htmlToBase64Pdf = htmlToBase64Pdf;
@@ -1 +1 @@
1
- {"version":3,"file":"htmlToBase64Pdf.js","sourceRoot":"","sources":["../../../../extensions/athenahealth/helpers/htmlToBase64Pdf.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAiC;AAE1B,MAAM,eAAe,GAAG,KAAK,EAAE,IAAY,EAAmB,EAAE;IACrE,MAAM,OAAO,GAAG,MAAM,mBAAS,CAAC,MAAM,EAAE,CAAA;IACxC,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAA;IAEpC,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;QAC1B,SAAS,EAAE,cAAc,EAAE,0CAA0C;KACtE,CAAC,CAAA;IAEF,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;IAClD,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAE9C,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;IAErB,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAdY,QAAA,eAAe,mBAc3B"}
1
+ {"version":3,"file":"htmlToBase64Pdf.js","sourceRoot":"","sources":["../../../../extensions/athenahealth/helpers/htmlToBase64Pdf.ts"],"names":[],"mappings":";;;AAAO,MAAM,eAAe,GAAG,KAAK,EAAE,IAAY,EAAmB,EAAE;IACrE,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IACvD,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAA;IACxC,MAAM,WAAW,GAAG,KAAK,EAAE,EAAU,EAAkB,EAAE;QACvD,+CAA+C;QAC/C,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;YACrC,UAAU,CAAC,GAAG,EAAE;gBACd,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,EAAE,GAAG,IAAI,UAAU,CAAC,CAAC,CAAA;YACnE,CAAC,EAAE,EAAE,CAAC,CAAA;QACR,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,2CAA2C,EAAE;QACjE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;QACD,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,IAAI,EAAE,UAAU;SACjB,CAAC;KACH,CAAC,CAAA;IACF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CACtE,CAAC,GAAG,EAAE,EAAE;QACN,UAAU,CAAC,KAAK,EAAE,CAAA;QAClB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,GAAG,CAAA;IACX,CAAC,CACF,CAAA;IACD,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;IAChD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AA9BY,QAAA,eAAe,mBA8B3B"}
@@ -18,6 +18,7 @@ exports.Experimental = {
18
18
  requestVideoVisit: actions_1.requestVideoVisit,
19
19
  enterMedication: actions_1.enterMedication,
20
20
  wait: actions_1.wait,
21
+ patientRecommendation: actions_1.patientRecommendation,
21
22
  },
22
23
  };
23
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/experimental/index.ts"],"names":[],"mappings":";;;AAAA,0CAAuE;AAEvE,yCAAqC;AACrC,mEAAoE;AAEvD,QAAA,YAAY,GAAc;IACrC,GAAG,EAAE,cAAc;IACnB,KAAK,EAAE,wBAAwB;IAC/B,QAAQ,EAAE,yDAAyD;IACnE,WAAW,EAAE,qCAAqC;IAClD,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,QAAQ,EAAR,mBAAQ;IACR,OAAO,EAAE;QACP,iBAAiB,EAAjB,2BAAiB;QACjB,eAAe,EAAf,yBAAe;QACf,IAAI,EAAJ,cAAI;KACL;CACF,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/experimental/index.ts"],"names":[],"mappings":";;;AAAA,0CAKqB;AAErB,yCAAqC;AACrC,mEAAoE;AAEvD,QAAA,YAAY,GAAc;IACrC,GAAG,EAAE,cAAc;IACnB,KAAK,EAAE,wBAAwB;IAC/B,QAAQ,EAAE,yDAAyD;IACnE,WAAW,EAAE,qCAAqC;IAClD,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,QAAQ,EAAR,mBAAQ;IACR,OAAO,EAAE;QACP,iBAAiB,EAAjB,2BAAiB;QACjB,eAAe,EAAf,yBAAe;QACf,IAAI,EAAJ,cAAI;QACJ,qBAAqB,EAArB,+BAAqB;KACtB;CACF,CAAA"}
@@ -1,3 +1,4 @@
1
1
  export { requestVideoVisit } from './requestVideoVisit';
2
2
  export { enterMedication } from './enterMedication';
3
3
  export { wait } from './wait';
4
+ export { patientRecommendation } from './patientRecommendation';
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wait = exports.enterMedication = exports.requestVideoVisit = void 0;
3
+ exports.patientRecommendation = exports.wait = exports.enterMedication = exports.requestVideoVisit = void 0;
4
4
  var requestVideoVisit_1 = require("./requestVideoVisit");
5
5
  Object.defineProperty(exports, "requestVideoVisit", { enumerable: true, get: function () { return requestVideoVisit_1.requestVideoVisit; } });
6
6
  var enterMedication_1 = require("./enterMedication");
7
7
  Object.defineProperty(exports, "enterMedication", { enumerable: true, get: function () { return enterMedication_1.enterMedication; } });
8
8
  var wait_1 = require("./wait");
9
9
  Object.defineProperty(exports, "wait", { enumerable: true, get: function () { return wait_1.wait; } });
10
+ var patientRecommendation_1 = require("./patientRecommendation");
11
+ Object.defineProperty(exports, "patientRecommendation", { enumerable: true, get: function () { return patientRecommendation_1.patientRecommendation; } });
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/experimental/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,qDAAmD;AAA1C,kHAAA,eAAe,OAAA;AACxB,+BAA6B;AAApB,4FAAA,IAAI,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/experimental/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,qDAAmD;AAA1C,kHAAA,eAAe,OAAA;AACxB,+BAA6B;AAApB,4FAAA,IAAI,OAAA;AACb,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA"}
@@ -0,0 +1,6 @@
1
+ export declare const dataPoints: {
2
+ acceptRecommendation: {
3
+ key: string;
4
+ valueType: "boolean";
5
+ };
6
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = void 0;
4
+ exports.dataPoints = {
5
+ acceptRecommendation: {
6
+ key: 'acceptRecommendation',
7
+ valueType: 'boolean',
8
+ },
9
+ };
10
+ //# sourceMappingURL=datapoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../../extensions/experimental/v1/actions/patientRecommendation/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,oBAAoB,EAAE;QACpB,GAAG,EAAE,sBAAsB;QAC3B,SAAS,EAAE,SAAS;KACrB;CAC4C,CAAA"}
@@ -0,0 +1,58 @@
1
+ import { FieldType } from '@awell-health/extensions-core';
2
+ import { z } from 'zod';
3
+ export declare const fields: {
4
+ title: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.STRING;
9
+ required: true;
10
+ };
11
+ message: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.HTML;
16
+ required: true;
17
+ };
18
+ acceptRecommendationButtonLabel: {
19
+ id: string;
20
+ label: string;
21
+ description: string;
22
+ type: FieldType.STRING;
23
+ required: true;
24
+ };
25
+ acceptRecommendationDeepLink: {
26
+ id: string;
27
+ label: string;
28
+ description: string;
29
+ type: FieldType.STRING;
30
+ required: true;
31
+ };
32
+ discardRecommendationButtonLabel: {
33
+ id: string;
34
+ label: string;
35
+ description: string;
36
+ type: FieldType.STRING;
37
+ required: true;
38
+ };
39
+ };
40
+ export declare const FieldsValidationSchema: z.ZodObject<{
41
+ title: z.ZodString;
42
+ message: z.ZodString;
43
+ acceptRecommendationButtonLabel: z.ZodString;
44
+ acceptRecommendationDeepLink: z.ZodString;
45
+ discardRecommendationButtonLabel: z.ZodString;
46
+ }, "strip", z.ZodTypeAny, {
47
+ message: string;
48
+ title: string;
49
+ acceptRecommendationButtonLabel: string;
50
+ acceptRecommendationDeepLink: string;
51
+ discardRecommendationButtonLabel: string;
52
+ }, {
53
+ message: string;
54
+ title: string;
55
+ acceptRecommendationButtonLabel: string;
56
+ acceptRecommendationDeepLink: string;
57
+ discardRecommendationButtonLabel: string;
58
+ }>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldsValidationSchema = exports.fields = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const zod_1 = require("zod");
6
+ exports.fields = {
7
+ title: {
8
+ id: 'title',
9
+ label: 'Title',
10
+ description: 'Descriptive title that is shown on the page',
11
+ type: extensions_core_1.FieldType.STRING,
12
+ required: true,
13
+ },
14
+ message: {
15
+ id: 'message',
16
+ label: 'Message',
17
+ description: 'Inform the patient about the recommendation and decision they have to make',
18
+ type: extensions_core_1.FieldType.HTML,
19
+ required: true,
20
+ },
21
+ acceptRecommendationButtonLabel: {
22
+ id: 'acceptRecommendationButtonLabel',
23
+ label: 'Accept recommendation button label',
24
+ description: 'The label of the buton to accept the recommendation and redirect the patient to a different page with a deep link',
25
+ type: extensions_core_1.FieldType.STRING,
26
+ required: true,
27
+ },
28
+ acceptRecommendationDeepLink: {
29
+ id: 'acceptRecommendationDeepLink',
30
+ label: 'Deep link',
31
+ description: 'The deep link the patient is redirected to when accepting the recommendation',
32
+ type: extensions_core_1.FieldType.STRING,
33
+ required: true,
34
+ },
35
+ discardRecommendationButtonLabel: {
36
+ id: 'discardRecommendationButtonLabel',
37
+ label: 'Discard recommendation button label',
38
+ description: 'The label of the button allowing patients to continue and discard the recommendation',
39
+ type: extensions_core_1.FieldType.STRING,
40
+ required: true,
41
+ },
42
+ };
43
+ exports.FieldsValidationSchema = zod_1.z.object({
44
+ title: zod_1.z.string().min(1),
45
+ message: zod_1.z.string().min(1),
46
+ acceptRecommendationButtonLabel: zod_1.z.string().min(1),
47
+ acceptRecommendationDeepLink: zod_1.z.string().min(1),
48
+ discardRecommendationButtonLabel: zod_1.z.string().min(1),
49
+ });
50
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/experimental/v1/actions/patientRecommendation/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE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C,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { fields, FieldsValidationSchema } from './fields';
2
+ export { dataPoints } from './datapoints';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = exports.FieldsValidationSchema = 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, "FieldsValidationSchema", { enumerable: true, get: function () { return fields_1.FieldsValidationSchema; } });
7
+ var datapoints_1 = require("./datapoints");
8
+ Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return datapoints_1.dataPoints; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/experimental/v1/actions/patientRecommendation/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -0,0 +1 @@
1
+ export { patientRecommendation } from './patientRecommendation';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.patientRecommendation = void 0;
4
+ var patientRecommendation_1 = require("./patientRecommendation");
5
+ Object.defineProperty(exports, "patientRecommendation", { enumerable: true, get: function () { return patientRecommendation_1.patientRecommendation; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/patientRecommendation/index.ts"],"names":[],"mappings":";;;AAAA,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../../settings';
3
+ import { fields } from './config';
4
+ export declare const patientRecommendation: Action<typeof fields, typeof settings>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.patientRecommendation = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const extensions_core_2 = require("@awell-health/extensions-core");
6
+ const config_1 = require("./config");
7
+ const zod_1 = require("zod");
8
+ exports.patientRecommendation = {
9
+ key: 'patientRecommendation',
10
+ category: extensions_core_2.Category.WORKFLOW,
11
+ title: 'Patient recommendation',
12
+ description: 'Recommend the patient with an office visit, video chat, ...',
13
+ fields: config_1.fields,
14
+ dataPoints: config_1.dataPoints,
15
+ options: {
16
+ stakeholders: {
17
+ label: 'Stakeholder',
18
+ mode: 'single',
19
+ },
20
+ },
21
+ previewable: false,
22
+ onActivityCreated: async (payload, onComplete, onError) => {
23
+ (0, extensions_core_1.validate)({
24
+ schema: zod_1.z.object({
25
+ fields: config_1.FieldsValidationSchema,
26
+ }),
27
+ payload,
28
+ });
29
+ // Completion happens in Hosted Pages
30
+ },
31
+ };
32
+ //# sourceMappingURL=patientRecommendation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patientRecommendation.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/patientRecommendation/patientRecommendation.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,mEAAwD;AACxD,qCAAqE;AACrE,6BAAuB;AAEV,QAAA,qBAAqB,GAA2C;IAC3E,GAAG,EAAE,uBAAuB;IAC5B,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,6DAA6D;IAC1E,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE;QACP,YAAY,EAAE;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;SACf;KACF;IACD,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,IAAA,0BAAQ,EAAC;YACP,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,MAAM,EAAE,+BAAsB;aAC/B,CAAC;YACF,OAAO;SACR,CAAC,CAAA;QAEF,qCAAqC;IACvC,CAAC;CACF,CAAA"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_1 = require("./config");
4
+ describe('Patient recommendation action', () => {
5
+ beforeEach(() => {
6
+ jest.clearAllMocks();
7
+ });
8
+ test('Action fields validation validation work', async () => {
9
+ expect(() => {
10
+ config_1.FieldsValidationSchema.parse({
11
+ title: 'title',
12
+ message: 'message',
13
+ acceptRecommendationButtonLabel: 'Button label',
14
+ acceptRecommendationDeepLink: 'https://www.test.com',
15
+ discardRecommendationButtonLabel: 'Button label',
16
+ });
17
+ }).not.toThrow();
18
+ });
19
+ });
20
+ //# sourceMappingURL=patientRecommendation.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patientRecommendation.test.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/patientRecommendation/patientRecommendation.test.ts"],"names":[],"mappings":";;AAAA,qCAAiD;AAEjD,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,CAAC,GAAG,EAAE;YACV,+BAAsB,CAAC,KAAK,CAAC;gBAC3B,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE,SAAS;gBAClB,+BAA+B,EAAE,cAAc;gBAC/C,4BAA4B,EAAE,sBAAsB;gBACpD,gCAAgC,EAAE,cAAc;aACjD,CAAC,CAAA;QACJ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;IAClB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "1.0.223",
3
+ "version": "1.0.225",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {
@@ -90,7 +90,6 @@
90
90
  "messagebird": "^4.0.1",
91
91
  "node-fetch": "2",
92
92
  "openai": "^3.2.1",
93
- "puppeteer": "^22.6.1",
94
93
  "showdown": "^2.1.0",
95
94
  "twilio": "^4.8.0",
96
95
  "xml2js": "^0.6.2",