public org.hl7.v3.PRPAIN201306UV02 proxyPRPAIN201305UV( org.hl7.v3.PRPAIN201305UV02 body, WebServiceContext context) { PRPAIN201306UV02 response = null; ProxyPRPAIN201305UVProxyRequestType request = new ProxyPRPAIN201305UVProxyRequestType(); request.setPRPAIN201305UV02(body); request.setAssertion(SamlTokenExtractor.GetAssertion(context)); String homeCommunityId = null; if (body != null && NullChecker.isNotNullish(body.getReceiver()) && body.getReceiver().get(0) != null && body.getReceiver().get(0).getDevice() != null && body.getReceiver().get(0).getDevice().getAsAgent() != null && body.getReceiver().get(0).getDevice().getAsAgent().getValue() != null && body.getReceiver() .get(0) .getDevice() .getAsAgent() .getValue() .getRepresentedOrganization() != null && body.getReceiver() .get(0) .getDevice() .getAsAgent() .getValue() .getRepresentedOrganization() .getValue() != null && NullChecker.isNotNullish( body.getReceiver() .get(0) .getDevice() .getAsAgent() .getValue() .getRepresentedOrganization() .getValue() .getId()) && body.getReceiver() .get(0) .getDevice() .getAsAgent() .getValue() .getRepresentedOrganization() .getValue() .getId() .get(0) != null && NullChecker.isNotNullish( body.getReceiver() .get(0) .getDevice() .getAsAgent() .getValue() .getRepresentedOrganization() .getValue() .getId() .get(0) .getRoot())) { homeCommunityId = body.getReceiver() .get(0) .getDevice() .getAsAgent() .getValue() .getRepresentedOrganization() .getValue() .getId() .get(0) .getRoot(); } else { homeCommunityId = SamlTokenExtractorHelper.getHomeCommunityId(); } if (NullChecker.isNotNullish(homeCommunityId)) { NhincProxyPatientDiscovery service = new NhincProxyPatientDiscovery(); NhincProxyPatientDiscoveryPortType port = service.getNhincProxyPatientDiscoveryPort(); ((javax.xml.ws.BindingProvider) port) .getRequestContext() .put( javax.xml.ws.BindingProvider.ENDPOINT_ADDRESS_PROPERTY, SamlTokenExtractorHelper.getEndpointURL(homeCommunityId, SERVICE_NAME)); response = port.proxyPRPAIN201305UV(request); } else { response = null; } return response; }
public PRPAIN201306UV02 PRPAIN201305UV( PRPAIN201305UV02 body, AssertionType assertion, NhinTargetSystemType target) { String url = null; PRPAIN201306UV02 response = new PRPAIN201306UV02(); ProxyPRPAIN201305UVProxyRequestType proxyRequest = new ProxyPRPAIN201305UVProxyRequestType(); try { if (body != null) { proxyRequest.setPRPAIN201305UV02(body); proxyRequest.setAssertion(assertion); proxyRequest.setNhinTargetSystem(target); log.debug("Before target system URL look up."); url = oProxyHelper.getUrlLocalHomeCommunity( NhincConstants.NHINC_PASSTHRU_PATIENT_DISCOVERY_SERVICE_NAME); log.debug( "After target system URL look up. URL for service: " + NhincConstants.NHINC_PASSTHRU_PATIENT_DISCOVERY_SERVICE_NAME + " is: " + url); if (NullChecker.isNotNullish(url)) { NhincProxyPatientDiscoveryPortType port = getPort( url, NhincConstants.PATIENT_DISCOVERY_ACTION, WS_ADDRESSING_ACTION, assertion); response = (PRPAIN201306UV02) oProxyHelper.invokePort( port, NhincProxyPatientDiscoveryPortType.class, "proxyPRPAIN201305UV", proxyRequest); } else { log.error( "Failed to call the web service (" + NhincConstants.NHINC_PASSTHRU_PATIENT_DISCOVERY_SERVICE_NAME + "). The URL is null."); } } else { log.error( "Failed to call the web service (" + NhincConstants.NHINC_PASSTHRU_PATIENT_DISCOVERY_SERVICE_NAME + "). The input parameter is null."); } } catch (Exception e) { log.error( "Failed to call the web service (" + NhincConstants.NHINC_PASSTHRU_PATIENT_DISCOVERY_SERVICE_NAME + "). An unexpected exception occurred. " + "Exception: " + e.getMessage(), e); response = new HL7PRPA201306Transforms() .createPRPA201306ForErrors( proxyRequest.getPRPAIN201305UV02(), NhincConstants.PATIENT_DISCOVERY_ANSWER_NOT_AVAIL_ERR_CODE); } return response; }