@awell-health/awell-extensions 1.0.184 → 1.0.187

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.d.ts +4 -0
  2. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.js +24 -0
  3. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.js.map +1 -0
  4. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.test.d.ts +1 -0
  5. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.test.js +31 -0
  6. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.test.js.map +1 -0
  7. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/datapoints.d.ts +1 -0
  8. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/datapoints.js +5 -0
  9. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/datapoints.js.map +1 -0
  10. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/fields.d.ts +68 -0
  11. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/fields.js +61 -0
  12. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/fields.js.map +1 -0
  13. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/index.d.ts +2 -0
  14. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/index.js +9 -0
  15. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/index.js.map +1 -0
  16. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/index.d.ts +1 -0
  17. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/index.js +6 -0
  18. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/index.js.map +1 -0
  19. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.d.ts +4 -0
  20. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.js +24 -0
  21. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.js.map +1 -0
  22. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.test.d.ts +1 -0
  23. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.test.js +29 -0
  24. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.test.js.map +1 -0
  25. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/datapoints.d.ts +1 -0
  26. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/datapoints.js +5 -0
  27. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/datapoints.js.map +1 -0
  28. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/fields.d.ts +48 -0
  29. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/fields.js +45 -0
  30. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/fields.js.map +1 -0
  31. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/index.d.ts +2 -0
  32. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/index.js +9 -0
  33. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/index.js.map +1 -0
  34. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/index.d.ts +1 -0
  35. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/index.js +6 -0
  36. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/index.js.map +1 -0
  37. package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.d.ts +4 -0
  38. package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.js +24 -0
  39. package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.js.map +1 -0
  40. package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.test.d.ts +1 -0
  41. package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.test.js +27 -0
  42. package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.test.js.map +1 -0
  43. package/dist/extensions/athenahealth/actions/cancelAppointment/config/datapoints.d.ts +1 -0
  44. package/dist/extensions/athenahealth/actions/cancelAppointment/config/datapoints.js +5 -0
  45. package/dist/extensions/athenahealth/actions/cancelAppointment/config/datapoints.js.map +1 -0
  46. package/dist/extensions/athenahealth/actions/cancelAppointment/config/fields.d.ts +28 -0
  47. package/dist/extensions/athenahealth/actions/cancelAppointment/config/fields.js +29 -0
  48. package/dist/extensions/athenahealth/actions/cancelAppointment/config/fields.js.map +1 -0
  49. package/dist/extensions/athenahealth/actions/cancelAppointment/config/index.d.ts +2 -0
  50. package/dist/extensions/athenahealth/actions/cancelAppointment/config/index.js +9 -0
  51. package/dist/extensions/athenahealth/actions/cancelAppointment/config/index.js.map +1 -0
  52. package/dist/extensions/athenahealth/actions/cancelAppointment/index.d.ts +1 -0
  53. package/dist/extensions/athenahealth/actions/cancelAppointment/index.js +6 -0
  54. package/dist/extensions/athenahealth/actions/cancelAppointment/index.js.map +1 -0
  55. package/dist/extensions/athenahealth/actions/getAppointment/config/datapoints.d.ts +22 -0
  56. package/dist/extensions/athenahealth/actions/getAppointment/config/datapoints.js +26 -0
  57. package/dist/extensions/athenahealth/actions/getAppointment/config/datapoints.js.map +1 -0
  58. package/dist/extensions/athenahealth/actions/getAppointment/config/fields.d.ts +28 -0
  59. package/dist/extensions/athenahealth/actions/getAppointment/config/fields.js +29 -0
  60. package/dist/extensions/athenahealth/actions/getAppointment/config/fields.js.map +1 -0
  61. package/dist/extensions/athenahealth/actions/getAppointment/config/index.d.ts +2 -0
  62. package/dist/extensions/athenahealth/actions/getAppointment/config/index.js +9 -0
  63. package/dist/extensions/athenahealth/actions/getAppointment/config/index.js.map +1 -0
  64. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.d.ts +4 -0
  65. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.js +32 -0
  66. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.js.map +1 -0
  67. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.test.d.ts +1 -0
  68. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.test.js +35 -0
  69. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.test.js.map +1 -0
  70. package/dist/extensions/athenahealth/actions/getAppointment/index.d.ts +1 -0
  71. package/dist/extensions/athenahealth/actions/getAppointment/index.js +6 -0
  72. package/dist/extensions/athenahealth/actions/getAppointment/index.js.map +1 -0
  73. package/dist/extensions/athenahealth/actions/getPatient/config/datapoints.d.ts +18 -0
  74. package/dist/extensions/athenahealth/actions/getPatient/config/datapoints.js +22 -0
  75. package/dist/extensions/athenahealth/actions/getPatient/config/datapoints.js.map +1 -0
  76. package/dist/extensions/athenahealth/actions/getPatient/config/fields.d.ts +28 -0
  77. package/dist/extensions/athenahealth/actions/getPatient/config/fields.js +29 -0
  78. package/dist/extensions/athenahealth/actions/getPatient/config/fields.js.map +1 -0
  79. package/dist/extensions/athenahealth/actions/getPatient/config/index.d.ts +2 -0
  80. package/dist/extensions/athenahealth/actions/getPatient/config/index.js +9 -0
  81. package/dist/extensions/athenahealth/actions/getPatient/config/index.js.map +1 -0
  82. package/dist/extensions/athenahealth/actions/getPatient/getPatient.d.ts +4 -0
  83. package/dist/extensions/athenahealth/actions/getPatient/getPatient.js +33 -0
  84. package/dist/extensions/athenahealth/actions/getPatient/getPatient.js.map +1 -0
  85. package/dist/extensions/athenahealth/actions/getPatient/getPatient.test.d.ts +1 -0
  86. package/dist/extensions/athenahealth/actions/getPatient/getPatient.test.js +34 -0
  87. package/dist/extensions/athenahealth/actions/getPatient/getPatient.test.js.map +1 -0
  88. package/dist/extensions/athenahealth/actions/getPatient/index.d.ts +1 -0
  89. package/dist/extensions/athenahealth/actions/getPatient/index.js +6 -0
  90. package/dist/extensions/athenahealth/actions/getPatient/index.js.map +1 -0
  91. package/dist/extensions/athenahealth/actions/index.d.ts +305 -0
  92. package/dist/extensions/athenahealth/actions/index.js +16 -0
  93. package/dist/extensions/athenahealth/actions/index.js.map +1 -0
  94. package/dist/extensions/athenahealth/api/cacheService.d.ts +11 -0
  95. package/dist/extensions/athenahealth/api/cacheService.js +15 -0
  96. package/dist/extensions/athenahealth/api/cacheService.js.map +1 -0
  97. package/dist/extensions/athenahealth/api/client.d.ts +21 -0
  98. package/dist/extensions/athenahealth/api/client.js +31 -0
  99. package/dist/extensions/athenahealth/api/client.js.map +1 -0
  100. package/dist/extensions/athenahealth/helpers.d.ts +11 -0
  101. package/dist/extensions/athenahealth/helpers.js +31 -0
  102. package/dist/extensions/athenahealth/helpers.js.map +1 -0
  103. package/dist/extensions/athenahealth/index.d.ts +2 -0
  104. package/dist/extensions/athenahealth/index.js +22 -0
  105. package/dist/extensions/athenahealth/index.js.map +1 -0
  106. package/dist/extensions/athenahealth/settings.d.ts +57 -0
  107. package/dist/extensions/athenahealth/settings.js +49 -0
  108. package/dist/extensions/athenahealth/settings.js.map +1 -0
  109. package/dist/extensions/index.js +3 -1
  110. package/dist/extensions/index.js.map +1 -1
  111. package/dist/extensions/markdown.json +5 -1
  112. package/package.json +1 -1
