@awell-health/awell-extensions 2.0.49 → 2.0.50

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,6 @@ exports.addIdentifierToPatient = void 0;
4
4
  const extensions_core_1 = require("@awell-health/extensions-core");
5
5
  const config_1 = require("./config");
6
6
  const zod_1 = require("zod");
7
- const lodash_1 = require("lodash");
8
7
  exports.addIdentifierToPatient = {
9
8
  key: 'addIdentifierToPatient',
10
9
  category: extensions_core_1.Category.WORKFLOW,
@@ -23,47 +22,74 @@ exports.addIdentifierToPatient = {
23
22
  payload,
24
23
  });
25
24
  const sdk = await helpers.awellSdk();
26
- const patient = await sdk.orchestration.query({
25
+ const { patientByIdentifier: { patient: existingPatient }, } = await sdk.orchestration.query({
27
26
  patientByIdentifier: {
28
- __args: {
29
- system,
30
- value,
31
- },
27
+ __args: { system, value },
32
28
  patient: {
33
29
  id: true,
30
+ profile: { identifier: { system: true, value: true } },
34
31
  },
35
32
  },
36
33
  });
37
- const patientAlreadyExists = !(0, lodash_1.isNil)((_a = patient.patientByIdentifier.patient) === null || _a === void 0 ? void 0 : _a.id);
38
- const isCurrentPatient = patientAlreadyExists
39
- ? ((_b = patient.patientByIdentifier.patient) === null || _b === void 0 ? void 0 : _b.id) === patientId
40
- : false;
41
- /**
42
- * If a patient with the identifier already exists and it's the current patient,
43
- * do nothing. The identifier is already in place, trying to add it again will
44
- * throw an error
45
- */
46
- if (patientAlreadyExists && isCurrentPatient) {
47
- await onComplete();
34
+ const patientExists = Boolean(existingPatient === null || existingPatient === void 0 ? void 0 : existingPatient.id);
35
+ const isCurrentPatient = patientExists && (existingPatient === null || existingPatient === void 0 ? void 0 : existingPatient.id) === patientId;
36
+ if (patientExists && !isCurrentPatient) {
37
+ await onError({
38
+ events: [
39
+ {
40
+ date: new Date().toISOString(),
41
+ text: {
42
+ en: `Another patient (${String(existingPatient === null || existingPatient === void 0 ? void 0 : existingPatient.id)}) already has an identifier with system ${system} and value ${value}. Adding this identifier to the current patient is not possible.`,
43
+ },
44
+ },
45
+ ],
46
+ });
47
+ return;
48
+ }
49
+ // Filter identifiers, excluding any with the current system
50
+ const existingIdentifiers = (_b = (_a = existingPatient === null || existingPatient === void 0 ? void 0 : existingPatient.profile) === null || _a === void 0 ? void 0 : _a.identifier) !== null && _b !== void 0 ? _b : [];
51
+ const otherIdentifiers = existingIdentifiers.filter((id) => id.system !== system);
52
+ const previousIdentifier = existingIdentifiers.find((id) => id.system === system);
53
+ const isUpdatingIdentifier = Boolean(previousIdentifier);
54
+ if (isUpdatingIdentifier && (previousIdentifier === null || previousIdentifier === void 0 ? void 0 : previousIdentifier.value) === value) {
55
+ await onComplete({
56
+ events: [
57
+ {
58
+ date: new Date().toISOString(),
59
+ text: {
60
+ en: 'Patient already had an identifier of the same value and system. No changes were made.',
61
+ },
62
+ },
63
+ ],
64
+ });
48
65
  return;
49
66
  }
67
+ // Perform update or add the new identifier
50
68
  await sdk.orchestration.mutation({
51
- addIdentifierToPatient: {
69
+ updatePatient: {
52
70
  __args: {
53
71
  input: {
54
72
  patient_id: patientId,
55
- identifier: {
56
- system,
57
- value,
73
+ profile: {
74
+ identifier: [...otherIdentifiers, { system, value }],
58
75
  },
59
76
  },
60
77
  },
61
- patient: {
62
- id: true,
63
- },
78
+ patient: { id: true },
64
79
  },
65
80
  });
66
- await onComplete();
81
+ await onComplete({
82
+ events: [
83
+ {
84
+ date: new Date().toISOString(),
85
+ text: {
86
+ en: isUpdatingIdentifier
87
+ ? `The patient already had an identifier with system ${system} and value ${String(previousIdentifier === null || previousIdentifier === void 0 ? void 0 : previousIdentifier.value)}. The identifier value has been updated to ${value}.`
88
+ : `The identifier with system ${system} and value ${value} has been added to the patient.`,
89
+ },
90
+ },
91
+ ],
92
+ });
67
93
  },
68
94
  };
69
95
  //# sourceMappingURL=addIdentifierToPatient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"addIdentifierToPatient.js","sourceRoot":"","sources":["../../../../../../extensions/awell/v1/actions/addIdentifierToPatient/addIdentifierToPatient.ts"],"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H,IAAI,oBAAoB,IAAI,gBAAgB,EAAE;YAC5C,MAAM,UAAU,EAAE,CAAA;YAClB,OAAM;SACP;QAED,MAAM,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC;YAC/B,sBAAsB,EAAE;gBACtB,MAAM,EAAE;oBACN,KAAK,EAAE;wBACL,UAAU,EAAE,SAAS;wBACrB,UAAU,EAAE;4BACV,MAAM;4BACN,KAAK;yBACN;qBACF;iBACF;gBACD,OAAO,EAAE;oBACP,EAAE,EAAE,IAAI;iBACT;aACF;SACF,CAAC,CAAA;QAEF,MAAM,UAAU,EAAE,CAAA;IACpB,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"addIdentifierToPatient.js","sourceRoot":"","sources":["../../../../../../extensions/awell/v1/actions/addIdentifierToPatient/addIdentifierToPatient.ts"],"names":[],"mappings":";;;AAEA,mEAAkE;AAClE,qCAKiB;AACjB,6BAAuB;AAEV,QAAA,sBAAsB,GAA2C;IAC5E,GAAG,EAAE,wBAAwB;IAC7B,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,2BAA2B;IAClC,WAAW,EAAE,+CAA+C;IAC5D,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAiB,EAAE;;QAC1E,MAAM,EACJ,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EACzB,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,GAC3B,GAAG,IAAA,0BAAQ,EAAC;YACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,MAAM,EAAE,+BAAsB;gBAC9B,OAAO,EAAE,gCAAuB;aACjC,CAAC;YACF,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAA;QAEp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EAAE,CAAC,MAAM,KAAK,MAAM,CAC7B,CAAA;QACD,MAAM,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;QAExD,IAAI,oBAAoB,IAAI,CAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,KAAK,MAAK,KAAK,EAAE;YAC/D,MAAM,UAAU,CAAC;gBACf,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBAC9B,IAAI,EAAE;4BACJ,EAAE,EAAE,uFAAuF;yBAC5F;qBACF;iBACF;aACF,CAAC,CAAA;YACF,OAAM;SACP;QAED,2CAA2C;QAC3C,MAAM,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC;YAC/B,aAAa,EAAE;gBACb,MAAM,EAAE;oBACN,KAAK,EAAE;wBACL,UAAU,EAAE,SAAS;wBACrB,OAAO,EAAE;4BACP,UAAU,EAAE,CAAC,GAAG,gBAAgB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;yBACrD;qBACF;iBACF;gBACD,OAAO,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE;aACtB;SACF,CAAC,CAAA;QAEF,MAAM,UAAU,CAAC;YACf,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;oBAC9B,IAAI,EAAE;wBACJ,EAAE,EAAE,oBAAoB;4BACtB,CAAC,CAAC,qDAAqD,MAAM,cAAc,MAAM,CAC7E,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,KAAK,CAC1B,8CAA8C,KAAK,GAAG;4BACzD,CAAC,CAAC,8BAA8B,MAAM,cAAc,KAAK,iCAAiC;qBAC7F;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -3,53 +3,375 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tests_1 = require("@/tests");
4
4
  const addIdentifierToPatient_1 = require("./addIdentifierToPatient");
5
5
  const extensions_core_1 = require("@awell-health/extensions-core");
6
- /**
7
- * Test needs to be fixed
8
- */
9
6
  jest.mock('@awell-health/awell-sdk');
10
7
  describe('Add identifier to patient', () => {
11
- const { onComplete, onError, extensionAction, clearMocks } = extensions_core_1.TestHelpers.fromAction(addIdentifierToPatient_1.addIdentifierToPatient);
12
- const helpers = {
13
- httpsAgent: jest.fn(),
14
- awellSdk: jest.fn().mockImplementation(async () => {
15
- return {
16
- orchestration: {
17
- query: jest.fn().mockImplementation(async () => {
18
- return {
8
+ const { onComplete, onError, extensionAction, helpers, clearMocks } = extensions_core_1.TestHelpers.fromAction(addIdentifierToPatient_1.addIdentifierToPatient);
9
+ beforeEach(() => {
10
+ clearMocks();
11
+ });
12
+ describe('No patient with the provided identifier system and value exists', () => {
13
+ describe('Current patient does already have an identifier of the same system but a different value', () => {
14
+ test('Should update the provided identifier system with the new identifier value', async () => {
15
+ /**
16
+ * Mocking the SDK's response to simulate a scenario where the current patient
17
+ * already has an identifier with the same system but a different value
18
+ */
19
+ const awellSdkMock = {
20
+ orchestration: {
21
+ mutation: jest.fn().mockResolvedValue({}),
22
+ query: jest.fn().mockResolvedValue({
19
23
  patientByIdentifier: {
20
24
  patient: {
21
25
  id: 'some-patient-id',
26
+ profile: {
27
+ identifier: [
28
+ {
29
+ system: 'https://www.system.com/',
30
+ value: 'existingIdentifierValue',
31
+ },
32
+ ],
33
+ },
22
34
  },
23
35
  },
24
- };
36
+ }),
37
+ },
38
+ };
39
+ helpers.awellSdk = jest.fn().mockResolvedValue(awellSdkMock);
40
+ // Simulate an event where a new identifier value is provided for an existing system
41
+ await extensionAction.onEvent({
42
+ payload: (0, tests_1.generateTestPayload)({
43
+ fields: {
44
+ system: 'https://www.system.com/',
45
+ value: 'identifier-value',
46
+ },
47
+ settings: {},
48
+ patient: {
49
+ id: 'some-patient-id',
50
+ },
25
51
  }),
26
- },
27
- };
28
- }),
29
- };
30
- beforeEach(() => {
31
- clearMocks();
32
- Object.values(helpers).forEach((mock) => mock.mockClear());
52
+ onComplete,
53
+ onError,
54
+ helpers,
55
+ });
56
+ expect(onComplete).toHaveBeenCalledWith({
57
+ events: [
58
+ {
59
+ date: expect.any(String),
60
+ text: {
61
+ en: 'The patient already had an identifier with system https://www.system.com/ and value existingIdentifierValue. The identifier value has been updated to identifier-value.',
62
+ },
63
+ },
64
+ ],
65
+ });
66
+ expect(onError).not.toHaveBeenCalled();
67
+ });
68
+ });
69
+ describe('Current patient does not have an identifier of the same system', () => {
70
+ test('Should add the provided identifier system and value to the patient', async () => {
71
+ /**
72
+ * Mocking the SDK's response to simulate a scenario where the current patient
73
+ * does not have an identifier of the same system (but could have an identifier of a different system)
74
+ */
75
+ const awellSdkMock = {
76
+ orchestration: {
77
+ mutation: jest.fn().mockResolvedValue({}),
78
+ query: jest.fn().mockResolvedValue({
79
+ patientByIdentifier: {
80
+ patient: {
81
+ id: 'some-patient-id',
82
+ profile: {
83
+ identifier: [
84
+ {
85
+ system: 'https://www.another-system.com/',
86
+ value: 'value',
87
+ },
88
+ ],
89
+ },
90
+ },
91
+ },
92
+ }),
93
+ },
94
+ };
95
+ helpers.awellSdk = jest.fn().mockResolvedValue(awellSdkMock);
96
+ // Simulate an event where a new identifier system and value is provided
97
+ await extensionAction.onEvent({
98
+ payload: (0, tests_1.generateTestPayload)({
99
+ fields: {
100
+ system: 'https://www.system.com/',
101
+ value: 'newIdentifierValue',
102
+ },
103
+ settings: {},
104
+ patient: {
105
+ id: 'some-patient-id',
106
+ },
107
+ }),
108
+ onComplete,
109
+ onError,
110
+ helpers,
111
+ });
112
+ expect(onComplete).toHaveBeenCalledWith({
113
+ events: [
114
+ {
115
+ date: expect.any(String),
116
+ text: {
117
+ en: 'The identifier with system https://www.system.com/ and value newIdentifierValue has been added to the patient.',
118
+ },
119
+ },
120
+ ],
121
+ });
122
+ expect(onError).not.toHaveBeenCalled();
123
+ });
124
+ });
125
+ });
126
+ describe('A patient with the provided identifier system and value already exists', () => {
127
+ describe('Existing patient is the current patient', () => {
128
+ describe('The new identifier value is the same as the existing value', () => {
129
+ test('It should not update the patient', async () => {
130
+ /**
131
+ * Mocking the SDK's response to simulate a scenario where the current patient
132
+ * already has an identifier of the same system and value
133
+ */
134
+ const awellSdkMock = {
135
+ orchestration: {
136
+ mutation: jest.fn().mockResolvedValue({}),
137
+ query: jest.fn().mockResolvedValue({
138
+ patientByIdentifier: {
139
+ patient: {
140
+ id: 'some-patient-id',
141
+ profile: {
142
+ identifier: [
143
+ {
144
+ system: 'https://www.system.com/',
145
+ value: 'existingIdentifierValue',
146
+ },
147
+ ],
148
+ },
149
+ },
150
+ },
151
+ }),
152
+ },
153
+ };
154
+ helpers.awellSdk = jest.fn().mockResolvedValue(awellSdkMock);
155
+ // Simulate an event where an existing identifier system is updated to the same value
156
+ await extensionAction.onEvent({
157
+ payload: (0, tests_1.generateTestPayload)({
158
+ fields: {
159
+ system: 'https://www.system.com/',
160
+ value: 'existingIdentifierValue', // The new value is equal to the existing value
161
+ },
162
+ settings: {},
163
+ patient: {
164
+ id: 'some-patient-id',
165
+ },
166
+ }),
167
+ onComplete,
168
+ onError,
169
+ helpers,
170
+ });
171
+ expect(onComplete).toHaveBeenCalledWith({
172
+ events: [
173
+ {
174
+ date: expect.any(String),
175
+ text: {
176
+ en: 'Patient already had an identifier of the same value and system. No changes were made.',
177
+ },
178
+ },
179
+ ],
180
+ });
181
+ expect(onError).not.toHaveBeenCalled();
182
+ });
183
+ });
184
+ describe('The new identifier value is different from the existing value', () => {
185
+ test('It should update the identifier to the new value', async () => {
186
+ /**
187
+ * Mocking the SDK's response to simulate a scenario where the current patient
188
+ * already has an identifier of the same system and value
189
+ */
190
+ const awellSdkMock = {
191
+ orchestration: {
192
+ mutation: jest.fn().mockResolvedValue({}),
193
+ query: jest.fn().mockResolvedValue({
194
+ patientByIdentifier: {
195
+ patient: {
196
+ id: 'some-patient-id',
197
+ profile: {
198
+ identifier: [
199
+ {
200
+ system: 'https://www.system.com/',
201
+ value: 'existingIdentifierValue',
202
+ },
203
+ ],
204
+ },
205
+ },
206
+ },
207
+ }),
208
+ },
209
+ };
210
+ helpers.awellSdk = jest.fn().mockResolvedValue(awellSdkMock);
211
+ // Simulate an event where an existing identifier system is updated to a new value
212
+ await extensionAction.onEvent({
213
+ payload: (0, tests_1.generateTestPayload)({
214
+ fields: {
215
+ system: 'https://www.system.com/',
216
+ value: 'newIdentifierValue', // The new value is different from the existing value
217
+ },
218
+ settings: {},
219
+ patient: {
220
+ id: 'some-patient-id',
221
+ },
222
+ }),
223
+ onComplete,
224
+ onError,
225
+ helpers,
226
+ });
227
+ expect(onComplete).toHaveBeenCalledWith({
228
+ events: [
229
+ {
230
+ date: expect.any(String),
231
+ text: {
232
+ en: 'The patient already had an identifier with system https://www.system.com/ and value existingIdentifierValue. The identifier value has been updated to newIdentifierValue.',
233
+ },
234
+ },
235
+ ],
236
+ });
237
+ expect(onError).not.toHaveBeenCalled();
238
+ });
239
+ });
240
+ });
241
+ describe('Existing patient is not the current patient', () => {
242
+ test('It should throw an error', async () => {
243
+ /**
244
+ * Mocking the SDK's response to simulate a scenario where another patient
245
+ * already has an identifier of the same system and value
246
+ */
247
+ const awellSdkMock = {
248
+ orchestration: {
249
+ mutation: jest.fn().mockResolvedValue({}),
250
+ query: jest.fn().mockResolvedValue({
251
+ patientByIdentifier: {
252
+ patient: {
253
+ id: 'some-patient-id',
254
+ profile: {
255
+ identifier: [
256
+ {
257
+ system: 'https://www.system.com/',
258
+ value: 'existingIdentifierValue',
259
+ },
260
+ ],
261
+ },
262
+ },
263
+ },
264
+ }),
265
+ },
266
+ };
267
+ helpers.awellSdk = jest.fn().mockResolvedValue(awellSdkMock);
268
+ // Simulate an event where the action is executed for a patient different from the current one
269
+ await extensionAction.onEvent({
270
+ payload: (0, tests_1.generateTestPayload)({
271
+ fields: {
272
+ system: 'https://www.system.com/',
273
+ value: 'newIdentifierValue',
274
+ },
275
+ settings: {},
276
+ patient: {
277
+ id: 'another-patient-id', // Different patient
278
+ },
279
+ }),
280
+ onComplete,
281
+ onError,
282
+ helpers,
283
+ });
284
+ expect(onError).toHaveBeenCalledWith({
285
+ events: [
286
+ {
287
+ date: expect.any(String),
288
+ text: {
289
+ en: 'Another patient (some-patient-id) already has an identifier with system https://www.system.com/ and value newIdentifierValue. Adding this identifier to the current patient is not possible.',
290
+ },
291
+ },
292
+ ],
293
+ });
294
+ expect(onComplete).not.toHaveBeenCalled();
295
+ });
296
+ });
33
297
  });
34
- test('Should call the onComplete callback', async () => {
35
- await extensionAction.onEvent({
36
- payload: (0, tests_1.generateTestPayload)({
37
- fields: {
38
- system: 'system',
39
- value: 'value',
298
+ describe('When the patient has multiple identifiers', () => {
299
+ test('We should PATCH the new identifier and not remove existing ones', async () => {
300
+ // Mocking the SDK's response for an existing patient with multiple identifiers
301
+ const awellSdkMock = {
302
+ orchestration: {
303
+ mutation: jest.fn().mockResolvedValue({}),
304
+ query: jest.fn().mockResolvedValue({
305
+ patientByIdentifier: {
306
+ patient: {
307
+ id: 'some-patient-id',
308
+ profile: {
309
+ identifier: [
310
+ {
311
+ system: 'https://www.system-1.com/',
312
+ value: 'value-1',
313
+ },
314
+ {
315
+ system: 'https://www.system-2.com/',
316
+ value: 'value-2', // Identifier we want to update
317
+ },
318
+ {
319
+ system: 'https://www.system-3.com/',
320
+ value: 'value-3',
321
+ },
322
+ ],
323
+ },
324
+ },
325
+ },
326
+ }),
40
327
  },
41
- settings: {},
42
- patient: {
43
- id: 'some-patient-id',
328
+ };
329
+ helpers.awellSdk = jest.fn().mockResolvedValue(awellSdkMock);
330
+ // Simulate an event where a new identifier value is provided for an existing system
331
+ await extensionAction.onEvent({
332
+ payload: (0, tests_1.generateTestPayload)({
333
+ fields: {
334
+ system: 'https://www.system-2.com/',
335
+ value: 'newIdentifierValue',
336
+ },
337
+ settings: {},
338
+ patient: {
339
+ id: 'some-patient-id',
340
+ },
341
+ }),
342
+ onComplete,
343
+ onError,
344
+ helpers,
345
+ });
346
+ expect(awellSdkMock.orchestration.mutation).toHaveBeenCalledWith({
347
+ updatePatient: {
348
+ __args: {
349
+ input: {
350
+ patient_id: 'some-patient-id',
351
+ profile: {
352
+ identifier: [
353
+ // Retain existing identifiers that aren't being updated
354
+ {
355
+ system: 'https://www.system-1.com/',
356
+ value: 'value-1',
357
+ },
358
+ {
359
+ system: 'https://www.system-3.com/',
360
+ value: 'value-3',
361
+ },
362
+ // Update the identifier with the matching system to the new value
363
+ {
364
+ system: 'https://www.system-2.com/',
365
+ value: 'newIdentifierValue',
366
+ },
367
+ ],
368
+ },
369
+ },
370
+ },
371
+ patient: expect.any(Object),
44
372
  },
45
- }),
46
- onComplete,
47
- onError,
48
- helpers,
373
+ });
49
374
  });
50
- expect(true).toBe(true);
51
- // expect(onComplete).toHaveBeenCalled()
52
- // expect(onError).not.toHaveBeenCalled()
53
375
  });
54
376
  });
55
377
  //# sourceMappingURL=addIdentifierToPatient.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"addIdentifierToPatient.test.js","sourceRoot":"","sources":["../../../../../../extensions/awell/v1/actions/addIdentifierToPatient/addIdentifierToPatient.test.ts"],"names":[],"mappings":";;AAAA,mCAA6C;AAC7C,qEAAiE;AACjE,mEAA2D;AAC3D;;GAEG;AACH,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAA;AAEpC,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,GACxD,6BAAW,CAAC,UAAU,CAAC,+CAAsB,CAAC,CAAA;IAChD,MAAM,OAAO,GAAG;QACd,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;QACrB,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,IAAI,EAAE;YAChD,OAAO;gBACL,aAAa,EAAE;oBACb,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,IAAI,EAAE;wBAC7C,OAAO;4BACL,mBAAmB,EAAE;gCACnB,OAAO,EAAE;oCACP,EAAE,EAAE,iBAAiB;iCACtB;6BACF;yBACF,CAAA;oBACH,CAAC,CAAC;iBACH;aACF,CAAA;QACH,CAAC,CAAC;KACH,CAAA;IAED,UAAU,CAAC,GAAG,EAAE;QACd,UAAU,EAAE,CAAA;QACZ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,eAAe,CAAC,OAAO,CAAC;YAC5B,OAAO,EAAE,IAAA,2BAAmB,EAAC;gBAC3B,MAAM,EAAE;oBACN,MAAM,EAAE,QAAQ;oBAChB,KAAK,EAAE,OAAO;iBACf;gBACD,QAAQ,EAAE,EAAE;gBACZ,OAAO,EAAE;oBACP,EAAE,EAAE,iBAAiB;iBACtB;aACF,CAAC;YACF,UAAU;YACV,OAAO;YACP,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAEvB,wCAAwC;QACxC,yCAAyC;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"addIdentifierToPatient.test.js","sourceRoot":"","sources":["../../../../../../extensions/awell/v1/actions/addIdentifierToPatient/addIdentifierToPatient.test.ts"],"names":[],"mappings":";;AACA,mCAA6C;AAC7C,qEAAiE;AACjE,mEAA2D;AAE3D,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAA;AAEpC,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE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;iBACH;aACF,CAAA;YAED,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAA;YAE5D,oFAAoF;YACpF,MAAM,eAAe,CAAC,OAAO,CAAC;gBAC5B,OAAO,EAAE,IAAA,2BAAmB,EAAC;oBAC3B,MAAM,EAAE;wBACN,MAAM,EAAE,2BAA2B;wBACnC,KAAK,EAAE,oBAAoB;qBAC5B;oBACD,QAAQ,EAAE,EAAE;oBACZ,OAAO,EAAE;wBACP,EAAE,EAAE,iBAAiB;qBACtB;iBACF,CAAC;gBACF,UAAU;gBACV,OAAO;gBACP,OAAO;aACR,CAAC,CAAA;YAEF,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,oBAAoB,CAAC;gBAC/D,aAAa,EAAE;oBACb,MAAM,EAAE;wBACN,KAAK,EAAE;4BACL,UAAU,EAAE,iBAAiB;4BAC7B,OAAO,EAAE;gCACP,UAAU,EAAE;oCACV,wDAAwD;oCACxD;wCACE,MAAM,EAAE,2BAA2B;wCACnC,KAAK,EAAE,SAAS;qCACjB;oCACD;wCACE,MAAM,EAAE,2BAA2B;wCACnC,KAAK,EAAE,SAAS;qCACjB;oCACD,kEAAkE;oCAClE;wCACE,MAAM,EAAE,2BAA2B;wCACnC,KAAK,EAAE,oBAAoB;qCAC5B;iCACF;6BACF;yBACF;qBACF;oBACD,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;iBAC5B;aACF,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -4,7 +4,7 @@
4
4
  "changelog": "# Athena changelog"
5
5
  },
6
6
  "awell": {
7
- "readme": "---\ntitle: Awell Workflow\ndescription: Enrich your care flows with powerful Awell actions.\n---\n\n# Awell API extension\n\n## Extension settings\n\nYou will need to provide the [API URL](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/endpoints) and an [API key](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/authorization).\n\n## Custom Actions\n\n### Start care flow\n\nStarts a new care flow for the patient enrolled in your current care flow.\n\n**Passing baseline info:**\nPlease read the documentation on [our developer hub](https://developers.awellhealth.com/awell-orchestration/api-reference/mutations/start-pathway) to learn more about how to pass baseline info.\n\n**Example of how to configure a value for the baseline info action field:**\n\n```json\n[\n {\n \"data_point_definition_id\": \"age\",\n \"value\": \"29\"\n },\n {\n \"data_point_definition_id\": \"dob\",\n \"value\": \"1993-11-30\"\n }\n]\n```\n\n### Stop care flow\n\nStops the care flow the patient is currently enrolled in. A reason is why you are stopping the care flow is mandatory.\n\n### Update patient\n\nAllows updating patient data for the patient currently enrolled in the care flow.\n\n### Is patient already enrolled in care flow\n\nChecks whether the patient is already enrolled in a care flow definition. The care flow the patient is currently enrolled in does not count and is excluded from the results.\n\n**Action fields:**\n\n- pathwayStatus: a comma-separated string of care flow statuses that will be used when looking for care flows the patient is already enrolled in. By default, we only look at active care flows. Options: \"active\", \"completed\", \"missing_baseline_info\", \"starting\", and \"stopped\".\n- careFlowDefinitionIds: a comma-separated string of care flow definition ids that will be used when looking for care flows the patient is already enrolled in. By default, we only search for care flows that match the current care flow definition id (i.e. is the patient already included in the current care flow?).\n\n**Data points:**\n\n- result: a boolean indicating whether the patient is already enrolled in another care flow that matches your criteria (status & care flow definition id)\n- nbrOfResults: the number of care flows found for the patient that match the criteria.\n- careFlowIds: a comma-separated string of care flow ids that matched your search criteria. It will be empty when the result is `false` because then there are no other care flow ids that match your criteria.\n\n### Search patients by patient code\n\nNote that this action is deprecated and we recommend using [identifiers](https://developers.awellhealth.com/awell-orchestration/docs/misc/patient-identifiers) instead.\n\nSearch whether, apart from the patient currently enrolled in the care flow, another patient with the same `patient_code` already exists.\n\n**Data points:**\n\n1. patientAlreadyExists: a boolean which will be true if minimum one patient with the patient code already exists.\n2. numberOfPatientsFound: the number of patients found with the same patient code.\n3. awellPatientIds: a comma-separated string of all Awell patient ids (except the current patient) that have the same patient code as the patient currently enrolled in the care flow. Will return an empty string when there are no other patients with the same patient code.\n\n### Get patient by identifier\n\nThis action lets you check if a patient with a specific identifier already exists in Awell. It's particularly useful when a patient's identity is initially anonymous during the start of the care flow, but later becomes identifiable through the identifiers collected during the care flow. This check ensures whether a patient with that identifier is already present or not.\n\n### Add identifier to patient\n\nThis action enables adding an identifier to the current patient. We recommend using the \"Get patient by identifier\" action first to verify if a patient with that identifier already exists. If the identifier isn't already associated with another patient, it's safe to add it to the current patient. If a match is found, implementing a strategy for deduplication is advisable.\n\n## Webhooks\n\nWebhooks in the Awell extension offer ways to trigger a care flow based on the end of another care flow, or from any event that happens in your system (via the pathwayStart webhook).\n",
7
+ "readme": "---\ntitle: Awell Workflow\ndescription: Enrich your care flows with powerful Awell actions.\n---\n\n# Awell API extension\n\n## Extension settings\n\nYou will need to provide the [API URL](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/endpoints) and an [API key](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/authorization).\n\n## Custom Actions\n\n### Start care flow\n\nStarts a new care flow for the patient enrolled in your current care flow.\n\n**Passing baseline info:**\nPlease read the documentation on [our developer hub](https://developers.awellhealth.com/awell-orchestration/api-reference/mutations/start-pathway) to learn more about how to pass baseline info.\n\n**Example of how to configure a value for the baseline info action field:**\n\n```json\n[\n {\n \"data_point_definition_id\": \"age\",\n \"value\": \"29\"\n },\n {\n \"data_point_definition_id\": \"dob\",\n \"value\": \"1993-11-30\"\n }\n]\n```\n\n### Stop care flow\n\nStops the care flow the patient is currently enrolled in. A reason is why you are stopping the care flow is mandatory.\n\n### Update patient\n\nAllows updating patient data for the patient currently enrolled in the care flow.\n\n### Is patient already enrolled in care flow\n\nChecks whether the patient is already enrolled in a care flow definition. The care flow the patient is currently enrolled in does not count and is excluded from the results.\n\n**Action fields:**\n\n- pathwayStatus: a comma-separated string of care flow statuses that will be used when looking for care flows the patient is already enrolled in. By default, we only look at active care flows. Options: \"active\", \"completed\", \"missing_baseline_info\", \"starting\", and \"stopped\".\n- careFlowDefinitionIds: a comma-separated string of care flow definition ids that will be used when looking for care flows the patient is already enrolled in. By default, we only search for care flows that match the current care flow definition id (i.e. is the patient already included in the current care flow?).\n\n**Data points:**\n\n- result: a boolean indicating whether the patient is already enrolled in another care flow that matches your criteria (status & care flow definition id)\n- nbrOfResults: the number of care flows found for the patient that match the criteria.\n- careFlowIds: a comma-separated string of care flow ids that matched your search criteria. It will be empty when the result is `false` because then there are no other care flow ids that match your criteria.\n\n### Search patients by patient code\n\nNote that this action is deprecated and we recommend using [identifiers](https://developers.awellhealth.com/awell-orchestration/docs/misc/patient-identifiers) instead.\n\nSearch whether, apart from the patient currently enrolled in the care flow, another patient with the same `patient_code` already exists.\n\n**Data points:**\n\n1. patientAlreadyExists: a boolean which will be true if minimum one patient with the patient code already exists.\n2. numberOfPatientsFound: the number of patients found with the same patient code.\n3. awellPatientIds: a comma-separated string of all Awell patient ids (except the current patient) that have the same patient code as the patient currently enrolled in the care flow. Will return an empty string when there are no other patients with the same patient code.\n\n### Get patient by identifier\n\nThis action lets you check if a patient with a specific identifier already exists in Awell. It's particularly useful when a patient's identity is initially anonymous during the start of the care flow, but later becomes identifiable through the identifiers collected during the care flow. This check ensures whether a patient with that identifier is already present or not.\n\n### Add identifier to patient\n\nThis action allows you to add a unique identifier to the current patient's profile. If the patient already has an identifier with the same system but a different value, this action will update the existing identifier with the new value provided. \n\nFirst, it checks if this identifier (system and value) is already associated with another patient. If it's safe to proceed, it will add or update the identifier as needed. However, if another patient already has this identifier, the action will stop and notify you, preventing duplicates. To avoid conflicts, we recommend first running the \"Get patient by identifier\" action to check for any existing matches.\n\n## Webhooks\n\nWebhooks in the Awell extension offer ways to trigger a care flow based on the end of another care flow, or from any event that happens in your system (via the pathwayStart webhook).\n",
8
8
  "changelog": "# Awell changelog\n\n## April 2024\n\nTwo new action were added: \"Get patient by identifier\" and \"Add identifier to patient\".\n\n## October 26, 2023\n\nGeneric webhook to start a care flow added\n\n## April 19, 2023\n\nStop care flow action added.\nSearch patients by patient code action was added.\n\"Is patient enrolled in care flow\" action added.\n"
9
9
  },
10
10
  "calDotCom": {
@@ -78,12 +78,12 @@ describe('getNextDateWithinBusinessHours', () => {
78
78
  expect((0, getNextDateWithinBusinessHours_1.getNextDateWithinBusinessHours)(mockDate, timeZone)).toEqual(mockDate);
79
79
  });
80
80
  it('returns the next day at 9 AM in ISO format when the date is after working hours', () => {
81
- const mockDate = (0, date_fns_1.setHours)((0, date_fns_1.startOfDay)(new Date()), 16); // 4 PM UTC is 5 PM in Belgium and is after working hours
81
+ const mockDate = (0, date_fns_1.setHours)((0, date_fns_1.startOfDay)(new Date('2024-10-01')), 16); // 4 PM UTC is 5 PM in Belgium and is after working hours
82
82
  const expectedDate = (0, date_fns_1.setHours)((0, date_fns_1.startOfDay)((0, date_fns_1.addDays)(mockDate, 1)), 7); // should return 8 AM of the next day in UTC (which is 9 AM Belgium time)
83
83
  expect((0, getNextDateWithinBusinessHours_1.getNextDateWithinBusinessHours)(mockDate, timeZone)).toEqual(expectedDate);
84
84
  });
85
85
  it('returns today at 9 AM in ISO format when the date is before working hours', () => {
86
- const mockDate = (0, date_fns_1.setHours)((0, date_fns_1.startOfDay)(new Date()), 7); // 7 AM UTC is 8 AM in Belgum and is before working hours
86
+ const mockDate = (0, date_fns_1.setHours)((0, date_fns_1.startOfDay)(new Date('2024-10-01')), 7); // 7 AM UTC is 8 AM in Belgum and is before working hours
87
87
  const expectedDate = (0, date_fns_1.setHours)((0, date_fns_1.startOfDay)(mockDate), 7); // should return 8 AM of the same day in UTC (which is 9 AM Belgium time)
88
88
  expect((0, getNextDateWithinBusinessHours_1.getNextDateWithinBusinessHours)(mockDate, timeZone)).toEqual(expectedDate);
89
89
  });
@@ -1 +1 @@
1
- {"version":3,"file":"getNextDateWithinBusinessHours.test.js","sourceRoot":"","sources":["../../../../src/utils/getNextDateWithinBusinessHours/getNextDateWithinBusinessHours.test.ts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AAE,CAAC,CAAC,CAAA,CAAC,yDAAyD;YAC9G,MAAM,YAAY,GAAG,IAAA,mBAAQ,EAAC,IAAA,qBAAU,EAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA,CAAC,yEAAyE;YAEhI,MAAM,CAAC,IAAA,+DAA8B,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAChE,YAAY,CACb,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"getNextDateWithinBusinessHours.test.js","sourceRoot":"","sources":["../../../../src/utils/getNextDateWithinBusinessHours/getNextDateWithinBusinessHours.test.ts"],"names":[],"mappings":";;AAAA,qFAGyC;AACzC,uCAAwD;AAExD,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;YAC7D,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAA;YAC7C,MAAM,CAAC,IAAA,2DAA0B,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACrD,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;YAC9D,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAA;YAC7C,MAAM,CAAC,IAAA,2DAA0B,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACtD,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;YAC7D,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAA;YAC7C,MAAM,CAAC,IAAA,2DAA0B,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAA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E,EAAE,CAAC,CAAA,CAAC,yDAAyD;YAC3H,MAAM,YAAY,GAAG,IAAA,mBAAQ,EAAC,IAAA,qBAAU,EAAC,IAAA,kBAAO,EAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAC,yEAAyE;YAE5I,MAAM,CAAC,IAAA,+DAA8B,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAChE,YAAY,CACb,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,2EAA2E,EAAE,GAAG,EAAE;YACnF,MAAM,QAAQ,GAAG,IAAA,mBAAQ,EAAC,IAAA,qBAAU,EAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAC,yDAAyD;YAC1H,MAAM,YAAY,GAAG,IAAA,mBAAQ,EAAC,IAAA,qBAAU,EAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA,CAAC,yEAAyE;YAEhI,MAAM,CAAC,IAAA,+DAA8B,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAChE,YAAY,CACb,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "2.0.49",
3
+ "version": "2.0.50",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {