CommcareSchemaService

public interface CommcareSchemaService

The CommcareSchemaService is responsible for retrieving CommCare applications and schemas from MOTECH database. The important point is that implementers should NOT query CommCareHQ for data, but rather use current, local copy of the data.

Methods

getAllCaseTypes

Map<String, Set<String>> getAllCaseTypes(String configName)

Retrieves case types and fields that are assigned to the case type.

Returns:Map of case types. Key represents a case type, while a value is a collection of fields assigned to the case type.

getAllCaseTypes

Map<String, Set<String>> getAllCaseTypes()

Same as getAllCaseTypes but uses default CommcareHQ configuration.

getAllFormSchemas

List<FormSchemaJson> getAllFormSchemas(String configName)

Retrieves form schemas for all modules from MOTECH database for given configuration..

Returns:List of all from schemas

getAllFormSchemas

List<FormSchemaJson> getAllFormSchemas()

Same as getAllFormSchemas but uses default CommcareHQ configuration.

getCaseTypesWithApplicationName

Set<CaseTypeWithApplicationName> getCaseTypesWithApplicationName(String configName)

Retrieves case types with application name

Returns:Set of Cases with display names

getFormsWithApplicationName

Set<FormWithApplicationName> getFormsWithApplicationName(String configName)

Retrieves forms with application name

Returns:Set of Forms with display names.

getReportsMetadata

List<ReportsMetadataInfo> getReportsMetadata(String configName)

Retrieves reports metadata by configuration name

Returns:the list of matching reports metadata

retrieveApplications

List<CommcareApplicationJson> retrieveApplications(String configName)

Retrieves applications by configuration name

Returns:the list of matching applications