Example #1
0
        public override System.String FromDicomToHl7(System.String dicomValue)
        {
            CommonTimeFormat commonTimeFormat = new CommonTimeFormat();

            commonTimeFormat.FromDicomFormat(dicomValue);
            return(commonTimeFormat.ToHl7Format());
        }
Example #2
0
        public override System.String FromHl7ToDicom(System.String hl7Value)
        {
            CommonTimeFormat commonTimeFormat = new CommonTimeFormat();

            commonTimeFormat.FromHl7Format(hl7Value);
            return(commonTimeFormat.ToDicomFormat());
        }
Example #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);
        }