FHIR Chat · HAPI FHIR 5.3.0 · norway

Stream: norway

Topic: HAPI FHIR 5.3.0


view this post on Zulip Jens Villadsen (Feb 17 2021 at 17:00):

Hei norske gutter (@Espen Stranger Seland @Thomas Tveit Rosenlund @Øyvind Aassve ) - jeg tænkte det ville være bra for jer at kende til en ny feature (https://github.com/hapifhir/hapi-fhir/pull/2264) i HAPI FHIR 5.3.0 som jeg har anvendt sammen med @MedCom FHIR Team . Det gør at man kan validere en ressource på det tidspunkt hvor den gemmes. Sat sammen med featuren for at kunne loade Implementation Guide, så giver det muligheden for kunne sætte en hel FHIR server op med fuld validering fra en implementation guide. Dette har jeg gjort for MedCom i DK. Jeg tænker i bør overveje at gøre det samme. Giv lyd hvis I skal have hjælp til det.

view this post on Zulip Jens Villadsen (Feb 17 2021 at 17:03):

Det blev en del af HAPI FHIR starter projektet med mit PR (https://github.com/hapifhir/hapi-fhir-jpaserver-starter/pull/210)

view this post on Zulip Thomas Tveit Rosenlund (Feb 17 2021 at 18:17):

Interessant @Jens Villadsen
@Michal Cermak kanskje av interesse for deg også?

Er det ved POST/PUT av ressurser til server som er use-caset her?
Noterer man da i meta hvilken profil definisjon instansen er validert mot, og hvordan sier man i meta at det faktisk er gjort en validering?

view this post on Zulip Jens Villadsen (Feb 17 2021 at 18:29):

Korrekt (dokumentationen er her https://hapifhir.io/hapi-fhir/docs/validation/repository_validating_interceptor.html). De ressourcer som der modtages via PUT/POST/PATCH, valideres i forhold til det som er angivet i meta.profile.

view this post on Zulip Jens Villadsen (Feb 17 2021 at 18:30):

Så hvis I har en Implementation Guide, og denne installeres (det gøres nemt i HAPI FHIR starter), så vil alle resourcer der sendes til serveren validere i forhold til det som er angivet i selve ressourcen - automatisk.

view this post on Zulip Jens Villadsen (Feb 17 2021 at 18:31):

Det gør der MEGET let at sætte servere op til test og prototype brug hvis man har en implementation guide.

view this post on Zulip Jens Villadsen (Feb 17 2021 at 18:31):

faktisk behøves man ikk engang en implementation guide. Hvis blot man har sine StructureDefs og sidde gemmes på serveren, så er det også nok

view this post on Zulip Jens Villadsen (Feb 17 2021 at 18:32):

Jeg kan godt give en demo næste gang vi tales ved

view this post on Zulip Espen Stranger Seland (Feb 18 2021 at 07:10):

Det virker spennende - kanskje det kunne vært fint med en kort presentasjon på vår FHIR Fagforum? @Thomas Tveit Rosenlund @*Øyvind Aassve

view this post on Zulip Thomas Tveit Rosenlund (Feb 18 2021 at 07:54):

Ser ut som man kan tagge meta med valideringsresultat. Bra! Virker som en veldig nyttig funksjon.

view this post on Zulip Jens Villadsen (Feb 18 2021 at 15:51):

Hvis i kan give mig et link til en af jeres IG'er så laver vi en live demo

view this post on Zulip Thomas Tveit Rosenlund (Feb 19 2021 at 07:11):

Må den ha en IG ressurs, eller kan den ta ting fra SIMPLIFIER?
Vi publiserer foreløpig bare IG'er på SIMPLIFIER med pakker slik som denne:
https://simplifier.net/guide/masterpersonindexr4/servicesforpersoninformation
https://simplifier.net/Grunndata-R4/~packages

view this post on Zulip Jens Villadsen (Feb 19 2021 at 13:33):

@Ward Weistra :point_up:the IG above - would that be listed in a registry / downloadable as a FHIR IG package.tgz file somewhere?

view this post on Zulip Jens Villadsen (Feb 19 2021 at 14:51):

Nevermind ... found it at https://simplifier.net/packages/ehelse.fhir.no.grunndata/2.3.5 under the npm tab

view this post on Zulip Jens Villadsen (Feb 19 2021 at 16:01):

@Thomas Tveit Rosenlund .... looks like there are issues with the IG:

StructureDefinition/no-basis-AllergyIntolerance
    at ca.uhn.fhir.jpa.packages.PackageInstallerSvcImpl.install(PackageInstallerSvcImpl.java:225)
    at ca.uhn.fhir.jpa.packages.PackageInstallerSvcImpl.install(PackageInstallerSvcImpl.java:175)
    at ca.uhn.fhir.jpa.starter.BaseJpaRestfulServer.initialize(BaseJpaRestfulServer.java:360)
    at ca.uhn.fhir.jpa.starter.JpaRestfulServer.initialize(JpaRestfulServer.java:22)
    at ca.uhn.fhir.rest.server.RestfulServer.init(RestfulServer.java:1285)
    at javax.servlet.GenericServlet.init(GenericServlet.java:203)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1134)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:986)
    at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.load(TomcatEmbeddedContext.java:82)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
    at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
    at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
    at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:3177)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
    at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.lambda$deferredLoadOnStartup$0(TomcatEmbeddedContext.java:65)
    at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.doWithThreadContextClassLoader(TomcatEmbeddedContext.java:106)
    at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.deferredLoadOnStartup(TomcatEmbeddedContext.java:64)
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.performDeferredLoadOnStartup(TomcatWebServer.java:305)
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:216)
    at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:43)
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178)
    at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
    at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155)
    at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:940)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:326)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298)
    at ca.uhn.fhir.jpa.starter.Application.main(Application.java:33)
