示例#1
0
        public void Test_HISearchMedicareNumber()
        {
            IResourceServiceOutcomeFactory IResourceServiceOutcomeFactory = CommonTestSetup.TestSetupMocks.GetIResourceServiceOutcomeFactory();
            IPyroFhirUriFactory            IPyroFhirUriFactory            = CommonTestSetup.TestSetupMocks.GetIPyroFhirUriFactory();
            IResourceServices     IResourceServices     = GetIResourceServices();
            IGlobalProperties     IGlobalProperties     = CommonTestSetup.TestSetupMocks.GetIGlobalProperties();
            IHiServiceApi         IHiServiceApi         = GetMokIHiServiceApi();
            IMedicareNumberParser IMedicareNumberParser = new MedicareNumberParser();
            IIndividualHealthcareIdentifierParser IIndividualHealthcareIdentifierParser = new IndividualHealthcareIdentifierParser();
            IDVANumberParser    IDVANumberParser   = new DVANumberParser();
            IRequestMetaFactory RequestMetaFactory = CommonTestSetup.TestSetupMocks.GetIRequestMetaFactory();
            INationalHealthcareIdentifierInfo INationalHealthcareIdentifierInfo = new NationalHealthcareIdentifierInfo();
            IMedicareNumberInfo IMedicareNumberInfo = new MedicareNumberInfo();

            Common.PyroHealthFhirResource.CodeSystems.IPyroFhirServer IPyroFhirServerCodeSystem = new Common.PyroHealthFhirResource.CodeSystems.PyroFhirServer();


            IHISearchOrValidateOperation IHISearchOrValidateOperationService = new IHISearchOrValidateOperation(
                IResourceServiceOutcomeFactory,
                IResourceServices,
                IGlobalProperties,
                IHiServiceApi,
                RequestMetaFactory,
                IMedicareNumberParser,
                IIndividualHealthcareIdentifierParser,
                IDVANumberParser,
                INationalHealthcareIdentifierInfo,
                IMedicareNumberInfo,
                IPyroFhirServerCodeSystem);

            OperationClass OperationClass = new OperationClass()
            {
                Scope = Common.Enum.FhirOperationEnum.OperationScope.Resource,
                Type  = Common.Enum.FhirOperationEnum.OperationType.xIHISearchOrValidate
            };

            //var SearchParameterGeneric = new Common.Search.SearchParameterGeneric();

            var PyroRequestUri = CommonTestSetup.TestSetupMocks.GetIPyroRequestUriFactory().CreateFhirRequestUri();

            PyroRequestUri.FhirRequestUri = CommonTestSetup.TestSetupMocks.GetIPyroRequestUriFactory().CreateFhirRequestUri().FhirRequestUri = new Pyro.Common.Tools.UriSupport.PyroFhirUri(CommonTestSetup.TestSetupMocks.GetIPrimaryServiceRootCache());
            PyroRequestUri.FhirRequestUri.Parse($"{StaticTestData.FhirEndpoint()}/{ResourceType.Patient.GetLiteral()}/{Common.Enum.FhirOperationEnum.OperationType.xIHISearchOrValidate.GetPyroLiteral()}");
            IRequestMeta RequestMeta = RequestMetaFactory.CreateRequestMeta();

            RequestMeta.PyroRequestUri         = PyroRequestUri;
            RequestMeta.RequestHeader          = CommonTestSetup.TestSetupMocks.GetIRequestHeaderFactory().CreateRequestHeader();
            RequestMeta.SearchParameterGeneric = CommonTestSetup.TestSetupMocks.GetISearchParameterGenericFactory().CreateDtoSearchParameterGeneric();

            Parameters ParametersResource = GenerateRequestParametersResource();

            IResourceServiceOutcome ResourceServiceOutcome = IHISearchOrValidateOperationService.IHISearchOrValidate(
                OperationClass,
                ParametersResource,
                RequestMeta
                );

            Assert.NotNull(ResourceServiceOutcome.ResourceResult);
            Assert.AreEqual(ResourceType.Parameters.GetLiteral(), ResourceServiceOutcome.ResourceResult.TypeName);
        }
