Stream: implementers
Topic: Vonk allows POST with empty strings
Jakob Lindblad (May 10 2019 at 13:50):
Hello again,
I find that when using Vonk it is possible to POST empty strings. For example if i post a CodeSystem containing 1 'concept' i can set 'code' and 'display' to a value of choice but then leave 'definition' empty -> ("").
I find this problematic because when i want call the VONK in C# i use the HL7.Fhir nuget to parse the response returned from VONK to a FHIR resource it gives me format exceptions such as ("The attribute 'value' in element 'definition' has an empty value, which is not allowed."). Shouldnt Vonk not allow POST of resources containing empty strings to be more compatible with the HL7 Nuget package validation(or the opposite) or is this a deliberate decision from Vonk to allow empty strings?
I also found this applicable on some attributes on ValueSet.
One could argue you dont want to post empty strings in the first place, but i just happened to find myself in this situation(dont ask how) so thought it might be of interest.
Yunwei Wang (May 10 2019 at 14:16):
CodeSystem.concept.description has [0..1] in FHIR base profile so empty definition should be valid unless other profile is used.
Jakob Lindblad (May 10 2019 at 14:39):
CodeSystem.concept.description has [0..1] in FHIR base profile so empty definition should be valid unless other profile is used.
My guess is that an empty string in defintion still counts as 1. I mean its a difference between "definition": "" and no defintion at all. So if one declare they have a defintion it must have a value?
Alexander Zautke (May 10 2019 at 17:14):
Hi @Jakob Lindblad Thanks for reaching out, of course we want to help you to get out of this situation! First of all, empty strings are never a valid value in FHIR, even if the underlying element specifies a cardinality of [0..1]. Therefore, Vonk should accept such a CodeSystem but ignore the empty element. It is definitely not a choice of Vonk to allow it. I assume that you are using the latest version of Vonk (2.0.1)? Could you share one of the ValueSets and CodeSystems? Are you posting the resources against the regular FHIR endpoint or against the administration endpoint?
Ewout Kramer (May 10 2019 at 21:36):
Hi Jakob, in the mean time, there is a setting in the FhirClient.ParserSettings.PermissiveParsing that you can set to 'true' - the parser will then ignore such empty strings.
Ewout Kramer (May 10 2019 at 21:39):
I know it is an explicit choice from the Vonk developers to be lenient in what they accept. If you run your own copy of Vonk, this behaviour is configurable.
Ewout Kramer (May 10 2019 at 21:40):
See this documentation page
Jakob Lindblad (May 13 2019 at 11:05):
Hi Jakob Lindblad Thanks for reaching out, of course we want to help you to get out of this situation! First of all, empty strings are never a valid value in FHIR, even if the underlying element specifies a cardinality of [0..1]. Therefore, Vonk should accept such a CodeSystem but ignore the empty element. It is definitely not a choice of Vonk to allow it. I assume that you are using the latest version of Vonk (2.0.1)? Could you share one of the ValueSets and CodeSystems? Are you posting the resources against the regular FHIR endpoint or against the administration endpoint?
It seems like im using Vonk 1.0.0. (If that is what software.version referes to in /metadata) so might not be the same result when using Vonk 2.0.1 i guess. Im posting against the regular FHIR endpoint.
Here is an example of a CodeSystem i can post with empty defintion:
{
"resourceType": "CodeSystem",
"meta": {
"versionId": "ec7a5291-c366-4b4f-a496-c6589b813203",
"lastUpdated": "2019-05-10T13:43:15.039+00:00"
},
"url": "testtest",
"identifier": {
"system": "dsada",
"value": "dsada"
},
"version": "1",
"name": "ett test",
"title": "dsadadad",
"status": "active",
"experimental": true,
"date": "2019-05-08T11:49:50.300Z",
"publisher": "testtest",
"contact": [
{
"name": "adsadad",
"telecom": [
{
"system": "phone",
"value": "dsadadad"
}
]
}
],
"description": "testtest",
"purpose": "gsgsg",
"copyright": "testtest",
"caseSensitive": true,
"hierarchyMeaning": "is-a",
"content": "example",
"concept": [
{
"code": "2",
"display": "två",
"concept": [
{
"code": "4",
"display": "fyra",
"definition" : ""
}
]
},
{
"code": "1",
"display": "ett",
"concept": [
{
"code": "3",
"display": "tre"
}
]
}
]
}
Jakob Lindblad (May 13 2019 at 11:08):
Hi Jakob, in the mean time, there is a setting in the FhirClient.ParserSettings.PermissiveParsing that you can set to 'true' - the parser will then ignore such empty strings.
This solved the problem but im guessing that settting PermissiveParsing = true will ignore other validations concerning data structure etc?
Alexander Zautke (May 13 2019 at 15:44):
Would it be a possibility for you to try upgrading? The issue seems to be fixed in the latest release, I can't reproduce the behaviour against the public Vonk endpoint.
Alexander Zautke (May 13 2019 at 15:46):
And yes, PermissiveParsing will be a bit more lenient to some data structures. The documentation page that Ewout mentioned above describes a few things that are accepted with PermissiveParsing.
Jakob Lindblad (May 15 2019 at 06:06):
Would it be a possibility for you to try upgrading? The issue seems to be fixed in the latest release, I can't reproduce the behaviour against the public Vonk endpoint.
I can upgrade. Thank you for the support :-)
Last updated: Apr 12 2022 at 19:14 UTC