/**
 * 
 */


package gov.va.med.mediator.webservice;


import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;


/**
 * @author DNS   egberb
 *
 */
public class RestMediatorServiceProcessMessageProxy
    extends
        AbstractRestPathwaysServiceProxy
{
    /*
     * (non-Javadoc)
     * 
     * @see
     * gov.va.med.cds.client.ClinicalDataServiceSynchronousInterface#isAlive()
     */
    @GET
    @Path( "" )
    @Produces( "application/xml" )
    public String readData( @QueryParam( "hl7MessageRequest" ) String hl7MessageRequest, 
                            @DefaultValue("false") @QueryParam( "persistOriginalMessage" ) boolean persistOriginalMessage )
    {
        try
        {
            return this.mediatorService.processMessage( hl7MessageRequest, persistOriginalMessage );
        }
        catch ( Exception e )
        {
            throw new WebApplicationException( e );
        }
    }
}
