Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack

Documentation

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added documentation for the new toggle attribute

...

  • drugNames: Determines which drug names appear in the list
    • REQUIRED
    • Example: <drugOrder drugNames='kaletra' />
    • Value: Comma separated list of drug id, drug name, drug UUID
    • Default: None
  • validateDose: Sets whether or not to validate the dose value (min, max of the dose)
    • OPTIONAL
    • Example: <drugOrder drugNames='kaletra' validateDose='true' />
    • Value: true or false
    • Default: false
  • instructionsLabel: Renders a text box for entering instructions for the drug order.
    • OPTIONAL
    • Example: <drugOrder drugNames="d4T 30,d4T 40" validateDose="true" instructionsLabel="Drug Order Instructions: "/>
    • Value: any text label for the instructions field
    • Default:none
  • drugLabels: This allows you to change the drug names that are displayed in the drop-down drug list. There have to be an equal number of drugLabels as drugNames to use this attribute, although validation will catch this if you forget.  
    • OPTIONAL
    • Example: <drugOrder drugNames="RIF 300,RHEZ,PZA 500,NVP Susp" drugLabels="RIF,RZ, PZ, NVP Syrup" />
    • Value: a comma-delimited set of drug names.  Names will be applied to the drugs in the drugName attribute, in order.
    • Default: none
    • NOTE: Adding Drug Type Headers to the dropdown list:  Also, I added a hacky syntax to the drugName attribute what can allow you to put drug type headers in the drugName dropdown widget. To insert a drug type header into the drug list, in the drugName list, you just insert the header with the forward-slash '/' character at the beginning and end of the drugName. For example, this is a valid tag: <drugOrder drugNames="RIF 300,RHEZ,PZA 500,/Syrups/,NVP Susp" drugLabels="RIF,RZ, PZ, NVP Syrup" hideDoseAndFrequency="true"/>. You'll notice that the drugNames attribue has 5 entries and the drugLabels attribute has only four labels. This works because the /Syrups/ isn't a real drug, so it isn't considered during validation. Finally, I've added validation that doesn't allow you to select a drug type header as a drug.
  • hideDoseAndFrequency:  Allows you to hide the dose and frequency text boxes that are rendered by the tag by default
    • OPTIONAL
    • Example: <drugOrder drugNames="RIF 300,RHEZ,PZA 500,/Syrups/,NVP Susp" drugLabels="RIF,RZ, PZ, NVP Syrup"  hideDoseAndFrequency="true"/>
    • Value: true/false
    • Default: false
    • NOTE: If this tag is used the drug order will be submitted using the drug strength from the concept drug definition. 
  • checkbox: This renders a checkbox for choosing to create a drugOrder for a single drug listed in the drugName attribute. Works nicely with the "hideDoseAndFrequency" tag above.  This tag will only be applied if there is EXACTLY one drug listed in drugName, and the select attribute is set to "true".
    • OPTIONAL
    • Example: <drugOrder drugNames="Terizidone (Trd)" drugLabels="TRD" checkbox="true" hideDoseAndFrequency="true"/>
    • Value:true/false
    • Default: false
  • discontinuedReasonConceptId: This creates a drop-down of coded reasons for discontinuing a regimen. This covers the valueCoded reason for discontinuing a regimen, and I'm currently waiting on a bug fix to 1.6+ to be able to support a text field for 'other' for discontinueReasonText.
    • OPTIONAL
    • Example: <drugOrder drugNames="d4T 30,d4T 40" validateDose="true" instructionsLabel="INSTRUCTIONS:" discontinuedReasonConceptId="1252"/>
    • Value:  a valid conceptId or uuid for the concept representing the reason for discontinuing drug question.  This concept must have conceptAnswers.
    • Default: none
  • showOrderDuration: This creates a text field that allows you to say what the duration of the order should be.  This, then, is applied as an autoExpireDate.
    • OPTIONAL
    • Example <drugOrder drugNames="Nelfinavir,Tenofovir (TDF)" showOrderDuration="true" /> 
    • Value:  true/false
    • Default: false
  • defaultDose: This sets a default dose that will be pre-entered in the drug order entry widget
    • OPTIONAL
    • Example <drugOrder drugNames="Ibuprofen" defaultDose="250"/>
    • Value: empty string or a string that can be converted to a Double
    • Default: none 

...

    • none
  • toggle: For checkbox style fields only, specify the id of a div or span that you wish to hide or disable depending on whether the checkbox is checked or not.
    • OPTIONAL
    • The toggle attribute accepts two syntaxes (see below).
      • Basic: The basic syntax simply accepts the DOM id of the target div or span:
      • Code Block
        html
        html

...

      • <obs conceptId="12" answerConceptId="116" answerLabel="Patient has a hat" style="checkbox" toggle="hatColors"/>
        
        <div id="hatColors">
           What 

...

<encounterDate>

Data entry widget for recording encounter date. Along with encounterLocation and encounterProvider, encounterDate should be present on every HTML form.

Attributes

  • default: Specifies default value for encounterDate widget.
    • OPTIONAL
    • Example: <encounterDate default="today"/>
    • Value: "today", "now", or ?????
    • Default: None
  • showTime: The showTime attribute determines if the encounterDate widget is date-only or date and time.
    • OPTIONAL
    • Example: <encounterDate showTime="true"/>
    • Value: "true" or "false"
    • Default: False - Widget is date-only
  • disallowMultipleEncountersOnDate: This will warn the user that this Form type has been entered for this Patient on this Encounter date.  This will prevent duplicate paper entries of the same form.  The mechanism for this is an ajax popup that is presented to the user after selecting an encounter date (only if there is already a form submitted of the same type for that date for that patient).
    • OPTIONAL
    • As of version 1.8.0
    • Example: <encounterDate disallowMultipleEncountersOnDate ="warn"/>
    • Value: "warn" or "block":  'warn' will only warn the user that they may be entering a duplicate form.  'block' will give the warning, and will then clear the encounterDate field, thus making the form un-submittable.
    • Default: there is no default.  You must choose one of the above.

Example Usage

...

      • color is your hat?
           <obs conceptId="101" answerConceptIds="309,374,377" answerLabels="red,green,blue" style="Radio"/><br/>
           <obs conceptId="103" answerConceptId="394" answerLabel="Hat is warm" style="checkbox" id="hatWarmInd"/>
        </div>
      • Advanced: The more advanced syntax accepts a JSON structure with the attributes: id and style. The "id" attribute is the DOM id of target div/span that you wish to hide or disable. The "style" attribute accepts either "hide" (default) or "dim". The "hide" style completely hides the target div/span until the checkbox is checked. The "dim" style greys-out and disables the child components of the target div/span until the checkbox is checked.
      • Code Block
        html
        html
        <obs conceptId="12" answerConceptId="116" answerLabel="Patient has a hat" style="checkbox" toggle="{id: 'hatColors', style: 'dim'}"/>
        
        <div id="hatColors">
           What color is your hat?
           <obs conceptId="101" answerConceptIds="309,374,377" answerLabels="red,green,blue" style="Radio"/><br/>
           <obs conceptId="103" answerConceptId="394" answerLabel="Hat is warm" style="checkbox" id="hatWarmInd"/>
        </div>
    • Version: Available since version 1.11.0

Example Usage

Code Block
html
html

<drugOrder drugNames='d80af3ef-ca9f-11de-ac93-672ba0a04471, 17, kaletra' />        <!-- a datelist of drugs is generated using UUID, ID and timedrug widgetname -->
<encounterDate<drugOrder showTime="true" default="now"/> drugNames='d80af3ef-ca9f-11de-ac93-672ba0a04471' validateDose='true'/>  <!-- adose datevalue andwill timebe widgetvalidated defaulting(min, to the time on the server max value) -->

...

<encounterDate>

Data entry widget for recording location of the encounter date. Along with encounterDate encounterLocation and encounterProvider, encounterLocation encounterDate should be present on every HTML form.

