Exemple #1
0
        private void ValidateDatePattern(string datePattern, FormatContext context)
        {
            StandardDataType standardDataType = StandardDataType.GetByTypeName(context);
            VersionNumber    version          = (context == null ? null : context.GetVersion());

            string[] allowedDateFormats = TsDateFormats.GetAllDateFormats(standardDataType, version);
            if (ArrayContains(allowedDateFormats, datePattern))
            {
                // check if this pattern is missing a timezone
                if (!IsCerx(standardDataType, version) && TsDateFormats.datetimeFormatsRequiringWarning.Contains(datePattern))
                {
                    context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, System.String.Format("Date format {0} supplied for value of type {1} should also have a timezone (ZZZZZ)"
                                                                                                                              , datePattern, context == null ? "TS" : context.Type), context.GetPropertyPath()));
                }
            }
            else
            {
                // MBR-368: a temporary work-around for producing AB PIN compliant date time renderings
                // with out error messages -- required until the runtime's knowledge of datatypes has been
                // corrected to distinguish between CeRx v3 (ie., V01R03) and CeRx v4 (ie., V01R04)
                if (!SpecificationVersion.IsExactVersion(SpecificationVersion.V01R04_1_AB, version))
                {
                    context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, System.String.Format("Invalid date format {0} supplied for value of type {1}"
                                                                                                                              , datePattern, context == null ? "TS" : context.Type), context.GetPropertyPath()));
                }
            }
        }
Exemple #2
0
 private void ValidateSpecializationType(StandardDataType specializationType, bool valueOmitted, FormatContext context)
 {
     if (specializationType == StandardDataType.TS || specializationType == null)
     {
         if (Ca.Infoway.Messagebuilder.BooleanUtils.ValueOf(Runtime.GetProperty(TsDateFormats.ABSTRACT_TS_IGNORE_SPECIALIZATION_TYPE_ERROR_PROPERTY_NAME
                                                                                )))
         {
         }
         else
         {
             // user has specified that this validation error should be suppressed
             if (valueOmitted)
             {
             }
             else
             {
                 // RM16399 - there are some cases where it is valid to omit a specialization type (such as when not providing a TS value)
                 // do nothing; other potential errors will be caught by the default concrete TS formatter
                 context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, System.String.Format("No specializationType provided. Value should be one of TS.FULLDATE / TS.FULLDATETIME / TS.FULLDATEPARTTIME. TS.FULLDATETIME will be assumed."
                                                                                                                           , specializationType.Type), context.GetPropertyPath()));
             }
         }
     }
     else
     {
         if (specializationType != StandardDataType.TS_FULLDATE && specializationType != StandardDataType.TS_FULLDATETIME && specializationType
             != StandardDataType.TS_FULLDATEPARTTIME)
         {
             context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, System.String.Format("Invalid specializationType: {0}. Value should be one of TS.FULLDATE / TS.FULLDATETIME / TS.FULLDATEPARTTIME. TS.FULLDATETIME will be assumed."
                                                                                                                       , specializationType.Type), context.GetPropertyPath()));
         }
     }
 }
Exemple #3
0
        internal static void AssertInvalidUrlScheme(TestableAbstractValueNullFlavorPropertyFormatter <TelecommunicationAddress> formatter
                                                    , Ca.Infoway.Messagebuilder.Domainvalue.URLScheme urlScheme, FormatContext context)
        {
            TelecommunicationAddress address = new TelecommunicationAddress();

            address.UrlScheme = urlScheme;
            address.Address   = "sometext";
            formatter.GetAttributeNameValuePairsForTest(context, address, new TELImpl());
            Assert.IsFalse(context.GetModelToXmlResult().IsValid());
            Assert.AreEqual(1, context.GetModelToXmlResult().GetHl7Errors().Count);
            Assert.IsTrue(context.GetModelToXmlResult().GetHl7Errors()[0].GetMessage().Contains("Scheme " + urlScheme.CodeValue + " is not valid"
                                                                                                ), "expected message");
        }
