@awell-health/awell-extensions 1.0.214 → 1.0.215

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. package/dist/extensions/athenahealth/actions/createAppointmentNote/config/datapoints.js.map +1 -0
  2. package/dist/extensions/athenahealth/actions/{addProblemToPatientChart → createAppointmentNote}/config/fields.d.ts +19 -18
  3. package/dist/extensions/athenahealth/actions/{addProblemToPatientChart → createAppointmentNote}/config/fields.js +20 -20
  4. package/dist/extensions/athenahealth/actions/createAppointmentNote/config/fields.js.map +1 -0
  5. package/dist/extensions/athenahealth/actions/createAppointmentNote/config/index.js.map +1 -0
  6. package/dist/extensions/athenahealth/actions/{addProblemToPatientChart/addProblemToPatientChart.d.ts → createAppointmentNote/createAppointmentNote.d.ts} +1 -1
  7. package/dist/extensions/athenahealth/actions/{addProblemToPatientChart/addProblemToPatientChart.js → createAppointmentNote/createAppointmentNote.js} +12 -7
  8. package/dist/extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.js.map +1 -0
  9. package/dist/extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.test.js +51 -0
  10. package/dist/extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.test.js.map +1 -0
  11. package/dist/extensions/athenahealth/actions/createAppointmentNote/index.d.ts +1 -0
  12. package/dist/extensions/athenahealth/actions/createAppointmentNote/index.js +6 -0
  13. package/dist/extensions/athenahealth/actions/createAppointmentNote/index.js.map +1 -0
  14. package/dist/extensions/athenahealth/actions/createPatient/config/datapoints.d.ts +6 -0
  15. package/dist/extensions/athenahealth/actions/createPatient/config/datapoints.js +10 -0
  16. package/dist/extensions/athenahealth/actions/createPatient/config/datapoints.js.map +1 -0
  17. package/dist/extensions/athenahealth/actions/createPatient/config/fields.d.ts +69 -0
  18. package/dist/extensions/athenahealth/actions/createPatient/config/fields.js +62 -0
  19. package/dist/extensions/athenahealth/actions/createPatient/config/fields.js.map +1 -0
  20. package/dist/extensions/athenahealth/actions/createPatient/config/index.js.map +1 -0
  21. package/dist/extensions/athenahealth/actions/{cancelAppointment/cancelAppointment.d.ts → createPatient/createPatient.d.ts} +1 -1
  22. package/dist/extensions/athenahealth/actions/{cancelAppointment/cancelAppointment.js → createPatient/createPatient.js} +16 -8
  23. package/dist/extensions/athenahealth/actions/createPatient/createPatient.js.map +1 -0
  24. package/dist/extensions/athenahealth/actions/createPatient/createPatient.test.js +33 -0
  25. package/dist/extensions/athenahealth/actions/createPatient/createPatient.test.js.map +1 -0
  26. package/dist/extensions/athenahealth/actions/createPatient/index.d.ts +1 -0
  27. package/dist/extensions/athenahealth/actions/createPatient/index.js +6 -0
  28. package/dist/extensions/athenahealth/actions/createPatient/index.js.map +1 -0
  29. package/dist/extensions/athenahealth/actions/getAppointment/config/datapoints.d.ts +9 -1
  30. package/dist/extensions/athenahealth/actions/getAppointment/config/datapoints.js +9 -1
  31. package/dist/extensions/athenahealth/actions/getAppointment/config/datapoints.js.map +1 -1
  32. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.js +11 -6
  33. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.js.map +1 -1
  34. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.test.js +40 -15
  35. package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.test.js.map +1 -1
  36. package/dist/extensions/athenahealth/actions/getPatient/getPatient.js +8 -7
  37. package/dist/extensions/athenahealth/actions/getPatient/getPatient.js.map +1 -1
  38. package/dist/extensions/athenahealth/actions/getPatient/getPatient.test.js +38 -15
  39. package/dist/extensions/athenahealth/actions/getPatient/getPatient.test.js.map +1 -1
  40. package/dist/extensions/athenahealth/actions/index.d.ts +18 -70
  41. package/dist/extensions/athenahealth/actions/index.js +8 -6
  42. package/dist/extensions/athenahealth/actions/index.js.map +1 -1
  43. package/dist/extensions/athenahealth/api/client.d.ts +32 -2
  44. package/dist/extensions/athenahealth/api/client.js +38 -2
  45. package/dist/extensions/athenahealth/api/client.js.map +1 -1
  46. package/dist/extensions/athenahealth/api/schema/appointment.d.ts +36 -0
  47. package/dist/extensions/athenahealth/api/schema/appointment.js +21 -0
  48. package/dist/extensions/athenahealth/api/schema/appointment.js.map +1 -0
  49. package/dist/extensions/athenahealth/api/schema/date.d.ts +7 -0
  50. package/dist/extensions/athenahealth/api/schema/date.js +23 -0
  51. package/dist/extensions/athenahealth/api/schema/date.js.map +1 -0
  52. package/dist/extensions/athenahealth/api/schema/index.d.ts +3 -0
  53. package/dist/extensions/athenahealth/api/schema/index.js +11 -0
  54. package/dist/extensions/athenahealth/api/schema/index.js.map +1 -0
  55. package/dist/extensions/athenahealth/api/schema/patient.d.ts +42 -0
  56. package/dist/extensions/athenahealth/api/schema/patient.js +22 -0
  57. package/dist/extensions/athenahealth/api/schema/patient.js.map +1 -0
  58. package/dist/extensions/athenahealth/api/schema/schema.test.d.ts +1 -0
  59. package/dist/extensions/athenahealth/api/schema/schema.test.js +22 -0
  60. package/dist/extensions/athenahealth/api/schema/schema.test.js.map +1 -0
  61. package/dist/extensions/athenahealth/validation/date.d.ts +6 -0
  62. package/dist/extensions/athenahealth/validation/date.js +22 -0
  63. package/dist/extensions/athenahealth/validation/date.js.map +1 -0
  64. package/dist/extensions/athenahealth/validation/validation.test.d.ts +1 -0
  65. package/dist/extensions/athenahealth/validation/validation.test.js +12 -0
  66. package/dist/extensions/athenahealth/validation/validation.test.js.map +1 -0
  67. package/dist/extensions/markdown.json +1 -1
  68. package/package.json +1 -1
  69. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.js.map +0 -1
  70. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.test.js +0 -29
  71. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.test.js.map +0 -1
  72. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/datapoints.js.map +0 -1
  73. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/fields.js.map +0 -1
  74. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/index.js.map +0 -1
  75. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/index.d.ts +0 -1
  76. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/index.js +0 -6
  77. package/dist/extensions/athenahealth/actions/addProblemToPatientChart/index.js.map +0 -1
  78. package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.js.map +0 -1
  79. package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.test.js +0 -27
  80. package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.test.js.map +0 -1
  81. package/dist/extensions/athenahealth/actions/cancelAppointment/config/datapoints.d.ts +0 -1
  82. package/dist/extensions/athenahealth/actions/cancelAppointment/config/datapoints.js +0 -5
  83. package/dist/extensions/athenahealth/actions/cancelAppointment/config/datapoints.js.map +0 -1
  84. package/dist/extensions/athenahealth/actions/cancelAppointment/config/fields.d.ts +0 -28
  85. package/dist/extensions/athenahealth/actions/cancelAppointment/config/fields.js +0 -29
  86. package/dist/extensions/athenahealth/actions/cancelAppointment/config/fields.js.map +0 -1
  87. package/dist/extensions/athenahealth/actions/cancelAppointment/config/index.js.map +0 -1
  88. package/dist/extensions/athenahealth/actions/cancelAppointment/index.d.ts +0 -1
  89. package/dist/extensions/athenahealth/actions/cancelAppointment/index.js +0 -6
  90. package/dist/extensions/athenahealth/actions/cancelAppointment/index.js.map +0 -1
  91. /package/dist/extensions/athenahealth/actions/{addProblemToPatientChart → createAppointmentNote}/config/datapoints.d.ts +0 -0
  92. /package/dist/extensions/athenahealth/actions/{addProblemToPatientChart → createAppointmentNote}/config/datapoints.js +0 -0
  93. /package/dist/extensions/athenahealth/actions/{addProblemToPatientChart → createAppointmentNote}/config/index.d.ts +0 -0
  94. /package/dist/extensions/athenahealth/actions/{addProblemToPatientChart → createAppointmentNote}/config/index.js +0 -0
  95. /package/dist/extensions/athenahealth/actions/{addProblemToPatientChart/addProblemToPatientChart.test.d.ts → createAppointmentNote/createAppointmentNote.test.d.ts} +0 -0
  96. /package/dist/extensions/athenahealth/actions/{cancelAppointment → createPatient}/config/index.d.ts +0 -0
  97. /package/dist/extensions/athenahealth/actions/{cancelAppointment → createPatient}/config/index.js +0 -0
  98. /package/dist/extensions/athenahealth/actions/{cancelAppointment/cancelAppointment.test.d.ts → createPatient/createPatient.test.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/createAppointmentNote/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,EAAgD,CAAA"}
@@ -1,48 +1,49 @@
1
1
  import { FieldType } from '@awell-health/extensions-core';
2
2
  import z from 'zod';
3
3
  export declare const fields: {
4
- patientId: {
4
+ practiceid: {
5
5
  id: string;
6
6
  label: string;
7
7
  description: string;
8
8
  type: FieldType.STRING;
9
9
  required: true;
10
10
  };
11
- practiceId: {
11
+ appointmentid: {
12
12
  id: string;
13
13
  label: string;
14
14
  description: string;
15
15
  type: FieldType.STRING;
16
16
  required: true;
17
17
  };
18
- note: {
18
+ notetext: {
19
19
  id: string;
20
20
  label: string;
21
21
  description: string;
22
22
  type: FieldType.TEXT;
23
23
  required: true;
24
24
  };
25
- onsetDate: {
25
+ displayonschedule: {
26
26
  id: string;
27
27
  label: string;
28
28
  description: string;
29
- type: FieldType.DATE;
30
- required: true;
29
+ type: FieldType.BOOLEAN;
30
+ required: false;
31
31
  };
32
32
  };
33
33
  export declare const FieldsValidationSchema: z.ZodObject<{
34
- patientId: z.ZodString;
35
- practiceId: z.ZodString;
36
- note: z.ZodString;
37
- onsetDate: z.ZodEffects<z.ZodDate, string, Date>;
34
+ practiceid: z.ZodString;
35
+ appointmentid: z.ZodString;
36
+ notetext: z.ZodString;
37
+ displayonschedule: z.ZodOptional<z.ZodBoolean>;
38
38
  }, "strip", z.ZodTypeAny, {
39
- note: string;
40
- patientId: string;
41
- practiceId: string;
42
- onsetDate: string;
39
+ practiceid: string;
40
+ appointmentid: string;
41
+ notetext: string;
42
+ displayonschedule?: boolean | undefined;
43
43
  }, {
44
- note: string;
45
- patientId: string;
46
- practiceId: string;
47
- onsetDate: Date;
44
+ practiceid: string;
45
+ appointmentid: string;
46
+ notetext: string;
47
+ displayonschedule?: boolean | undefined;
48
48
  }>;
49
+ export type CreateAppointmentNoteInputType = z.infer<typeof FieldsValidationSchema>;
@@ -7,39 +7,39 @@ 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
- patientId: {
11
- id: 'patientId',
12
- label: 'Patient ID',
10
+ practiceid: {
11
+ id: 'practiceid',
12
+ label: 'Practice ID',
13
13
  description: '',
14
14
  type: extensions_core_1.FieldType.STRING,
15
15
  required: true,
16
16
  },
17
- practiceId: {
18
- id: 'practiceId',
19
- label: 'Practice ID',
17
+ appointmentid: {
18
+ id: 'appointmentid',
19
+ label: 'Appointment ID',
20
20
  description: '',
21
21
  type: extensions_core_1.FieldType.STRING,
22
22
  required: true,
23
23
  },
24
- note: {
25
- id: 'note',
26
- label: 'Note',
27
- description: 'The note to be attached to this problem',
24
+ notetext: {
25
+ id: 'notetext',
26
+ label: 'Note text',
27
+ description: '',
28
28
  type: extensions_core_1.FieldType.TEXT,
29
29
  required: true,
30
30
  },
31
- onsetDate: {
32
- id: 'onsetDate',
33
- label: 'Onset date',
34
- description: 'The onset date to be updated for this problem',
35
- type: extensions_core_1.FieldType.DATE,
36
- required: true,
31
+ displayonschedule: {
32
+ id: 'displayonschedule',
33
+ label: 'Add note to homepage',
34
+ description: 'Add appointment note to homepage display',
35
+ type: extensions_core_1.FieldType.BOOLEAN,
36
+ required: false,
37
37
  },
38
38
  };
39
39
  exports.FieldsValidationSchema = zod_1.default.object({
40
- patientId: zod_1.default.string(),
41
- practiceId: zod_1.default.string(),
42
- note: zod_1.default.string(),
43
- onsetDate: extensions_core_1.DateOnlySchema,
40
+ practiceid: zod_1.default.string().min(1),
41
+ appointmentid: zod_1.default.string().min(1),
42
+ notetext: zod_1.default.string().min(1),
43
+ displayonschedule: zod_1.default.boolean().optional(),
44
44
  });
45
45
  //# sourceMappingURL=fields.js.map
@@ -0,0 +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"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/createAppointmentNote/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -1,4 +1,4 @@
1
1
  import { type Action } from '@awell-health/extensions-core';
2
2
  import { type settings } from '../../settings';
3
3
  import { fields, dataPoints } from './config';
4
- export declare const addProblemToPatientChart: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
4
+ export declare const createAppointmentNote: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addProblemToPatientChart = void 0;
3
+ exports.createAppointmentNote = 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
- exports.addProblemToPatientChart = {
8
- key: 'addProblemToPatientChart',
7
+ const lodash_1 = require("lodash");
8
+ exports.createAppointmentNote = {
9
+ key: 'createAppointmentNote',
9
10
  category: extensions_core_1.Category.EHR_INTEGRATIONS,
10
- title: 'Add problem to patient chart',
11
- description: "Records a problem in the patient's active problem list",
11
+ title: 'Create appointment note',
12
+ description: 'Creates a note for a specific appointment',
12
13
  fields: config_1.fields,
13
14
  previewable: false,
14
15
  dataPoints: config_1.dataPoints,
@@ -17,8 +18,12 @@ exports.addProblemToPatientChart = {
17
18
  fieldsSchema: config_1.FieldsValidationSchema,
18
19
  payload,
19
20
  });
20
- console.log(input, client);
21
+ await client.createAppointmentNote({
22
+ practiceId: input.practiceid,
23
+ appointmentId: input.appointmentid,
24
+ data: (0, lodash_1.omit)(input, ['practiceid', 'appointmentid']),
25
+ });
21
26
  await onComplete();
22
27
  },
23
28
  };
24
- //# sourceMappingURL=addProblemToPatientChart.js.map
29
+ //# sourceMappingURL=createAppointmentNote.js.map
@@ -0,0 +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"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ const tests_1 = require("../../../../src/tests");
5
+ const mockData_1 = require("../../api/__mocks__/mockData");
6
+ jest.mock('../../api/client');
7
+ describe('athenahealth - Create appointment note', () => {
8
+ const onComplete = jest.fn();
9
+ const onError = jest.fn();
10
+ beforeEach(() => {
11
+ jest.clearAllMocks();
12
+ });
13
+ test('Should create an appointment note', async () => {
14
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
15
+ fields: {
16
+ appointmentid: '1',
17
+ practiceid: '195900',
18
+ notetext: 'hello world',
19
+ displayonschedule: true,
20
+ },
21
+ settings: mockData_1.mockSettings,
22
+ });
23
+ await _1.createAppointmentNote.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
24
+ expect(onComplete).toHaveBeenCalled();
25
+ });
26
+ test('Should return an error when the appointment does not exist', async () => {
27
+ var _a, _b;
28
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
29
+ fields: {
30
+ appointmentid: '2123223221',
31
+ practiceid: '195900',
32
+ notetext: 'hello world',
33
+ displayonschedule: true,
34
+ },
35
+ settings: mockData_1.mockSettings,
36
+ });
37
+ try {
38
+ await _1.createAppointmentNote.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
39
+ }
40
+ catch (error) {
41
+ const axiosError = error;
42
+ expect(axiosError.response).toBeDefined();
43
+ expect((_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.status).toBe(404);
44
+ expect((_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.data).toStrictEqual({
45
+ error: 'The appointment is not available.',
46
+ });
47
+ }
48
+ expect(onComplete).not.toHaveBeenCalled();
49
+ });
50
+ });
51
+ //# sourceMappingURL=createAppointmentNote.test.js.map
@@ -0,0 +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"}
@@ -0,0 +1 @@
1
+ export { createAppointmentNote } from './createAppointmentNote';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createAppointmentNote = void 0;
4
+ var createAppointmentNote_1 = require("./createAppointmentNote");
5
+ Object.defineProperty(exports, "createAppointmentNote", { enumerable: true, get: function () { return createAppointmentNote_1.createAppointmentNote; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/createAppointmentNote/index.ts"],"names":[],"mappings":";;;AAAA,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA"}
@@ -0,0 +1,6 @@
1
+ export declare const dataPoints: {
2
+ createdPatientId: {
3
+ key: string;
4
+ valueType: "string";
5
+ };
6
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = void 0;
4
+ exports.dataPoints = {
5
+ createdPatientId: {
6
+ key: 'createdPatientId',
7
+ valueType: 'string',
8
+ },
9
+ };
10
+ //# sourceMappingURL=datapoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/createPatient/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE;QAChB,GAAG,EAAE,kBAAkB;QACvB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
@@ -0,0 +1,69 @@
1
+ import { FieldType } from '@awell-health/extensions-core';
2
+ import z from 'zod';
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
+ departmentid: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.STRING;
16
+ required: true;
17
+ };
18
+ firstname: {
19
+ id: string;
20
+ label: string;
21
+ description: string;
22
+ type: FieldType.STRING;
23
+ required: true;
24
+ };
25
+ lastname: {
26
+ id: string;
27
+ label: string;
28
+ description: string;
29
+ type: FieldType.STRING;
30
+ required: true;
31
+ };
32
+ dob: {
33
+ id: string;
34
+ label: string;
35
+ description: string;
36
+ type: FieldType.DATE;
37
+ required: true;
38
+ };
39
+ email: {
40
+ id: string;
41
+ label: string;
42
+ description: string;
43
+ type: FieldType.STRING;
44
+ required: true;
45
+ };
46
+ };
47
+ export declare const FieldsValidationSchema: z.ZodObject<{
48
+ practiceid: z.ZodString;
49
+ departmentid: z.ZodString;
50
+ firstname: z.ZodString;
51
+ lastname: z.ZodString;
52
+ dob: z.ZodEffects<z.ZodString, string, string>;
53
+ email: z.ZodString;
54
+ }, "strip", z.ZodTypeAny, {
55
+ email: string;
56
+ dob: string;
57
+ practiceid: string;
58
+ departmentid: string;
59
+ firstname: string;
60
+ lastname: string;
61
+ }, {
62
+ email: string;
63
+ dob: string;
64
+ practiceid: string;
65
+ departmentid: string;
66
+ firstname: string;
67
+ lastname: string;
68
+ }>;
69
+ export type CreatePatientInputType = z.infer<typeof FieldsValidationSchema>;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FieldsValidationSchema = exports.fields = void 0;
7
+ const extensions_core_1 = require("@awell-health/extensions-core");
8
+ const zod_1 = __importDefault(require("zod"));
9
+ const date_1 = require("../../../validation/date");
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
+ departmentid: {
19
+ id: 'departmentid',
20
+ label: 'Department ID',
21
+ description: '',
22
+ type: extensions_core_1.FieldType.STRING,
23
+ required: true,
24
+ },
25
+ firstname: {
26
+ id: 'firstname',
27
+ label: 'First name',
28
+ description: '',
29
+ type: extensions_core_1.FieldType.STRING,
30
+ required: true,
31
+ },
32
+ lastname: {
33
+ id: 'lastname',
34
+ label: 'Last name',
35
+ description: '',
36
+ type: extensions_core_1.FieldType.STRING,
37
+ required: true,
38
+ },
39
+ dob: {
40
+ id: 'dob',
41
+ label: 'Date of birth',
42
+ description: '',
43
+ type: extensions_core_1.FieldType.DATE,
44
+ required: true,
45
+ },
46
+ email: {
47
+ id: 'email',
48
+ label: 'Email',
49
+ description: '',
50
+ type: extensions_core_1.FieldType.STRING,
51
+ required: true,
52
+ },
53
+ };
54
+ exports.FieldsValidationSchema = zod_1.default.object({
55
+ practiceid: zod_1.default.string().min(1),
56
+ departmentid: zod_1.default.string().min(1),
57
+ firstname: zod_1.default.string().min(1),
58
+ lastname: zod_1.default.string().min(1),
59
+ dob: date_1.AwellToAthenaDateOnlySchema,
60
+ email: zod_1.default.string().min(1).email(),
61
+ });
62
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +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,EAAE,IAAI;KACf;IACD,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,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,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"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/athenahealth/actions/createPatient/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -1,4 +1,4 @@
1
1
  import { type Action } from '@awell-health/extensions-core';
2
2
  import { type settings } from '../../settings';
3
3
  import { fields, dataPoints } from './config';
4
- export declare const cancelAppointment: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
4
+ export declare const createPatient: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cancelAppointment = void 0;
3
+ 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
- exports.cancelAppointment = {
8
- key: 'cancelAppointment',
7
+ const lodash_1 = require("lodash");
8
+ exports.createPatient = {
9
+ key: 'createPatient',
9
10
  category: extensions_core_1.Category.EHR_INTEGRATIONS,
10
- title: 'Cancel appointment',
11
- description: 'Cancel an appointment',
11
+ title: 'Create patient',
12
+ description: 'Create a patient in athena',
12
13
  fields: config_1.fields,
13
14
  previewable: false,
14
15
  dataPoints: config_1.dataPoints,
@@ -17,8 +18,15 @@ exports.cancelAppointment = {
17
18
  fieldsSchema: config_1.FieldsValidationSchema,
18
19
  payload,
19
20
  });
20
- console.log(input, client);
21
- await onComplete();
21
+ const res = await client.createPatient({
22
+ practiceId: input.practiceid,
23
+ data: (0, lodash_1.omit)(input, ['practiceid']),
24
+ });
25
+ await onComplete({
26
+ data_points: {
27
+ createdPatientId: res.patientid,
28
+ },
29
+ });
22
30
  },
23
31
  };
24
- //# sourceMappingURL=cancelAppointment.js.map
32
+ //# sourceMappingURL=createPatient.js.map
@@ -0,0 +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"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ const tests_1 = require("../../../../src/tests");
5
+ const mockData_1 = require("../../api/__mocks__/mockData");
6
+ jest.mock('../../api/client');
7
+ describe('athenahealth - Create patient', () => {
8
+ const onComplete = jest.fn();
9
+ const onError = jest.fn();
10
+ beforeEach(() => {
11
+ jest.clearAllMocks();
12
+ });
13
+ test('Should create a patient', async () => {
14
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
15
+ fields: {
16
+ practiceid: '195900',
17
+ firstname: 'Nick',
18
+ lastname: 'Hellemans',
19
+ dob: '11/30/1993',
20
+ email: 'nick@awellhealth.com',
21
+ departmentid: '1',
22
+ },
23
+ settings: mockData_1.mockSettings,
24
+ });
25
+ await _1.createPatient.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
26
+ expect(onComplete).toHaveBeenCalledWith({
27
+ data_points: {
28
+ createdPatientId: '1',
29
+ },
30
+ });
31
+ });
32
+ });
33
+ //# sourceMappingURL=createPatient.test.js.map
@@ -0,0 +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"}
@@ -0,0 +1 @@
1
+ export { createPatient } from './createPatient';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createPatient = void 0;
4
+ var createPatient_1 = require("./createPatient");
5
+ Object.defineProperty(exports, "createPatient", { enumerable: true, get: function () { return createPatient_1.createPatient; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/createPatient/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,8GAAA,aAAa,OAAA"}
@@ -11,7 +11,11 @@ export declare const dataPoints: {
11
11
  key: string;
12
12
  valueType: "string";
13
13
  };
14
- type: {
14
+ appointmentTypeName: {
15
+ key: string;
16
+ valueType: "string";
17
+ };
18
+ appointmentTypeId: {
15
19
  key: string;
16
20
  valueType: "string";
17
21
  };
@@ -19,4 +23,8 @@ export declare const dataPoints: {
19
23
  key: string;
20
24
  valueType: "date";
21
25
  };
26
+ duration: {
27
+ key: string;
28
+ valueType: "number";
29
+ };
22
30
  };
@@ -14,7 +14,11 @@ exports.dataPoints = {
14
14
  key: 'status',
15
15
  valueType: 'string',
16
16
  },
17
- type: {
17
+ appointmentTypeName: {
18
+ key: 'type',
19
+ valueType: 'string',
20
+ },
21
+ appointmentTypeId: {
18
22
  key: 'type',
19
23
  valueType: 'string',
20
24
  },
@@ -22,5 +26,9 @@ exports.dataPoints = {
22
26
  key: 'date',
23
27
  valueType: 'date',
24
28
  },
29
+ duration: {
30
+ key: 'duration',
31
+ valueType: 'number',
32
+ },
25
33
  };
26
34
  //# sourceMappingURL=datapoints.js.map
@@ -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,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"}
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"}
@@ -4,6 +4,7 @@ exports.getAppointment = 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 appointment_1 = require("../../api/schema/appointment");
7
8
  exports.getAppointment = {
8
9
  key: 'getAppointment',
9
10
  category: extensions_core_1.Category.EHR_INTEGRATIONS,
@@ -17,14 +18,18 @@ exports.getAppointment = {
17
18
  fieldsSchema: config_1.FieldsValidationSchema,
18
19
  payload,
19
20
  });
20
- console.log(input, client);
21
+ const res = await client.getAppointment(input);
22
+ // Both validates and transforms some of the response data
23
+ const appt = appointment_1.AppointmentSchema.parse(res);
21
24
  await onComplete({
22
25
  data_points: {
23
- patientId: '56529',
24
- startTime: '1:00 PM',
25
- status: 'scheduled',
26
- type: 'Follow-up',
27
- date: '2024-05-05',
26
+ patientId: appt.patientid,
27
+ startTime: appt.starttime,
28
+ status: appt.appointmentstatus,
29
+ appointmentTypeName: appt.appointmenttype,
30
+ appointmentTypeId: appt.appointmenttypeid,
31
+ date: appt.date,
32
+ duration: String(appt.duration),
28
33
  },
29
34
  });
30
35
  },
@@ -1 +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"}
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"}