Aidbox / Issues

Issue tracker for Aidbox FHIR backend by Health Samurai
7 stars 0 forks source link

[BUG] Error if ViewDefinition path contains capital letters #568

Closed pavlushkin closed 7 months ago

pavlushkin commented 7 months ago

Describe the bug If use ViewDefinition path containing capital letters e.g. "ingredient.item.CodeableConcept" get ERROR: syntax error at or near "$" of jsonpath input

Severity Minor

Steps to reproduce the behavior: Run ViewDefinition like

{
  "description": "Medication flat view",
  "name": "medication_view",
  "extension": [
    {
      "url": "materialization",
      "value": {
        "code": "view"
      }
    }
  ],
  "status": "draft",
  "resource": "Medication",
  "select": [
    {
      "path": "id",
      "alias": "id"
    },
    {
      "path": "ingredient.item.CodeableConcept",
      "alias": "ingredient_strength"
    }
  ]
}

Versions:

Additional context SQL-on-FHIR

Nesmeshnoy commented 7 months ago

@pavlushkin what's the severity?

Yngwarr commented 7 months ago

The idiomatic way to access polymorphic values in FHIR Path is to use ofType expression like so:

ingredient.item.ofType(CodeableConcept)

We will make the error message clearer, thank you for pointing this out.

pavlushkin commented 7 months ago

Thank you, that works!