Validation requires snapshot? Generate snapshot?

652 views
Skip to first unread message

eve...@gmail.com

unread,
Aug 17, 2018, 2:36:27 PM8/17/18
to HAPI FHIR
I'm using the HAPI REST API to $validate against a profile...
I posted the StructureDefinition to HAPI.
Then I took an instance of an Observation and used $validate to validate it against the profile.
I'm receiving the following error: "StructureDefinition has no snapshot - validation is against the snapshot, so it must be provided"
I know HAPI has logic to generate a snapshot... I figured it did this automatically when I POST'd the StructureDefinition. But, aparently not. Is there a way to ask the rest api to generate a snapshot so that I can PUT the StructureDefinition *with* a snapshot, and not receive this error during validation?

cartha...@gmail.com

unread,
Aug 19, 2018, 9:07:50 AM8/19/18
to HAPI FHIR
You can use a tool like Forge: https://simplifier.net/forge

Open your profile using Forge. Then make sure you tell it to always generate snapshot. There should be a setting under Options. Once that is enabled, save your profile. Then upload your profile back to HAPI.

eve...@gmail.com

unread,
Aug 22, 2018, 12:36:56 AM8/22/18
to HAPI FHIR
I know I can use tooling to generate snapshots... I'm more-so interested if there is a way to get the HAPI REST API to do this for me as part of a create or update.

As a side note... I created a custom operation to do this. But would still like it to be automated as part of create and update.

James Agnew

unread,
Aug 22, 2018, 5:31:30 AM8/22/18
to Sean McIlvenna, HAPI FHIR
This definitely isn't supported today, but it sounds like it would be a useful feature. If you wanted to contribute your custom method or even better add this as an optional function when persisting StructureDefinition resources in the JPA server I'm happy to chat about approaches to get there.

Cheers,
James

On Wed, Aug 22, 2018 at 12:36 AM <eve...@gmail.com> wrote:
I know I can use tooling to generate snapshots... I'm more-so interested if there is a way to get the HAPI REST API to do this for me as part of a create or update.

As a side note... I created a custom operation to do this. But would still like it to be automated as part of create and update.

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/460f7fe2-6a29-435c-b0cd-5bd867b9e178%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

eve...@gmail.com

unread,
Aug 22, 2018, 11:42:08 AM8/22/18
to HAPI FHIR
I have my change in our own fork of hapi-fhir... however, I committed the change to our fork's "master" branch, which also has a bunch of other changes in it.
Do you know how to separate that out so I can do I pull request for just the custom operation?

And, as for contributing my idea... I'm happy to take a stab at it. Can you put me in the right direction of where that persistence logic would be decided for StructureDefinition?

Viviana Sanz

unread,
Aug 29, 2018, 4:42:25 AM8/29/18
to HAPI FHIR
Hi, 

We have the same issue… we don’t want to use the generated snapshot because it could be out of synch, we want to generate it runtime before validation. Can you give me some ideas of how create it in a custom operation ? 

Thank you!
Regards,
Viviana

Patrick Werner

unread,
Aug 29, 2018, 4:49:43 AM8/29/18
to HAPI FHIR
You have to create an operation inside of HAPI which includes modifying the hapi-tinder-plugin. I've created the $document operation for hapi, maybe this helps:

Creation the snapshot before validation is too expensive. Imagine complex profiles which are extending other profiles.
I think this should be implemented as an operation on StructureDefinition. This operation creates the snapshot and has to search for all children of the profile and update their snapshots as well.
Reply all
Reply to author
Forward
0 new messages