DMN Feel Expression to filter List of List Complex Objects based on a condition

163 Views Asked by At

I have list of "components" complex object need to FILTER the component list WHEN components[].code.coding[1].code="48005-3" return components[x] x = matched index in the components list

I'm looking for the following final out put

IF components[].code.coding[1].code="48005-3" THEN return components[].valueCodeableConcept.coding[1].code

{ "components": [
  {
                        "code": {
                            "coding": [
                                {
                                    "system": "http://loinc.org",
                                    "code": "48005-3"
                                }
                            ]
                        },
                        "valueCodeableConcept": {
                            "coding": [
                                {
                                    "system": "http://varnomen.hgvs.org",
                                    "code": "p.Val455Met"
                                }
                            ],
                            "text": "V455M"
                        }
                    },
                    {
                        "code": {
                            "coding": [
                                {
                                    "system": "http://loinc.org",
                                    "code": "53037-8"
                                }
                            ]
                        },
                        "valueCodeableConcept": {
                            "coding": [
                                {
                                    "system": "http://loinc.org",
                                    "code": "LA26333-7"
                                }
                            ],
                            "text": "Variant of Uncertain Significance"
                        }
                    }
]
}

I wrote the following logic in the DMN Business Knowledge Model in the DMN Editor (sandbox.kie.org) (context) for aComponent in components return for aCoding in aComponent.code.coding return for aCode in aCoding return if aCode.code="48005-3"" = true then aComponent else null

its returning entire components content

0

There are 0 best solutions below