protected MCCIIN000002UV01 addPatientDiscoveryAsyncReq(
      RespondingGatewayPRPAIN201305UV02RequestType request) {
    MCCIIN000002UV01 ack = new MCCIIN000002UV01();

    // "process" the request and send a response out to the Nhin.
    PatientDiscovery201305Processor msgProcessor = new PatientDiscovery201305Processor();
    PRPAIN201306UV02 resp =
        msgProcessor.process201305(request.getPRPAIN201305UV02(), request.getAssertion());

    // Generate a new response assertion
    AsyncMessageProcessHelper asyncProcess = createAsyncProcesser();
    AssertionType newAssertion = asyncProcess.copyAssertionTypeObject(request.getAssertion());
    // Original request message id is now set as the relates to id
    newAssertion.getRelatesToList().add(request.getAssertion().getMessageId());
    // Generate a new unique response assertion Message ID
    newAssertion.setMessageId(AsyncMessageIdCreator.generateMessageId());
    // Set user info homeCommunity
    String homeCommunityId = HomeCommunityMap.getLocalHomeCommunityId();
    HomeCommunityType homeCommunityType = new HomeCommunityType();
    homeCommunityType.setHomeCommunityId(homeCommunityId);
    homeCommunityType.setName(homeCommunityId);
    newAssertion.setHomeCommunity(homeCommunityType);
    if (newAssertion.getUserInfo() != null && newAssertion.getUserInfo().getOrg() != null) {
      newAssertion.getUserInfo().getOrg().setHomeCommunityId(homeCommunityId);
      newAssertion.getUserInfo().getOrg().setName(homeCommunityId);
    }

    ack = sendToNhin(resp, newAssertion, request.getNhinTargetCommunities());

    return ack;
  }
  public DocQueryAcknowledgementType crossGatewayQueryRequest(
      RespondingGatewayCrossGatewayQuerySecuredRequestType crossGatewayQueryRequest,
      WebServiceContext context) {
    getLogger()
        .debug("Beginning of PassthruDocQueryDeferredRequestSecured.crossGatewayQueryRequest()");

    AssertionType assertion = extractAssertion(context);

    // Extract the message id value from the WS-Addressing Header and place it in the Assertion
    // Class
    if (assertion != null) {
      assertion.setMessageId(getAsyncMessageIdExtractor().GetAsyncMessageId(context));
    }

    // Fwd request to orchestrator
    DocQueryAcknowledgementType ackResponse =
        getPassthruDocQueryDeferredRequestOrchImpl()
            .crossGatewayQueryRequest(
                crossGatewayQueryRequest.getAdhocQueryRequest(),
                assertion,
                crossGatewayQueryRequest.getNhinTargetSystem());

    getLogger().debug("End of PassthruDocQueryDeferredRequestSecured.crossGatewayQueryRequest()");

    return ackResponse;
  }