@awell-health/awell-extensions 1.0.215 → 1.0.217

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/dist/extensions/athenahealth/actions/createAppointmentNote/config/fields.d.ts +0 -10
  2. package/dist/extensions/athenahealth/actions/createAppointmentNote/config/fields.js +0 -8
  3. package/dist/extensions/athenahealth/actions/createAppointmentNote/config/fields.js.map +1 -1
  4. package/dist/extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.js +20 -5
  5. package/dist/extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.js.map +1 -1
  6. package/dist/extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.test.js +25 -3
  7. package/dist/extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.test.js.map +1 -1
  8. package/dist/extensions/athenahealth/actions/createPatient/config/fields.d.ts +0 -10
  9. package/dist/extensions/athenahealth/actions/createPatient/config/fields.js +0 -8
  10. package/dist/extensions/athenahealth/actions/createPatient/config/fields.js.map +1 -1
  11. package/dist/extensions/athenahealth/actions/createPatient/createPatient.js +3 -4
  12. package/dist/extensions/athenahealth/actions/createPatient/createPatient.js.map +1 -1
  13. package/dist/extensions/athenahealth/actions/createPatient/createPatient.test.js +0 -1
  14. package/dist/extensions/athenahealth/actions/createPatient/createPatient.test.js.map +1 -1
  15. package/dist/extensions/athenahealth/actions/getAppointment/config/datapoints.js +2 -2
  16. package/dist/extensions/athenahealth/actions/getAppointment/config/datapoints.js.map +1 -1
  17. package/dist/extensions/athenahealth/actions/getAppointment/config/fields.d.ts +0 -10
  18. package/dist/extensions/athenahealth/actions/getAppointment/config/fields.js +0 -8
  19. package/dist/extensions/athenahealth/actions/getAppointment/config/fields.js.map +1 -1
  20. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.js +2 -2
  21. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.js.map +1 -1
  22. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.test.js +24 -4
  23. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.test.js.map +1 -1
  24. package/dist/extensions/athenahealth/actions/getPatient/config/fields.d.ts +0 -10
  25. package/dist/extensions/athenahealth/actions/getPatient/config/fields.js +0 -8
  26. package/dist/extensions/athenahealth/actions/getPatient/config/fields.js.map +1 -1
  27. package/dist/extensions/athenahealth/actions/getPatient/getPatient.js +2 -2
  28. package/dist/extensions/athenahealth/actions/getPatient/getPatient.js.map +1 -1
  29. package/dist/extensions/athenahealth/actions/getPatient/getPatient.test.js +23 -3
  30. package/dist/extensions/athenahealth/actions/getPatient/getPatient.test.js.map +1 -1
  31. package/dist/extensions/athenahealth/actions/index.d.ts +26 -26
  32. package/dist/extensions/athenahealth/actions/index.js +0 -4
  33. package/dist/extensions/athenahealth/actions/index.js.map +1 -1
  34. package/dist/extensions/athenahealth/api/client.d.ts +3 -2
  35. package/dist/extensions/athenahealth/api/client.js +1 -1
  36. package/dist/extensions/athenahealth/api/client.js.map +1 -1
  37. package/dist/extensions/athenahealth/api/schema/appointment.d.ts +3 -0
  38. package/dist/extensions/athenahealth/api/schema/appointment.js.map +1 -1
  39. package/dist/extensions/athenahealth/helpers.d.ts +2 -0
  40. package/dist/extensions/athenahealth/helpers.js +2 -2
  41. package/dist/extensions/athenahealth/helpers.js.map +1 -1
  42. package/dist/extensions/athenahealth/settings.d.ts +10 -0
  43. package/dist/extensions/athenahealth/settings.js +11 -3
  44. package/dist/extensions/athenahealth/settings.js.map +1 -1
  45. package/package.json +1 -1
  46. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.d.ts +0 -4
  47. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.js +0 -24
  48. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.js.map +0 -1
  49. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.test.d.ts +0 -1
  50. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.test.js +0 -31
  51. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.test.js.map +0 -1
  52. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/datapoints.d.ts +0 -1
  53. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/datapoints.js +0 -5
  54. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/datapoints.js.map +0 -1
  55. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/fields.d.ts +0 -68
  56. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/fields.js +0 -61
  57. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/fields.js.map +0 -1
  58. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/index.d.ts +0 -2
  59. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/index.js +0 -9
  60. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/index.js.map +0 -1
  61. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/index.d.ts +0 -1
  62. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/index.js +0 -6
  63. package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/index.js.map +0 -1
@@ -1,13 +1,6 @@
1
1
  import { FieldType } from '@awell-health/extensions-core';
2
2
  import z from 'zod';
