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

Definition based extraction: Issue in the extension url using ProfileLoader #2029

Open
vbothe23 opened this issue Jun 8, 2023 · 1 comment
Assignees

Comments

@vbothe23
Copy link
Contributor

vbothe23 commented Jun 8, 2023

Describe the bug
When using structure-definition-based-extraction with ProfileLoader, the extension URL in the resource should be same as it's profile URL, rather than the definition URL mentioned in the Questionnaire.

Component
SDC library

To Reproduce
Steps to reproduce the behavior:

  1. Use below json as a questionnaire string.
{
         "resourceType": "Questionnaire",
         "extension": [
           {
             "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemExtractionContext",
             "valueExpression": {
               "language": "application/x-fhir-query",
               "expression": "Patient",
               "name": "patient"
             }
           }
         ],
         "item": [
           {
             "linkId": "1",
             "definition": "http://fhir.org/guides/who/core/StructureDefinition/who-patient#Patient.birthTime",
             "text": "Time of birth",
             "type": "dateTime"
           }
         ]
       }
  1. Use below json as a questionnaireResponse string.
{
          "resourceType": "QuestionnaireResponse",
          "item": [
            {
              "linkId": "1",
              "answer": [
                {
                  "valueDateTime": "2022-02-07T13:28:17-05:00"
                }
              ]
            }
          ]
        }
  1. Perform extraction using profileLoader.
ResourceMapper.extract(
        questionnaire = questionnaireWithBirthTimeExt,
        questionnaireResponse = questionnaireResponseWithBirthTimeExt,
        profileLoader = ProfileLoaderImplWithExt(mContext),
      )

Profile for Patient Birth-time extension

{
        "id": "Patient.extension:birthTime",
        "path": "Patient.extension",
        "sliceName": "birthTime",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/patient-birthTime"
            ]
          }
        ],
        "mustSupport": true
      }

Expected behavior
Extracted Patient resource should contain the extension with URL http://hl7.org/fhir/StructureDefinition/patient-birthTime
But URL in the extension is http://fhir.org/guides/who/core/StructureDefinition/who-patient#Patient.birthTime

Additional context
https://fhir-ru.github.io/extension-patient-birthtime.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

No branches or pull requests

2 participants