@awell-health/awell-extensions 1.0.214 → 1.0.216
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/extensions/athenahealth/actions/createAppointmentNote/config/datapoints.js.map +1 -0
- package/dist/extensions/athenahealth/actions/createAppointmentNote/config/fields.d.ts +39 -0
- package/dist/extensions/athenahealth/actions/{cancelAppointment → createAppointmentNote}/config/fields.js +16 -8
- package/dist/extensions/athenahealth/actions/createAppointmentNote/config/fields.js.map +1 -0
- package/dist/extensions/athenahealth/actions/createAppointmentNote/config/index.js.map +1 -0
- package/dist/extensions/athenahealth/actions/{addProblemToPatientChart/addProblemToPatientChart.d.ts → createAppointmentNote/createAppointmentNote.d.ts} +1 -1
- package/dist/extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.js +29 -0
- package/dist/extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.js.map +1 -0
- package/dist/extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.test.js +73 -0
- package/dist/extensions/athenahealth/actions/createAppointmentNote/createAppointmentNote.test.js.map +1 -0
- package/dist/extensions/athenahealth/actions/createAppointmentNote/index.d.ts +1 -0
- package/dist/extensions/athenahealth/actions/createAppointmentNote/index.js +6 -0
- package/dist/extensions/athenahealth/actions/createAppointmentNote/index.js.map +1 -0
- package/dist/extensions/athenahealth/actions/createPatient/config/datapoints.d.ts +6 -0
- package/dist/extensions/athenahealth/actions/createPatient/config/datapoints.js +10 -0
- package/dist/extensions/athenahealth/actions/createPatient/config/datapoints.js.map +1 -0
- package/dist/extensions/athenahealth/actions/{addDocumentToPatientChart → createPatient}/config/fields.d.ts +23 -32
- package/dist/extensions/athenahealth/actions/createPatient/config/fields.js +54 -0
- package/dist/extensions/athenahealth/actions/createPatient/config/fields.js.map +1 -0
- package/dist/extensions/athenahealth/actions/createPatient/config/index.js.map +1 -0
- package/dist/extensions/athenahealth/actions/{cancelAppointment/cancelAppointment.d.ts → createPatient/createPatient.d.ts} +1 -1
- package/dist/extensions/athenahealth/actions/createPatient/createPatient.js +31 -0
- package/dist/extensions/athenahealth/actions/createPatient/createPatient.js.map +1 -0
- package/dist/extensions/athenahealth/actions/createPatient/createPatient.test.js +32 -0
- package/dist/extensions/athenahealth/actions/createPatient/createPatient.test.js.map +1 -0
- package/dist/extensions/athenahealth/actions/createPatient/index.d.ts +1 -0
- package/dist/extensions/athenahealth/actions/createPatient/index.js +6 -0
- package/dist/extensions/athenahealth/actions/createPatient/index.js.map +1 -0
- package/dist/extensions/athenahealth/actions/getAppointment/config/datapoints.d.ts +9 -1
- package/dist/extensions/athenahealth/actions/getAppointment/config/datapoints.js +10 -2
- package/dist/extensions/athenahealth/actions/getAppointment/config/datapoints.js.map +1 -1
- package/dist/extensions/athenahealth/actions/getAppointment/config/fields.d.ts +0 -10
- package/dist/extensions/athenahealth/actions/getAppointment/config/fields.js +0 -8
- package/dist/extensions/athenahealth/actions/getAppointment/config/fields.js.map +1 -1
- package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.js +12 -7
- package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.js.map +1 -1
- package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.test.js +60 -15
- package/dist/extensions/athenahealth/actions/getAppointment/getAppointment.test.js.map +1 -1
- package/dist/extensions/athenahealth/actions/getPatient/config/fields.d.ts +0 -10
- package/dist/extensions/athenahealth/actions/getPatient/config/fields.js +0 -8
- package/dist/extensions/athenahealth/actions/getPatient/config/fields.js.map +1 -1
- package/dist/extensions/athenahealth/actions/getPatient/getPatient.js +9 -8
- package/dist/extensions/athenahealth/actions/getPatient/getPatient.js.map +1 -1
- package/dist/extensions/athenahealth/actions/getPatient/getPatient.test.js +58 -15
- package/dist/extensions/athenahealth/actions/getPatient/getPatient.test.js.map +1 -1
- package/dist/extensions/athenahealth/actions/index.d.ts +35 -87
- package/dist/extensions/athenahealth/actions/index.js +4 -6
- package/dist/extensions/athenahealth/actions/index.js.map +1 -1
- package/dist/extensions/athenahealth/api/client.d.ts +32 -2
- package/dist/extensions/athenahealth/api/client.js +38 -2
- package/dist/extensions/athenahealth/api/client.js.map +1 -1
- package/dist/extensions/athenahealth/api/schema/appointment.d.ts +36 -0
- package/dist/extensions/athenahealth/api/schema/appointment.js +21 -0
- package/dist/extensions/athenahealth/api/schema/appointment.js.map +1 -0
- package/dist/extensions/athenahealth/api/schema/date.d.ts +7 -0
- package/dist/extensions/athenahealth/api/schema/date.js +23 -0
- package/dist/extensions/athenahealth/api/schema/date.js.map +1 -0
- package/dist/extensions/athenahealth/api/schema/index.d.ts +3 -0
- package/dist/extensions/athenahealth/api/schema/index.js +11 -0
- package/dist/extensions/athenahealth/api/schema/index.js.map +1 -0
- package/dist/extensions/athenahealth/api/schema/patient.d.ts +42 -0
- package/dist/extensions/athenahealth/api/schema/patient.js +22 -0
- package/dist/extensions/athenahealth/api/schema/patient.js.map +1 -0
- package/dist/extensions/athenahealth/api/schema/schema.test.js +22 -0
- package/dist/extensions/athenahealth/api/schema/schema.test.js.map +1 -0
- package/dist/extensions/athenahealth/helpers.d.ts +2 -0
- package/dist/extensions/athenahealth/helpers.js +2 -2
- package/dist/extensions/athenahealth/helpers.js.map +1 -1
- package/dist/extensions/athenahealth/settings.d.ts +10 -0
- package/dist/extensions/athenahealth/settings.js +11 -3
- package/dist/extensions/athenahealth/settings.js.map +1 -1
- package/dist/extensions/athenahealth/validation/date.d.ts +6 -0
- package/dist/extensions/athenahealth/validation/date.js +22 -0
- package/dist/extensions/athenahealth/validation/date.js.map +1 -0
- package/dist/extensions/athenahealth/validation/validation.test.d.ts +1 -0
- package/dist/extensions/athenahealth/validation/validation.test.js +12 -0
- package/dist/extensions/athenahealth/validation/validation.test.js.map +1 -0
- package/dist/extensions/markdown.json +1 -1
- package/package.json +1 -1
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.d.ts +0 -4
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.js +0 -24
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.js.map +0 -1
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.test.js +0 -31
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/addDocumentToPatientChart.test.js.map +0 -1
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/datapoints.js.map +0 -1
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/fields.js +0 -61
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/fields.js.map +0 -1
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/config/index.js.map +0 -1
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/index.d.ts +0 -1
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/index.js +0 -6
- package/dist/extensions/athenahealth/actions/addDocumentToPatientChart/index.js.map +0 -1
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.js +0 -24
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.js.map +0 -1
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.test.js +0 -29
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/addProblemToPatientChart.test.js.map +0 -1
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/datapoints.d.ts +0 -1
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/datapoints.js +0 -5
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/datapoints.js.map +0 -1
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/fields.d.ts +0 -48
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/fields.js +0 -45
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/fields.js.map +0 -1
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/config/index.js.map +0 -1
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/index.d.ts +0 -1
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/index.js +0 -6
- package/dist/extensions/athenahealth/actions/addProblemToPatientChart/index.js.map +0 -1
- package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.js +0 -24
- package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.js.map +0 -1
- package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.test.js +0 -27
- package/dist/extensions/athenahealth/actions/cancelAppointment/cancelAppointment.test.js.map +0 -1
- package/dist/extensions/athenahealth/actions/cancelAppointment/config/datapoints.d.ts +0 -1
- package/dist/extensions/athenahealth/actions/cancelAppointment/config/datapoints.js +0 -5
- package/dist/extensions/athenahealth/actions/cancelAppointment/config/datapoints.js.map +0 -1
- package/dist/extensions/athenahealth/actions/cancelAppointment/config/fields.d.ts +0 -28
- package/dist/extensions/athenahealth/actions/cancelAppointment/config/fields.js.map +0 -1
- package/dist/extensions/athenahealth/actions/cancelAppointment/config/index.d.ts +0 -2
- package/dist/extensions/athenahealth/actions/cancelAppointment/config/index.js +0 -9
- package/dist/extensions/athenahealth/actions/cancelAppointment/config/index.js.map +0 -1
- package/dist/extensions/athenahealth/actions/cancelAppointment/index.d.ts +0 -1
- package/dist/extensions/athenahealth/actions/cancelAppointment/index.js +0 -6
- package/dist/extensions/athenahealth/actions/cancelAppointment/index.js.map +0 -1
- /package/dist/extensions/athenahealth/actions/{addDocumentToPatientChart → createAppointmentNote}/config/datapoints.d.ts +0 -0
- /package/dist/extensions/athenahealth/actions/{addDocumentToPatientChart → createAppointmentNote}/config/datapoints.js +0 -0
- /package/dist/extensions/athenahealth/actions/{addDocumentToPatientChart → createAppointmentNote}/config/index.d.ts +0 -0
- /package/dist/extensions/athenahealth/actions/{addDocumentToPatientChart → createAppointmentNote}/config/index.js +0 -0
- /package/dist/extensions/athenahealth/actions/{addDocumentToPatientChart/addDocumentToPatientChart.test.d.ts → createAppointmentNote/createAppointmentNote.test.d.ts} +0 -0
- /package/dist/extensions/athenahealth/actions/{addProblemToPatientChart → createPatient}/config/index.d.ts +0 -0
- /package/dist/extensions/athenahealth/actions/{addProblemToPatientChart → createPatient}/config/index.js +0 -0
- /package/dist/extensions/athenahealth/actions/{addProblemToPatientChart/addProblemToPatientChart.test.d.ts → createPatient/createPatient.test.d.ts} +0 -0
- /package/dist/extensions/athenahealth/{actions/cancelAppointment/cancelAppointment.test.d.ts → api/schema/schema.test.d.ts} +0 -0
@@ -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,
|
@@ -13,18 +14,22 @@ exports.getAppointment = {
|
|
13
14
|
previewable: false,
|
14
15
|
dataPoints: config_1.dataPoints,
|
15
16
|
onActivityCreated: async (payload, onComplete, onError) => {
|
16
|
-
const { fields: input, client } = await (0, helpers_1.validatePayloadAndCreateClient)({
|
17
|
+
const { fields: input, client, settings: { practiceId }, } = await (0, helpers_1.validatePayloadAndCreateClient)({
|
17
18
|
fieldsSchema: config_1.FieldsValidationSchema,
|
18
19
|
payload,
|
19
20
|
});
|
20
|
-
|
21
|
+
const res = await client.getAppointment({ ...input, practiceId });
|
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:
|
24
|
-
startTime:
|
25
|
-
status:
|
26
|
-
|
27
|
-
|
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;
|
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"}
|
@@ -1,35 +1,80 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const date_fns_1 = require("date-fns");
|
3
4
|
const _1 = require(".");
|
4
5
|
const tests_1 = require("../../../../src/tests");
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
};
|
6
|
+
const mockData_1 = require("../../api/__mocks__/mockData");
|
7
|
+
jest.mock('../../api/client');
|
8
|
+
describe('athenahealth - Get appointment', () => {
|
13
9
|
const onComplete = jest.fn();
|
14
10
|
const onError = jest.fn();
|
11
|
+
beforeEach(() => {
|
12
|
+
jest.clearAllMocks();
|
13
|
+
});
|
15
14
|
test('Should return an appointment', async () => {
|
16
15
|
const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
|
17
16
|
fields: {
|
18
17
|
appointmentId: '1',
|
19
|
-
practiceId: '1',
|
20
18
|
},
|
21
|
-
settings,
|
19
|
+
settings: mockData_1.mockSettings,
|
22
20
|
});
|
23
21
|
await _1.getAppointment.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
|
24
22
|
expect(onComplete).toHaveBeenCalledWith({
|
25
23
|
data_points: {
|
26
|
-
patientId:
|
27
|
-
startTime:
|
28
|
-
status:
|
29
|
-
|
30
|
-
|
24
|
+
patientId: mockData_1.mockGetAppointmentResponse.patientid,
|
25
|
+
startTime: mockData_1.mockGetAppointmentResponse.starttime,
|
26
|
+
status: mockData_1.mockGetAppointmentResponse.appointmentstatus,
|
27
|
+
appointmentTypeName: mockData_1.mockGetAppointmentResponse.appointmenttype,
|
28
|
+
appointmentTypeId: mockData_1.mockGetAppointmentResponse.appointmenttypeid,
|
29
|
+
date: (0, date_fns_1.formatISO)(new Date(mockData_1.mockGetAppointmentResponse.date), {
|
30
|
+
representation: 'date',
|
31
|
+
}),
|
32
|
+
duration: String(mockData_1.mockGetAppointmentResponse.duration),
|
33
|
+
},
|
34
|
+
});
|
35
|
+
});
|
36
|
+
test('Should return an error when appointment is not found', async () => {
|
37
|
+
var _a, _b;
|
38
|
+
const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
|
39
|
+
fields: {
|
40
|
+
appointmentId: 'non-existing-appointment-id',
|
41
|
+
},
|
42
|
+
settings: mockData_1.mockSettings,
|
43
|
+
});
|
44
|
+
try {
|
45
|
+
await _1.getAppointment.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
|
46
|
+
}
|
47
|
+
catch (error) {
|
48
|
+
const axiosError = error;
|
49
|
+
expect(axiosError.response).toBeDefined();
|
50
|
+
expect((_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.status).toBe(404);
|
51
|
+
expect((_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.data).toStrictEqual({
|
52
|
+
error: 'The appointment is not available.',
|
53
|
+
});
|
54
|
+
}
|
55
|
+
expect(onComplete).not.toHaveBeenCalled();
|
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',
|
31
62
|
},
|
63
|
+
settings: { ...mockData_1.mockSettings, practiceId: 'non-existing-practice-id' },
|
32
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();
|
33
78
|
});
|
34
79
|
});
|
35
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":";;
|
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,SAAS,EAAE,qCAA0B,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A0B,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;
|
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"}
|
@@ -4,6 +4,7 @@ exports.getPatient = 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 patient_1 = require("../../api/schema/patient");
|
7
8
|
exports.getPatient = {
|
8
9
|
key: 'getPatient',
|
9
10
|
category: extensions_core_1.Category.EHR_INTEGRATIONS,
|
@@ -13,19 +14,19 @@ exports.getPatient = {
|
|
13
14
|
previewable: false,
|
14
15
|
dataPoints: config_1.dataPoints,
|
15
16
|
onActivityCreated: async (payload, onComplete, onError) => {
|
16
|
-
const { fields: input, client } = await (0, helpers_1.validatePayloadAndCreateClient)({
|
17
|
+
const { fields: input, client, settings: { practiceId }, } = await (0, helpers_1.validatePayloadAndCreateClient)({
|
17
18
|
fieldsSchema: config_1.FieldsValidationSchema,
|
18
19
|
payload,
|
19
20
|
});
|
20
|
-
|
21
|
-
//
|
22
|
-
|
21
|
+
const res = await client.getPatient({ practiceId, ...input });
|
22
|
+
// Both validates and transforms some of the response data
|
23
|
+
const patient = patient_1.PatientSchema.parse(res);
|
23
24
|
await onComplete({
|
24
25
|
data_points: {
|
25
|
-
firstName:
|
26
|
-
lastName:
|
27
|
-
dob:
|
28
|
-
email:
|
26
|
+
firstName: patient.firstname,
|
27
|
+
lastName: patient.lastname,
|
28
|
+
dob: patient.dob,
|
29
|
+
email: patient.email,
|
29
30
|
},
|
30
31
|
});
|
31
32
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getPatient.js","sourceRoot":"","sources":["../../../../../extensions/athenahealth/actions/getPatient/getPatient.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,2CAA8D;
|
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"}
|
@@ -2,33 +2,76 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const _1 = require(".");
|
4
4
|
const tests_1 = require("../../../../src/tests");
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
-
};
|
5
|
+
const mockData_1 = require("../../api/__mocks__/mockData");
|
6
|
+
const date_fns_1 = require("date-fns");
|
7
|
+
jest.mock('../../api/client');
|
8
|
+
describe('athenahealth - Get patient', () => {
|
13
9
|
const onComplete = jest.fn();
|
14
10
|
const onError = jest.fn();
|
11
|
+
beforeEach(() => {
|
12
|
+
jest.clearAllMocks();
|
13
|
+
});
|
15
14
|
test('Should return a patient', async () => {
|
16
15
|
const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
|
17
16
|
fields: {
|
18
|
-
patientId: '
|
19
|
-
practiceId: '1',
|
17
|
+
patientId: '56529',
|
20
18
|
},
|
21
|
-
settings,
|
19
|
+
settings: mockData_1.mockSettings,
|
22
20
|
});
|
23
21
|
await _1.getPatient.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
|
24
22
|
expect(onComplete).toHaveBeenCalledWith({
|
25
23
|
data_points: {
|
26
|
-
firstName:
|
27
|
-
lastName:
|
28
|
-
dob:
|
29
|
-
|
24
|
+
firstName: mockData_1.mockGetPatientResponse.firstname,
|
25
|
+
lastName: mockData_1.mockGetPatientResponse.lastname,
|
26
|
+
dob: (0, date_fns_1.formatISO)(new Date(mockData_1.mockGetPatientResponse.dob), {
|
27
|
+
representation: 'date',
|
28
|
+
}),
|
29
|
+
email: mockData_1.mockGetPatientResponse.email,
|
30
|
+
},
|
31
|
+
});
|
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
|
+
});
|
55
|
+
test('Should return an error when patient is not found', async () => {
|
56
|
+
var _a, _b;
|
57
|
+
const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
|
58
|
+
fields: {
|
59
|
+
patientId: 'non-existing-patient-id',
|
30
60
|
},
|
61
|
+
settings: mockData_1.mockSettings,
|
31
62
|
});
|
63
|
+
try {
|
64
|
+
await _1.getPatient.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
|
65
|
+
}
|
66
|
+
catch (error) {
|
67
|
+
const axiosError = error;
|
68
|
+
expect(axiosError.response).toBeDefined();
|
69
|
+
expect((_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.status).toBe(404);
|
70
|
+
expect((_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.data).toStrictEqual({
|
71
|
+
error: 'This patient does not exist in this context.',
|
72
|
+
});
|
73
|
+
}
|
74
|
+
expect(onComplete).not.toHaveBeenCalled();
|
32
75
|
});
|
33
76
|
});
|
34
77
|
//# sourceMappingURL=getPatient.test.js.map
|
@@ -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,QAAQ,CAAC,
|
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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
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
|
-
|
54
|
-
|
55
|
-
appointmentId: {
|
56
|
-
id: string;
|
46
|
+
practiceId: {
|
47
|
+
key: string;
|
57
48
|
label: string;
|
58
|
-
|
59
|
-
type: import("@awell-health/extensions-core").FieldType.STRING;
|
49
|
+
obfuscated: false;
|
60
50
|
required: true;
|
51
|
+
description: string;
|
61
52
|
};
|
62
|
-
|
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,86 +95,48 @@ declare const actions: {
|
|
102
95
|
required: true;
|
103
96
|
description: string;
|
104
97
|
};
|
105
|
-
}, "type" | "startTime" | "status" | "date" | "patientId", never>;
|
106
|
-
cancelAppointment: import("@awell-health/extensions-core").Action<{
|
107
|
-
appointmentId: {
|
108
|
-
id: string;
|
109
|
-
label: string;
|
110
|
-
description: string;
|
111
|
-
type: import("@awell-health/extensions-core").FieldType.STRING;
|
112
|
-
required: true;
|
113
|
-
};
|
114
98
|
practiceId: {
|
115
|
-
id: string;
|
116
|
-
label: string;
|
117
|
-
description: string;
|
118
|
-
type: import("@awell-health/extensions-core").FieldType.STRING;
|
119
|
-
required: true;
|
120
|
-
};
|
121
|
-
}, {
|
122
|
-
auth_url: {
|
123
99
|
key: string;
|
124
100
|
label: string;
|
125
101
|
obfuscated: false;
|
126
102
|
required: true;
|
127
103
|
description: string;
|
128
104
|
};
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
required: true;
|
134
|
-
description: string;
|
135
|
-
};
|
136
|
-
client_secret: {
|
137
|
-
key: string;
|
138
|
-
label: string;
|
139
|
-
obfuscated: true;
|
140
|
-
required: true;
|
141
|
-
description: string;
|
142
|
-
};
|
143
|
-
api_url: {
|
144
|
-
key: string;
|
105
|
+
}, "startTime" | "status" | "date" | "patientId" | "duration" | "appointmentTypeId" | "appointmentTypeName", never>;
|
106
|
+
createPatient: import("@awell-health/extensions-core").Action<{
|
107
|
+
departmentid: {
|
108
|
+
id: string;
|
145
109
|
label: string;
|
146
|
-
obfuscated: false;
|
147
|
-
required: true;
|
148
110
|
description: string;
|
149
|
-
|
150
|
-
scope: {
|
151
|
-
key: string;
|
152
|
-
label: string;
|
153
|
-
obfuscated: false;
|
111
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
154
112
|
required: true;
|
155
|
-
description: string;
|
156
113
|
};
|
157
|
-
|
158
|
-
addProblemToPatientChart: import("@awell-health/extensions-core").Action<{
|
159
|
-
patientId: {
|
114
|
+
firstname: {
|
160
115
|
id: string;
|
161
116
|
label: string;
|
162
117
|
description: string;
|
163
118
|
type: import("@awell-health/extensions-core").FieldType.STRING;
|
164
119
|
required: true;
|
165
120
|
};
|
166
|
-
|
121
|
+
lastname: {
|
167
122
|
id: string;
|
168
123
|
label: string;
|
169
124
|
description: string;
|
170
125
|
type: import("@awell-health/extensions-core").FieldType.STRING;
|
171
126
|
required: true;
|
172
127
|
};
|
173
|
-
|
128
|
+
dob: {
|
174
129
|
id: string;
|
175
130
|
label: string;
|
176
131
|
description: string;
|
177
|
-
type: import("@awell-health/extensions-core").FieldType.
|
132
|
+
type: import("@awell-health/extensions-core").FieldType.DATE;
|
178
133
|
required: true;
|
179
134
|
};
|
180
|
-
|
135
|
+
email: {
|
181
136
|
id: string;
|
182
137
|
label: string;
|
183
138
|
description: string;
|
184
|
-
type: import("@awell-health/extensions-core").FieldType.
|
139
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
185
140
|
required: true;
|
186
141
|
};
|
187
142
|
}, {
|
@@ -220,49 +175,35 @@ declare const actions: {
|
|
220
175
|
required: true;
|
221
176
|
description: string;
|
222
177
|
};
|
223
|
-
}, never, never>;
|
224
|
-
addDocumentToPatientChart: import("@awell-health/extensions-core").Action<{
|
225
|
-
patientId: {
|
226
|
-
id: string;
|
227
|
-
label: string;
|
228
|
-
description: string;
|
229
|
-
type: import("@awell-health/extensions-core").FieldType.STRING;
|
230
|
-
required: true;
|
231
|
-
};
|
232
178
|
practiceId: {
|
233
|
-
|
179
|
+
key: string;
|
234
180
|
label: string;
|
235
|
-
|
236
|
-
type: import("@awell-health/extensions-core").FieldType.STRING;
|
181
|
+
obfuscated: false;
|
237
182
|
required: true;
|
238
|
-
};
|
239
|
-
departmentId: {
|
240
|
-
id: string;
|
241
|
-
label: string;
|
242
183
|
description: string;
|
243
|
-
type: import("@awell-health/extensions-core").FieldType.STRING;
|
244
|
-
required: true;
|
245
184
|
};
|
246
|
-
|
185
|
+
}, "createdPatientId", never>;
|
186
|
+
createAppointmentNote: import("@awell-health/extensions-core").Action<{
|
187
|
+
appointmentid: {
|
247
188
|
id: string;
|
248
189
|
label: string;
|
249
190
|
description: string;
|
250
191
|
type: import("@awell-health/extensions-core").FieldType.STRING;
|
251
|
-
required:
|
192
|
+
required: true;
|
252
193
|
};
|
253
|
-
|
194
|
+
notetext: {
|
254
195
|
id: string;
|
255
196
|
label: string;
|
256
197
|
description: string;
|
257
|
-
type: import("@awell-health/extensions-core").FieldType.
|
198
|
+
type: import("@awell-health/extensions-core").FieldType.TEXT;
|
258
199
|
required: true;
|
259
200
|
};
|
260
|
-
|
201
|
+
displayonschedule: {
|
261
202
|
id: string;
|
262
203
|
label: string;
|
263
204
|
description: string;
|
264
205
|
type: import("@awell-health/extensions-core").FieldType.BOOLEAN;
|
265
|
-
required:
|
206
|
+
required: false;
|
266
207
|
};
|
267
208
|
}, {
|
268
209
|
auth_url: {
|
@@ -300,6 +241,13 @@ declare const actions: {
|
|
300
241
|
required: true;
|
301
242
|
description: string;
|
302
243
|
};
|
244
|
+
practiceId: {
|
245
|
+
key: string;
|
246
|
+
label: string;
|
247
|
+
obfuscated: false;
|
248
|
+
required: true;
|
249
|
+
description: string;
|
250
|
+
};
|
303
251
|
}, never, never>;
|
304
252
|
};
|
305
253
|
export default actions;
|
@@ -2,15 +2,13 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const getPatient_1 = require("./getPatient");
|
4
4
|
const getAppointment_1 = require("./getAppointment");
|
5
|
-
const
|
6
|
-
const
|
7
|
-
const addDocumentToPatientChart_1 = require("./addDocumentToPatientChart");
|
5
|
+
const createPatient_1 = require("./createPatient");
|
6
|
+
const createAppointmentNote_1 = require("./createAppointmentNote");
|
8
7
|
const actions = {
|
9
8
|
getPatient: getPatient_1.getPatient,
|
10
9
|
getAppointment: getAppointment_1.getAppointment,
|
11
|
-
|
12
|
-
|
13
|
-
addDocumentToPatientChart: addDocumentToPatientChart_1.addDocumentToPatientChart,
|
10
|
+
createPatient: createPatient_1.createPatient,
|
11
|
+
createAppointmentNote: createAppointmentNote_1.createAppointmentNote,
|
14
12
|
};
|
15
13
|
exports.default = actions;
|
16
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,
|
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"}
|
@@ -1,9 +1,26 @@
|
|
1
1
|
import { APIClient, DataWrapper, type DataWrapperCtor, type OAuthGrantClientCredentialsRequest } from '@awell-health/extensions-core';
|
2
|
+
import { type CreateAppointmentNoteInputType } from '../actions/createAppointmentNote/config/fields';
|
3
|
+
import { type CreatePatientInputType } from '../actions/createPatient/config/fields';
|
4
|
+
import { type PatientSchemaType, type AppointmentSchemaType } from './schema';
|
5
|
+
import { type CreatePatientResponseType } from './schema/patient';
|
2
6
|
export declare class AthenaDataWrapper extends DataWrapper {
|
7
|
+
createPatient({ practiceId, data, }: {
|
8
|
+
practiceId: string;
|
9
|
+
data: Omit<CreatePatientInputType, 'practiceid'>;
|
10
|
+
}): Promise<CreatePatientResponseType>;
|
3
11
|
getPatient({ practiceId, patientId, }: {
|
4
12
|
practiceId: string;
|
5
13
|
patientId: string;
|
6
|
-
}): Promise<
|
14
|
+
}): Promise<PatientSchemaType>;
|
15
|
+
getAppointment({ practiceId, appointmentId, }: {
|
16
|
+
practiceId: string;
|
17
|
+
appointmentId: string;
|
18
|
+
}): Promise<AppointmentSchemaType>;
|
19
|
+
createAppointmentNote({ practiceId, appointmentId, data, }: {
|
20
|
+
practiceId: string;
|
21
|
+
appointmentId: string;
|
22
|
+
data: Omit<CreateAppointmentNoteInputType, 'practiceid' | 'appointmentid'>;
|
23
|
+
}): Promise<CreatePatientResponseType>;
|
7
24
|
}
|
8
25
|
interface AthenaClientConstructorProps {
|
9
26
|
authUrl: string;
|
@@ -13,9 +30,22 @@ interface AthenaClientConstructorProps {
|
|
13
30
|
export declare class AthenaAPIClient extends APIClient<AthenaDataWrapper> {
|
14
31
|
readonly ctor: DataWrapperCtor<AthenaDataWrapper>;
|
15
32
|
constructor({ authUrl, requestConfig, ...opts }: AthenaClientConstructorProps);
|
33
|
+
createPatient({ practiceId, data, }: {
|
34
|
+
practiceId: string;
|
35
|
+
data: Omit<CreatePatientInputType, 'practiceid'>;
|
36
|
+
}): Promise<CreatePatientResponseType>;
|
16
37
|
getPatient({ practiceId, patientId, }: {
|
17
38
|
practiceId: string;
|
18
39
|
patientId: string;
|
19
|
-
}): Promise<
|
40
|
+
}): Promise<PatientSchemaType>;
|
41
|
+
getAppointment({ practiceId, appointmentId, }: {
|
42
|
+
practiceId: string;
|
43
|
+
appointmentId: string;
|
44
|
+
}): Promise<AppointmentSchemaType>;
|
45
|
+
createAppointmentNote({ practiceId, appointmentId, data, }: {
|
46
|
+
practiceId: string;
|
47
|
+
appointmentId: string;
|
48
|
+
data: Omit<CreateAppointmentNoteInputType, 'practiceid' | 'appointmentid'>;
|
49
|
+
}): Promise<CreatePatientResponseType>;
|
20
50
|
}
|
21
51
|
export {};
|