OpenMRSPatientService

public interface OpenMRSPatientService

Interface for handling patients on the OpenMRS server.

Methods

createPatient

Patient createPatient(String configName, Patient patient)

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

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

the created patient

deceasePatient

void deceasePatient(String configName, String motechId, Concept causeOfDeath, Date dateOfDeath, String comment)

Marks a patient with the given motechId as dead with the given dateOfDeath, causeOfDeath and a comment. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • motechId – the MOTECH ID of the patient
  • causeOfDeath – the cause of death
  • dateOfDeath – the date of death
  • comment – the additional information for the cause of death
Throws:

deletePatient

void deletePatient(String configName, String uuid)

Deletes the patient 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 patient
Throws:

getPatientByIdentifier

Patient getPatientByIdentifier(String configName, String identifierId, String identifierName)

Returns the patient with the given identifierName and identifierId. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • identifierId – the identifier id of the patient
  • identifierName – the identifier name of the patient
Returns:

the patient with the given identifier, null if the patient doesn’t exist

getPatientByMotechId

Patient getPatientByMotechId(String configName, String motechId)

Returns the patient with the given motechId. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • motechId – the MOTECH ID of the patient
Returns:

the patient with the given MOTECH ID, null if the patient doesn’t exist

getPatientByUuid

Patient getPatientByUuid(String configName, String uuid)

Returns the patient 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 patient
Returns:

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

updatePatient

Patient updatePatient(String configName, Patient patient, String currentMotechId)

Updates the patient with the given currentMotechId with the information stored in the given patient (including the new MOTECH ID passed in the given patient). Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • patient – the patient to be used as an update source
  • currentMotechId – the current MOTECH ID of the patient to update (used for searching)
Returns:

the updated patient

updatePatient

Patient updatePatient(String configName, Patient patient)

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

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

the updated patient

updatePatientIdentifiers

Patient updatePatientIdentifiers(String configName, Patient patient)

Updates the patient’s identifier with the information stored in the given patient. Configuration with the given configName will be used while performing this action.

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

the updated patient