3
3
  export declare const fields: {
4
- practiceid: {
5
- id: string;
6
- label: string;
7
- description: string;
8
- type: FieldType.STRING;
9
- required: true;
10
- };
11
4
  appointmentid: {
12
5
  id: string;
13
6
  label: string;
@@ -31,17 +24,14 @@ export declare const fields: {
31
24
  };
32
25
  };
33
26
  export declare const FieldsValidationSchema: z.ZodObject<{
34
- practiceid: z.ZodString;
35
27
  appointmentid: z.ZodString;
36
28
  notetext: z.ZodString;
37
29
  displayonschedule: z.ZodOptional<z.ZodBoolean>;
38
30
  }, "strip", z.ZodTypeAny, {
39
- practiceid: string;
40
31
  appointmentid: string;
41
32
  notetext: string;
42
33
  displayonschedule?: boolean | undefined;
43
34
  }, {
44
- practiceid: string;
45
35
  appointmentid: string;
46
36
  notetext: string;
47
37
  displayonschedule?: boolean | undefined;
@@ -7,13 +7,6 @@ exports.FieldsValidationSchema = exports.fields = void 0;
7
7
  const extensions_core_1 = require("@awell-health/extensions-core");
8
8
  const zod_1 = __importDefault(require("zod"));
9
9
  exports.fields = {
10
- practiceid: {
11
- id: 'practiceid',
12
- label: 'Practice ID',
13
- description: '',
14
- type: extensions_core_1.FieldType.STRING,
15
- required: true,
16
- },
17
10
  appointmentid: {
18
11
  id: 'appointmentid',
19
12
  label: 'Appointment ID',
@@ -37,7 +30,6 @@ exports.fields = {
37
30
  },
38
31
  };
39
32
  exports.FieldsValidationSchema = zod_1.default.object({
40
- practiceid: zod_1.default.string().min(1),
41
33
  appointmentid: zod_1.default.string().min(1),
42
34
  notetext: zod_1.default.string().min(1),
43
35
  displayonschedule: zod_1.default.boolean().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/createAppointmentNote/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,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;IACD,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,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;KACf;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,0CAA0C;QACvD,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,aAAa,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,QAAQ,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,iBAAiB,EAAE,aAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACQ,CAAC,CAAA"}
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/createAppointmentNote/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,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;KACf;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,0CAA0C;QACvD,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,aAAa,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,QAAQ,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,iBAAiB,EAAE,aAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACQ,CAAC,CAAA"}
@@ -14,16 +14,31 @@ exports.createAppointmentNote = {
14
14
  previewable: false,
15
15
  dataPoints: config_1.dataPoints,
16
16
  onActivityCreated: async (payload, onComplete, onError) => {
17
- const { fields: input, client } = await (0, helpers_1.validatePayloadAndCreateClient)({
17
+ const { fields: input, client, settings: { practiceId }, } = await (0, helpers_1.validatePayloadAndCreateClient)({
18
18
  fieldsSchema: config_1.FieldsValidationSchema,
19
19
  payload,
20
20
  });
21
- await client.createAppointmentNote({
22
- practiceId: input.practiceid,
21
+ const res = await client.createAppointmentNote({
22
+ practiceId,
23
23
  appointmentId: input.appointmentid,
24
- data: (0, lodash_1.omit)(input, ['practiceid', 'appointmentid']),
24
+ data: (0, lodash_1.omit)(input, ['appointmentid']),
25
+ });
26
+ if (res.success === 'true') {
27
+ await onComplete();
28
+ return;
29
+ }
30
+ await onError({
31
+ events: [
32
+ {
33
+ date: new Date().toISOString(),
34
+ text: { en: 'Unable to create the appointment note' },
35
+ error: {
36
+ category: 'SERVER_ERROR',
37
+ message: 'Unable to create the appointment note',
38
+ },
39
+ },
40
+ ],
25
41
  });
26
- await onComplete();
27
42
  },
28
43
  };
29
44
  //# sourceMappingURL=createAppointmentNote.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createAppointmentNote.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;AAC9D,mCAA6B;AAEhB,QAAA,qBAAqB,GAI9B;IACF,GAAG,EAAE,uBAAuB;IAC5B,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,2CAA2C;IACxD,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,MAAM,MAAM,CAAC,qBAAqB,CAAC;YACjC,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,IAAI,EAAE,IAAA,aAAI,EAAC,KAAK,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;SACnD,CAAC,CAAA;QAEF,MAAM,UAAU,EAAE,CAAA;IACpB,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"createAppointmentNote.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;AAC9D,mCAA6B;AAEhB,QAAA,qBAAqB,GAI9B;IACF,GAAG,EAAE,uBAAuB;IAC5B,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,2CAA2C;IACxD,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,EACJ,MAAM,EAAE,KAAK,EACb,MAAM,EACN,QAAQ,EAAE,EAAE,UAAU,EAAE,GACzB,GAAG,MAAM,IAAA,wCAA8B,EAAC;YACvC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;YAC7C,UAAU;YACV,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,IAAI,EAAE,IAAA,aAAI,EAAC,KAAK,EAAE,CAAC,eAAe,CAAC,CAAC;SACrC,CAAC,CAAA;QAEF,IAAI,GAAG,CAAC,OAAO,KAAK,MAAM,EAAE;YAC1B,MAAM,UAAU,EAAE,CAAA;YAClB,OAAM;SACP;QAED,MAAM,OAAO,CAAC;YACZ,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;oBAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,uCAAuC,EAAE;oBACrD,KAAK,EAAE;wBACL,QAAQ,EAAE,cAAc;wBACxB,OAAO,EAAE,uCAAuC;qBACjD;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -14,7 +14,6 @@ describe('athenahealth - Create appointment note', () => {
14
14
  const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
15
15
  fields: {
16
16
  appointmentid: '1',
17
- practiceid: '195900',
18
17
  notetext: 'hello world',
19
18
  displayonschedule: true,
20
19
  },
@@ -27,8 +26,7 @@ describe('athenahealth - Create appointment note', () => {
27
26
  var _a, _b;
28
27
  const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
29
28
  fields: {
30
- appointmentid: '2123223221',
31
- practiceid: '195900',
29
+ appointmentid: 'non-existing-appointment-id',
32
30
  notetext: 'hello world',
33
31
  displayonschedule: true,
34
32
  },
@@ -47,5 +45,29 @@ describe('athenahealth - Create appointment note', () => {
47
45
  }
48
46
  expect(onComplete).not.toHaveBeenCalled();
49
47
  });
48
+ test('Should return an error when practice is not found', async () => {
49
+ var _a, _b;
50
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
51
+ fields: {
52
+ appointmentid: '1',
53
+ notetext: 'hello world',
54
+ displayonschedule: true,
55
+ },
56
+ settings: { ...mockData_1.mockSettings, practiceId: 'non-existing-practice-id' },
57
+ });
58
+ try {
59
+ await _1.createAppointmentNote.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
60
+ }
61
+ catch (error) {
62
+ const axiosError = error;
63
+ expect(axiosError.response).toBeDefined();
64
+ expect((_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.status).toBe(404);
65
+ expect((_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.data).toStrictEqual({
66
+ error: 'Invalid practice.',
67
+ detailedmessage: 'The practice ID does not exist.',
68
+ });
69
+ }
70
+ expect(onComplete).not.toHaveBeenCalled();
71
+ });
50
72
  });
51
73
  //# sourceMappingURL=createAppointmentNote.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createAppointmentNote.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.test.ts"],"names":[],"mappings":";;AACA,wBAAyC;AACzC,iDAA2D;AAC3D,2DAA2D;AAE3D,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAE7B,QAAQ,CAAC,wCAAwC,EAAE,GAAG,EAAE;IACtD,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,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,aAAa,EAAE,GAAG;gBAClB,UAAU,EAAE,QAAQ;gBACpB,QAAQ,EAAE,aAAa;gBACvB,iBAAiB,EAAE,IAAI;aACxB;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,MAAM,wBAAqB,CAAC,iBAAiB,CAC3C,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAA;IACvC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;;QAC5E,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,aAAa,EAAE,YAAY;gBAC3B,UAAU,EAAE,QAAQ;gBACpB,QAAQ,EAAE,aAAa;gBACvB,iBAAiB,EAAE,IAAI;aACxB;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,IAAI;YACF,MAAM,wBAAqB,CAAC,iBAAiB,CAC3C,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,UAAU,GAAG,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,mCAAmC;aAC3C,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":"createAppointmentNote.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.test.ts"],"names":[],"mappings":";;AACA,wBAAyC;AACzC,iDAA2D;AAC3D,2DAA2D;AAE3D,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAE7B,QAAQ,CAAC,wCAAwC,EAAE,GAAG,EAAE;IACtD,MAAM,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AC,CAAC,aAAa,CAAC;gBAC9C,KAAK,EAAE,mCAAmC;aAC3C,CAAC,CAAA;SACH;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;IAC3C,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;;QACnE,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,aAAa,EAAE,GAAG;gBAClB,QAAQ,EAAE,aAAa;gBACvB,iBAAiB,EAAE,IAAI;aACxB;YACD,QAAQ,EAAE,EAAE,GAAG,uBAAY,EAAE,UAAU,EAAE,0BAA0B,EAAE;SACtE,CAAC,CAAA;QAEF,IAAI;YACF,MAAM,wBAAqB,CAAC,iBAAiB,CAC3C,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,UAAU,GAAG,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,13 +1,6 @@
1
1
  import { FieldType } from '@awell-health/extensions-core';
2
2
  import z from 'zod';
3
3
  export declare const fields: {
4
- practiceid: {
5
- id: string;
6
- label: string;
7
- description: string;
8
- type: FieldType.STRING;
9
- required: true;
10
- };
11
4
  departmentid: {
12
5
  id: string;
13
6
  label: string;
@@ -45,7 +38,6 @@ export declare const fields: {
45
38
  };
46
39
  };
47
40
  export declare const FieldsValidationSchema: z.ZodObject<{
48
- practiceid: z.ZodString;
49
41
  departmentid: z.ZodString;
50
42
  firstname: z.ZodString;
51
43
  lastname: z.ZodString;
@@ -54,14 +46,12 @@ export declare const FieldsValidationSchema: z.ZodObject<{
54
46
  }, "strip", z.ZodTypeAny, {
55
47
  email: string;
56
48
  dob: string;
57
- practiceid: string;
58
49
  departmentid: string;
59
50
  firstname: string;
60
51
  lastname: string;
61
52
  }, {
62
53
  email: string;
63
54
  dob: string;
64
- practiceid: string;
65
55
  departmentid: string;
66
56
  firstname: string;
67
57
  lastname: string;
@@ -8,13 +8,6 @@ const extensions_core_1 = require("@awell-health/extensions-core");
8
8
  const zod_1 = __importDefault(require("zod"));
9
9
  const date_1 = require("../../../validation/date");
10
10
  exports.fields = {
11
- practiceid: {
12
- id: 'practiceid',
13
- label: 'Practice ID',
14
- description: '',
15
- type: extensions_core_1.FieldType.STRING,
16
- required: true,
17
- },
18
11
  departmentid: {
19
12
  id: 'departmentid',
20
13
  label: 'Department ID',
@@ -52,7 +45,6 @@ exports.fields = {
52
45
  },
53
46
  };
54
47
  exports.FieldsValidationSchema = zod_1.default.object({
55
- practiceid: zod_1.default.string().min(1),
56
48
  departmentid: zod_1.default.string().min(1),
57
49
  firstname: zod_1.default.string().min(1),
58
50
  lastname: zod_1.default.string().min(1),
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/createPatient/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AACxC,mDAAsE;AAEzD,QAAA,MAAM,GAAG;IACpB,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EA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C,CAAC,CAAC,KAAK,EAAE;CACiB,CAAC,CAAA"}
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/createPatient/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAqE;AACrE,8CAAwC;AACxC,mDAAsE;AAEzD,QAAA,MAAM,GAAG;IACpB,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,GAAG,EAAE;QACH,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;KACf;IACD,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,OAAO;QACd,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,YAAY,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,SAAS,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,QAAQ,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,GAAG,EAAE,kCAA2B;IAChC,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;CACiB,CAAC,CAAA"}
@@ -4,7 +4,6 @@ exports.createPatient = void 0;
4
4
  const extensions_core_1 = require("@awell-health/extensions-core");
5
5
  const config_1 = require("./config");
6
6
  const helpers_1 = require("../../helpers");
7
- const lodash_1 = require("lodash");
8
7
  exports.createPatient = {
9
8
  key: 'createPatient',
10
9
  category: extensions_core_1.Category.EHR_INTEGRATIONS,
@@ -14,13 +13,13 @@ exports.createPatient = {
14
13
  previewable: false,
15
14
  dataPoints: config_1.dataPoints,
16
15
  onActivityCreated: async (payload, onComplete, onError) => {
17
- const { fields: input, client } = await (0, helpers_1.validatePayloadAndCreateClient)({
16
+ const { fields: input, client, settings: { practiceId }, } = await (0, helpers_1.validatePayloadAndCreateClient)({
18
17
  fieldsSchema: config_1.FieldsValidationSchema,
19
18
  payload,
20
19
  });
21
20
  const res = await client.createPatient({
22
- practiceId: input.practiceid,
23
- data: (0, lodash_1.omit)(input, ['practiceid']),
21
+ practiceId,
22
+ data: input,
24
23
  });
25
24
  await onComplete({
26
25
  data_points: {
@@ -1 +1 @@
1
- {"version":3,"file":"createPatient.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/createPatient/createPatient.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;AAC9D,mCAA6B;AAEhB,QAAA,aAAa,GAItB;IACF,GAAG,EAAE,eAAe;IACpB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,4BAA4B;IACzC,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,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;YACrC,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,IAAI,EAAE,IAAA,aAAI,EAAC,KAAK,EAAE,CAAC,YAAY,CAAC,CAAC;SAClC,CAAC,CAAA;QAEF,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,gBAAgB,EAAE,GAAG,CAAC,SAAS;aAChC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"createPatient.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/createPatient/createPatient.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;AAEjD,QAAA,aAAa,GAItB;IACF,GAAG,EAAE,eAAe;IACpB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,4BAA4B;IACzC,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,EACJ,MAAM,EAAE,KAAK,EACb,MAAM,EACN,QAAQ,EAAE,EAAE,UAAU,EAAE,GACzB,GAAG,MAAM,IAAA,wCAA8B,EAAC;YACvC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;YACrC,UAAU;YACV,IAAI,EAAE,KAAK;SACZ,CAAC,CAAA;QAEF,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,gBAAgB,EAAE,GAAG,CAAC,SAAS;aAChC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -13,7 +13,6 @@ describe('athenahealth - Create patient', () => {
13
13
  test('Should create a patient', async () => {
14
14
  const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
15
15
  fields: {
16
- practiceid: '195900',
17
16
  firstname: 'Nick',
18
17
  lastname: 'Hellemans',
19
18
  dob: '11/30/1993',
@@ -1 +1 @@
1
- {"version":3,"file":"createPatient.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/createPatient/createPatient.test.ts"],"names":[],"mappings":";;AAAA,wBAAiC;AACjC,iDAA2D;AAC3D,2DAA2D;AAE3D,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAE7B,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,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,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,UAAU,EAAE,QAAQ;gBACpB,SAAS,EAAE,MAAM;gBACjB,QAAQ,EAAE,WAAW;gBACrB,GAAG,EAAE,YAAY;gBACjB,KAAK,EAAE,sBAAsB;gBAC7B,YAAY,EAAE,GAAG;aAClB;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,MAAM,gBAAa,CAAC,iBAAiB,CACnC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,gBAAgB,EAAE,GAAG;aACtB;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"createPatient.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/createPatient/createPatient.test.ts"],"names":[],"mappings":";;AAAA,wBAAiC;AACjC,iDAA2D;AAC3D,2DAA2D;AAE3D,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAE7B,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,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,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,SAAS,EAAE,MAAM;gBACjB,QAAQ,EAAE,WAAW;gBACrB,GAAG,EAAE,YAAY;gBACjB,KAAK,EAAE,sBAAsB;gBAC7B,YAAY,EAAE,GAAG;aAClB;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,MAAM,gBAAa,CAAC,iBAAiB,CACnC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,gBAAgB,EAAE,GAAG;aACtB;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -15,11 +15,11 @@ exports.dataPoints = {
15
15
  valueType: 'string',
16
16
  },
17
17
  appointmentTypeName: {
18
- key: 'type',
18
+ key: 'appointmentTypeName',
19
19
  valueType: 'string',
20
20
  },
21
21
  appointmentTypeId: {
22
- key: 'type',
22
+ key: 'appointmentTypeId',
23
23
  valueType: 'string',
24
24
  },
25
25
  date: {
@@ -1 +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,mBAAmB,EAAE;QACnB,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,QAAQ;KACpB;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,MAAM;KAClB;IACD,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
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,mBAAmB,EAAE;QACnB,GAAG,EAAE,qBAAqB;QAC1B,SAAS,EAAE,QAAQ;KACpB;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,mBAAmB;QACxB,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,MAAM;KAClB;IACD,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
@@ -8,21 +8,11 @@ export declare const fields: {
8
8
  type: FieldType.STRING;
9
9
  required: true;
10
10
  };
11
- practiceId: {
12
- id: string;
13
- label: string;
14
- description: string;
15
- type: FieldType.STRING;
16
- required: true;
17
- };
18
11
  };
19
12
  export declare const FieldsValidationSchema: z.ZodObject<{
20
13
  appointmentId: z.ZodString;
21
- practiceId: z.ZodString;
22
14
  }, "strip", z.ZodTypeAny, {
23
15
  appointmentId: string;
24
- practiceId: string;
25
16
  }, {
26
17
  appointmentId: string;
27
- practiceId: string;
28
18
  }>;
@@ -14,16 +14,8 @@ exports.fields = {
14
14
  type: extensions_core_1.FieldType.STRING,
15
15
  required: true,
16
16
  },
17
- practiceId: {
18
- id: 'practiceId',
19
- label: 'Practice ID',
20
- description: '',
21
- type: extensions_core_1.FieldType.STRING,
22
- required: true,
23
- },
24
17
  };
25
18
  exports.FieldsValidationSchema = zod_1.default.object({
26
19
  appointmentId: zod_1.default.string(),
27
- practiceId: zod_1.default.string(),
28
20
  });
29
21
  //# sourceMappingURL=fields.js.map
@@ -1 +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"}
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;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,aAAa,EAAE,aAAC,CAAC,MAAM,EAAE;CACwB,CAAC,CAAA"}
@@ -14,11 +14,11 @@ exports.getAppointment = {
14
14
  previewable: false,
15
15
  dataPoints: config_1.dataPoints,
16
16
  onActivityCreated: async (payload, onComplete, onError) => {
17
- const { fields: input, client } = await (0, helpers_1.validatePayloadAndCreateClient)({
17
+ const { fields: input, client, settings: { practiceId }, } = await (0, helpers_1.validatePayloadAndCreateClient)({
18
18
  fieldsSchema: config_1.FieldsValidationSchema,
19
19
  payload,
20
20
  });
21
- const res = await client.getAppointment(input);
21
+ const res = await client.getAppointment({ ...input, practiceId });
22
22
  // Both validates and transforms some of the response data
23
23
  const appt = appointment_1.AppointmentSchema.parse(res);
24
24
  await onComplete({
@@ -1 +1 @@
1
- {"version":3,"file":"getAppointment.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getAppointment/getAppointment.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;AAC9D,8DAAgE;AAEnD,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,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAE9C,0DAA0D;QAC1D,MAAM,IAAI,GAAG,+BAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAEzC,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,MAAM,EAAE,IAAI,CAAC,iBAAiB;gBAC9B,mBAAmB,EAAE,IAAI,CAAC,eAAe;gBACzC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;aAChC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"getAppointment.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getAppointment/getAppointment.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;AAC9D,8DAAgE;AAEnD,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,EACJ,MAAM,EAAE,KAAK,EACb,MAAM,EACN,QAAQ,EAAE,EAAE,UAAU,EAAE,GACzB,GAAG,MAAM,IAAA,wCAA8B,EAAC;YACvC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,CAAC,CAAA;QAEjE,0DAA0D;QAC1D,MAAM,IAAI,GAAG,+BAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAEzC,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,MAAM,EAAE,IAAI,CAAC,iBAAiB;gBAC9B,mBAAmB,EAAE,IAAI,CAAC,eAAe;gBACzC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;aAChC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -15,7 +15,6 @@ describe('athenahealth - Get appointment', () => {
15
15
  const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
16
16
  fields: {
17
17
  appointmentId: '1',
18
- practiceId: '195900',
19
18
  },
20
19
  settings: mockData_1.mockSettings,
21
20
  });
@@ -34,12 +33,11 @@ describe('athenahealth - Get appointment', () => {
34
33
  },
35
34
  });
36
35
  });
37
- test('Should return an error when patient is not found', async () => {
36
+ test('Should return an error when appointment is not found', async () => {
38
37
  var _a, _b;
39
38
  const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
40
39
  fields: {
41
- appointmentId: 'non-existent-appointment-id',
42
- practiceId: '195900',
40
+ appointmentId: 'non-existing-appointment-id',
43
41
  },
44
42
  settings: mockData_1.mockSettings,
45
43
  });
@@ -56,5 +54,27 @@ describe('athenahealth - Get appointment', () => {
56
54
  }
57
55
  expect(onComplete).not.toHaveBeenCalled();
58
56
  });
57
+ test('Should return an error when practice is not found', async () => {
58
+ var _a, _b;
59
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
60
+ fields: {
61
+ appointmentId: '1',
62
+ },
63
+ settings: { ...mockData_1.mockSettings, practiceId: 'non-existing-practice-id' },
64
+ });
65
+ try {
66
+ await _1.getAppointment.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
67
+ }
68
+ catch (error) {
69
+ const axiosError = error;
70
+ expect(axiosError.response).toBeDefined();
71
+ expect((_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.status).toBe(404);
72
+ expect((_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.data).toStrictEqual({
73
+ error: 'Invalid practice.',
74
+ detailedmessage: 'The practice ID does not exist.',
75
+ });
76
+ }
77
+ expect(onComplete).not.toHaveBeenCalled();
78
+ });
59
79
  });
60
80
  //# sourceMappingURL=getAppointment.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getAppointment.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getAppointment/getAppointment.test.ts"],"names":[],"mappings":";;AACA,uCAAoC;AACpC,wBAAkC;AAClC,iDAA2D;AAC3D,2DAAwF;AAExF,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAE7B,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAA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AA;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,mCAAmC;aAC3C,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":"getAppointment.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getAppointment/getAppointment.test.ts"],"names":[],"mappings":";;AACA,uCAAoC;AACpC,wBAAkC;AAClC,iDAA2D;AAC3D,2DAGqC;AAErC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAE7B,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,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,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC9C,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,aAAa,EAAE,GAAG;aACnB;YACD,QAAQ,EAAE,uBAAY;SACvB,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,SAA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;QACnE,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,aAAa,EAAE,GAAG;aACnB;YACD,QAAQ,EAAE,EAAE,GAAG,uBAAY,EAAE,UAAU,EAAE,0BAA0B,EAAE;SACtE,CAAC,CAAA;QAEF,IAAI;YACF,MAAM,iBAAc,CAAC,iBAAiB,CACpC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,UAAU,GAAG,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"}
@@ -8,21 +8,11 @@ export declare const fields: {
8
8
  type: FieldType.STRING;
9
9
  required: true;
10
10
  };
11
- practiceId: {
12
- id: string;
13
- label: string;
14
- description: string;
15
- type: FieldType.STRING;
16
- required: true;
17
- };
18
11
  };
19
12
  export declare const FieldsValidationSchema: z.ZodObject<{
20
13
  patientId: z.ZodString;
21
- practiceId: z.ZodString;
22
14
  }, "strip", z.ZodTypeAny, {
23
15
  patientId: string;
24
- practiceId: string;
25
16
  }, {
26
17
  patientId: string;
27
- practiceId: string;
28
18
  }>;
@@ -14,16 +14,8 @@ exports.fields = {
14
14
  type: extensions_core_1.FieldType.STRING,
15
15
  required: true,
16
16
  },
17
- practiceId: {
18
- id: 'practiceId',
19
- label: 'Practice ID',
20
- description: '',
21
- type: extensions_core_1.FieldType.STRING,
22
- required: true,
23
- },
24
17
  };
25
18
  exports.FieldsValidationSchema = zod_1.default.object({
26
19
  patientId: zod_1.default.string(),
27
- practiceId: zod_1.default.string(),
28
20
  });
29
21
  //# sourceMappingURL=fields.js.map
@@ -1 +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"}
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;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,aAAC,CAAC,MAAM,EAAE;CAC4B,CAAC,CAAA"}
@@ -14,11 +14,11 @@ exports.getPatient = {
14
14
  previewable: false,
15
15
  dataPoints: config_1.dataPoints,
16
16
  onActivityCreated: async (payload, onComplete, onError) => {
17
- const { fields: input, client } = await (0, helpers_1.validatePayloadAndCreateClient)({
17
+ const { fields: input, client, settings: { practiceId }, } = await (0, helpers_1.validatePayloadAndCreateClient)({
18
18
  fieldsSchema: config_1.FieldsValidationSchema,
19
19
  payload,
20
20
  });
21
- const res = await client.getPatient(input);
21
+ const res = await client.getPatient({ practiceId, ...input });
22
22
  // Both validates and transforms some of the response data
23
23
  const patient = patient_1.PatientSchema.parse(res);
24
24
  await onComplete({
@@ -1 +1 @@
1
- {"version":3,"file":"getPatient.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getPatient/getPatient.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;AAC9D,sDAAwD;AAE3C,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,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAE1C,0DAA0D;QAC1D,MAAM,OAAO,GAAG,uBAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAExC,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"getPatient.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getPatient/getPatient.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;AAC9D,sDAAwD;AAE3C,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,EACJ,MAAM,EAAE,KAAK,EACb,MAAM,EACN,QAAQ,EAAE,EAAE,UAAU,EAAE,GACzB,GAAG,MAAM,IAAA,wCAA8B,EAAC;YACvC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,CAAC,CAAA;QAE7D,0DAA0D;QAC1D,MAAM,OAAO,GAAG,uBAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAExC,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -15,7 +15,6 @@ describe('athenahealth - Get patient', () => {
15
15
  const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
16
16
  fields: {
17
17
  patientId: '56529',
18
- practiceId: '195900',
19
18
  },
20
19
  settings: mockData_1.mockSettings,
21
20
  });
@@ -31,12 +30,33 @@ describe('athenahealth - Get patient', () => {
31
30
  },
32
31
  });
33
32
  });
33
+ test('Should return an error when practice is not found', async () => {
34
+ var _a, _b;
35
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
36
+ fields: {
37
+ patientId: '123',
38
+ },
39
+ settings: { ...mockData_1.mockSettings, practiceId: 'non-existing-practice-id' },
40
+ });
41
+ try {
42
+ await _1.getPatient.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
43
+ }
44
+ catch (error) {
45
+ const axiosError = error;
46
+ expect(axiosError.response).toBeDefined();
47
+ expect((_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.status).toBe(404);
48
+ expect((_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.data).toStrictEqual({
49
+ error: 'Invalid practice.',
50
+ detailedmessage: 'The practice ID does not exist.',
51
+ });
52
+ }
53
+ expect(onComplete).not.toHaveBeenCalled();
54
+ });
34
55
  test('Should return an error when patient is not found', async () => {
35
56
  var _a, _b;
36
57
  const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
37
58
  fields: {
38
- patientId: 'non-existent-patient-id',
39
- practiceId: '195900',
59
+ patientId: 'non-existing-patient-id',
40
60
  },
41
61
  settings: mockData_1.mockSettings,
42
62
  });
@@ -1 +1 @@
1
- {"version":3,"file":"getPatient.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getPatient/getPatient.test.ts"],"names":[],"mappings":";;AAAA,wBAA8B;AAC9B,iDAA2D;AAE3D,2DAGqC;AACrC,uCAAoC;AAEpC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAE7B,QAAQ,CAAC,4B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AM,UAAU,GAAG,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,8CAA8C;aACtD,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":"getPatient.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getPatient/getPatient.test.ts"],"names":[],"mappings":";;AAAA,wBAA8B;AAC9B,iDAA2D;AAE3D,2DAGqC;AACrC,uCAAoC;AAEpC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAE7B,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,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,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,SAAS,EAAE,OAAO;aACnB;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,MAAM,aAAU,CAAC,iBAAiB,CAChC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,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AAE;gBACN,SAAS,EAAE,yBAAyB;aACrC;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,CAAA;QAEF,IAAI;YACF,MAAM,aAAU,CAAC,iBAAiB,CAChC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,UAAU,GAAG,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,8CAA8C;aACtD,CAAC,CAAA;SACH;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -7,13 +7,6 @@ declare const actions: {
7
7
  type: import("@awell-health/extensions-core").FieldType.STRING;
8
8
  required: true;
9
9
  };
10
- practiceId: {
11
- id: string;
12
- label: string;
13
- description: string;
14
- type: import("@awell-health/extensions-core").FieldType.STRING;
15
- required: true;
16
- };
17
10
  }, {
18
11
  auth_url: {
19
12
  key: string;
@@ -50,16 +43,16 @@ declare const actions: {
50
43
  required: true;
51
44
  description: string;
52
45
  };
53
- }, "email" | "firstName" | "lastName" | "dob", never>;
54
- getAppointment: import("@awell-health/extensions-core").Action<{
55
- appointmentId: {
56
- id: string;
46
+ practiceId: {
47
+ key: string;
57
48
  label: string;
58
- description: string;
59
- type: import("@awell-health/extensions-core").FieldType.STRING;
49
+ obfuscated: false;
60
50
  required: true;
51
+ description: string;
61
52
  };
62
- practiceId: {
53
+ }, "email" | "firstName" | "lastName" | "dob", never>;
54
+ getAppointment: import("@awell-health/extensions-core").Action<{
55
+ appointmentId: {
63
56
  id: string;
64
57
  label: string;
65
58
  description: string;
@@ -102,15 +95,15 @@ declare const actions: {
102
95
  required: true;
103
96
  description: string;
104
97
  };
105
- }, "startTime" | "status" | "date" | "patientId" | "duration" | "appointmentTypeId" | "appointmentTypeName", never>;
106
- createPatient: import("@awell-health/extensions-core").Action<{
107
- practiceid: {
108
- id: string;
98
+ practiceId: {
99
+ key: string;
109
100
  label: string;
110
- description: string;
111
- type: import("@awell-health/extensions-core").FieldType.STRING;
101
+ obfuscated: false;
112
102
  required: true;
103
+ description: string;
113
104
  };
105
+ }, "startTime" | "status" | "date" | "patientId" | "duration" | "appointmentTypeId" | "appointmentTypeName", never>;
106
+ createPatient: import("@awell-health/extensions-core").Action<{
114
107
  departmentid: {
115
108
  id: string;
116
109
  label: string;
@@ -182,15 +175,15 @@ declare const actions: {
182
175
  required: true;
183
176
  description: string;
184
177
  };
185
- }, "createdPatientId", never>;
186
- createAppointmentNote: import("@awell-health/extensions-core").Action<{
187
- practiceid: {
188
- id: string;
178
+ practiceId: {
179
+ key: string;
189
180
  label: string;
190
- description: string;
191
- type: import("@awell-health/extensions-core").FieldType.STRING;
181
+ obfuscated: false;
192
182
  required: true;
183
+ description: string;
193
184
  };
185
+ }, "createdPatientId", never>;
186
+ createAppointmentNote: import("@awell-health/extensions-core").Action<{
194
187
  appointmentid: {
195
188
  id: string;
196
189
  label: string;
@@ -248,6 +241,13 @@ declare const actions: {
248
241
  required: true;
249
242
  description: string;
250
243
  };
244
+ practiceId: {
245
+ key: string;
246
+ label: string;
247
+ obfuscated: false;
248
+ required: true;
249
+ description: string;
250
+ };
251
251
  }, never, never>;
252
252
  };
253
253
  export default actions;
@@ -4,15 +4,11 @@ const getPatient_1 = require("./getPatient");
4
4
  const getAppointment_1 = require("./getAppointment");
5
5
  const createPatient_1 = require("./createPatient");
6
6
  const createAppointmentNote_1 = require("./createAppointmentNote");
7
- // import { addProblemToPatientChart } from './addProblemToPatientChart'
8
- // import { addDocumentToPatientChart } from './addDocumentToPatientChart'
9
7
  const actions = {
10
8
  getPatient: getPatient_1.getPatient,
11
9
  getAppointment: getAppointment_1.getAppointment,
12
10
  createPatient: createPatient_1.createPatient,
13
11
  createAppointmentNote: createAppointmentNote_1.createAppointmentNote,
14
- // addProblemToPatientChart,
15
- // addDocumentToPatientChart,
16
12
  };
17
13
  exports.default = actions;
18
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/athenahealth/actions/index.ts"],"names":[],"mappings":";;AAAA,6CAAyC;AACzC,qDAAiD;AACjD,mDAA+C;AAC/C,mEAA+D;AAC/D,wEAAwE;AACxE,0EAA0E;AAE1E,MAAM,OAAO,GAAG;IACd,UAAU,EAAV,uBAAU;IACV,cAAc,EAAd,+BAAc;IACd,aAAa,EAAb,6BAAa;IACb,qBAAqB,EAArB,6CAAqB;IACrB,4BAA4B;IAC5B,6BAA6B;CAC9B,CAAA;AAED,kBAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/athenahealth/actions/index.ts"],"names":[],"mappings":";;AAAA,6CAAyC;AACzC,qDAAiD;AACjD,mDAA+C;AAC/C,mEAA+D;AAE/D,MAAM,OAAO,GAAG;IACd,UAAU,EAAV,uBAAU;IACV,cAAc,EAAd,+BAAc;IACd,aAAa,EAAb,6BAAa;IACb,qBAAqB,EAArB,6CAAqB;CACtB,CAAA;AAED,kBAAe,OAAO,CAAA"}
@@ -2,6 +2,7 @@ import { APIClient, DataWrapper, type DataWrapperCtor, type OAuthGrantClientCred
2
2
  import { type CreateAppointmentNoteInputType } from '../actions/createAppointmentNote/config/fields';
3
3
  import { type CreatePatientInputType } from '../actions/createPatient/config/fields';
4
4
  import { type PatientSchemaType, type AppointmentSchemaType } from './schema';
5
+ import { type CreateAppointmentNoteResponseType } from './schema/appointment';
5
6
  import { type CreatePatientResponseType } from './schema/patient';
6
7
  export declare class AthenaDataWrapper extends DataWrapper {
7
8
  createPatient({ practiceId, data, }: {
@@ -20,7 +21,7 @@ export declare class AthenaDataWrapper extends DataWrapper {
20
21
  practiceId: string;
21
22
  appointmentId: string;
22
23
  data: Omit<CreateAppointmentNoteInputType, 'practiceid' | 'appointmentid'>;
23
- }): Promise<CreatePatientResponseType>;
24
+ }): Promise<CreateAppointmentNoteResponseType>;
24
25
  }
25
26
  interface AthenaClientConstructorProps {
26
27
  authUrl: string;
@@ -46,6 +47,6 @@ export declare class AthenaAPIClient extends APIClient<AthenaDataWrapper> {
46
47
  practiceId: string;
47
48
  appointmentId: string;
48
49
  data: Omit<CreateAppointmentNoteInputType, 'practiceid' | 'appointmentid'>;
49
- }): Promise<CreatePatientResponseType>;
50
+ }): Promise<CreateAppointmentNoteResponseType>;
50
51
  }
51
52
  export {};
@@ -34,7 +34,7 @@ class AthenaDataWrapper extends extensions_core_1.DataWrapper {
34
34
  headers: { 'content-type': 'application/x-www-form-urlencoded' },
35
35
  data,
36
36
  });
37
- return result[0];
37
+ return result;
38
38
  }
39
39
  }
40
40
  exports.AthenaDataWrapper = AthenaDataWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../extensions/athenahealth/api/client.ts"],"names":[],"mappings":";;;AAAA,mEAMsC;AAGtC,iDAA6C;AAI7C,MAAa,iBAAkB,SAAQ,6BAAW;IACzC,KAAK,CAAC,aAAa,CAAC,EACzB,UAAU,EACV,IAAI,GAIL;QACC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAA8B;YAC7D,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,OAAO,UAAU,WAAW;YACjC,OAAO,EAAE,EAAE,cAAc,EAAE,mCAAmC,EAAE;YAChE,IAAI;SACL,CAAC,CAAA;QAEF,OAAO,MAAM,CAAC,CAAC,CAAC,CAAA;IAClB,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,EACtB,UAAU,EACV,SAAS,GAIV;QACC,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Aa,CAAC,EACzB,UAAU,EACV,IAAI,GAIL;QACC,OAAO,MAAM,IAAI,CAAC,SAAS,CACzB,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAC3D,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,EACtB,UAAU,EACV,SAAS,GAIV;QACC,OAAO,MAAM,IAAI,CAAC,SAAS,CACzB,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAC7D,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,EAC1B,UAAU,EACV,aAAa,GAId;QACC,OAAO,MAAM,IAAI,CAAC,SAAS,CACzB,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,cAAc,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CACrE,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,qBAAqB,CAAC,EACjC,UAAU,EACV,aAAa,EACb,IAAI,GAKL;QACC,OAAO,MAAM,IAAI,CAAC,SAAS,CACzB,KAAK,EAAE,EAAE,EAAE,EAAE,CACX,MAAM,EAAE,CAAC,qBAAqB,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CACtE,CAAA;IACH,CAAC;CACF;AAvED,0CAuEC"}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../extensions/athenahealth/api/client.ts"],"names":[],"mappings":";;;AAAA,mEAMsC;AAGtC,iDAA6C;AAK7C,MAAa,iBAAkB,SAAQ,6BAAW;IACzC,KAAK,CAAC,aAAa,CAAC,EACzB,UAAU,EACV,IAAI,GAIL;QACC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAA8B;YAC7D,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,O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,YAAY,EAAZ,2BAAY;aACb,CAAC;SACH,CAAC,CAAA;QAjBK,SAAI,GAAuC,CAClD,KAAa,EACb,OAAe,EACf,EAAE,CAAC,IAAI,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAe1C,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,EACzB,UAAU,EACV,IAAI,GAIL;QACC,OAAO,MAAM,IAAI,CAAC,SAAS,CACzB,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAC3D,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,EACtB,UAAU,EACV,SAAS,GAIV;QACC,OAAO,MAAM,IAAI,CAAC,SAAS,CACzB,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAC7D,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,EAC1B,UAAU,EACV,aAAa,GAId;QACC,OAAO,MAAM,IAAI,CAAC,SAAS,CACzB,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,cAAc,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CACrE,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,qBAAqB,CAAC,EACjC,UAAU,EACV,aAAa,EACb,IAAI,GAKL;QACC,OAAO,MAAM,IAAI,CAAC,SAAS,CACzB,KAAK,EAAE,EAAE,EAAE,EAAE,CACX,MAAM,EAAE,CAAC,qBAAqB,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CACtE,CAAA;IACH,CAAC;CACF;AAvED,0CAuEC"}
@@ -1,4 +1,7 @@
1
1
  import z from 'zod';
2
+ export interface CreateAppointmentNoteResponseType {
3
+ success: string;
4
+ }
2
5
  export declare const AppointmentSchema: z.ZodObject<{
3
6
  appointmenttypeid: z.ZodString;
4
7
  appointmenttype: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"appointment.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/api/schema/appointment.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAmB;AACnB,iCAA6C;AAEhC,QAAA,iBAAiB,GAAG,aAAC,CAAC,MAAM,CAAC;IACxC,iBAAiB,EAAE,aAAC,CAAC,MAAM,EAAE;IAC7B,eAAe,EAAE,aAAC,CAAC,MAAM,EAAE;IAC3B,0BAA0B,EAAE,aAAC,CAAC,MAAM,EAAE;IACtC,iBAAiB,EAAE,aAAC,CAAC,MAAM,EAAE;IAC7B,YAAY,EAAE,aAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE;IACtB,IAAI,EAAE,2BAAoB;IAC1B,SAAS,EAAE,aAAC,CAAC,MAAM,EAAE;IACrB,QAAQ,EAAE,aAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,aAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAA"}
1
+ {"version":3,"file":"appointment.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/api/schema/appointment.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAmB;AACnB,iCAA6C;AAMhC,QAAA,iBAAiB,GAAG,aAAC,CAAC,MAAM,CAAC;IACxC,iBAAiB,EAAE,aAAC,CAAC,MAAM,EAAE;IAC7B,eAAe,EAAE,aAAC,CAAC,MAAM,EAAE;IAC3B,0BAA0B,EAAE,aAAC,CAAC,MAAM,EAAE;IACtC,iBAAiB,EAAE,aAAC,CAAC,MAAM,EAAE;IAC7B,YAAY,EAAE,aAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE;IACtB,IAAI,EAAE,2BAAoB;IAC1B,SAAS,EAAE,aAAC,CAAC,MAAM,EAAE;IACrB,QAAQ,EAAE,aAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,aAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAA"}
@@ -1,11 +1,13 @@
1
1
  import z from 'zod';
2
2
  import { AthenaAPIClient } from './api/client';
3
+ import { SettingsValidationSchema } from './settings';
3
4
  type ValidateAndCreateClient = <T extends z.ZodTypeAny>(args: {
4
5
  fieldsSchema: T;
5
6
  payload: unknown;
6
7
  }) => Promise<{
7
8
  client: AthenaAPIClient;
8
9
  fields: z.infer<(typeof args)['fieldsSchema']>;
10
+ settings: z.infer<typeof SettingsValidationSchema>;
9
11
  }>;
10
12
  export declare const validatePayloadAndCreateClient: ValidateAndCreateClient;
11
13
  export {};
@@ -9,7 +9,7 @@ const zod_1 = __importDefault(require("zod"));
9
9
  const client_1 = require("./api/client");
10
10
  const settings_1 = require("./settings");
11
11
  const validatePayloadAndCreateClient = async ({ fieldsSchema, payload, }) => {
12
- const { settings: { client_id, client_secret, auth_url, api_url, scope }, fields, } = (0, extensions_core_1.validate)({
12
+ const { settings: { client_id, client_secret, auth_url, api_url, scope }, fields, settings, } = (0, extensions_core_1.validate)({
13
13
  schema: zod_1.default.object({
14
14
  fields: fieldsSchema,
15
15
  settings: settings_1.SettingsValidationSchema,
@@ -25,7 +25,7 @@ const validatePayloadAndCreateClient = async ({ fieldsSchema, payload, }) => {
25
25
  },
26
26
  baseUrl: api_url,
27
27
  });
28
- return { client, fields };
28
+ return { client, fields, settings };
29
29
  };
30
30
  exports.validatePayloadAndCreateClient = validatePayloadAndCreateClient;
31
31
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../extensions/athenahealth/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,mEAAwD;AACxD,8CAAmB;AACnB,yCAA8C;AAC9C,yCAAqD;AAU9C,MAAM,8BAA8B,GAA4B,KAAK,EAAE,EAC5E,YAAY,EACZ,OAAO,GACR,EAAE,EAAE;IACH,MAAM,EACJ,QAAQ,EAAE,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EAAE,CAAA;AACrC,CAAC,CAAA;AA3BY,QAAA,8BAA8B,kCA2B1C"}
@@ -35,6 +35,13 @@ export declare const settings: {
35
35
  required: true;
36
36
  description: string;
37
37
  };
38
+ practiceId: {
39
+ key: string;
40
+ label: string;
41
+ obfuscated: false;
42
+ required: true;
43
+ description: string;
44
+ };
38
45
  };
39
46
  export declare const SettingsValidationSchema: z.ZodObject<{
40
47
  client_id: z.ZodString;
@@ -42,16 +49,19 @@ export declare const SettingsValidationSchema: z.ZodObject<{
42
49
  auth_url: z.ZodString;
43
50
  api_url: z.ZodString;
44
51
  scope: z.ZodString;
52
+ practiceId: z.ZodString;
45
53
  }, "strip", z.ZodTypeAny, {
46
54
  auth_url: string;
47
55
  client_id: string;
48
56
  client_secret: string;
49
57
  scope: string;
58
+ practiceId: string;
50
59
  api_url: string;
51
60
  }, {
52
61
  auth_url: string;
53
62
  client_id: string;
54
63
  client_secret: string;
55
64
  scope: string;
65
+ practiceId: string;
56
66
  api_url: string;
57
67
  }>;
@@ -38,12 +38,20 @@ exports.settings = {
38
38
  required: true,
39
39
  description: 'The value is a space-delimited, case-sensitive string of requested scopes.',
40
40
  },
41
+ practiceId: {
42
+ key: 'practiceId',
43
+ label: 'Practice ID',
44
+ obfuscated: false,
45
+ required: true,
46
+ description: 'The ID of your practice within athenahealth',
47
+ },
41
48
  };
42
49
  exports.SettingsValidationSchema = zod_1.z.object({
43
- client_id: zod_1.z.string(),
44
- client_secret: zod_1.z.string(),
50
+ client_id: zod_1.z.string().min(1),
51
+ client_secret: zod_1.z.string().min(1),
45
52
  auth_url: zod_1.z.string().url(),
46
53
  api_url: zod_1.z.string().url(),
47
- scope: zod_1.z.string(),
54
+ scope: zod_1.z.string().min(1),
55
+ practiceId: zod_1.z.string().min(1),
48
56
  });
49
57
  //# sourceMappingURL=settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../extensions/athenahealth/settings.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,QAAQ,GAAG;IACtB,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf,KAAK,EAAE,iBAAiB;QACxB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,uEAAuE;KAC1E;IACD,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,KAAK,EAAE,WAAW;QAClB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,uEAAuE;KAC1E;IACD,aAAa,EAAE;QACb,GAAG,EAAE,eAAe;QACpB,KAAK,EAAE,eAAe;QACtB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,uEAAuE;KAC1E;IACD,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,yCAAyC;KACvD;IACD,KAAK,EAAE;QACL,GAAG,EAAE,OAAO;QACZ,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,4EAA4E;KAC/E;CACgC,CAAA;AAEtB,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC1B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACzB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;CACkC,CAAC,CAAA"}
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../extensions/athenahealth/settings.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,QAAQ,GAAG;IACtB,QAAQ,EAAE;QACR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,CAAC,CAAC,CAAC;IACxB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACsB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "1.0.215",
3
+ "version": "1.0.217",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {
@@ -1,4 +0,0 @@
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 addDocumentToPatientChart: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addDocumentToPatientChart = 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.addDocumentToPatientChart = {
8
- key: 'addDocumentToPatientChart',
9
- category: extensions_core_1.Category.EHR_INTEGRATIONS,
10
- title: 'Add document to patient chart',
11
- description: "Adds a document to the patient's chart",
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
- },
23
- };
24
- //# sourceMappingURL=addDocumentToPatientChart.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addDocumentToPatientChart.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;AAEjD,QAAA,yBAAyB,GAIlC;IACF,GAAG,EAAE,2BAA2B;IAChC,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,+BAA+B;IACtC,WAAW,EAAE,wCAAwC;IACrD,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,EAAE,CAAA;IACpB,CAAC;CACF,CAAA"}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const _1 = require(".");
4
- const tests_1 = require("../../../../src/tests");
5
- describe('Athena - Cancel 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
- patientId: '1',
19
- practiceId: '1',
20
- departmentId: '1',
21
- actionNote: 'Some note',
22
- documentContent: 'Some content',
23
- autoClose: false,
24
- },
25
- settings,
26
- });
27
- await _1.addDocumentToPatientChart.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
28
- expect(onComplete).toHaveBeenCalled();
29
- });
30
- });
31
- //# sourceMappingURL=addDocumentToPatientChart.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addDocumentToPatientChart.test.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.test.ts"],"names":[],"mappings":";;AAAA,wBAA6C;AAC7C,iDAA2D;AAE3D,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,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,SAAS,EAAE,GAAG;gBACd,UAAU,EAAE,GAAG;gBACf,YAAY,EAAE,GAAG;gBACjB,UAAU,EAAE,WAAW;gBACvB,eAAe,EAAE,cAAc;gBAC/B,SAAS,EAAE,KAAK;aACjB;YACD,QAAQ;SACT,CAAC,CAAA;QAEF,MAAM,4BAAyB,CAAC,iBAAiB,CAC/C,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAA;IACvC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- export declare const dataPoints: {};
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dataPoints = void 0;
4
- exports.dataPoints = {};
5
- //# sourceMappingURL=datapoints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/addDocumentToPatientChart/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,EAAgD,CAAA"}
@@ -1,68 +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.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
- departmentId: {
19
- id: string;
20
- label: string;
21
- description: string;
22
- type: FieldType.STRING;
23
- required: true;
24
- };
25
- actionNote: {
26
- id: string;
27
- label: string;
28
- description: string;
29
- type: FieldType.STRING;
30
- required: false;
31
- };
32
- documentContent: {
33
- id: string;
34
- label: string;
35
- description: string;
36
- type: FieldType.HTML;
37
- required: true;
38
- };
39
- autoClose: {
40
- id: string;
41
- label: string;
42
- description: string;
43
- type: FieldType.BOOLEAN;
44
- required: true;
45
- };
46
- };
47
- export declare const FieldsValidationSchema: z.ZodObject<{
48
- patientId: z.ZodString;
49
- practiceId: z.ZodString;
50
- departmentId: z.ZodString;
51
- actionNote: z.ZodString;
52
- documentContent: z.ZodString;
53
- autoClose: z.ZodBoolean;
54
- }, "strip", z.ZodTypeAny, {
55
- patientId: string;
56
- practiceId: string;
57
- departmentId: string;
58
- actionNote: string;
59
- documentContent: string;
60
- autoClose: boolean;
61
- }, {
62
- patientId: string;
63
- practiceId: string;
64
- departmentId: string;
65
- actionNote: string;
66
- documentContent: string;
67
- autoClose: boolean;
68
- }>;
@@ -1,61 +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: '',
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
- departmentId: {
25
- id: 'departmentId',
26
- label: 'Department ID',
27
- description: 'The department ID associated with the uploaded document.',
28
- type: extensions_core_1.FieldType.STRING,
29
- required: true,
30
- },
31
- actionNote: {
32
- id: 'actionNote',
33
- label: 'Any note to accompany the creation of this document',
34
- description: '',
35
- type: extensions_core_1.FieldType.STRING,
36
- required: false,
37
- },
38
- documentContent: {
39
- id: 'documentContent',
40
- label: 'Content of the document',
41
- description: '',
42
- type: extensions_core_1.FieldType.HTML,
43
- required: true,
44
- },
45
- autoClose: {
46
- id: 'autoClose',
47
- label: 'Auto close?',
48
- description: 'Documents will, normally, automatically appear in the clinical inbox for providers to review. In some cases, you might want to force the document to skip the clinical inbox, and go directly to the patient chart with a "closed" status.',
49
- type: extensions_core_1.FieldType.BOOLEAN,
50
- required: true,
51
- },
52
- };
53
- exports.FieldsValidationSchema = zod_1.default.object({
54
- patientId: zod_1.default.string(),
55
- practiceId: zod_1.default.string(),
56
- departmentId: zod_1.default.string(),
57
- actionNote: zod_1.default.string(),
58
- documentContent: zod_1.default.string(),
59
- autoClose: zod_1.default.boolean(),
60
- });
61
- //# sourceMappingURL=fields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/addDocumentToPatientChart/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,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;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,0DAA0D;QACvE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,qDAAqD;QAC5D,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,eAAe,EAAE;QACf,EAAE,EAAE,iBAAiB;QACrB,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;KACf;IACD,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,aAAa;QACpB,WAAW,EACT,4OAA4O;QAC9O,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,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;IACtB,YAAY,EAAE,aAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE;IACtB,eAAe,EAAE,aAAC,CAAC,MAAM,EAAE;IAC3B,SAAS,EAAE,aAAC,CAAC,OAAO,EAAE;CAC2B,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export { fields, FieldsValidationSchema } from './fields';
2
- export { dataPoints } from './datapoints';
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/addDocumentToPatientChart/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -1 +0,0 @@
1
- export { addDocumentToPatientChart } from './addDocumentToPatientChart';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addDocumentToPatientChart = void 0;
4
- var addDocumentToPatientChart_1 = require("./addDocumentToPatientChart");
5
- Object.defineProperty(exports, "addDocumentToPatientChart", { enumerable: true, get: function () { return addDocumentToPatientChart_1.addDocumentToPatientChart; } });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/addDocumentToPatientChart/index.ts"],"names":[],"mappings":";;;AAAA,yEAAuE;AAA9D,sIAAA,yBAAyB,OAAA"}