Exemple #4
0
        public virtual void TestFormatValueNonNullWithOperatorNotAllowed()
        {
            MoR2PropertyFormatter formatter = new MoR2PropertyFormatter();
            Money         money             = new Money(new BigDecimal("12.00"), Ca.Infoway.Messagebuilder.Domainvalue.Basic.Currency.CANADIAN_DOLLAR);
            FormatContext context           = GetContext("amount");
            MOImpl        dataType          = new MOImpl(money);

            dataType.Operator = SetOperator.CONVEX_HULL;
            string result = formatter.Format(context, dataType);

            Assert.AreEqual("<amount currency=\"CAD\" value=\"12.00\"/>", result.Trim(), "something in text node");
            Assert.IsFalse(context.GetModelToXmlResult().IsValid());
            Assert.AreEqual(1, context.GetModelToXmlResult().GetHl7Errors().Count);
            Assert.IsTrue(context.GetModelToXmlResult().GetHl7Errors()[0].GetMessage().ToLower().Contains("operator"));
        }
Exemple #5
0
        private void Validate(StringBuilder buffer, int indentLevel, FormatContext context, bool hasLang, BareANY dataType)
        {
            // ST has min length of 1 according to schema, and cannot have both a NF and text
            // no details on what language strings are allowed
            ModelToXmlResult result = context.GetModelToXmlResult();

            if (dataType.HasNullFlavor())
            {
                if (dataType.BareValue != null)
                {
                    Hl7Error hl7Error = new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "ST cannot have both a nullFlavour and a text value.", context
                                                     .GetPropertyPath());
                    result.AddHl7Error(hl7Error);
                }
            }
            else
            {
                if (StringUtils.IsBlank(GetStringValue(dataType)))
                {
                    Hl7Error hl7Error = new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "ST text value must be provided.", context.GetPropertyPath
                                                         ());
                    result.AddHl7Error(hl7Error);
                }
            }
            if (hasLang && StringUtils.IsBlank(GetLanguage(dataType)))
            {
                Hl7Error hl7Error = new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "ST language attribute, if provided, can not be blank.", context
                                                 .GetPropertyPath());
                result.AddHl7Error(hl7Error);
            }
        }
Exemple #6
0
        protected override string FormatNonNullValue(FormatContext context, CodeRole codeRole, int indentLevel)
        {
            bool hasContent = (codeRole.Name != null || codeRole.Value != null);

            // validation here (limited, from schema); must have value or a NF (and if we are here, we don't have a NF)
            if (codeRole.Value == null)
            {
                context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "CR types must have the \"value\" property provided"
                                                                       , context.GetPropertyPath()));
            }
            StringBuilder buffer = new StringBuilder();

            buffer.Append(CreateElement(context, CreateAttributesMap(codeRole, context), indentLevel, !hasContent, true));
            if (hasContent)
            {
                if (codeRole.Name != null)
                {
                    buffer.Append(FormatName(context, codeRole.Name, indentLevel + 1));
                }
                if (codeRole.Value != null)
                {
                    buffer.Append(FormatValue(context, codeRole.Value, indentLevel + 1));
                }
                buffer.Append(CreateElementClosure(context.GetElementName(), indentLevel, true));
            }
            return(buffer.ToString());
        }
Exemple #7
0
 private void Validate(Int32?integer, FormatContext context, BareANY bareAny)
 {
     if (integer.Value < 0)
     {
         RecordNotNegativeError(integer, context.GetPropertyPath(), context.GetModelToXmlResult());
     }
 }
Exemple #8
0
        private void LogMandatoryError(FormatContext context)
        {
            string errorMessage = context.GetElementName() + " is a mandatory field, but no value is specified";

            context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, errorMessage, context.GetPropertyPath
                                                                       ()));
        }