Caused by: ca.uhn.fhir.jpa.packages.ImplementationGuideInstallationException: Failure when generating snapshot of StructureDefinition: StructureDefinition/no-basis-AllergyIntolerance
    at ca.uhn.fhir.jpa.packages.PackageInstallerSvcImpl.generateSnapshot(PackageInstallerSvcImpl.java:413)
    at ca.uhn.fhir.jpa.packages.PackageInstallerSvcImpl.install(PackageInstallerSvcImpl.java:221)
    ... 41 common frames omitted
Caused by: ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to generate snapshot
    at org.hl7.fhir.common.hapi.validation.support.SnapshotGeneratingValidationSupport.generateSnapshot(SnapshotGeneratingValidationSupport.java:134)
    at org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain.generateSnapshot(ValidationSupportChain.java:66)
    at org.hl7.fhir.common.hapi.validation.support.BaseValidationSupportWrapper.generateSnapshot(BaseValidationSupportWrapper.java:94)
    at ca.uhn.fhir.jpa.packages.PackageInstallerSvcImpl.generateSnapshot(PackageInstallerSvcImpl.java:411)
    ... 42 common frames omitted
Caused by: org.hl7.fhir.exceptions.DefinitionException: Attempt to a slice an element that does not repeat: AllergyIntolerance.code/AllergyIntolerance.code from http://hl7.org/fhir/StructureDefinition/CodeableConcept in null, at element AllergyIntolerance.code (slice = ATC, FESTSubstance, FESTMedication)
    at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:1389)
    at org.hl7.fhir.r5.conformance.ProfileUtilities.generateSnapshot(ProfileUtilities.java:639)
    at org.hl7.fhir.common.hapi.validation.support.SnapshotGeneratingValidationSupport.generateSnapshot(SnapshotGeneratingValidationSupport.java:104)
    ... 45 common frames omitted

view this post on Zulip Jens Villadsen (Feb 22 2021 at 09:23):

@Ward Weistra I imagine that error (:point_up:) would also prevent you guys from loading the IG. Does simplifier list any warnings for the profiles once uploaded?

view this post on Zulip Ward Weistra (Feb 22 2021 at 11:48):

Hi @Jens Villadsen,

You can download any package from the UI, after logging in with free account:
image.png

The validation of no-basis-AllergyIntolerance looks clean (at least on the development version of it) in Simplifier.net: https://simplifier.net/hl7norwayno-basis/nobasisallergyintolerance/$validate
It doesn't seem like the Firely .NET SDK snapshot generator has problems with generating a snapshot for that / the validator does not complain about slicing a non-repeating element. I'll check with the team whether they think we should/are working on that.

view this post on Zulip Jens Villadsen (Feb 22 2021 at 12:25):

lol (@Ward Weistra I ended up 'reverse engineering' what the download did fetch using the npm way - I didn't even see the download button :joy: )

view this post on Zulip Jens Villadsen (Feb 22 2021 at 12:26):

But great if you can get the team to confirm whether there's a bug in the java or the .net impl

view this post on Zulip Ward Weistra (Feb 22 2021 at 12:36):

@Jens Villadsen So apparently, it's a long discussion whether slicing on non-repeating elements is allowed. I'll try to summarize what @Ewout Kramer relayed to me before he has time to respond:

view this post on Zulip Ward Weistra (Feb 22 2021 at 12:36):

@Firely Bot issue show FHIR-28619

view this post on Zulip Firely Bot (Feb 22 2021 at 12:36):

FHIR-28619 Allow slicing of a non-repeating element to define a choice
Status: Resolved - No Change, Type: Change Request

view this post on Zulip Ward Weistra (Feb 22 2021 at 12:37):

Recent ticket :point_up:
Conclusion seems to be our Snapshot generator is able to handle it, but for Java stack it would be hard to implement. So perhaps we should remove it again, given the ticket resolution.

view this post on Zulip Ward Weistra (Feb 22 2021 at 12:38):

But @Ewout Kramer also wondered whether the situation in question isn't type slicing, where it still could be allowed.

view this post on Zulip Jens Villadsen (Feb 22 2021 at 12:47):

Oh my ... its 'just' a discussion going back to 2017 ... yikes

view this post on Zulip Ewout Kramer (Feb 23 2021 at 19:34):

Removing something that works well is soooo painful.

view this post on Zulip Ewout Kramer (Feb 23 2021 at 19:35):

This is where we remove it, and add it back using an Option setting in the validator. "Naughty validation mode".

view this post on Zulip Thomas Tveit Rosenlund (Feb 25 2021 at 12:52):

I am aware of this bug in the no-basis profiles. One of the reasons we kept doing this for so long was that the .NET validator did not complain, however the java validator have been complaining for some time, this has not always been the case. Before our first release of these profiles I did validate everything using the java validator, and it was all OK (did not try snapshot generation in the IG publisher however). We have to fix this using one of the methods proposed in that old thread regarding slicing of non-repeating elements.

Turns out we already have an issue to clean this up already, it has been down to time/resource related issues I guess... https://github.com/HL7Norway/basisprofiler-r4/issues/55


Last updated: Apr 12 2022 at 19:14 UTC