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.

...

  • type: this is the relationship_type_id (or UUID) for the relationship that should be created for the selected person.
    • REQUIRED
    • Examples
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" />
      • <relationship type="0cbe2ed3-cd5f-4f46-9459-26127c9265ab" whoAmI="A" changeExistingRelationship="true" />
    • Value: Any valid relationship type ID or UUID for a relationship type
    • Default: NONE
  • whoAmI: this is the side of the relationship the patient the form is being entered on is. For example in a Parent to Child relationship, if the form is being filled out for the child then the whoAmI value should be set to "B" whereas if the form is being filled out for the parent then the whoAmI value should be set to "A"
    • REQUIRED
    • Examples
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" />
      • <relationship type="1" whoAmI="B" changeExistingRelationship="true" />
    • Value: "A" or "B"
    • Default: NONE
  • changeExistingRelationship: this attribute determines if new relationships should be added in addition to existing relationships or should replace the existing relationships of that type. So if this value is set to true, any existing relationships of that type will be replaced. If the attribute is set to false then a new relationship will be added in addition to any existing relationships.
    • REQUIRED
    • Examples
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" />
      • <relationship type="1" whoAmI="A" changeExistingRelationship="false" />
    • Value: "true" or "false"
    • Default: NONE
  • required: this is used for validation, and if true the form will not be able to be submitted without the required relationships existing for the patient. The code checks to see if the patient already has relationships existing, so validation will not fail if the required relationship types were set up prior to entering the form (in this situation the data entry clerk can edit or add new relationships or just ignore the question). The relationship widget displays to the user all existing relationships (for the types we care about in the tag), so the data entry clerk should be able to decide if entry on this question is needed.
    • OPTIONAL
    • Examples
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" required="true" />
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" required="false" />
    • Value: "true" or "false"
    • Default: false
  • requireAttributes: this attribute restricts the search results based on person_attributes. This attribute takes in a comma separated list of attributes. Each attribute can be entered as a name value pair (separated by a ',' for example Health Center:Rwinkwavu Health Center. Alternatively the attribute value can be entered in the format of ${currentPatientAttribute("Health Center")}, in this case the relationship tag will retrieve the value of Health Center attribute for the patient of the form and use this value as the valueto match. The value for the attribute is optional, and if left out then the search will return any people that possess the specified person_attribute.  If multiple attributes are specified, only persons that match all of the specified attributes are displayed.
    • OPTIONAL
    • Examples
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" requireAttributes="Health Center:Rwinkwavu Health Center" />
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" requireAttributes="Health Center:$#36;${currentPatientAttribute("Health Center")" />
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" requireAttributes="Health Center" />
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" requireAttributes="Health Center:Florida,Citizenship:USA" />
    • Value: any valid person attribute type and optionally the value the person attribute should have.
    • Default: NONE
  • programIds: this attribute allows the search results to be filtered based on program enrollment. So this takes in a comma separated list of the program ids (or UUIDs). This can be used in conjunction with the personAttributes if necessary. If multiple programs are specified, only patients in all of the specified programs are displayed.
    • OPTIONAL
    • Examples
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" programIds="1" />
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" programIds="1,5" />
      • <relationship type="1" whoAmI="A" changeExistingRelationship="true" programIds="0cbe2ed3-cd5f-4f46-9459-26127c9265ab" />
    • Value: Any valid program ID, program UUID or underlying concept name
    • Default: NONE
  • display: This attribute determines which widget is displayed to the user to pick the person for the relationship. A value of “search” will present the user with a popup search box, allow them to enter a search term then select from the returned list. All searches in the tag search are based on person not patient, however you can search on patient identifiers and it will work. A value of “dropDown” presents the people in a simple drop down. If the drop down list is used when a large number of people are returned then this slows down the loading of the form, so drop down box option can only be used in conjunction with the requireAttributes and/or programId fields.
    • OPTIONAL
    • Examples
      • <relationship type="1" ="1" whoAmI="A" changeExistingRelationship="true" display="search" />
      • <relationship type="1" ="1" whoAmI="A" changeExistingRelationship="true" display="dropDown" />
    • Value: "search" or "dropDown"
    • Default: search

...