Conversation
kennyEung
reviewed
Jan 25, 2023
Contributor
|
The Linter is throwing a couple of warning messages that would seem useful to resolve. Though not critical. |
46378da to
6aa3b82
Compare
39db756 to
4ca10e0
Compare
kennyEung
approved these changes
Jan 26, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
This adds some basic prefetch hydration to the REMS CRD app. The prefetch hydration checks to see which prefetch elements are missing, then uses the definition of the hook to make the requests for prefetch data itself with the EHR url present in the hook it receives.
Possible next steps might include allowing the hydration app to accept different types of hooks. For example, if we wanted to add order-select, there would need to be some logic to check the type of hook received, and based on that, send the correct prefetch structure to the hydrator.
To see this in action, you will need to use the branch of similar name on request-generator
hydrate-prefetchwhich includes a change to removerequestfrom the prefetch. This is because, technically, the prefetch token used in the request is not valid according to the CDS hooks specification. Prefetch tokens are only allowed to be one level deep, which means something likecontext.draftOrders.medicationRequestis not valid. To access this information, we would need to redefine the definition of ourrems-order-signhook to includemedicationRequestIdas a top-level property of thecontextobject. Or we just need to search through the draftOrders for the information we want.With the correct branch of the request generator, you can send a request without a prefetch by opening settings and unselecting the "include prefetch" option. This will send a hook with no prefetch element, and CRD will instead hydrate it itself, resulting in the prefetch still having the appropriate resources.
Issue ticket number and Jira link
REMS-260
Checklist before requesting a review
devnot main (the only exception to this is releases fromdevand hotfix branches)Checklist for conducting a review
Workflow
Owner of the Pull Request will be responsible for merge after all requirements are met, including approval from at least one reviewer. Additional changes made after a review will dismiss any approvals and require re-review of the additional updates. Auto merging can be enabled below if additional changes are likely not to be needed. The bot will auto assign reviewers to your Pull Request for you.