Versions Compared

Key

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

Create a New Person Attribute Type

  • Go to Administration screen
  • Click Manage Person Attributes Types
  • Click Add New Person Attribute
  • Field definitions:
    • Name: Any string you want to recognize this type by. Spaces should not be used
    • Format: Most likely it will be java.lang.String. Other possibilities are org.openmrs.User, org.openmrs.Concept, and org.openmrs.util.AttributableDate (version 1.4)
    • Foreign Key: The only time a foreign key value is needed is when you are using a separate table for the answers. A good example of this is the Civil Status attribute that links to the concept civil status for its possible answers, see here on how to implement it More information about coded concepts is available elsewhere on the wiki.  
    • Searchable: Whether or not this attribute is included in searches
    • Description: Text blob describing this type
    • Edit privilege:The privilege needed by user to edit this person attribute.

Listing and Viewing of Person Attribute Types

...

  • Create a field of type "database element". Set the `table` to be "person_attribute" and the `attribute` to be "value".
  • If you want them to then appear with data in the forms, you need to be able to define a default value.
    • Person attribute data is entered on the Edit patient pages. Attributes are viewed in InfoPath by setting the field's `Default Value` to: ${patient.attributeMap.Cell} where "Cell" is the attribute type name.

Anchor
coded person attribute
coded person attribute
Creating Coded Person Attributes

  • Create a person attribute, per usual steps
    • Format:  org.openmrs.Concept (indicates this value is being linked to a concept from the dictionary)
    • Foreign Key: enter the concept_id for the concept from which you would like to use the coded responses
    • As mentioned earlier, a good example of this is the Civil Status attribute, which links to the "civil status" concept for its possible coded answers (married, single, divorced, etc.). 

...