Attributes

  • default: Sets Specifies default value for the encounterDate widget.
    • OPTIONAL
    • Example: <encounterLocation <encounterDate default="2today"/>
    • Value: Location ID, Location UUID, Location Name. Since 1.9.5 we also support "GlobalProperty:xyz" and "UserProperty:xyz" where xyz is the name of a global property or user property, whose value must be equal to a legal location value using one of the supported formats."today", "now", or ?????
    • Default: None
  • order: Determines which locations appear in the list, and specifies the order in which they appearshowTime: The showTime attribute determines if the encounterDate widget is date-only or date and time.
    • OPTIONAL
    • Example: <encounterLocation order<encounterDate showTime="2,7,4true"/>
    • Value: Comma separated list of Location IDs, Location UUIDs, or Location Names
    • Default: All locations in alphabetical order
    type: Specifies the input element to display (i.e a dropdown vs autocomplete); shows a dropdown by default if type is not specified
    • Since 1.11
    • OPTIONAL
    • Example: <encounterLocation type="autocomplete"true" or "false"
    • Default: False - Widget is date-only
  • disallowMultipleEncountersOnDate: This will warn the user that this Form type has been entered for this Patient on this Encounter date.  This will prevent duplicate paper entries of the same form.  The mechanism for this is an ajax popup that is presented to the user after selecting an encounter date (only if there is already a form submitted of the same type for that date for that patient).
    • OPTIONAL
    • As of version 1.8.0
    • Example: <encounterDate disallowMultipleEncountersOnDate ="warn"/>
    • Value:   "autocomplete"
    • Default: dropdown

Example Usage

    • "warn" or "block":  'warn' will only warn the user that they may be entering a duplicate form.  'block' will give the warning, and will then clear the encounterDate field, thus making the form un-submittable.
    • Default: there is no default.  You must choose one of the above.

Example Usage

Code Block
html
html
<encounterLocation<encounterDate/>                   <!-- an initially-blank date widget -->
<encounterDate default="today"/>          <!-- a listdate ofwidget all locations, sorted alphabetically by namepre-filled with today's date -->
<encounterLocation<encounterDate defaultshowTime="2true"/>   <!-- a date and time widget -->
<encounterDate         showTime="true" default="now"/>     <!-- a listdate ofand alltime locations,widget sorteddefaulting alphabeticallyto bythe name,time withon location 2 selected by defaultthe server -->
<encounterLocation default="GlobalProperty:defLoc"/>    <!-- a list of all locations, sorted alphabetically by name, with the location specified in the "defLoc" global property selected by default -->
<encounterLocation order="2,7,4"/>                      <!-- a list of the specified locations, by id -->
<encounterLocation order="Rwinkwavu,Kirehe,Mulindi"/>   <!-- a list of the specified locations, by name -->
<encounterLocation type="autocomplete"/>

<encounterLocation>

Data entry widget for recording location of the encounter. Along with encounterDate and encounterProvider, encounterLocation should be present on every HTML form.

Attributes

  • default: Sets default value for the widget.
    • OPTIONAL
    • Example: <encounterLocation default="2"/>
    • Value: Location ID, Location UUID, Location Name. Since 1.9.5 we also support "GlobalProperty:xyz" and "UserProperty:xyz" where xyz is the name of a global property or user property, whose value must be equal to a legal location value using one of the supported formats.
    • Default: None
  • order: Determines which locations appear in the list, and specifies the order in which they appear.
    • OPTIONAL
    • Example: <encounterLocation order="2,7,4"/>
    • Value: Comma separated list of Location IDs, Location UUIDs, or Location Names
    • Default: All locations in alphabetical order
  • type: Specifies the input element to display (i.e a dropdown vs autocomplete); shows a dropdown by default if type is not specified
    • Since 1.11
    • OPTIONAL
    • Example: <encounterLocation type="autocomplete"/>
    • Value:  "autocomplete"
    • Default: dropdown

Example Usage

Code Block
html
html

<encounterLocation/>                                    <!-- ana autocompletelist fieldof forall location selectionlocations, withsorted prepopulatedalphabetically listby of locationsname -->

<encounterProvider>

Data entry widget for recording provider for the encounter. Along with encounterDate and encounterLocation, encounterProvider should be present on every HTML form. (In 1.9+ you should use the <encounterProviderAndRole> tag instead.)

Attributes

  • default: Sets default value for the widget.
    • OPTIONAL
    • Example: <encounterProvider default="djaz"/>
    • Value: username, currentUser, Person IDs, or Person UUID
    • Default: None
  • role: Filters the list of persons to only those users with the specified role
    • OPTIONAL
    • Example: <encounterProvider role="Provider"/>
    • Value: Any valid role
    • Default: Provider
  • persons:  Determines which persons appear in the list, and specifies the order in which they appear.
    • OPTIONAL
    • As of version 1.6.8
    • Example: <encounterLocation persons="1,2,4"/>
    • Value: Comma separated list of usernames, Person IDs, or Person UUIDs
  • type: Specifies the input element to display (i.e a dropdown vs autocomplete); shows a dropdown by default if type is not specified
    • Since 1.11
    • OPTIONAL
    • Example: <encounterProvider type="autocomplete"/>
    • Value:  "autocomplete"
    • Default: dropdown

Example Usage

Code Block
htmlhtml

<encounterProvider/> <encounterLocation default="2"/>                        <!-- a list of all locations, sorted alphabetically by name, with location 2 selected by default -->
<encounterLocation default="GlobalProperty:defLoc"/>    <!-- a list of all locations, sorted alphabetically by name, with the location specified in the "defLoc" global property selected by default -->
<encounterLocation order="2,7,4"/>                      <!-- a list of all users the specified locations, by id -->
<encounterProvider<encounterLocation defaultorder="djazRwinkwavu,Kirehe,Mulindi"/>        <!-- a list of the allspecified userslocations, withby the user whose username is djaz selected name -->
<encounterProvider<encounterLocation defaulttype="6autocomplete"/>                <!-- an aautocomplete listfield offor alllocation usersselection, with theprepopulated userlist whose userId is 6 selectedof locations -->
<encounterProvider 

<encounterProvider>

Data entry widget for recording provider for the encounter. Along with encounterDate and encounterLocation, encounterProvider should be present on every HTML form. (In 1.9+ you should use the <encounterProviderAndRole> tag instead.)

Attributes

  • default: Sets default value for the widget.
    • OPTIONAL
    • Example: <encounterProvider default="

...

    • djaz"/>

...

    • Value: username, currentUser, Person IDs, or Person UUID
    • Default: None
  • role: Filters the list of persons to only those users with the specified role
    • OPTIONAL
    • Example: <encounterProvider role="Provider"/>

...

    • Value: Any valid role
    • Default: Provider
  • persons:  Determines which persons appear in the list, and specifies the order in which they appear.
    • OPTIONAL
    • As of version 1.6.8
    • Example: <encounterLocation persons="1,2,4"/>
    • Value: Comma separated list of usernames, Person IDs, or Person UUIDs
  • type: Specifies the input element to display (i.e a dropdown vs autocomplete); shows a dropdown by default if type is not specified
    • Since 1.11
    • OPTIONAL
    • Example: <encounterProvider type="autocomplete"/>
    • Value:  "autocomplete"
    • Default: dropdown

Example Usage

Code Block
html
html
<encounterProvider/>            <!-- an autocomplete field for provider selection, with pre populated list of providers<!-->

<encounterProviderAndRole>

(since 1.9; requires htmlformentry19ext module)

Data entry widget for recording one or more providers for the encounter, along with the roles those providers played in the encounter

Attributes

  • default: Sets default provider for the widget (id or uuid of a Provider, or "currentUser"). If you specify "currentUser" but the currently-logged-in user does not have a Provider record associated with their Person record, nothing happens. (If that user has more than one Provider record, one is chosen arbitrarily.)
  • encounterRole: (id or uuid of a encounterRole) When specified, this tag displays a widget for choosing a provider, and assigns it to the role indicated by this parameter. If you do not specify this attribute, then the tag will also display a widget to choose an encounter role for the provider.
  • required: when true, the form cannot be submitted unless you have chosen a provider

Example Usage

Code Block

<encounterProviderAndRole/>       a list of all users -->
<encounterProvider default="djaz"/>        <!-- a list of all users, with the user whose username is djaz selected -->
<encounterProvider default="6"/>           <!-- a list of all users, with the user whose userId is 6 selected -->
  <encounterProvider default="currentUser"/> <!-- a dropdownlist of all encounterusers, roleswith :the dropdowncurrent ofuser providersselected -->
