private static void AddRadiationDoseDefaultValues(Dvtk.Dicom.InformationEntity.DefaultValues.DefaultValueManager defaultValueManager, DvtkData.Dimse.DataSet dataset) { if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.DISTANCE_SOURCE_TO_DETECTOR) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.DISTANCE_SOURCE_TO_DETECTOR, VR.DS, dataset); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.IMAGE_AREA_DOSE_PRODUCT) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.IMAGE_AREA_DOSE_PRODUCT, VR.DS, dataset); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.TOTAL_TIME_OF_FLUOROSCOPY) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.TOTAL_TIME_OF_FLUOROSCOPY, VR.US, dataset); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.TOTAL_NUMBER_OF_EXPOSURES) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.TOTAL_NUMBER_OF_EXPOSURES, VR.US, dataset); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.ENTRANCE_DOSE) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.ENTRANCE_DOSE, VR.US, dataset); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.EXPOSED_AREA) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.EXPOSED_AREA, VR.US, dataset); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.DISTANCE_SOURCE_TO_ENTRANCE) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.DISTANCE_SOURCE_TO_ENTRANCE, VR.DS, dataset); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.COMMENTS_ON_RADIATION_DOSE) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.COMMENTS_ON_RADIATION_DOSE, VR.ST, dataset); } DvtkData.Dimse.SequenceItem exposeureDoseSequenceItem = new DvtkData.Dimse.SequenceItem(); if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.KVP) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.KVP, VR.DS, exposeureDoseSequenceItem); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.EXPOSURE_TIME) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.EXPOSURE_TIME, VR.IS, exposeureDoseSequenceItem); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.RADIATION_MODE) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.RADIATION_MODE, VR.CS, exposeureDoseSequenceItem); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.FILTER_TYPE) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.FILTER_TYPE, VR.SH, exposeureDoseSequenceItem); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.FILTER_MATERIAL) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.FILTER_MATERIAL, VR.CS, exposeureDoseSequenceItem); } if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.X_RAY_TUBE_CURRENT_IN_UA) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.X_RAY_TUBE_CURRENT_IN_UA, VR.DS, exposeureDoseSequenceItem); } if (exposeureDoseSequenceItem.Count > 0) { dataset.AddAttribute(DvtkData.Dimse.Tag.EXPOSURE_DOSE_SEQUENCE.GroupNumber, DvtkData.Dimse.Tag.EXPOSURE_DOSE_SEQUENCE.ElementNumber, VR.SQ, exposeureDoseSequenceItem); } }
private static void AddDefaultValue(Dvtk.Dicom.InformationEntity.DefaultValues.DefaultValueManager defaultValueManager, DvtkData.Dimse.Tag tag, VR vr, DvtkData.Dimse.AttributeSet attributeSet) { // Only add a default value if the attribute does not already exist DvtkData.Dimse.Attribute attribute = attributeSet.GetAttribute(tag); if (attribute == null) { // Attribute does not exist so add a default value System.String lValue = defaultValueManager.GetInstantiatedValue(tag); attributeSet.AddAttribute(tag.GroupNumber, tag.ElementNumber, (DvtkData.Dimse.VR)vr, lValue); } }
private static void AddDefaultValueEvenIfZeroLength(Dvtk.Dicom.InformationEntity.DefaultValues.DefaultValueManager defaultValueManager, DvtkData.Dimse.Tag tag, VR vr, DvtkData.Dimse.AttributeSet attributeSet) { // Only add a default value if the attribute does not already exist or has a zero length DvtkData.Dimse.Attribute attribute = attributeSet.GetAttribute(tag); if (attribute == null) { // Attribute does not exist so add a default value System.String lValue = defaultValueManager.GetInstantiatedValue(tag); attributeSet.AddAttribute(tag.GroupNumber, tag.ElementNumber, (DvtkData.Dimse.VR)vr, lValue); } else if (attribute.Length == 0) { // Remove the existing attribute attributeSet.Remove(attribute); // Attribute had zero length so add a default value System.String lValue = defaultValueManager.GetInstantiatedValue(tag); attributeSet.AddAttribute(tag.GroupNumber, tag.ElementNumber, (DvtkData.Dimse.VR)vr, lValue); } }
private static void AddDefaultMppsCompletedDiscontinuedValues(Dvtk.Dicom.InformationEntity.DefaultValues.DefaultValueManager defaultValueManager, ReferencedSopItemCollection storageCommitItems, DvtkData.Dimse.DataSet dataset, System.String mppsStatus) { DvtkData.Dimse.SequenceItem performedSeriesSequenceItem = new DvtkData.Dimse.SequenceItem(); // Series Entity default values AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.PROTOCOL_NAME, VR.LO, performedSeriesSequenceItem); AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.RETRIEVE_AE_TITLE, VR.AE, performedSeriesSequenceItem); AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.SERIES_DESCRIPTION, VR.LO, performedSeriesSequenceItem); AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.PERFORMING_PHYSICIANS_NAME, VR.PN, performedSeriesSequenceItem); AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.OPERATORS_NAME, VR.PN, performedSeriesSequenceItem); AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.SERIES_INSTANCE_UID, VR.UI, performedSeriesSequenceItem); performedSeriesSequenceItem.AddAttribute(DvtkData.Dimse.Tag.REFERENCED_STANDALONE_SOP_INSTANCE_SEQUENCE.GroupNumber, DvtkData.Dimse.Tag.REFERENCED_STANDALONE_SOP_INSTANCE_SEQUENCE.ElementNumber, DvtkData.Dimse.VR.SQ); // Performed Procedure Step Entity default values AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.PERFORMED_PROCEDURE_STEP_END_DATE, VR.DA, dataset); AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.PERFORMED_PROCEDURE_STEP_END_TIME, VR.TM, dataset); if (defaultValueManager.GetInstantiatedValue(DvtkData.Dimse.Tag.COMMENTS_ON_THE_PERFORMED_PROCEDURE_STEPS) != System.String.Empty) { AddDefaultValue(defaultValueManager, DvtkData.Dimse.Tag.COMMENTS_ON_THE_PERFORMED_PROCEDURE_STEPS, VR.ST, dataset); } AddReferencedSopSequence(storageCommitItems, 0x00081140, performedSeriesSequenceItem, InstanceStateEnum.InstanceMppsCompleted); dataset.AddAttribute(DvtkData.Dimse.Tag.PERFORMED_SERIES_SEQUENCE.GroupNumber, DvtkData.Dimse.Tag.PERFORMED_SERIES_SEQUENCE.ElementNumber, DvtkData.Dimse.VR.SQ, performedSeriesSequenceItem); dataset.AddAttribute(DvtkData.Dimse.Tag.PERFORMED_PROCEDURE_STEP_STATUS.GroupNumber, DvtkData.Dimse.Tag.PERFORMED_PROCEDURE_STEP_STATUS.ElementNumber, VR.CS, mppsStatus); // Add any RadiationDoseDefaultValues default values AddRadiationDoseDefaultValues(defaultValueManager, dataset); }