bzkf / orwdp

Apache License 2.0
0 stars 0 forks source link

Malformed SQ? #9

Open BoehmDo opened 5 months ago

BoehmDo commented 5 months ago

Backend Error:

Caused by: de.numcodex.feasibility_gui_backend.query.dispatch.QueryDispatchException: cannot translate enqueued query body into configured formats
    at de.numcodex.feasibility_gui_backend.query.dispatch.QueryDispatcher.translateQueryIntoTargetFormats(QueryDispatcher.java:201)
    at de.numcodex.feasibility_gui_backend.query.dispatch.QueryDispatcher.dispatchEnqueuedQuery(QueryDispatcher.java:98)
    ... 172 common frames omitted
Caused by: de.numcodex.feasibility_gui_backend.query.translation.QueryTranslationException: cannot translate structured query to CQL format
    at de.numcodex.feasibility_gui_backend.query.translation.CqlQueryTranslator.translate(CqlQueryTranslator.java:35)
    at de.numcodex.feasibility_gui_backend.query.translation.QueryTranslationComponent.translate(QueryTranslationComponent.java:33)
    at de.numcodex.feasibility_gui_backend.query.dispatch.QueryDispatcher.translateQueryIntoTargetFormats(QueryDispatcher.java:199)
    ... 173 common frames omitted
Caused by: java.lang.IllegalStateException: unknown attribute mapping type: CodeableConcept
    at de.numcodex.sq2cql.model.structured_query.ValueSetAttributeFilter.toModifier(ValueSetAttributeFilter.java:41)
    at de.numcodex.sq2cql.model.structured_query.AbstractCriterion.lambda$resolveAttributeModifiers$15(AbstractCriterion.java:193)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
    at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
    at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
    at de.numcodex.sq2cql.model.structured_query.AbstractCriterion.resolveAttributeModifiers(AbstractCriterion.java:194)
    at de.numcodex.sq2cql.model.structured_query.AbstractCriterion.appendModifier(AbstractCriterion.java:174)

SQ:

{
  "version": "http://to_be_decided.com/draft-1/schema#",
  "display": "",
  "inclusionCriteria": [
    [
      {
        "termCodes": [
          {
            "code": "C50.0",
            "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
            "version": "2024",
            "display": "Brustwarze und Warzenhof"
          }
        ],
        "attributeFilters": [
          {
            "criteria": [
              {
                "termCodes": [
                  {
                    "code": "21902-2",
                    "display": "Stage group.pathology Cancer",
                    "system": "http://loinc.org"
                  }
                ],
                "attributeFilters": [
                  {
                    "selectedConcepts": [
                      {
                        "code": "1b1",
                        "display": "1b1",
                        "system": "http://dktk.dkfz.de/fhir/onco/core/CodeSystem/TNMTCS"
                      }
                    ],
                    "type": "concept",
                    "attributeCode": {
                      "code": "TNM-T",
                      "display": "TNM-T",
                      "system": "http://hl7.org/fhir/StructureDefinition"
                    }
                  }
                ],
                "context": {
                  "code": "TNMp",
                  "display": "TNMp",
                  "system": "bzkf.dktk.oncology"
                }
              }
            ],
            "type": "reference",
            "attributeCode": {
              "code": "assessment",
              "display": "assessment",
              "system": "http://hl7.org/fhir/StructureDefinition"
            }
          }
        ],
        "context": {
          "code": "Primaerdiagnose",
          "system": "bzkf.dktk.oncology",
          "display": "Primaerdiagnose"
        }
      }
    ]
  ]
}
juliangruendner commented 5 months ago

wrong attribute type in cql_mapping.json

attribute type is set to "attributeType": "CodeableConcept" instead of "attributeType": "Coding"

@BoehmDo double check generation and if it cannot be fixed via config speak with geloro