Versions Compared

Key

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

...

Example: (only shows this app if the user logged in with the Outpatient Clinic session location)

sessionContext.sessionLocation.uuid == '58c57d25-8d39-41ab-8422-108a0c277d98'

Hardcoding a specific uuid is not a good approach if you want your code to work across multiple OpenMRS implementations. A better approach would be to do this based on location tags, e.g. this app would only be available if the user logged in with a session location that has the "Admission Location" tag (on our demo server this would be Inpatient Ward or Isolation Ward).

hasMemberWithProperty(sessionLocation.tags, 'display', 'Admission Location')

Patient Summary and Visit Dashboard

...

Example: (only show this form for inpatients)

visit.admitted

Helper Functions

hasMemberWithProperty(list, propertyName, valueToLookFor) ... true if any item in list has item[propertyName] == valueToLookFor

See this code for full details.

Available Properties

sessionContext

...

See this code for full details.