Exemple #9
0
        protected virtual string FormatAllElements(FormatContext originalContext, FormatContext subContext, ICollection <BareANY>
                                                   collection, int indentLevel)
        {
            StringBuilder builder = new StringBuilder();

            ValidateCardinality(originalContext, collection);
            PropertyFormatter formatter = this.formatterRegistry.Get(subContext.Type);

            if (collection.IsEmpty())
            {
                builder.Append(formatter.Format(subContext, null, indentLevel));
            }
            else
            {
                foreach (BareANY hl7Value in EmptyIterable <object> .NullSafeIterable <BareANY>(collection))
                {
                    string type = DetermineActualType(subContext.Type, hl7Value, originalContext.GetModelToXmlResult(), originalContext.GetPropertyPath
                                                          (), originalContext.IsCda());
                    if (!StringUtils.Equals(type, subContext.Type))
                    {
                        subContext = new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl(type, true, subContext);
                        formatter  = this.formatterRegistry.Get(type);
                    }
                    builder.Append(formatter.Format(subContext, hl7Value, indentLevel));
                }
            }
            return(builder.ToString());
        }
Exemple #10
0
        private void Validate(StringBuilder buffer, int indentLevel, FormatContext context, bool isStLang, BareANY dataType)
        {
            // ST.LANG not allowed for CeRx; not checking as this should be controlled by the message set
            // is ST allowed to be 0 length or only whitespace???
            ModelToXmlResult result   = context.GetModelToXmlResult();
            string           language = GetLanguage(dataType);

            if (isStLang)
            {
                if (!STImpl.ALLOWED_LANGUAGES.Contains(language))
                {
                    Hl7Error hl7Error = new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, System.String.Format("The language attribute content ({0}) is not an allowed value. Using en-CA instead."
                                                                                                        , language), context.GetPropertyPath());
                    result.AddHl7Error(hl7Error);
                }
            }
            else
            {
                if (language != null)
                {
                    Hl7Error hl7Error = new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, System.String.Format("The language attribute ({0}) is not allowed for ST element types"
                                                                                                        , language), context.GetPropertyPath());
                    result.AddHl7Error(hl7Error);
                }
            }
        }
Exemple #11
0
 private void Validate(Int32?integer, FormatContext context, BareANY bareAny)
 {
     if (integer.Value <= 0)
     {
         RecordMustBeGreaterThanZeroError(integer, context.GetPropertyPath(), context.GetModelToXmlResult());
     }
 }
Exemple #12
0
        public virtual void TestFormatValueNull()
        {
            FormatContext context = GetContext("name");
            string        result  = new MoR2PropertyFormatter().Format(context, new MOImpl((Money)null));

            Assert.AreEqual("<name nullFlavor=\"NI\"/>", result.Trim(), "named null format");
            Assert.IsTrue(context.GetModelToXmlResult().IsValid());
        }
Exemple #13
0
        private void ValidateCardinality(FormatContext context, ICollection <BareANY> collection)
        {
            int size = collection.Count;
            int min  = (int)context.GetCardinality().Min;
            int max  = (int)context.GetCardinality().Max;

            if (size < min)
            {
                context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "Number of elements (" + size + ") is less than the specified minimum ("
                                                                       + min + ")", context.GetPropertyPath()));
            }
            if (size > max)
            {
                context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "Number of elements (" + size + ") is more than the specified maximum ("
                                                                       + max + ")", context.GetPropertyPath()));
            }
        }
Exemple #14
0
 private void ValidateDatePattern(string datePattern, FormatContext context)
 {
     string[] allowedDateFormats = TsDateFormats.GetAllDateFormats(StandardDataType.TS_DATETIME, context.GetVersion());
     if (!ArrayContains(allowedDateFormats, datePattern))
     {
         context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, System.String.Format("Unknown date format {0} supplied for value of type {1}"
                                                                                                                   , datePattern, context == null ? "TS" : context.Type), context.GetPropertyPath()));
     }
 }
