use of ca.uhn.fhir.rest.server.IRestfulServerDefaults in project gpconnect-demonstrator by nhsconnect.
the class PatientJwtValidator method getPatientResourceBinding.
private ResourceBinding getPatientResourceBinding(IRestfulServerDefaults defaultServer) {
ResourceBinding resourceBinding = null;
if (defaultServer instanceof RestfulServer) {
RestfulServer restfulServer = (RestfulServer) defaultServer;
// if we get more than one Patient binding then return null
resourceBinding = restfulServer.getResourceBindings().stream().filter(currentResourceBinding -> "Patient".equalsIgnoreCase(currentResourceBinding.getResourceName())).collect(Collectors.reducing((a, b) -> null)).orElse(null);
}
return resourceBinding;
}
Aggregations