-
Notifications
You must be signed in to change notification settings - Fork 2
RWA-778 ensure-orders-have-encounters #6
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
base: master
Are you sure you want to change the base?
Conversation
| (`name`,`description`,`creator`,`date_created`,`uuid`) | ||
| VALUES | ||
| ( | ||
| "Drug Order Encounter","for orders without encounters",1,now(),@EncTUUID); |
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 sure that this is what we want to name this encounter type? And can the description be capitalized?
|
|
||
| /* select the unknown provider */ | ||
|
|
||
| SELECT @UnknownProvider := provider_id FROM provider WHERE uuid="6a7d7d04-f523-11e5-9ce9-5e5517507c66"; |
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.
Do we always want to use the unknown provider? Or are there cases where we'd want to use the creator's provider account?
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.
This would work if ticket RWA-805 "Ensure all orders creators are providers" is done
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.
@bjoshuadevelopment I'm not sure this is true. My understanding of what @jberchmas did in RWA-801 is to retrieve the unknown provider uuid by provider name, and then use this to set the uuid as a global property, as the uuid is different on Rwink and Butaro servers. So as written, I don't think your migration will work on both Rwink and Butaro.
I'd recommend one of two approaches:
a) Ensure your migration runs after the one in RWA-801, and change your code above to get the unknownprovider uuid from the global_property table that RWA-801 is populating.
b) Create a common function that is part of a library of functions we create before any migrations execute, and which can be used by both migration scripts to retrieve the uuid of the unknown provider (we can follow this pattern for other sql functions that might help with our migrations). eg.
create or replace function unknown_provider_uuid() as ...
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.
Considering this ticket to depend on RWA-819 where all creators of encounters will be providers
No description provided.