public PeriodicIntervalTimeR2(Interval <PlatformDate> phase, PhysicalQuantity period, CalendarCycle alignment, Boolean?institutionSpecified, Int32?frequencyRepetitions, PhysicalQuantity frequencyQuantity) { Phase = phase; Period = period; Alignment = alignment; InstitutionSpecified = institutionSpecified; FrequencyRepetitions = frequencyRepetitions; FrequencyQuantity = frequencyQuantity; }
/// <exception cref="Ca.Infoway.Messagebuilder.Marshalling.HL7.XmlToModelTransformationException"></exception> protected override PeriodicIntervalTimeR2 ParseNonNullNode(ParseContext context, XmlNode node, BareANY result, Type expectedReturnType , XmlToModelResult xmlToModelResult) { XmlElement periodElement = (XmlElement)GetNamedChildNode(node, "period"); PhysicalQuantity period = CreatePeriodType(context, periodElement, xmlToModelResult); XmlElement phaseElement = (XmlElement)GetNamedChildNode(node, "phase"); Interval <PlatformDate> phase = CreatePhaseType(context, phaseElement, xmlToModelResult); CalendarCycle alignment = ObtainAlignment(context, (XmlElement)node, xmlToModelResult); bool institutionSpecified = ObtainInstitutionSpecified(context, (XmlElement)node, xmlToModelResult); return(new PeriodicIntervalTimeR2(phase, period, alignment, institutionSpecified, null, null)); }
private CalendarCycle ObtainAlignment(ParseContext context, XmlElement element, XmlToModelResult xmlToModelResult) { CalendarCycle alignment = null; if (element.HasAttribute("alignment")) { string alignmentString = element.GetAttribute("alignment"); foreach (CalendarCycle calendarCycle in EnumPattern.Values <CalendarCycle>()) { if (StringUtils.Equals(calendarCycle.CalendarCycleCode, alignmentString)) { alignment = calendarCycle; break; } } if (alignment == null) { xmlToModelResult.AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "Alignment attribute is not a valid CalendarCycle value. Value found: \"" + alignmentString + "\"", element)); } } return(alignment); }