package gov.va.med.tfs.mapping.tfstocds;

import gov.va.med.tfs.client.webservice.DomainEntryPoint;
import gov.va.med.tfs.client.webservice.EntryFilter;
import gov.va.med.tfs.exception.WtfServiceCreateException;
import gov.va.med.tfs.mapping.MapperInterface;

public class EntryFilterMapper 
	implements
	MapperInterface<EntryFilter, gov.va.med.cds.clinicaldata.EntryFilter>
{
    private static EntryFilterMapper entryFilterMapper = new EntryFilterMapper();
	
    private EntryFilterMapper( )
    {
    }

    public static EntryFilterMapper getInstance( )
    {
        return entryFilterMapper;
    }

	@Override
	public gov.va.med.cds.clinicaldata.EntryFilter map(
			EntryFilter fromEntryFilter) throws Exception 
	{
		gov.va.med.cds.clinicaldata.EntryFilter toEntryFilter = new gov.va.med.cds.clinicaldata.EntryFilter();
  
		DomainEntryPoint fromDomainEntryPoint = fromEntryFilter.getDomainEntryPoint();
        if ( fromDomainEntryPoint != null )
        {
        	toEntryFilter.setDomainEntryPoint( DomainEntryPointMapper.getInstance().map( fromDomainEntryPoint ) );
        }
		
        String fromXpath = fromEntryFilter.getXpath();
        if ( fromXpath != null )
        {
        	toEntryFilter.setXpath( fromXpath );
        }
		
	
		return toEntryFilter;
	}
	
	
}
