@awell-health/awell-extensions 2.0.74 → 2.0.75

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/elation/actions/{addHistories/addHistories.d.ts → addHistory/addHistory.d.ts} +1 -1
  2. package/dist/extensions/elation/actions/addHistory/addHistory.js +33 -0
  3. package/dist/extensions/elation/actions/addHistory/addHistory.js.map +1 -0
  4. package/dist/extensions/elation/actions/addHistory/config/fields.d.ts +38 -0
  5. package/dist/extensions/elation/actions/addHistory/config/fields.js +38 -0
  6. package/dist/extensions/elation/actions/addHistory/config/fields.js.map +1 -0
  7. package/dist/extensions/elation/actions/addHistory/config/index.js.map +1 -0
  8. package/dist/extensions/elation/actions/addHistory/index.d.ts +1 -0
  9. package/dist/extensions/elation/actions/addHistory/index.js +6 -0
  10. package/dist/extensions/elation/actions/addHistory/index.js.map +1 -0
  11. package/dist/extensions/elation/actions/index.d.ts +5 -82
  12. package/dist/extensions/elation/actions/index.js +2 -2
  13. package/dist/extensions/elation/actions/index.js.map +1 -1
  14. package/dist/extensions/elation/types/history.d.ts +2 -15
  15. package/dist/extensions/elation/types/history.js +3 -4
  16. package/dist/extensions/elation/types/history.js.map +1 -1
  17. package/package.json +1 -1
  18. package/dist/extensions/elation/actions/addHistories/addHistories.js +0 -52
  19. package/dist/extensions/elation/actions/addHistories/addHistories.js.map +0 -1
  20. package/dist/extensions/elation/actions/addHistories/config/fields.d.ts +0 -148
  21. package/dist/extensions/elation/actions/addHistories/config/fields.js +0 -125
  22. package/dist/extensions/elation/actions/addHistories/config/fields.js.map +0 -1
  23. package/dist/extensions/elation/actions/addHistories/config/index.js.map +0 -1
  24. package/dist/extensions/elation/actions/addHistories/index.d.ts +0 -1
  25. package/dist/extensions/elation/actions/addHistories/index.js +0 -6
  26. package/dist/extensions/elation/actions/addHistories/index.js.map +0 -1
  27. /package/dist/extensions/elation/actions/{addHistories → addHistory}/config/index.d.ts +0 -0
  28. /package/dist/extensions/elation/actions/{addHistories → addHistory}/config/index.js +0 -0
@@ -1,4 +1,4 @@
1
1
  import { type Action } from '@awell-health/extensions-core';
2
2
  import { type settings } from '../../settings';
3
3
  import { fields as elationFields } from './config';
