-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a new "lab order signed" timer in the elation extension (#577)
* chore: bump extensions core to latest version * feat(elation): create new experimental lab order signed timer
- Loading branch information
1 parent
cd0ba46
commit f98b609
Showing
10 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file renamed
BIN
+168 KB
...core-npm-1.0.17-4123e8eae8-6395df02c0.zip → ...core-npm-1.0.18-682857dd76-f65aaf1c89.zip
Binary file not shown.
Binary file removed
BIN
-122 KB
.yarn/cache/@parcel-watcher-darwin-arm64-npm-2.4.1-7294eb72cd-10.zip
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { labOrderSigned } from './labOrderSigned' | ||
|
||
export const timers = [labOrderSigned] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { type Timer } from '@awell-health/extensions-core' | ||
import { isNil } from 'lodash' | ||
import { type ElationWebhookPayload } from './types' | ||
|
||
export const labOrderSigned: Timer = { | ||
type: 'resource_updated', | ||
key: 'lab_order.signed', | ||
action_key: 'createLabOrder', | ||
description: 'Wait for lab order to be signed', | ||
resource_id: { | ||
type: 'extension_data_point', | ||
key: 'labOrderId', | ||
}, | ||
evaluate: (input: unknown) => { | ||
const payload = input as ElationWebhookPayload | ||
const { data: labOrder, action } = payload | ||
return ( | ||
action === 'saved' && | ||
payload.resource === 'lab_orders' && | ||
!isNil(labOrder.signed_by) && | ||
!isNil(labOrder.signed_date) | ||
) | ||
}, | ||
extractResourceId: (input: unknown) => { | ||
const payload = input as ElationWebhookPayload | ||
return payload.data.id | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface ElationWebhookPayload { | ||
action: string | ||
data: { id: string; patient?: number } & Record<string, unknown> | ||
resource: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters