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

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Locale;

import cdac.medinfo.sdk.dcm30_04.commoninterface.IDataSet;
import cdac.medinfo.sdk.dcm30_04.enums.EnumIODQualifiednames;
import cdac.medinfo.sdk.dcm30_04.enums.EnumSOPClassUIDs;
import cdac.medinfo.sdk.dcm30_04.exceptions.IODNotFoundException;
import cdac.medinfo.sdk.dcm30_04.exceptions.IODNotSupportedException;
import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidIODException;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConfig;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConstants;
import cdac.medinfo.sdk.dcm30_04.utils.DicomLogger;
import cdac.medinfo.sdk.dcm30_04.utils.ResourceBundleWrapper;
import cdac.medinfo.sdk.dcm30_04.utils.StandardMethods;

/**
 * This class provides the entry point for the DataSet to be validated.
 * The IODValidator is not suppose to be exposed to the user. Only classes
 * within the DicomModel package can access it. 
 */
public class IODValidator 
{

	private static String fValidate = "validate";

	//this method invoke validate method of the IOD.
	@SuppressWarnings("unchecked")
	private void invokeMethod(String classpath, IDataSet objIDataSet) throws InvalidIODException,InstantiationException,
	NoSuchMethodException,IllegalAccessException,ClassNotFoundException,InvocationTargetException
	{
		Class c = Class.forName(classpath);
		Constructor ctor = c.getConstructor(Class.forName(DicomConstants.DICOM_DATASET_QUALIFIED_NAME));
		Object obj = ctor.newInstance(objIDataSet);
		Method m = c.getMethod(fValidate);
		m.invoke(obj);
	}

	/**
	 * This method decides the type of IOD and calls the validate method of particular IOD
	 * @param objIDataSet - object of DataSet to be validated.
	 * @return boolean - status indicating whether the IOD is valid or invalid.
	 * @throws InvalidIODException Signals that Invalid IOD Exception has occurred.
	 * @throws IODNotSupportedException Signals that Instantiation Exception has occurred.
	 * @throws IODNotFoundException Signals that No Such Method Exception has occurred.
	 */
	public boolean validate(IDataSet objIDataSet) throws InvalidIODException, IODNotSupportedException, IODNotFoundException
	{
		String strSOPClassUID = objIDataSet.getSOPClassUID();

		if(strSOPClassUID == null)
		{
			String strMessage = ResourceBundleWrapper.getValue("exceptions", "SOPclassUIDorModality", new Locale(DicomConfig.createInstance().getLocale()));

			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(strMessage);
			}
				throw new InvalidIODException();

		}

		EnumSOPClassUIDs enumSOPClassUIDs = StandardMethods.getSOPClassUID(strSOPClassUID);
		
		if(enumSOPClassUIDs == null)
			throw new IODNotSupportedException();
		try
		{
			switch (enumSOPClassUIDs)
			{
			case CRIOD:
				invokeMethod(EnumIODQualifiednames.CRIOD.getValue(), objIDataSet);
				break;
			case CTIOD:
				invokeMethod(EnumIODQualifiednames.CTIOD.getValue(), objIDataSet);
				break;
			case ENHANCEDCTIOD:
				invokeMethod(EnumIODQualifiednames.ENHANCEDCTIOD.getValue(), objIDataSet);
				break;
			case USMULTIFRAME:
				invokeMethod(EnumIODQualifiednames.USMULTIFRAME.getValue(), objIDataSet);
				break;
			case MRIOD:
				invokeMethod(EnumIODQualifiednames.MRIOD.getValue(), objIDataSet);
				break;
			case ENHANCEDMRIOD:
				invokeMethod(EnumIODQualifiednames.ENHANCEDMRIOD.getValue(), objIDataSet);
				break;
			case MRSPECTROSCOPYIOD:
				invokeMethod(EnumIODQualifiednames.MRSPECTROSCOPYIOD.getValue(), objIDataSet);
				break;
			case USIOD:
				invokeMethod(EnumIODQualifiednames.USIOD.getValue(), objIDataSet);
				break;
			case SCIOD:
				invokeMethod(EnumIODQualifiednames.SCIOD.getValue(), objIDataSet);
				break;
			case MFSINGLEBITSCIOD:
				invokeMethod(EnumIODQualifiednames.MFSINGLEBITSCIOD.getValue(), objIDataSet);
				break;
			case MFGRAYSCALEBYTESCIOD:
				invokeMethod(EnumIODQualifiednames.MFGRAYSCALEBYTESCIOD.getValue(), objIDataSet);
				break;
			case MFGRAYSCALEWORDSCIOD:
				invokeMethod(EnumIODQualifiednames.MFGRAYSCALEWORDSCIOD.getValue(), objIDataSet);
				break;
			case MFTRUECOLORSCIOD:
				invokeMethod(EnumIODQualifiednames.MFTRUECOLORSCIOD.getValue(), objIDataSet);
				break;
			case STANDALONEOVERLAYIOD:
				invokeMethod(EnumIODQualifiednames.STANDALONEOVERLAYIOD.getValue(), objIDataSet);
				break;
			case STANDALONECURVEIOD:
				invokeMethod(EnumIODQualifiednames.STANDALONECURVEIOD.getValue(), objIDataSet);
				break;
			case TWELVELEADECGWAVEFORMIOD:
				invokeMethod(EnumIODQualifiednames.TWELVELEADECGWAVEFORMIOD.getValue(), objIDataSet);
				break;
			case GENERALECGWAVEFORMIOD:
				invokeMethod(EnumIODQualifiednames.GENERALECGWAVEFORMIOD.getValue(), objIDataSet);
				break;
			case AMBULATORYECGWAVEFORMIOD:
				invokeMethod(EnumIODQualifiednames.AMBULATORYECGWAVEFORMIOD.getValue(), objIDataSet);
				break;
			case HEMODYNAMICWAVEFORMIOD:
				invokeMethod(EnumIODQualifiednames.HEMODYNAMICWAVEFORMIOD.getValue(), objIDataSet);
				break;
			case CARDIACELECTROPHYSIOLOGYWAVEFORMIOD:
				invokeMethod(EnumIODQualifiednames.CARDIACELECTROPHYSIOLOGYWAVEFORMIOD.getValue(), objIDataSet);
				break;
			case BASICVOICEAUDIOWAVEFORMIOD:
				invokeMethod(EnumIODQualifiednames.BASICVOICEAUDIOWAVEFORMIOD.getValue(), objIDataSet);
				break;
			case STANDALONEMODALITYLUTIOD:
				invokeMethod(EnumIODQualifiednames.STANDALONEMODALITYLUTIOD.getValue(), objIDataSet);
				break;
			case STANDALONEVOILUTIOD:
				invokeMethod(EnumIODQualifiednames.STANDALONEVOILUTIOD.getValue(), objIDataSet);
				break;
			case GRAYSCALESOFTCOPYIOD:
				invokeMethod(EnumIODQualifiednames.GRAYSCALESOFTCOPYIOD.getValue(), objIDataSet);
				break;
			case XRAYANGIOGRAPHICIOD:
				invokeMethod(EnumIODQualifiednames.XRAYANGIOGRAPHICIOD.getValue(), objIDataSet);
				break;
			case XRAYRADIOFLUOROSCOPICIOD:
				invokeMethod(EnumIODQualifiednames.XRAYRADIOFLUOROSCOPICIOD.getValue(), objIDataSet);
				break;
			case NMIOD:
				invokeMethod(EnumIODQualifiednames.NMIOD.getValue(), objIDataSet);
				break;
			case RAWDATAIOD:
				invokeMethod(EnumIODQualifiednames.RAWDATAIOD.getValue(), objIDataSet);
				break;
			case SPATIALREGISTRATIONIOD:
				invokeMethod(EnumIODQualifiednames.SPATIALREGISTRATIONIOD.getValue(), objIDataSet);
				break;
			case SPATIALFIDUCIALSIOD:
				invokeMethod(EnumIODQualifiednames.SPATIALFIDUCIALSIOD.getValue(), objIDataSet);
				break;
			case VLENDOSCOPICIOD:
				invokeMethod(EnumIODQualifiednames.VLENDOSCOPICIOD.getValue(), objIDataSet);
				break;
			case VIDEOENDOSCOPICIOD:
				invokeMethod(EnumIODQualifiednames.VIDEOENDOSCOPICIOD.getValue(), objIDataSet);
				break;
			case VLMICROSCOPICIOD:
				invokeMethod(EnumIODQualifiednames.VLMICROSCOPICIOD.getValue(), objIDataSet);
				break;
			case VIDEOMICROSCOPICIOD:
				invokeMethod(EnumIODQualifiednames.VIDEOMICROSCOPICIOD.getValue(), objIDataSet);
				break;
			case VLSLIDECOORDINATESMICROSCOPICIOD:
				invokeMethod(EnumIODQualifiednames.VLSLIDECOORDINATESMICROSCOPICIOD.getValue(), objIDataSet);
				break;
			case VLPHOTOGRAPHICIOD:
				invokeMethod(EnumIODQualifiednames.VLPHOTOGRAPHICIOD.getValue(), objIDataSet);
				break;
			case VIDEOPHOTOGRAPHICIOD:
				invokeMethod(EnumIODQualifiednames.VIDEOPHOTOGRAPHICIOD.getValue(), objIDataSet);
				break;
			case OPHTHALMICPHOTOGRAPHY8BITIOD:
				invokeMethod(EnumIODQualifiednames.OPHTHALMICPHOTOGRAPHY8BITIOD.getValue(), objIDataSet);
				break;
			case OPHTHALMICPHOTOGRAPHY16BITIOD:
				invokeMethod(EnumIODQualifiednames.OPHTHALMICPHOTOGRAPHY16BITIOD.getValue(), objIDataSet);
				break;
			case STEREOMETRICRELATIONSHIP:
				invokeMethod(EnumIODQualifiednames.STEREOMETRICRELATIONSHIP.getValue(), objIDataSet);
				break;
			case BASICTEXTSRIOD:
				invokeMethod(EnumIODQualifiednames.BASICTEXTSRIOD.getValue(), objIDataSet);
				break;
			case ENHANCEDSRIOD:
				invokeMethod(EnumIODQualifiednames.ENHANCEDSRIOD.getValue(), objIDataSet);
				break;
			case COMPREHENSIVESRIOD:
				invokeMethod(EnumIODQualifiednames.COMPREHENSIVESRIOD.getValue(), objIDataSet);
				break;
			case PROCEDURELOGIOD:
				invokeMethod(EnumIODQualifiednames.PROCEDURELOGIOD.getValue(), objIDataSet);
				break;
			case MAMMOGRAPHYCADSRIOD:
				invokeMethod(EnumIODQualifiednames.MAMMOGRAPHYCADSRIOD.getValue(), objIDataSet);
				break;
			case KEYOBJECTSELECTIONDOCUMENTIOD:
				invokeMethod(EnumIODQualifiednames.KEYOBJECTSELECTIONDOCUMENTIOD.getValue(), objIDataSet);
				break;
			case CHESTCADSRIOD:
				invokeMethod(EnumIODQualifiednames.CHESTCADSRIOD.getValue(), objIDataSet);
				break;
			case POSITRONEMISSIONTOMOGRAPHYIOD:
				invokeMethod(EnumIODQualifiednames.POSITRONEMISSIONTOMOGRAPHYIOD.getValue(), objIDataSet);
				break;
			case STANDALONEPETCURVEIOD:
				invokeMethod(EnumIODQualifiednames.STANDALONEPETCURVEIOD.getValue(), objIDataSet);
				break;
			case RTIOD:
				invokeMethod(EnumIODQualifiednames.RTIOD.getValue(), objIDataSet);
				break;
			case RTDOSEIOD:
				invokeMethod(EnumIODQualifiednames.RTDOSEIOD.getValue(), objIDataSet);
				break;
			case RTSTRUCTURESETIOD:
				invokeMethod(EnumIODQualifiednames.RTSTRUCTURESETIOD.getValue(), objIDataSet);
				break;
			case RTBEAMSTREATMENTRECORDIOD:
				invokeMethod(EnumIODQualifiednames.RTBEAMSTREATMENTRECORDIOD.getValue(), objIDataSet);
				break;
			case RTPLANIOD:
				invokeMethod(EnumIODQualifiednames.RTPLANIOD.getValue(), objIDataSet);
				break;
			case RTBRACHYTREATMENTIOD:
				invokeMethod(EnumIODQualifiednames.RTBRACHYTREATMENTIOD.getValue(), objIDataSet);
				break;
			case RTTREATMENTSUMMARYIOD:
				invokeMethod(EnumIODQualifiednames.RTTREATMENTSUMMARYIOD.getValue(), objIDataSet);
				break;
			case DIGITALINTRAORALXRAYIMAGESTORAGEFORPRESENTATIONIOD:
				invokeMethod(EnumIODQualifiednames.DIGITALINTRAORALXRAYIMAGESTORAGEFORPRESENTATIONIOD.getValue(), objIDataSet);
				break;
			case DIGITALXRAYIMAGESTORAGEFORPRESENTATIONIOD:
				invokeMethod(EnumIODQualifiednames.DIGITALXRAYIMAGESTORAGEFORPRESENTATIONIOD.getValue(), objIDataSet);
				break;
			case MEDIASTORAGEDIRECTORYSTORAGE:
				invokeMethod(EnumIODQualifiednames.BASICDIRECTORYIOD.getValue(), objIDataSet);
				break;
			case ARTERIALPULSEWAVEFORMIOD:
				invokeMethod(EnumIODQualifiednames.ARTERIALPULSEWAVEFORMIOD.getValue(), objIDataSet);
				break;
			case AUTOREFRACTIONMEASUREMENTSIOD:invokeMethod(EnumIODQualifiednames.AUTOREFRACTIONMEASUREMENTSIOD.getValue(), objIDataSet);
			    break;
			case BASICSTRUCTUREDDISPLAYIOD:invokeMethod(EnumIODQualifiednames.BASICSTRUCTUREDDISPLAYIOD.getValue(), objIDataSet);
			    break;
			case BLENDINGSOFTCOPYPRESENTATIONSTATEIOD:invokeMethod(EnumIODQualifiednames.BLENDINGSOFTCOPYPRESENTATIONSTATEIOD.getValue(), objIDataSet);
			    break;
			case BREASTPROJECTIONXRAYIMAGEIOD:invokeMethod(EnumIODQualifiednames.BREASTPROJECTIONXRAYIMAGEIOD.getValue(), objIDataSet);
			    break;
			case BREASTTOMOSYNTHESISIMAGEIOD:invokeMethod(EnumIODQualifiednames.BREASTTOMOSYNTHESISIMAGEIOD.getValue(), objIDataSet);
			    break;
			case COLONCADSRIOD:invokeMethod(EnumIODQualifiednames.COLONCADSRIOD.getValue(), objIDataSet);
			    break;
			case COLORPALETTEIOD:invokeMethod(EnumIODQualifiednames.COLORPALETTEIOD.getValue(), objIDataSet);
			    break;
			case COLORSOFTCOPYPRESENTATIONSTATEIOD:invokeMethod(EnumIODQualifiednames.COLORSOFTCOPYPRESENTATIONSTATEIOD.getValue(), objIDataSet);
			    break;
			case COMPREHENSIVE3DSRIOD:invokeMethod(EnumIODQualifiednames.COMPREHENSIVE3DSRIOD.getValue(), objIDataSet);
			    break;
			case CORNEALTOPOGRAPHYMAPIOD:invokeMethod(EnumIODQualifiednames.CORNEALTOPOGRAPHYMAPIOD.getValue(), objIDataSet);
			    break;
			case DEFORMABLESPATIALREGISTRATIONIOD:invokeMethod(EnumIODQualifiednames.DEFORMABLESPATIALREGISTRATIONIOD.getValue(), objIDataSet);
			    break;
			case DISPLAYSYSTEMIOD:
				invokeMethod(EnumIODQualifiednames.DISPLAYSYSTEMINFORMATIONOBJECTDEFINITION.getValue(), objIDataSet);
			    break;
			case ENCAPSULATEDCDAIOD:invokeMethod(EnumIODQualifiednames.ENCAPSULATEDCDAIOD.getValue(), objIDataSet);
			    break;
			case ENCAPSULATEDPDFIOD:invokeMethod(EnumIODQualifiednames.ENCAPSULATEDPDFIOD.getValue(), objIDataSet);
			    break;
			case EnhancedCTImageIOD:
				invokeMethod(EnumIODQualifiednames.ENHANCEDCOMPUTEDTOMOGRAPHYIMAGEIOD.getValue(), objIDataSet);
			    break;
			case ENHANCEDMRCOLORIMAGEIOD:
				invokeMethod(EnumIODQualifiednames.ENHANCEDMRCOLORIMAGEIOD.getValue(), objIDataSet);
			    break;
			case EnhancedPETImageIOD:
				invokeMethod(EnumIODQualifiednames.ENHANCEDPETIMAGEIOD.getValue(), objIDataSet);
			    break;
			case ENHANCEDUSVOLUMEIOD:invokeMethod(EnumIODQualifiednames.ENHANCEDUSVOLUMEIOD.getValue(), objIDataSet);
			    break;
			case ENHANCEDXAIMAGEIOD:
				invokeMethod(EnumIODQualifiednames.ENHANCEDXRAYANGIOGRAPHICIMAGEIOD.getValue(), objIDataSet);
			    break;
			case ENHANCEDXRFIMAGEIOD:
				invokeMethod(EnumIODQualifiednames.ENHANCEDXRAYRFIMAGEIOD.getValue(), objIDataSet);
			    break;
			case EXTENSIBLESRIOD:invokeMethod(EnumIODQualifiednames.EXTENSIBLESRIOD.getValue(), objIDataSet);
			    break;
			case GENERALAUDIOWAVEFORMIOD:invokeMethod(EnumIODQualifiednames.GENERALAUDIOWAVEFORMIOD.getValue(), objIDataSet);
			    break;
			case GENERICIMPLANTTEMPLATEIOD:invokeMethod(EnumIODQualifiednames.GENERICIMPLANTTEMPLATEIOD.getValue(), objIDataSet);
			    break;
			case HANGINGPROTOCOLIOD:invokeMethod(EnumIODQualifiednames.HANGINGPROTOCOLIOD.getValue(), objIDataSet);
			    break;
			case IMPLANTASSEMBLYTEMPLATEIOD:invokeMethod(EnumIODQualifiednames.IMPLANTASSEMBLYTEMPLATEIOD.getValue(), objIDataSet);
			    break;
			case IMPLANTTEMPLATEGROUPIOD:invokeMethod(EnumIODQualifiednames.IMPLANTTEMPLATEGROUPIOD.getValue(), objIDataSet);
			    break;
			case IMPLANTATIONPLANSRIOD:
				invokeMethod(EnumIODQualifiednames.IMPLANTATIONPLANSRDOCUMENTIOD.getValue(), objIDataSet);
			    break;
			case INTRAOCULARLENSCALCULATIONSIOD:invokeMethod(EnumIODQualifiednames.INTRAOCULARLENSCALCULATIONSIOD.getValue(), objIDataSet);
			    break;
			case INTRAVASCULAROCTIOD:invokeMethod(EnumIODQualifiednames.INTRAVASCULAROCTIOD.getValue(), objIDataSet);
			    break;
			case KERATOMETRYMEASUREMENTSIOD:invokeMethod(EnumIODQualifiednames.KERATOMETRYMEASUREMENTSIOD.getValue(), objIDataSet);
			    break;
			case LEGACYCONVERTEDENHANCEDCTIMAGEIOD:invokeMethod(EnumIODQualifiednames.LEGACYCONVERTEDENHANCEDCTIMAGEIOD.getValue(), objIDataSet);
			    break;
			case LEGACYCONVERTEDENHANCEDMRIMAGEIOD:invokeMethod(EnumIODQualifiednames.LEGACYCONVERTEDENHANCEDMRIMAGEIOD.getValue(), objIDataSet);
			    break;
			case LEGACYCONVERTEDENHANCEDPETIMAGEIOD:invokeMethod(EnumIODQualifiednames.LEGACYCONVERTEDENHANCEDPETIMAGEIOD.getValue(), objIDataSet);
			    break;
			case LENSOMETRYMEASUREMENTSIOD:invokeMethod(EnumIODQualifiednames.LENSOMETRYMEASUREMENTSIOD.getValue(), objIDataSet);
			    break;
			case MACULARGRIDTHICKNESSANDVOLUMEREPORTIOD:invokeMethod(EnumIODQualifiednames.MACULARGRIDTHICKNESSANDVOLUMEREPORTIOD.getValue(), objIDataSet);
			    break;
			case OPHTHALMICAXIALMEASUREMENTSIOD:invokeMethod(EnumIODQualifiednames.OPHTHALMICAXIALMEASUREMENTSIOD.getValue(), objIDataSet);
			    break;
			case OPHTHALMICTHICKNESSMAPIOD:invokeMethod(EnumIODQualifiednames.OPHTHALMICTHICKNESSMAPIOD.getValue(), objIDataSet);
			    break;
			case OPHTHALMICTOMOGRAPHYIMAGEIOD:invokeMethod(EnumIODQualifiednames.OPHTHALMICTOMOGRAPHYIMAGEIOD.getValue(), objIDataSet);
			    break;
			case OPHTHALMICVISUALFIELDSTATICPERIMETRYMEASUREMENTSIOD:invokeMethod(EnumIODQualifiednames.OPHTHALMICVISUALFIELDSTATICPERIMETRYMEASUREMENTSIOD.getValue(), objIDataSet);
			    break;
			case PARAMETRICMAPIOD:invokeMethod(EnumIODQualifiednames.PARAMETRICMAPIOD.getValue(), objIDataSet);
			    break;
			case PseudoColorSoftcopyPresentationStateIOD:
				invokeMethod(EnumIODQualifiednames.PSEUDOCOLORSOFTCOPYPRESENTATIONSTATEIOD.getValue(), objIDataSet);
			    break;
			case RADIOPHARMACEUTICALRADIATIONDOSESRIOD:invokeMethod(EnumIODQualifiednames.RADIOPHARMACEUTICALRADIATIONDOSESRIOD.getValue(), objIDataSet);
			    break;
			case REALWORLDVALUEMAPPINGIOD:invokeMethod(EnumIODQualifiednames.REALWORLDVALUEMAPPINGIOD.getValue(), objIDataSet);
			    break;
			case RESPIRATORYWAVEFORMIOD:invokeMethod(EnumIODQualifiednames.RESPIRATORYWAVEFORMIOD.getValue(), objIDataSet);
			    break;
			case RTBEAMSDELIVERYINSTRUCTIONIOD:invokeMethod(EnumIODQualifiednames.RTBEAMSDELIVERYINSTRUCTIONIOD.getValue(), objIDataSet);
			    break;
			case RTCONVENTIONALMACHINEVERIFICATIONINFORMATIONOBJECTDEFINITION:invokeMethod(EnumIODQualifiednames.RTCONVENTIONALMACHINEVERIFICATIONINFORMATIONOBJECTDEFINITION.getValue(), objIDataSet);
			    break;
			case RTIONBEAMSTREATMENTRECORDIOD:invokeMethod(EnumIODQualifiednames.RTIONBEAMSTREATMENTRECORDIOD.getValue(), objIDataSet);
			    break;
			case RTIONMACHINEVERIFICATIONINFORMATIONOBJECTDEFINITION:invokeMethod(EnumIODQualifiednames.RTIONMACHINEVERIFICATIONINFORMATIONOBJECTDEFINITION.getValue(), objIDataSet);
			    break;
			case RTIonPlanIOD:
				invokeMethod(EnumIODQualifiednames.RTIONPLANIOD.getValue(), objIDataSet);
			    break;
			case SEGMENTATIONIOD:invokeMethod(EnumIODQualifiednames.SEGMENTATIONIOD.getValue(), objIDataSet);
			    break;
			case SPECTACLEPRESCRIPTIONREPORTIOD:invokeMethod(EnumIODQualifiednames.SPECTACLEPRESCRIPTIONREPORTIOD.getValue(), objIDataSet);
			    break;
			case SUBJECTIVEREFRACTIONMEASUREMENTSIOD:invokeMethod(EnumIODQualifiednames.SUBJECTIVEREFRACTIONMEASUREMENTSIOD.getValue(), objIDataSet);
			    break;
			case SURFACESCANMESHIOD:invokeMethod(EnumIODQualifiednames.SURFACESCANMESHIOD.getValue(), objIDataSet);
			    break;
			case SURFACESCANPOINTCLOUDIOD:invokeMethod(EnumIODQualifiednames.SURFACESCANPOINTCLOUDIOD.getValue(), objIDataSet);
			    break;
			case SURFACESEGMENTATIONIOD:invokeMethod(EnumIODQualifiednames.SURFACESEGMENTATIONIOD.getValue(), objIDataSet);
			    break;
			case UNIFIEDPROCEDURESTEPIOD:
				invokeMethod(EnumIODQualifiednames.UNIFIEDPROCEDURESTEPINFORMATIONOBJECTDEFINITION.getValue(), objIDataSet);
			    break;
			case VISUALACUITYMEASUREMENTSIOD:invokeMethod(EnumIODQualifiednames.VISUALACUITYMEASUREMENTSIOD.getValue(), objIDataSet);
			    break;
			case VLWHOLESLIDEMICROSCOPYIMAGEIOD:invokeMethod(EnumIODQualifiednames.VLWHOLESLIDEMICROSCOPYIMAGEIOD.getValue(), objIDataSet);
			    break;
			case WIDEFIELDOPHTHALMICPHOTOGRAPHY3DCOORDINATESIMAGEIOD:invokeMethod(EnumIODQualifiednames.WIDEFIELDOPHTHALMICPHOTOGRAPHY3DCOORDINATESIMAGEIOD.getValue(), objIDataSet);
			    break;
			case WIDEFIELDOPHTHALMICPHOTOGRAPHYSTEREOGRAPHICPROJECTIONIMAGEIOD:invokeMethod(EnumIODQualifiednames.WIDEFIELDOPHTHALMICPHOTOGRAPHYSTEREOGRAPHICPROJECTIONIMAGEIOD.getValue(), objIDataSet);
			    break;
			case XAIMAGEIOD:invokeMethod(EnumIODQualifiednames.XAIMAGEIOD.getValue(), objIDataSet);
			    break;
			case XAXRFGrayscaleSoftcopyPresentationStateIOD:
				invokeMethod(EnumIODQualifiednames.XAXRFGRAYSCALESOFTCOPYPRESENTATIONSTATEIOD.getValue(), objIDataSet);
			    break;
			case XRAY3DANGIOGRAPHICIMAGEIOD:invokeMethod(EnumIODQualifiednames.XRAY3DANGIOGRAPHICIMAGEIOD.getValue(), objIDataSet);
			    break;
			case XRAY3DCRANIOFACIALIMAGEIOD:invokeMethod(EnumIODQualifiednames.XRAY3DCRANIOFACIALIMAGEIOD.getValue(), objIDataSet);
			    break;
			case XRAYRADIATIONDOSESRIOD:invokeMethod(EnumIODQualifiednames.XRAYRADIATIONDOSESRIOD.getValue(), objIDataSet);
			    break;
	

			}
		}
		catch(IllegalAccessException iae)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(iae.getMessage());
			}
			throw new IODNotFoundException(ResourceBundleWrapper.getValue("exceptions", "IllegalAccess", new Locale(DicomConfig.createInstance().getLocale())),iae);
		}
		catch(ClassNotFoundException cnfe)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(cnfe.getMessage());
			}
			throw new IODNotFoundException(ResourceBundleWrapper.getValue("exceptions", "ClassNotFound", new Locale(DicomConfig.createInstance().getLocale())),cnfe);
		}
		catch(NoSuchMethodException nsme)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(nsme.getMessage());
			}
			throw new IODNotFoundException(ResourceBundleWrapper.getValue("exceptions", "NoSuchMethodException", new Locale(DicomConfig.createInstance().getLocale())),nsme);
		}
		catch(InstantiationException ie)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(ie.getMessage());
			}
			throw new IODNotFoundException(ResourceBundleWrapper.getValue("exceptions", "InstantiationException", new Locale(DicomConfig.createInstance().getLocale())),ie);
		}
		catch(InvocationTargetException ite)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(ite.getMessage());
			}
			throw new IODNotFoundException(ResourceBundleWrapper.getValue("exceptions", "InvocationTargetException", new Locale(DicomConfig.createInstance().getLocale())),ite);
		}
		return true;
	}
}