Exemple #15
0
        private void ValidatePhysicalQuantity(PhysicalQuantity physicalQuantity, BareANY bareANY, FormatContext context)
        {
            string           type   = context.Type;
            ModelToXmlResult errors = context.GetModelToXmlResult();
            // nothing to validate for value, based on R2 schema
            string unitsAsString = (physicalQuantity.Unit == null ? null : physicalQuantity.Unit.CodeValue);

            this.pqValidationUtils.ValidateUnits(type, unitsAsString, null, context.GetPropertyPath(), errors, true);
        }
Exemple #16
0
        private void Validate(FormatContext context, BareANY dataType, EncapsulatedData encapsulatedData)
        {
            string         type = context.Type;
            string         specializationType = dataType.DataType == null ? null : dataType.DataType.Type;
            Hl7BaseVersion baseVersion        = context.GetVersion().GetBaseVersion();
            Hl7Errors      errors             = context.GetModelToXmlResult();

            this.edValidationUtils.DoValidate(encapsulatedData, specializationType, baseVersion, type, context.GetPropertyPath(), errors
                                              );
        }
Exemple #17
0
        public virtual void TestFormatSxcmValueNonNullWithNoOperator()
        {
            MoR2PropertyFormatter formatter = new MoR2PropertyFormatter();
            Money         money             = new Money(new BigDecimal("12.00"), Ca.Infoway.Messagebuilder.Domainvalue.Basic.Currency.CANADIAN_DOLLAR);
            FormatContext context           = GetContext("amount", "SXCM<TS>");
            MOImpl        dataType          = new MOImpl(money);
            string        result            = formatter.Format(context, dataType);

            Assert.AreEqual("<amount currency=\"CAD\" value=\"12.00\"/>", result.Trim(), "something in text node");
            Assert.IsTrue(context.GetModelToXmlResult().IsValid());
        }
Exemple #18
0
        protected sealed override string GetValue(TelecommunicationAddress uri, FormatContext context, BareANY bareAny)
        {
            string           type = context.Type;
            StandardDataType specializationType = bareAny.DataType;
            VersionNumber    version            = context.GetVersion();
            Hl7Errors        errors             = context.GetModelToXmlResult();

            TEL_VALIDATION_UTILS.ValidateTelecommunicationAddress(uri, type, specializationType.Type, version, null, context.GetPropertyPath
                                                                      (), errors);
            return(uri.ToString());
        }
Exemple #19
0
        protected override string FormatDenominator(FormatContext context, PhysicalQuantity denominator, int indentLevel)
        {
            if (denominator != null && BigDecimal.ZERO.Equals(denominator.Quantity))
            {
                context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "Denominator cannot be zero for RTO types."
                                                                       , context.GetPropertyPath()));
            }
            FormatContext newContext = new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl("PQ", Ca.Infoway.Messagebuilder.Xml.ConformanceLevel
                                                                                                                 .OPTIONAL, Cardinality.Create("0-1"), "denominator", context);

            return(this.pqFormatter.Format(newContext, new PQImpl(denominator), indentLevel));
        }
Exemple #20
0
        private void Validate(FormatContext context, BigDecimal bigDecimal)
        {
            ModelToXmlResult modelToXmlResult = context.GetModelToXmlResult();

            if (bigDecimal.CompareTo(BigDecimal.ZERO) < 0 || bigDecimal.CompareTo(BigDecimal.ONE) > 0)
            {
                RecordValueMustBeBetweenZeroAndOneError(context.GetPropertyPath(), modelToXmlResult);
            }
            if (bigDecimal.Scale() > realFormat.GetMaxDecimalPartLength())
            {
                RecordTooManyDigitsToRightOfDecimalError(context.GetPropertyPath(), modelToXmlResult);
            }
        }
Exemple #21
0
        public virtual string Format(FormatContext context, BareANY dataType, int indentLevel)
        {
            if (dataType == null)
            {
                return(string.Empty);
            }
            HandleConstraints(context.GetConstraints(), context.GetModelToXmlResult(), context.GetPropertyPath(), (DateInterval)dataType
                              .BareValue);
            FormatContext newContext  = ConvertContext(context);
            BareANY       newDataType = ConvertDataType(dataType);

            return(this.r1Formatter.Format(newContext, newDataType, indentLevel));
        }
Exemple #22
0
        private void ValidateDatePattern(string datePattern, FormatContext context)
        {
            StandardDataType standardDataType = StandardDataType.GetByTypeName(context);
            VersionNumber    version          = (context == null ? null : context.GetVersion());

            string[] allowedDateFormats = TsDateFormats.GetAllDateFormats(standardDataType, version);
            if (!ArrayContains(allowedDateFormats, datePattern))
            {
                Hl7Error hl7Error = new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, System.String.Format("Invalid date format {0} supplied for value of type {1}"
                                                                                                    , datePattern, context == null ? "TS" : context.Type), context.GetPropertyPath());
                context.GetModelToXmlResult().AddHl7Error(hl7Error);
            }
        }
Exemple #23
0
 public override string Format(FormatContext context, BareANY hl7Value, int indentLevel)
 {
     // if type is BN then NFs are not allowed
     if (StringUtils.Equals(context.Type, StandardDataType.BN.Type))
     {
         if (hl7Value == null || hl7Value.BareValue == null || hl7Value.HasNullFlavor())
         {
             context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.MANDATORY_FIELD_NOT_PROVIDED, "BN can not be null or have a nullFlavor"
                                                                    , context.GetPropertyPath()));
         }
     }
     return(base.Format(context, hl7Value, indentLevel));
 }
Exemple #24
0
        protected override string FormatNonNullValue(FormatContext context, CodedString <Code> value, int indentLevel)
        {
            bool codeProvided       = value.Code == null ? false : StringUtils.IsNotBlank(value.Code.CodeValue);
            bool codeSystemProvided = value.Code == null ? false : StringUtils.IsNotBlank(value.Code.CodeSystem);

            this.codedStringValidationUtils.ValidateCodedString(value, codeProvided, codeSystemProvided, null, context.GetPropertyPath
                                                                    (), context.GetModelToXmlResult());
            StringBuilder buffer = new StringBuilder();

            buffer.Append(CreateElement(context, GetAttributeNameValuePairs(value), indentLevel, false, false));
            buffer.Append(XmlStringEscape.Escape(value.Value));
            buffer.Append(CreateElementClosure(context, 0, true));
            return(buffer.ToString());
        }
Exemple #25
0
        private void ValidatePhysicalQuantity(FormatContext context, PhysicalQuantity physicalQuantity, BareANY bareANY)
        {
            // does not validate originalText here as this section is bypassed when value is a NullFlavor
            string           type             = context.Type;
            ModelToXmlResult errors           = context.GetModelToXmlResult();
            bool             hasNullFlavor    = (bareANY == null || bareANY.NullFlavor != null);
            string           quantityAsString = physicalQuantity.Quantity == null ? null : physicalQuantity.Quantity.ToPlainString();

            this.pqValidationUtils.ValidateValue(quantityAsString, context.GetVersion(), type, hasNullFlavor, null, context.GetPropertyPath
                                                     (), errors);
            string unitsAsString = (physicalQuantity.Unit == null ? null : physicalQuantity.Unit.CodeValue);

            this.pqValidationUtils.ValidateUnits(type, unitsAsString, null, context.GetPropertyPath(), errors, false);
        }
Exemple #26
0
        /// <exception cref="System.Exception"></exception>
        internal static void AssertValidUrlScheme(TestableAbstractValueNullFlavorPropertyFormatter <TelecommunicationAddress> formatter
                                                  , Ca.Infoway.Messagebuilder.Domainvalue.URLScheme urlScheme, FormatContext context, string expected)
        {
            TelecommunicationAddress address = new TelecommunicationAddress();

            address.UrlScheme = urlScheme;
            address.Address   = "someAddress";
            IDictionary <string, string> result = formatter.GetAttributeNameValuePairsForTest(context, address, new TELImpl());

            Assert.IsTrue(context.GetModelToXmlResult().IsValid());
            Assert.AreEqual(1, result.Count, "map size");
            Assert.IsTrue(result.ContainsKey("value"), "key as expected");
            Assert.AreEqual(expected + address.Address, result.SafeGet("value"), "value as expected");
        }
Exemple #27
0
		private void Validate(FormatContext context, BigDecimal bigDecimal)
		{
			ModelToXmlResult modelToXmlResult = context.GetModelToXmlResult();
			string value = bigDecimal.ToString();
			string integerPart = value.Contains(".") ? StringUtils.SubstringBefore(value, ".") : value;
			string decimalPart = value.Contains(".") ? StringUtils.SubstringAfter(value, ".") : string.Empty;
			if (integerPart.Length > realFormat.GetMaxIntegerPartLength())
			{
				RecordTooManyCharactersToLeftOfDecimalError(context.GetPropertyPath(), modelToXmlResult);
			}
			if (decimalPart.Length > realFormat.GetMaxDecimalPartLength())
			{
				RecordTooManyDigitsToRightOfDecimalError(context.GetPropertyPath(), modelToXmlResult);
			}
		}
Exemple #28
0
 private void HandleConstraints(string type, ConstrainedDatatype constraints, BareANY hl7Value, ICollection <BareANY> bareAnyCollection
                                , FormatContext context)
 {
     IiCollectionConstraintHandler.ConstraintResult constraintResult = this.constraintHandler.CheckConstraints(type, constraints
                                                                                                               , bareAnyCollection);
     if (constraintResult != null && !constraintResult.IsFoundMatch())
     {
         // there should be a match, but if not we need to create an II with the appropriate values and add to collection
         Identifier identifier = constraintResult.GetIdentifer();
         //In Java these are really the same collection due to type erasure. In .NET we need two different collections.
         ICollection <II> iiCollection = (ICollection <II>)hl7Value.BareValue;
         iiCollection.Add(new IIImpl(identifier));
         context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.CDA_FIXED_CONSTRAINT_PROVIDED, ErrorLevel.INFO, "A fixed constraint was added for compliance: "
                                                                + identifier, context.GetPropertyPath()));
     }
 }
Exemple #29
0
        protected override string FormatNonNullValue(FormatContext context, BareRatio value, int indentLevel)
        {
            StringBuilder buffer = new StringBuilder();

            buffer.Append(CreateElement(context, null, indentLevel, false, true));
            T bareNumerator   = (T)value.BareNumerator;
            U bareDenominator = (U)value.BareDenominator;

            if (bareNumerator == null || bareDenominator == null)
            {
                context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "Numerator and denominator must be non-null; both are mandatory for Ratio types."
                                                                       , context.GetPropertyPath()));
            }
            buffer.Append(FormatNumerator(context, bareNumerator, indentLevel + 1));
            buffer.Append(FormatDenominator(context, bareDenominator, indentLevel + 1));
            buffer.Append(CreateElementClosure(context.GetElementName(), indentLevel, true));
            return(buffer.ToString());
        }
Exemple #30
0
        protected override string FormatNonNullValue(FormatContext context, UncertainRange <PlatformDate> value, int indentLevel)
        {
            // convert URG to an IVL and use IVL formatter
            Interval <PlatformDate> convertedInterval = IntervalFactory.CreateFromUncertainRange(value);
            IVLImpl <TS, Interval <PlatformDate> > convertedHl7Interval = new IVLImpl <TS, Interval <PlatformDate> >(convertedInterval);
            FormatContext ivlContext = new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl(context.Type.Replace
                                                                                                                     ("URG", "IVL"), context.IsSpecializationType(), context);
            string xml = this.formatter.Format(ivlContext, convertedHl7Interval, indentLevel);

            xml = ChangeAnyIvlRemnants(xml);
            // inclusive attributes not allowed for URG<TS>
            if (value.LowInclusive != null || value.HighInclusive != null)
            {
                context.GetModelToXmlResult().AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "High/Low inclusive fields should not be set; these attributes are not allowed for "
                                                                       + context.Type + " types", context.GetPropertyPath()));
            }
            return(xml);
        }