FHIR Chat · The element Extension.url has a fixed of type uri · shorthand

Stream: shorthand

Topic: The element Extension.url has a fixed of type uri


view this post on Zulip Jens Villadsen (Mar 05 2021 at 20:36):

Hi Fsh-folks. I've gofsh'ed my IG and now I have an error on the QA page I don't really understand. The error is the following: The element Extension.url has a fixed of type uri, which is not in the list of allowed types ([http://hl7.org/fhirpath/System.String])

The QA page can be found here: https://build.fhir.org/ig/hl7dk/dk-core/branches/going-fshing/qa.html#_scratch_ig-build-temp-6H6E5O_repo_fsh-generated_resources_StructureDefinition-dk-core-RegionalSubDivisionCodes and the source is here: https://github.com/hl7dk/dk-core/blob/going-fshing/input/fsh/extensions.fsh

From the sources I can't really understand where that error is comming from. Help would be much appreciated (@Chris Moesel ).

view this post on Zulip Mark Kramer (Mar 06 2021 at 19:35):

Hi Jens, I have the same error, and it doesn't seem to be related to SUSHI or FSH. It appeared somewhere around IG Publisher version 1.1.60. At that time, I didn't change SUSHI, just the IG Publisher - and poof - all of a sudden I had 60+ instances of this error.
If you look at the latest build of US Core IG, they have the same error, and they aren't using SUSHI for their StructureDefinitions.

view this post on Zulip Mark Kramer (Mar 06 2021 at 19:47):

https://github.com/HL7/fhir-ig-publisher/issues/240

view this post on Zulip Jens Villadsen (Mar 07 2021 at 10:07):

@Grahame Grieve you might want to look into this

view this post on Zulip Torben M. Hagensen (Mar 08 2021 at 11:07):

Jens Villadsen said:

Hi Fsh-folks. I've gofsh'ed my IG and now I have an error on the QA page I don't really understand. The error is the following: The element Extension.url has a fixed of type uri, which is not in the list of allowed types ([http://hl7.org/fhirpath/System.String])

The QA page can be found here: https://build.fhir.org/ig/hl7dk/dk-core/branches/going-fshing/qa.html#_scratch_ig-build-temp-6H6E5O_repo_fsh-generated_resources_StructureDefinition-dk-core-RegionalSubDivisionCodes and the source is here: https://github.com/hl7dk/dk-core/blob/going-fshing/input/fsh/extensions.fsh

From the sources I can't really understand where that error is comming from. Help would be much appreciated (Chris Moesel ).

I have the same issue after updating IG publisher. FSH generated a fixedUri by default which generates the error in IG publisher.
Can't say what's right though.

view this post on Zulip Chris Moesel (Mar 08 2021 at 13:30):

I don't know what's going on either -- but fixedUri should be appropriate since Extension.url is defined as having the uri type: image.png

view this post on Zulip Gino Canessa (Mar 08 2021 at 22:05):

This looks like a problem in the publisher, since I just started getting these errors too, and:

  • Internally the specs use .fixedValueUri for extension urls, so that is the correct type.
  • The error seems to be indicating the type must be http://hl7.org/fhirpath/System.String, which is the backing type for uri.

@Grahame Grieve , thoughts?

view this post on Zulip Bob Milius (Mar 09 2021 at 16:42):

another data point... This sushi snippet from my patient profile produces no publisher errors:

Alias: PatientBirthPlaceExtension = http://hl7.org/fhir/StructureDefinition/patient-birthPlace
* extension contains PatientBirthPlaceExtension named PatBirthPlaceExt 0..1 MS
// * extension[PatBirthPlaceExt].valueAddress.country MS

but if I uncomment the last line, I get the error

