This is a stub page that needs to be filled in
A Person object in openmrs OpenMRS represents either a Patient or a User. (TODO: links) A Person can have multiple PersonNames and multiple PersonAddresses. There are is some general metadata defined on the a Person object (birthdate, deathdate, gender, etc.), but most attributes of a Person are custom to a certain install location. This is where PersonAttributes come in; they are additional "columns" on a Person that are defined by the implementation. Two or more Person objects can be linked by a Relationship.
A Person object is the basis for all humans in the OpenMRS system.
Properties on a Person:
Inherited from BaseOpenMRSData:
// Gets Person objects with the given criteria. public List<Person> getPeople(String searchPhrase, Boolean dead); // Saves the given Person object to the database. Saves will cascade down onto the Person's fields (PersonName, PersonAddress, etc.) public Person savePerson(Person person); // Marks the given Person as invalid. All associated data will be left as-is. public Person voidPerson(Person person, String reason); // Gets all PersonAttributeTypes in the system. public List<PersonAttributeType> getAllPersonAttributeTypes(); // Gets all Relationships in the system. public List<Relationship> getAllRelationships(); // Gets all RelationshipTypes in the system. public List<RelationshipType> getAllRelationshipTypes(); // Gets all PersonAttributeTypes in the system. public List<PersonAttributeType> getAllPersonAttributeTypes();
Person person = Context.getPersonService().getPersonByUuid("1234-56789-123"); person.setGender("M"); person.addName(new PersonName("Jim", "Bob", "Smith")); Context.getPersonService().savePerson(person);
The Person class source code can be seen here.
The PersonService class source code can be seen here.
A module demonstrating how to use this class can be seen here.
A PersonName object represents a person's name. A Person can have multiple PersonName objects. A PersonName's primary information is contained in the givenName, middleName, and familyName fields.
Properties on a PersonName:
The PersonName class source code can be seen here.
A PersonAddress object represents a person's address. A PersonAddress's primary information is contained in the address1, address2, cityVillage, countryDistrict, stateProvince, country, and postalCode fields.
PersonAddress implements the Address interface.
Properties on a PersonAddress:
The PersonAddress class source code can be seen here.
A PersonAttribute object represents arbitrary information about a Person
Also see . A PersonAttribute is essentially a key-value pair tied to a Person object. The value can have anything in it, including a foreign key reference to another table.
Properties on a PersonAttribute:
The PersonAttribute class source code can be seen here.
A PersonAttributeType exists to group PersonAttribute objects together.
Properties on a PersonAttributeType:
The PersonAttributeType class source code can be seen here.
See also Managing Person Attribute Types
A relationship pairs two Person objects together.
Properties on a Relationship:
The Relationship class source code can be seen here.
A RelationshipType defines a type of relationship between two Person objects.
Properties on a RelationshipType:
The RelationshipType class source code can be seen here.
This is a class diagram for the Person class and the classes it uses in its properties. This provides an at-a-glance summary of the classes, their fields, and their methods.
The XML file can be edited in case of future changes.