Stream: implementers
Topic: Seemingly valid profiles don't render in Simplifier
Chris Munro (Jul 04 2017 at 12:53):
This profile https://simplifier.net/ELabNetwork/OpenFoodChallengeOutcome
and https://simplifier.net/ELabNetwork/OpenFoodChallengeSymptoms
I believe are both valid, in that there are no errors in Forge, however, the overview part is displaying 'this resource cannot be rendered'. Retrieving it by the endpoint e.g. in C# FHIR API seems to work fine though. One for @Mirjam Baltus or @Michel Rutten maybe??
Mirjam Baltus (Jul 04 2017 at 16:26):
@Chris Munro I see three errors when I run the first StructureDefinition through a validator. The first is that the StructureDefinition.date is not correct. It should either not have a time, or have a timezone added. The other two are more obscure, failing constraint sdf-14, meaning you have a duplicate element.id somewhere, and constraint sdf-20, saying something about slicing on the top level. It is possible that Forge doesn't detect those yet, because we are having some issues with slicing and element ids. I did not go through the XML in depth to find those last two issues, just saying what my validator told me.
Chris Munro (Jul 05 2017 at 08:31):
Thank you @Mirjam Baltus, is the validator a piece of Furore software or can I download it from the FHIR website? If so I can use it to check the profiles myself.
Mirjam Baltus (Jul 05 2017 at 11:11):
I've used the demo tool on Ewout's GitHub: https://github.com/ewoutkramer/Furore.Fhir.ValidationDemo/tree/develop-stu3. Note that this is not a production tool, but it usually gives me a nice idea of things that could be wrong.
Chris Munro (Jul 05 2017 at 12:49):
Thanks @Mirjam Baltus
Richard Kavanagh (Jul 05 2017 at 12:54):
Just so you are aware - we are working with Furore on the validation parts of the software and recently reported a few bugs. Furore have hopefully fixed these now but that code will not be in the current NuGet package. If you want the "latest" version youl'll need to build the library yourself.
Brian Reinhold (Jul 05 2017 at 18:39):
I downloaded an built the validator but it doesn't seem to find the profiles loaded into the directory; doesn't even work when I point to the 'examples' directory that came with the package. Any ideas what I am doing wrong? Does the exe need to be run from a certain directory?
Eric Haas (Jul 05 2017 at 21:30):
if you are talking about the java jar validator in the spec. Here is my bash file that will validate all the resource in the listed directory based on the profile. Note the profile must declared be in the resource's meta.profile element for it to work.... the profiles are defined after -ig
which is the ig's validator pack in this case. you also use the -profile
option for a single profile too.
#!/bin/bash name="US-Core" path=/Users/ehaas/Documents/FHIR/US-Core echo "=================================================================" echo === Validate $name IG!!! $(date -u) === echo "=================================================================" sleep 1 fs="" for f in "${path}"/examples/*.* do s=${f##*/} echo validating ${s%.*}... fs="$fs $f" done java -jar /Users/ehaas/Downloads/validator/org.hl7.fhir.validator.jar ${fs} -defn /Users/ehaas/Downloads/igpack.zip -ig "${path}"/output/validator.pack
Brian Reinhold (Jul 05 2017 at 23:02):
Eric, Where do you get this jar validator? I am creating profiles by hand because of Forge bugs and I could really use one!
Never mind, I was looking for a profile validator, not a FHIR example validator!
Lloyd McKenzie (Jul 05 2017 at 23:34):
Profiles are a type of FHIR example (they're instances of StructureDefinition). The instance validator validates profiles too as well as validating instances against profiles.
Eric Haas (Jul 06 2017 at 00:04):
jar validator here
Mirjam Baltus (Jul 06 2017 at 08:28):
@Brian Reinhold If you run the program, you can just paste the XML for your StructureDefinition into the XML instance window and click validate. It will validate the profile against the base specification. The directory can be used to store profiles and then validate an example against them.
Brian Reinhold (Jul 06 2017 at 09:18):
Mirjam, I think I misunderstood the validator. I thought it would validate my profile, not an xml USING a profile.Due to bugs in the Forge tool I am writing a profile by editing xml directly by hand. This is messy and easily subject to errors. I can get a partial test by loading the profile into Forge and seeing if I get errors. But sometimes I know there are errors and it doesn't complain, and sometimes I get errors but I cannot see what is wrong. So I was looking for an independent profile validator in lieu of Forge.
Vadim Peretokin (Jul 06 2017 at 09:34):
@Brian Reinhold I take it you know of the schema + xsd validation you could apply? I imagine it wouldn't catch all types of errors, like if you didn't get all the elements for setting up slicing right, but it's a bit of a help.
Brian Reinhold (Jul 06 2017 at 09:54):
Vadim, I am not aware of those. Does a profile schema exist that I could use with this tool to validate my profiles? If so, where would I place the schema so the validator finds it? Do I then check the 'xsd' box? Thanks!
Marten Smits (Jul 06 2017 at 11:54):
@Chris Munro Thanks for reporting! We fixed a bug (our fault) your profile is perfectly fine. Your resource should render after we deploy a new version of simplifier. I'll let you know when that happens. (Probably this week or early next week).
Vadim Peretokin (Jul 06 2017 at 13:34):
@Brian Reinhold Yeah, FHIR has XML Schema and Schematron files available (download).
You can use any tool that supports validating with them - I personally use Oxygen XML editor. There is a "Validate with..." option you can use - point it to structuredefinition.sch
and then structuredefinition.xsd
to validate using both.
Later on you can just assign the schematron and schema to the profile and validate in one go.
Brian Reinhold (Jul 06 2017 at 14:12):
@Vadim Peretokin it looks like this is still a validation for a resource following a profile. I am looking to validate the profile.xml itself.
Eric Haas (Jul 06 2017 at 14:26):
Did not realize you were not using the schema - hand editing is 1000% easier using the schema + Spy or Oxygen - it catches 90% of your errors then the validation tools catch the rest. After I get an error free structure, instead of applying the schematron ( since I use XMLSpy - not as slick as Oxygen) I usually just upload the file to a test server and the server will validate the rest of the way. Realized that these errors are typically due to some invariants or a supported profile. If the server doesn't support the profile then i use the java jar above to finish the job.
Lloyd McKenzie (Jul 06 2017 at 16:45):
A profile is a resource that follows a profile - it follows the StructureDefinition profile
Eric Haas (Jul 06 2017 at 16:47):
I was speaking generically. If the profile is only defined on my laptop then I have to use the java jar and my profile definition and not try uploading to a test server
Eric Haas (Jul 06 2017 at 16:48):
profile could be SD or Obs etc
Vadim Peretokin (Jul 07 2017 at 06:45):
@Brian Reinhold Hi Brian, this is for the profile.xml itself.
Christiaan Knaap (Jul 07 2017 at 12:05):
You can also validate by sending it to vonk.furore.com/<resourcetype>/$validate, and provide the resource to be validated in the body. If you need specific StructureDefinitions beyond those in the specification to validate against, you can post them first to /StructureDefinition. This requires no installation on your side, and the resource to be validated will not be stored on the server. The validation code behind it is the same as in the .Net library. The OperationOutcome that you get back will list any issues.
Last updated: Apr 12 2022 at 19:14 UTC