How to customize a specific operation for Resource in JPA server

37 views
Skip to first unread message

三浦笑峰

unread,
May 6, 2021, 1:47:46 AM5/6/21
to HAPI FHIR
I want to set a unique identifier to Patient Resource when I create it.
Therefore, I want to customize Create operation for Patient Resource to add identifier.

This identifier is calculated based on Encounter Resources referencing to the Patient Resource, so I want to assign the identifier in server, not in client.

How can I do this?

PS.
Adding Resource Provider is not a good solution because I have to define operations for other resources. (https://hapifhir.io/hapi-fhir/docs/server_plain/resource_providers.html)
What I want to do is only modifying Create Operation for Patient Resource, and leave other operations in any other Resource as they originally are.

Thank you

James Agnew

unread,
May 6, 2021, 7:33:01 AM5/6/21
to 三浦笑峰, HAPI FHIR
Probably the easiest way to do this would be with an interceptor implementing the STORAGE_PRECOMMIT_RESOURCE_UPDATED pointcut.

Cheers,
James

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/445e11e5-bac4-4138-b109-f188a6590aa4n%40googlegroups.com.

三浦笑峰

unread,
May 7, 2021, 12:09:14 AM5/7/21
to HAPI FHIR
Thank you! It seems appropriate for my purpose.
Reply all
Reply to author
Forward
0 new messages