Page tree

Versions Compared

Key

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

...

  • fn.logic(String logicExpression)
    • evaluates a logic expression, and returns an org.openmrs.logic.Result
    • since 1.7.0
    • Example
      Code Block
      Latest BMI: <lookup expression="fn.logic('BMI')"/> <!-- requires that you have a BMI rule registered -->
      
  • fn.allObs(Integer conceptId)
    • returns all the patient's observations for the given concept id, as a List<Obs>
    • since 1.7.0
    • Example
      Code Block
      Past CD4 results: <lookup complexExpression="#foreach($cd4 in $fn.allObs(5497)) $cd4.valueNumeric #end"/>
      
  • fn.latestObs(Integer conceptId)
    • returns the patient's most recent observation for the given concept id (most recent ever and not in relation to this encounter's date)
    • since 1.7.0
    • Example
      Code Block
      Last Weight: <lookup expression="fn.latestObs(5089)"/>
      
      Last BMI: <lookup complexExpression="#set( $wt = $fn.latestObs(5089) ) #set( $ht = $fn.latestObs(5090) ) #set( $bmi = $wt / ($ht * $ht) ) $!{bmi}"/>
      
  • fn.earliestObs(Integer conceptId)
    • returns the patient's earliest observation for the given concept id
    • since 1.7.0
    • Example
      Code Block
      First Weight: <lookup expression="fn.earliestObs(5089)"/>
      
  • fn.allEncounters(EncounterType type)
    • returns all the patient's encounters for the given encounter type ( or all the patient's encounters if given a null parameter), as a List<Encounter>
    • since 1.7.4
    • Example   
      Code Block
      
      Past Encounter Dates: <lookup complexExpression="#foreach($encounter in $fn.allEncounters(null)) $encounter.encounterDatetime #end"/>
      

...