The element Patient.extension:PatBirthPlaceExt.url has a fixed of type uri, which is not in the list of allowed types ([http://hl7.org/fhirpath/System.String])

view this post on Zulip Gino Canessa (Mar 09 2021 at 17:31):

Doing a little digging, and just want to put my thoughts down in case it saves anyone time.

  • This appears to be caused by changes in the FHIR Core library.
  • I believe this appeared in either 5.3.3 or 5.3.4, when SD_VALUE_TYPE_IILEGAL was added.
  • With the understanding that this is my first time looking through this code...
    • In StructureDefinitionValidator.java, these lines look like the change that we are looking for
    • This line in particular is the error that is being logged.
    • However, the Structure Definitions I'm getting errors on (exported by FSH) do not have a snapshot section, only a differential.

Having never played with the validator code, I am loathe to start tinkering (or even set up my environment to do so). That said, I don't know how much more I can learn from just browsing the source.

@Grahame Grieve is my reading of this correct? If so, is there a change to be made to the validator and/or should FSH be exporting a snapshot in addition to the differential?

view this post on Zulip Jens Villadsen (Mar 09 2021 at 21:51):

@Gino Canessa im pretty sure that the differential made by fsh is sufficient. My guess would be that it is the generation of the snapshot, but I haven't had time to have a look yet

view this post on Zulip Gino Canessa (Mar 10 2021 at 15:25):

Thanks @Jens Villadsen! As I mentioned, I just started looking at commits around when the error started appearing. I know how busy people are, so was trying to think on ways around it. Cheers!

view this post on Zulip Lloyd McKenzie (Mar 16 2021 at 15:00):

Re-raised the issue here: https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/BUG.3A.20The.20element.20Extension.2Eurl.20has.20a.20fixed.20of.20type.20uri so I could get Mark's attention too.

view this post on Zulip Mark Iantorno (Mar 19 2021 at 20:53):

Alright so, I think this is related to a commit made on March 2-3 (14dc86e3a2f895498d5a63aa8baefa0c5283fc85)

view this post on Zulip Mark Iantorno (Mar 19 2021 at 20:54):

There was code added in the validation process to add the message you are encountering

view this post on Zulip Mark Iantorno (Mar 19 2021 at 20:54):

specifically:
// in a snapshot, we validate that fixedValue, pattern, and defaultValue, if present, are all of the right type if (snapshot && element.getIdBase().contains(".")) { if (rule(errors, IssueType.EXCEPTION, stack.getLiteralPath(), !typeCodes.isEmpty() || element.hasChild("contentReference"), I18nConstants.SD_NO_TYPES_OR_CONTENTREF, element.getIdBase())) { Element v = element.getNamedChild("defaultValue"); if (v != null) { rule(errors, IssueType.EXCEPTION, stack.push(v, -1, null, null).getLiteralPath(), typeCodes.contains(v.fhirType()), I18nConstants.SD_VALUE_TYPE_IILEGAL, element.getIdBase(), "defaultValue", v.fhirType(), typeCodes); } v = element.getNamedChild("fixed"); if (v != null) { rule(errors, IssueType.EXCEPTION, stack.push(v, -1, null, null).getLiteralPath(), typeCodes.contains(v.fhirType()), I18nConstants.SD_VALUE_TYPE_IILEGAL, element.getIdBase(), "fixed", v.fhirType(), typeCodes); } v = element.getNamedChild("pattern"); if (v != null) { rule(errors, IssueType.EXCEPTION, stack.push(v, -1, null, null).getLiteralPath(), typeCodes.contains(v.fhirType()), I18nConstants.SD_VALUE_TYPE_IILEGAL, element.getIdBase(), "pattern", v.fhirType(), typeCodes); } } }

view this post on Zulip Mark Iantorno (Mar 19 2021 at 20:55):

That is the only time this message is used in the core.

view this post on Zulip Mark Iantorno (Mar 19 2021 at 20:55):

SD_VALUE_TYPE_IILEGAL = The element {0} has a {1} of type {2}, which is not in the list of allowed types ({3})

view this post on Zulip Mark Iantorno (Mar 19 2021 at 20:56):

This is in the StructureDefinitionValidator

view this post on Zulip Mark Iantorno (Mar 19 2021 at 20:57):

actually, I'm giong to post this all in the other thread Lloyd made


Last updated: Apr 12 2022 at 19:14 UTC