@awell-health/awell-extensions 1.1.43 → 1.1.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. package/dist/extensions/athenahealth/actions/index.d.ts +1 -1
  2. package/dist/extensions/athenahealth/settings.d.ts +2 -2
  3. package/dist/extensions/awell/v1/actions/updatePatient/config/fields.d.ts +2 -2
  4. package/dist/extensions/awell/v1/webhooks/index.d.ts +1 -1
  5. package/dist/extensions/awell/v1/webhooks/pathwayStart.d.ts +3 -1
  6. package/dist/extensions/awell/v1/webhooks/pathwayStart.js +13 -3
  7. package/dist/extensions/awell/v1/webhooks/pathwayStart.js.map +1 -1
  8. package/dist/extensions/calDotCom/actions/createBooking/config/fields.d.ts +12 -12
  9. package/dist/extensions/calDotCom/actions/updateBooking/config/fields.d.ts +6 -6
  10. package/dist/extensions/calDotCom/schema.d.ts +70 -70
  11. package/dist/extensions/calDotCom/webhooks/index.d.ts +1 -1
  12. package/dist/extensions/calendly/schema.d.ts +262 -262
  13. package/dist/extensions/calendly/webhooks/index.d.ts +1 -1
  14. package/dist/extensions/canvasMedical/v1/actions/createClaim/config/fields.d.ts +2 -2
  15. package/dist/extensions/canvasMedical/v1/actions/createCoverage/config/fields.d.ts +2 -2
  16. package/dist/extensions/canvasMedical/v1/actions/createQuestionnaireResponses/config/fields.d.ts +2 -2
  17. package/dist/extensions/canvasMedical/v1/actions/updateCoverage/config/fields.d.ts +4 -4
  18. package/dist/extensions/canvasMedical/v1/validation/address.zod.d.ts +4 -4
  19. package/dist/extensions/canvasMedical/v1/validation/appointment.zod.d.ts +48 -48
  20. package/dist/extensions/canvasMedical/v1/validation/claim.d.ts +6 -6
  21. package/dist/extensions/canvasMedical/v1/validation/coding.zod.d.ts +2 -2
  22. package/dist/extensions/canvasMedical/v1/validation/coverage.zod.d.ts +6 -6
  23. package/dist/extensions/canvasMedical/v1/validation/identifier.zod.d.ts +8 -8
  24. package/dist/extensions/canvasMedical/v1/validation/patient.zod.d.ts +148 -148
  25. package/dist/extensions/canvasMedical/v1/validation/questionnaireResponses.zod.d.ts +30 -30
  26. package/dist/extensions/canvasMedical/v1/validation/settings.zod.d.ts +4 -4
  27. package/dist/extensions/canvasMedical/v1/validation/task.zod.d.ts +12 -12
  28. package/dist/extensions/collectData/v1/actions/remoteSingleSelect/config/fields.d.ts +2 -2
  29. package/dist/extensions/dockHealth/api/schema/atoms/patientReference.schema.d.ts +2 -2
  30. package/dist/extensions/dockHealth/api/schema/atoms/taskGroup.schema.d.ts +2 -2
  31. package/dist/extensions/dockHealth/api/schema/atoms/taskListReference.schema.d.ts +2 -2
  32. package/dist/extensions/dockHealth/api/schema/atoms/taskReference.schema.d.ts +2 -2
  33. package/dist/extensions/dockHealth/api/schema/atoms/taskWorkflowStatusReference.schema.d.ts +2 -2
  34. package/dist/extensions/dockHealth/api/schema/atoms/userReference.schema.d.ts +2 -2
  35. package/dist/extensions/dockHealth/api/schema/patient.schema.d.ts +10 -10
  36. package/dist/extensions/dockHealth/api/schema/task.schema.d.ts +77 -77
  37. package/dist/extensions/dockHealth/lib/dock.types.d.ts +2 -2
  38. package/dist/extensions/elation/actions/index.d.ts +2 -2
  39. package/dist/extensions/elation/validation/appointment.zod.d.ts +18 -18
  40. package/dist/extensions/elation/validation/labOrder.zod.d.ts +2 -2
  41. package/dist/extensions/elation/validation/nonVisitNote.zod.d.ts +6 -6
  42. package/dist/extensions/elation/validation/patient.zod.d.ts +116 -116
  43. package/dist/extensions/elation/validation/physician.zod.d.ts +2 -2
  44. package/dist/extensions/elation/validation/settings.zod.d.ts +6 -6
  45. package/dist/extensions/elation/webhooks/index.d.ts +1 -1
  46. package/dist/extensions/formsort/settings.d.ts +3 -3
  47. package/dist/extensions/healthie/lib/helpers.d.ts +8 -0
  48. package/dist/extensions/healthie/lib/helpers.js +6 -1
  49. package/dist/extensions/healthie/lib/helpers.js.map +1 -1
  50. package/dist/extensions/healthie/lib/sdk/createSdk.d.ts +10 -0
  51. package/dist/extensions/healthie/lib/sdk/createSdk.js +17 -0
  52. package/dist/extensions/healthie/lib/sdk/createSdk.js.map +1 -0
  53. package/dist/extensions/healthie/lib/sdk/errors.d.ts +1 -0
  54. package/dist/extensions/healthie/lib/sdk/errors.js +46 -1
  55. package/dist/extensions/healthie/lib/sdk/errors.js.map +1 -1
  56. package/dist/extensions/healthie/lib/sdk/generated/sdk.d.ts +373 -9
  57. package/dist/extensions/healthie/lib/sdk/generated/sdk.js +110 -3
  58. package/dist/extensions/healthie/lib/sdk/generated/sdk.js.map +1 -1
  59. package/dist/extensions/healthie/lib/sdk/validatePayloadAndCreateSdk.js.map +1 -1
  60. package/dist/extensions/healthie/lib/types.d.ts +2 -1
  61. package/dist/extensions/healthie/lib/types.js +2 -0
  62. package/dist/extensions/healthie/lib/types.js.map +1 -1
  63. package/dist/extensions/healthie/lib/validation/createTask.zod.d.ts +1 -1
  64. package/dist/extensions/healthie/lib/validation/sendFormCompletionRequest.zod.d.ts +4 -4
  65. package/dist/extensions/healthie/webhooks/appliedTagCreated.d.ts +2 -1
  66. package/dist/extensions/healthie/webhooks/appliedTagCreated.js +20 -7
  67. package/dist/extensions/healthie/webhooks/appliedTagCreated.js.map +1 -1
  68. package/dist/extensions/healthie/webhooks/appliedTagDeleted.d.ts +2 -1
  69. package/dist/extensions/healthie/webhooks/appliedTagDeleted.js +20 -7
  70. package/dist/extensions/healthie/webhooks/appliedTagDeleted.js.map +1 -1
  71. package/dist/extensions/healthie/webhooks/appointmentCreated.d.ts +6 -1
  72. package/dist/extensions/healthie/webhooks/appointmentCreated.js +26 -6
  73. package/dist/extensions/healthie/webhooks/appointmentCreated.js.map +1 -1
  74. package/dist/extensions/healthie/webhooks/appointmentCreated.test.d.ts +1 -0
  75. package/dist/extensions/healthie/webhooks/appointmentCreated.test.js +61 -0
  76. package/dist/extensions/healthie/webhooks/appointmentCreated.test.js.map +1 -0
  77. package/dist/extensions/healthie/webhooks/appointmentDeleted.d.ts +2 -1
  78. package/dist/extensions/healthie/webhooks/appointmentDeleted.js +22 -6
  79. package/dist/extensions/healthie/webhooks/appointmentDeleted.js.map +1 -1
  80. package/dist/extensions/healthie/webhooks/appointmentUpdated.d.ts +6 -1
  81. package/dist/extensions/healthie/webhooks/appointmentUpdated.js +26 -6
  82. package/dist/extensions/healthie/webhooks/appointmentUpdated.js.map +1 -1
  83. package/dist/extensions/healthie/webhooks/formAnswerGroupCreated.d.ts +6 -1
  84. package/dist/extensions/healthie/webhooks/formAnswerGroupCreated.js +27 -7
  85. package/dist/extensions/healthie/webhooks/formAnswerGroupCreated.js.map +1 -1
  86. package/dist/extensions/healthie/webhooks/formAnswerGroupDeleted.d.ts +2 -1
  87. package/dist/extensions/healthie/webhooks/formAnswerGroupDeleted.js +21 -6
  88. package/dist/extensions/healthie/webhooks/formAnswerGroupDeleted.js.map +1 -1
  89. package/dist/extensions/healthie/webhooks/formAnswerGroupLocked.d.ts +6 -1
  90. package/dist/extensions/healthie/webhooks/formAnswerGroupLocked.js +26 -6
  91. package/dist/extensions/healthie/webhooks/formAnswerGroupLocked.js.map +1 -1
  92. package/dist/extensions/healthie/webhooks/formAnswerGroupSigned.d.ts +6 -1
  93. package/dist/extensions/healthie/webhooks/formAnswerGroupSigned.js +26 -6
  94. package/dist/extensions/healthie/webhooks/formAnswerGroupSigned.js.map +1 -1
  95. package/dist/extensions/healthie/webhooks/goalCreated.d.ts +3 -2
  96. package/dist/extensions/healthie/webhooks/goalCreated.js +22 -9
  97. package/dist/extensions/healthie/webhooks/goalCreated.js.map +1 -1
  98. package/dist/extensions/healthie/webhooks/goalCreated.test.d.ts +1 -0
  99. package/dist/extensions/healthie/webhooks/goalCreated.test.js +35 -0
  100. package/dist/extensions/healthie/webhooks/goalCreated.test.js.map +1 -0
  101. package/dist/extensions/healthie/webhooks/goalUpdated.d.ts +2 -1
  102. package/dist/extensions/healthie/webhooks/goalUpdated.js +21 -8
  103. package/dist/extensions/healthie/webhooks/goalUpdated.js.map +1 -1
  104. package/dist/extensions/healthie/webhooks/index.d.ts +316 -5
  105. package/dist/extensions/healthie/webhooks/index.js +0 -8
  106. package/dist/extensions/healthie/webhooks/index.js.map +1 -1
  107. package/dist/extensions/healthie/webhooks/labOrderCreated.d.ts +2 -1
  108. package/dist/extensions/healthie/webhooks/labOrderCreated.js +20 -7
  109. package/dist/extensions/healthie/webhooks/labOrderCreated.js.map +1 -1
  110. package/dist/extensions/healthie/webhooks/labOrderUpdated.d.ts +2 -1
  111. package/dist/extensions/healthie/webhooks/labOrderUpdated.js +20 -7
  112. package/dist/extensions/healthie/webhooks/labOrderUpdated.js.map +1 -1
  113. package/dist/extensions/healthie/webhooks/messageCreated.d.ts +2 -1
  114. package/dist/extensions/healthie/webhooks/messageCreated.js +21 -7
  115. package/dist/extensions/healthie/webhooks/messageCreated.js.map +1 -1
  116. package/dist/extensions/healthie/webhooks/messageDeleted.d.ts +2 -1
  117. package/dist/extensions/healthie/webhooks/messageDeleted.js +21 -7
  118. package/dist/extensions/healthie/webhooks/messageDeleted.js.map +1 -1
  119. package/dist/extensions/healthie/webhooks/metricEntryCreated.d.ts +2 -1
  120. package/dist/extensions/healthie/webhooks/metricEntryCreated.js +20 -7
  121. package/dist/extensions/healthie/webhooks/metricEntryCreated.js.map +1 -1
  122. package/dist/extensions/healthie/webhooks/metricEntryUpdated.d.ts +2 -1
  123. package/dist/extensions/healthie/webhooks/metricEntryUpdated.js +20 -7
  124. package/dist/extensions/healthie/webhooks/metricEntryUpdated.js.map +1 -1
  125. package/dist/extensions/healthie/webhooks/patientCreated.js +8 -1
  126. package/dist/extensions/healthie/webhooks/patientCreated.js.map +1 -1
  127. package/dist/extensions/healthie/webhooks/patientUpdated.js +8 -1
  128. package/dist/extensions/healthie/webhooks/patientUpdated.js.map +1 -1
  129. package/dist/extensions/healthie/webhooks/requestedFormCompletionCreated.d.ts +2 -1
  130. package/dist/extensions/healthie/webhooks/requestedFormCompletionCreated.js +20 -7
  131. package/dist/extensions/healthie/webhooks/requestedFormCompletionCreated.js.map +1 -1
  132. package/dist/extensions/healthie/webhooks/requestedFormCompletionUpdated.d.ts +2 -1
  133. package/dist/extensions/healthie/webhooks/requestedFormCompletionUpdated.js +20 -7
  134. package/dist/extensions/healthie/webhooks/requestedFormCompletionUpdated.js.map +1 -1
  135. package/dist/extensions/healthie/webhooks/taskCreated.d.ts +2 -1
  136. package/dist/extensions/healthie/webhooks/taskCreated.js +20 -7
  137. package/dist/extensions/healthie/webhooks/taskCreated.js.map +1 -1
  138. package/dist/extensions/healthie/webhooks/taskUpdated.d.ts +2 -1
  139. package/dist/extensions/healthie/webhooks/taskUpdated.js +21 -8
  140. package/dist/extensions/healthie/webhooks/taskUpdated.js.map +1 -1
  141. package/dist/extensions/hello-world/webhooks/index.d.ts +1 -1
  142. package/dist/extensions/infobip/v1/actions/sendEmail/config/fields.d.ts +2 -2
  143. package/dist/extensions/mailgun/settings.d.ts +1 -1
  144. package/dist/extensions/mailgun/v1/actions/sendEmailWithTemplate/config/fields.d.ts +2 -2
  145. package/dist/extensions/math/v1/actions/calculateDateDifference/config/fields.d.ts +2 -2
  146. package/dist/extensions/math/v1/actions/generateRandomNumber/config/fields.d.ts +2 -2
  147. package/dist/extensions/medplum/actions/createPatient/config/fields.d.ts +4 -4
  148. package/dist/extensions/medplum/actions/createServiceRequest/config/fields.d.ts +4 -4
  149. package/dist/extensions/medplum/actions/createTask/config/fields.d.ts +6 -6
  150. package/dist/extensions/medplum/fhir/schemas/atoms/PeriodSchema.d.ts +2 -2
  151. package/dist/extensions/medplum/fhir/schemas/resources/patient.schema.d.ts +4 -4
  152. package/dist/extensions/medplum/fhir/schemas/resources/serviceRequest.schema.d.ts +4 -4
  153. package/dist/extensions/medplum/fhir/schemas/resources/task.schema.d.ts +6 -6
  154. package/dist/extensions/metriport/actions/index.d.ts +1 -1
  155. package/dist/extensions/metriport/actions/patient/validation.d.ts +4 -4
  156. package/dist/extensions/stripe/actions/createCustomer/config/fields.d.ts +2 -2
  157. package/dist/extensions/stripe/actions/embeddedCheckout/config/fields.d.ts +2 -2
  158. package/dist/extensions/talkDesk/settings.d.ts +1 -1
  159. package/dist/extensions/textline/client/schema.d.ts +10 -10
  160. package/dist/extensions/westFax/actions/sendFax/sendFax.test.js +13 -3
  161. package/dist/extensions/westFax/actions/sendFax/sendFax.test.js.map +1 -1
  162. package/dist/extensions/westFax/settings.d.ts +2 -2
  163. package/dist/extensions/zendesk/v1/actions/createTask/config/fields.d.ts +2 -2
  164. package/dist/extensions/zusHealth/validation/settings.zod.d.ts +6 -6
  165. package/dist/extensions/zusHealth/webhooks/index.d.ts +37 -1
  166. package/dist/extensions/zusHealth/webhooks/patientAdmitted.d.ts +2 -1
  167. package/dist/extensions/zusHealth/webhooks/patientAdmitted.js.map +1 -1
  168. package/dist/extensions/zusHealth/webhooks/patientDischarged.d.ts +2 -1
  169. package/dist/extensions/zusHealth/webhooks/patientDischarged.js.map +1 -1
  170. package/dist/src/test-server.js +4 -0
  171. package/dist/src/test-server.js.map +1 -1
  172. package/package.json +4 -3
  173. package/dist/extensions/healthie/webhooks/goalDeleted.d.ts +0 -11
  174. package/dist/extensions/healthie/webhooks/goalDeleted.js +0 -30
  175. package/dist/extensions/healthie/webhooks/goalDeleted.js.map +0 -1
  176. package/dist/extensions/healthie/webhooks/metricEntryDeleted.d.ts +0 -11
  177. package/dist/extensions/healthie/webhooks/metricEntryDeleted.js +0 -30
  178. package/dist/extensions/healthie/webhooks/metricEntryDeleted.js.map +0 -1
  179. package/dist/extensions/healthie/webhooks/requestedFormCompletionDeleted.d.ts +0 -11
  180. package/dist/extensions/healthie/webhooks/requestedFormCompletionDeleted.js +0 -30
  181. package/dist/extensions/healthie/webhooks/requestedFormCompletionDeleted.js.map +0 -1
  182. package/dist/extensions/healthie/webhooks/taskDeleted.d.ts +0 -11
  183. package/dist/extensions/healthie/webhooks/taskDeleted.js +0 -30
  184. package/dist/extensions/healthie/webhooks/taskDeleted.js.map +0 -1
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sdk_1 = require("../lib/sdk/generated/sdk");
4
+ const sdk_2 = require("../lib/sdk/generated/__mocks__/sdk");
5
+ const goalCreated_1 = require("./goalCreated");
6
+ jest.mock('../lib/sdk/generated/sdk');
7
+ jest.mock('../lib/sdk/graphqlClient');
8
+ describe('GoalCreated Webhook', () => {
9
+ const onComplete = jest.fn();
10
+ beforeAll(() => {
11
+ ;
12
+ sdk_1.getSdk.mockImplementation(sdk_2.mockGetSdk);
13
+ });
14
+ beforeEach(() => {
15
+ jest.clearAllMocks();
16
+ });
17
+ test('Receive a webhook', async () => {
18
+ await goalCreated_1.goalCreated.onWebhookReceived({
19
+ payload: {
20
+ resource_id: 72499,
21
+ resource_id_type: 'Goal',
22
+ event_type: 'goal.created',
23
+ },
24
+ settings: {
25
+ apiUrl: 'https://api.healthieapp.com/graphql',
26
+ apiKey: 'apiKey',
27
+ },
28
+ rawBody: Buffer.from(''),
29
+ headers: {},
30
+ }, onComplete, jest.fn());
31
+ expect(sdk_2.mockGetSdkReturn.getGoal).toHaveBeenCalled();
32
+ expect(onComplete).toHaveBeenCalled();
33
+ });
34
+ });
35
+ //# sourceMappingURL=goalCreated.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goalCreated.test.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/goalCreated.test.ts"],"names":[],"mappings":";;AAAA,kDAAiD;AACjD,4DAG2C;AAC3C,+CAA2C;AAE3C,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;AACrC,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;AAErC,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAE5B,SAAS,CAAC,GAAG,EAAE;QACb,CAAC;QAAC,YAAoB,CAAC,kBAAkB,CAAC,gBAAU,CAAC,CAAA;IACvD,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;QACnC,MAAM,yBAAW,CAAC,iBAAiB,CACjC;YACE,OAAO,EAAE;gBACP,WAAW,EAAE,KAAK;gBAClB,gBAAgB,EAAE,MAAM;gBACxB,UAAU,EAAE,cAAc;aAC3B;YACD,QAAQ,EAAE;gBACR,MAAM,EAAE,qCAAqC;gBAC7C,MAAM,EAAE,QAAQ;aACjB;YACD,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,OAAO,EAAE,EAAE;SACZ,EACD,UAAU,EACV,IAAI,CAAC,EAAE,EAAE,CACV,CAAA;QAED,MAAM,CAAC,sBAAgB,CAAC,OAAO,CAAC,CAAC,gBAAgB,EAAE,CAAA;QACnD,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAA;IACvC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,11 +1,12 @@
1
1
  import { type Webhook } from '@awell-health/extensions-core';
