Search in sources :

Example 1 with IBaseResource

use of org.hl7.fhir.instance.model.api.IBaseResource in project gpconnect-demonstrator by nhsconnect.

the class PostProcessor method outgoingResponse.

@Override
public boolean outgoingResponse(RequestDetails theRequestDetails, IBaseResource theResponseDetails, javax.servlet.http.HttpServletRequest theServletRequest, javax.servlet.http.HttpServletResponse theServletResponse) throws AuthenticationException {
    if (theResponseDetails instanceof Bundle) {
        Bundle bundle = (Bundle) theResponseDetails;
        // #299 remove total and link from searchset result bundles
        if (bundle.getType() == SEARCHSET) {
            bundle.setTotalElement(null);
            bundle.setLink(null);
        }
        for (Bundle.BundleEntryComponent entry : bundle.getEntry()) {
            if (entry.hasFullUrl()) {
                // #215 don't populate Bundle.entry.fullurl
                entry.setFullUrl("");
            }
        }
    }
    return true;
}
Also used : Bundle(org.hl7.fhir.dstu3.model.Bundle)

Aggregations

Bundle (org.hl7.fhir.dstu3.model.Bundle)1