Stream: genomics
Topic: validating against the IG
Bob Milius (Oct 29 2018 at 18:37):
I need to upload some examples to the Genomics Reporting IG, but want to make sure they validate against the current profile. I'm running the FHIR Validator and I can validate against the default FHIR version (3.6.0), but am having trouble when trying to validate against the IG. Any suggestions? I tried this...
$ java -jar org.hl7.fhir.validator.jar diagnosticreport-hla-r4.xml -ig http://build.fhir.org/ig/HL7/genomics-reporting -profile http://build.fhir.org/ig/HL7/genomics-reporting/StructureDefinition/diagnosticreport FHIR Validator Build ?? Arguments: diagnosticreport-hla-r4.xml -ig http://build.fhir.org/ig/HL7/genomics-reporting -profile http://build.fhir.org/ig/HL7/genomics-reporting/StructureDefinition/diagnosticreport -output out.txt .. connect to tx server @ http://tx.fhir.org .. definitions from hl7.fhir.core#3.6.0 (v3.6.0-null) + .. load IG from http://build.fhir.org/ig/HL7/genomics-reporting Loading http://build.fhir.org/ig/HL7/genomics-reporting/package.tgz to the package cache Fetching:.... done. Fetch Profile from http://build.fhir.org/ig/HL7/genomics-reporting/StructureDefinition/diagnosticreport Exception in thread "main" java.lang.Exception: Unable to find definitions at URL 'http://build.fhir.org/ig/HL7/genomics-reporting/StructureDefinition/diagnosticreport': http://build.fhir.org/ig/HL7/genomics-reporting/StructureDefinition/diagnosticreport?nocache=1540838122053 at org.hl7.fhir.r4.validation.ValidationEngine.loadProfileFromUrl(ValidationEngine.java:360) at org.hl7.fhir.r4.validation.ValidationEngine.loadProfileSource(ValidationEngine.java:346) at org.hl7.fhir.r4.validation.ValidationEngine.loadProfile(ValidationEngine.java:611) at org.hl7.fhir.r4.validation.Validator.main(Validator.java:401) Caused by: java.io.FileNotFoundException: http://build.fhir.org/ig/HL7/genomics-reporting/StructureDefinition/diagnosticreport?nocache=1540838122053 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1890) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) at org.hl7.fhir.r4.validation.ValidationEngine.loadProfileFromUrl(ValidationEngine.java:358) ... 3 more $
Lloyd McKenzie (Oct 29 2018 at 18:43):
Might be best to raise this one on the IG creation or committers thread
Kevin Power (Oct 29 2018 at 18:47):
Hmm, I have never tried it this way. Maybe when referring to the IG, you have to refer to the actual IG contents? http://build.fhir.org/ig/HL7/genomics-reporting/ImplementationGuide-genomics-reporting.json
Kevin Power (Oct 29 2018 at 18:48):
And similar for the profile? http://build.fhir.org/ig/HL7/genomics-reporting/StructureDefinition-diagnosticreport.json
Jamie Jones (Oct 29 2018 at 18:49):
It looks like you may also have to specify -version current
to confirm the build version of the IG, I haven't played around with the Validator yet.
Kevin Power (Oct 29 2018 at 18:57):
Or this as the IG:
-ig hl7.fhir.uv.genomics-reporting#dev
Jamie Jones (Oct 29 2018 at 18:59):
Curiously, the generated structuredefns on build.fhir.org are listed as http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/diagnosticreport so might have to specifically target them
Bob Milius (Oct 29 2018 at 19:09):
@Kevin Power from the docs, it sounds like to use the #dev, I'd have to have an implementation built on my machine
if you want to validate against an implementation that you built yourself using the IG publisher on your own machine, use 'dev' as the version
Kevin Power (Oct 29 2018 at 19:11):
ahh, OK. That would explain why it is in my cache that way.
Bob Milius (Oct 29 2018 at 19:13):
I'll try that, ie cloning it and running the publisher locally
Kevin Power (Oct 29 2018 at 19:31):
Looking more closely at the error:
Fetch Profile from http://build.fhir.org/ig/HL7/genomics-reporting/StructureDefinition/diagnosticreport
Exception in thread "main" java.lang.Exception: Unable to find definitions at URL 'http://build.fhir.org/ig/HL7/genomics-reporting/StructureDefinition/diagnosticreport': http://build.fhir.org/ig/HL7/genomics-reporting/StructureDefinition/diagnosticreport?nocache=1540838122053
Perhaps it how you referenced the profile? And you need to add a .json to it to get the specific contents?
Kevin Power (Oct 29 2018 at 19:32):
Which again, is like this: http://build.fhir.org/ig/HL7/genomics-reporting/StructureDefinition-diagnosticreport.json
Bob Milius (Oct 29 2018 at 22:16):
Okay, making progress... here's my command which seems to try to validate a very simple genotype observation after building the IG locally:
$ java -jar org.hl7.fhir.validator.jar observation_genotype_HLA-A_R4.xml -ig hl7.fhir.uv.genomics-reporting#dev -profile http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-genotype FHIR Validator Build ?? Arguments: observation_genotype_HLA-A_R4.xml -ig hl7.fhir.uv.genomics-reporting#dev -profile http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-genotype .. connect to tx server @ http://tx.fhir.org .. definitions from hl7.fhir.core#3.6.0 (v3.6.0-null) + .. load IG from hl7.fhir.uv.genomics-reporting#dev .. validate [observation_genotype_HLA-A_R4.xml] against [http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-genotype] Terminology server: Check for supported code systems for http://loinc.org Success...validating observation_genotype_HLA-A_R4.xml: error:0 warn:0 info:0
Bob Milius (Oct 29 2018 at 22:19):
But I'm getting validation errors when I try to add a component for gene name:
<component> <code> <coding> <system value="http://loinc.org"/> <code value="48018-6"/> <display value="Gene studied [ID]"/> </coding> </code> <valueCodeableConcept> <coding> <system value="https://www.genenames.org"/> <code value="HGNC:4931"/> <display value="HLA-A"/> </coding> </valueCodeableConcept> </component>
The validator gives me this error:
Error @ Observation.component.valueCodeableConcept (line 92, col31) : None of the codes provided are in the value set http://hl7.org/fhir/uv/genomics-reporting/ValueSet/hgnc (http://hl7.org/fhir/uv/genomics-reporting/ValueSet/hgnc, and a code from this value set is required) (codes = https://www.genenames.org#HGNC:4931)
Kevin Power (Oct 29 2018 at 22:25):
That is one of the things that @Patrick Werner is trying to figure out by building proper value sets. Here is the HGNC value set as of now, which you can see is actually empty. Meaning, we don't actually have HGNC gene codes properly handled. Perhaps we need to make HGNC as an 'example' for now instead of 'required' so it validates until we figure out the HGNC ValueSet?
Bob Milius (Oct 29 2018 at 22:26):
yeah, at least to get the validator to handle it until something is in place
Bob Milius (Oct 29 2018 at 22:29):
Here's another validator issue... if I change the observation.code to what is required for Haplotype Observation instead of what's required for Genotype Observation, it validates fine against the genotype structuredefinition. I would think it should throw an error since the binding is required.
Kevin Power (Oct 29 2018 at 22:30):
If you have the IG local and building, you can make that change yourself to test it. In genomics-reporting/src/resources/observation-profile-spreadsheet.xml
, you can go to the Bindings tab, and make HGNC (and likely others) example instead of required.
Kevin Power (Oct 29 2018 at 22:33):
RE: Genotype/Haplotype - The codes are listed in the Pattern? Would have to defer to @Lloyd McKenzie or someone else to say how the validator would look at those.
Kevin Power (Oct 29 2018 at 22:38):
Actually, betting you have to slice the code like is done here: http://build.fhir.org/heartrate.html
Lloyd McKenzie (Oct 29 2018 at 22:39):
The validator might think it's simplyt not a Genotype or Haplotype - are you explicitly asserting that profile?
Bob Milius (Oct 29 2018 at 22:40):
@Lloyd McKenzie yep... here's my command
java -jar org.hl7.fhir.validator.jar observation_genotype_HLA-A_R4.xml -ig hl7.fhir.uv.genomics-reporting#dev -profile http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-genotype
Bob Milius (Oct 29 2018 at 22:41):
and here's my observation.code
<code> <coding> <system value="http://loinc.org"/> <code value="84414-2"/> <display value="Haplotype name"/> </coding> </code>
no errors
Kevin Power (Oct 29 2018 at 22:47):
May not be apples/apples - But here is the 'vitalsigns-heartrate-profile-spreadsheet' and how it formats the 'required' LOINC code in Observation.code:
pasted image
Kevin Power (Oct 29 2018 at 22:49):
I will admit this is a beyond my knowledge so I might be completely wrong - just trying to find something to compare.
Bob Milius (Oct 29 2018 at 22:49):
@Kevin Power regarding HGNC, yes, I changed binding from required to example, and rebuilt it, and validator now like it.
Bob Milius (Oct 29 2018 at 22:51):
@Lloyd McKenzie I also have this in my Observation:
<meta> <profile value="http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-genotype"/> </meta>
Lloyd McKenzie (Oct 29 2018 at 22:58):
If it's a required binding and the binding isn't met, that should cause an error.
Bob Milius (Oct 29 2018 at 22:58):
@Kevin Power are you suggesting we should add the other columns? eg Type and Value for Observation.code.coding.system and Observation.code.coding.type? Do they have anything for Pattern?
Bob Milius (Oct 29 2018 at 22:59):
@Lloyd McKenzie yes, that's what I expected
Bob Milius (Oct 29 2018 at 23:05):
Here's my example Genotype Observation with the wrong observation.code.
<Observation xmlns="http://hl7.org/fhir"> <meta> <profile value="http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-genotype"/> </meta> <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"> <pre>HLA-A*03:01:01:01+HLA-A*30:01:01</pre> </div> </text> <basedOn> <reference value="urn:uuid:FA407A8B-89DF-4AE9-B30D-9AA887DA7AD3"/> <type value="ServiceRequest"/> <display value="HLA-A typing for sample 001-246802468"/> </basedOn> <status value="final"/> <category> <coding> <system value="http://terminology.hl7.org/CodeSystem/observation-category"/> <code value="laboratory"/> </coding> </category> <!-- <code> <coding> <system value="http://loinc.org"/> <code value="84413-4"/> <display value="Genotype display name"/> </coding> </code> --> <code> <coding> <system value="http://loinc.org"/> <code value="84414-2"/> <display value="Haplotype name"/> </coding> </code> <effectiveDateTime value="2018-07-26"/> <performer> <reference value="urn:uuid:1927BBEE-39A0-4E3D-A51F-FEFF7448E81E"/> <type value="Organization"/> <display value="reporting-center ID"/> </performer> <valueCodeableConcept> <coding> <system value="https://glstring.org"/> <code value="hla#3.31.0#HLA-A*03:01:01:01+HLA-A*30:01:01"/> </coding> </valueCodeableConcept> <method> <text value="sbt-ngs locus=HLA-A test-id=PACBIOSequel test-id-source=Be The Match"/> </method> <specimen> <reference value="urn:uuid:249AA766-38F0-4770-809E-C2A58B5DED8A"/> <display value="buccal swab: 001-246802468"/> </specimen> <!-- <derivedFrom> <reference value="Observation/f456"/> <type value="Observation"/> <display value="HLA-A*03:01:01:01 allele"/> </derivedFrom> <derivedFrom> <reference value="Observation/f457"/> <type value="Observation"/> <display value="HLA-A*30:01:01 allele"/> </derivedFrom> --> <component> <code> <coding> <system value="http://loinc.org"/> <code value="48018-6"/> <display value="Gene studied [ID]"/> </coding> </code> <valueCodeableConcept> <coding> <system value="https://www.genenames.org"/> <code value="HGNC:4931"/> <display value="HLA-A"/> </coding> </valueCodeableConcept> </component> </Observation>
Bob Milius (Oct 29 2018 at 23:06):
and validator says it's okay
$ java -jar org.hl7.fhir.validator.jar observation_genotype_HLA-A_R4.xml -ig hl7.fhir.uv.genomics-reporting#dev -profile http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-genotype FHIR Validator Build ?? Arguments: observation_genotype_HLA-A_R4.xml -ig hl7.fhir.uv.genomics-reporting#dev -profile http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-genotype .. connect to tx server @ http://tx.fhir.org .. definitions from hl7.fhir.core#3.6.0 (v3.6.0-null) + .. load IG from hl7.fhir.uv.genomics-reporting#dev .. validate [observation_genotype_HLA-A_R4.xml] against [http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-genotype] Terminology server: Check for supported code systems for http://loinc.org Success...validating observation_genotype_HLA-A_R4.xml: error:0 warn:0 info:0
Lloyd McKenzie (Oct 29 2018 at 23:19):
That's definitely a validator bug. Submit a change request and point to this thread
Bob Milius (Oct 29 2018 at 23:20):
will do -- #19565
Kevin Power (Oct 29 2018 at 23:21):
We reference the haplotype/genotype Observation.code values as a "Pattern" - So @Lloyd McKenzie you are saying that should cause the validator to reject if the instance's Observation.code doesn't match the Pattern?
Kevin Power (Oct 29 2018 at 23:23):
Maybe it should - I just asked because it is different than how I see some other Observation.code things in other profiles (like the Heartrate one I referenced earlier)
Kevin Power (Oct 29 2018 at 23:31):
Or maybe something else I noted here: http://wiki.hl7.org/index.php?title=FHIR_Spreadsheet_Authoring#Structure_Tab
Pattern: This specifies a set of elements and values that must be present in the instance. It should only be present for complex data types and is expressed as XML. Additional elements and values not specified in the pattern are still permitted.
Note XML - It looks like our patterns are in JSON? Is that just an older out of date document? It does say its last edit was 2017.
Lloyd McKenzie (Oct 30 2018 at 01:34):
It should reject it. But patterns aren't used as much so it's not super-surprising that the validation isn't quite right.
Bob Milius (Oct 30 2018 at 18:19):
@Kevin Power what profile is that figure from? US-Core? Argonaut? STU3 or R4? I'm trying to edit a spreadsheet to resemble that and am having issues. Now the validator is not even recognizing my observation.code even when I think it's correct, e.g.,
*FAILURE* validating observation_genotype_HLA-A_R4.xml: error:1 warn:0 info:1 Error @ Observation.code (line 23, col11) : Profile http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-genotype, Element 'Observation.code.coding': minimum required = 1, but only found 0 Information @ Observation.code.coding (line 23, col19) : This element does not match any known slice for the profile http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-genotype
and here's my observation.code,
<code> <coding> <system value="http://loinc.org"/> <code value="84413-4"/> <display value="Genotype display name"/> </coding> </code>
Kevin Power (Oct 30 2018 at 18:23):
I pulled that from FHIR Core (fhir\source\observation\observation-vitalsigns-heartrate-profile-spreadsheet.xml)
Bob Milius (Oct 30 2018 at 18:29):
thanks! btw, I found a typo in my spreadsheet, so working better now.
Bob Milius (Oct 30 2018 at 20:38):
fyi, I have another issue with the validation, but asked the question in the conformance stream
Bob Dolin (Nov 08 2018 at 15:34):
I'm new to building / validating, but it seems as though our latest IG build is no longer visible (e.g. http://build.fhir.org/ig/HL7/genomics-reporting/). Any idea what is happening?
Kevin Power (Nov 08 2018 at 15:35):
Yup - Afraid it is a known issue (see the #IG creation channel)
Kevin Power (Nov 08 2018 at 15:39):
Specifically the topics "New error message in IG build" and "ig-autobuilder error"
Bob Dolin (Nov 08 2018 at 15:40):
ok, thanks @Kevin Power
Kevin Power (Jan 12 2019 at 15:50):
I have decided to work on some cleanup activities today regarding validation. I will look to start on errors found here
Last updated: Apr 12 2022 at 19:14 UTC