public void GTSTestXsiOutputIVL_TS_Test() { // Constrct a GTS GTS test = new IVL<TS>(DateTime.Today, DateTime.Now); String xml = R1SerializationHelper.SerializeAsString(test, Formatters.XML.Datatypes.R1.DatatypeFormatterCompatibilityMode.ClinicalDocumentArchitecture); Assert.IsTrue(xml.Contains("xsi:type=\"IVL_TS\"")); }
public p_author_000081(TS authorTime) : base() { typeCode = "AUT"; contextControlCode = "OP"; functionCode = new CV<string>("OA", "2.16.840.1.113883.2.1.3.2.4.17.178", null, null, "Originating Author", null); functionCode.OriginalText = null; time = new IVL<TS>(authorTime); }
internal static IVL <TS> CreateIVLTS(UseContext context) { Tracer.Trace("Creating IVL<TS>", context); IVL <TS> result = new IVL <TS>(); result.Low = CreateTS(context); result.High = CreateTS(context).DateValue.AddDays(1); return(result); }
internal static IVL <PQ> CreateIVLPQ(UseContext context) { Tracer.Trace("Creating IVL<PQ>", context); IVL <PQ> result = new IVL <PQ>(); result.Low = new PQ((decimal)1, "d"); result.High = new PQ((decimal)3, "d"); return(result); }
public TriggerEvent() { this.id = new IIImpl(); this.code = new CVImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.reasonCode = new CVImpl(); this.languageCode = new CEImpl(); this.queryContinuationQueryId = new IIImpl(); this.queryContinuationStartResultNumber = new INTImpl(); this.queryContinuationContinuationQuantity = new INTImpl(); }
public OtherMedication() { this.id = new IIImpl(); this.code = new CDImpl(); this.statusCode = new CSImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.confidentialityCode = new CVImpl(); this.routeCode = new CVImpl(); this.subjectOf1DetectedIssueIndicator = new BLImpl(false); this.subjectOf2AnnotationIndicator = new BLImpl(false); }
public BillableClinicalService() { this.moodCode = new CSImpl(); this.id = new IIImpl(); this.code = new CVImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.reasonCode = new SETImpl <CV, Code>(typeof(CVImpl)); this.productManufacturedProduct = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Claims.Coct_mt290000ca.ManufacturedProduct>(); this.pertinentInformation1 = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Claims.Coct_mt290000ca.AccidentInformation>(); this.pertinentInformation3 = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Claims.Merged.DiagnosisInformation>(); }
public TriggerEvent() { this.id = new IIImpl(); this.code = new CVImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.reasonCode = new CVImpl(); this.languageCode = new CEImpl(); this.subject = new List <Ca.Infoway.Messagebuilder.Model.Ab_r02_04_03_imm.Common.Merged.RefersTo <ACT> >(); this.subjectOf1DetectedIssueEvent = new List <Ca.Infoway.Messagebuilder.Model.Ab_r02_04_03_imm.Common.Coct_mt260022ca.Issues>(); this.componentOfPatientCareProvisionEvent = new List <Ca.Infoway.Messagebuilder.Model.Ab_r02_04_03_imm.Common.Coct_mt011001ca.CareCompositions>(); }
public void IVLNULLNullflavorHighLowIncludedHighIncludedWidthValidationTest() { IVL <INT> ivl = new IVL <INT>(); ivl.NullFlavor = null; ivl.High = null; ivl.LowClosed = null; ivl.HighClosed = null; ivl.Width = null; Assert.IsFalse(ivl.Validate()); }
public HealthCondition() { this.code = new CVImpl(); this.negationInd = new BLImpl(); this.statusCode = new CSImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.confidentialityCode = new SETImpl <CV, Code>(typeof(CVImpl)); this.value = new CDImpl(); this.predecessorOldCondition = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Iehr.Merged.OldCondition>(); this.componentOfPatientCareProvisionEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Common.Coct_mt011001ca.CareCompositions>(); }
public ParameterList() { this.administrationEffectivePeriodValue = new IVLImpl <TS, Interval <PlatformDate> >(); this.amendedInTimeRangeValue = new IVLImpl <TS, Interval <PlatformDate> >(); this.careCompositionIDValue = new List <II>(); this.careCompositionTypeValue = new List <CV>(); this.includeIssuesIndicatorValue = new BLImpl(); this.includeNotesIndicatorValue = new BLImpl(); this.issueFilterCodeValue = new CVImpl(); this.otherMedicationRecordIdValue = new IIImpl(); }
public ImmunizationCandidateQueryParameters() { this.immunizationPeriodValue = new IVLImpl <TS, Interval <PlatformDate> >(); this.patientBirthDateValue = new IVLImpl <TS, Interval <PlatformDate> >(); this.patientGenderValue = new CVImpl(); this.patientID = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Immunization.Poiz_mt061140ca.PatientID>(); this.patientNameValue = new PNImpl(); this.postalCodeValue = new STImpl(); this.serviceDeliveryLocationValue = new List <II>(); this.vaccineCodeValue = new CVImpl(); }
public CareComposition() { this.code = new CVImpl(); this.statusCode = new CSImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.outcomeDiagnosisEvent = new List <Ca.Infoway.Messagebuilder.Model.Ab_r02_04_03_shr.Common.Merged.DischargeDiagnosis>(); this.reasonIndications = new List <Ca.Infoway.Messagebuilder.Model.Ab_r02_04_03_shr.Common.Coct_mt120402ca.IIndications>(); this.componentActEvent = new List <Ca.Infoway.Messagebuilder.Model.Ab_r02_04_03_shr.Common.Merged.ActEvent>(); this.subjectOfAnnotation = new List <Ca.Infoway.Messagebuilder.Model.Ab_r02_04_03_shr.Common.Coct_mt120600ab.Notes>(); this.componentOfPatientCareProvisionEvent = new List <Ca.Infoway.Messagebuilder.Model.Ab_r02_04_03_shr.Common.Coct_mt011001ca.CareCompositions>(); }
public ParameterList() { this.administrationEffectivePeriodValue = new IVLImpl <TS, Interval <PlatformDate> >(); this.issueFilterCodeValue = new CVImpl(); this.mostRecentByDrugIndicatorValue = new BLImpl(); this.mostRecentDispenseForEachRxIndicatorValue = new BLImpl(); this.patientBirthDateValue = new TSImpl(); this.patientGenderValue = new CVImpl(); this.patientIDValue = new IIImpl(); this.patientNameValue = new PNImpl(); }
public GenericQueryParameters() { this.issueFilterCodeValue = new CVImpl(); this.mostRecentByDeviceIndicatorValue = new BLImpl(); this.mostRecentDispenseForEachRxIndicatorValue = new BLImpl(); this.patientBirthDateValue = new TSImpl(); this.patientGenderValue = new CVImpl(); this.patientIDValue = new IIImpl(); this.patientNameValue = new PNImpl(); this.usageEffectivePeriodValue = new IVLImpl <TS, Interval <PlatformDate> >(); }
public Sender() { this.telecom = new TELImpl(); this.deviceId = new IIImpl(); this.deviceName = new STImpl(); this.deviceDesc = new STImpl(); this.deviceExistenceTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.deviceManufacturerModelName = new STImpl(); this.deviceSoftwareName = new STImpl(); this.deviceAgentAgentOrganizationId = new IIImpl(); }
public DrugPrescriptionDetailQueryParameters() { this.amendedInTimeRangeValue = new IVLImpl <TS, Interval <PlatformDate> >(); this.careCompositionIDValue = new List <II>(); this.careCompositionTypeValue = new List <CV>(); this.includeEventHistoryIndicatorValue = new BLImpl(); this.includeIssuesIndicatorValue = new BLImpl(); this.includeNotesIndicatorValue = new BLImpl(); this.includePendingChangesIndicatorValue = new BLImpl(); this.prescriptionOrderNumberValue = new IIImpl(); }
public void IVLValidationNULLNullflavorLowLowIncludedHighIncludedPOPHighWidthTest() { IVL <INT> ivl = new IVL <INT>(); ivl.NullFlavor = null; ivl.Low = null; ivl.LowClosed = null; ivl.HighClosed = null; ivl.High = 10; ivl.Width = 5; Assert.IsTrue(ivl.Validate()); }//Should validate
public AllergyIntoleranceQueryParameters() { this.allergyIntoleranceStatusValue = new CVImpl(); this.allergyIntoleranceTypeValue = new CDImpl(); this.alllergyIntoleranceChangePeriodValue = new IVLImpl <TS, Interval <PlatformDate> >(); this.includeNotesIndicatorValue = new BLImpl(); this.patientBirthDateValue = new TSImpl(); this.patientGenderValue = new CVImpl(); this.patientIDValue = new IIImpl(); this.patientNameValue = new PNImpl(); this.reactionTypeValue = new CVImpl(); }
public ProfessionalService() { this.code = new CDImpl(); this.negationInd = new BLImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.confidentialityCode = new SETImpl <CV, Code>(typeof(CVImpl)); this.performerActingPerson = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Common.Coct_mt911108ca.IActingPerson>(); this.definitionActDefinition = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Iehr.Merged.ActDefinition>(); this.predecessorOldProcedureEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Iehr.Merged.OldProcedureEvent>(); this.reason = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Merged.BecauseOf>(); this.componentOfPatientCareProvisionEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Common.Coct_mt011001ca.CareCompositions>(); }
public HealthcareProvider() { this.id = new SETImpl <II, Identifier>(typeof(IIImpl)); this.code = new CVImpl(); this.name = new LISTImpl <PN, PersonName>(typeof(PNImpl)); this.addr = new LISTImpl <AD, PostalAddress>(typeof(ADImpl)); this.telecom = new LISTImpl <TEL, TelecommunicationAddress>(typeof(TELImpl)); this.statusCode = new CSImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.responsibleForPrivilege = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Pr.Merged.Privilege>(); this.relatedTo = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Pr.Prpm_mt301010ca.RelatedTo>(); }
public SpecialAuthorizationRequest() { this.id = new IIImpl(); this.code = new CVImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.priorityCode = new CVImpl(); this.confidentialityCode = new SETImpl <CV, Code>(typeof(CVImpl)); this.supportSpecialAuthorizationCriteria = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Claims.Ficr_mt490102ca.SpecialAuthorizationCriteria>(); this.subject2 = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Merged.Subject5>(); this.pertinentInformationHealthDocumentAttachment = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Claims.Ficr_mt490102ca.HealthDocumentAttachment>(); this.subjectOf = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Merged.Includes>(); }
public void BoundIVLTest04() { IVL <TS> janStartHigh = new IVL <TS>() { High = new TS(new DateTime(2012, 01, 30), DatePrecision.Day) }; var janStart = janStartHigh.ToBoundIVL(); janStart.NullFlavor = null; Console.WriteLine("{{ {0}...{1} }}", janStart.Low, janStart.High); Assert.IsTrue(janStart.Validate()); }
public Dispense() { this.code = new CVImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.repeatNumber = new INTImpl(); this.quantity = new PQImpl(); this.expectedUseTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.id = new IIImpl(); this.statusCode = new CSImpl(); this.confidentialityCode = new SETImpl <CV, Code>(typeof(CVImpl)); this.inFulfillmentOfSubstanceAdministrationEventId = new SETImpl <II, Identifier>(typeof(IIImpl)); }
public ReportedReaction() { this.id = new IIImpl(); this.code = new CDImpl(); this.text = new STImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.confidentialityCode = new CVImpl(); this.value = new CVImpl(); this.subjectOf1Annotation = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_3.Common.Coct_mt120600ca.Notes>(); this.subjectOf2AnnotationIndicator = new BLImpl(false); this.subjectOf3CausalityAssessment = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_3.Iehr.Merged.ReactionAssessments>(); }
public void ConstructingIVLTest03() { // Using high/width IVL <TS> janStartHigh = new IVL <TS>() { Width = new PQ(15, "d"), High = new TS(new DateTime(2012, 01, 05), DatePrecision.Day) }; janStartHigh.NullFlavor = null; Assert.IsTrue(janStartHigh.Validate()); }
public void ConstructingIVLTest02() { // Using low/width IVL <TS> janStartLow = new IVL <TS>() { Low = new TS(new DateTime(2012, 01, 01), DatePrecision.Day), Width = new PQ(15, "d") }; janStartLow.NullFlavor = null; Assert.IsTrue(janStartLow.Validate()); }
public void ConstructingIVLTest04() { // Using low IVL <TS> janStart = new IVL <TS>() { Low = new TS(new DateTime(2012, 01, 05), DatePrecision.Day), High = new TS(new DateTime(2012, 01, 05), DatePrecision.Day) }; janStart.NullFlavor = NullFlavor.Unknown; Assert.IsFalse(janStart.Validate()); }
public void ConstructingIVLTest05() { // Using low IVL <TS> janStart = new IVL <TS>() { LowClosed = true, //Low = new TS(new DateTime(2012, 01, 05), DatePrecision.Day), High = new TS(new DateTime(2012, 01, 05), DatePrecision.Day) }; Assert.IsFalse(janStart.Validate()); }
public MedicalCondition() { this.id = new IIImpl(); this.code = new CDImpl(); this.statusCode = new CSImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.confidentialityCode = new CVImpl(); this.value = new CVImpl(); this.subjectOf1AnnotationIndicator = new BLImpl(false); this.subjectOf2Annotation = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cerx_v01_r04_3.Common.Coct_mt120600ca.Notes>(); this.subjectOf3ChronicIndicator = new BLImpl(false); }
public AdministrationInstructions() { this.moodCode = new CSImpl(); this.code = new CDImpl(); this.text = new STImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.approachSiteCode = new SETImpl <CV, Code>(typeof(CVImpl)); this.routeCode = new CVImpl(); this.maxDoseQuantity = new SETImpl <RTO <PhysicalQuantity, PhysicalQuantity>, Ratio <PhysicalQuantity, PhysicalQuantity> >(typeof(RTOImpl <PhysicalQuantity, PhysicalQuantity>)); this.administrationUnitCode = new CVImpl(); this.component2 = new List <Ca.Infoway.Messagebuilder.Model.Ab_r02_04_03.Common.Coct_mt270010ca.ConsistsOf>(); }
public OtherMedication() { this.id = new SETImpl <II, Identifier>(typeof(IIImpl)); this.code = new CDImpl(); this.statusCode = new CSImpl(); this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.confidentialityCode = new SETImpl <CV, Code>(typeof(CVImpl)); this.routeCode = new CVImpl(); this.subjectOf1DetectedIssueIndicator = new BLImpl(false); this.subjectOf2AnnotationIndicator = new BLImpl(false); this.componentOfPatientCareProvisionEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Common.Coct_mt011001ca.CareCompositions>(); }
public void IVL_TS_FullSerializationTest() { IVL<TS> origin = new IVL<TS>((TS)"20080102"); origin.Low = (TS)"20080101"; origin.High = (TS)"20080103"; // Serialize String expected = "<test value=\"20080102\" xmlns=\"urn:hl7-org:v3\"><low value=\"20080101\"/><high value=\"20080103\"/></test>"; String actual = R1SerializationHelper.SerializeAsString(origin); R2SerializationHelper.XmlIsEquivalent(expected, actual); }
public void IVLINTNotContainsExceptionTest() { IVL<INT> container = new IVL<INT>(1, null); container.Width = new PQ(1, "ft"); try { container.Contains(9); Assert.IsTrue(false); } catch (InvalidOperationException) { Assert.IsTrue(true); } catch (Exception) { Assert.IsTrue(false); } }
public void BoundIVLTest07() { IVL<TS> janStartLow = new IVL<TS>() { Low = new TS(new DateTime(2012, 01, 01), DatePrecision.Day), High = new TS(new DateTime(2012, 01, 15), DatePrecision.Day) }; var janStart = janStartLow.ToBoundIVL(); janStart.NullFlavor =null; Console.WriteLine("{{ {0}...{1} }}", janStart.Low, janStart.High); Assert.IsTrue(janStart.Validate()); }
public void SXCMValueTest1() { SXCM<TEL> sxcm = new IVL<TEL>(); sxcm.Value = "HOLA"; Assert.IsTrue(sxcm.Validate()); }
public void BoundIVLTest06() { IVL<TS> janStartW = new IVL<TS>() { Width = new PQ(14, "d") }; try { var janStart = janStartW.ToBoundIVL(); janStart.NullFlavor = NullFlavor.Unknown; Assert.IsFalse(janStart.Validate()); } catch (Exception e) { Console.WriteLine(e); } }
public void IVLIsSemanticEqualsTest() { SET<INT> ints = new SET<INT>() { 1, 2, 4, 6 }; IVL<INT> range = new IVL<INT>(0, 7); }
public void SXCMNullValueTest() { SXCM<TEL> sxcm = new IVL<TEL>(); sxcm.Value = null; Assert.IsFalse(sxcm.Validate()); }
public void IVLTSNotContainsWidthTest() { // Create an IVL starting on 20000101 IVL<TS> container = new IVL<TS>(DateTime.Parse("2000-01-01"), null); container.Width = new PQ(1, "a"); Assert.IsFalse(container.Contains(DateTime.Parse("2002-05-22"))); }
public void IVLINTContainsTest() { IVL<INT> container = new IVL<INT>(1, 10); Assert.IsTrue(container.Contains(9)); }
public void IVLValidationNULLHighLowIncludedHighIncludedWidthPOPNullflavorLowTest() { IVL<INT> ivl = new IVL<INT>(); ivl.High = null; ivl.LowClosed = null; ivl.HighClosed = null; ivl.Width = null; ivl.Low = 0; ivl.NullFlavor = NullFlavor.NotAsked; Assert.IsFalse(ivl.Validate()); }
public void IVLValidationNULLNullflavorLowLowIncludedHighIncludedPOPHighWidthTest() { IVL<INT> ivl = new IVL<INT>(); ivl.NullFlavor = null; ivl.Low = null; ivl.LowClosed = null; ivl.HighClosed = null; ivl.High = 10; ivl.Width = 5; Assert.IsTrue(ivl.Validate()); }//Should validate
public void IVLINTNotContainsTest() { IVL<INT> container = new IVL<INT>(1, 10); Assert.IsFalse(container.Contains(90)); }
public void GTSIVLCTORTest() { // interval from May 1, 2010 to May 10, 2010 IVL<TS> tenDays = new IVL<TS>(DateTime.Parse("2010/05/1"), DateTime.Parse("2010/05/10")); GTS gtsInstance = new GTS(tenDays); Assert.AreEqual(typeof(IVL<TS>), gtsInstance.Hull.GetType()); }
public void PIVLExamplesTest01() { // Represents an interval of time from 9am-5pm IVL<TS> nineToFiveIVL = new IVL<TS> ( // create new lower boundary timestamp (9am) new TS (new DateTime(2011, 01, 01, 09, 00, 00), DatePrecision.Minute), // create new upper boundary timestamp (5pm) new TS(new DateTime(2011, 01, 01, 17, 00, 00), DatePrecision.Minute) ); // create new period interval PIVL<TS> nineToFiveEveryDay = new PIVL<TS> ( nineToFiveIVL, // specify interval (9am-5pm) new PQ(1, "d") // specify frequency (once per day) ); nineToFiveEveryDay.NullFlavor = null; Assert.IsTrue(nineToFiveEveryDay.Validate()); }
public void PIVLExamplesTest03() { // Represents an interval of time from 9am-5pm IVL<TS> nineToFiveIVL = new IVL<TS> ( new TS(new DateTime(2011, 01, 01, 09, 00, 00), DatePrecision.Minute), new TS(new DateTime(2011, 01, 01, 17, 00, 00), DatePrecision.Minute) ); // create empty period interval (no interval or frequency) PIVL<TS> nineToFiveEveryDay = new PIVL<TS>(); nineToFiveEveryDay.NullFlavor = NullFlavor.Other; Assert.IsTrue(nineToFiveEveryDay.Validate()); }
public void PIVLExamplesTest02() { // Represents an interval of time from 9am-5pm IVL<TS> nineToFiveIVL = new IVL<TS> ( new TS(new DateTime(2011, 01, 01, 09, 00, 00), DatePrecision.Minute), new TS(new DateTime(2011, 01, 01, 17, 00, 00), DatePrecision.Minute) ); PIVL<TS> nineToFiveEveryDay = new PIVL<TS> ( nineToFiveIVL, new PQ(1, "d") ); nineToFiveEveryDay.NullFlavor = NullFlavor.Other; Assert.IsFalse(nineToFiveEveryDay.Validate()); }
public void IVLPQNotContainsTest() { IVL<PQ> ageRange = new IVL<PQ>( new PQ(1, "a"), new PQ(3, "a") ); Assert.IsTrue(ageRange.Contains(new PQ(24,"mo"))); }
public void IvlToSetTest01() { IVL<INT> interval = new IVL<INT>(1, 10) { HighClosed = true }; foreach (var i in interval.ToSet()) Console.WriteLine(i); interval.NullFlavor = null; Assert.IsTrue(interval.Validate()); }
public void IVLTSNotContainsTest() { IVL<TS> container = new IVL<TS>(DateTime.MinValue, DateTime.Now); Assert.IsFalse(container.Contains(DateTime.MaxValue)); }
public void BoundIVLTest02() { IVL<TS> janStartHigh = new IVL<TS>() { Width = new PQ(14, "d"), High = new TS(new DateTime(2012, 01, 30), DatePrecision.Day), }; var janStart = janStartHigh.ToBoundIVL(); janStart.NullFlavor = null; Console.WriteLine("{{ {0}...{1} }}", janStart.Low, janStart.High); // output is: {20120116...20120130} Assert.IsTrue(janStart.Validate()); }
public void IVLLowHighTranslationTest() { IVL<TS> start = new IVL<TS>(DateTime.Parse("2001-01-01"), DateTime.Parse("2002-01-01")); var translated = start.Translate(new PQ(1, "a")); Assert.AreEqual(2002, translated.Low.DateValue.Year); Assert.AreEqual(2003, translated.High.DateValue.Year); }
public void BoundIVLTest03() { IVL<TS> janStartHigh = new IVL<TS>() { Width = new PQ(14, "d"), High = new TS(new DateTime(2012, 01, 30), DatePrecision.Day), }; var janStart = janStartHigh.ToBoundIVL(); janStart.NullFlavor = NullFlavor.Other; Console.WriteLine("{{ {0}...{1} }}", janStart.Low, janStart.High); Assert.IsFalse(janStart.Validate()); }
public void IVL_ContainsTest05() { // Create an instance of IVL IVL<PQ> acceptableRange = new IVL<PQ>( new PQ(0, "L"), new PQ(10, "L") ) { LowClosed = true, HighClosed = true }; // Since we need to convert PQ units, add a unit converter PQ.UnitConverters.Add(new SimpleSiUnitConverter()); PQ test = new PQ(10, "m"); try { // Determine if the value is in range (true) bool isInRange = acceptableRange.Contains(test); acceptableRange.NullFlavor = NullFlavor.NoInformation; Assert.IsFalse(isInRange); } catch (Exception e) { Assert.IsTrue(e.ToString().Contains("Units must match to compare PQ")); } }
public void EIVLValidEIVL() { // Offset of 1d IVL<PQ> effectiveTime = new IVL<PQ>() { High = new PQ(1, "d") }; // Event is BeforeLunch CS<DomainTimingEventType> event1 = new CS<DomainTimingEventType>(DomainTimingEventType.BeforeLunch); // Create EIVL instance and pass it the effective Time and event EIVL<TS> eivlInstance = new EIVL<TS>(); //eivlInstance.Offset = effectiveTime; eivlInstance.Event = event1; // true if it validates Assert.IsTrue(eivlInstance.Validate()); }
public void IVLInclusiveFormattingTest() { IVL<INT> intIvl = new IVL<INT>(1, 4); intIvl.LowClosed = true; intIvl.HighClosed = false; MemoryStream ms = new MemoryStream(); XmlStateWriter writer = new XmlStateWriter(XmlWriter.Create(ms)); writer.WriteStartElement("ivl", "urn:hl7-org:v3"); MARC.Everest.Formatters.XML.Datatypes.R1.DatatypeFormatter fmtr = new MARC.Everest.Formatters.XML.Datatypes.R1.DatatypeFormatter(); fmtr.Graph(writer, intIvl); writer.Close(); ms.Seek(0, SeekOrigin.Begin); XmlDocument d = new XmlDocument(); d.Load(ms); Tracer.Trace(d.OuterXml); Assert.IsTrue(d.OuterXml.Contains("inclusive")); }
public void IVL_ContainsTest01() { // Create an instance of IVL IVL<PQ> acceptableRange = new IVL<PQ>( new PQ(0, "L"), new PQ(10, "L") ) { LowClosed = true, HighClosed = true }; // Since we need to convert PQ units, add a unit converter PQ.UnitConverters.Add(new SimpleSiUnitConverter()); PQ test = new PQ(9, "L"); // Determine if the value is in range (true) bool isInRange = acceptableRange.Contains(test); acceptableRange.NullFlavor = NullFlavor.NoInformation; Assert.IsTrue(isInRange); }
public void IVLNULLNullflavorHighLowIncludedHighIncludedWidthValidationTest() { IVL<INT> ivl = new IVL<INT>(); ivl.NullFlavor = null; ivl.High = null; ivl.LowClosed = null; ivl.HighClosed = null; ivl.Width = null; Assert.IsFalse(ivl.Validate()); }
public void BoundIVLTest01() { IVL<TS> janStartLow = new IVL<TS>() { Low = new TS(new DateTime(2012, 01, 01), DatePrecision.Day), Width = new PQ(14, "d") }; var janStart = janStartLow.ToBoundIVL(); janStart.NullFlavor = null; Console.WriteLine("{{ {0}...{1} }}",janStart.Low,janStart.High); Assert.IsTrue(janStart.Validate()); // output is: {20120101...20120115} }