2
2
  import { type HealthieWebhookPayload } from '../lib/types';
3
+ import { type settings } from '../settings';
3
4
  declare const dataPoints: {
4
5
  updatedGoalId: {
5
6
  key: string;
6
7
  valueType: "string";
7
8
  };
8
9
  };
9
- export declare const goalUpdated: Webhook<keyof typeof dataPoints, HealthieWebhookPayload>;
10
+ export declare const goalUpdated: Webhook<keyof typeof dataPoints, HealthieWebhookPayload, typeof settings>;
10
11
  export type GoalUpdated = typeof goalUpdated;
11
12
  export {};
@@ -2,6 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.goalUpdated = void 0;
4
4
  const lodash_1 = require("lodash");
5
+ const types_1 = require("../lib/types");
6
+ const createSdk_1 = require("../lib/sdk/createSdk");
7
+ const errors_1 = require("../lib/sdk/errors");
8
+ const helpers_1 = require("../lib/helpers");
5
9
  const dataPoints = {
6
10
  updatedGoalId: {
7
11
  key: 'updatedGoalId',
@@ -12,19 +16,28 @@ exports.goalUpdated = {
12
16
  key: 'goalUpdated',
13
17
  dataPoints,
14
18
  onWebhookReceived: async ({ payload, settings }, onSuccess, onError) => {
15
- const { resource_id: updatedGoalId } = payload;
16
- if ((0, lodash_1.isNil)(updatedGoalId)) {
17
- await onError({
18
- // We should automatically send a 400 here, so no need to provide info
19
- });
20
- }
21
- else {
19
+ var _a, _b;
20
+ try {
21
+ const { sdk } = await (0, createSdk_1.createSdk)({ settings });
22
+ const validatedPayload = helpers_1.webhookPayloadSchema.parse(payload);
23
+ const updatedGoalId = validatedPayload.resource_id.toString();
24
+ const response = await sdk.getGoal({ id: updatedGoalId });
25
+ const healthiePatientId = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.goal) === null || _b === void 0 ? void 0 : _b.user_id;
22
26
  await onSuccess({
23
27
  data_points: {
24
28
  updatedGoalId,
25
29
  },
30
+ ...(!(0, lodash_1.isNil)(healthiePatientId) && {
31
+ patient_identifier: {
32
+ system: types_1.HEALTHIE_IDENTIFIER,
33
+ value: healthiePatientId,
34
+ },
35
+ }),
26
36
  });
27
37
  }
28
- },
38
+ catch (error) {
39
+ await onError((0, errors_1.formatError)(error));
40
+ }
41
+ }
29
42
  };
30
43
  //# sourceMappingURL=goalUpdated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"goalUpdated.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/goalUpdated.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAO9B,MAAM,UAAU,GAAG;IACjB,aAAa,EAAE;QACb,GAAG,EAAE,eAAe;QACpB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA;AAElC,QAAA,WAAW,GAGpB;IACF,GAAG,EAAE,aAAa;IAClB,UAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QAC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a;iBACd;gBACD,GAAG,CAAC,CAAC,IAAA,cAAK,EAAC,iBAAiB,CAAC,IAAI;oBAC/B,kBAAkB,EAAE;wBAClB,MAAM,EAAE,2BAAmB;wBAC3B,KAAK,EAAE,iBAAiB;qBACzB;iBACF,CAAC;aACH,CAAC,CAAA;SACH;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,OAAO,CAAC,IAAA,oBAAW,EAAC,KAAK,CAAC,CAAC,CAAA;SAClC;IACH,CAAC;CACF,CAAA"}
@@ -13,16 +13,327 @@ export type { LabOrderUpdated } from './labOrderUpdated';
13
13
  export type { MessageCreated } from './messageCreated';
14
14
  export type { MessageDeleted } from './messageDeleted';
15
15
  export type { MetricEntryCreated } from './metricEntryCreated';
16
- export type { MetricEntryDeleted } from './metricEntryDeleted';
17
16
  export type { MetricEntryUpdated } from './metricEntryUpdated';
18
17
  export type { PatientUpdated } from './patientUpdated';
19
18
  export type { RequestFormCompletionCreated } from './requestedFormCompletionCreated';
20
- export type { RequestFormCompletionDeleted } from './requestedFormCompletionDeleted';
21
19
  export type { RequestFormCompletionUpdated } from './requestedFormCompletionUpdated';
22
20
  export type { TaskCreated } from './taskCreated';
23
- export type { TaskDeleted } from './taskDeleted';
24
21
  export type { TaskUpdated } from './taskUpdated';
25
22
  export type { GoalCreated } from './goalCreated';
26
23
  export type { GoalUpdated } from './goalUpdated';
27
- export type { GoalDeleted } from './goalDeleted';
28
- export declare const webhooks: (import("@awell-health/extensions-core").Webhook<"appointmentId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"patientId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"createdAppliedTagId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"deletedAppliedTagId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"deletedAppointmentId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"updatedAppointmentId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"createdFormAnswerGroupId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"deletedFormAnswerGroupId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"lockedFormAnswerGroupId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"signedFormAnswerGroupId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"createdLabOrderId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"updatedLabOrderId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"createdMessageId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"deletedMessageId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"createdMetricId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"deletedMetricId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"updatedMetricId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"updatedPatientId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"createdFormCompletionId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"deletedFormCompletionId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"updatedFormCompletionId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"createdTaskId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"deletedTaskId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"updatedTaskId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"createdGoalId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"updatedGoalId", import("../lib/types").HealthieWebhookPayload> | import("@awell-health/extensions-core").Webhook<"deletedGoalId", import("../lib/types").HealthieWebhookPayload>)[];
24
+ export declare const webhooks: (import("@awell-health/extensions-core").Webhook<"appointmentId" | "appointment", import("../lib/types").HealthieWebhookPayload, {
25
+ apiUrl: {
26
+ key: string;
27
+ label: string;
28
+ obfuscated: false;
29
+ required: true;
30
+ description: string;
31
+ };
32
+ apiKey: {
33
+ key: string;
34
+ label: string;
35
+ obfuscated: true;
36
+ required: true;
37
+ description: string;
38
+ };
39
+ }> | import("@awell-health/extensions-core").Webhook<"patientId", import("../lib/types").HealthieWebhookPayload, Record<string, import("@awell-health/extensions-core").Setting>> | import("@awell-health/extensions-core").Webhook<"createdAppliedTagId", import("../lib/types").HealthieWebhookPayload, {
40
+ apiUrl: {
41
+ key: string;
42
+ label: string;
43
+ obfuscated: false;
44
+ required: true;
45
+ description: string;
46
+ };
47
+ apiKey: {
48
+ key: string;
49
+ label: string;
50
+ obfuscated: true;
51
+ required: true;
52
+ description: string;
53
+ };
54
+ }> | import("@awell-health/extensions-core").Webhook<"deletedAppliedTagId", import("../lib/types").HealthieWebhookPayload, {
55
+ apiUrl: {
56
+ key: string;
57
+ label: string;
58
+ obfuscated: false;
59
+ required: true;
60
+ description: string;
61
+ };
62
+ apiKey: {
63
+ key: string;
64
+ label: string;
65
+ obfuscated: true;
66
+ required: true;
67
+ description: string;
68
+ };
69
+ }> | import("@awell-health/extensions-core").Webhook<"deletedAppointmentId", import("../lib/types").HealthieWebhookPayload, {
70
+ apiUrl: {
71
+ key: string;
72
+ label: string;
73
+ obfuscated: false;
74
+ required: true;
75
+ description: string;
76
+ };
77
+ apiKey: {
78
+ key: string;
79
+ label: string;
80
+ obfuscated: true;
81
+ required: true;
82
+ description: string;
83
+ };
84
+ }> | import("@awell-health/extensions-core").Webhook<"appointment" | "updatedAppointmentId", import("../lib/types").HealthieWebhookPayload, {
85
+ apiUrl: {
86
+ key: string;
87
+ label: string;
88
+ obfuscated: false;
89
+ required: true;
90
+ description: string;
91
+ };
92
+ apiKey: {
93
+ key: string;
94
+ label: string;
95
+ obfuscated: true;
96
+ required: true;
97
+ description: string;
98
+ };
99
+ }> | import("@awell-health/extensions-core").Webhook<"createdFormAnswerGroupId" | "createdFormAnswerGroup", import("../lib/types").HealthieWebhookPayload, {
100
+ apiUrl: {
101
+ key: string;
102
+ label: string;
103
+ obfuscated: false;
104
+ required: true;
105
+ description: string;
106
+ };
107
+ apiKey: {
108
+ key: string;
109
+ label: string;
110
+ obfuscated: true;
111
+ required: true;
112
+ description: string;
113
+ };
114
+ }> | import("@awell-health/extensions-core").Webhook<"deletedFormAnswerGroupId", import("../lib/types").HealthieWebhookPayload, {
115
+ apiUrl: {
116
+ key: string;
117
+ label: string;
118
+ obfuscated: false;
119
+ required: true;
120
+ description: string;
121
+ };
122
+ apiKey: {
123
+ key: string;
124
+ label: string;
125
+ obfuscated: true;
126
+ required: true;
127
+ description: string;
128
+ };
129
+ }> | import("@awell-health/extensions-core").Webhook<"lockedFormAnswerGroupId" | "lockedFormAnswerGroup", import("../lib/types").HealthieWebhookPayload, {
130
+ apiUrl: {
131
+ key: string;
132
+ label: string;
133
+ obfuscated: false;
134
+ required: true;
135
+ description: string;
136
+ };
137
+ apiKey: {
138
+ key: string;
139
+ label: string;
140
+ obfuscated: true;
141
+ required: true;
142
+ description: string;
143
+ };
144
+ }> | import("@awell-health/extensions-core").Webhook<"signedFormAnswerGroupId" | "signedFormAnswerGroup", import("../lib/types").HealthieWebhookPayload, {
145
+ apiUrl: {
146
+ key: string;
147
+ label: string;
148
+ obfuscated: false;
149
+ required: true;
150
+ description: string;
151
+ };
152
+ apiKey: {
153
+ key: string;
154
+ label: string;
155
+ obfuscated: true;
156
+ required: true;
157
+ description: string;
158
+ };
159
+ }> | import("@awell-health/extensions-core").Webhook<"createdLabOrderId", import("../lib/types").HealthieWebhookPayload, {
160
+ apiUrl: {
161
+ key: string;
162
+ label: string;
163
+ obfuscated: false;
164
+ required: true;
165
+ description: string;
166
+ };
167
+ apiKey: {
168
+ key: string;
169
+ label: string;
170
+ obfuscated: true;
171
+ required: true;
172
+ description: string;
173
+ };
174
+ }> | import("@awell-health/extensions-core").Webhook<"updatedLabOrderId", import("../lib/types").HealthieWebhookPayload, {
175
+ apiUrl: {
176
+ key: string;
177
+ label: string;
178
+ obfuscated: false;
179
+ required: true;
180
+ description: string;
181
+ };
182
+ apiKey: {
183
+ key: string;
184
+ label: string;
185
+ obfuscated: true;
186
+ required: true;
187
+ description: string;
188
+ };
189
+ }> | import("@awell-health/extensions-core").Webhook<"createdMessageId", import("../lib/types").HealthieWebhookPayload, {
190
+ apiUrl: {
191
+ key: string;
192
+ label: string;
193
+ obfuscated: false;
194
+ required: true;
195
+ description: string;
196
+ };
197
+ apiKey: {
198
+ key: string;
199
+ label: string;
200
+ obfuscated: true;
201
+ required: true;
202
+ description: string;
203
+ };
204
+ }> | import("@awell-health/extensions-core").Webhook<"deletedMessageId", import("../lib/types").HealthieWebhookPayload, {
205
+ apiUrl: {
206
+ key: string;
207
+ label: string;
208
+ obfuscated: false;
209
+ required: true;
210
+ description: string;
211
+ };
212
+ apiKey: {
213
+ key: string;
214
+ label: string;
215
+ obfuscated: true;
216
+ required: true;
217
+ description: string;
218
+ };
219
+ }> | import("@awell-health/extensions-core").Webhook<"createdMetricId", import("../lib/types").HealthieWebhookPayload, {
220
+ apiUrl: {
221
+ key: string;
222
+ label: string;
223
+ obfuscated: false;
224
+ required: true;
225
+ description: string;
226
+ };
227
+ apiKey: {
228
+ key: string;
229
+ label: string;
230
+ obfuscated: true;
231
+ required: true;
232
+ description: string;
233
+ };
234
+ }> | import("@awell-health/extensions-core").Webhook<"updatedMetricId", import("../lib/types").HealthieWebhookPayload, {
235
+ apiUrl: {
236
+ key: string;
237
+ label: string;
238
+ obfuscated: false;
239
+ required: true;
240
+ description: string;
241
+ };
242
+ apiKey: {
243
+ key: string;
244
+ label: string;
245
+ obfuscated: true;
246
+ required: true;
247
+ description: string;
248
+ };
249
+ }> | import("@awell-health/extensions-core").Webhook<"updatedPatientId", import("../lib/types").HealthieWebhookPayload, Record<string, import("@awell-health/extensions-core").Setting>> | import("@awell-health/extensions-core").Webhook<"createdFormCompletionId", import("../lib/types").HealthieWebhookPayload, {
250
+ apiUrl: {
251
+ key: string;
252
+ label: string;
253
+ obfuscated: false;
254
+ required: true;
255
+ description: string;
256
+ };
257
+ apiKey: {
258
+ key: string;
259
+ label: string;
260
+ obfuscated: true;
261
+ required: true;
262
+ description: string;
263
+ };
264
+ }> | import("@awell-health/extensions-core").Webhook<"updatedFormCompletionId", import("../lib/types").HealthieWebhookPayload, {
265
+ apiUrl: {
266
+ key: string;
267
+ label: string;
268
+ obfuscated: false;
269
+ required: true;
270
+ description: string;
271
+ };
272
+ apiKey: {
273
+ key: string;
274
+ label: string;
275
+ obfuscated: true;
276
+ required: true;
277
+ description: string;
278
+ };
279
+ }> | import("@awell-health/extensions-core").Webhook<"createdTaskId", import("../lib/types").HealthieWebhookPayload, {
280
+ apiUrl: {
281
+ key: string;
282
+ label: string;
283
+ obfuscated: false;
284
+ required: true;
285
+ description: string;
286
+ };
287
+ apiKey: {
288
+ key: string;
289
+ label: string;
290
+ obfuscated: true;
291
+ required: true;
292
+ description: string;
293
+ };
294
+ }> | import("@awell-health/extensions-core").Webhook<"updatedTaskId", import("../lib/types").HealthieWebhookPayload, {
295
+ apiUrl: {
296
+ key: string;
297
+ label: string;
298
+ obfuscated: false;
299
+ required: true;
300
+ description: string;
301
+ };
302
+ apiKey: {
303
+ key: string;
304
+ label: string;
305
+ obfuscated: true;
306
+ required: true;
307
+ description: string;
308
+ };
309
+ }> | import("@awell-health/extensions-core").Webhook<"createdGoalId", import("../lib/types").HealthieWebhookPayload, {
310
+ apiUrl: {
311
+ key: string;
312
+ label: string;
313
+ obfuscated: false;
314
+ required: true;
315
+ description: string;
316
+ };
317
+ apiKey: {
318
+ key: string;
319
+ label: string;
320
+ obfuscated: true;
321
+ required: true;
322
+ description: string;
323
+ };
324
+ }> | import("@awell-health/extensions-core").Webhook<"updatedGoalId", import("../lib/types").HealthieWebhookPayload, {
325
+ apiUrl: {
326
+ key: string;
327
+ label: string;
328
+ obfuscated: false;
329
+ required: true;
330
+ description: string;
331
+ };
332
+ apiKey: {
333
+ key: string;
334
+ label: string;
335
+ obfuscated: true;
336
+ required: true;
337
+ description: string;
338
+ };
339
+ }>)[];
@@ -16,18 +16,14 @@ const labOrderUpdated_1 = require("./labOrderUpdated");
16
16
  const messageCreated_1 = require("./messageCreated");
17
17
  const messageDeleted_1 = require("./messageDeleted");
18
18
  const metricEntryCreated_1 = require("./metricEntryCreated");
19
- const metricEntryDeleted_1 = require("./metricEntryDeleted");
20
19
  const metricEntryUpdated_1 = require("./metricEntryUpdated");
21
20
  const patientUpdated_1 = require("./patientUpdated");
22
21
  const requestedFormCompletionCreated_1 = require("./requestedFormCompletionCreated");
23
- const requestedFormCompletionDeleted_1 = require("./requestedFormCompletionDeleted");
24
22
  const requestedFormCompletionUpdated_1 = require("./requestedFormCompletionUpdated");
25
23
  const taskCreated_1 = require("./taskCreated");
26
- const taskDeleted_1 = require("./taskDeleted");
27
24
  const taskUpdated_1 = require("./taskUpdated");
28
25
  const goalCreated_1 = require("./goalCreated");
29
26
  const goalUpdated_1 = require("./goalUpdated");
30
- const goalDeleted_1 = require("./goalDeleted");
31
27
  exports.webhooks = [
32
28
  appointmentCreated_1.appointmentCreated,
33
29
  patientCreated_1.patientCreated,
@@ -44,17 +40,13 @@ exports.webhooks = [
44
40
  messageCreated_1.messageCreated,
45
41
  messageDeleted_1.messageDeleted,
46
42
  metricEntryCreated_1.metricEntryCreated,
47
- metricEntryDeleted_1.metricEntryDeleted,
48
43
  metricEntryUpdated_1.metricEntryUpdated,
49
44
  patientUpdated_1.patientUpdated,
50
45
  requestedFormCompletionCreated_1.requestFormCompletionCreated,
51
- requestedFormCompletionDeleted_1.requestFormCompletionDeleted,
52
46
  requestedFormCompletionUpdated_1.requestFormCompletionUpdated,
53
47
  taskCreated_1.taskCreated,
54
- taskDeleted_1.taskDeleted,
55
48
  taskUpdated_1.taskUpdated,
56
49
  goalCreated_1.goalCreated,
57
50
  goalUpdated_1.goalUpdated,
58
- goalDeleted_1.goalDeleted,
59
51
  ];
60
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/index.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AACzD,qDAAiD;AACjD,2DAAuD;AACvD,2DAAuD;AACvD,6DAAyD;AACzD,6DAAyD;AACzD,qEAAiE;AACjE,qEAAiE;AACjE,mEAA+D;AAC/D,mEAA+D;AAC/D,uDAAmD;AACnD,uDAAmD;AACnD,qDAAiD;AACjD,qDAAiD;AACjD,6DAAyD;AACzD,6DAAyD;AACzD,6DAAyD;AACzD,qDAAiD;AACjD,qFAA+E;AAC/E,qFAA+E;AAC/E,qFAA+E;AAC/E,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AA8B9B,QAAA,QAAQ,GAAG;IACtB,uCAAkB;IAClB,+BAAc;IACd,qCAAiB;IACjB,qCAAiB;IACjB,uCAAkB;IAClB,uCAAkB;IAClB,+CAAsB;IACtB,+CAAsB;IACtB,6CAAqB;IACrB,6CAAqB;IACrB,iCAAe;IACf,iCAAe;IACf,+BAAc;IACd,+BAAc;IACd,uCAAkB;IAClB,uCAAkB;IAClB,uCAAkB;IAClB,+BAAc;IACd,6DAA4B;IAC5B,6DAA4B;IAC5B,6DAA4B;IAC5B,yBAAW;IACX,yBAAW;IACX,yBAAW;IACX,yBAAW;IACX,yBAAW;IACX,yBAAW;CACZ,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/index.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AACzD,qDAAiD;AACjD,2DAAuD;AACvD,2DAAuD;AACvD,6DAAyD;AACzD,6DAAyD;AACzD,qEAAiE;AACjE,qEAAiE;AACjE,mEAA+D;AAC/D,mEAA+D;AAC/D,uDAAmD;AACnD,uDAAmD;AACnD,qDAAiD;AACjD,qDAAiD;AACjD,6DAAyD;AACzD,6DAAyD;AACzD,qDAAiD;AACjD,qFAA+E;AAC/E,qFAA+E;AAC/E,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AA0B9B,QAAA,QAAQ,GAAG;IACtB,uCAAkB;IAClB,+BAAc;IACd,qCAAiB;IACjB,qCAAiB;IACjB,uCAAkB;IAClB,uCAAkB;IAClB,+CAAsB;IACtB,+CAAsB;IACtB,6CAAqB;IACrB,6CAAqB;IACrB,iCAAe;IACf,iCAAe;IACf,+BAAc;IACd,+BAAc;IACd,uCAAkB;IAClB,uCAAkB;IAClB,+BAAc;IACd,6DAA4B;IAC5B,6DAA4B;IAC5B,yBAAW;IACX,yBAAW;IACX,yBAAW;IACX,yBAAW;CACZ,CAAA"}
@@ -1,11 +1,12 @@
1
1
  import { type Webhook } from '@awell-health/extensions-core';
2
2
  import { type HealthieWebhookPayload } from '../lib/types';
3
+ import { type settings } from '../settings';
3
4
  declare const dataPoints: {
4
5
  createdLabOrderId: {
5
6
  key: string;
6
7
  valueType: "string";
7
8
  };
8
9
  };
9
- export declare const labOrderCreated: Webhook<keyof typeof dataPoints, HealthieWebhookPayload>;
10
+ export declare const labOrderCreated: Webhook<keyof typeof dataPoints, HealthieWebhookPayload, typeof settings>;
10
11
  export type LabOrderCreated = typeof labOrderCreated;
11
12
  export {};
@@ -2,6 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.labOrderCreated = void 0;
4
4
  const lodash_1 = require("lodash");
5
+ const types_1 = require("../lib/types");
6
+ const errors_1 = require("../lib/sdk/errors");
7
+ const createSdk_1 = require("../lib/sdk/createSdk");
8
+ const helpers_1 = require("../lib/helpers");
5
9
  const dataPoints = {
6
10
  createdLabOrderId: {
7
11
  key: 'createdLabOrderId',
@@ -12,19 +16,28 @@ exports.labOrderCreated = {
12
16
  key: 'labOrderCreated',
13
17
  dataPoints,
14
18
  onWebhookReceived: async ({ payload, settings }, onSuccess, onError) => {
15
- const { resource_id: createdLabOrderId } = payload;
16
- if ((0, lodash_1.isNil)(createdLabOrderId)) {
17
- await onError({
18
- // We should automatically send a 400 here, so no need to provide info
19
- });
20
- }
21
- else {
19
+ var _a, _b, _c;
20
+ try {
21
+ const { sdk } = await (0, createSdk_1.createSdk)({ settings });
22
+ const validatedPayload = helpers_1.webhookPayloadSchema.parse(payload);
23
+ const createdLabOrderId = validatedPayload.resource_id.toString();
24
+ const response = await sdk.getLabOrder({ id: createdLabOrderId });
25
+ const healthiePatientId = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.labOrder) === null || _b === void 0 ? void 0 : _b.patient) === null || _c === void 0 ? void 0 : _c.id;
22
26
  await onSuccess({
23
27
  data_points: {
24
28
  createdLabOrderId,
25
29
  },
30
+ ...(!(0, lodash_1.isNil)(healthiePatientId) && {
31
+ patient_identifier: {
32
+ system: types_1.HEALTHIE_IDENTIFIER,
33
+ value: healthiePatientId,
34
+ },
35
+ }),
26
36
  });
27
37
  }
38
+ catch (error) {
39
+ await onError((0, errors_1.formatError)(error));
40
+ }
28
41
  },
29
42
  };
30
43
  //# sourceMappingURL=labOrderCreated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"labOrderCreated.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/labOrderCreated.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAO9B,MAAM,UAAU,GAAG;IACjB,iBAAiB,EAAE;QACjB,GAAG,EAAE,mBAAmB;QACxB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA;AAElC,QAAA,eAAe,GAGxB;IACF,GAAG,EAAE,iBAAiB;IACtB,UAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ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QAAQ,0CAAE,OAAO,0CAAE,EAAE,CAAA;YAC/D,MAAM,SAAS,CAAC;gBACd,WAAW,EAAE;oBACX,iBAAiB;iBAClB;gBACD,GAAG,CAAC,CAAC,IAAA,cAAK,EAAC,iBAAiB,CAAC,IAAI;oBAC/B,kBAAkB,EAAE;wBAClB,MAAM,EAAE,2BAAmB;wBAC3B,KAAK,EAAE,iBAAiB;qBACzB;iBACF,CAAC;aACH,CAAC,CAAA;SACH;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,OAAO,CAAC,IAAA,oBAAW,EAAC,KAAK,CAAC,CAAC,CAAA;SAClC;IACH,CAAC;CACF,CAAA"}
@@ -1,11 +1,12 @@
1
1
  import { type Webhook } from '@awell-health/extensions-core';
2
2
  import { type HealthieWebhookPayload } from '../lib/types';
3
+ import { type settings } from '../settings';
3
4
  declare const dataPoints: {
4
5
  updatedLabOrderId: {
5
6
  key: string;
6
7
  valueType: "string";
7
8
  };
8
9
  };
9
- export declare const labOrderUpdated: Webhook<keyof typeof dataPoints, HealthieWebhookPayload>;
10
+ export declare const labOrderUpdated: Webhook<keyof typeof dataPoints, HealthieWebhookPayload, typeof settings>;
10
11
  export type LabOrderUpdated = typeof labOrderUpdated;
11
12
  export {};
@@ -2,6 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.labOrderUpdated = void 0;
4
4
  const lodash_1 = require("lodash");
5
+ const types_1 = require("../lib/types");
6
+ const errors_1 = require("../lib/sdk/errors");
7
+ const createSdk_1 = require("../lib/sdk/createSdk");
8
+ const helpers_1 = require("../lib/helpers");
5
9
  const dataPoints = {
6
10
  updatedLabOrderId: {
7
11
  key: 'updatedLabOrderId',
@@ -12,19 +16,28 @@ exports.labOrderUpdated = {
12
16
  key: 'labOrderUpdated',
13
17
  dataPoints,
14
18
  onWebhookReceived: async ({ payload, settings }, onSuccess, onError) => {
15
- const { resource_id: updatedLabOrderId } = payload;
16
- if ((0, lodash_1.isNil)(updatedLabOrderId)) {
17
- await onError({
18
- // We should automatically send a 400 here, so no need to provide info
19
- });
20
- }
21
- else {
19
+ var _a, _b, _c;
20
+ try {
21
+ const { sdk } = await (0, createSdk_1.createSdk)({ settings });
22
+ const validatedPayload = helpers_1.webhookPayloadSchema.parse(payload);
23
+ const updatedLabOrderId = validatedPayload.resource_id.toString();
24
+ const response = await sdk.getLabOrder({ id: updatedLabOrderId });
25
+ const healthiePatientId = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.labOrder) === null || _b === void 0 ? void 0 : _b.patient) === null || _c === void 0 ? void 0 : _c.id;
22
26
  await onSuccess({
23
27
  data_points: {
24
28
  updatedLabOrderId,
25
29
  },
30
+ ...(!(0, lodash_1.isNil)(healthiePatientId) && {
31
+ patient_identifier: {
32
+ system: types_1.HEALTHIE_IDENTIFIER,
33
+ value: healthiePatientId,
34
+ },
35
+ }),
26
36
  });
27
37
  }
38
+ catch (error) {
39
+ await onError((0, errors_1.formatError)(error));
40
+ }
28
41
  },
29
42
  };
30
43
  //# sourceMappingURL=labOrderUpdated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"labOrderUpdated.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/labOrderUpdated.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAO9B,MAAM,UAAU,GAAG;IACjB,iBAAiB,EAAE;QACjB,GAAG,EAAE,mBAAmB;QACxB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA;AAElC,QAAA,eAAe,GAGxB;IACF,GAAG,EAAE,iBAAiB;IACtB,UAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QACrE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAA;QAElD,IAAI,IAAA,cAAK,EAAC,iBAAiB,CAAC,EAAE;YAC5B,MAAM,OAAO,CAAC;YACZ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AAE;wBAClB,MAAM,EAAE,2BAAmB;wBAC3B,KAAK,EAAE,iBAAiB;qBACzB;iBACF,CAAC;aACH,CAAC,CAAA;SACH;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,OAAO,CAAC,IAAA,oBAAW,EAAC,KAAK,CAAC,CAAC,CAAA;SAClC;IACH,CAAC;CACF,CAAA"}
@@ -1,11 +1,12 @@
1
1
  import { type Webhook } from '@awell-health/extensions-core';
2
2
  import { type HealthieWebhookPayload } from '../lib/types';
3
+ import { type settings } from '../settings';
3
4
  declare const dataPoints: {
4
5
  createdMessageId: {
5
6
  key: string;
6
7
  valueType: "string";
7
8
  };
8
9
  };
9
- export declare const messageCreated: Webhook<keyof typeof dataPoints, HealthieWebhookPayload>;
10
+ export declare const messageCreated: Webhook<keyof typeof dataPoints, HealthieWebhookPayload, typeof settings>;
10
11
  export type MessageCreated = typeof messageCreated;
11
12
  export {};