Exemple #1
0
 public SearchParameterReferance(IPyroFhirUriFactory IPyroFhirUriFactory)
     : base()
 {
     this.IPyroFhirUriFactory = IPyroFhirUriFactory;
     this.Type      = Hl7.Fhir.Model.SearchParamType.Reference;
     this.IsChained = false;
 }
Exemple #2
0
 public DbReferenceSetter(IServiceBaseUrlRepository IServiceBaseUrlRepository, IPyroFhirUriFactory IPyroFhirUriFactory, IPrimaryServiceRootCache IPrimaryServiceRootCache, ICommonFactory ICommonFactory, IReferenceSetter IReferenceSetter)
 {
     this.IServiceBaseUrlRepository = IServiceBaseUrlRepository;
     this.IPyroFhirUriFactory       = IPyroFhirUriFactory;
     this.IPrimaryServiceRootCache  = IPrimaryServiceRootCache;
     this.IReferenceSetter          = IReferenceSetter;
 }
Exemple #3
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);
        }
Exemple #4
0
 public BundleTransactionOperation(IResourceServices IResourceServices, IRequestHeaderFactory IRequestHeaderFactory, IResourceServiceOutcomeFactory IResourceServiceOutcomeFactory, ISearchParameterGenericFactory ISearchParameterGenericFactory, IPyroFhirUriFactory IPyroFhirUriFactory, IPyroRequestUriFactory IPyroRequestUriFactory, IRequestMetaFactory IRequestMetaFactory)
 {
     this.IResourceServices              = IResourceServices;
     this.IRequestHeaderFactory          = IRequestHeaderFactory;
     this.IResourceServiceOutcomeFactory = IResourceServiceOutcomeFactory;
     this.IPyroFhirUriFactory            = IPyroFhirUriFactory;
     this.ISearchParameterGenericFactory = ISearchParameterGenericFactory;
     this.IPyroRequestUriFactory         = IPyroRequestUriFactory;
     this.IRequestMetaFactory            = IRequestMetaFactory;
 }
        public void Test_ORSearchParameterReferance_ResourceAndId_Positive()
        {
            //Arrange
            IPyroFhirUriFactory      PyroFhirUriFactory       = TestSetupMocks.GetIPyroFhirUriFactory();
            SearchParameterReferance SearchParameterReferance = new SearchParameterReferance(PyroFhirUriFactory);

            SearchParameterReferance.Id         = 10;
            SearchParameterReferance.Expression = "Not Required For Test";
            SearchParameterReferance.AllowedReferanceResourceList = new List <string>()
            {
                ResourceType.Patient.GetLiteral(),
                    ResourceType.Group.GetLiteral(),
            };

            string       TestResourceId    = "MyResID1";
            string       TestResourceId2   = "MyResID2";
            ResourceType TestResourceType  = ResourceType.Patient;
            ResourceType TestResourceType2 = ResourceType.Group;
            string       TestResourceName  = TestResourceType.GetLiteral();
            string       TestResourceName2 = TestResourceType2.GetLiteral();
            //Looks like: Patient/MyResId
            string TestParameter = $"{TestResourceName}/{TestResourceId},{TestResourceName2}/{TestResourceId2}";

            //Act
            bool Result = SearchParameterReferance.TryParseValue(TestParameter);

            //Assert
            Assert.IsTrue(Result, "Parse retruned False, expected True");
            Assert.AreEqual(SearchParameterReferance.ValueList.Count, 2, "To many Values returned for parse");
            Assert.IsFalse(SearchParameterReferance.ValueList[0].IsMissing, "IsMissing should be False");
            Assert.IsNull(SearchParameterReferance.ChainedSearchParameter, "ChainedSearchParameter should be null");
            Assert.IsTrue(SearchParameterReferance.HasLogicalOrProperties, "HasLogicalOrProperties should be False");
            Assert.IsNull(SearchParameterReferance.InvalidMessage, "InvalidMessage should be Null");
            Assert.IsFalse(SearchParameterReferance.IsChained, "IsChained should be False");
            Assert.IsTrue(SearchParameterReferance.IsValid, "IsValid  should be True");
            Assert.IsNull(SearchParameterReferance.Modifier, "Modifier should be NUll");
            Assert.IsNull(SearchParameterReferance.TypeModifierResource, "RawValue does not match parameter");

            Assert.IsNotNull(SearchParameterReferance.ValueList[0].FhirRequestUri, "FhirRequestUri can not be Null");
            Assert.AreEqual(SearchParameterReferance.ValueList[0].FhirRequestUri.ResourceType, TestResourceType, "FhirRequestUri.ResourceType should be Patient");
            Assert.AreEqual(SearchParameterReferance.ValueList[0].FhirRequestUri.ResourseName, TestResourceName, "FhirRequestUri.ResourceName should be Patient");
            Assert.AreEqual(SearchParameterReferance.ValueList[0].FhirRequestUri.ResourceId, TestResourceId, "FhirRequestUri.ResourceName should be Patient");

            Assert.IsNotNull(SearchParameterReferance.ValueList[1].FhirRequestUri, "FhirRequestUri can not be Null");
            Assert.AreEqual(SearchParameterReferance.ValueList[1].FhirRequestUri.ResourceType, TestResourceType2, "FhirRequestUri.ResourceType should be Patient");
            Assert.AreEqual(SearchParameterReferance.ValueList[1].FhirRequestUri.ResourseName, TestResourceName2, "FhirRequestUri.ResourceName should be Patient");
            Assert.AreEqual(SearchParameterReferance.ValueList[1].FhirRequestUri.ResourceId, TestResourceId2, "FhirRequestUri.ResourceName should be Patient");
        }
 public FhirValidateOperation(
     IResourceServiceOutcomeFactory IResourceServiceOutcomeFactory,
     IPyroFhirUriFactory IPyroFhirUriFactory,
     ISearchParameterServiceFactory ISearchParameterServiceFactory,
     IResourceServices IResourceServices,
     IFhirValidationSupport IFhirValidationSupport,
     IRequestMetaFactory IRequestMetaFactory)
 {
     //this.ICommonFactory = ICommonFactory;
     this.IResourceServiceOutcomeFactory = IResourceServiceOutcomeFactory;
     this.IPyroFhirUriFactory            = IPyroFhirUriFactory;
     this.ISearchParameterServiceFactory = ISearchParameterServiceFactory;
     this.IResourceServices      = IResourceServices;
     this.IFhirValidationSupport = IFhirValidationSupport;
     this.IRequestMetaFactory    = IRequestMetaFactory;
 }
Exemple #7
0
 //Constructor for dependency injection
 public ChainSearchingService(IRepositorySwitcher IRepositorySwitcher, IPyroFhirUriFactory IPyroFhirUriFactory)
 {
     this.IRepositorySwitcher = IRepositorySwitcher;
     this.IPyroFhirUriFactory = IPyroFhirUriFactory;
 }
Exemple #8
0
 public ReferenceSetter(IPyroFhirUriFactory IPyroFhirUriFactory, IPrimaryServiceRootCache IPrimaryServiceRootCache, ICommonFactory ICommonFactory)
 {
     this.IPyroFhirUriFactory      = IPyroFhirUriFactory;
     this.IPrimaryServiceRootCache = IPrimaryServiceRootCache;
 }