OpenMRSConceptService

public interface OpenMRSConceptService

Interface for handling concepts on the OpenMRS server.

Methods

createConcept

Concept createConcept(String configName, Concept concept)

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

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

the created concept

deleteConcept

void deleteConcept(String configName, String uuid)

Deletes the concept with the given uuid from the OpenMRS server. Configuration with the given configName will be used while performing this action.

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

getAllConcepts

List<Concept> getAllConcepts(String configName)

Returns the basic information (UUID and name) about all the concepts stored on the OpenMRS server. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
Returns:

the list of all concepts

getConceptByUuid

Concept getConceptByUuid(String configName, String uuid)

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

the concept with the given UUID

getConcepts

List<Concept> getConcepts(String configName, int page, int pageSize)

Returns a list of the concepts. The returned list will contain maximum of pageSize concepts fetched from the page with the given page number. The list might contain less entries if the given page is the last one and there is less than pageSize concepts on it. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • page – the number of the page
  • pageSize – the size of the page
Returns:

the list of concepts on the given page

resolveConceptUuidFromConceptName

String resolveConceptUuidFromConceptName(String configName, String name)

Returns the UUID of the concept with the given name. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • name – the name of the concept
Returns:

the UUID of the concept

updateConcept

Concept updateConcept(String configName, Concept concept)

Updates the concept with the information stored in the given concept. Fields name, names and display name will be ignored as changing them is not allowed by the system. Configuration with the given configName will be used while performing this action.

Parameters:
  • configName – the name of the configuration
  • concept – the concept used as an update source
Returns:

the updated concept