How do I format the request object when making a Boolean Search query on the Composition tab for the Cohort Builder

Good day, everyone,

I’m really trying to make a boolean search using the reportingrest/adhocquery?v=full endpoint. I need to ensure the request is formatted properly. My request object is shown below, Is there anything missing.

{
  "type": "org.openmrs.module.reporting.dataset.definition.PatientDataSetDefinition",
  "columns": [
    {
      "name": "firstname",
      "key": "reporting.library.patientDataDefinition.builtIn.preferredName.givenName",
      "type": "org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition"
    },
    {
      "name": "lastname",
      "key": "reporting.library.patientDataDefinition.builtIn.preferredName.familyName",
      "type": "org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition"
    },
    {
      "name": "gender",
      "key": "reporting.library.patientDataDefinition.builtIn.gender",
      "type": "org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition"
    },
    {
      "name": "age",
      "key": "reporting.library.patientDataDefinition.builtIn.ageOnDate.fullYears",
      "type": "org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition"
    },
    {
      "name": "patientId",
      "key": "reporting.library.patientDataDefinition.builtIn.patientId",
      "type": "org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition"
    }
  ],
  "customRowFilterCombination": "((1)) AND ((2 OR 2 OR 3))",
  "rowFilters": [
    {
      "key": "reporting.library.cohortDefinition.builtIn.numericObsSearchAdvanced",
      "parameterValues": {
        "timeModifier": "ANY",
        "question": "7fae062d-a5a4-4d02-885c-ddd60adde01f",
        "operator1": "LESS_THAN",
        "value1": "300"
      },
      "type": "org.openmrs.module.reporting.dataset.definition.PatientDataSetDefinition"
    },
    {
      "type": "org.openmrs.module.reporting.dataset.definition.PatientDataSetDefinition",
      "key": "reporting.library.cohortDefinition.builtIn.males"
    },
    {
      "type": "org.openmrs.module.reporting.dataset.definition.PatientDataSetDefinition",
      "key": "reporting.library.cohortDefinition.builtIn.females"
    },
    {
      "type": "org.openmrs.module.reporting.dataset.definition.PatientDataSetDefinition",
      "key": "reporting.library.cohortDefinition.builtIn.unknownGender"
    }
  ]
}

cc: @mseaton cc: @dkayiwa

@joelakwes, sorry for the late response. I haven’t tried this, but I’m wondering why you have

“type”: “org.openmrs.module.reporting.dataset.definition.PatientDataSetDefinition”

for each of the rowFilters. I don’t think this belongs there.

I also don’t know exactly what the “customRowFilterCombination” will do. Is there code somewhere that will use this to create a CompositionCohortDefinition out of the rowFilter elements, based on the index within the array?

Mike