@@ -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/athenahealth/actions/cancelAppointment/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 { cancelAppointment } from './cancelAppointment';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cancelAppointment = void 0;
4
+ var cancelAppointment_1 = require("./cancelAppointment");
5
+ Object.defineProperty(exports, "cancelAppointment", { enumerable: true, get: function () { return cancelAppointment_1.cancelAppointment; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/cancelAppointment/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA"}
@@ -0,0 +1,22 @@
1
+ export declare const dataPoints: {
2
+ patientId: {
3
+ key: string;
4
+ valueType: "string";
5
+ };
6
+ startTime: {
7
+ key: string;
8
+ valueType: "string";
9
+ };
10
+ status: {
11
+ key: string;
12
+ valueType: "string";
13
+ };
14
+ type: {
15
+ key: string;
16
+ valueType: "string";
17
+ };
18
+ date: {
19
+ key: string;
20
+ valueType: "date";
21
+ };
22
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = void 0;
4
+ exports.dataPoints = {
5
+ patientId: {
6
+ key: 'patientId',
7
+ valueType: 'string',
8
+ },
9
+ startTime: {
10
+ key: 'startTime',
11
+ valueType: 'string',
12
+ },
13
+ status: {
14
+ key: 'status',
15
+ valueType: 'string',
16
+ },
17
+ type: {
18
+ key: 'type',
19
+ valueType: 'string',
20
+ },
21
+ date: {
22
+ key: 'date',
23
+ valueType: 'date',
24
+ },
25
+ };
26
+ //# sourceMappingURL=datapoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/getAppointment/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,QAAQ;KACpB;IACD,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,QAAQ;KACpB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { FieldType } from '@awell-health/extensions-core';
2
+ import z from 'zod';
3
+ export declare const fields: {
4
+ appointmentId: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.STRING;
9
+ required: true;
10
+ };
11
+ practiceId: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.STRING;
16
+ required: true;
17
+ };
18
+ };
19
+ export declare const FieldsValidationSchema: z.ZodObject<{
20
+ appointmentId: z.ZodString;
21
+ practiceId: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ appointmentId: string;
24
+ practiceId: string;
25
+ }, {
26
+ appointmentId: string;
27
+ practiceId: string;
28
+ }>;
@@ -0,0 +1,29 @@
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
+ appointmentId: {
11
+ id: 'appointmentId',
12
+ label: 'Appointment ID',
13
+ description: '',
14
+ type: extensions_core_1.FieldType.STRING,
15
+ required: true,
16
+ },
17
+ practiceId: {
18
+ id: 'practiceId',
19
+ label: 'Practice ID',
20
+ description: '',
21
+ type: extensions_core_1.FieldType.STRING,
22
+ required: true,
23
+ },
24
+ };
25
+ exports.FieldsValidationSchema = zod_1.default.object({
26
+ appointmentId: zod_1.default.string(),
27
+ practiceId: zod_1.default.string(),
28
+ });
29
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/getAppointment/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,aAAa,EAAE;QACb,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,aAAa,EAAE,aAAC,CAAC,MAAM,EAAE;IACzB,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE;CAC2B,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/athenahealth/actions/getAppointment/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../settings';
3
+ import { fields, dataPoints } from './config';
4
+ export declare const getAppointment: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAppointment = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const config_1 = require("./config");
6
+ const helpers_1 = require("../../helpers");
7
+ exports.getAppointment = {
8
+ key: 'getAppointment',
9
+ category: extensions_core_1.Category.EHR_INTEGRATIONS,
10
+ title: 'Get appointment',
11
+ description: 'Retrieve appointment details from Athena',
12
+ fields: config_1.fields,
13
+ previewable: false,
14
+ dataPoints: config_1.dataPoints,
15
+ onActivityCreated: async (payload, onComplete, onError) => {
16
+ const { fields: input, client } = await (0, helpers_1.validatePayloadAndCreateClient)({
17
+ fieldsSchema: config_1.FieldsValidationSchema,
18
+ payload,
19
+ });
20
+ console.log(input, client);
21
+ await onComplete({
22
+ data_points: {
23
+ patientId: '56529',
24
+ startTime: '1:00 PM',
25
+ status: 'scheduled',
26
+ type: 'Follow-up',
27
+ date: '2024-05-05',
28
+ },
29
+ });
30
+ },
31
+ };
32
+ //# sourceMappingURL=getAppointment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAppointment.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getAppointment/getAppointment.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;AAEjD,QAAA,cAAc,GAIvB;IACF,GAAG,EAAE,gBAAgB;IACrB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,0CAA0C;IACvD,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,wCAA8B,EAAC;YACrE,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAE1B,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,SAAS,EAAE,OAAO;gBAClB,SAAS,EAAE,SAAS;gBACpB,MAAM,EAAE,WAAW;gBACnB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,YAAY;aACnB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ const tests_1 = require("../../../../src/tests");
5
+ describe('Athena - Get appointment', () => {
6
+ const settings = {
7
+ client_id: 'hello',
8
+ client_secret: 'world',
9
+ auth_url: 'https://api.preview.platform.athenahealth.com/oauth2/v1/token',
10
+ api_url: 'https://api.preview.platform.athenahealth.com',
11
+ scope: 'athena/service/Athenanet.MDP.* system/Observation.read system/Patient.read',
12
+ };
13
+ const onComplete = jest.fn();
14
+ const onError = jest.fn();
15
+ test('Should return an appointment', async () => {
16
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
17
+ fields: {
18
+ appointmentId: '1',
19
+ practiceId: '1',
20
+ },
21
+ settings,
22
+ });
23
+ await _1.getAppointment.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
24
+ expect(onComplete).toHaveBeenCalledWith({
25
+ data_points: {
26
+ patientId: '56529',
27
+ startTime: '1:00 PM',
28
+ status: 'scheduled',
29
+ type: 'Follow-up',
30
+ date: '2024-05-05',
31
+ },
32
+ });
33
+ });
34
+ });
35
+ //# sourceMappingURL=getAppointment.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAppointment.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getAppointment/getAppointment.test.ts"],"names":[],"mappings":";;AAAA,wBAAkC;AAClC,iDAA2D;AAE3D,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,MAAM,QAAQ,GAAG;QACf,SAAS,EAAE,OAAO;QAClB,aAAa,EAAE,OAAO;QACtB,QAAQ,EAAE,+DAA+D;QACzE,OAAO,EAAE,+CAA+C;QACxD,KAAK,EACH,4EAA4E;KAC/E,CAAA;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,IAAI,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC9C,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,aAAa,EAAE,GAAG;gBAClB,UAAU,EAAE,GAAG;aAChB;YACD,QAAQ;SACT,CAAC,CAAA;QAEF,MAAM,iBAAc,CAAC,iBAAiB,CACpC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,SAAS,EAAE,OAAO;gBAClB,SAAS,EAAE,SAAS;gBACpB,MAAM,EAAE,WAAW;gBACnB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,YAAY;aACnB;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export { getAppointment } from './getAppointment';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAppointment = void 0;
4
+ var getAppointment_1 = require("./getAppointment");
5
+ Object.defineProperty(exports, "getAppointment", { enumerable: true, get: function () { return getAppointment_1.getAppointment; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getAppointment/index.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAAxC,gHAAA,cAAc,OAAA"}
@@ -0,0 +1,18 @@
1
+ export declare const dataPoints: {
2
+ firstName: {
3
+ key: string;
4
+ valueType: "string";
5
+ };
6
+ lastName: {
7
+ key: string;
8
+ valueType: "string";
9
+ };
10
+ email: {
11
+ key: string;
12
+ valueType: "string";
13
+ };
14
+ dob: {
15
+ key: string;
16
+ valueType: "date";
17
+ };
18
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = void 0;
4
+ exports.dataPoints = {
5
+ firstName: {
6
+ key: 'firstName',
7
+ valueType: 'string',
8
+ },
9
+ lastName: {
10
+ key: 'lastName',
11
+ valueType: 'string',
12
+ },
13
+ email: {
14
+ key: 'email',
15
+ valueType: 'string',
16
+ },
17
+ dob: {
18
+ key: 'dob',
19
+ valueType: 'date',
20
+ },
21
+ };
22
+ //# sourceMappingURL=datapoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/getPatient/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,QAAQ;KACpB;IACD,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf,SAAS,EAAE,QAAQ;KACpB;IACD,KAAK,EAAE;QACL,GAAG,EAAE,OAAO;QACZ,SAAS,EAAE,QAAQ;KACpB;IACD,GAAG,EAAE;QACH,GAAG,EAAE,KAAK;QACV,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA"}
@@ -0,0 +1,28 @@
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.STRING;
9
+ required: true;
10
+ };
11
+ practiceId: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.STRING;
16
+ required: true;
17
+ };
18
+ };
19
+ export declare const FieldsValidationSchema: z.ZodObject<{
20
+ patientId: z.ZodString;
21
+ practiceId: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ patientId: string;
24
+ practiceId: string;
25
+ }, {
26
+ patientId: string;
27
+ practiceId: string;
28
+ }>;
@@ -0,0 +1,29 @@
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: 'Logical identifier of the patient in Athena',
14
+ type: extensions_core_1.FieldType.STRING,
15
+ required: true,
16
+ },
17
+ practiceId: {
18
+ id: 'practiceId',
19
+ label: 'Practice ID',
20
+ description: '',
21
+ type: extensions_core_1.FieldType.STRING,
22
+ required: true,
23
+ },
24
+ };
25
+ exports.FieldsValidationSchema = zod_1.default.object({
26
+ patientId: zod_1.default.string(),
27
+ practiceId: zod_1.default.string(),
28
+ });
29
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/getPatient/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,6CAA6C;QAC1D,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,aAAC,CAAC,MAAM,EAAE;IACrB,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE;CAC2B,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/athenahealth/actions/getPatient/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../settings';
3
+ import { fields, dataPoints } from './config';
4
+ export declare const getPatient: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPatient = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const config_1 = require("./config");
6
+ const helpers_1 = require("../../helpers");
7
+ exports.getPatient = {
8
+ key: 'getPatient',
9
+ category: extensions_core_1.Category.EHR_INTEGRATIONS,
10
+ title: 'Get patient',
11
+ description: 'Retrieve patient details from Athena',
12
+ fields: config_1.fields,
13
+ previewable: false,
14
+ dataPoints: config_1.dataPoints,
15
+ onActivityCreated: async (payload, onComplete, onError) => {
16
+ const { fields: input, client } = await (0, helpers_1.validatePayloadAndCreateClient)({
17
+ fieldsSchema: config_1.FieldsValidationSchema,
18
+ payload,
19
+ });
20
+ console.log(input, client);
21
+ // Client doesn't work yet :-(
22
+ // await client.getPatient(input)
23
+ await onComplete({
24
+ data_points: {
25
+ firstName: 'Rik',
26
+ lastName: 'Renard',
27
+ dob: '1993-11-30',
28
+ email: 'rik@awellhealth.com',
29
+ },
30
+ });
31
+ },
32
+ };
33
+ //# sourceMappingURL=getPatient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPatient.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getPatient/getPatient.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;AAEjD,QAAA,UAAU,GAInB;IACF,GAAG,EAAE,YAAY;IACjB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,sCAAsC;IACnD,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,wCAA8B,EAAC;YACrE,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAE1B,8BAA8B;QAC9B,iCAAiC;QAEjC,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,SAAS,EAAE,KAAK;gBAChB,QAAQ,EAAE,QAAQ;gBAClB,GAAG,EAAE,YAAY;gBACjB,KAAK,EAAE,qBAAqB;aAC7B;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ const tests_1 = require("../../../../src/tests");
5
+ describe('Athena - Get patient', () => {
6
+ const settings = {
7
+ client_id: 'hello',
8
+ client_secret: 'world',
9
+ auth_url: 'https://api.preview.platform.athenahealth.com/oauth2/v1/token',
10
+ api_url: 'https://api.preview.platform.athenahealth.com',
11
+ scope: 'athena/service/Athenanet.MDP.* system/Observation.read system/Patient.read',
12
+ };
13
+ const onComplete = jest.fn();
14
+ const onError = jest.fn();
15
+ test('Should return a patient', async () => {
16
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
17
+ fields: {
18
+ patientId: '1',
19
+ practiceId: '1',
20
+ },
21
+ settings,
22
+ });
23
+ await _1.getPatient.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
24
+ expect(onComplete).toHaveBeenCalledWith({
25
+ data_points: {
26
+ firstName: 'Rik',
27
+ lastName: 'Renard',
28
+ dob: '1993-11-30',
29
+ email: 'rik@awellhealth.com',
30
+ },
31
+ });
32
+ });
33
+ });
34
+ //# sourceMappingURL=getPatient.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPatient.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getPatient/getPatient.test.ts"],"names":[],"mappings":";;AAAA,wBAA8B;AAC9B,iDAA2D;AAE3D,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,MAAM,QAAQ,GAAG;QACf,SAAS,EAAE,OAAO;QAClB,aAAa,EAAE,OAAO;QACtB,QAAQ,EAAE,+DAA+D;QACzE,OAAO,EAAE,+CAA+C;QACxD,KAAK,EACH,4EAA4E;KAC/E,CAAA;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,IAAI,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,SAAS,EAAE,GAAG;gBACd,UAAU,EAAE,GAAG;aAChB;YACD,QAAQ;SACT,CAAC,CAAA;QAEF,MAAM,aAAU,CAAC,iBAAiB,CAChC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,SAAS,EAAE,KAAK;gBAChB,QAAQ,EAAE,QAAQ;gBAClB,GAAG,EAAE,YAAY;gBACjB,KAAK,EAAE,qBAAqB;aAC7B;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export { getPatient } from './getPatient';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPatient = void 0;
4
+ var getPatient_1 = require("./getPatient");
5
+ Object.defineProperty(exports, "getPatient", { enumerable: true, get: function () { return getPatient_1.getPatient; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getPatient/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}