Exemplo n.º 1
0
        /// <summary>
        /// Validate the Dicom Message using a definition file.
        /// </summary>
        /// <param name="dicomMessage">The Dicom Message.</param>
        /// <param name="iodId">The IOD ID to use, implicitly determining which definition file to use.</param>
        ///

        public void Validate(DicomThread dicomThread, DicomMessage dicomMessage, String iodName)
        {
            this.thread.WriteInformationInternal("Validate Dicom message...");

            Dvtk.Sessions.ValidationControlFlags validationFlags = Dvtk.Sessions.ValidationControlFlags.None;

            // Determine if the VR's need to be validated.
            validationFlags |= ValidateValueRepresentations(dicomMessage);

            // Determine if the DicomMessage can or needs to be validated against a definition file.
            if (iodName.Length > 0)
            {
                validationFlags |= ValidateUseDefinitions(dicomMessage, iodName);
            }

            // If validation is needed, do it now.
            if (validationFlags != Dvtk.Sessions.ValidationControlFlags.None)
            {
                dicomThread.DvtkScriptSession.Validate(dicomMessage.DvtkDataDicomMessage, null, validationFlags);
            }
            else
            {
                dicomThread.WriteInformationInternal("No validation performed.");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Validate the Dul Message by inspecting the VR's and the definition.
        /// </summary>
        /// <param name="dulMessage">The Dul Message.</param>

        public void Validate(DicomThread dicomThread, DulMessage dulMessage)
        {
            this.thread.WriteInformationInternal("Validate Dul message...");

            if (!dulMessage.AreValueRepresentationsValidated)
            {
                dicomThread.DvtkScriptSession.Validate(dulMessage.DvtkDataDulMessage, null, Dvtk.Sessions.ValidationControlFlags.UseValueRepresentations);
                dulMessage.AreValueRepresentationsValidated = true;
            }
            else
            {
                dicomThread.WriteInformationInternal("VR's of DulMessage will not be validated again.\r\nNo validation performed.");
            }
        }