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); }
public override System.String FromHl7ToDicom(System.String hl7Value) { CommonUidFormat commonUidFormat = new CommonUidFormat(); commonUidFormat.FromHl7Format(hl7Value); return commonUidFormat.ToDicomFormat(); }