Exemplo n.º 1
0
 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\""));
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 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();
 }
Exemplo n.º 6
0
 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);
 }
Exemplo n.º 7
0
 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>();
 }
Exemplo n.º 8
0
 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>();
 }
Exemplo n.º 9
0
        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());
        }
Exemplo n.º 10
0
 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>();
 }
Exemplo n.º 11
0
 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();
 }
Exemplo n.º 12
0
 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();
 }
Exemplo n.º 13
0
 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>();
 }
Exemplo n.º 14
0
 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();
 }
Exemplo n.º 15
0
 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> >();
 }
Exemplo n.º 16
0
 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();
 }
Exemplo n.º 17
0
 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();
 }
Exemplo n.º 18
0
        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
Exemplo n.º 19
0
 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();
 }
Exemplo n.º 20
0
 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>();
 }
Exemplo n.º 21
0
 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>();
 }
Exemplo n.º 22
0
 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>();
 }
Exemplo n.º 23
0
        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());
        }
Exemplo n.º 24
0
 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));
 }
Exemplo n.º 25
0
 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>();
 }
Exemplo n.º 26
0
        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());
        }
Exemplo n.º 27
0
        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());
        }
Exemplo n.º 28
0
        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());
        }
Exemplo n.º 29
0
        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());
        }
Exemplo n.º 30
0
 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);
 }
Exemplo n.º 31
0
 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>();
 }
Exemplo n.º 32
0
 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>();
 }
Exemplo n.º 33
0
        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);

        }
Exemplo n.º 34
0
 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);
     }
 }
Exemplo n.º 35
0
 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());
 }
Exemplo n.º 36
0
 public void SXCMValueTest1()
 {
     SXCM<TEL> sxcm = new IVL<TEL>();
     sxcm.Value = "HOLA";
     Assert.IsTrue(sxcm.Validate());
 }
Exemplo n.º 37
0
 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);
     }
 }
Exemplo n.º 38
0
        public void IVLIsSemanticEqualsTest()
        {
            SET<INT> ints = new SET<INT>() { 1, 2, 4, 6 };
            IVL<INT> range = new IVL<INT>(0, 7);

        }
Exemplo n.º 39
0
 public void SXCMNullValueTest()
 {
     SXCM<TEL> sxcm = new IVL<TEL>();
     sxcm.Value = null;
     Assert.IsFalse(sxcm.Validate());
 }
Exemplo n.º 40
0
 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")));
 }
Exemplo n.º 41
0
 public void IVLINTContainsTest()
 {
     IVL<INT> container = new IVL<INT>(1, 10);
     Assert.IsTrue(container.Contains(9));
 }
Exemplo n.º 42
0
 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());
 }
Exemplo n.º 43
0
 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
Exemplo n.º 44
0
 public void IVLINTNotContainsTest()
 {
     IVL<INT> container = new IVL<INT>(1, 10);
     Assert.IsFalse(container.Contains(90));
 }
Exemplo n.º 45
0
        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());
        }
Exemplo n.º 46
0
        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());
        }
Exemplo n.º 47
0
        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());
        }
Exemplo n.º 48
0
 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());
 }
Exemplo n.º 49
0
 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")));
 }
Exemplo n.º 50
0
 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());
 }
Exemplo n.º 51
0
 public void IVLTSNotContainsTest()
 {
     IVL<TS> container = new IVL<TS>(DateTime.MinValue, DateTime.Now);
     Assert.IsFalse(container.Contains(DateTime.MaxValue));
 }
Exemplo n.º 52
0
 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());
 }
Exemplo n.º 53
0
 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);
 }
Exemplo n.º 54
0
 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());
 }
Exemplo n.º 55
0
        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"));
            }
        }
Exemplo n.º 56
0
        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());
        }
Exemplo n.º 57
0
        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"));

        }
Exemplo n.º 58
0
        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);
        }
Exemplo n.º 59
0
 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());
 }
Exemplo n.º 60
0
 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}
 }