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

Add Drug Ingredients to API

    XMLWordPrintable

    Details

    • Complexity:
      Medium

      Description

      OpenMRS includes a domain object and hibernate mapping for DrugIngredient, but we've never actually used this in the API. We need to improve the domain object slightly, and start using it.

      Changes to DrugIngredient class (and database table and hibernate mapping):

      • change "drug" property to be a Drug, not a concept (should be required)
      • leave "ingredient" property as is (should be required)
      • add property: Double quantity (optional)
      • add property: Concept units (optional)

      Add to Drug:

      • Set<DrugIngredient> ingredients

      Add to ConceptService:

      • getDrugsByIngredient(Concept) returns List<Drug>
        • should return any drug with the given concept as its concept or as the concept of any of its ingredients. I.e. getDrugsByIngredient(amoxicillin) should return both amoxicillin itself (drug.concept = amoxicillan) and augmentin (drug.ingredients[0].ingredient = amoxicillin)

      Add to OrderService: (re-think the precise method after Order Entry work begins)

      • getDrugOrdersByPatientAndIngredient(Patient, Concept) returns List<DrugOrder>
        • should also find orders whose drug doesn't explicitly list the ingredient, but is the ingredient, as in the amoxicillin example above

      Further:

      • the user interface for Manage Drugs needs to allow specifying the ingredients
        • this is optional--drugs that don't explicitly list ingredients are implied to be made exclusively of one ingredient, of (drug.concept, drug.doseStrength, drug.units).

      (These changes do not need to be backwards-compatible, since use of this domain object has never been supported.)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              raff Rafal Korytkowski
              Reporter:
              darius Darius Jazayeri [X] (Inactive)
              Designated Committer:
              Rafal Korytkowski
              Votes:
              2 Vote for this issue
              Watchers:
              15 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: