Exemplo n.º 1
0
        public void SerializeValidate(
            DvtkData.Validation.ValidationDirectoryRecordResult validationDirectoryRecordResult)
        {
            if (this.m_bIsTopSerializer)
            {
                //
                // The directory records should be serialized using child-serializers.
                // Not by means of the top parent-serializer.
                //
                throw new System.ApplicationException(
                    string.Concat(
                    "ValidationDirectoryRecordResult should not be serialized ",
                    "by means of the top parent-serializer!"));
            }
            if (!this.m_parentSerializer.m_bIsTopSerializer)
            {
                //
                // The parent of this child serializer should be the top.
                //
                throw new System.ApplicationException(
                    "The parent-serializer of this child-serializer should be the top serializer.");
            }
            //
            // Store errors and warnings in the temporary count tables of the top parent-serializer.
            // To be used during serialization of record links.
            //
            this.m_parentSerializer.topDirectoryRecordErrorCountTable[validationDirectoryRecordResult.DirectoryRecordIndex]
                = validationDirectoryRecordResult.NrOfErrors;
            this.m_parentSerializer.topDirectoryRecordWarningCountTable[validationDirectoryRecordResult.DirectoryRecordIndex]
                = validationDirectoryRecordResult.NrOfWarnings;

            if (this.m_parentSession.ResultsGatheringPaused) return;
            if (this.m_serializationWriter == null) return;

            /* TODO: Remove obsolete, is now done by CreateAndRegisterChildSerializer.
            //
            // Split-of directory records into
            // separate files post-fixed by DicomDirectoryIndex.
            //
            SerializationWriter serializationWriter = new SerializationWriter(
                this.m_targetFileName,
                isParentDocument,
                validationDirectoryRecordResult.DirectoryRecordIndex,
                this.m_parentSession.DetailedValidationResults,
                this.m_parentSession.SummaryValidationResults);
            serializationWriter.WriteStartDocument();
            serializationWriter.WriteStartElement();
            */

            // stream detailed validation results
            validationDirectoryRecordResult.DvtDetailToXml(this.m_serializationWriter.DetailStreamWriter, 0);

            validationDirectoryRecordResult.DisplayConditionText = this.m_parentSession.DisplayConditionText;
            if (validationDirectoryRecordResult.ReferencedFile != null)
            {
                validationDirectoryRecordResult.ReferencedFile.ConditionTextDisplay = this.m_parentSession.DisplayConditionText;
            }

            // stream summary validation results
            validationDirectoryRecordResult.DvtSummaryToXml(this.m_serializationWriter.SummaryStreamWriter, 0);

            /* TODO: Remove obsolete, is now done by CreateAndRegisterChildSerializer.
            // close the targets
            serializationWriter.WriteEndElement();
            serializationWriter.WriteEndDocument();
            */
        }
Exemplo n.º 2
0
        public void SerializeValidate(DvtkData.Validation.ValidationAssociateRq validationAssociateRq)
        {
            if (this.m_parentSession.ResultsGatheringPaused) return;
            if (this.m_serializationWriter == null) return;

            //Assign Unique ID to the message
            validationAssociateRq.MessageUID = GetNextDIMSEDULMessageIndex();

            // stream detailed validation results
            validationAssociateRq.DvtDetailToXml(this.m_serializationWriter.DetailStreamWriter, 0);

            // stream summary validation results
            validationAssociateRq.DvtSummaryToXml(this.m_serializationWriter.SummaryStreamWriter, 0);
        }
Exemplo n.º 3
0
        public void SerializeValidate(DvtkData.Validation.ValidationReleaseRq validationReleaseRq)
        {
            if (this.m_parentSession.ResultsGatheringPaused) return;
            if (this.m_serializationWriter == null) return;

            // stream detailed validation results
            validationReleaseRq.DvtDetailToXml(this.m_serializationWriter.DetailStreamWriter, 0);

            // stream summary validation results
            validationReleaseRq.DvtSummaryToXml(this.m_serializationWriter.SummaryStreamWriter, 0);
        }
Exemplo n.º 4
0
        public void SerializeValidate(DvtkData.Validation.ValidationObjectResult validationObjectResult)
        {
            if (this.m_parentSession.ResultsGatheringPaused) return;
            if (this.m_serializationWriter == null) return;
            //
            // Determine whether to process a Directory Record Table of Contents
            // within this Validation Object Results.
            //
            if (validationObjectResult.DirectoryRecordTOC != null)
            {
                //
                // An Validation Object Results with a Directory Record Table of Contents
                // should only be serialized via the top parent-serializer.
                //
                if (!this.m_bIsTopSerializer)
                {
                    throw new System.ApplicationException(
                        string.Concat(
                        "An Validation Object Results with a Directory Record Table of Contents",
                        "should only be serialized via the top parent-serializer."));
                }
                //
                // Check that intermediate counting tables exist of the top parent-serializer.
                //
                if (
                    this.topDirectoryRecordErrorCountTable == null ||
                    this.topDirectoryRecordWarningCountTable == null)
                {
                    throw new System.ApplicationException(
                        string.Concat(
                        "Did not find the intermediate error and warning ",
                        "counting tables for directory records."));
                }
                //
                // Add the missing information about errors and warnings to the serialized data.
                // This error and warning counting was done at the top parent-serializer level.
                //
                foreach (
                    DvtkData.Validation.SubItems.ValidationDirectoryRecordLink link
                        in validationObjectResult.DirectoryRecordTOC)
                {
                    //
                    // copy temporary data for errors and warnings to link.
                    //
                    object o;
                    object key;
                    key = link.DirectoryRecordIndex;
                    o = this.topDirectoryRecordErrorCountTable[key];
                    link.NrOfErrors = (o == null) ? 0 : (System.UInt32)o;
                    this.topDirectoryRecordErrorCountTable.Remove(key);
                    o = this.topDirectoryRecordWarningCountTable[key];
                    link.NrOfWarnings = (o == null) ? 0 : (System.UInt32)o;
                    this.topDirectoryRecordWarningCountTable.Remove(key);
                }
            }

            //Assign Unique ID to the message
            validationObjectResult.MessageUID = GetNextDIMSEDULMessageIndex();

            // stream detailed validation results
            validationObjectResult.DvtDetailToXml(this.m_serializationWriter.DetailStreamWriter, 0);

            //Assign user selected choice from UI
            validationObjectResult.ConditionTextDisplay = this.m_parentSession.DisplayConditionText;

            // stream summary validation results
            validationObjectResult.DvtSummaryToXml(this.m_serializationWriter.SummaryStreamWriter, 0);
        }