Details
-
Sub-task
-
Status: Closed
-
Must
-
Resolution: Fixed
-
None
-
Low
-
Order Entry 1.10 Iteration 2, Order Entry 1.10 Iteration 3
Description
- Add liquibase changeset(s) to convert the datatype of drug_order.frequency to int (fk to order_frequency.order_frequency_id)
- Auto generate order frequencies for all existing text frequencies as mapped by the OpenmrsConstants.GP_ORDER_ENTRY_UNITS_TO_CONCEPTS_MAPPINGS global property.
- Add another changeset to convert existing frequencies to match respective entries in order_frequency table via the OpenmrsConstants.GP_ORDER_ENTRY_UNITS_TO_CONCEPTS_MAPPINGS global property.
- Add a separate changeset to add the fk constraint from drug_order.frequency to order_frequency.order_frequency_id
- Change DrugOrder.frequency to be of type OrderFrequency, deprecate the old setters/getters and delegate to the new ones, you will need to add some logic to the old getters/setters that returns a meaningful string value as the frequency using the OrderFrequency property
- Update Order.hbm.xml(see joined-subclass tag that maps to DrugOrder) file to match the changes above.
- Update DrugOrder.copyHelper() to take care of the new properties
DEV NOTES:
- See an example of how to add to do the conversion via a custom changeset at 2e3c7cf50dfe292f3915afe61aeb9650c84714ef
- You can use DatabaseUtil.getConceptIdForUnits(..) to fetch the conceptId from the global property value
Gliffy Diagrams
Attachments
Issue Links
- depends on
-
TRUNK-4159 Add OrderFrequency to the data model
-
- Closed
-
- relates to
-
TRUNK-4052 Add a way to test liquibase changesets
-
- Closed
-