Stream: implementers
Topic: Resolving online profiles through client
Mads Øigård (Jan 29 2020 at 10:46):
Hey,
I'm trying to target my simplifier profile (https://simplifier.net/hdir-test/hdirperson) through a .net client doing this:
resolver.ResolveByUri("https://simplifier.net/resolve?target=simplifier&canonical=http://hdir.no/fhir/StructureDefinition/HdirPerson&fhirVersion=R4")
Or any variation of the api links provided on the profile page:
https://fhir.simplifier.net/hdir-test/StructureDefinition/84e0ae72-ee35-4a7a-836b-0411051bef53
https://fhir.simplifier.net/r4/StructureDefinition/84e0ae72-ee35-4a7a-836b-0411051bef53
Or just the canonical:
http://hdir.no/fhir/StructureDefinition/HdirPerson
The result is null every time. How do I correctly target my simplifier profile?
Martijn Harthoorn (Jan 29 2020 at 14:42):
ResolveByUri( )
requires a canonical URL, while the Simplifier resolve page redirects you to an actual documentation page.
Martijn Harthoorn (Jan 29 2020 at 14:43):
It is the resolver class implementation that determines where to get the actual data from.
Martijn Harthoorn (Jan 29 2020 at 14:44):
A FHIR server can resolve a canonical using this format:
https://<server-endpoint>/<resource-type>/?url=<canonical>
Martijn Harthoorn (Jan 29 2020 at 14:46):
So in the case of the Simplifier global FHIR endpoint:
https://fhir.simplifier.net/r4/StructureDefinition/?url=http://hdir.no/fhir/StructureDefinition/HdirPerson
Martijn Harthoorn (Jan 29 2020 at 14:46):
So you can implement a resolver that uses that endpoint for resolving.
Martijn Harthoorn (Jan 29 2020 at 14:47):
If you're only interested in resolving within that specific project, you can use the FHIR endpoint of that project:
Martijn Harthoorn (Jan 29 2020 at 14:48):
Mads Øigård (Jan 30 2020 at 09:03):
Thanks for the answer. I still can't get it to work. Here is my code:
var hdirPerson1 = "https://fhir.simplifier.net/r4/StructureDefinition/?url=http://hdir.no/fhir/StructureDefinition/HdirPerson";
var hdirPerson2 = "https://fhir.simplifier.net/hdir-test/StructureDefinition?url=http://hdir.no/fhir/StructureDefinition/HdirPerson";
var noBasisPerson = "https://fhir.simplifier.net/r4/StructureDefinition/?url=http://hl7.no/fhir/StructureDefinition/no-basis-Person";
var source = new CachedResolver(new MultiResolver(
new DirectorySource(@"./Profiles/"),
new ZipSource(new DirectorySource(@"./Profiles/").ContentDirectory + "definitions.json.zip")));
var webResolver = new WebResolver();
var def = source.ResolveByUri(hdirPerson1)
as StructureDefinition;
////var def2 = webResolver.ResolveByUri(hdirPerson1); throws argnull parameter name endpoint(??) == null
var validator = new Hl7.Fhir.Validation.Validator(source.BuildSettings());
var outcome = validator.Validate(
resource); // , def
return outcome;
Is there anywhere I can read some concrete documentation on resolver implementations? def == null with all of these URLs.
Ward Weistra (Feb 11 2020 at 16:36):
Hi @Mads Øigård, the #dotnet stream should likely get you a quicker response.
Last updated: Apr 12 2022 at 19:14 UTC