Stream: hapi
Topic: HAPI Validation using derived profiles
Kevin Mayfield (Jun 19 2020 at 05:28):
Does HAPI work with derived profiles?
FHIR Validator works fine, as does hapi with https://fhir.nhs.uk/R4/StructureDefinition/UKCore-PractitionerRole.
but https://fhir.nhs.uk/R4/StructureDefinition/DM-PractitionerRole which is a derived profile returns
https://fhir.nhs.uk/R4/StructureDefinition/DM-PractitionerRole
I can see the StructureDefinition being returned in the valiation chain. (I'm still debugging)
Kevin Mayfield (Jun 19 2020 at 06:16):
This is getting weird. It's finding resources that are not in supplied packages but in ones I unofficially released using IG Publisher.
Grahame Grieve (Jun 19 2020 at 06:18):
note that the core HAPI validator is the same is the FHIR Validator, but the context it runs in is much more complicated than the FHIR validation because the context management gives you - the system integrator using HAPI - much more control, as befits an application library.
Also, which version of FHIR are you using? the package subsystem was re-written in HAPI 5
Kevin Mayfield (Jun 19 2020 at 06:36):
on HAPI 5 but did have this working on earlier versions. I think I need to clear my cache - suspect I've got it looking there.
Kevin Mayfield (Jun 19 2020 at 07:24):
Need to investigate more. It does seem the (simplifier) packages I'm using are be ignored for another source of packages somewhere in the process.
Kevin Mayfield (Jun 19 2020 at 15:13):
snapshot?
Kevin Mayfield (Jun 19 2020 at 15:31):
And the problem was the new person on the team not creating a snapshot profiles in the IG......
No names
Kevin Mayfield (Jun 19 2020 at 19:56):
@Ward Weistra not sure if it’s a requirement for packages but issue above was caused by lack of snapshot in profile.
Grahame Grieve (Jun 19 2020 at 19:59):
the validator should just automatically populate the snapshot. So I would like to know why that's a problem
Ward Weistra (Jun 19 2020 at 20:28):
@Kevin Mayfield Also, it's not a requirement yet, but we are moving there to prevent other tools needing to generate it.
Kevin Mayfield (Jun 20 2020 at 03:46):
@Grahame Grieve I'm going to look into that, that's my preferred option. The packages look fine and I think I just need a step to create the snapshot during load (which I think is a step the FHIR Validator does).
Grahame Grieve (Jun 20 2020 at 03:46):
well, I think that the HAPI context should sort that out
Kevin Mayfield (Jun 20 2020 at 03:48):
It might be how I've created profiles. They are on top of UK Core profiles not base.
Grahame Grieve (Jun 20 2020 at 03:49):
shouldn't matter. my view is that the HAPI context should sort that out
Kevin Mayfield (Jun 21 2020 at 05:47):
TERMINOLOGY - I think its my validationSupport at fault. It needs to expand ValueSets and create Snapshots. Looking at https://github.com/hapifhir/org.hl7.fhir.core/blob/master/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/context/BaseWorkerContext.java some of this is done there. I think my fetchResource needs to do this.
The HAPI RemoteTerminologyServiceValidationSupport seems to behave differently to BaseWorkerContext around SNOMED.
Kevin Mayfield (Jun 21 2020 at 07:22):
SNAPSHOT - It appears the validation worker context would do that but I can't find a link to that in HAPI.
I should be calling something like ProfileUtilities in org.hl7.fhir.r4.conformance to generate the context.
Grahame Grieve (Jun 21 2020 at 09:54):
@James Agnew I think the context should look after snapshot generation automatically. Java user shouldn't have to think about this
Kevin Mayfield (Jun 21 2020 at 19:12):
ProfileUtilities.generateSnapshot worked for me.
I roughly followed this https://github.com/hapifhir/org.hl7.fhir.core/blob/463a5574027473db99df732859c1b408e11f0423/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/context/SimpleWorkerContext.java#L582
Last updated: Apr 12 2022 at 19:14 UTC