Package org.hisp.dhis
Class Dhis2
java.lang.Object
org.hisp.dhis.BaseDhis2
org.hisp.dhis.Dhis2
DHIS 2 API client for HTTP requests and responses. Request and response bodies are in JSON
format. Client is tread-safe and suitable for reuse.
Methods generally throw Dhis2ClientException for status code 401, 403
and 404 in HTTP responses.
- Author:
- Lars Helge Overland
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAuthority which provides superuser authorization in DHIS 2.Fields inherited from class org.hisp.dhis.BaseDhis2
CATEGORY_COMBO_FIELDS, CATEGORY_FIELDS, CATEGORY_OPTION_COMBO_FIELDS, CATEGORY_OPTION_FIELDS, CATEGORY_OPTION_GROUP_FIELDS, CATEGORY_OPTION_GROUP_SET_FIELDS, config, DASHBOARD_FIELDS, DATA_ELEMENT_FIELDS, DATA_ELEMENT_GROUP_SET_FIELDS, DATA_SET_FIELDS, DATA_SET_PARAM, DATA_SET_VALIDATION_FIELDS, FIELDS_PARAM, httpClient, ID_FIELDS, INDICATOR_FIELDS, INDICATOR_GROUP_SET_FIELDS, INDICATOR_TYPE_FIELDS, ME_FIELDS, NAME_FIELDS, objectMapper, OPTION_SET_FIELDS, ORG_UNIT_FIELDS, ORG_UNIT_GROUP_SET_FIELDS, PROGRAM_FIELDS, PROGRAM_STAGE_DATA_ELEMENT_FIELDS, SKIP_SHARING_PARAM, TRACKED_ENTITY_ATTRIBUTE_FIELDS, TRACKED_ENTITY_TYPE_FIELDS, VALIDATION_RULE_FIELDS, VALIDATION_SIDE_FIELDS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOrgUnitToOrgUnitGroup(String orgUnitGroup, String orgUnit) Adds the program to the org unit.addOrgUnitToProgram(String program, String orgUnit) Adds the program to the org unit.Retrieves aDataValueSet.getCategories(Query query) Retrieves a list ofCategory.getCategory(String id) Retrieves anCategory.Retrieves anCategoryCombo.getCategoryCombos(Query query) Retrieves a list ofCategoryCombo.Retrieves anCategoryOption.Retrieves anCategoryOptionCombo.getCategoryOptionCombos(Query query) Retrieves a list ofCategoryOptionCombo.Retrieves anCategoryOptionGroup.getCategoryOptionGroups(Query query) Retrieves a list ofCategoryOptionGroup.Retrieves anCategoryOptionGroupSet.getCategoryOptionGroupSets(Query query) Retrieves a list ofCategoryOptionGroupSet.getCategoryOptions(Query query) Retrieves a list ofCategoryOption.Retrieves a list ofCompleteDataSetRegistration.getDashboard(String id) Retrieves aDashboard.getDashboards(Query query) Retrieves a list ofDashboard.getDataElement(String id) Retrieves anDataElement.Retrieves anDataElementGroup.getDataElementGroups(Query query) Retrieves a list ofDataElementGroup.Retrieves anDataElementGroupSet.getDataElementGroupSets(Query query) Retrieves a list ofDataElementGroupSet.getDataElements(Query query) Retrieves a list ofDataElement.getDataSet(String id) Retrieves anDataSet.getDataSets(Query query) Retrieves a list ofDataSet.getDatastoreEntries(String namespace, List<String> fields) Retrieves a list of data store entries.<T> TgetDataStoreEntry(String namespace, String key, Class<T> type) Retrieves a data store entry.getDataStoreEntryMetadata(String namespace, String key) Retrieves metadata for a data store entry.getDataStoreKeys(String namespace) Retrieves all data store keys for the given namespace.Retrieves all data store namespaces.getDataValueFile(DataValueQuery query) Retrieves the content of a file resource from aDataValue.getDataValueSet(DataValueSetQuery query) Retrieves aDataValueSet.Returns the URL of the DHIS 2 configuration.getDimension(String id) Retrieves aDimension.getDimensions(Query query) Retrieves a list ofDimension.Retrieves anEvent.getEvents(EventsQuery query) Retrieves anEvents.Retrieves aFileResource.Retrieves a list of "filled"OrgUnitLevel, meaning any gaps in the persisted levels will be inserted by generated levels.getIndicator(String id) Retrieves anIndicator.Retrieves anIndicatorGroup.getIndicatorGroups(Query query) Retrieves a list ofIndicatorGroup.Retrieves anIndicatorGroupSet.getIndicatorGroupSets(Query query) Retrieves a list ofIndicatorGroupSet.getIndicators(Query query) Retrieves a list ofIndicator.Retrieves anIndicatorType.getIndicatorTypes(Query query) Retrieves a list ofIndicatorType.getJobNotifications(JobCategory category, String id) Retrieves a list ofJobNotification.Retrieves aGeoMap.Retrieves a list ofGeoMap.getMe()Retrieves information about the current authenticated user.getOptionSet(String id) Retrieves anOptionSet.getOptionSets(Query query) Retrieves a list ofOptionSet.getOrgUnit(String id) Retrieves anOrgUnit.Retrieves anOrgUnitGroup.getOrgUnitGroups(Query query) Retrieves a list ofOrgUnitGroup.Retrieves anOrgUnitGroupSet.getOrgUnitGroupSets(Query query) Retrieves a list ofOrgUnitGroupSet.Retrieves anOrgUnitLevel.getOrgUnitLevels(Query query) Retrieves a list ofOrgUnitLevel.getOrgUnits(Query query) Retrieves a list ofOrgUnit.getOrgUnitSubHierarchy(String id, Integer level, Query query) Retrieves a list ofOrgUnitwhich represents the sub-hierarchy of the given parent org unit.getPeriodTypes(Query query) Retrieves a list ofPeriodType.getProgram(String id) Retrieves aProgram.Retrieves aProgramIndicator.getProgramIndicators(Query query) Retrieves a list ofProgramIndicator.getPrograms(Query query) Retrieves a list ofProgram.Checks the status of the DHIS 2 instance.Retrieves theSystemInfo.RetrievesSystemSettings.getTableHook(String id) Retrieves anTableHook.getTableHooks(Query query) Retrieves a list ofTableHook.Retrieves aTrackedEntityType.getTrackedEntityTypes(Query query) Retrieves a list ofTrackedEntityType.Retrieves the list of authorities granted to the authenticated user.getValidationRules(String dataSet) Retrieves a list ofValidationRule.Retrieves aVisualization.getVisualizations(Query query) Retrieves a list ofVisualization.booleanisCategory(String id) Indicates whether aCategoryexists.booleanisDataElement(String id) Indicates whether aDataElementexists.booleanIndicates whether anOrgUnitexists.booleanIndicates whether aProgramexists.mergeOrgUnits(OrgUnitMergeRequest request) Performs an org unit merge operation.booleanobjectExists(String path) Indicates whether an object exists at the given URL path using HTTP HEAD.removeCategory(String id) Removes aCategory.Removes aCategoryCombo.Removes aCategoryOption.Removes aCategoryOptionGroup.Removes aCategoryOptionGroupSet.Removes aDashboard.Removes aDataElement.Removes aDataElementGroup.Removes aDataElementGroupSet.removeDataSet(String id) Removes aDataSet.removeDataStoreEntry(String namespace, String key) Removes a data store entry.removeDataStoreNamespace(String namespace) Removes a namespace including all entries.removeEvent(Event event) Removes anEvent.removeEvents(Events events) Removes anEvents.Removes anIndicator.Removes anIndicatorGroup.Removes anIndicatorGroupSet.Removes anIndicatorType.Removes aGeoMap.Removes anOptionSet.removeOrgUnit(String id) Removes aOrgUnit.Removes aOrgUnitGroup.Removes aOrgUnitGroupSet.removeProgram(String id) Removes aProgram.Removes aProgramIndicator.Removes aTableHook.Removes aVisualization.saveCategories(List<Category> categories) Saves or updates the list ofCategory.saveCategory(Category category) Saves aCategory.saveCategoryCombo(CategoryCombo categoryCombo) Saves aCategoryCombo.saveCategoryOption(CategoryOption categoryOption) Saves aCategoryOption.saveCategoryOptions(List<CategoryOption> categoryOptions) Saves or updates the list ofCategoryOption.Saves a complete data set registration payload in JSON format represented by the given file.saveCompleteDataSetRegistrations(InputStream inputStream, CompleteDataSetRegistrationImportOptions options) Saves a complete data set registration payload in JSON format represented by the given input stream.saveCompleteDataSetRegistrations(List<CompleteDataSetRegistration> completeDataSetRegistrations, CompleteDataSetRegistrationImportOptions options) Saves or updates the list ofCompleteDataSetRegistration.saveDataElement(DataElement dataElement) Saves aDataElement.saveDataElementGroup(DataElementGroup dataElementGroup) Saves aDataElement.saveDataElementGroups(List<DataElementGroup> dataElementGroups) Saves or updates the list ofDataElementGroup.saveDataElements(List<DataElement> dataElements) Saves or updates the list ofDataElement.<T> ResponsesaveDataStoreEntry(String namespace, String key, T object) Saves a data store entry.saveDataValueSet(File file, DataValueSetImportOptions options) Saves a data value set payload in JSON format represented by the given file.saveDataValueSet(InputStream inputStream, DataValueSetImportOptions options) Saves a data value set payload in JSON format represented by the given input stream.saveDataValueSet(DataValueSet dataValueSet, DataValueSetImportOptions options) Saves aDataValueSet.saveEvents(Events events) Saves anEvents.saveOrgUnit(OrgUnit orgUnit) Saves aOrgUnit.saveOrgUnitGroup(OrgUnitGroup orgUnitGroup) Saves aOrgUnitGroup.saveOrgUnitGroups(List<OrgUnitGroup> orgUnitGroups) Saves or updates the list ofOrgUnitGroup.saveOrgUnitGroupSet(OrgUnitGroupSet orgUnitGroupSet) Saves aOrgUnitGroupSet.saveOrgUnitGroupSets(List<OrgUnitGroupSet> orgUnitGroupSets) Saves or updates the list ofOrgUnitGroupSet.saveOrgUnits(List<OrgUnit> orgUnits) Saves or updates the list ofOrgUnit.saveTableHook(TableHook tableHook) Saves aTableHook.saveTableHooks(List<TableHook> tableHooks) Saves or updates the list ofTableHook.splitOrgUnit(OrgUnitSplitRequest request) Performs an org unit split operation.updateCategory(Category category) Updates aCategory.updateCategoryOption(CategoryOption categoryOption) Updates aCategoryOption.updateDataElement(DataElement dataElement) Updates aDataElement.updateDataElementGroup(DataElementGroup dataElementGroup) Updates aDataElementGroup.<T> ResponseupdateDataStoreEntry(String namespace, String key, T object) Updates a data store entry.updateOrgUnit(OrgUnit orgUnit) Updates aOrgUnit.updateOrgUnitGroup(OrgUnitGroup orgUnitGroup) Updates aOrgUnitGroup.updateOrgUnitGroupSet(OrgUnitGroupSet orgUnitGroupSet) Updates aOrgUnitGroupSet.updateTableHook(TableHook tableHook) Updates aTableHook.static Dhis2withAccessTokenAuth(String url, String accessToken) Creates aDhis2instance configured for access token (PAT) authentication.static Dhis2withBasicAuth(String url, String username, String password) Creates aDhis2instance configured for basic authentication.static Dhis2withCookieAuth(String url, String sessionId) Creates aDhis2instance configured for cookie authentication.voidwriteAnalyticsDataValueSet(AnalyticsQuery query, File file) Retrieves aDataValueSetand writes it to the given file.Methods inherited from class org.hisp.dhis.BaseDhis2
addToCollection, executeJsonPostPutRequest, executeRequest, getAnalyticsQuery, getAnalyticsResponse, getCompleteDataSetRegistrationQuery, getDataSetValidationQuery, getDataSetValidationResponse, getDataValueFileResponse, getDataValueQuery, getDataValueSetImportQuery, getDataValueSetQuery, getDataValueSetResponse, getEventsQuery, getEventsResponse, getJsonHttpResponse, getObject, getObject, getObject, getObjectFromUrl, getObjectQuery, getPostRequest, newDhis2ClientException, objectExists, readValue, removeMetadataObject, removeObject, saveCompleteDataSetRegistrations, saveMetadataObject, saveMetadataObjects, saveObject, saveObject, toJsonString, toNameValuePairs, updateMetadataObject, updateObject, withAuth, writeToFile
-
Field Details
-
SUPER_AUTH
Authority which provides superuser authorization in DHIS 2.- See Also:
-
-
Constructor Details
-
Dhis2
-
-
Method Details
-
withBasicAuth
Creates aDhis2instance configured for basic authentication.- Parameters:
url- the URL to the DHIS 2 instance, do not include the/apipart or a trailing/.username- the DHIS 2 account username.password- the DHIS 2 account password.- Returns:
- a
Dhis2instance.
-
withAccessTokenAuth
Creates aDhis2instance configured for access token (PAT) authentication.- Parameters:
url- the URL to the DHIS 2 instance, do not include the/apipart or a trailing/.accessToken- the access token (PAT).- Returns:
- a
Dhis2instance.
-
withCookieAuth
Creates aDhis2instance configured for cookie authentication.- Parameters:
url- the URL to the DHIS 2 instance, do not include the/apipart or a trailing/.sessionId- the session identifier.- Returns:
- a
Dhis2instance.
-
getStatus
Checks the status of the DHIS 2 instance. Returns various status codes describing the status:HttpStatus.OKif instance is available and authentication isf successful.HttpStatus.UNAUTHORIZEDif the username and password combination is not valid.HttpStatus.NOT_FOUNDif the URL is not pointing to a DHIS 2 instance or the DHIS 2 instance is not available.
- Returns:
- the HTTP status code of the response.
-
getDhis2Url
Returns the URL of the DHIS 2 configuration.- Returns:
- the URL of the DHIS 2 configuration.
-
objectExists
Indicates whether an object exists at the given URL path using HTTP HEAD.- Parameters:
path- the URL path relative to the API end point.- Returns:
- true if the object exists.
-
getSystemInfo
Retrieves theSystemInfo.- Returns:
- the
SystemInfo.
-
getUserAuthorization
Retrieves the list of authorities granted to the authenticated user.- Returns:
- a list of authorities.
-
getMe
Retrieves information about the current authenticated user.- Returns:
- the current authenticated user.
-
saveDataStoreEntry
Saves a data store entry.- Type Parameters:
T- the object type.- Parameters:
namespace- the namespace.key- the key.object- the object.- Returns:
Responseholding information about the operation.
-
updateDataStoreEntry
Updates a data store entry.- Type Parameters:
T- the object type.- Parameters:
namespace- the namespace.key- the key.object- the object.- Returns:
Responseholding information about the operation.
-
getDataStoreNamespaces
Retrieves all data store namespaces.- Returns:
- the list of namespaces.
-
getDataStoreKeys
Retrieves all data store keys for the given namespace.- Parameters:
namespace- the namespace.- Returns:
- the list of keys.
-
getDataStoreEntry
Retrieves a data store entry.- Type Parameters:
T- the object type.- Parameters:
namespace- the namespace.key- the key.type- the class type of the object to retrieve.- Returns:
- the object associated with the given namespace and key.
-
getDatastoreEntries
Retrieves a list of data store entries.- Parameters:
namespace- the namespace.fields- the list of fields, must not be empty.- Returns:
- a list of data store entries.
-
getDataStoreEntryMetadata
Retrieves metadata for a data store entry.- Parameters:
namespace- the namespace.key- the key.- Returns:
- the
EntryMetadata.
-
removeDataStoreEntry
Removes a data store entry.- Parameters:
namespace- the namespace.key- the key.- Returns:
Responseholding information about the operation.
-
removeDataStoreNamespace
Removes a namespace including all entries.- Parameters:
namespace- the namespace.- Returns:
Responseholding information about the operation.
-
saveOrgUnit
Saves aOrgUnit.- Parameters:
orgUnit- the object to save.- Returns:
ObjectResponseholding information about the operation.
-
saveOrgUnits
Saves or updates the list ofOrgUnit.- Parameters:
orgUnits- the list ofOrgUnit.- Returns:
ObjectsResponseholding information about the operation.
-
updateOrgUnit
Updates aOrgUnit.- Parameters:
orgUnit- the object to update.- Returns:
ObjectResponseholding information about the operation.
-
removeOrgUnit
Removes aOrgUnit.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getOrgUnit
Retrieves anOrgUnit.- Parameters:
id- the object identifier.- Returns:
- the
OrgUnit. - Throws:
Dhis2ClientException- if the object does not exist.
-
isOrgUnit
Indicates whether anOrgUnitexists.- Parameters:
id- the object identifier.- Returns:
- true if the object exists.
-
getOrgUnitSubHierarchy
Retrieves a list ofOrgUnitwhich represents the sub-hierarchy of the given parent org unit. -
getOrgUnits
Retrieves a list ofOrgUnit. -
splitOrgUnit
Performs an org unit split operation.- Parameters:
request- theOrgUnitSplitRequest.- Returns:
- the
Responseholding information about the operation.
-
mergeOrgUnits
Performs an org unit merge operation. -
saveOrgUnitGroup
Saves aOrgUnitGroup.- Parameters:
orgUnitGroup- the object to save.- Returns:
ObjectResponseholding information about the operation.
-
saveOrgUnitGroups
Saves or updates the list ofOrgUnitGroup.- Parameters:
orgUnitGroups- the list ofOrgUnitGroup.- Returns:
ObjectsResponseholding information about the operation.
-
updateOrgUnitGroup
Updates aOrgUnitGroup.- Parameters:
orgUnitGroup- the object to update.- Returns:
ObjectResponseholding information about the operation.
-
removeOrgUnitGroup
Removes aOrgUnitGroup.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getOrgUnitGroup
Retrieves anOrgUnitGroup.- Parameters:
id- the object identifier.- Returns:
- the
OrgUnitGroup. - Throws:
Dhis2ClientException- if the object does not exist.
-
getOrgUnitGroups
Retrieves a list ofOrgUnitGroup.- Parameters:
query- theQuery.- Returns:
- list of
OrgUnitGroup.
-
addOrgUnitToOrgUnitGroup
Adds the program to the org unit.- Parameters:
orgUnitGroup- the org unit group identifier.orgUnit- the org unit identifier.- Returns:
- a
Response.
-
saveOrgUnitGroupSet
Saves aOrgUnitGroupSet.- Parameters:
orgUnitGroupSet- the object to save.- Returns:
ObjectResponseholding information about the operation.
-
saveOrgUnitGroupSets
Saves or updates the list ofOrgUnitGroupSet.- Parameters:
orgUnitGroupSets- the list ofOrgUnitGroupSet.- Returns:
ObjectsResponseholding information about the operation.
-
updateOrgUnitGroupSet
Updates aOrgUnitGroupSet.- Parameters:
orgUnitGroupSet- the object to update.- Returns:
ObjectResponseholding information about the operation.
-
removeOrgUnitGroupSet
Removes aOrgUnitGroupSet.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getOrgUnitGroupSet
Retrieves anOrgUnitGroupSet.- Parameters:
id- the object identifier.- Returns:
- the
OrgUnitGroupSet. - Throws:
Dhis2ClientException- if the object does not exist.
-
getOrgUnitGroupSets
Retrieves a list ofOrgUnitGroupSet.- Parameters:
query- theQuery.- Returns:
- list of
OrgUnitGroupSet.
-
getOrgUnitLevel
Retrieves anOrgUnitLevel.- Parameters:
id- the object identifier.- Returns:
- the
OrgUnitLevel. - Throws:
Dhis2ClientException- if the object does not exist.
-
getOrgUnitLevels
Retrieves a list ofOrgUnitLevel.- Parameters:
query- theQuery.- Returns:
- list of
OrgUnitLevel.
-
getFilledOrgUnitLevels
Retrieves a list of "filled"OrgUnitLevel, meaning any gaps in the persisted levels will be inserted by generated levels.- Returns:
- list of
OrgUnitLevel.
-
saveCategoryOption
Saves aCategoryOption.- Parameters:
categoryOption- the object to save.- Returns:
ObjectResponseholding information about the operation.
-
saveCategoryOptions
Saves or updates the list ofCategoryOption.- Parameters:
categoryOptions- the list ofCategoryOption.- Returns:
ObjectsResponseholding information about the operation.
-
updateCategoryOption
Updates aCategoryOption.- Parameters:
categoryOption- the object to update.- Returns:
ObjectResponseholding information about the operation.
-
removeCategoryOption
Removes aCategoryOption.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getCategoryOption
Retrieves anCategoryOption.- Parameters:
id- the object identifier.- Returns:
- the
CategoryOption. - Throws:
Dhis2ClientException- if the object does not exist.
-
getCategoryOptions
Retrieves a list ofCategoryOption.- Parameters:
query- theQuery.- Returns:
- list of
CategoryOption.
-
saveCategory
Saves aCategory.- Parameters:
category- the object to save.- Returns:
ObjectResponseholding information about the operation.
-
saveCategories
Saves or updates the list ofCategory.- Parameters:
categories- the list ofCategory.- Returns:
ObjectsResponseholding information about the operation.
-
updateCategory
Updates aCategory.- Parameters:
category- the object to update.- Returns:
ObjectResponseholding information about the operation.
-
removeCategory
Removes aCategory.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getCategory
Retrieves anCategory.- Parameters:
id- the object identifier.- Returns:
- the
Category. - Throws:
Dhis2ClientException- if the object does not exist.
-
isCategory
Indicates whether aCategoryexists.- Parameters:
id- the object identifier.- Returns:
- true if the object exists.
-
getCategories
Retrieves a list ofCategory. -
saveCategoryCombo
Saves aCategoryCombo.- Parameters:
categoryCombo- the object to save.- Returns:
ObjectResponseholding information about the operation.
-
removeCategoryCombo
Removes aCategoryCombo.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getCategoryCombo
Retrieves anCategoryCombo.- Parameters:
id- the object identifier.- Returns:
- the
CategoryCombo. - Throws:
Dhis2ClientException- if the object does not exist.
-
getCategoryCombos
Retrieves a list ofCategoryCombo.- Parameters:
query- theQuery.- Returns:
- list of
CategoryCombo.
-
getCategoryOptionCombo
Retrieves anCategoryOptionCombo.- Parameters:
id- the object identifier.- Returns:
- the
CategoryOptionCombo. - Throws:
Dhis2ClientException- if the object does not exist.
-
getCategoryOptionCombos
Retrieves a list ofCategoryOptionCombo.- Parameters:
query- theQuery.- Returns:
- list of
CategoryOptionCombo.
-
saveDataElement
Saves aDataElement.- Parameters:
dataElement- the object to save.- Returns:
ObjectResponseholding information about the operation.
-
saveDataElements
Saves or updates the list ofDataElement.- Parameters:
dataElements- the list ofDataElement.- Returns:
ObjectsResponseholding information about the operation.
-
updateDataElement
Updates aDataElement.- Parameters:
dataElement- the object to update.- Returns:
ObjectResponseholding information about the operation.
-
removeDataElement
Removes aDataElement.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getDataElement
Retrieves anDataElement.- Parameters:
id- the object identifier.- Returns:
- the
DataElement. - Throws:
Dhis2ClientException- if the object does not exist.
-
isDataElement
Indicates whether aDataElementexists.- Parameters:
id- the object identifier.- Returns:
- true if the object exists.
-
getDataElements
Retrieves a list ofDataElement.- Parameters:
query- theQuery.- Returns:
- list of
DataElement.
-
saveDataElementGroup
Saves aDataElement.- Parameters:
dataElementGroup- the object to save.- Returns:
ObjectResponseholding information about the operation.
-
saveDataElementGroups
Saves or updates the list ofDataElementGroup.- Parameters:
dataElementGroups- the list ofDataElementGroup.- Returns:
ObjectsResponseholding information about the operation.
-
updateDataElementGroup
Updates aDataElementGroup.- Parameters:
dataElementGroup- the object to update.- Returns:
ObjectResponseholding information about the operation.
-
removeDataElementGroup
Removes aDataElementGroup.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getDataElementGroup
Retrieves anDataElementGroup.- Parameters:
id- the object identifier.- Returns:
- the
DataElementGroup. - Throws:
Dhis2ClientException- if the object does not exist.
-
getDataElementGroups
Retrieves a list ofDataElementGroup.- Parameters:
query- theQuery.- Returns:
- list of
DataElementGroup.
-
removeDataElementGroupSet
Removes aDataElementGroupSet.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getDataElementGroupSet
Retrieves anDataElementGroupSet.- Parameters:
id- the object identifier.- Returns:
- the
DataElementGroupSet.
-
getDataElementGroupSets
Retrieves a list ofDataElementGroupSet.- Parameters:
query- theQuery.- Returns:
- list of
DataElementGroupSet.
-
removeIndicator
Removes anIndicator.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getIndicator
Retrieves anIndicator.- Parameters:
id- the object identifier.- Returns:
- the
Indicator.
-
getIndicators
Retrieves a list ofIndicator. -
removeIndicatorGroup
Removes anIndicatorGroup.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getIndicatorGroup
Retrieves anIndicatorGroup.- Parameters:
id- the object identifier.- Returns:
- the
IndicatorGroup. - Throws:
Dhis2ClientException- if the object does not exist.
-
getIndicatorGroups
Retrieves a list ofIndicatorGroup.- Parameters:
query- theQuery.- Returns:
- list of
IndicatorGroup.
-
removeIndicatorGroupSet
Removes anIndicatorGroupSet.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getIndicatorGroupSet
Retrieves anIndicatorGroupSet.- Parameters:
id- the object identifier.- Returns:
- the
IndicatorGroupSet.
-
getIndicatorGroupSets
Retrieves a list ofIndicatorGroupSet.- Parameters:
query- theQuery.- Returns:
- list of
IndicatorGroupSet.
-
removeIndicatorType
Removes anIndicatorType.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getIndicatorType
Retrieves anIndicatorType.- Parameters:
id- the object identifier.- Returns:
- the
IndicatorType.
-
getIndicatorTypes
Retrieves a list ofIndicatorType.- Parameters:
query- theQuery.- Returns:
- list of
IndicatorType.
-
removeDataSet
Removes aDataSet.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getDataSet
Retrieves anDataSet.- Parameters:
id- the object identifier.- Returns:
- the
DataSet.
-
getDataSets
Retrieves a list ofDataSet. -
getCompleteDataSetRegistrations
public List<CompleteDataSetRegistration> getCompleteDataSetRegistrations(CompleteDataSetRegistrationQuery query) Retrieves a list ofCompleteDataSetRegistration.- Parameters:
query- theQuery.- Returns:
- list of
CompleteDataSetRegistration.
-
saveCompleteDataSetRegistrations
public CompleteDataSetRegistrationResponse saveCompleteDataSetRegistrations(List<CompleteDataSetRegistration> completeDataSetRegistrations, CompleteDataSetRegistrationImportOptions options) Saves or updates the list ofCompleteDataSetRegistration.- Parameters:
completeDataSetRegistrations- the list ofCompleteDataSetRegistration.options- import optionsCompleteDataSetRegistrationImportOptions.- Returns:
CompleteDataSetRegistrationResponseholding information about the operation.
-
saveCompleteDataSetRegistrations
public CompleteDataSetRegistrationResponse saveCompleteDataSetRegistrations(File file, CompleteDataSetRegistrationImportOptions options) Saves a complete data set registration payload in JSON format represented by the given file.- Parameters:
file- the file representing the complete data set registration JSON payload.options- theCompleteDataSetRegistrationImportOptions.- Returns:
CompleteDataSetRegistrationResponseholding information about the operation.
-
saveCompleteDataSetRegistrations
public CompleteDataSetRegistrationResponse saveCompleteDataSetRegistrations(InputStream inputStream, CompleteDataSetRegistrationImportOptions options) Saves a complete data set registration payload in JSON format represented by the given input stream.- Parameters:
inputStream- the input stream representing the complete data set registration JSON payload.options- theDataValueSetImportOptions.- Returns:
CompleteDataSetRegistrationResponseholding information about the operation.
-
removeProgram
Removes aProgram.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getProgram
Retrieves aProgram.- Parameters:
id- the object identifier.- Returns:
- the
Program. - Throws:
Dhis2ClientException- if the object does not exist.
-
isProgram
Indicates whether aProgramexists.- Parameters:
id- the object identifier.- Returns:
- true if the object exists.
-
getPrograms
Retrieves a list ofProgram. -
addOrgUnitToProgram
Adds the program to the org unit.- Parameters:
program- the program identifier.orgUnit- the org unit identifier.- Returns:
- a
Response.
-
removeProgramIndicator
Removes aProgramIndicator.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getProgramIndicator
Retrieves aProgramIndicator.- Parameters:
id- the object identifier.- Returns:
- the
ProgramIndicator.
-
getProgramIndicators
Retrieves a list ofProgramIndicator.- Parameters:
query- theQuery.- Returns:
- list of
ProgramIndicator.
-
getTrackedEntityType
Retrieves aTrackedEntityType.- Parameters:
id- the object identifier.- Returns:
- the
TrackedEntityType.
-
getTrackedEntityTypes
Retrieves a list ofTrackedEntityType.- Parameters:
query- theQuery.- Returns:
- list of
TrackedEntityType.
-
removeCategoryOptionGroup
Removes aCategoryOptionGroup.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getCategoryOptionGroup
Retrieves anCategoryOptionGroup.- Parameters:
id- the object identifier.- Returns:
- the
CategoryOptionGroup. - Throws:
Dhis2ClientException- if the object does not exist.
-
getCategoryOptionGroups
Retrieves a list ofCategoryOptionGroup.- Parameters:
query- theQuery.- Returns:
- list of
CategoryOptionGroup.
-
removeCategoryOptionGroupSet
Removes aCategoryOptionGroupSet.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getCategoryOptionGroupSet
Retrieves anCategoryOptionGroupSet.- Parameters:
id- the object identifier.- Returns:
- the
CategoryOptionGroupSet. - Throws:
Dhis2ClientException- if the object does not exist.
-
getCategoryOptionGroupSets
Retrieves a list ofCategoryOptionGroupSet.- Parameters:
query- theQuery.- Returns:
- list of
CategoryOptionGroupSet.
-
removeOptionSet
Removes anOptionSet.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getOptionSet
Retrieves anOptionSet.- Parameters:
id- the object identifier.- Returns:
- the
OptionSet. - Throws:
Dhis2ClientException- if the object does not exist.
-
getOptionSets
Retrieves a list ofOptionSet. -
saveTableHook
Saves aTableHook.- Parameters:
tableHook- the object to save.- Returns:
ObjectResponseholding information about the operation.
-
saveTableHooks
Saves or updates the list ofTableHook.- Parameters:
tableHooks- the list ofTableHook.- Returns:
ObjectsResponseholding information about the operation.
-
updateTableHook
Updates aTableHook.- Parameters:
tableHook- the object to update.- Returns:
ObjectResponseholding information about the operation.
-
removeTableHook
Removes aTableHook.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getTableHook
Retrieves anTableHook.- Parameters:
id- the identifier of the table hook.- Returns:
- the
TableHook. - Throws:
Dhis2ClientException- if the object does not exist.
-
getTableHooks
Retrieves a list ofTableHook. -
removeVisualization
Removes aVisualization.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getVisualization
Retrieves aVisualization.- Parameters:
id- the object identifier.- Returns:
- the
Visualization. - Throws:
Dhis2ClientException- if the object does not exist.
-
getVisualizations
Retrieves a list ofVisualization.- Parameters:
query- theQuery.- Returns:
- list of
Visualization.
-
removeMap
Removes aGeoMap.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getMap
Retrieves aGeoMap.- Parameters:
id- the object identifier.- Returns:
- the
GeoMap. - Throws:
Dhis2ClientException- if the object does not exist.
-
getMaps
Retrieves a list ofGeoMap. -
removeDashboard
Removes aDashboard.- Parameters:
id- the identifier of the object to remove.- Returns:
ObjectResponseholding information about the operation.
-
getDashboard
Retrieves aDashboard.- Parameters:
id- the object identifier.- Returns:
- the
Dashboard. - Throws:
Dhis2ClientException- if the object does not exist.
-
getDashboards
Retrieves a list ofDashboard. -
getDimension
Retrieves aDimension.- Parameters:
id- the identifier of the dimension.- Returns:
- the
Dimension.
-
getDimensions
Retrieves a list ofDimension. -
getPeriodTypes
Retrieves a list ofPeriodType.- Parameters:
query- theQuery.- Returns:
- list of
PeriodType.
-
getSystemSettings
RetrievesSystemSettings.- Returns:
- system settings.
-
saveDataValueSet
public DataValueSetResponse saveDataValueSet(DataValueSet dataValueSet, DataValueSetImportOptions options) Saves aDataValueSet.- Parameters:
dataValueSet- theDataValueSetto save.options- theDataValueSetImportOptions.- Returns:
DataValueSetResponseholding information about the operation.
-
saveDataValueSet
Saves a data value set payload in JSON format represented by the given file.- Parameters:
file- the file representing the data value set JSON payload.options- theDataValueSetImportOptions.- Returns:
DataValueSetResponseholding information about the operation.
-
saveDataValueSet
public DataValueSetResponse saveDataValueSet(InputStream inputStream, DataValueSetImportOptions options) Saves a data value set payload in JSON format represented by the given input stream.- Parameters:
inputStream- the input stream representing the data value set JSON payload.options- theDataValueSetImportOptions.- Returns:
DataValueSetResponseholding information about the operation.
-
getDataValueSet
Retrieves aDataValueSet.- Parameters:
query- theAnalyticsQuery.- Returns:
DataValueSet.
-
getDataValueFile
Retrieves the content of a file resource from aDataValue.- Parameters:
query- theDataValueQuery.- Returns:
- the content of a file resource referenced in a
DataValue.
-
getAnalyticsDataValueSet
Retrieves aDataValueSet.- Parameters:
query- theAnalyticsQuery.- Returns:
DataValueSet.
-
writeAnalyticsDataValueSet
Retrieves aDataValueSetand writes it to the given file.- Parameters:
query- theAnalyticsQuery.file- theFile.
-
saveEvents
Saves anEvents. The operation is synchronous.Requires DHIS 2 version 2.36 or later.
- Parameters:
events- theEvents.- Returns:
EventResponseholding information about the operation.
-
getEvent
Retrieves anEvent.Requires DHIS 2 version 2.36 or later.
- Parameters:
id- the event identifier.- Returns:
- the
Event.
-
getEvents
Retrieves anEvents.Requires DHIS 2 version 2.36 or later.
- Parameters:
query- theEventsQuery.- Returns:
- the
Events.
-
removeEvents
Removes anEvents. The operation is synchronous.Requires DHIS 2 version 2.36 or later.
- Parameters:
events- theEvents.- Returns:
EventResponseholding information about the operation.
-
removeEvent
Removes anEvent.Requires DHIS 2 version 2.36 or later.
- Parameters:
event- theEvent.- Returns:
EventResponseholding information about the operation.
-
getJobNotifications
Retrieves a list ofJobNotification.- Parameters:
category- theJobCategory.id- the job identifier.- Returns:
- list of
JobNotification.
-
getFileResource
Retrieves aFileResource.- Parameters:
id- the object identifier.- Returns:
- the
FileResource. - Throws:
Dhis2ClientException- if the object does not exist.
-
getDataSetValidation
- Parameters:
query- theDataSetValidationQuery.- Returns:
- the validation results of the
DataSetin the specifiedPeriodandOrgUnit.
-
getValidationRules
Retrieves a list ofValidationRule.- Parameters:
dataSet- the object identifier of the Data Set where the validations apply.- Returns:
- list of
ValidationRule.
-