1.81 Min-max data elements

The min-max data elements resource allows you to set minimum and maximum value ranges for data elements. It is unique by the combination of organisation unit, data element and category option combo.

/api/minMaxDataElements
Min-max data element data structure
Item Description Data type
source Organisation unit identifier String
dataElement Data element identifier String
optionCombo Data element category option combo identifier String
min Minimum value Integer
max Maximum value Integer
generated Indicates whether this object is generated by the system (and not set manually). Boolean

You can retrieve a list of all min-max data elements from the following resource:

GET /api/minMaxDataElements.json

You can filter the response like this:

GET /api/minMaxDataElements.json?filter=dataElement.id:eq:UOlfIjgN8X6

GET /api/minMaxDataElements.json?filter=dataElement.id:in:[UOlfIjgN8X6,xc8gmAKfO95]

The filter parameter for min-max data elements supports two operators: eq and in.

Use fields paremeter

GET /api/minMaxDataElements.json?fields=:all,dataElement[id,name]

1.81.1 Add/Update min-max data element

To add a new min-max data element, use POST request with JSON content with below format:

POST /api/minMaxDataElements.json

{
  "min": 1,
  "generated": false,
  "max": 100,
  "dataElement": {
    "id": "UOlfIjgN8X6"
   },
  "source": {
    "id": "DiszpKrYNg8"
  },
  "optionCombo": {
    "id": "psbwp3CQEhs"
  }
}

If the combination of data element, organisation unit and category option combo exists, the min-max value will be updated.

1.81.2 Delete min-max data element

To delete a min-max data element, send a request with DELETE method and JSON content with same format as above:

DELETE /api/minMaxDataElements.json

{
  "min": 1,
  "generated": false,
  "max": 100,
  "dataElement": {
    "id": "UOlfIjgN8X6"
   },
  "source": {
    "id": "DiszpKrYNg8"
  },
  "optionCombo": {
    "id": "psbwp3CQEhs"
  }
}