OpenMRSPersonService

public interface OpenMRSPersonService

Interface for handling persons on the OpenMRS server.

Methods

createPerson

Person createPerson(String configName, Person person)

Creates the given person on the OpenMRS server. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • person – the person to be created
Returns:

the created person

createPerson

Person createPerson(String configName, String firstName, String lastName, DateTime dateOfBirth, String gender, String address, List<Attribute> attributes)

Creates a person on the OpenMRS server based on the given information. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • firstName – the person’s first name
  • lastName – the person’s last name
  • dateOfBirth – the person’s date of birth
  • gender – the person’s gender
  • address – the address of the person
  • attributes – a list of attributes for the person

deletePerson

void deletePerson(String configName, String uuid)

Deletes the person with the given uuid from the OpenMRS server. If the person with the given uuid doesn’t exist an error will be logged. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • uuid – the UUID of the person

getPersonByUuid

Person getPersonByUuid(String configName, String uuid)

Returns the person with the given uuid. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • uuid – the UUID of the person
Returns:

the person with the given UUID, null if the person doesn’t exist

updatePerson

Person updatePerson(String configName, Person person)

Updates the person with the information stored in the given person. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • person – the person to be used as an update source
Returns:

the updated person