/**
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations under
* the License.
*
* The Original Code is OpenELIS code.
*
* Copyright (C) The Minnesota Department of Health. All Rights Reserved.
*
* Contributor(s): CIRG, University of Washington, Seattle WA.
*/
package us.mn.state.health.lims.sample.util.CI;
import us.mn.state.health.lims.common.action.BaseActionForm;
import us.mn.state.health.lims.common.exception.LIMSRuntimeException;
import us.mn.state.health.lims.sample.util.CI.*;
public class ProjectFormMapperFactory {
private static final String InitialARV = "InitialARV_Id";
private static final String FollowUpARV = "FollowUpARV_Id";
private static final String EID = "EID_Id";
private static final String VL = "VL_Id";
private static final String RTN = "RTN_Id";
private static final String IND = "Indeterminate_Id";
private static final String SPE = "Special_Request_Id";
public IProjectFormMapper getProjectInitializer(String projectFormId, BaseActionForm dynaForm) throws LIMSRuntimeException {
if (projectFormId.equals(InitialARV) || projectFormId.equals(FollowUpARV) || projectFormId.equals(VL)){
return new ARVFormMapper(projectFormId, dynaForm);
}
else if (projectFormId.equals(EID)){
return new EIDFormMapper(projectFormId, dynaForm);
}
else if (projectFormId.equals(VL)){
return new ARVFormMapper(projectFormId, dynaForm);
}
else if (projectFormId.equals(RTN)){
return new RTNFormMapper(projectFormId, dynaForm);
}
else if (projectFormId.equals(IND)){
return new INDFormMapper(projectFormId, dynaForm);
}
else if (projectFormId.equals(SPE)){
return new SPEFormMapper(projectFormId, dynaForm);
}
throw new LIMSRuntimeException("ProjectFormMapperFactory: Unable to find project initializer for " + projectFormId);
}
}