Skip to content

include+exclude same code produces with 0 entries #93

@jmandel

Description

@jmandel

Bug

Including a code and then excluding the same code produces an empty expansion (correct) but total=1 (wrong — should be 0).

Repro

curl -s -X POST 'https://tx-dev.fhir.org/r4/ValueSet/$expand' \
  -H 'Content-Type: application/fhir+json' -H 'Accept: application/fhir+json' \
  -d '{
    "resourceType": "Parameters",
    "parameter": [{"name": "valueSet", "resource": {
      "resourceType": "ValueSet", "status": "active",
      "compose": {
        "include": [{"system": "http://hl7.org/fhir/administrative-gender",
          "concept": [{"code": "male"}]}],
        "exclude": [{"system": "http://hl7.org/fhir/administrative-gender",
          "concept": [{"code": "male"}]}]
      }
    }}]
  }' | jq '{total: .expansion.total, returned: (.expansion.contains | length)}'
# Returns: {"total": 1, "returned": 0}
# Expected: {"total": 0, "returned": 0}

Reproduces on both tx-dev.fhir.org and tx.fhir.org.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions