Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Age:

    1. $patient.getAge() > 5 checks if the patient is older than 5 years.

    2. $patient.getAgeInMonths() < 3 checks if the patient is less than 3 months.

    3. $patient.getAgeInWeeks() < 12 checks if the patient is less than 12 weeks.

    4. $patient.getAgeInDays() < 10 checks if the patient is less than 10 days.

    5. $patient.getAge() > 18 && $patient.getAge() < 70 checks if the patient is between the age of 18 and 70 years.

  2. Gender:

    1. $patient.getGender().equals("M") checks if the patient is male.

    2. $patient.getGender().equals("M") || $patient.getGender().equals("F") checks if the patient is male OR female.

  3. Age & Gender:

    1. $patient.getGender().equals("F") && $patient.getAge() > 18 checks if the patient is a female older than 18 years.

    2. $patient.getGender().equals("M") || $patient.getAge() > 20 checks if the patient is either a male or is older than 20 years.

  4. Observation Value:

    1. $fn.getLatestObsByConcept("CIEL:1234").getValueText().equals("PREGNANT") checks if the patient has a recent observation indicating pregnancy.

    2. $fn.getLatestObsByConcept("2a86e48c-76ef-479f-815f-d7c1701e8fb7").getValueBoolean() == true checks if the patient
      Note:

      1. CIEL:1234 used in example a) is concept mapping while 2a86e48c-76ef-479f-815f-d7c1701e8fb7 used in example b) is concept’s uuid.

      2. The method called after getLatestObsByConcept() expression depends on the data type of the concept passed in the parameter. For instance in example a) above, the concepts data type is text while in example b) the data type is boolean.
        - $fn.getLatestObsByConcept("CIEL:1234").getValueNumeric() for value numeric
        - $fn.getLatestObsByConcept("CIEL:1234").getValueCoded() for value coded

  5. Time of the day:

    1. $fn.getTimeOfTheDay() == 14 checks if the (current) time of the the day at the time of creating the Observation is the specified time in the criteria. In our example, the expression checks if the time of the day is 2pm. Note that getTimeOfTheDay() returns the hour of the day in 24hr format.

  6. Person Attributes:
    Note that you person attributes need to be set. Therefore make sure that person attributes are set for the attribute expressions to work. Find more on how to manage person attributes here.

    1. $patient.getAttribute("Ethnicity").getValue() == "Maasai" check if there is the person is of Maasai ethnicity. The ‘Maasai’ in this example is the attribute value while the ‘Ethnicity’ is attribute type.

  7. Complex Criteria reference:

    1. ($patient.getGender().equals("F") && $patient.getAge() > 18) || ($patient.getGender().equals("M") && $patient.getAge() < 18) checks the patient is either a female older than 18 years or a male who is less than 18 years of age.

    2. $patient.getAge() >= 1 && $patient.getAge() <= 3 evaluates to true if the patient is one, two or 3 years old.

    3. You can come up with criteria expressions using the values of the current Obs. For example:-

      1. BMI - criteria expression would require the use of formula. If person’s weight and height are in kg and cm, then the formula would be weight/ ((1/100 x height) power 2) or weight/ ((1/100 x height) x (1/100 x height)). Here is an example of an expression that will return true if BMI is greater than 25.
        "($fn.getCurrentObs("c607c80f-1ea9-4da3-bb88-6276ce8868dd", $obs).getValueNumeric() / (($fn.getCurrentObs("a09ab2c5-878e-4905-b25d-5784167d0216", $obs).getValueNumeric() / 100) * ($fn.getCurrentObs("a09ab2c5-878e-4905-b25d-5784167d0216", $obs).getValueNumeric() / 100))) > 25"

        Note: c607c80f-1ea9-4da3-bb88-6276ce8868dd is the uuid(conceptRef) for weight concept and a09ab2c5-878e-4905-b25d-5784167d0216 is the uuid(conceptRef) for height concept.

Strict Ranges

In the case where multiple concept reference ranges are evaluated to true, then we use the strictest range.

...