/*
 * NIST HL7 Web Service
 * Hl7GazelleMessageValidationInterface.java Oct 30, 2007
 *
 * This code was produced by the National Institute of Standards and
 * Technology (NIST). See the "nist.disclaimer" file given in the distribution
 * for information on the use and redistribution of this software.
 */

package gov.nist.hl7.ws.messagevalidation;

/**
 * Gazelle Implementation
 * @author Robert Snelick (NIST)
 *
 */
public interface Hl7GazelleMessageValidationInterface {

    /**
     * This method is used to validate a message
     * @param objectOID unique identifier for the object being validated
     * @param xmlReferencedStandard The Referenced Standard defines which protocol the xmlMessage
     * or ER7Message represents and the Standard expected to be supported by the EVS.
     * @param xmlValidationContext The Validation Context is used to initialize the EVS or prime it
     * @param xmlMessageMetaData The MessageMetaData is Standard specific meta data about the
     * message being validated.
     * @param xmlMessage The message is the XML/ER7 representation of the message to be validated.
     * This will be Standard specific.
     * @return xmlResultsOverview The following information should be provided by the EVS in
     * the- overview results:
     *                  Validation Object GUID – unique identifier for the object being validated
     *                  Referenced Standard – copied from the Validate Message call
     *                  Validation Service Name – the validation service name (web service name)
     *                  Validation Service Software Version
     *                  Validation Service Status
     *                  Validation Date
     *                  Validation Time
     *                  Validation Test Id – test identifier defined by the validation service
     *                  Validation Test Result – simple validation result indicating PASSED or FAILED status.
     */
    String validateMessage(String objectOID,
            String xmlReferencedStandard,
            String xmlValidationContext,
            String xmlMessageMetaData,
            String xmlMessage);

    /**
     * This method is used to return the Summary validation results.
     * @param objectGuid unique identifier for the object being validated
     * @return xmlSummaryResults provides a list of all the Error, Warning and
     * Condition Message Level issues encountered by the EVS when
     *  validating the message.
     */
    String getSummaryResults(String objectOID);

    /**
     * This method is used to return the Detailed validation results.
     * @param objectGuid unique identifier for the object being validated
     * @return xmlDetailedResults  It is expected that the detailed results will provide a full validation result,
     *      meaning that parts of the message to be validated,
     *      that pass the validation algorithm will be included in the results stream
     *      as well as those which fail the validation algorithm.
     *      The detailed results consist of the following sections:
     *          Validation results overview
     *          Detailed validation results for the validated message
     *          Validation counters.
     *  The EVS implementation can/will provide an XLT stylesheet
     *  to allow display of the XML detailed results returned.
     */
    String getDetailedResults(String objectOID);

    /**
     * The web service will cache the Summary and Detailed results.
     * This method is used to clear the web service results cache.
     * Any calls to the GetSummaryResults( ) and GetDetailedResults( ) methods
     * made immediately after this call would return an empty string.
     */
    void clearResultsCache();

    /**
     * This method is used to return the status of the external validation web service.
     * @return xmlValidationServiceStatus
     */
    String getValidationServiceStatus();
}
