Esempio n. 1
0
        /// <summary>
        /// Check if the objects are equal.
        /// </summary>
        /// <param name="obj">Comparison object.</param>
        /// <returns>bool indicating true = equal or false  = not equal.</returns>
        public override bool Equals(object obj)
        {
            bool equals = false;

            if (obj is CommonUidFormat)
            {
                CommonUidFormat thatCommonUid = (CommonUidFormat)obj;
                if (this.Uid == thatCommonUid.Uid)
                {
                    equals = true;
                }
            }
            return(equals);
        }
Esempio n. 2
0
 public override System.String FromHl7ToDicom(System.String hl7Value)
 {
     CommonUidFormat commonUidFormat = new CommonUidFormat();
     commonUidFormat.FromHl7Format(hl7Value);
     return commonUidFormat.ToDicomFormat();
 }
Esempio n. 3
0
        private BaseCommonDataFormat CreateCommonDateFormat(AttributeBase attribute)
        {
            BaseCommonDataFormat commonDataFormat = new CommonStringFormat();

            switch (this.compareRule.CompareValueType)
            {
                case CompareValueTypes.Date:
                    commonDataFormat = new CommonDateFormat();
                    break;

                case CompareValueTypes.ID:
                    commonDataFormat = new CommonIdFormat();
                    break;

                case CompareValueTypes.Name:
                    commonDataFormat = new CommonNameFormat();
                    break;

                case CompareValueTypes.String:
                    commonDataFormat = new CommonStringFormat();
                    break;

                case CompareValueTypes.Time:
                    commonDataFormat = new CommonTimeFormat();
                    break;

                case CompareValueTypes.UID:
                    commonDataFormat = new CommonUidFormat();
                    break;

                default:
                    // Do nothing.
                    break;
            }

            if (attribute is DicomAttribute)
            {
                DvtkHighLevelInterface.Dicom.Other.Attribute dicomAttributeOnly = (attribute as DicomAttribute).AttributeOnly;

                if (dicomAttributeOnly.VM == 0)
                {
                    commonDataFormat.FromDicomFormat("");
                }
                else
                {
                    commonDataFormat.FromDicomFormat(dicomAttributeOnly.Values[0]);
                }

            }
            else if (attribute is Hl7Attribute)
            {
                commonDataFormat.FromHl7Format((attribute as Hl7Attribute).AttributeOnly);
            }
            else
            {
                throw new System.Exception("Not supposed to get here.");
            }

            return(commonDataFormat);
        }
Esempio n. 4
0
 public override System.String FromDicomToHl7(System.String dicomValue)
 {
     CommonUidFormat commonUidFormat = new CommonUidFormat();
     commonUidFormat.FromDicomFormat(dicomValue);
     return commonUidFormat.ToHl7Format();
 }