<encounterProviderAndRole<encounterProvider defaultrole="currentUserProvider"/>             <!-- dropdowna list of encounterthose roles : dropdown of providers users with onethe chosenProvider by defaultrole -->
<encounterProviderAndRole<encounterProvider encounterRolepersons="1" required="true"username1,username2"/>   <!-- dropdowna list of providers, required for submission those 2 Persons who are users with usernames username1 and username2 -->
<encounterProviderAndRole<encounterProvider encounterRoletype="2" default="3"autocomplete"/>     <!-- dropdown of providers, with one chosen by default   <!-- an autocomplete field for provider selection, with pre populated list of providers-->

<encounterType>

Used to specify the Encounter Type while filling out an HTML Form rather than when designing the form. When using this tag, the "Encounter Type" field of the HTML Form design should be left blank.

Attributes

...

<encounterProviderAndRole>

(since 1.9; requires htmlformentry19ext module)

Data entry widget for recording one or more providers for the encounter, along with the roles those providers played in the encounter

Attributes

  • default: Sets default provider for the widget (id or uuid of a Provider, or "currentUser"). If you specify "currentUser" but the currently-logged-in user does not have a Provider record associated with their Person record, nothing happens. (If that user has more than one Provider record, one is chosen arbitrarily.)
  • encounterRole: (id or uuid of a encounterRole) When specified, this tag displays a widget for choosing a provider, and assigns it to the role indicated by this parameter. If you do not specify this attribute, then the tag will also display a widget to choose an encounter role for the provider.
  • required: when true, the form cannot be submitted unless you have chosen a provider

Example Usage

Code Block
<encounterType types="25,24,9,23,20,14,18,22,19,13,10,17,26,11,12,16,21,15,27" default="CLINIC MOBILE" />

<encounterVoided>

In edit mode only, for an existing encounter, renders a voided checkbox that allows you to void the encounter.  There are no tag arguments.  Available in htmlformentry1.7.4.  This tag does not render anything when entering a new form, or when viewing an existing encounter (viewing the encounter implies already implies that the encounter is not voided).

Example Usage

Code Block

<encounterVoided/>

<enrollInProgram>

Enrolls a patient in a program when the form is submitted.

To automatically un-enroll a patient, see the completeProgram tag.

Specifics about this enrollment behavior:

  • If the patient is already in the program on the selected date, nothing changes
  • If the patient is registered in the program after the selected date, then the patient's enrollment date will be moved back to the selected date, otherwise, patient is enrolled on selected date
  • Otherwise, the patient is enrolled as requested
  • If state ids are specified, these patient states are set upon program enrollment
  • If the patient is already enrolled in the program when this form is submitted, the patient states are NOT automatically set; however, if the enrollment date is changed (via the logic above) all the states that have a start date equal to the enrollment date are changed to the new enrollment date
  • This tag is invalid if any of the states listed are not initial states, or if two or more of the states are from the same workflow

Attributes

  • programId: ID of the program in which the patient is to be enrolled.
    • REQUIRED
    • Examples: 
      • <enrollInProgram programId="1"/> 
      • <enrollInProgram programId="Rehab program"/>
    • Value: Any valid program ID, program UUID or underlying concept name
    • Default: None.
  • showDate: If true, a date widget is displayed and the patient is enrolled on the selected date; if false, or if no date selected, the patient is enrolled on the encounter date
    • OPTIONAL
    • Example: <enrollInProgram programId="1" showDate="true"/>
    • Value: true or false
    • Default: False.
  • stateIds: A comma-separated list of program work flow states ids
    • OPTIONAL
    • Example: <enrollInProgram programId="1" stateIds="3, 444ce6ba-551d-11e1-8cb6-00248140a5eb, PIH:356789"/>
    • Value: Any valid program workflow state id, program workflow state uuid, or concept mapping of the underlying concept for the state
    • Default: None
    • If you reference states by concept mappings, be careful that you don't have two states in the same program with the same underlying concept, or unpredictable results will occur!

<excludeIf>

A tag that optionally exclude all its content based on evaluating a logic token or a velocity expression. This tag has to only contain either a logic test or a velocity test.

Attributes

  • logicTest A logic expression represents a logic test.
    • OPTIONAL
    • Example: <excludeIf logicTest="GENDER = F"/> - A logic test to see if the patient's gender is female
  • velocityTest A velocity expression represents a velocity test.
    • OPTIONAL
    • Example: <excludeIf velocityTest="$patient.gender == 'F' "/> - A velocity test to see if the patient's gender is female.

Example Usage

Code Block
htmlhtml

<htmlform>
     <table border="0" width="100%">
        <tr><td><includeIf logicTest="GENDER = F">This shows a logic test for a woman</includeIf> </td></tr>
        <tr><td><includeIf velocityTest="$patient.gender == 'F' ">This shows a velocity test for a woman</includeIf> </td></tr><encounterProviderAndRole/>                                   <!-- dropdown of encounter roles : dropdown of providers -->
<encounterProviderAndRole default="currentUser"/>             <!-- dropdown of encounter roles : dropdown of providers with one chosen by default -->
<encounterProviderAndRole encounterRole="1" required="true"/> <!-- dropdown of providers, required for submission -->
<encounterProviderAndRole encounterRole="2" default="3"/>     <!-- dropdown of providers, with one chosen by default -->

<encounterType>

Used to specify the Encounter Type while filling out an HTML Form rather than when designing the form. When using this tag, the "Encounter Type" field of the HTML Form design should be left blank.

Attributes

  • types: comma-separated list of encounterTypes to display in the select list, referenced by id, uuid, or name
  • default: the default encounterType, referenced by id, uuid or name

Example Usage

Code Block

<encounterType types="25,24,9,23,20,14,18,22,19,13,10,17,26,11,12,16,21,15,27" default="CLINIC MOBILE" />

<encounterVoided>

In edit mode only, for an existing encounter, renders a voided checkbox that allows you to void the encounter.  There are no tag arguments.  Available in htmlformentry1.7.4.  This tag does not render anything when entering a new form, or when viewing an existing encounter (viewing the encounter implies already implies that the encounter is not voided).

Example Usage

Code Block

<encounterVoided/>

<enrollInProgram>

Enrolls a patient in a program when the form is submitted.

To automatically un-enroll a patient, see the completeProgram tag.

Specifics about this enrollment behavior:

  • If the patient is already in the program on the selected date, nothing changes
  • If the patient is registered in the program after the selected date, then the patient's enrollment date will be moved back to the selected date, otherwise, patient is enrolled on selected date
  • Otherwise, the patient is enrolled as requested
  • If state ids are specified, these patient states are set upon program enrollment
  • If the patient is already enrolled in the program when this form is submitted, the patient states are NOT automatically set; however, if the enrollment date is changed (via the logic above) all the states that have a start date equal to the enrollment date are changed to the new enrollment date
  • This tag is invalid if any of the states listed are not initial states, or if two or more of the states are from the same workflow

Attributes

  • programId: ID of the program in which the patient is to be enrolled.
    • REQUIRED
    • Examples: 
      • <enrollInProgram programId="1"/> 
      • <enrollInProgram programId="Rehab program"/>
    • Value: Any valid program ID, program UUID or underlying concept name
    • Default: None.
  • showDate: If true, a date widget is displayed and the patient is enrolled on the selected date; if false, or if no date selected, the patient is enrolled on the encounter date
    • OPTIONAL
    • Example: <enrollInProgram programId="1" showDate="true"/>
    • Value: true or false
    • Default: False.
  • stateIds: A comma-separated list of program work flow states ids
    • OPTIONAL
    • Example: <enrollInProgram programId="1" stateIds="3, 444ce6ba-551d-11e1-8cb6-00248140a5eb, PIH:356789"/>
    • Value: Any valid program workflow state id, program workflow state uuid, or concept mapping of the underlying concept for the state
    • Default: None
    • If you reference states by concept mappings, be careful that you don't have two states in the same program with the same underlying concept, or unpredictable results will occur!

<excludeIf>

A tag that optionally exclude all its content based on evaluating a logic token or a velocity expression. This tag has to only contain either a logic test or a velocity test.

Attributes

  • logicTest A logic expression represents a logic test.
    • OPTIONAL
    • Example: <excludeIf logicTest="GENDER = F"/> - A logic test to see if the patient's gender is female
  • velocityTest A velocity expression represents a velocity test.
    • OPTIONAL
    • Example: <excludeIf velocityTest="$patient.gender == 'F' "/> - A velocity test to see if the patient's gender is female.

Example Usage

Code Block
html
html

<htmlform>
     <table border="0" width="100%">
        <tr><td><excludeIf<tr><td><includeIf logicTest="GENDER = F">This won't show for shows a logic test for a woman</excludeIf>includeIf> </td></tr>
        <tr><td><excludeIf<tr><td><includeIf velocityTest="$patient.gender == 'F' ">This won't show forshows a velocity test for a woman</excludeIf>includeIf> </td></tr>
     </table>    </<tr><td><excludeIf logicTest="GENDER = F">This won't show for a logic test for a woman</excludeIf> </td></tr>
        <tr><td><excludeIf velocityTest="$patient.gender == 'F' ">This won't show for a velocity test for a woman</excludeIf> </td></tr>
     </table>
   </htmlform>

<exitFromCare>

This tag is used to record the scenario where a patient exits care. It operates in a similar manner to the exit from care functionality on the patient dashboard, providing a date field  and a reason dropdown to the user. To exit a patient from care, the date field should be set to the date of the patient's exit and the reason dropdown set to the reason for the patient's exit. Exiting a patient from care is not mandatory, however once the fields are filled out and submitted for a certain patient, the exit can't be undone, hence the fields can't be set back to empty. However it is possible to edit the date and reason fields.

...

  • 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()
    • returns all the patient's encounters, as a List<Encounter>
    • since 1.7.4
    • Example
      Code Block
      
      Past Encounter Dates: <lookup complexExpression="#foreach($encounter in $fn.allEncounters()) $encounter.encounterDatetime #end"/>
      
  • fn.latestEncounter()
    • returns the patient's latest encounter
    • since 1.7.4
    • Example
      Code Block
      
      Latest MDR-TB Encounter: <lookup expression="fn.latestEncounter(2)"/>
      
  • fn.latestEncounter(EncounterType type)
    • returns the patient's latest encounter for the given encounter type id
    • since 1.7.4
    • Example
      Code Block
      
      First MDR-TB Encounter: <lookup expression="fn.latestEncounter(2)"/>
      

Attributes

  • complexExpression
    • OPTIONAL
    • Example: <lookup complexExpression="#foreach( $addr in $patient.addresses ) $!addr.cityVillage <br/> #end"/>
    • Value: Valid complex velocity expression
    • Default: None
  • class
    • OPTIONAL
    • Example: <lookup class="value" ... />
    • Value: Valid velocity class
    • Default: None
  • expression
    • OPTIONAL
    • Example: <lookup expression="patient.personName"/>
    • Value: Valid velocity expression
    • Default: None

Example Usage

...


<lookup expression="patient.personName"/> this will translate to the velocity expression $\!{patient.personName}
<lookup expression="patient.personName.givenName"/>
<lookup expression="patient.personName.familyName"/>
<lookup expression="patient.getPatientIdentifier(5)"/> this will get the patient's first identifier with Identifier Type Id of 5
<lookup expression="patient.birthdate"/>
<lookup expression="patient.age"/>
<lookup expression="patient.gender" codePrefix="gender_"/>
<lookup complexExpression="#foreach( $addr in $patient.addresses ) $\!addr.cityVillage <br/> #end"/>
<lookup class="value" .../>   this will produce <span>result of expression</span>
<lookup expression="personAttributes.get('Tribe')"/> this will get the patient's 'Tribe' person attribute
<lookup expression="patient.personAddress.address1"/> this will get the address1 field of the patient's preferred address
<lookup expression="patient.personAddress.cityVillage"/> this will get the city field of the patient's preferred address
<lookup complexExpression="#foreach ( $relationship in $relationshipList )
    #if( $relationship.relationshipType.bIsToA == 'Parent' )
          #if( !($relationship.personB.patientId == $patient.patientId ))
             #if( $relationship.personB.gender == 'F' )
                   $relationship.personB.personName
             #end
          #end
    #end
#end "/> this will get the patient's mother's name
<lookup complexExpression="
&#60;img src=&#34;http://www.someserver.com/somepath/barcode.php?string=${patient.getPatientIdentifier(1)}&#34;/&#62;
" /> this loads a dynamic image (This requires the us of ASCII character codes because the quote and less-than symbols are illegal.)

<macros>

Define macros at the top of the file (e.g. for things like colors).

Example Usage

...


<htmlform>
    <macros>
        lightgrey=#e0e0e0
        lightblue=#e0e0ff
        darkblue=#4444ff
    </macros>
    <div style="background-color: $lightblue">This is a pleasant light blue color</div>
</htmlform>

<obs>

Generates an obs data entry widget. Depending on the datatype of the concept you specify, you get different obs.value widgets, and you use different attributes to control them.

Data Types

Numeric

By default, displays a small text box that auto-checks that entries are between absoluteMinimum and absoluteMaximum for the concept, and checks on precise also. You can also specify a constrained list of answers, as radio button or a dropdown (Since 1.6.1) Example:

...


<!-- free text box (constrained to legal numbers) -->
<obs conceptId="5497" labelText="Most recent CD4:" dateLabel="Date of test:"/>

<!-- constrained to None, 1-6, and 7-8 -->
<obs conceptId="123" labelText="Education" answers="0,6,8" answerLabels="None,1-6,7-8" style="radio"/>
<obs conceptId="123" labelText="Education" answers="0,6,8" answerLabels="None,1-6,7-8" style="dropdown"/>

You can also specify answerCodes instead of answerLabels to reference answer labels by codes in messages.properties or in the translation mappings in the form itself.

Boolean

Various widget styles can be used to input Boolean values:

...


style="checkbox"                 A checkbox that when checked creates a TRUE obs, and when unchecked does nothing
style="checkbox" value="false"   A checkbox that when checked creates a FALSE obs, and when unchecked does nothing
style="no_yes"                   Radio buttons for no and yes. You may click on a selected radio button to unselect it.
style="yes_no"                   Like above but reverse order
style="no_yes_dropdown"          Dropdown list with blank, no, and yes options.
style="yes_no_dropdown"          Like above but reverse order

<!-- Localization -->
<obs conceptId="5272" style="no_yes" noLabel="Non" yesLabel="Oui"/>

Text

By default, displays a normal text input box.

...


size="5" means a text field with the specified size
style="textarea" means a textarea
rows="10" number of rows in the textarea (implies style="textarea")
cols="80" number of columns in the textarea (implies style="textarea")
answers="comma,separated,legal,answers"
answerLabels="Display,For,Legal,Answers"
answerCodes=Allows you to reference labels by a messages.properties codes or a codes in the translation mappings defined in the form.
style="location" provides a drop-down list of Locations
style="person" provides a drop-down list of persons.  Used with role, it limits the list to a subset of persons who have an associated User account with the specified Role.

Date

Renders a date picker widget. Note that dates are not allowed to be in the future, unless attribute allowFutureDates="true".

Coded

Renders a drop-down with all possible coded answered. Set style="radio" to display a radio set of options in lieu of a drop-down. Set style = "autocomplete" to display a autocomplete widget. Note autocomplete has to work with either an answerClasses attribute or an answerConceptId attribute.

...


Examples:
<obs conceptId="1234" answerConceptId="123" labelText="The question:" answerLabel="The answer"/>
Renders as: The question: [ ]The answer
If checked creates an obs with conceptId=1234 and valueCoded=123

<obs conceptId="1234"/>
Renders as a dropdown of all possible answer specified for concept 1234 in the dictionary

<obs conceptId="1234" answerConceptIds="123,7,912" answerLabels="Malaria,Tuberculosis,Diabetes"/>
Renders as a dropdown of the specified answers with the specified labels.

<obs conceptId="1296" answerClasses="Drug"/>
Renders as a dropdown all Concepts with ConceptClass = "Drug", ordered by Concept Name

<obs conceptId="1296" answerClasses="Drug" style="autocomplete"/>
Renders as a autocomplete widget with ConceptClass = "Drug"

You can also specify answerCode instead of answerLabel to reference an answer label by a code in messages.properties or in the translation mappings in the form itself.

Attributes

  • allowFutureDates: When set to true allows obsDatetime to be in the future. (Has no effect on valueDatetime.)
    • OPTIONAL
    • Example: <obs conceptId="5096" dateLabel="Date measured:" allowFutureDates="true" />
    • Value: "true" or "false"
    • Default: False - Only past dates are allowed by default.
  • answerCodes: Allows you to reference labels by a messages.properties codes or a codes in the translation mappings defined in the form.
    • OPTIONAL
    • Example: ???
    • Value ??
    • Default: ?????
  • answerClasses: Renders as a dropdown all Concepts with specified ConceptClass, ordered by Concept Name
    • OPTIONAL
    • Example: <obs conceptId="1296" answerClasses="Drug"/>
    • Value: Valid ConceptClass
    • Default: None
  • answerConceptId: Concept reference corresponding to the coded answer for the question. Frequently used with checkboxes.
    • OPTIONAL
    • Examples:
      • <obs conceptId="3509" answerConceptId="2070" answerLabel="l'hôpital" style="checkbox" />
      • <obs conceptId="3509" answerConceptId="XYZ:HT" answerLabel="l'hôpital" style="checkbox" />
      • <obs conceptId="3509" answerConceptId="0cbe2ed3-cd5f-4f46-9459-26127c9265ab" answerLabel="l'hôpital" style="checkbox" />
    • Value: A valid 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()
    • returns all the patient's encounters, as a List<Encounter>
    • since 1.7.4
    • Example
      Code Block
      
      Past Encounter Dates: <lookup complexExpression="#foreach($encounter in $fn.allEncounters()) $encounter.encounterDatetime #end"/>
      
  • fn.latestEncounter()
    • returns the patient's latest encounter
    • since 1.7.4
    • Example
      Code Block
      
      Latest MDR-TB Encounter: <lookup expression="fn.latestEncounter(2)"/>
      
  • fn.latestEncounter(EncounterType type)
    • returns the patient's latest encounter for the given encounter type id
    • since 1.7.4
    • Example
      Code Block
      
      First MDR-TB Encounter: <lookup expression="fn.latestEncounter(2)"/>
      

Attributes

  • complexExpression
    • OPTIONAL
    • Example: <lookup complexExpression="#foreach( $addr in $patient.addresses ) $!addr.cityVillage <br/> #end"/>
    • Value: Valid complex velocity expression
    • Default: None
  • class
    • OPTIONAL
    • Example: <lookup class="value" ... />
    • Value: Valid velocity class
    • Default: None
  • expression
    • OPTIONAL
    • Example: <lookup expression="patient.personName"/>
    • Value: Valid velocity expression
    • Default: None

Example Usage

Code Block
html
html

<lookup expression="patient.personName"/> this will translate to the velocity expression $\!{patient.personName}
<lookup expression="patient.personName.givenName"/>
<lookup expression="patient.personName.familyName"/>
<lookup expression="patient.getPatientIdentifier(5)"/> this will get the patient's first identifier with Identifier Type Id of 5
<lookup expression="patient.birthdate"/>
<lookup expression="patient.age"/>
<lookup expression="patient.gender" codePrefix="gender_"/>
<lookup complexExpression="#foreach( $addr in $patient.addresses ) $\!addr.cityVillage <br/> #end"/>
<lookup class="value" .../>   this will produce <span>result of expression</span>
<lookup expression="personAttributes.get('Tribe')"/> this will get the patient's 'Tribe' person attribute
<lookup expression="patient.personAddress.address1"/> this will get the address1 field of the patient's preferred address
<lookup expression="patient.personAddress.cityVillage"/> this will get the city field of the patient's preferred address
<lookup complexExpression="#foreach ( $relationship in $relationshipList )
    #if( $relationship.relationshipType.bIsToA == 'Parent' )
          #if( !($relationship.personB.patientId == $patient.patientId ))
             #if( $relationship.personB.gender == 'F' )
                   $relationship.personB.personName
             #end
          #end
    #end
#end "/> this will get the patient's mother's name
<lookup complexExpression="
&#60;img src=&#34;http://www.someserver.com/somepath/barcode.php?string=${patient.getPatientIdentifier(1)}&#34;/&#62;
" /> this loads a dynamic image (This requires the us of ASCII character codes because the quote and less-than symbols are illegal.)

<macros>

Define macros at the top of the file (e.g. for things like colors).

Example Usage

Code Block
html
html

<htmlform>
    <macros>
        lightgrey=#e0e0e0
        lightblue=#e0e0ff
        darkblue=#4444ff
    </macros>
    <div style="background-color: $lightblue">This is a pleasant light blue color</div>
</htmlform>

<obs>

Generates an obs data entry widget. Depending on the datatype of the concept you specify, you get different obs.value widgets, and you use different attributes to control them.

Data Types

Numeric

By default, displays a small text box that auto-checks that entries are between absoluteMinimum and absoluteMaximum for the concept, and checks on precise also. You can also specify a constrained list of answers, as radio button or a dropdown (Since 1.6.1) Example:

Code Block
html
html

<!-- free text box (constrained to legal numbers) -->
<obs conceptId="5497" labelText="Most recent CD4:" dateLabel="Date of test:"/>

<!-- constrained to None, 1-6, and 7-8 -->
<obs conceptId="123" labelText="Education" answers="0,6,8" answerLabels="None,1-6,7-8" style="radio"/>
<obs conceptId="123" labelText="Education" answers="0,6,8" answerLabels="None,1-6,7-8" style="dropdown"/>

You can also specify answerCodes instead of answerLabels to reference answer labels by codes in messages.properties or in the translation mappings in the form itself.

Boolean

Various widget styles can be used to input Boolean values:

Code Block
html
html

style="checkbox"                 A checkbox that when checked creates a TRUE obs, and when unchecked does nothing
style="checkbox" value="false"   A checkbox that when checked creates a FALSE obs, and when unchecked does nothing
style="no_yes"                   Radio buttons for no and yes. You may click on a selected radio button to unselect it.
style="yes_no"                   Like above but reverse order
style="no_yes_dropdown"          Dropdown list with blank, no, and yes options.
style="yes_no_dropdown"          Like above but reverse order

<!-- Localization -->
<obs conceptId="5272" style="no_yes" noLabel="Non" yesLabel="Oui"/>

Text

By default, displays a normal text input box.

Code Block
html
html

size="5" means a text field with the specified size
style="textarea" means a textarea
rows="10" number of rows in the textarea (implies style="textarea")
cols="80" number of columns in the textarea (implies style="textarea")
answers="comma,separated,legal,answers"
answerLabels="Display,For,Legal,Answers"
answerCodes=Allows you to reference labels by a messages.properties codes or a codes in the translation mappings defined in the form.
style="location" provides a drop-down list of Locations
style="person" provides a drop-down list of persons.  Used with role, it limits the list to a subset of persons who have an associated User account with the specified Role.

Date

Renders a date picker widget. Note that dates are not allowed to be in the future, unless attribute allowFutureDates="true".

Coded

Renders a drop-down with all possible coded answered. Set style="radio" to display a radio set of options in lieu of a drop-down. Set style = "autocomplete" to display a autocomplete widget. Note autocomplete has to work with either an answerClasses attribute or an answerConceptId attribute.

Code Block
html
html

Examples:
<obs conceptId="1234" answerConceptId="123" labelText="The question:" answerLabel="The answer"/>
Renders as: The question: [ ]The answer
If checked creates an obs with conceptId=1234 and valueCoded=123

<obs conceptId="1234"/>
Renders as a dropdown of all possible answer specified for concept 1234 in the dictionary

<obs conceptId="1234" answerConceptIds="123,7,912" answerLabels="Malaria,Tuberculosis,Diabetes"/>
Renders as a dropdown of the specified answers with the specified labels.

<obs conceptId="1296" answerClasses="Drug"/>
Renders as a dropdown all Concepts with ConceptClass = "Drug", ordered by Concept Name

