/*******************************************************************************
 *  Copyright 2018 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package cdac.medinfo.sdk.dcm30_04.templates.cid;


import java.util.Locale;

import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_OphthalmicMacularGridProblem;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_VisualFixationQualityProblem;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_OphthalmicMacularGridProblem;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_OphthalmicMacularGridProblem;
import cdac.medinfo.sdk.dcm30_04.templates.dicomsnomedmap.EnumDICOMSNOMEDMap;
import cdac.medinfo.sdk.dcm30_04.templates.dicomsnomedmap.EnumOpthalmicSNOMEDMap;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConfig;
import cdac.medinfo.sdk.dcm30_04.utils.DicomLogger;
import cdac.medinfo.sdk.dcm30_04.utils.ResourceBundleWrapper;


/**
 * This class represents OphthalmicMacularGridProblem CID4222
 */
public class OphthalmicMacularGridProblem_CID4222 {

	/**
	 * The Code Value for template.
	 */
	private String strCodeValue = null;

	/**
	 * The Code Meaning for template.
	 */
	private String strCodeMeaning = null;

	/**
	 * The Coding Scheme Designator for template.
	 */
	private String strCodingSchemeDesignator;

	/**
	 * The SNOMED CT ID for template.
	 */
	private String strSNOMEDCTID = null;
	/**
	 * Instantiates a new OphthalmicMacularGridProblem_CID4222 Template 
	 */
	
	/**
	 * Object of VisualFixationQualityProblem_CID4221
	 */
	private VisualFixationQualityProblem_CID4221 objVisualFixationQualityProblemCID4221;

	
	public OphthalmicMacularGridProblem_CID4222()
	{

	}

	/**
	 * Retrieves the value for Code Meaning.
	 * @return String value for Code Meaning.
	 */
	public String getCodeMeaning()
	{
		return strCodeMeaning;
	}

	/**
	 * Retrieves the value for Code Value.
	 * @return String value for Code Value.
	 */
	public String getCodeValue() 
	{
		return strCodeValue;
	}

	/**
	 * Retrieves the value for Coding Scheme Designator.
	 * @return String value for Coding Scheme Designator.
	 */
	public String getCodingSchemeDesignator() 
	{
		return strCodingSchemeDesignator;
	}
	
