-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(fix) make visit information available within expression context #269
Conversation
@@ -42,7 +42,7 @@ interface EncounterFormProps { | |||
formSessionDate: Date; | |||
provider: string; | |||
location: SessionLocation; | |||
visit?: Visit; | |||
visit: Visit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we now making the visit mandatory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, since it is now not being passed as a prop but rather being fetched within the root component, it wouldn't make sense to have it as optional anymore yet it is always available.
src/form-engine.test.tsx
Outdated
visit={visit} | ||
/>, | ||
); | ||
render(<FormEngine formJson={formJson} formUUID={formUUID} patientUUID={patientUUID} formSessionIntent={intent} />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if its RDE? How do you know the visit to use if the visit uuid or visit is not passed as a prop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not entirely sure what RDE is, please explain. For the second part, currently I am picking the current visit.
@samuelmale This doesn't seem to be the case from my side. Could you show how to replicate your findings above? |
@arodidev I didn't understand why it is necessary for the form-engine to load the visit by itself; what are the issues with the current setup? |
Well, considering we are getting the visit from the |
Ideally, I think the form engine wouldn't be calling |
…-lib into adding-visit-type-uuid
…-lib into adding-visit-type-uuid
@@ -60,6 +64,7 @@ export function evaluateExpression( | |||
sex, | |||
age, | |||
HD, | |||
visitTypeUuid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add this to the evaluateAsyncExpression
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done @samuelmale
* MVP * Cleanup * Adapt tests to new format * revert to visit as a prop * remove unnecessary visit * expand context for async-exp
Requirements
Summary
This PR aims to provide visit information (
visitTypeUuid
) to the expression context to be used for expression evaluation.Screenshots
Related Issue
Other