Skip to content
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

TRUNK-4287: Add order_type column to orders table #731

Closed
wants to merge 8 commits into from
Closed

TRUNK-4287: Add order_type column to orders table #731

wants to merge 8 commits into from

Conversation

coldcue
Copy link
Contributor

@coldcue coldcue commented Mar 6, 2014

  • Add a required order_type column to the orders table
  • Add orderType field to Order class and update Order.hbm.xml file
  • Set order_type column for existing orders, use the order types added by TRUNK-4292
  • Update OrderService.getOrders(...) and OrderService.getActiveOrders(...) should use OrderType as a parameter, not a java class
  • Change the equivalent methods in the DAO to filter on orderType because to prior to this we ere passing in the Order class object to the DAO to be the root entity for the criteria object.
  • Add a test to Database1_9To1_10UpgradeTest to ensure the changesets are doing the right thing

@@ -152,8 +144,8 @@
* @return list of Orders matching the parameters
*/
@Authorized(PrivilegeConstants.VIEW_ORDERS)
public <Ord extends Order> List<Ord> getOrders(Class<Ord> orderClassType, List<Patient> patients,
List<Concept> concepts, List<User> orderers, List<Encounter> encounters);
public <Ord extends Order> List<Ord> getOrders(OrderType orderType, List<Patient> patients, List<Concept> concepts,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to declare the type boundary anymore, should return a list of Orders

@wluyima
Copy link
Member

wluyima commented Mar 6, 2014

The rest of changes looks fine to me for now

@coldcue
Copy link
Contributor Author

coldcue commented Mar 12, 2014

Now, I have time to do it today, but there's one thing not clear to me, how should I decide, that which OrderType is associated to an Order by default? Is it appropriate like this, because as I saw, the order_type_id field is removed previously in the changeset and there's no information about the type of an order?

@coldcue
Copy link
Contributor Author

coldcue commented Mar 12, 2014

Should I be more precise with the orders.order_type = 1? Something like inline select?

… orders with a matching row in the test_order or drug_order table of their type

<changeSet id="201403111039-TRUNK-4287-2" author="andras-szell" failOnError="true">
<preConditions onFail="MARK_RAN">
<not><columnExists tableName="orders" columnName="order_type_id"/></not>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this column is named order_type in the changeset above, did you test it?

@wluyima
Copy link
Member

wluyima commented Mar 13, 2014

This code isn't compiling

@coldcue
Copy link
Contributor Author

coldcue commented Mar 13, 2014

Yes, because I had to update the OrderService interface 338c964 which is dependent by many objects and so incompatible

@wluyima
Copy link
Member

wluyima commented Mar 13, 2014

Merged at 3303068

@wluyima wluyima closed this Mar 13, 2014
@coldcue coldcue deleted the TRUNK-4287 branch March 14, 2014 22:35
RandilaP pushed a commit to RandilaP/openmrs-core that referenced this pull request Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants