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.

...

  • 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
  • Per If the showDate parameter is not used, the encounterDate tag must appear above the enrollInProgram tag. See
    Jira
    serverOpenMRS Issues
    serverId45c5771b-fa4b-3e43-b34a-c19dc45ccc95
    keyHTML-309
    , if the showDate parameter is not used, the encounterDate tag must appear above the enrollInProgram tag

Attributes

  • locationTag: if specified, the enrollment location of the patient program is set to the encounter location if  the encounter location is tagged with the specified tag; otherwise it searches up through the parent locations of the location and uses the first location found with that tag. If no matching location found with that tag, enrollment location is not set.  Note that this only sets  the location on initial enrollment, it does not edit the enrollment location if the encounter location is later edited.  Also, note that if this tag is not  present, no enrollment location is set (which was default behavior before introduction of this tag).
    • OPTIONAL
    • Example:
      • <enrollInProgram programId="Rehab program" locationTag="Program Location"/>
    • Since version 3.12.0
  • programId: ID or UUID of the program, or name of the associated concept, in which the patient is to be enrolled.
    • REQUIRED
    • Examples: 
      • <enrollInProgram programId="1"/> 
      • <enrollInProgram programId="9b45541a-e8f0-41ff-a55a-445b08a8d8b5"/> 
      • <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
  • showCheckbox: If true, a checkbox widget is displayed. The patient is only enrolled if the box is checked. If the patient is already enrolled, the box is checked and disabled – it cannot be used to un-enroll a patient. Whether or not the patient is enrolled is based on the existing encounter date if there is one, else the default encounter date, else today.
    • OPTIONAL
    • Example: <enrollInProgram programId="1" showCheckbox="true"/>
    • Value: true or false
    • Default: False
    • Since version 3.9.0
  • toggle: If showCheckbox is enabled, specifies the ID of a DOM element to hide or dim when the checkbox is unticked.
    • OPTIONAL
    • showCheckbox must be "true"
    • The toggle attribute accepts two syntaxes:
      • Basic: The basic syntax simply accepts the ID of the DOM element. It hides the element when the checkbox is not ticked.

        Code Block
        html
        html
        <enrollInProgram id="ANC" showCheckbox="true" toggle="anc-form"/>
        
        <div id="anc-form">
           Favorite baby name
           <obs conceptId="101" style="textarea"/>
        </div>


      • Advanced: The more advanced syntax accepts a JSON structure with the attributes "id" and "style". The "id" attribute is the ID of the DOM element that you wish to hide or disable. The "style" attribute accepts either "hide" (default) or "dim". The "hide" style completely hides the target element until the checkbox is checked. The "dim" style greys-out and disables the child components of the target element until the checkbox is checked.

        Code Block
        html
        html
        <enrollInProgram id="ANC" showCheckbox="true" toggle="{ id: 'anc-form', style: 'dim' }"/>
        
        <div id="anc-form">
           Fetal hair color
           <obs conceptId="102" style="textarea"/>
        </div>


    • Since version 3.9.0
  • 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!

...