Stream: IG creation
Topic: BUG: The element Extension.url has a fixed of type uri
Lloyd McKenzie (Mar 16 2021 at 14:59):
When building R4 IGs, they're raising the following error in the qa.txt: "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])"
This issue was initially raised over 10 days ago on the FSH stream. I know @Grahame Grieve and @Mark Iantorno were heads down on R4B at that point. So re-surfacing it here to make sure it's on the priority list to fix.
Mark Iantorno (Mar 16 2021 at 14:59):
Have they tried building again recently
Mark Iantorno (Mar 16 2021 at 15:00):
this is similar to another error that I encountered recently, that was fixed with a kindling dependency bump
Lloyd McKenzie (Mar 16 2021 at 15:01):
I just retried with a client IG (not publicly available) 5 minutes ago with the current validator and it was still an issue
Lloyd McKenzie (Mar 16 2021 at 15:02):
I'll retry again with a 'public' one.
Lloyd McKenzie (Mar 16 2021 at 15:12):
Still an issue w/ SDC
http://build.fhir.org/ig/HL7/sdc/branches/master/qa.html#_scratch_ig-build-temp-JVWTM1_repo_input_examples_questionnaire-sdc-profile-example
Jean Duteau (Mar 16 2021 at 16:23):
And I forgot about this issue and why I was holding off upgrading to the latest publisher. I did that in one project and now have 40 spurious errors. that I'm going to have to explain to the client. I really need to start using stickies around my computer to remind me of things!
Lloyd McKenzie (Mar 16 2021 at 21:30):
@Mark Iantorno do you need anything further to chase?
Brian Reinhold (Mar 17 2021 at 14:21):
Lloyd McKenzie said:
Mark Iantorno do you need anything further to chase?
There is the error on the <fixedUri> element when in an extension introduced by the latest version of the IG publisher ....Does this fix it?
Lloyd McKenzie (Mar 17 2021 at 14:32):
I don't believe we have a fix yet...
Brian Reinhold (Mar 17 2021 at 14:42):
@Lloyd McKenzie Okay, working with Jessica on the transport identifier naming system. Going well.
Resolved the dependency issue. Have an agreed upon JIRA xml file (today's DoF meeting) so the only thing left is this fix uri. By the way, if I change <fixedUri> to <fixeduri> in the extension, the error goes away.
Lloyd McKenzie (Mar 17 2021 at 16:14):
That's definitely a bug in the publisher - because fixedUri is what's defined in the schema, and that's not allowed to change. (@Mark Iantorno FYI)
François Macary (Mar 17 2021 at 16:19):
I have the same issue today on both local and public build of fhir-order-catalog IG. Two weeks ago the same IG had zero errors in its QA. Now it has 65 after the single change of adding copyrigths to ValueSet resources to comply with HTA QA.
Rob Hausam (Mar 17 2021 at 16:30):
Yes, and some of the 65 errors are "Attempt to use Terminology server when no Terminology server is available for 'http://unitsofmeasure.org#mmol/L'" - which seems (almost certainly) unrelated (but since they've occurred at the same time that is a little suspicious).
Mark Iantorno (Mar 19 2021 at 20:57):
Alright so, I think this is related to a commit made on March 2-3 (14dc86e3a2f895498d5a63aa8baefa0c5283fc85)
Mark Iantorno (Mar 19 2021 at 20:57):
There was code added in the validation process to add the message you are encountering
Mark Iantorno (Mar 19 2021 at 20:57):
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);
}
}
}
Mark Iantorno (Mar 19 2021 at 20:58):
That is the only time this message is used in the core.
SD_VALUE_TYPE_IILEGAL = The element {0} has a {1} of type {2}, which is not in the list of allowed types ({3})
Mark Iantorno (Mar 19 2021 at 20:58):
This is in the StructureDefinitionValidator
Mark Iantorno (Mar 19 2021 at 20:59):
Let me look at what exactly is getting validated there
Mark Iantorno (Mar 19 2021 at 20:59):
and why
Mark Iantorno (Mar 19 2021 at 21:00):
Can someone here please provide me with instructions on how to actually get this to happen, like provide me with the files and steps so I can reproduce locally
Mark Iantorno (Mar 19 2021 at 21:00):
it will help me get it done faster
Jean Duteau (Mar 19 2021 at 21:01):
any IG with extensions will trigger. You can test it on one of mine: https://github.com/HL7/fhir-spl
Mark Iantorno (Mar 19 2021 at 21:02):
@Jean Duteau I've never published an IG, are there instructions on how to do it
Mark Iantorno (Mar 19 2021 at 21:02):
I just do the plumbing, never done the actual spec work
Jean Duteau (Mar 19 2021 at 21:03):
clone the repository, run _updatePublisher.sh to download the publisher.jar and then run _genonce.sh to generate the IG
Mark Iantorno (Mar 19 2021 at 21:03):
great
Mark Iantorno (Mar 19 2021 at 21:08):
@Jean Duteau I'm getting an error
Mark Iantorno (Mar 19 2021 at 21:08):
(deleted)
Mark Iantorno (Mar 19 2021 at 21:08):
forget it, I remember I had a messed up installation of the tools from before
Mark Iantorno (Mar 19 2021 at 21:09):
I will fix
Mark Iantorno (Mar 19 2021 at 21:11):
actually it's still throwing the error after I re-installed
Mark Iantorno (Mar 19 2021 at 21:11):
Online
FHIR IG Publisher Version 1.1.63 (Git# 0bd80eee0691). Built 2021-03-05T01:42:43.498Z (14 days old)
Detected Java version: 11.0.9.1 from /home/mark/.sdkman/candidates/java/11.0.9.open-adpt on Linux/amd64 (64bit). 8028MB available
dir = /home/mark/Documents/Projects/temp/fhir-spl, path = /home/mark/gems/bin:/home/mark/Downloads/google-cloud-sdk/bin:/home/mark/gems/bin:/home/mark/.nvm/versions/node/v8.9.1/bin:/home/mark/.sdkman/candidates/java/current/bin:/home/mark/.sdkman/candidates/gradle/current/bin:/home/mark/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:Users/home/mark/.local/bin:Users/home/mark/.local/bin
Parameters: -ig .
Start Clock @ Friday, March 19, 2021 at 5:10:19 p.m. Eastern Daylight Time (2021-03-19T17:10:19-04:00)
API keys loaded from /home/mark/apikeys.ini (00:00.0013)
Package Cache: /home/mark/.fhir/packages (00:00.0015)
Run Sushi on /home/mark/Documents/Projects/temp/fhir-spl (00:00.0015)
Sushi: info Running SUSHI v1.3.0 (implements FHIR Shorthand specification v1.1.0) (00:00.0375)
Sushi: info Arguments: (00:00.0375)
Sushi: info --out /home/mark/Documents/Projects/temp/fhir-spl (00:00.0376)
Sushi: info /home/mark/Documents/Projects/temp/fhir-spl (00:00.0376)
Sushi: info Using configuration file: /home/mark/Documents/Projects/temp/fhir-spl/sushi-config.yaml (00:00.0379)
Sushi: info Importing FSH text... (00:00.0389)
Sushi: info Preprocessed 12 documents with 1 aliases. (00:00.0585)
Sushi: error BigInt is not defined (00:00.0590)
Sushi: File: /home/mark/Documents/Projects/temp/fhir-spl/input/fsh/EstablishmentLogicalModel.fsh (00:00.0590)
Sushi: Line: 1 - 337 (00:00.0591)
Sushi: error BigInt is not defined (00:00.0593)
Sushi: File: /home/mark/Documents/Projects/temp/fhir-spl/input/fsh/GDUFALogicalModel.fsh (00:00.0594)
Sushi: Line: 1 - 247 (00:00.0594)
Sushi: error BigInt is not defined (00:00.0595)
Sushi: File: /home/mark/Documents/Projects/temp/fhir-spl/input/fsh/LabelerLogicalModel.fsh (00:00.0595)
Sushi: Line: 1 - 220 (00:00.0596)
Sushi: error BigInt is not defined (00:00.0596)
Sushi: File: /home/mark/Documents/Projects/temp/fhir-spl/input/fsh/Operations.fsh (00:00.0596)
Sushi: Line: 1 - 27 (00:00.0597)
Sushi: error BigInt is not defined (00:00.0598)
Sushi: File: /home/mark/Documents/Projects/temp/fhir-spl/input/fsh/ProductSubmissionLogicalModel.fsh (00:00.0598)
Sushi: Line: 1 - 328 (00:00.0599)
Sushi: info Imported 32 definitions and 18 instances. (00:00.0601)
Sushi: info Checking local cache for hl7.fhir.r4.core#4.0.1... (00:00.0602)
Sushi: info Found hl7.fhir.r4.core#4.0.1 in local cache. (00:00.0980)
Sushi: info Loaded package hl7.fhir.r4.core#4.0.1 (00:00.0981)
Sushi: info Converting FSH to FHIR resources... (00:01.0035)
Sushi: info Converted 23 FHIR StructureDefinitions. (00:01.0921)
Sushi: info Converted 2 FHIR CodeSystems. (00:01.0953)
Sushi: info Converted 7 FHIR ValueSets. (00:02.0017)
Sushi: info Converted 18 FHIR instances. (00:02.0473)
Sushi: info Exporting FHIR resources as JSON... (00:02.0473)
Sushi: info Exported 50 FHIR resources as JSON. (00:02.0523)
Sushi: info Assembling Implementation Guide sources... (00:02.0523)
Sushi: error Group LogicalModel configured with nonexistent resource StructureDefinition/LabelerCodeRequestLogicalModel (00:02.0525)
Sushi: error Group LogicalModel configured with nonexistent resource StructureDefinition/EstablishmentRegistrationLogicalModel (00:02.0526)
Sushi: error Group LogicalModel configured with nonexistent resource StructureDefinition/GDUFAFacilityIdentificationLogicalModel (00:02.0526)
Sushi: error Group LogicalModel configured with nonexistent resource StructureDefinition/ProductSubmissionDocumentLogicalModel (00:02.0526)
Sushi: error Group Operations configured with nonexistent resource OperationDefinition/processOrganizationBundle (00:02.0526)
Sushi: info Generated ImplementationGuide-hl7.fhir.us.spl.json (00:02.0529)
Sushi: info Assembled Implementation Guide sources; ready for IG Publisher. (00:02.0530)
Sushi: (00:02.0530)
Sushi: ========================= SUSHI RESULTS =========================== (00:02.0530)
Sushi: | ------------------------------------------------------------- | (00:02.0531)
Sushi: | | Profiles | Extensions | ValueSets | CodeSystems | Instances | | (00:02.0531)
Sushi: | |-------------------------------------------------------------| | (00:02.0531)
Sushi: | | 19 | 4 | 7 | 2 | 18 | | (00:02.0532)
Sushi: | ------------------------------------------------------------- | (00:02.0532)
Sushi: | | (00:02.0532)
Sushi: =================================================================== (00:02.0533)
Sushi: | Some-fin went wrong... 10 Errors 0 Warnings | (00:02.0533)
Sushi: =================================================================== (00:02.0533)
Sushi couldn't be run. Complete output from running Sushi : (00:02.0539)
Note: Check that Sushi is installed correctly ("npm install -g fsh-sushi". On windows, get npm from https://www.npmjs.com/get-npm) (00:02.0539)
Exception: Process exited with an error: 10 (Exit value: 10) (00:02.0539)
Publishing Content Failed: Process exited with an error: 10 (Exit value: 10) (00:02.0540)
(00:02.0540)
Use -? to get command line help (00:02.0540)
(00:02.0540)
Stack Dump (for debugging): (00:02.0540)
org.apache.commons.exec.ExecuteException: Process exited with an error: 10 (Exit value: 10)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:153)
at org.hl7.fhir.igtools.publisher.Publisher.runFsh(Publisher.java:1567)
at org.hl7.fhir.igtools.publisher.Publisher.initialize(Publisher.java:1451)
at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:726)
at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:8424)
Mark Iantorno (Mar 19 2021 at 21:11):
@Jean Duteau
Mark Iantorno (Mar 19 2021 at 21:11):
any idea why this is happening
Mark Iantorno (Mar 19 2021 at 21:11):
Sushi is installed
Jean Duteau (Mar 19 2021 at 21:14):
no, BigInt isn't in those files, so this seems like a SUSHI bug. I'd suggest to reinstall sushi?
Mark Iantorno (Mar 19 2021 at 21:15):
will try
Jean Duteau (Mar 19 2021 at 21:15):
Here is a guide that doesn't have logical models, not sure if that will bypass this error: https://github.com/bcgov/moh-plr-fhir
Gino Canessa (Mar 19 2021 at 21:16):
It's also happening on the Subscription Backport IG, which is fairly simple.
Mark Iantorno (Mar 19 2021 at 21:19):
quick question, does sushi work on linux
Jens Villadsen (Mar 19 2021 at 21:20):
yep
Mark Iantorno (Mar 19 2021 at 21:20):
kk
Mark Iantorno (Mar 19 2021 at 21:20):
wanted to make sure
Jean Duteau (Mar 19 2021 at 21:30):
Yeah, that code all got added on March 2nd. The problem is that the list of valid type codes is only String. In the snapshots that are being created, we have the following declaration of type:
"type": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
"valueUrl": "uri"
}
],
"code": "http://hl7.org/fhirpath/System.String"
}
],
The validation uses this where the type is declared as fhirpath/System.String. That is actually incorrect. It should be "http://hl7.org/fhir/data-types/uri".
This leads me to believe that the bug is not necessarily in this new validation routine but in the snapshot generation which is putting the wrong type for this element.
Lloyd McKenzie (Mar 19 2021 at 21:34):
I think the issue is that the code isn't doing camel-casing properly. It should be looking for fixedUri rather than fixeduri
Jean Duteau (Mar 19 2021 at 21:36):
i'm not sure that an earlier report about changing it to uri wasn't a red herring. Here's the code where it builds up the valid set of types:
List<Element> types = element.getChildrenByName("type");
Set<String> typeCodes = new HashSet<>();
for (Element type : types) {
if (hasMustSupportExtension(type)) {
typeMustSupport = true;
}
typeCodes.add(type.getChildValue("code"));
// check the stated profile - must be a constraint on the type
if (snapshot || sd != null) {
validateElementType(errors, type, stack.push(type, -1, null, null), sd, element.getChildValue("path"));
}
}
It's just looking at element.type.code.
Jean Duteau (Mar 19 2021 at 21:37):
That totally fits with the error message: 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 only value in the typeCode array is System.String because that's exactly what the snapshot says it can be. So fixedUri isn't allowed. fixedSystem.String would be :)
Lloyd McKenzie (Mar 19 2021 at 21:39):
Extension.url has a type of 'uri' - so why is the list of allowed types only String?
Jean Duteau (Mar 19 2021 at 21:40):
look up in the chat. because the snapshot is saying that it's type is [http://hl7.org/fhirpath/System.String]
Lloyd McKenzie (Mar 19 2021 at 21:40):
So it's a snapshot generation issue?
Jean Duteau (Mar 19 2021 at 21:40):
yes, I think this is actually a bug in snapshot generation
Jean Duteau (Mar 19 2021 at 21:53):
yeah, I manually changed the generated structure definition from "http://hl7.org/fhirpath/System.String" to "string" or "uri" and then ran the validator and it passed.
Jean Duteau (Mar 19 2021 at 21:55):
I'm not sure why the snapshot generation is putting both "string" and "uri" to "http://hl7.org/fhirpath/System.String". There might be a reason for that. But if there is, the validator code that checks types doesn't recognize it.
Mark Iantorno (Mar 19 2021 at 21:55):
so explain to me exactly what would need to be changed here
Mark Iantorno (Mar 19 2021 at 21:56):
when the generation happens you want uri's to be labelled as Strings?
Jean Duteau (Mar 19 2021 at 21:56):
well, I think the easiest solution is to comment out lines 152-162 in the StructureDefinitionValidator. I'm loathe to change the snapshot generator without knowing why it's spitting out http://hl7.org/fhirpath/System.String.
Mark Iantorno (Mar 19 2021 at 21:58):
okay, i can make that change in the validator for now, and then tag Grahame to actually figure out what is going on when he is back from being sick
Jean Duteau (Mar 19 2021 at 21:58):
exactly. Can you point me to the code that does snapshot generation? I can look into that and see if I can see why it's doing what it is doing.
Mark Iantorno (Mar 19 2021 at 21:58):
I will have to run the full test suite to make sure I don' mess up anythig
Mark Iantorno (Mar 19 2021 at 21:58):
give me a bit
Mark Iantorno (Mar 19 2021 at 22:19):
PR here: https://github.com/hapifhir/org.hl7.fhir.core/pull/465
Jean Duteau (Mar 19 2021 at 22:31):
pardon my ignorance, but what is the process to move from the pull request to getting out a new release of the publisher?
Mark Iantorno (Mar 19 2021 at 22:48):
lots of pipelines
Mark Iantorno (Mar 19 2021 at 22:48):
I will detail shortly
Lloyd McKenzie (Mar 19 2021 at 22:50):
Phrased a different way - @Mark Iantorno do you expect to push out a new version of the publisher incorporating that rollback "soon-ish"?
Lloyd McKenzie (Mar 19 2021 at 22:50):
:)
Mark Iantorno (Mar 19 2021 at 22:50):
Version 5.3.6 of the core libraries will have this fix, the pipeline running the job is here: https://dev.azure.com/fhir-pipelines/fhir-core-library/_build/results?buildId=2855&view=results
Mark Iantorno (Mar 19 2021 at 22:50):
this will take 45ish min to release
Mark Iantorno (Mar 19 2021 at 22:50):
once that is completed, I will need to release the IG publisher
Mark Iantorno (Mar 19 2021 at 22:51):
The current version of the IG publisher is 1.1.63, these changes will be released in IG publisher 1.1.64
Mark Iantorno (Mar 19 2021 at 22:53):
if everything works this should all be done in a couple hours
Mark Iantorno (Mar 19 2021 at 22:53):
takes time to upload and run all the tests and such
Mark Iantorno (Mar 20 2021 at 00:14):
The latest build is live
Mark Iantorno (Mar 20 2021 at 00:15):
v1.1.64 is available to download here: https://github.com/HL7/fhir-ig-publisher/releases/tag/1.1.64
Mark Iantorno (Mar 20 2021 at 00:15):
please let me know if there is an issue
Grahame Grieve (Mar 30 2021 at 07:21):
this is properly working the latest validator now
Jean Duteau (Mar 30 2021 at 07:30):
Did you fix the snapshot generation code? We have an R5 ticket that has the same symptoms that caused this validation error.
Grahame Grieve (Mar 30 2021 at 19:23):
no the problem was in the validator.
Jean Duteau (Mar 30 2021 at 19:55):
really? Because we have a JIRA issues that seems related:
FHIR-28586: unsignedInt.value has a type.code of System.String
{
"id" : "unsignedInt.value",
"path" : "unsignedInt.value",
"representation" : ["xmlAttr"],
"short" : "Primitive value for unsignedInt",
"definition" : "Primitive value for unsignedInt",
"min" : 0,
"max" : "1",
"type" : [{
"extension" : [{
"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
"valueUri" : "unsignedInt"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/regex",
"valueString" : "[0]|([1-9][0-9]*)"
}],
"code" : "http://hl7.org/fhirpath/System.String"
}
Do you know why the snapshot generation is putting System.String here?
Grahame Grieve (Mar 30 2021 at 21:58):
for what version?
Jean Duteau (Mar 30 2021 at 22:00):
that's currently in R5
Grahame Grieve (Mar 30 2021 at 22:00):
oh. not an IG issue?
Jean Duteau (Mar 30 2021 at 22:14):
that's not an IG issue but it looked the same as the error we saw in the IGs
Grahame Grieve (Mar 31 2021 at 00:02):
yes it should be System.Integer not System.String
Jean Duteau (Mar 31 2021 at 00:49):
right. do you know where this gets created? Marc and I couldn't see it, so I assigned the issue to you. If it's something you can point me to, i.e. not some snapshot generation code, then I'll take it back
Grahame Grieve (Mar 31 2021 at 00:59):
it's in code, that one. Just found it. I'll commit it now but it won't be released for a few days
Jean Duteau (Mar 31 2021 at 01:00):
thanks. i'll mark the issue as applied.
Grahame Grieve (Mar 31 2021 at 01:21):
https://github.com/HL7/kindling/pull/12
Last updated: Apr 12 2022 at 19:14 UTC