/**
   * Reports error to ATNA server.
   *
   * <p>TODO: make this work with the right universal id - derive from the configuration.
   *
   * @param username
   * @param eventOutcome
   * @throws IOException
   */
  private void atnaStatus(String username, int eventOutcome) throws IOException {
    // int eventOutcome = AtnaConstants.OUTCOME_SUCCESS;
    ResponseType response = null;
    String initiatingUserNodeIP = "DemoIdP";
    String authenticatingNodeIP = "10.242.0.70";
    PatientRecordResultManager pdqResults = getPatientRecordResultManager();
    RhioConfig[] rhios = pdqResults.getFilteredRhios();
    OhfBridgeSoapBindingStub binding = pdqResults.getOhfBindingStub();
    // String dataRecipientId = "doctor";
    // String exportedDataId = "urn:abcdefg";
    // String patientId = "95a1633c27e94eb";
    SessionContext sessionContext = createSessionContext(rhios[0], username);
    OHFBridgeStub.AssigningAuthorityType assigningAuthorityType =
        new OHFBridgeStub.AssigningAuthorityType();
    assigningAuthorityType.setUniversalId("1.3.6.1.4.1.21367.2005.1.1");
    assigningAuthorityType.setUniversalIdType("ISO");

    response =
        binding.auditUserAuthenticationLoginEvent(
            sessionContext, eventOutcome, username, initiatingUserNodeIP, authenticatingNodeIP);

    if (response.isSuccess()) logger.info("ATNA audit success  for LoginEvent");
    else {
      logger.info("ATNA Failed for LoginEvent");
      logger.info(response.getFailMessage());
    }
  }
  public void executeTest() throws Exception {

    setTestname("SN 11103");

    OhfBridgeSoapBindingStub binding = null;
    binding = createBinding();

    RhioConfig[] fRhios = pdqResults.getFilteredRhios();

    /*
    OHFBridgeStub.AssigningAuthorityType assigningAuthorityType = new OHFBridgeStub.AssigningAuthorityType();
    assigningAuthorityType.setUniversalId("1.3.6.1.4.1.21367.2005.1.1");
    assigningAuthorityType.setUniversalIdType("ISO");

    OHFBridgeStub.AssigningAuthorityType[] authorityTypes = new  OHFBridgeStub.AssigningAuthorityType[1];
    authorityTypes[0] = assigningAuthorityType;
    */

    ResponseType response = null;
    for (int i = 0; i < fRhios.length; i++) {
      try {
        logger.info("Attempting to context RHIO " + fRhios[i].getName());
        mesaResults.setRhioConfig(fRhios[i]);
        SessionContext sessionContext = createSessionContext(fRhios[i]);
        logger.info(sessionContextToString(sessionContext));
        int eventOutcome = OUTCOME_SUCCESS;
        String dataRecipientId = "dataRecipientId";
        String exportedDataId = "urn:abcdefg";
        String patientId = "95a1633c27e94eb";
        OHFBridgeStub.AssigningAuthorityType assigningAuthorityType =
            new OHFBridgeStub.AssigningAuthorityType();
        assigningAuthorityType.setUniversalId("1.3.6.1.4.1.21367.2005.1.1");
        assigningAuthorityType.setUniversalIdType("ISO");

        PatientIdType idType = new PatientIdType();
        idType.setIdNumber(patientId);
        idType.setAssigningAuthorityType(assigningAuthorityType);
        response =
            binding.auditPhiExport(
                sessionContext, eventOutcome, dataRecipientId, exportedDataId, idType);
        // response= binding.auditActorStartEvent(sessionContext, eventOutcome, dataRecipientId);
        String message = null;
        String[] bridgeLog = binding.getMyLog(sessionContext, 0);
        String log = saveLog(bridgeLog, getLogFile());

        logger.info(log);
        if (response.isSuccess()) {

          message = response.getSuccessMessage();
          logger.info("Success:" + message);
        } else {
          message = response.getFailMessage();
          logger.error("Failure:" + message);
          // throw new RuntimeException("Bridge returned failure:" + message);
        }

      } catch (Exception e) {
        e.printStackTrace(System.out);
      }
    }
  }