Example #1
0
        /// <summary>
        /// Validate the Dicom Message by inspecting the VR's.
        /// </summary>
        /// <param name="dicomMessage">The Dicom Message.</param>
        public void Validate(DicomThread dicomThread, DicomMessage dicomMessage)
        {
            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.
            validationFlags |= ValidateUseDefinitions(dicomThread, dicomMessage);

            // 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.");
            }
        }
Example #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.");
            }
        }