示例#2
0
        public void Test_Negative_DVA_AlphaAfterWarCode()
        {
            string Number = "N Z123S56A";

            IDVANumberParser Parser = new DVANumberParser();
            IDVANumber       DVA;

            Assert.IsFalse(Parser.TryParse(Number, out DVA));
        }
示例#3
0
        public void Test_Negative_DVA_SegmentLinkNotAnAlpha()
        {
            string Number = "N ZX123458";

            IDVANumberParser Parser = new DVANumberParser();
            IDVANumber       DVA;

            Assert.IsFalse(Parser.TryParse(Number, out DVA));
        }
示例#4
0
        public void Test_Negative_DVA_Number_ToManyNumber()
        {
            string Number = "N ZX123456Z";

            IDVANumberParser Parser = new DVANumberParser();
            IDVANumber       DVA;

            Assert.IsFalse(Parser.TryParse(Number, out DVA));
        }
示例#5
0
        public void Test_Negative_DVA_Number_BadStateCode()
        {
            string Number = "Z ZX12345Z";

            IDVANumberParser Parser = new DVANumberParser();
            IDVANumber       DVA;

            Assert.IsFalse(Parser.TryParse(Number, out DVA));
        }
示例#6
0
        public void Test_BenSkinner_Negative_DVA()
        {
            string Number = "WX82477A";

            IDVANumberParser Parser = new DVANumberParser();
            IDVANumber       DVA;

            Assert.IsFalse(Parser.TryParse(Number, out DVA));
        }
示例#7
0
        public void Test_Valid_DVA_Number_3()
        {
            string Number = "Q ZX12345Z";

            IDVANumberParser Parser = new DVANumberParser();
            IDVANumber       DVA;

            Assert.IsTrue(Parser.TryParse(Number, out DVA));
            Assert.AreEqual("QZX12345Z", DVA.Value);
            Assert.AreEqual("Q", DVA.StateCode);
            Assert.AreEqual("ZX", DVA.WarCode);
            Assert.AreEqual("12345", DVA.Number);
            Assert.AreEqual("Z", DVA.SegmentLink);
            Assert.AreEqual("ZX12345", DVA.FileNumber);
        }
示例#8
0
        public void Test_Valid_DVA_Number_2()
        {
            string Number = "V A123456";

            IDVANumberParser Parser = new DVANumberParser();
            IDVANumber       DVA;

            Assert.IsTrue(Parser.TryParse(Number, out DVA));
            Assert.AreEqual("VA123456", DVA.Value);
            Assert.AreEqual("V", DVA.StateCode);
            Assert.AreEqual("A", DVA.WarCode);
            Assert.AreEqual("123456", DVA.Number);
            Assert.AreEqual("", DVA.SegmentLink);
            Assert.AreEqual("A123456", DVA.FileNumber);
        }
示例#9
0
        public void Test_Valid_DVA_Number_1()
        {
            string Number = "N ABC1234C";

            IDVANumberParser Parser = new DVANumberParser();
            IDVANumber       DVA;

            Assert.IsTrue(Parser.TryParse(Number, out DVA));
            Assert.AreEqual("NABC1234C", DVA.Value);
            Assert.AreEqual("N", DVA.StateCode);
            Assert.AreEqual("ABC", DVA.WarCode);
            Assert.AreEqual("1234", DVA.Number);
            Assert.AreEqual("C", DVA.SegmentLink);
            Assert.AreEqual("ABC1234", DVA.FileNumber);
        }
示例#10
0
        public void Test_Valid_DVA_Number_5()
        {
            string Number = "NX223456";

            IDVANumberParser Parser = new DVANumberParser();
            IDVANumber       DVA;

            Assert.IsTrue(Parser.TryParse(Number, out DVA));
            Assert.AreEqual("NX223456", DVA.Value);
            Assert.AreEqual("NX223456", DVA.ValueFormated);
            Assert.AreEqual("N", DVA.StateCode);
            Assert.AreEqual("X", DVA.WarCode); //Yes a single empty char
            Assert.AreEqual("223456", DVA.Number);
            Assert.AreEqual("", DVA.SegmentLink);
            Assert.AreEqual("X223456", DVA.FileNumber);
        }