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

Add a setDosing method to DrugOrder that takes a DosingInstruction type

    XMLWordPrintable

Details

    Description

      TODOs:

      • Add the interface and classes that implemented it as shown below:
        DosingInstructions
        interface DosingInstructions {
          /* Report the type of dosing instructions */
          DosingType getType();
        
          /* Get human-readable version of dosing instructions for a particular locale
           * Note that not all dosing instructions can be localized, so the result, especially
           * any free text may remain in the original language.  In general, we expect that
           * most implementations will write orders in a single language and then want to
           * translate instructions to the patient's preferred language when printing orders
           * for the patient.  In all other cases, you will want to call this method with
           * the user's locale (i.e., <tt>context.getLocale()</tt>).
           */
          String getDosingInstructionsAsString(Locale locale);
        
          /* Serialize dosing instructions into order */
          void setDosingInstructions(DrugOrder order);
        
          /* Get dosing instructions from order */
          DosingInstructions getDosingInstructions(DrugOrder order);
        }
        
        SimpleDosingInstructions
        class SimpleDosingInstructions implements DosingInstructions {
          DosingType type = SIMPLE;
          Double dose;
          Concept doseUnits;
          Concept route;
          OrderFrequency frequency;
          Double duration;
          Concept durationUnits;
          Boolean asNeeded;
          String asNeededCondition;
          String administrationInstructions;
        }
        
        FreeTextDosingInstructions
        class FreeTextDosingInstructions implements DosingInstructions {
          DosingType type = FREE_TEXT;
          String instructions;
        }
        
      • Add setDosing(DosingInstruction dosing) method to DrugOrder which should copy the fields from the passed in DosingInstructions object and set them on the DrugOrder instance as shown below:
        public void setDosing(DosingInstructions di) {
            di.setFieldsOn(this);
        }
        

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                harsha89 Harsha Kumara
                wyclif Wyclif Luyima
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Time Tracking

                    Estimated:
                    Original Estimate - 5 hours
                    5h
                    Remaining:
                    Time Spent - 3 hours Remaining Estimate - 30 minutes
                    30m
                    Logged:
                    Time Spent - 3 hours Remaining Estimate - 30 minutes Time Not Required
                    3h