private void AppendUseablePeriod(StringBuilder buffer, PlatformDate date, SetOperator @operator, int indentLevel, FormatContext outerContext) { FormatContext context = new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl("SXCM<TS>", "useablePeriod" , outerContext); MbDate mbDate = (date == null ? null : new MbDate(date)); TS_R2 tsAny = new TS_R2Impl(mbDate, @operator); buffer.Append(this.tsFormatter.Format(context, tsAny, indentLevel)); }
private void AppendUseablePeriods(TelecommunicationAddress value, StringBuilder buffer, int indentLevel, FormatContext context ) { Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl tsFormatContext = new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl ("SXCM<TS>", context); IDictionary <PlatformDate, SetOperator> useablePeriods = value.UseablePeriods; foreach (PlatformDate period in useablePeriods.Keys) { MbDate mbDate = new MbDate(period); TS_R2 ts = new TS_R2Impl(mbDate, useablePeriods.SafeGet(period)); IDictionary <string, string> attributes = new TelR2PropertyFormatter.TsR2PropertyFormatterVisible().GetAttributeNameValuePairsVisible (tsFormatContext, mbDate, ts); buffer.Append(CreateElement("useablePeriod", attributes, indentLevel, true, true)); } }
public virtual void TestSxcmGetAttributeNameValuePairsDateWithNoOperator() { // used as expected: a date object is passed in PlatformDate calendar1 = DateUtil.GetDate(1999, 3, 23, 10, 11, 12, 0); TS_R2 ts = new TS_R2Impl(new MbDate(calendar1)); ModelToXmlResult xmlResult = new ModelToXmlResult(); IDictionary <string, string> result = new TsR2PropertyFormatterTest.TestableTsR2PropertyFormatter().GetAttributeNameValuePairsForTest (new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl(xmlResult, null, "name", "SXCM<TS>", null, null , false, SpecificationVersion.R02_04_02, null, null, null, false), new MbDate(calendar1), ts); Assert.AreEqual(1, result.Count, "map size"); Assert.IsTrue(xmlResult.IsValid()); Assert.IsTrue(result.ContainsKey("value"), "key as expected"); string expectedValue = "19990423101112.0000" + GetCurrentTimeZone(calendar1); Assert.AreEqual(expectedValue, result.SafeGet("value"), "value as expected"); }