Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4302

The API should be able to assign OrderTypes

    XMLWordPrintable

    Details

      Description

      When saving an order and the orderType field is null, the API should be able to set the appropriate one based on the criteria below:

      • Look at Order.concept, and infer the OrderType based on that concept
      • Under the hood this should be done by seeing which OrderType the concepts conceptClass is mapped to, if no order type matches the class of the concept, then fail. You will need to add the methods below to OrderService because you will need to use them:
      public OrderType getOrderTypeByConceptClass(ConceptClass conceptClass);
      
      //should delegate to getOrderTypeByConceptClass by passing in the concept's concept class
      public OrderType getOrderTypeByConcept(Concept concept);  
      

      Dev Notes:

      This ticket assumes that the required service methods have been implemented already

      Scope

      If the caller tries to save an order with OrderType specified, we trust this, and do not need to validate it. This ticket only involves inferring an OrderType when none is specified.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                dkayiwa Daniel Kayiwa
                Reporter:
                wyclif Wyclif Luyima
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 1 day Original Estimate - 1 day
                    1d
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 1 day, 4 hours
                    1d 4h