4
- export declare const addHistories: Action<typeof elationFields, typeof settings>;
4
+ export declare const addHistory: Action<typeof elationFields, typeof settings>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addHistory = void 0;
4
+ const zod_1 = require("zod");
5
+ const extensions_core_1 = require("@awell-health/extensions-core");
6
+ const settings_1 = require("../../settings");
7
+ const client_1 = require("../../client");
8
+ const config_1 = require("./config");
9
+ exports.addHistory = {
10
+ key: 'addHistory',
11
+ category: extensions_core_1.Category.EHR_INTEGRATIONS,
12
+ title: 'Add History',
13
+ description: "Add history item on Elation's patient page",
14
+ fields: config_1.fields,
15
+ previewable: true,
16
+ onEvent: async ({ payload, onComplete }) => {
17
+ const { fields, settings } = (0, extensions_core_1.validate)({
18
+ schema: zod_1.z.object({
19
+ fields: config_1.FieldsValidationSchema,
20
+ settings: settings_1.SettingsValidationSchema,
21
+ }),
22
+ payload,
23
+ });
24
+ const api = (0, client_1.makeAPIClient)(settings);
25
+ await api.addHistory({
26
+ type: fields.type,
27
+ patient: fields.patientId,
28
+ text: fields.text,
29
+ });
30
+ await onComplete();
31
+ },
32
+ };
33
+ //# sourceMappingURL=addHistory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addHistory.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/addHistory/addHistory.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,mEAA+E;AAC/E,6CAAwE;AACxE,yCAA4C;AAC5C,qCAA0E;AAE7D,QAAA,UAAU,GAAkD;IACvE,GAAG,EAAE,YAAY;IACjB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,4CAA4C;IACzD,MAAM,EAAE,eAAa;IACrB,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAiB,EAAE;QACxD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,0BAAQ,EAAC;YACpC,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,MAAM,EAAE,+BAAsB;gBAC9B,QAAQ,EAAE,mCAAwB;aACnC,CAAC;YACF,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,GAAG,GAAG,IAAA,sBAAa,EAAC,QAAQ,CAAC,CAAA;QAEnC,MAAM,GAAG,CAAC,UAAU,CAAC;YACnB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,SAAS;YACzB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC,CAAA;QAEF,MAAM,UAAU,EAAE,CAAA;IACpB,CAAC;CACF,CAAA"}
@@ -0,0 +1,38 @@
1
+ import { FieldType } from '@awell-health/extensions-core';
2
+ import z from 'zod';
3
+ export declare const fields: {
4
+ patientId: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.NUMERIC;
9
+ required: true;
10
+ };
11
+ type: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.STRING;
16
+ required: true;
17
+ };
18
+ text: {
19
+ id: string;
20
+ label: string;
21
+ description: string;
22
+ type: FieldType.STRING;
23
+ required: true;
24
+ };
25
+ };
26
+ export declare const FieldsValidationSchema: z.ZodObject<{
27
+ patientId: z.ZodNumber;
28
+ type: z.ZodEnum<["Past", "Family", "Social", "Habits", "Diet", "Exercise", "Immunization", "Legal", "Consultation", "Health Maintenance", "Past Surgical", "Cognitive Status", "Functional Status"]>;
29
+ text: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ type: "Past" | "Family" | "Social" | "Habits" | "Diet" | "Exercise" | "Immunization" | "Legal" | "Consultation" | "Health Maintenance" | "Past Surgical" | "Cognitive Status" | "Functional Status";
32
+ patientId: number;
33
+ text: string;
34
+ }, {
35
+ type: "Past" | "Family" | "Social" | "Habits" | "Diet" | "Exercise" | "Immunization" | "Legal" | "Consultation" | "Health Maintenance" | "Past Surgical" | "Cognitive Status" | "Functional Status";
36
+ patientId: number;
37
+ text: string;
38
+ }>;
@@ -0,0 +1,38 @@
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.FieldsValidationSchema = exports.fields = void 0;
7
+ const extensions_core_1 = require("@awell-health/extensions-core");
8
+ const zod_1 = __importDefault(require("zod"));
9
+ const history_1 = require("../../../types/history");
10
+ exports.fields = {
11
+ patientId: {
12
+ id: 'patientId',
13
+ label: 'Patient ID',
14
+ description: 'The patient for whom the the history is being created',
15
+ type: extensions_core_1.FieldType.NUMERIC,
16
+ required: true,
17
+ },
18
+ type: {
19
+ id: 'type',
20
+ label: 'Type',
21
+ description: 'The type of history being created. Supported values: Past, Family, Social, Habits, Diet, Exercise, Immunization, Legal, Consultation, Health Maintenance, Past Surgical, Cognitive Status, Functional Status',
22
+ type: extensions_core_1.FieldType.STRING,
23
+ required: true,
24
+ },
25
+ text: {
26
+ id: 'text',
27
+ label: 'Text',
28
+ description: 'The text of the history being created',
29
+ type: extensions_core_1.FieldType.STRING,
30
+ required: true,
31
+ },
32
+ };
33
+ exports.FieldsValidationSchema = zod_1.default.object({
34
+ patientId: extensions_core_1.NumericIdSchema,
35
+ type: history_1.HistoryTypes,
36
+ text: zod_1.default.string(),
37
+ });
38
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/elation/actions/addHistory/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAIsC;AACtC,8CAAwC;AACxC,oDAAqD;AAExC,QAAA,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,uDAAuD;QACpE,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,WAAW,EACT,8MAA8M;QAChN,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,uCAAuC;QACpD,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,iCAAe;IAC1B,IAAI,EAAE,sBAAY;IAClB,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE;CACiC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/elation/actions/addHistory/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA"}
@@ -0,0 +1 @@
1
+ export { addHistory } from './addHistory';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addHistory = void 0;
4
+ var addHistory_1 = require("./addHistory");
5
+ Object.defineProperty(exports, "addHistory", { enumerable: true, get: function () { return addHistory_1.addHistory; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/addHistory/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -1375,7 +1375,7 @@ export declare const actions: {
1375
1375
  required: true;
1376
1376
  };
1377
1377
  }, "messageThreadId">;
1378
- addHistories: import("@awell-health/extensions-core").Action<{
1378
+ addHistory: import("@awell-health/extensions-core").Action<{
1379
1379
  patientId: {
1380
1380
  id: string;
1381
1381
  label: string;
@@ -1383,96 +1383,19 @@ export declare const actions: {
1383
1383
  type: import("@awell-health/extensions-core").FieldType.NUMERIC;
1384
1384
  required: true;
1385
1385
  };
1386
- past: {
1386
+ type: {
1387
1387
  id: string;
1388
1388
  label: string;
1389
1389
  description: string;
1390
1390
  type: import("@awell-health/extensions-core").FieldType.STRING;
1391
- required: false;
1392
- };
1393
- family: {
1394
- id: string;
1395
- label: string;
1396
- description: string;
1397
- type: import("@awell-health/extensions-core").FieldType.STRING;
1398
- required: false;
1399
- };
1400
- social: {
1401
- id: string;
1402
- label: string;
1403
- description: string;
1404
- type: import("@awell-health/extensions-core").FieldType.STRING;
1405
- required: false;
1406
- };
1407
- habits: {
1408
- id: string;
1409
- label: string;
1410
- description: string;
1411
- type: import("@awell-health/extensions-core").FieldType.STRING;
1412
- required: false;
1413
- };
1414
- diet: {
1415
- id: string;
1416
- label: string;
1417
- description: string;
1418
- type: import("@awell-health/extensions-core").FieldType.STRING;
1419
- required: false;
1420
- };
1421
- exercise: {
1422
- id: string;
1423
- label: string;
1424
- description: string;
1425
- type: import("@awell-health/extensions-core").FieldType.STRING;
1426
- required: false;
1427
- };
1428
- immunization: {
1429
- id: string;
1430
- label: string;
1431
- description: string;
1432
- type: import("@awell-health/extensions-core").FieldType.STRING;
1433
- required: false;
1434
- };
1435
- legal: {
1436
- id: string;
1437
- label: string;
1438
- description: string;
1439
- type: import("@awell-health/extensions-core").FieldType.STRING;
1440
- required: false;
1441
- };
1442
- consultation: {
1443
- id: string;
1444
- label: string;
1445
- description: string;
1446
- type: import("@awell-health/extensions-core").FieldType.STRING;
1447
- required: false;
1448
- };
1449
- healthMaintenance: {
1450
- id: string;
1451
- label: string;
1452
- description: string;
1453
- type: import("@awell-health/extensions-core").FieldType.STRING;
1454
- required: false;
1455
- };
1456
- pastSurgical: {
1457
- id: string;
1458
- label: string;
1459
- description: string;
1460
- type: import("@awell-health/extensions-core").FieldType.STRING;
1461
- required: false;
1462
- };
1463
- cognitiveStatus: {
1464
- id: string;
1465
- label: string;
1466
- description: string;
1467
- type: import("@awell-health/extensions-core").FieldType.STRING;
1468
- required: false;
1391
+ required: true;
1469
1392
  };
1470
- functionalStatus: {
1393
+ text: {
1471
1394
  id: string;
1472
1395
  label: string;
1473
1396
  description: string;
1474
1397
  type: import("@awell-health/extensions-core").FieldType.STRING;
1475
- required: false;
1398
+ required: true;
1476
1399
  };
1477
1400
  }, {
1478
1401
  base_url: {
@@ -16,7 +16,7 @@ const getPhysician_1 = require("./getPhysician");
16
16
  const postLetter_1 = require("./postLetter");
17
17
  const createLabOrder_1 = require("./createLabOrder");
18
18
  const createMessageThread_1 = require("./createMessageThread");
19
- const addHistories_1 = require("./addHistories/addHistories");
19
+ const addHistory_1 = require("./addHistory/addHistory");
20
20
  const addAllergy_1 = require("./addAllergy/addAllergy");
21
21
  exports.actions = {
22
22
  getPatient: getPatient_1.getPatient,
@@ -34,7 +34,7 @@ exports.actions = {
34
34
  postLetter: postLetter_1.postLetter,
35
35
  createLabOrder: createLabOrder_1.createLabOrder,
36
36
  createMessageThread: createMessageThread_1.createMessageThread,
37
- addHistories: addHistories_1.addHistories,
37
+ addHistory: addHistory_1.addHistory,
38
38
  addAllergy: addAllergy_1.addAllergy,
39
39
  };
40
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/elation/actions/index.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AACzC,mDAA+C;AAC/C,mDAA+C;AAC/C,2DAAuD;AACvD,qDAAiD;AACjD,yDAAqD;AACrD,mDAA+C;AAC/C,6DAAyD;AACzD,6DAAyD;AACzD,uDAAmD;AACnD,6DAAyD;AACzD,iDAA6C;AAC7C,6CAAyC;AACzC,qDAAiD;AACjD,+DAA2D;AAC3D,8DAA0D;AAC1D,wDAAoD;AAEvC,QAAA,OAAO,GAAG;IACrB,UAAU,EAAV,uBAAU;IACV,aAAa,EAAb,6BAAa;IACb,aAAa,EAAb,6BAAa;IACb,iBAAiB,EAAjB,qCAAiB;IACjB,cAAc,EAAd,+BAAc;IACd,gBAAgB,EAAhB,mCAAgB;IAChB,YAAY,EAAZ,2BAAY;IACZ,aAAa,EAAb,6BAAa;IACb,kBAAkB,EAAlB,uCAAkB;IAClB,kBAAkB,EAAlB,uCAAkB;IAClB,eAAe,EAAf,iCAAe;IACf,kBAAkB,EAAlB,uCAAkB;IAClB,UAAU,EAAV,uBAAU;IACV,cAAc,EAAd,+BAAc;IACd,mBAAmB,EAAnB,yCAAmB;IACnB,YAAY,EAAZ,2BAAY;IACZ,UAAU,EAAV,uBAAU;CACX,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/elation/actions/index.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AACzC,mDAA+C;AAC/C,mDAA+C;AAC/C,2DAAuD;AACvD,qDAAiD;AACjD,yDAAqD;AACrD,mDAA+C;AAC/C,6DAAyD;AACzD,6DAAyD;AACzD,uDAAmD;AACnD,6DAAyD;AACzD,iDAA6C;AAC7C,6CAAyC;AACzC,qDAAiD;AACjD,+DAA2D;AAC3D,wDAAoD;AACpD,wDAAoD;AAEvC,QAAA,OAAO,GAAG;IACrB,UAAU,EAAV,uBAAU;IACV,aAAa,EAAb,6BAAa;IACb,aAAa,EAAb,6BAAa;IACb,iBAAiB,EAAjB,qCAAiB;IACjB,cAAc,EAAd,+BAAc;IACd,gBAAgB,EAAhB,mCAAgB;IAChB,YAAY,EAAZ,2BAAY;IACZ,aAAa,EAAb,6BAAa;IACb,kBAAkB,EAAlB,uCAAkB;IAClB,kBAAkB,EAAlB,uCAAkB;IAClB,eAAe,EAAf,iCAAe;IACf,kBAAkB,EAAlB,uCAAkB;IAClB,UAAU,EAAV,uBAAU;IACV,cAAc,EAAd,+BAAc;IACd,mBAAmB,EAAnB,yCAAmB;IACnB,UAAU,EAAV,uBAAU;IACV,UAAU,EAAV,uBAAU;CACX,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import * as z from 'zod';
2
- export declare const HistoryTypeSchema: z.ZodEnum<["Past", "Family", "Social", "Habits", "Diet", "Exercise", "Immunization", "Legal", "Consultation", "Health Maintenance", "Past Surgical", "Cognitive Status", "Functional Status"]>;
2
+ export declare const HistoryTypes: z.ZodEnum<["Past", "Family", "Social", "Habits", "Diet", "Exercise", "Immunization", "Legal", "Consultation", "Health Maintenance", "Past Surgical", "Cognitive Status", "Functional Status"]>;
3
3
  export declare const historySchema: z.ZodObject<{
4
4
  type: z.ZodEnum<["Past", "Family", "Social", "Habits", "Diet", "Exercise", "Immunization", "Legal", "Consultation", "Health Maintenance", "Past Surgical", "Cognitive Status", "Functional Status"]>;
5
5
  patient: z.ZodNumber;
@@ -13,23 +13,10 @@ export declare const historySchema: z.ZodObject<{
13
13
  patient: number;
14
14
  text: string;
15
15
  }>;
16
- export declare const historyArraySchema: z.ZodArray<z.ZodObject<{
17
- type: z.ZodEnum<["Past", "Family", "Social", "Habits", "Diet", "Exercise", "Immunization", "Legal", "Consultation", "Health Maintenance", "Past Surgical", "Cognitive Status", "Functional Status"]>;
18
- patient: z.ZodNumber;
19
- text: z.ZodString;
20
- }, "strict", z.ZodTypeAny, {
21
- type: "Past" | "Family" | "Social" | "Habits" | "Diet" | "Exercise" | "Immunization" | "Legal" | "Consultation" | "Health Maintenance" | "Past Surgical" | "Cognitive Status" | "Functional Status";
22
- patient: number;
23
- text: string;
24
- }, {
25
- type: "Past" | "Family" | "Social" | "Habits" | "Diet" | "Exercise" | "Immunization" | "Legal" | "Consultation" | "Health Maintenance" | "Past Surgical" | "Cognitive Status" | "Functional Status";
26
- patient: number;
27
- text: string;
28
- }>, "many">;
29
16
  export type addHistoryInput = z.infer<typeof historySchema>;
30
17
  export interface addHistoryResponse {
31
18
  id: number;
32
- type: typeof HistoryTypeSchema;
19
+ type: typeof HistoryTypes;
33
20
  rank: number;
34
21
  text: string;
35
22
  patient: number;
@@ -23,10 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.historyArraySchema = exports.historySchema = exports.HistoryTypeSchema = void 0;
26
+ exports.historySchema = exports.HistoryTypes = void 0;
27
27
  const extensions_core_1 = require("@awell-health/extensions-core");
28
28
  const z = __importStar(require("zod"));
29
- exports.HistoryTypeSchema = z.enum([
29
+ exports.HistoryTypes = z.enum([
30
30
  'Past',
31
31
  'Family',
32
32
  'Social',
@@ -43,10 +43,9 @@ exports.HistoryTypeSchema = z.enum([
43
43
  ]);
44
44
  exports.historySchema = z
45
45
  .object({
46
- type: exports.HistoryTypeSchema,
46
+ type: exports.HistoryTypes,
47
47
  patient: extensions_core_1.NumericIdSchema,
48
48
  text: z.string(),
49
49
  })
50
50
  .strict();
51
- exports.historyArraySchema = z.array(exports.historySchema);
52
51
  //# sourceMappingURL=history.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"history.js","sourceRoot":"","sources":["../../../../extensions/elation/types/history.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAA+D;AAC/D,uCAAwB;AAEX,QAAA,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC;IACtC,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,UAAU;IACV,cAAc;IACd,OAAO;IACP,cAAc;IACd,oBAAoB;IACpB,eAAe;IACf,kBAAkB;IAClB,mBAAmB;CACpB,CAAC,CAAA;AAEW,QAAA,aAAa,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,IAAI,EAAE,yBAAiB;IACvB,OAAO,EAAE,iCAAe;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC;KACD,MAAM,EAAE,CAAA;AAEE,QAAA,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,qBAAa,CAAC,CAAA"}
1
+ {"version":3,"file":"history.js","sourceRoot":"","sources":["../../../../extensions/elation/types/history.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAA+D;AAC/D,uCAAwB;AAEX,QAAA,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC;IACjC,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,UAAU;IACV,cAAc;IACd,OAAO;IACP,cAAc;IACd,oBAAoB;IACpB,eAAe;IACf,kBAAkB;IAClB,mBAAmB;CACpB,CAAC,CAAA;AAEW,QAAA,aAAa,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,IAAI,EAAE,oBAAY;IAClB,OAAO,EAAE,iCAAe;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC;KACD,MAAM,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "2.0.74",
3
+ "version": "2.0.75",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addHistories = void 0;
4
- const zod_1 = require("zod");
5
- const extensions_core_1 = require("@awell-health/extensions-core");
6
- const settings_1 = require("../../settings");
7
- const client_1 = require("../../client");
8
- const config_1 = require("./config");
9
- exports.addHistories = {
10
- key: 'addHistories',
11
- category: extensions_core_1.Category.EHR_INTEGRATIONS,
12
- title: 'Add Histories',
13
- description: "Add history items on Elation's patient page",
14
- fields: config_1.fields,
15
- previewable: true,
16
- onEvent: async ({ payload, onComplete }) => {
17
- const { fields, settings } = (0, extensions_core_1.validate)({
18
- schema: zod_1.z.object({
19
- fields: config_1.FieldsValidationSchema,
20
- settings: settings_1.SettingsValidationSchema,
21
- }),
22
- payload,
23
- });
24
- // we can execute up to 12 time so we want to capture if any of the fields failed
25
- const failedFields = [];
26
- const api = (0, client_1.makeAPIClient)(settings);
27
- // Get all field names except 'patientId'
28
- const fieldNames = Object.keys(fields).filter((field) => field !== 'patientId');
29
- // Attempt to add histories for each field
30
- await Promise.all(fieldNames.map(async (field) => {
31
- var _a;
32
- const key = field;
33
- const type = (_a = config_1.fields[key]) === null || _a === void 0 ? void 0 : _a.label;
34
- try {
35
- await api.addHistory({
36
- type,
37
- patient: fields.patientId,
38
- text: field,
39
- });
40
- }
41
- catch (failedField) {
42
- const errMessage = failedField instanceof Error ? failedField.message : 'failed to add';
43
- failedFields.push(`${type}: ${errMessage}`);
44
- }
45
- }));
46
- if (failedFields.length > 0) {
47
- throw new Error(`Failed to create histories for fields: ${failedFields.join(', ')}`);
48
- }
49
- await onComplete();
50
- },
51
- };
52
- //# sourceMappingURL=addHistories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addHistories.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/addHistories/addHistories.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAIvB,mEAA+E;AAC/E,6CAAwE;AACxE,yCAA4C;AAC5C,qCAA0E;AAG7D,QAAA,YAAY,GAAkD;IACzE,GAAG,EAAE,cAAc;IACnB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,6CAA6C;IAC1D,MAAM,EAAE,eAAa;IACrB,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAiB,EAAE;QACxD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,0BAAQ,EAAC;YACpC,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,MAAM,EAAE,+BAAsB;gBAC9B,QAAQ,EAAE,mCAAwB;aACnC,CAAC;YACF,OAAO;SACR,CAAC,CAAA;QACF,iFAAiF;QACjF,MAAM,YAAY,GAAa,EAAE,CAAA;QAEjC,MAAM,GAAG,GAAG,IAAA,sBAAa,EAAC,QAAQ,CAAC,CAAA;QAEnC,yCAAyC;QACzC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAC3C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,WAAW,CACjC,CAAA;QAED,0CAA0C;QAC1C,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;;YAC7B,MAAM,GAAG,GAAG,KAAmC,CAAA;YAC/C,MAAM,IAAI,GAAG,MAAA,eAAa,CAAC,GAAG,CAAC,0CAAE,KAEhC,CAAA;YAED,IAAI;gBACF,MAAM,GAAG,CAAC,UAAU,CAAC;oBACnB,IAAI;oBACJ,OAAO,EAAE,MAAM,CAAC,SAAS;oBACzB,IAAI,EAAE,KAAK;iBACZ,CAAC,CAAA;aACH;YAAC,OAAO,WAAW,EAAE;gBACpB,MAAM,UAAU,GACd,WAAW,YAAY,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAA;gBACtE,YAAY,CAAC,IAAI,CAAC,GAAG,IAAI,KAAK,UAAU,EAAE,CAAC,CAAA;aAC5C;QACH,CAAC,CAAC,CACH,CAAA;QAED,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,MAAM,IAAI,KAAK,CACb,0CAA0C,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACpE,CAAA;SACF;QACD,MAAM,UAAU,EAAE,CAAA;IACpB,CAAC;CACF,CAAA"}
@@ -1,148 +0,0 @@
1
- import { FieldType } from '@awell-health/extensions-core';
2
- import z from 'zod';
3
- export declare const fields: {
4
- patientId: {
5
- id: string;
6
- label: string;
7
- description: string;
8
- type: FieldType.NUMERIC;
9
- required: true;
10
- };
11
- past: {
12
- id: string;
13
- label: string;
14
- description: string;
15
- type: FieldType.STRING;
16
- required: false;
17
- };
18
- family: {
19
- id: string;
20
- label: string;
21
- description: string;
22
- type: FieldType.STRING;
23
- required: false;
24
- };
25
- social: {
26
- id: string;
27
- label: string;
28
- description: string;
29
- type: FieldType.STRING;
30
- required: false;
31
- };
32
- habits: {
33
- id: string;
34
- label: string;
35
- description: string;
36
- type: FieldType.STRING;
37
- required: false;
38
- };
39
- diet: {
40
- id: string;
41
- label: string;
42
- description: string;
43
- type: FieldType.STRING;
44
- required: false;
45
- };
46
- exercise: {
47
- id: string;
48
- label: string;
49
- description: string;
50
- type: FieldType.STRING;
51
- required: false;
52
- };
53
- immunization: {
54
- id: string;
55
- label: string;
56
- description: string;
57
- type: FieldType.STRING;
58
- required: false;
59
- };
60
- legal: {
61
- id: string;
62
- label: string;
63
- description: string;
64
- type: FieldType.STRING;
65
- required: false;
66
- };
67
- consultation: {
68
- id: string;
69
- label: string;
70
- description: string;
71
- type: FieldType.STRING;
72
- required: false;
73
- };
74
- healthMaintenance: {
75
- id: string;
76
- label: string;
77
- description: string;
78
- type: FieldType.STRING;
79
- required: false;
80
- };
81
- pastSurgical: {
82
- id: string;
83
- label: string;
84
- description: string;
85
- type: FieldType.STRING;
86
- required: false;
87
- };
88
- cognitiveStatus: {
89
- id: string;
90
- label: string;
91
- description: string;
92
- type: FieldType.STRING;
93
- required: false;
94
- };
95
- functionalStatus: {
96
- id: string;
97
- label: string;
98
- description: string;
99
- type: FieldType.STRING;
100
- required: false;
101
- };
102
- };
103
- export declare const FieldsValidationSchema: z.ZodObject<{
104
- patientId: z.ZodNumber;
105
- past: z.ZodOptional<z.ZodString>;
106
- family: z.ZodOptional<z.ZodString>;
107
- social: z.ZodOptional<z.ZodString>;
108
- habits: z.ZodOptional<z.ZodString>;
109
- diet: z.ZodOptional<z.ZodString>;
110
- exercise: z.ZodOptional<z.ZodString>;
111
- immunization: z.ZodOptional<z.ZodString>;
112
- legal: z.ZodOptional<z.ZodString>;
113
- consultation: z.ZodOptional<z.ZodString>;
114
- healthMaintenance: z.ZodOptional<z.ZodString>;
115
- pastSurgical: z.ZodOptional<z.ZodString>;
116
- cognitiveStatus: z.ZodOptional<z.ZodString>;
117
- functionalStatus: z.ZodOptional<z.ZodString>;
118
- }, "strip", z.ZodTypeAny, {
119
- patientId: number;
120
- family?: string | undefined;
121
- past?: string | undefined;
122
- social?: string | undefined;
123
- habits?: string | undefined;
124
- diet?: string | undefined;
125
- exercise?: string | undefined;
126
- immunization?: string | undefined;
127
- legal?: string | undefined;
128
- consultation?: string | undefined;
129
- healthMaintenance?: string | undefined;
130
- pastSurgical?: string | undefined;
131
- cognitiveStatus?: string | undefined;
132
- functionalStatus?: string | undefined;
133
- }, {
134
- patientId: number;
135
- family?: string | undefined;
136
- past?: string | undefined;
137
- social?: string | undefined;
138
- habits?: string | undefined;
139
- diet?: string | undefined;
140
- exercise?: string | undefined;
141
- immunization?: string | undefined;
142
- legal?: string | undefined;
143
- consultation?: string | undefined;
144
- healthMaintenance?: string | undefined;
145
- pastSurgical?: string | undefined;
146
- cognitiveStatus?: string | undefined;
147
- functionalStatus?: string | undefined;
148
- }>;
@@ -1,125 +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.FieldsValidationSchema = exports.fields = void 0;
7
- const extensions_core_1 = require("@awell-health/extensions-core");
8
- const zod_1 = __importDefault(require("zod"));
9
- exports.fields = {
10
- patientId: {
11
- id: 'patientId',
12
- label: 'Patient ID',
13
- description: 'The patient for whom the the history is being created',
14
- type: extensions_core_1.FieldType.NUMERIC,
15
- required: true,
16
- },
17
- past: {
18
- id: 'past',
19
- label: 'Past',
20
- description: 'Add past history item',
21
- type: extensions_core_1.FieldType.STRING,
22
- required: false,
23
- },
24
- family: {
25
- id: 'family',
26
- label: 'Family',
27
- description: 'Add family history item',
28
- type: extensions_core_1.FieldType.STRING,
29
- required: false,
30
- },
31
- social: {
32
- id: 'social',
33
- label: 'Social',
34
- description: 'Add social history item',
35
- type: extensions_core_1.FieldType.STRING,
36
- required: false,
37
- },
38
- habits: {
39
- id: 'habits',
40
- label: 'Habits',
41
- description: 'Add habits history item',
42
- type: extensions_core_1.FieldType.STRING,
43
- required: false,
44
- },
45
- diet: {
46
- id: 'diet',
47
- label: 'Diet',
48
- description: 'Add diet history item',
49
- type: extensions_core_1.FieldType.STRING,
50
- required: false,
51
- },
52
- exercise: {
53
- id: 'exercise',
54
- label: 'Exercise',
55
- description: 'Add exercise history item',
56
- type: extensions_core_1.FieldType.STRING,
57
- required: false,
58
- },
59
- immunization: {
60
- id: 'immunization',
61
- label: 'Immunization',
62
- description: 'Add immunization history item',
63
- type: extensions_core_1.FieldType.STRING,
64
- required: false,
65
- },
66
- legal: {
67
- id: 'legal',
68
- label: 'Legal',
69
- description: 'Add legal history item',
70
- type: extensions_core_1.FieldType.STRING,
71
- required: false,
72
- },
73
- consultation: {
74
- id: 'consultation',
75
- label: 'Consultation',
76
- description: 'Add consultation history item',
77
- type: extensions_core_1.FieldType.STRING,
78
- required: false,
79
- },
80
- healthMaintenance: {
81
- id: 'healthMaintenance',
82
- label: 'Health Maintenance',
83
- description: 'Add health maintenance history item',
84
- type: extensions_core_1.FieldType.STRING,
85
- required: false,
86
- },
87
- pastSurgical: {
88
- id: 'pastSurgical',
89
- label: 'Past Surgical',
90
- description: 'Add surgical history item',
91
- type: extensions_core_1.FieldType.STRING,
92
- required: false,
93
- },
94
- cognitiveStatus: {
95
- id: 'cognitiveStatus',
96
- label: 'Cognitive Status',
97
- description: 'Add cognitive history item',
98
- type: extensions_core_1.FieldType.STRING,
99
- required: false,
100
- },
101
- functionalStatus: {
102
- id: 'functionalStatus',
103
- label: 'Functional Status',
104
- description: 'Add functional history item',
105
- type: extensions_core_1.FieldType.STRING,
106
- required: false,
107
- },
108
- };
109
- exports.FieldsValidationSchema = zod_1.default.object({
110
- patientId: extensions_core_1.NumericIdSchema,
111
- past: zod_1.default.string().optional(),
112
- family: zod_1.default.string().optional(),
113
- social: zod_1.default.string().optional(),
114
- habits: zod_1.default.string().optional(),
115
- diet: zod_1.default.string().optional(),
116
- exercise: zod_1.default.string().optional(),
117
- immunization: zod_1.default.string().optional(),
118
- legal: zod_1.default.string().optional(),
119
- consultation: zod_1.default.string().optional(),
120
- healthMaintenance: zod_1.default.string().optional(),
121
- pastSurgical: zod_1.default.string().optional(),
122
- cognitiveStatus: zod_1.default.string().optional(),
123
- functionalStatus: zod_1.default.string().optional(),
124
- });
125
- //# sourceMappingURL=fields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/elation/actions/addHistories/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAIsC;AACtC,8CAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,uDAAuD;QACpE,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,MAAM,EAAE;QACN,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,yBAAyB;QACtC,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,MAAM,EAAE;QACN,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,yBAAyB;QACtC,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,MAAM,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AE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACU,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/elation/actions/addHistories/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA"}
@@ -1 +0,0 @@
1
- export { addHistories } from './addHistories';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addHistories = void 0;
4
- var addHistories_1 = require("./addHistories");
5
- Object.defineProperty(exports, "addHistories", { enumerable: true, get: function () { return addHistories_1.addHistories; } });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/addHistories/index.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAApC,4GAAA,YAAY,OAAA"}