Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect nesting of elements in complex extension #72

Open
mechanik-daniel opened this issue May 29, 2024 · 2 comments
Open

Incorrect nesting of elements in complex extension #72

mechanik-daniel opened this issue May 29, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@mechanik-daniel
Copy link
Contributor

Expression:

{
  "ishhearot": [
    {
      "tarich": "2023-11-19T10:20:40Z",
      "hearot": "טקסט הערה",
      "user_name": "benny",
      "k_metapel": 1,
      "shem_metapel": "אנשל",
      "k_heara": 57,
      "teur_heara": "מרפאת דיאליזה PD"
    },
    {
      "tarich": "2023-11-19T10:23:24Z",
      "hearot": "סתם הערה",
      "user_name": "aaa"
    }
  ]
}.(
  Instance: $uuid()
  InstanceOf: encounter-admission

  * (ishhearot).extension[hearot]
    * extension[note]
      * valueAnnotation
        * authorReference.identifier
          * system = 'http://fhir.laniado.org.il/Identifier/user-name'
          * value = user_name
        * time = tarich
        * text = hearot
    * extension[metapel].value
      * code = $.k_metapel
      * display = shem_metapel
    * extension[k-heara].value
      * code = k_heara
      * display = teur_heara
) ~> $selectKeys('extension')

Expected:

{
  "extension": [
    {
      "url": "http://fhir.laniado.org.il/StructureDefinition/ext-administrative-encounter-note",
      "extension": [
        {
          "url": "note",
          "valueAnnotation": {
            "authorReference": {
              "identifier": {
                "system": "http://fhir.laniado.org.il/Identifier/user-name",
                "value": "benny"
              }
            },
            "time": "2023-11-19T10:20:40Z",
            "text": "טקסט הערה"
          }
        },
        {
          "url": "metapel",
          "valueCoding": {
            "code": "1",
            "display": "אנשל"
          }
        },
        {
          "url": "k-heara",
          "valueCoding": {
            "code": "57",
            "display": "מרפאת דיאליזה PD"
          }
        }
      ]
    },
    {
      "url": "http://fhir.laniado.org.il/StructureDefinition/ext-administrative-encounter-note",
      "extension": [
        {
          "url": "note",
          "valueAnnotation": {
            "authorReference": {
              "identifier": {
                "system": "http://fhir.laniado.org.il/Identifier/user-name",
                "value": "aaa"
              }
            },
            "time": "2023-11-19T10:23:24Z",
            "text": "סתם הערה"
          }
        }
      ]
    }
  ]
}

Actual:

{
  "extension": [
    {
      "extension": [
        {
          "url": "note"
        },
        {
          "url": "note",
          "valueAnnotation": {
            "authorReference": {
              "identifier": {
                "system": "http://fhir.laniado.org.il/Identifier/user-name",
                "value": "benny"
              }
            },
            "time": "2023-11-19T10:20:40Z",
            "text": "טקסט הערה"
          }
        },
        {
          "url": "note",
          "valueAnnotation": {
            "authorReference": {
              "identifier": {
                "system": "http://fhir.laniado.org.il/Identifier/user-name",
                "value": "aaa"
              }
            },
            "time": "2023-11-19T10:23:24Z",
            "text": "סתם הערה"
          }
        }
      ],
      "url": "http://fhir.laniado.org.il/StructureDefinition/ext-administrative-encounter-note"
    }
  ]
}
@mechanik-daniel mechanik-daniel added the bug Something isn't working label May 29, 2024
@mechanik-daniel mechanik-daniel self-assigned this May 29, 2024
@mechanik-daniel
Copy link
Contributor Author

Expected two extensions, one with note, metapel and k_heara and the other with just note.
Actual results have only one extension object with just 3 notes (one of which has only a url and nothing more)

@mechanik-daniel
Copy link
Contributor Author

Profile: http://fhir.laniado.org.il/StructureDefinition/encounter-admission
Package: laniado.test.fhir.r4@0.1.63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant