Reportingrest modules

I use reportingrest modules and i want to send

POST /reportingrest/dataSetDefinition request, that contain SqlDataSetDefinition.

I find this documentation, where is written that i can serialized XML.

    "serializedXml": "<org.openmrs.module.reporting.cohort.definition.AgeCohortDefinition><maxAge>15</maxAge><maxAgeUnit>YEARS</maxAgeUnit><unknownAgeIncluded>false</unknownAgeIncluded></org.openmrs.module.reporting.cohort.definition.AgeCohortDefinition>"

Do I understand correctly that i can pass serialized XML in “class” parameter?

  "name": "string",
  "description": "string",
  "class": "string",
  "uuid": "string",
  "parameters": "string"

No, XML would not go in a class parameter. As mentioned in the documentation that you link to, the body of the POST should be a JSON object with a “serializedXml” property, whose value is a string of XML. In other words you could POST exactly the example that you copied and pasted.

If you’re asking how you would specifically evaluate a SqlDataSetDefinition the post body would look something like this:

    "serializedXml": "<org.openmrs.module.reporting.dataset.definition.SqlDataSetDefinition><sqlQuery>select name, description from encounter_type</sqlQuery></org.openmrs.module.reporting.dataset.definition.SqlDataSetDefinition>"

(I got the “sqlQuery” field name from looking at

Meta: also, please note that while posting to Talk you need to format your code snippets using markdown (by putting 4 spaces in front) which you can automatically do with the </> icon in the text editor. Otherwise the XML is messed up and unreadable.