	/**
	 * Retrieves the value for SNOMED-CT ID.
	 * @return String value for SNOMED-CT ID.
	 */
	public String getSNOMEDCTID() 
	{
		return strSNOMEDCTID;
	}
	/**
	 * Sets the Code Value according to Code Meaning.
	 * @param enumOphthalmicMacularGridProblem Object of EnumCM_OphthalmicMacularGridProblem represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_OphthalmicMacularGridProblem enumOphthalmicMacularGridProblem)
	{
		switch(enumOphthalmicMacularGridProblem) 
		{
		case CONSTRICTED_PUPIL: this.strCodeValue =EnumCV_OphthalmicMacularGridProblem.CONSTRICTED_PUPIL_F_0123A.getValue(); break;
		case LENS_OPACITY: this.strCodeValue =EnumCV_OphthalmicMacularGridProblem.LENS_OPACITY_DA_73402.getValue(); break;
		case CORNEAL_OPACITY: this.strCodeValue =EnumCV_OphthalmicMacularGridProblem.CORNEAL_OPACITY_DA_75300.getValue(); break;
		case VITREOUS_OPACITY: this.strCodeValue =EnumCV_OphthalmicMacularGridProblem.VITREOUS_OPACITY_DA_7931D.getValue(); break;
		case POOR_VISUAL_FIXATION: this.strCodeValue =EnumCV_OphthalmicMacularGridProblem.POOR_VISUAL_FIXATION_R_20839.getValue(); break;
		case EYELID_DISEASE: this.strCodeValue =EnumCV_OphthalmicMacularGridProblem.EYELID_DISEASE_DA_76000.getValue(); break;
		case INTERFERING_TEARS_OR_DROPS: this.strCodeValue =EnumCV_OphthalmicMacularGridProblem.INTERFERING_TEARS_OR_DROPS_111695.getValue(); break;
		case REFRACTIVE_ERROR: this.strCodeValue =EnumCV_OphthalmicMacularGridProblem.REFRACTIVE_ERROR_DA_74100.getValue(); break;
		case PATIENT_POSITIONING_PROBLEM: this.strCodeValue =EnumCV_OphthalmicMacularGridProblem.PATIENT_POSITIONING_PROBLEM_111209.getValue(); break;
		case DRY_EYES_PROBLEM: this.strCodeValue =EnumCV_OphthalmicMacularGridProblem.DRY_EYES_PROBLEM_F_F1722.getValue(); break;
		}
	}

	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumOphthalmicMacularGridProblem Object of EnumCM_OphthalmicMacularGridProblem represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_OphthalmicMacularGridProblem enumOphthalmicMacularGridProblem)
	{
		switch(enumOphthalmicMacularGridProblem)
		{
		case CONSTRICTED_PUPIL : this.strSNOMEDCTID =EnumOpthalmicSNOMEDMap.CONSTRICTED_PUPIL.getSNOMEDCTID(); break;
		case LENS_OPACITY : this.strSNOMEDCTID =EnumOpthalmicSNOMEDMap.LENS_OPACITY.getSNOMEDCTID(); break;
		case CORNEAL_OPACITY : this.strSNOMEDCTID =EnumOpthalmicSNOMEDMap.CORNEAL_OPACITY.getSNOMEDCTID(); break;
		case VITREOUS_OPACITY : this.strSNOMEDCTID =EnumOpthalmicSNOMEDMap.VITREOUS_OPACITY.getSNOMEDCTID(); break;
		case POOR_VISUAL_FIXATION : this.strSNOMEDCTID =EnumOpthalmicSNOMEDMap.POOR_VISUAL_FIXATION.getSNOMEDCTID(); break;
		case EYELID_DISEASE : this.strSNOMEDCTID =EnumOpthalmicSNOMEDMap.EYELID_DISEASE.getSNOMEDCTID(); break;
		case REFRACTIVE_ERROR : this.strSNOMEDCTID =EnumOpthalmicSNOMEDMap.REFRACTIVE_ERROR.getSNOMEDCTID(); break;
		case DRY_EYES_PROBLEM : this.strSNOMEDCTID =EnumOpthalmicSNOMEDMap.DRY_EYES_PROBLEM.getSNOMEDCTID(); break;
		}
	}

	/**
	 * Sets the value for OphthalmicMacularGridProblem
	 * @param enumOphthalmicMacularGridProblem Object of EnumCM_OphthalmicMacularGridProblem.
	 */
	public void setOphthalmicMacularGridProblem(Enum enumValue)
	{
		
		
		if (enumValue instanceof EnumCM_OphthalmicMacularGridProblem) 
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_OphthalmicMacularGridProblem new_enumOphthalmicMacularGridProblem = (EnumCM_OphthalmicMacularGridProblem)enumValue;
			/**
			 * Retrieves the value for CodingSchemeDesignator, CodingSchemeVersion and Code Meaning and 
			 * sets the Code Value according to Code Meaning.
			 */
			this.strCodeMeaning = new_enumOphthalmicMacularGridProblem.getValue();
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();
			
			/**
			 * set code Value
			 */
			setCodeValue(new_enumOphthalmicMacularGridProblem);

			/**
			 * set SNOMED-CT ID
			 */
			setSNOMEDCTID(new_enumOphthalmicMacularGridProblem);
			
		}
		else if(enumValue instanceof EnumCM_VisualFixationQualityProblem)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_VisualFixationQualityProblem new_enumVisualFixationQualityProblem = (EnumCM_VisualFixationQualityProblem) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objVisualFixationQualityProblemCID4221)
	this.objVisualFixationQualityProblemCID4221 = new VisualFixationQualityProblem_CID4221();
			this.objVisualFixationQualityProblemCID4221.setVisualFixationQualityProblem(new_enumVisualFixationQualityProblem);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objVisualFixationQualityProblemCID4221.getCodeMeaning();
			this.strCodeValue = objVisualFixationQualityProblemCID4221.getCodeValue();
			this.strCodingSchemeDesignator = objVisualFixationQualityProblemCID4221.getCodingSchemeDesignator();
			
			/**
			 * set SNOMED-CT ID
			 */
			this.strSNOMEDCTID = objVisualFixationQualityProblemCID4221.getSNOMEDCTID();
		}
		else
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger objDicomLogger = DicomLogger.getLogger();
				objDicomLogger.log(ResourceBundleWrapper.getValue("warning","InvalidEnumeratedValue",new Locale(DicomConfig.createInstance().getLocale())));
			}
		}
	}
}