<obs conceptId="1296" answerClasses="Drug" style="autocomplete"/>
Renders as a autocomplete widget with ConceptClass = "Drug"

You can also specify answerCode instead of answerLabel to reference an answer label by a code in messages.properties or in the translation mappings in the form itself.

Attributes

  • allowFutureDates: When set to true allows obsDatetime to be in the future. (Has no effect on valueDatetime.)
    • OPTIONAL
    • Example: <obs conceptId="5096" dateLabel="Date measured:" allowFutureDates="true" />
    • Value: "true" or "false"
    • Default: False - Only past dates are allowed by default.
  • answerCodes: Allows you to reference labels by a messages.properties codes or a codes in the translation mappings defined in the form.
    • OPTIONAL
    • Example: ???
    • Value ??
    • Default: ?????
  • answerClasses: Renders as a dropdown all Concepts with specified ConceptClass, ordered by Concept Name
    • OPTIONAL
    • Example: <obs conceptId="1296" answerClasses="Drug"/>
    • Value: Valid ConceptClass
    • Default: None
  • answerConceptId: Concept reference corresponding to the coded answer for the question. Frequently used with checkboxes.
    • OPTIONAL
    • Examples:
      • <obs conceptId="3509" answerConceptId="2070" answerLabel="l'hôpital" style="checkbox" />
      • <obs conceptId="3509" answerConceptId="XYZ:HT" answerLabel="l'hôpital" style="checkbox" />
      • <obs conceptId="3509" answerConceptId="0cbe2ed3-cd5f-4f46-9459-26127c9265ab" answerLabel="l'hôpital" style="checkbox" />
    • Value: A valid Concept Integer ID, Concept Mapping, or Concept uuid.
    • Default: None
  • answerConceptIds: Concept references corresponding to the coded answers for the question. Used with radio buttons and dropdowns.
    • OPTIONAL
    • Examples:
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="1320,1321,1316" answerLabels="tole,tache,beton"/>
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="XYZ:HT,ABC:QQ,QWE:TR" answerLabels="tole,tache,beton"/>
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="5ecb88f3-cd5f-4f46-9459-26127c9265ab,74e3ded1-cd4f-4f4b-9459-26127c9265ab,0cbe2ed3-cd5f-4f46-9459-26127c9265ab" answerLabels="tole,tache,beton"/>
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="1320,ABC:QQ,0cbe2ed3-cd5f-4f46-9459-26127c9265ab" answerLabels="tole,tache,beton"/>
    • Value: Quoted, comma separated list of valid Concept Integer IDs, Concept Mappings, or Concept uuid's.
    • Default: None
  • answerLabel: Sets the text to display after the object. Used with checkboxes.
    • OPTIONAL
    • Example: <obs conceptId="3509" answerConceptId="2070" answerLabel="l'hôpital" style="checkbox" />
    • Value: Any quoted string
    • Default: None
  • answerLabels: Sets the text to display after the objects. Used with radio buttons or dropdowns.
    • OPTIONAL
    • Example: <obs conceptId="3201" labelText="" answerConceptIds="1065,1066" style="radio" answerLabels="oui,non" />
    • Value: Comma separated list.
    • Default: None
  • answers: Values to be stored as the answer for a radio button or dropdown. NOT used when answers are concepts - see answerConceptIds in that case
    • OPTIONAL
    • Example: <obs conceptId="123" labelText="Education" answers="0,6,8" answerLabels="None,1-6,7-8" style="radio"/>
    • Value: Comma-separated list
    • Default: None
  • answerSeparator: Defines the string or character to be used to separate answers in case of radio buttons, one use case for this would be to set the layout of the radio buttons i.e horizontal Vs vertical orientation by setting the value to an html line break(<br />) as shown in the example below
    • OPTIONAL
    • Example: <obs conceptId="1054" labelText="Question Label<br/>" answerSeparator="<br />" answerConceptIds="1056,1057,1058" answerLabels="Label 1,Label 2,Label 3" style="radio"/>
    • Value: Any quoted string.
    • Default: None
  • cols: Number of columns in the textarea (implies style="textarea").
    • OPTIONAL
    • Example: <obs conceptId="3221" rows="7" cols="60" />
    • Value: Positive integer.
    • Default: None
  • conceptId: Integer ID, Concept Mapping, or Concept uuid of the concept to which the obs widget is linked. The datatype of this concept drives the behavior of the widget.
    • REQUIRED (unless using conceptIds)
    • Examples:<obs conceptId="6135" /><obs conceptId="XYZ:HT" /><obs conceptId="0cbe2ed3-cd5f-4f46-9459-26127c9265ab" />
    • Value: Valid Concept Integer ID, Concept Mapping, or Concept uuid.
    • Default: None
  • answerConceptIds: Concept references corresponding to the coded answers for the question. Used with radio buttons and dropdowns.
    • OPTIONAL
    • Examples:
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="1320,1321,1316" answerLabels="tole,tache,beton"/>
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="XYZ:HT,ABC:QQ,QWE:TR" answerLabels="tole,tache,beton"/>
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="5ecb88f3-cd5f-4f46-9459-26127c9265ab,74e3ded1-cd4f-4f4b-9459-26127c9265ab,0cbe2ed3-cd5f-4f46-9459-26127c9265ab" answerLabels="tole,tache,beton"/>
      • <obs conceptId="1319" labelText="Toiture/Roofing: " answerConceptIds="1320,ABC:QQ,0cbe2ed3-cd5f-4f46-9459-26127c9265ab" answerLabels="tole,tache,beton"/>
    • Value: Quoted, comma separated list of valid Concept Integer IDs, Concept Mappings, or Concept uuid's.
    • Default: None
  • answerLabel: Sets the text to display after the object. Used with checkboxesconceptIds: It is possible to create an obs tag where you're choosing the 'question' for a predefined answerConceptId.This attribute can't be used in the same obs tag as the usual 'conceptId' attribute, and for the moment requires an answerConceptId.
    • OPTIONAL
    • Example: <obs conceptIds="1441,3017,2474" answerConceptId="656" labelText="ISONIAZID"/> (Renders as a dropdown list of drug sensitivity results for the drug isoniazid. Concepts 1441, 3017, and 2474-SUSCEPTIBLE TO TUBERCULOSIS DRUG, INTERMEDIATE TO TUBERCULOSIS DRUG, RESISTANT TO TUBERCULOSIS DRUG-would be the concepts listed in the dropdown list). The resulting obs may, for example,'WEAKLY POSITIVE' for the concept, and Isoniazid (concept 656( as the conceptAnswer.)
    • Default: None
  • conceptLabels: Sets the display text to use for a concept. Used with the "conceptIds" tag.
    • OPTIONAL
    • Example: <obs conceptIdconceptIds="35091441,3017,2474" answerConceptId="2070656" answerLabellabelText="l'hôpitalISONIAZID" styleconceptLabels="checkboxSusceptible, Intermediate, Resistant"/>
    • Value: Any quoted string
    • Default: None
    answerLabels: Sets the text to display after the objects. Used with radio buttons or dropdowns
  • dateLabel: Text to display after the obs.value widget and before the obs.datetime widget (obs.obs_datetime). Specifying this implies showDate="true".
    • OPTIONAL
    • Example: <obs conceptId="32015497" labelText="Most recent CD4:" answerConceptIdsdateLabel="1065,1066" style="radio" answerLabels="oui,non" Date of test:"/>
    • Value: Comma separated list.Any quoted string
    • Default: None
    answers: Values to be stored as the answer for a radio button or dropdown. NOT used when answers are concepts - see answerConceptIds in that case
  • OPTIONAL
  • Example
  • defaultDatetime: Specify a default value for an Obs of type date, time, or datetime.
    • OPTIONAL
    • Values: "now" to use the current date and time; "today" to use the current date with time 00:00;  a specific date in the format yyyy-MM-dd-HH-mm
    • Examples: <obs conceptId="1235497" labelText="Education" answers="0,6,8" answerLabels="None,1-6,7-8" style="radio"/>
    • Value: Comma-separated list
    • Default: None
  • answerSeparator: Defines the string or character to be used to separate answers in case of radio buttons, one use case for this would be to set the layout of the radio buttons i.e horizontal Vs vertical orientation by setting the value to an html line break(<br />) as shown in the example below
    • OPTIONAL
    • Example: <obs conceptId="1054" labelText="Question Label<br/>" answerSeparator="<br />" answerConceptIds="1056,1057,1058" answerLabels="Label 1,Label 2,Label 3" style="radio"/>
    • Value: Any quoted string.
    • Default: None
  • cols: Number of columns in the textarea (implies style="textarea").
    • OPTIONAL
    • Example: <obs conceptId="3221" rows="7" cols="60" />
    • Value: Positive integer.
    • Default: None
  • conceptId: Integer ID, Concept Mapping, or Concept uuid of the concept to which the obs widget is linked. The datatype of this concept drives the behavior of the widget.
    • REQUIRED (unless using conceptIds)
    • Examples:<obs conceptId="6135" /><obs conceptId="XYZ:HT" /><obs conceptId="0cbe2ed3-cd5f-4f46-9459-26127c9265ab" />
    • Value: Valid Concept Integer ID, Concept Mapping, or Concept uuid.
    • Default: None
  • conceptIds: It is possible to create an obs tag where you're choosing the 'question' for a predefined answerConceptId.This attribute can't be used in the same obs tag as the usual 'conceptId' attribute, and for the moment requires an answerConceptId.
    • OPTIONAL
    • Example: <obs conceptIds="1441,3017,2474" answerConceptId="656" labelText="ISONIAZID"/> (Renders as a dropdown list of drug sensitivity results for the drug isoniazid. Concepts 1441, 3017, and 2474-SUSCEPTIBLE TO TUBERCULOSIS DRUG, INTERMEDIATE TO TUBERCULOSIS DRUG, RESISTANT TO TUBERCULOSIS DRUG-would be the concepts listed in the dropdown list). The resulting obs may, for example,'WEAKLY POSITIVE' for the concept, and Isoniazid (concept 656( as the conceptAnswer.)
    • Default: None
  • conceptLabels: Sets the display text to use for a concept. Used with the "conceptIds" tag.
    • OPTIONAL
    • Example: <obs conceptIds="1441,3017,2474" answerConceptId="656" labelText="ISONIAZID" conceptLabels="Susceptible, Intermediate, Resistant"/>
    • Default: None
  • dateLabel: Text to display after the obs.value widget and before the obs.datetime widget (obs.obs_datetime). Specifying this implies showDate="true".
    • OPTIONAL
    • Example: <obs conceptId="5497" labelText="Most recent CD4:" dateLabel="Date of test:"/>
    • Value: Any quoted string
    • Default: None
  • defaultDatetime: Specify a default value for an Obs of type date, time, or datetime.
    • OPTIONAL
    • Values: "now" to use the current date and time; "today" to use the current date with time 00:00;  a specific date in the format yyyy-MM-dd-HH-mm
    • Examples: <obs conceptId="5497" labelText="Sample test time:" defaultDatetime="now"/> <obs conceptId="5498" labelText="Request date:" defaultDatetime="today"/> <obs conceptId="5499" labelText="Last updated:" defaultDatetime="2011-04-18-23-05"/>Sample test time:" defaultDatetime="now"/> <obs conceptId="5498" labelText="Request date:" defaultDatetime="today"/> <obs conceptId="5499" labelText="Last updated:" defaultDatetime="2011-04-18-23-05"/>
    • Default: None
    • Version: Available since version 1.9.0
  • defaultObsDatetime: Every Obs has a datetime attribute to record when the Obs was made. This tag specifies a default datetime for an Obs of any type. If you also specify showDate="true" to display a datepicker for the obs.datetime , the datepicker will show this default. 
    • OPTIONAL
    • Values: "now" to use the current date and time; "today" to use the current date with time 00:00;  a specific date in the format yyyy-MM-dd-HH-mm
    • Examples: <obs conceptId="6000" labelText="Appearance:" defaultObsDatetime="now"/> <obs conceptId="6001" labelText="Appearance:" defaultObsDatetime="today"/> <obs conceptId="6002" labelText="Appearance:" defaultObsDatetime="2011-04-18-23-05"/>
    • Default: None
    • Version: Available since version 1.9.0
  • defaultValue: Specify a default value for Obs of any datatype
    • OPTIONAL
    • Values:
      • For numeric: Any numeric value
      • For boolean: "true" or "false"
      • For text: Any string
      • For date: "now" to use the current date and time; "today" to use the current date with time 00:00; a specific date in the format yyyy-MM-dd-HH-mm Note: For obs with a date datatype, defaultValue and defaultDateTime achieve the same result.
      • For coded: Valid Concept Integer ID, Concept Mapping, or Concept uuid
    • Examples:
      • <obs conceptId="3401" defaultValue="Hello World" />
      • <obs conceptId="3509" answerConceptId="2070" answerLabel="l'hôpital" style="checkbox" defaultValue="PIH: 2070" />
      • <obs conceptId="3201" labelText="" answerConceptIds="1175,1065,1066" style="radio" answerLabels="N/A,oui,non" defaultValue="PIH: 1065"/>
      • <obs conceptId="7417" defaultValue="2011-02-17-00-00"/>
      • <obs conceptId="1837" defaultValue="now"/> <obs conceptId="1271" answerConceptIds="678,729,653,654,849,1624" answerLabels="GB,Plaquettes,ALT/SGOT,AST/SGPT,Proteinuria,TSH" defaultValue="653"/>
    • Default: None
    • Version: Available since version 1.9.0
  • id: label that you can use to refer to this obs in javascript on the page
    • OPTIONAL
    • Example: <obs conceptId="5089" id="weight"/><obs conceptId="5090" id="height"/> <script>var bmi = getValue('weight.value') / Math.pow(getValue('height.value'), 2);</script>
    • Value: string
    • Default: None
    • Version: Available since version 1.96.08
    defaultObsDatetime: Every Obs has a datetime attribute to record when the Obs was made. This tag specifies a default datetime for
  • an Obs of any type. If you also specify showDate="true" to display a datepicker for the obs.datetime , the datepicker will show this default. 
  • OPTIONAL
  • Values: "now" to use the current date and time; "today" to use the current date with time 00:00;  a specific date in the format yyyy-MM-dd-HH-mm
  • ExampleslabelCode: Allows you to reference a label by a messages.properties code or a code in the translation mappings defined in the form.
    • OPTIONAL
    • Example: <obs conceptId="60001234" labelText="Appearance:" defaultObsDatetime="now"/> <obs conceptId="6001" labelText="Appearance:" defaultObsDatetime="today"/> <obs conceptId="6002" labelText="Appearance:" defaultObsDatetime="2011-04-18-23-05"/>labelCode="night_sweats"/>
    • Value: If referencing a translation mapping, the value for the labelCode attribute must be a valid name as defined within the <code> tag.
    • Default: None
    • Version: Available since version 1.9.0
  • defaultValue: Specify a default value for Obs of any datatype
    • OPTIONAL
    • Values:
      • For numeric: Any numeric value
      • For boolean: "true" or "false"
      • For text: Any string
      • For date: "now" to use the current date and time; "today" to use the current date with time 00:00; a specific date in the format yyyy-MM-dd-HH-mm Note: For obs with a date datatype, defaultValue and defaultDateTime achieve the same result.
      • For coded: Valid Concept Integer ID, Concept Mapping, or Concept uuid
    • Examples:
      • <obs conceptId="3401" defaultValue="Hello World" />
      • <obs conceptId="3509" answerConceptId="2070" answerLabel="l'hôpital" style="checkbox" defaultValue="PIH: 2070" />
      • <obs conceptId="3201" labelText="" answerConceptIds="1175,1065,1066" style="radio" answerLabels="N/A,oui,non" defaultValue="PIH: 1065"/>
      • <obs conceptId="7417" defaultValue="2011-02-17-00-00"/>
      • <obs conceptId="1837" defaultValue="now"/> <obs conceptId="1271" answerConceptIds="678,729,653,654,849,1624" answerLabels="GB,Plaquettes,ALT/SGOT,AST/SGPT,Proteinuria,TSH" defaultValue="653"/>
    • Default: None
    • Version: Available since version 1.9.0
  • id: label that you can use to refer to this obs in javascript on the page labelNameTag: "default" will delegate to Concept.getBestName(Context.getLocale()). Currently that's the only legal tag.
    • OPTIONAL
    • Example: ?????
    • Value: "default"
    • Default: None
  • labelText: Sets the label that goes before the widget.
    • OPTIONAL
    • Example: <obs conceptId="3355" labelText="cause de décès:" />
    • Value: Any quoted string
    • Default: None
  • noLabel: Defines the label for the "no" option for all styles with a "no" parameter. Commonly used to change label from "No" to "non"
    • OPTIONAL
    • Example: <obs conceptId="6689" style="yes_no" noLabel="non" yesLabel="oui" />
    • Value: Any quoted string.
    • Default: "No"
  • required: Sets this field as a required field
    • OPTIONAL
    • Example: <obs conceptId="3453" required="true" />
    • Value: True or false
  • role: Limits the person drop-down list to only include persons who have an associated User account with specified Role
    • OPTIONAL
    • Only affects when style="person"
    • Example: <obs concept="PIH: Name of Rehabilitation educator" style="person" role="Rehab educator" />
    • Default: Provider 
  • rows: Number of rows in the textarea (implies style="textarea")
    • OPTIONAL
    • Example: <obs conceptId="3221" rows="7" cols="60" />
    • Value: Positive Integer
    • Default: None
  • showAccessionNumber: Sets whether or not to show a field to set the obs.accession_number for this obs
    • OPTIONAL
    • Example: <obs conceptId="50893232" idshowAccessionNumber="weighttrue" /><obs conceptId="5090" id="height"/> <script>var bmi = getValue('weight.value') / Math.pow(getValue('height.value'), 2);</script>
    • Value: stringTrue or false
    • Default: None
    • Version: Available since version 1.6.8
  • labelCode: Allows you to reference a label by a messages.properties code or a code in the translation mappings defined in the form. showCommentField: Sets whether or not to show a text field to set the obs.comments for this obs
    • OPTIONAL
    • Example: <obs conceptId="12343232" labelCodeshowCommentField="night_sweatstrue" />
    • Value: If referencing a translation mapping, the value for the labelCode attribute must be a valid name as defined within the <code> tag.True or false
    • Default: None
  • labelNameTag: "default" will delegate to Concept.getBestName(Context.getLocale()). Currently that's the only legal tag. showDate: Sets whether or not to show a date widget to set the obs.datetime for this obs
    • OPTIONAL
    • Example: ?????<obs conceptId="3232" showDate="true" />
    • Value: "default"True or false
    • Default: NoneFalse
  • labelTextsize: Sets the label that goes before the widgetSpecifies the size of a text field.
    • OPTIONAL
    • Example: <obs conceptId="2216" labelText="3355Résultats: " labelTextsize="cause de décès:80" />
    • Value: Any quoted stringPositive integer
    • Default: None?
    noLabel
  • style: Defines the label for the "no" option for all styles with a "no" parameter. Commonly used to change label from "No" to "non" Specifies the type of input element (radio, checkbox, dropdown, yes/no, etc.) that displays on the form.
    • OPTIONAL
    • Example: <obs conceptId="6689" style="yes_no" noLabel="non" yesLabel="oui" />
    • Value: Any quoted string.
    • Default: "No"
    required: Sets this field as a required field
    • Value: "radio", "checkbox", "dropdown", "yes_no", "no_yes", "yes_no_dropdown", "no_yes_dropdown", "textarea", "autocomplete", "location", "person"
    • Default: Driven by datatype of associated concept.
  • value: When set to "false", a checked checkbox signifies a value of false for the concept. It inverts the normal relationship where a checked checkbox signifies "true". rows: Number of rows in the textarea (implies style="textarea")
    • OPTIONAL
    • Example: <obs conceptId="3453" required2146" style="checkbox" value="truefalse" />
    • Value: True or false
  • role: Limits the person drop-down list to only include persons who have an associated User account with specified Role
    • OPTIONAL
    • Only affects when style="person"
    • Example: <obs concept="PIH: Name of Rehabilitation educator" style="person" role="Rehab educator" />
    • Default: Provider 
    • Default: True
  • yesLabel: Defines the label for the "yes" option for all styles with a "yes" parameter. Commonly used to change label from "Yes" to "Oui"
    • OPTIONAL
    • Example: <obs conceptId="6689" style="3221yes_no" rowsnoLabel="7non" colsyesLabel="60oui" />
    • Value: Positive IntegerAny quoted string.
    • Default: None"Yes"
  • showAccessionNumber: Sets whether or not to show a field to set the obs.accession_number for this obs
    • OPTIONAL
    • Example: <obs conceptId="3232" showAccessionNumber="true" />
    • Value: True or false
    • Default: None
  • showCommentField: Sets whether or not to show a text field to set the obs.comments for this obs
    • OPTIONAL
    • Example: <obs conceptId="3232" showCommentField="true" />
    • Value: True or false
    • Default: None
  • showDate: Sets whether or not to show a date widget to set the obs.datetime for this obs
    • OPTIONAL
    • Example: <obs conceptId="3232" showDate="true" />
    • Value: True or false
    • Default: False
  • size: Specifies the size of a text field.
    • OPTIONAL
    • Example: <obs conceptId="2216" labelText="Résultats: " size="80" />
    • Value: Positive integer
    • Default:?
  • style: Specifies the type of input element (radio, checkbox, dropdown, yes/no, etc.) that displays on the form.
    • OPTIONAL
    • Example: <obs conceptId="6689" style="yes_no" noLabel="non" yesLabel="oui" />
    • Value: "radio", "checkbox", "dropdown", "yes_no", "no_yes", "yes_no_dropdown", "no_yes_dropdown", "textarea", "autocomplete", "location", "person"
    • Default: Driven by datatype of associated concept.
  • value: When set to "false", a checked checkbox signifies a value of false for the concept. It inverts the normal relationship where a checked checkbox signifies "true".
    • OPTIONAL
    • Example: <obs conceptId="2146" style="checkbox" value="false" />
    • Value: True or false
    • Default: True
  • yesLabel: Defines the label for the "yes" option for all styles with a "yes" parameter. Commonly used to change label from "Yes" to "Oui"
  • OPTIONAL
  • Example: <obs conceptId="6689" style="yes_no" noLabel="non" yesLabel="oui" />
  • Value: Any quoted string.
  • Default: "Yes"toggle: For checkbox style fields only, specify the id of a div or span that you wish to hide or disable depending on whether the checkbox is checked or not.
    • OPTIONAL
    • The toggle attribute accepts two syntaxes (see below).
      • Basic: The basic syntax simply accepts the DOM id of the target div or span:
      • Code Block
        html
        html
        <obs conceptId="12" answerConceptId="116" answerLabel="Patient has a hat" style="checkbox" toggle="hatColors"/>
        
        <div id="hatColors">
           What color is your hat?
           <obs conceptId="101" answerConceptIds="309,374,377" answerLabels="red,green,blue" style="Radio"/><br/>
           <obs conceptId="103" answerConceptId="394" answerLabel="Hat is warm" style="checkbox" id="hatWarmInd"/>
        </div>
      • Advanced: The more advanced syntax accepts a JSON structure with the attributes: id and style. The "id" attribute is the DOM id of target div/span that you wish to hide or disable. The "style" attribute accepts either "hide" (default) or "dim". The "hide" style completely hides the target div/span until the checkbox is checked. The "dim" style greys-out and disables the child components of the target div/span until the checkbox is checked.
      • Code Block
        html
        html
        <obs conceptId="12" answerConceptId="116" answerLabel="Patient has a hat" style="checkbox" toggle="{id: 'hatColors', style: 'dim'}"/>
        
        <div id="hatColors">
           What color is your hat?
           <obs conceptId="101" answerConceptIds="309,374,377" answerLabels="red,green,blue" style="Radio"/><br/>
           <obs conceptId="103" answerConceptId="394" answerLabel="Hat is warm" style="checkbox" id="hatWarmInd"/>
        </div>
    • Version: Available since version 1.11.0

Related Tags

<obsgroup>

...