Returning a Bundle in an ITI-67 transaction

17 views
Skip to first unread message

Quentin Ligier

unread,
Dec 21, 2020, 8:04:17 AM12/21/20
to ipf-user
Hi,

I'm trying to return a Bundle of DocumentReferences with an OperationOutcome in an ITI-67 transaction (MHD Find Document References). If I return a Bundle, it's inserted into another Bundle. If I return a list of Resources, a Bundle is automatically created but a few things are wrong:
- Bundle.total includes the OperationOutcome (it should not);
- Bundle.entry.search.mode is not set (the OperationOutcome should be marked as outcome) and Bundle.entry.search.score cannot be set.
How could I achieve that?
I'm using IPF 4.0-SNAPSHOT.

Thanks!
Quentin

Christian Ohr

unread,
Dec 21, 2020, 8:30:31 AM12/21/20
to ipf-...@googlegroups.com
Returning a List of resources is correct. Then, use a HAPI server interceptor, like:

@Interceptor
public class BundleModificationInterceptor {

    @Hook(value = Pointcut.SERVER_OUTGOING_RESPONSE)
    public boolean outgoingResponse(RequestDetails requestDetails, IBaseResource response, HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws AuthenticationException {
        if (response instanceof Bundle) {
            Bundle bundle = (Bundle) response;
            // .... check for iti67 response and then do whatever you want here

       return true;
    }
}

Don't forget to register it:

servlet.registerInterceptor(new BundleModificationInterceptor ());

regards
Christian

--
You received this message because you are subscribed to the Google Groups "ipf-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ipf-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ipf-user/06bae646-77aa-4bf0-9a24-b5699cf5ea39n%40googlegroups.com.

Quentin Ligier

unread,
Dec 21, 2020, 2:18:48 PM12/21/20
to ipf-user
Hi Christian,

Thank you for your answer, it's working fine!

Kind regards,
Quentin
Reply all
Reply to author
Forward
0 new messages