FHIR Chat · FHIR Resource Validation · dotnet

Stream: dotnet

Topic: FHIR Resource Validation


view this post on Zulip Sunil Lanke (Dec 11 2019 at 10:55):

I am new to FHIR, I want to validate FHIR resource against custom profile, how should I go ahead?

view this post on Zulip Ward Weistra (Dec 11 2019 at 13:09):

Hi Sunil, there are multiple options for that. I'll assume you're specifically looking to use the #dotnet validator, given the stream you've posted in.

They're all based on the same .NET validator. Does that answer your question?

view this post on Zulip Mirjam Baltus (Dec 11 2019 at 17:28):

To add to that, if you need to incorporate the .Net validator into your own code, you can take a look at this example project: https://github.com/FirelyTeam/Furore.Fhir.ValidationDemo. It is a bit older, but the code works for newer versions of the library and FHIR R4 as well.

view this post on Zulip Sunil Lanke (Dec 13 2019 at 06:06):

To add to that, if you need to incorporate the .Net validator into your own code, you can take a look at this example project: https://github.com/FirelyTeam/Furore.Fhir.ValidationDemo. It is a bit older, but the code works for newer versions of the library and FHIR R4 as well.

Hi, Thanks for your reply.
I have looked into this demo project, and I am inclined towards using this Hl7.Fhir.Specification component to use for Validation. But unfortunately, this uses default FHIR profiles, I am looking for validating custom profiles. This component uses XDS schema files of the profiles for validation, and I don't have XSD for custom profiles.
How can I create the XSD files of these custom profiles? Is there any tool?

view this post on Zulip Grahame Grieve (Dec 13 2019 at 06:07):

you can't create xsd files for the profiles. The make rules on top of the existing syntax which is what xsd can express.

view this post on Zulip Sunil Lanke (Dec 13 2019 at 06:07):

Hi Sunil, there are multiple options for that. I'll assume you're specifically looking to use the #dotnet validator, given the stream you've posted in.

They're all based on the same .NET validator. Does that answer your question?

Thanks for your reply.
I am looking for Custom Profile validation on Client system.

view this post on Zulip Grahame Grieve (Dec 13 2019 at 06:07):

the validator takes the structure definitions from the packages, and uses those to check the instances against the profiles

view this post on Zulip Mirjam Baltus (Dec 13 2019 at 08:12):

@Sunil Lanke : When you say 'custom profiles', do you mean that you have created custom structures, i.e. non-FHIR ones? Or do you mean you have profiled standard FHIR resource/data types? If the latter, you can just point the validator to the folder containing your profiles, set the meta.profile field in the resource instance, and validate against your own profiles. The validator can take a look at the xsd files for the standard structures - there's a setting for it - but this is in addition to using the StructureDefinitions.

view this post on Zulip Sunil Lanke (Dec 13 2019 at 11:45):

Sunil Lanke : When you say 'custom profiles', do you mean that you have created custom structures, i.e. non-FHIR ones? Or do you mean you have profiled standard FHIR resource/data types? If the latter, you can just point the validator to the folder containing your profiles, set the meta.profile field in the resource instance, and validate against your own profiles. The validator can take a look at the xsd files for the standard structures - there's a setting for it - but this is in addition to using the StructureDefinitions.

Hi, Thanks, this worked for me.
But what I observed that Validator does not validate as per the Schematron defined for the profile, so trying to solve that issue.

view this post on Zulip Mirjam Baltus (Dec 13 2019 at 12:25):

As Grahame mentioned, StructureDefinitions define the rules much more precise, so that is what the validator uses. You do not need the schematron if you have your profile.


Last updated: Apr 12 2022 at 19:14 UTC