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

support for datatype extension #93

Open
esbakker opened this issue Aug 9, 2021 · 0 comments
Open

support for datatype extension #93

esbakker opened this issue Aug 9, 2021 · 0 comments

Comments

@esbakker
Copy link

esbakker commented Aug 9, 2021

If you have a primitive datatype with an extension the value can not be read. We have a QuestionnaireResponse with extended datatypes for the answers (in this example a date):

"item": [
    {
        "linkId": "date_1",
        "answer": [
            {
                "_valueDate": {
                    "extension": [
                        {
                            "url": "http://localhost/fhir/StructureDefinition/custom-dateType",
                            "valueString": "someDateString"
                        }
                    ]
                }
            }
        ]
    }
]

As you can see the date is emitted with a _ prefix by HAPI. As described here.

There is no way to access these values. If I do a JSON.dump of the item I only get the linkId:

{"linkId":"date_1"}

For non-primitive datatypes like Coding it works as expected

For XML responses it works a little better, since the extension value is set as hash on the valueDate field:

<FHIR::QuestionnaireResponse::Item::Answer:0x000055c8b430afc0
 @extension=[],
 @id=nil,
 @item=[],
 @modifierExtension=[],
 @valueAttachment=nil,
 @valueBoolean=nil,
 @valueCoding=nil,
 @valueDate=nil,
 @valueDateTime=nil,
 @valueDecimal=
  {"extension"=>
    {"valueString"=> "someDateString",
     "url"=>"http://localhost/fhir/StructureDefinition/custom-dateType"}},
 @valueInteger=nil,
 @valueQuantity=nil,
 @valueReference=nil,
 @valueString=nil,
 @valueTime=nil,
 @valueUri=nil>
esbakker added a commit to openhealthhub/FhirClients that referenced this issue Aug 9, 2021
 * Due to a bug in fhir_models (fhir-crucible/fhir_models#93) we need too use xml response, which apparently doesn't parse the encrypted message very well, so a hack is needed there as well
esbakker added a commit to openhealthhub/FhirClients that referenced this issue Aug 9, 2021
* OP-651 add get examples for ruby

* OP-651 add create and search examples for ruby

* OP-651 add decryption example of questionnaire response
 * Due to a bug in fhir_models (fhir-crucible/fhir_models#93) we need too use xml response, which apparently doesn't parse the encrypted message very well, so a hack is needed there as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant