FHIR Chat · System.string · shorthand

Stream: shorthand

Topic: System.string


view this post on Zulip David Hay (Apr 14 2020 at 03:48):

I'm sure I've asked this before, but we're getting a validation error (using the external java validator) which is complaining about 'System.string' as a valid type value in an extension definition produced by the IG Publisher - from a shorthand produced definition. This is the validation command we're using:

java -jar org.hl7.fhir.validator.jar dhb.StructureDefinition.xml -output validation.xml -version 4.0.1

view this post on Zulip Grahame Grieve (Apr 14 2020 at 05:14):

what's the instance that causes the error?

view this post on Zulip David Hay (Apr 14 2020 at 05:40):

http://igs.clinfhir.com/nhi/StructureDefinition-dhb.html

view this post on Zulip Chris Moesel (Apr 14 2020 at 21:09):

The only cases of System.String I see in your SD are on Extension.id and Extension.url -- which I believe are expected. In fact, if you look at the Extension definition itself (which your SD is based on), it has the same: http://hl7.org/fhir/extension.profile.json.html

view this post on Zulip Peter Jordan (Apr 14 2020 at 21:30):

Superficially, at least - this looks problematic to me - i.e. the expected values in the valueUrl and code elements appear to be reversed and that's effectively what the Validator is reporting...

"type" : [{
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
          "valueUrl" : "string"
        }],
        "code" : "http://hl7.org/fhirpath/System.String"
      }],

view this post on Zulip Chris Moesel (Apr 15 2020 at 05:34):

I understand it seems odd, but this actually happens a lot -- primarily in definitions of primitives and the definitions of Element.id and Element.url -- and last I checked was quite intentional. Again, here is from the rendered JSON straight from the published R4 spec: image.png

view this post on Zulip Grahame Grieve (Apr 15 2020 at 05:35):

the validator shouldn't be complaining about this - it

view this post on Zulip Grahame Grieve (Apr 15 2020 at 05:35):

it's on my todo list to investigate

view this post on Zulip Chris Moesel (Apr 15 2020 at 05:41):

@Peter Jordan and @David Hay -- this pattern is often referred to as "compiler magic". If you search "compiler magic" on Zulip, you'll find a few threads about it, but here's a nice long one for you. ;-) https://chat.fhir.org/#narrow/stream/179166-implementers/topic/.22http.3A.2F.2Fhl7.2Eorg.2Ffhirpath.2FSystem.2EString.22

view this post on Zulip Peter Jordan (Apr 15 2020 at 06:44):

Thanks Chris. A little too visible to be termed "magic" I'd say and certainly not the output from a compiler - but as long as it's valid within the context of a FHIR StructureDefinition all is fine. :)


Last updated: Apr 12 2022 at 19:14 UTC