/*******************************************************************************
 *  Copyright 2017-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.BreastGYNMammoSNOMEDMap;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_BreastImagingProcedureModifiers;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_BreastProcedureReason;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_BreastProcedureReason;
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 BreastProcedureReason - CID6051
 */
public class BreastProcedureReason_CID6051 
{
	
	/**
	 * 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;
	
	private BreastImagingProcedureModifiers_CID6061 objBreastImagingProcedureModifiers_CID6061;
	/**
	 * Retrieves the value for SNOMED-CT ID.
	 * @return String value for SNOMED-CT ID.
	 */
	public String getSNOMEDCTID() 
	{
		return strSNOMEDCTID;
	}
	/**
	 * Instantiates a new BreastProcedureReason_CID6051 Template 
	 */
	public BreastProcedureReason_CID6051()
	{

	}

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

	/**
	 * Sets the Code Value according to Code Meaning.
	 * @param enumBreastProcedureReason Object of EnumCM_BreastProcedureReason represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_BreastProcedureReason enumBreastProcedureReason)
	{
		switch(enumBreastProcedureReason)
		{
		case ADDITIONAL_EVALUATION_REQUESTED_FROM_PRIOR_STUDY: this.strCodeValue =EnumCV_BreastProcedureReason.ADDITIONAL_EVALUATION_REQUESTED_FROM_PRIOR_STUDY_111415.getValue(); break;
		case FOLLOW_UP_AT_SHORT_INTERVAL_FROM_PRIOR_STUDY: this.strCodeValue =EnumCV_BreastProcedureReason.FOLLOW_UP_AT_SHORT_INTERVAL_FROM_PRIOR_STUDY_111416.getValue(); break;
		case HISTORY_OF_BREAST_AUGMENTATION_ASYMPTOMATIC: this.strCodeValue =EnumCV_BreastProcedureReason.HISTORY_OF_BREAST_AUGMENTATION_ASYMPTOMATIC_111417.getValue(); break;
		case REVIEW_OF_AN_OUTSIDE_STUDY: this.strCodeValue =EnumCV_BreastProcedureReason.REVIEW_OF_AN_OUTSIDE_STUDY_111418.getValue(); break;
		case CLINICAL_FINDING: this.strCodeValue =EnumCV_BreastProcedureReason.CLINICAL_FINDING_111402.getValue(); break;
		case REDUCTION_MAMMOPLASTY: this.strCodeValue =EnumCV_BreastProcedureReason.REDUCTION_MAMMOPLASTY_P1_48830.getValue(); break;
		case RADIATION_THERAPY: this.strCodeValue =EnumCV_BreastProcedureReason.RADIATION_THERAPY_P5_C0000.getValue(); break;
		case AUGMENTATION_MAMMOPLASTY: this.strCodeValue =EnumCV_BreastProcedureReason.AUGMENTATION_MAMMOPLASTY_P1_48840.getValue(); break;
		case ADDITIONAL_EVALUATION_REQUESTED_FROM_ABNORMAL_SCREENING_EXAM: this.strCodeValue =EnumCV_BreastProcedureReason.ADDITIONAL_EVALUATION_REQUESTED_FROM_ABNORMAL_SCREENING_EXAM_111419.getValue(); break;
		case BRACHYTHERAPY: this.strCodeValue =EnumCV_BreastProcedureReason.BRACHYTHERAPY_P5_C0610.getValue(); break;
		case HISTORY_OF_BENIGN_BREAST_BIOPSY: this.strCodeValue =EnumCV_BreastProcedureReason.HISTORY_OF_BENIGN_BREAST_BIOPSY_111420.getValue(); break;
		case PERSONAL_HISTORY_OF_BREAST_CANCER_WITH_BREAST_CONSERVATION_THERAPY: this.strCodeValue =EnumCV_BreastProcedureReason.PERSONAL_HISTORY_OF_BREAST_CANCER_WITH_BREAST_CONSERVATION_THERAPY_111421.getValue(); break;
		case PERSONAL_HISTORY_OF_BREAST_CANCER_WITH_MASTECTOMY: this.strCodeValue =EnumCV_BreastProcedureReason.PERSONAL_HISTORY_OF_BREAST_CANCER_WITH_MASTECTOMY_111124.getValue(); break;
		case KNOWN_BIOPSY_PROVEN_MALIGNANCY: this.strCodeValue =EnumCV_BreastProcedureReason.KNOWN_BIOPSY_PROVEN_MALIGNANCY_111125.getValue(); break;
		case PERSONAL_HISTORY_OF_BREAST_CANCER: this.strCodeValue =EnumCV_BreastProcedureReason.PERSONAL_HISTORY_OF_BREAST_CANCER_G_03D3.getValue(); break;
		case RECALL_FOR_TECHNICAL_REASONS: this.strCodeValue =EnumCV_BreastProcedureReason.RECALL_FOR_TECHNICAL_REASONS_111590.getValue(); break;
		case RECALL_FOR_IMAGING_FINDINGS: this.strCodeValue =EnumCV_BreastProcedureReason.RECALL_FOR_IMAGING_FINDINGS_111591.getValue(); break;
		case RECALL_FOR_PATIENT_SYMPTOMS_CLINICAL_FINDINGS: this.strCodeValue =EnumCV_BreastProcedureReason.RECALL_FOR_PATIENT_SYMPTOMS_CLINICAL_FINDINGS_111592.getValue(); break;}
	}
	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumBreastProcedureReason Object of EnumCM_BreastProcedureReason represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_BreastProcedureReason enumBreastProcedureReason)
	{
		switch(enumBreastProcedureReason)
		{
	case REDUCTION_MAMMOPLASTY : this.strSNOMEDCTID =BreastGYNMammoSNOMEDMap.REDUCTION_MAMMOPLASTY.getSNOMEDCTID(); break;
		case RADIATION_THERAPY : this.strSNOMEDCTID =BreastGYNMammoSNOMEDMap.RADIATION_THERAPY.getSNOMEDCTID(); break;
		case AUGMENTATION_MAMMOPLASTY : this.strSNOMEDCTID =BreastGYNMammoSNOMEDMap.AUGMENTATION_MAMMOPLASTY.getSNOMEDCTID(); break;
		case BRACHYTHERAPY : this.strSNOMEDCTID =BreastGYNMammoSNOMEDMap.BRACHYTHERAPY.getSNOMEDCTID(); break;
		case PERSONAL_HISTORY_OF_BREAST_CANCER : this.strSNOMEDCTID =BreastGYNMammoSNOMEDMap.PERSONAL_HISTORY_OF_BREAST_CANCER.getSNOMEDCTID(); break;
		}
	}

	/**
	 * Sets the value for BreastProcedureReason
	 * @param enumBreastProcedureReason Object of EnumCM_BreastProcedureReason.
	 */
	public void setBreastProcedureReason(Enum enumValue)
	{
		/**
		 * Retrieves the value for CodingSchemeDesignator, CodingSchemeVersion and Code Meaning and 
		 * sets the Code Value according to Code Meaning.
		 */
		
		if(enumValue instanceof EnumCM_BreastProcedureReason)
		{
			 /**
				 * Casting EnumValue to required Enum.
				 */
			EnumCM_BreastProcedureReason enumBreastProcedureReason = (EnumCM_BreastProcedureReason)enumValue;
		this.strCodeMeaning = enumBreastProcedureReason.getValue();
		if(strCodeMeaning.equalsIgnoreCase(EnumCM_BreastProcedureReason.PERSONAL_HISTORY_OF_BREAST_CANCER.getValue())
				|| strCodeMeaning.equalsIgnoreCase(EnumCM_BreastProcedureReason.REDUCTION_MAMMOPLASTY.getValue())
				|| strCodeMeaning.equalsIgnoreCase(EnumCM_BreastProcedureReason.RADIATION_THERAPY.getValue())
				|| strCodeMeaning.equalsIgnoreCase(EnumCM_BreastProcedureReason.AUGMENTATION_MAMMOPLASTY.getValue())
				|| strCodeMeaning.equalsIgnoreCase(EnumCM_BreastProcedureReason.BRACHYTHERAPY.getValue()))
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();
		else
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.DCM.getValue();
			
		/**
		 * set code Value
		 */
		setCodeValue(enumBreastProcedureReason);
		/**
		 * set SNOMED-CT ID
		 */
		setSNOMEDCTID(enumBreastProcedureReason);
		}
		else if ((enumValue instanceof EnumCM_BreastImagingProcedureModifiers))
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_BreastImagingProcedureModifiers new_EnumCM_BreastImagingProcedureModifiers = (EnumCM_BreastImagingProcedureModifiers) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objBreastImagingProcedureModifiers_CID6061)
			this.objBreastImagingProcedureModifiers_CID6061 = new BreastImagingProcedureModifiers_CID6061();
			this.objBreastImagingProcedureModifiers_CID6061.setBreastImagingProcedureModifiers(new_EnumCM_BreastImagingProcedureModifiers);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objBreastImagingProcedureModifiers_CID6061.getCodeMeaning();
			this.strCodeValue = objBreastImagingProcedureModifiers_CID6061.getCodeValue();
			this.strCodingSchemeDesignator = objBreastImagingProcedureModifiers_CID6061.getCodingSchemeDesignator();
			this.strSNOMEDCTID = objBreastImagingProcedureModifiers_CID6061.getSNOMEDCTID();
		}
		else
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger objDicomLogger = DicomLogger.getLogger();
				objDicomLogger.log(ResourceBundleWrapper.getValue("warning","InvalidEnumeratedValue",new Locale(DicomConfig.createInstance().getLocale())));
			}
		}
		}
	}

