/*******************************************************************************
 *  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.dicomsnomedmap.EnumAnimalBreedSNOMEDMap;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Breed;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CatAndDogBreed;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CattleAndCowBreed;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_PigBreed;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_HorseBreed;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_SheepAndGoatBreed;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Breed;
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 Breed CID7480
 */
public class Breed_CID7480 {

	/**
	 * 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;

	/**
	 * Object of CathComplications_CID3755
	 */
	private CatAndDogBreed_CID7480 objCatAndDogBreedCID7480 ;

	/**
	 * Object of CattleAndCowBreed_CID7480
	 */
	private CattleAndCowBreed_CID7480 objCattleAndCowBreedCID7480 ;

	/**
	 * Object of PigBreed_CID7480
	 */
	private PigBreed_CID7480 objPigBreedCID7480;

	/**
	 * Object of HorseBreed_CID7480
	 */
	private HorseBreed_CID7480 objHorseBreedCID7480;

	/**
	 * Object of SheepAndGoatBreed_CID7480
	 */
	private SheepAndGoatBreed_CID7480 objSheepAndGoatBreedCID7480 ;
	/**
	 * Instantiates a new Breed_CID7480 Template 
	 */
	public Breed_CID7480()
	{

	}

	/**
	 * 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 getValue() 
	{
		return strSNOMEDCTID;
	}
	/**
	 * Sets the Code Value according to Code Meaning.
	 * @param enumBreed Object of EnumCM_Breed represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_Breed enumBreed)
	{

		switch(enumBreed) 
		{
		case CATALANA_CHICKEN_BREED : this.strCodeValue =EnumCV_Breed.CATALANA_CHICKEN_BREED_L_80504.getValue(); break;
		case CESTRUM_PARQUI : this.strCodeValue =EnumCV_Breed.CESTRUM_PARQUI_L_D9814.getValue(); break;
		case BLANC_DE_BOUSCAT_RABBIT_BREED : this.strCodeValue =EnumCV_Breed.BLANC_DE_BOUSCAT_RABBIT_BREED_L_86B36.getValue(); break;
		}
	}

	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumBreed Object of EnumCM_Breed represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_Breed enumBreed)
	{
		switch(enumBreed)
		{
		case CATALANA_CHICKEN_BREED : this.strSNOMEDCTID =EnumAnimalBreedSNOMEDMap.CATALANA_CHICKEN_BREED.getSNOMEDCTID(); break;
		case CESTRUM_PARQUI : this.strSNOMEDCTID =EnumAnimalBreedSNOMEDMap.CESTRUM_PARQUI.getSNOMEDCTID(); break;
		case BLANC_DE_BOUSCAT_RABBIT_BREED : this.strSNOMEDCTID =EnumAnimalBreedSNOMEDMap.BLANC_DE_BOUSCAT_RABBIT_BREED.getSNOMEDCTID(); break;
		}
	}

	/**
	 * Sets the value for Breed
	 * @param enumBreed Object of EnumCM_Breed.
	 */
	public void setBreed(Enum enumValue)
	{
		if (enumValue instanceof EnumCM_Breed) 
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_Breed new_enumBreed = (EnumCM_Breed)enumValue;
			/**
			 * Retrieves the value for CodingSchemeDesignator, CodingSchemeVersion and Code Meaning and 
			 * sets the Code Value according to Code Meaning.
			 */
			this.strCodeMeaning = new_enumBreed.getValue();
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();

			/**
			 * set code Value
			 */
			setCodeValue(new_enumBreed);

			/**
			 * set SNOMED-CT ID
			 */
			setSNOMEDCTID(new_enumBreed);
		}
		else if(enumValue instanceof EnumCM_CatAndDogBreed)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_CatAndDogBreed new_enumCatAndDogBreed = (EnumCM_CatAndDogBreed) enumValue;

			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objCatAndDogBreedCID7480)
				this.objCatAndDogBreedCID7480 = new CatAndDogBreed_CID7480();
			this.objCatAndDogBreedCID7480.setCatAndDogBreed(new_enumCatAndDogBreed);

			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objCatAndDogBreedCID7480.getCodeMeaning();
			this.strCodeValue = objCatAndDogBreedCID7480.getCodeValue();
			this.strCodingSchemeDesignator = objCatAndDogBreedCID7480.getCodingSchemeDesignator();
			/**
			 * set SNOMED-CT ID
			 */
			this.strSNOMEDCTID = objCatAndDogBreedCID7480.getSNOMEDCTID();
		}
		else if(enumValue instanceof EnumCM_CattleAndCowBreed)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_CattleAndCowBreed new_enumCattleAndCowBreed = (EnumCM_CattleAndCowBreed) enumValue;

			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objCattleAndCowBreedCID7480)
				this.objCattleAndCowBreedCID7480 = new CattleAndCowBreed_CID7480();
			this.objCattleAndCowBreedCID7480.setCattleAndCowBreed(new_enumCattleAndCowBreed);

			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objCattleAndCowBreedCID7480.getCodeMeaning();
			this.strCodeValue = objCattleAndCowBreedCID7480.getCodeValue();
			this.strCodingSchemeDesignator = objCattleAndCowBreedCID7480.getCodingSchemeDesignator();
			/**
			 * set SNOMED-CT ID
			 */
			this.strSNOMEDCTID = objCattleAndCowBreedCID7480.getSNOMEDCTID();
		}
		else if(enumValue instanceof EnumCM_HorseBreed)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_HorseBreed new_enumHorseBreed = (EnumCM_HorseBreed) enumValue;

			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objHorseBreedCID7480)
				this.objHorseBreedCID7480 = new HorseBreed_CID7480();
			this.objHorseBreedCID7480.setHorseBreed(new_enumHorseBreed);

			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objHorseBreedCID7480.getCodeMeaning();
			this.strCodeValue = objHorseBreedCID7480.getCodeValue();
			this.strCodingSchemeDesignator = objHorseBreedCID7480.getCodingSchemeDesignator();
			/**
			 * set SNOMED-CT ID
			 */
			this.strSNOMEDCTID = objHorseBreedCID7480.getSNOMEDCTID();
		}
		else if(enumValue instanceof EnumCM_SheepAndGoatBreed)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_SheepAndGoatBreed new_enumSheepAndGoatBreed = (EnumCM_SheepAndGoatBreed) enumValue;

			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objSheepAndGoatBreedCID7480)
				this.objSheepAndGoatBreedCID7480 = new SheepAndGoatBreed_CID7480();
			this.objSheepAndGoatBreedCID7480.setSheepAndGoatBreed(new_enumSheepAndGoatBreed);

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