Esempio n. 1
0
        public IList <IQuantityIndex> Set(IElementNavigator oElement, DtoServiceSearchParameterLight SearchParameter)
        {
            _SearchParameter = SearchParameter;

            var ResourceIndexList        = new List <IQuantityIndex>();
            var ServiceSearchParameterId = SearchParameter.Id;

            if (oElement is Hl7.Fhir.ElementModel.PocoNavigator Poco && Poco.FhirValue != null)
            {
                if (Poco.FhirValue is Money Money)
                {
                    SetMoney(Money, ResourceIndexList);
                }
                else if (Poco.FhirValue is SimpleQuantity SimpleQuantity)
                {
                    SetSimpleQuantity(SimpleQuantity, ResourceIndexList);
                }
                else if (Poco.FhirValue is Quantity Quantity)
                {
                    SetQuantity(Quantity, ResourceIndexList);
                }
                else if (Poco.FhirValue is Location.PositionComponent PositionComponent)
                {
                    SetPositionComponent(PositionComponent, ResourceIndexList);
                }
                else if (Poco.FhirValue is Range Range)
                {
                    SetRange(Range, ResourceIndexList);
                }
                else
                {
                    throw new FormatException($"Unknown FhirType: '{oElement.Type}' for SearchParameterType: '{SearchParameter.Type}'");
                }
                return(ResourceIndexList);
            }
Esempio n. 2
0
        public IList <ResIndexReferenceType> Set(IElementNavigator oElement, IServiceSearchParameterLight SearchParameter)
        {
            var ReferenceIndexList = IReferenceSetter.Set(oElement, SearchParameter);

            if (ReferenceIndexList.Count == 0)
            {
                return(null);
            }

            var DbReferenceIndexList = new List <ResIndexReferenceType>();

            foreach (IReferenceIndex Index in ReferenceIndexList)
            {
                var DbResourceIndex = new ResIndexReferenceType();
                DbResourceIndex.ReferenceVersionId       = Index.VersionId;
                DbResourceIndex.ReferenceFhirId          = Index.FhirId;
                DbResourceIndex.ReferenceResourceType    = Index.ResourceType;
                DbResourceIndex.ServiceSearchParameterId = Index.ServiceSearchParameterLight.Id;

                if (Index.IsRelativeToServer)
                {
                    DbResourceIndex.ReferenceServiceBaseUrlId = IPrimaryServiceRootCache.GetPrimaryRootUrlStoreFromDatabase().Id;
                }
                else
                {
                    DbResourceIndex.ReferenceServiceBaseUrlId = IServiceBaseUrlRepository.GetAndOrAddService_RootUrlStore(Index.BaseUrl).Id;
                }
                DbReferenceIndexList.Add(DbResourceIndex);
            }
            return(DbReferenceIndexList);
        }
Esempio n. 3
0
        public IList <IReferenceIndex> Set(IElementNavigator oElement, IServiceSearchParameterLight SearchParameter)
        {
            List <IReferenceIndex> ResourceIndexList = new List <IReferenceIndex>();

            _SearchParameter = SearchParameter;

            if (oElement is Hl7.Fhir.ElementModel.PocoNavigator Poco && Poco.FhirValue != null)
            {
                if (Poco.FhirValue is FhirUri FhirUri)
                {
                    SetFhirUri(FhirUri, ResourceIndexList);
                }
                else if (Poco.FhirValue is ResourceReference ResourceReference)
                {
                    SetResourcereference(ResourceReference, ResourceIndexList);
                }
                else if (Poco.FhirValue is Resource Resource)
                {
                    SetResource(Resource, ResourceIndexList);
                }
                else if (Poco.FhirValue is Attachment Attachment)
                {
                    SetUri(Attachment, ResourceIndexList);
                }
                else if (Poco.FhirValue is Identifier Identifier)
                {
                    SetIdentifier(Identifier, ResourceIndexList);
                }
                else
                {
                    throw new FormatException($"Unknown FhirType: '{oElement.Type}' for SearchParameterType: '{SearchParameter.Type}'");
                }
                //ResourceIndexList.ForEach(x => x.ServiceSearchParameterId = ServiceSearchParameterId);
                return(ResourceIndexList);
            }
Esempio n. 4
0
        public IList <ResIndexQuantityType> Set(IElementNavigator oElement, IServiceSearchParameterLight SearchParameter)
        {
            var QuantityIndexList = INumberSetter.Set(oElement, SearchParameter);

            if (QuantityIndexList.Count == 0)
            {
                return(null);
            }

            var DbReferenceIndexList = new List <ResIndexQuantityType>();

            foreach (IQuantityIndex Index in QuantityIndexList)
            {
                var DbResourceIndex = new ResIndexQuantityType();
                DbResourceIndex.Comparator = Index.Comparator;
                DbResourceIndex.Quantity   = Index.Quantity;
                DbResourceIndex.Code       = Index.Code;
                DbResourceIndex.System     = Index.System;
                DbResourceIndex.Unit       = Index.Unit;

                DbResourceIndex.ComparatorHigh = Index.ComparatorHigh;
                DbResourceIndex.QuantityHigh   = Index.QuantityHigh;
                DbResourceIndex.CodeHigh       = Index.CodeHigh;
                DbResourceIndex.SystemHigh     = Index.SystemHigh;
                DbResourceIndex.UnitHigh       = Index.UnitHigh;

                DbResourceIndex.ServiceSearchParameterId = Index.ServiceSearchParameterLight.Id;

                DbReferenceIndexList.Add(DbResourceIndex);
            }
            return(DbReferenceIndexList);
        }
Esempio n. 5
0
        public IList <IQuantityIndex> Set(IElementNavigator oElement, IServiceSearchParameterLight SearchParameter)
        {
            var ResourceIndexList = new List <IQuantityIndex>();

            _SearchParameter = SearchParameter;

            if (oElement is Hl7.Fhir.ElementModel.PocoNavigator Poco && Poco.FhirValue != null)
            {
                if (Poco.FhirValue is Integer Integer)
                {
                    SetInteger(Integer, ResourceIndexList);
                }
                else if (Poco.FhirValue is PositiveInt PositiveInt)
                {
                    SetPositiveInt(PositiveInt, ResourceIndexList);
                }
                else if (Poco.FhirValue is Duration Duration)
                {
                    SetDuration(Duration, ResourceIndexList);
                }
                else if (Poco.FhirValue is FhirDecimal FhirDecimal)
                {
                    SetFhirDecimal(FhirDecimal, ResourceIndexList);
                }
                else if (Poco.FhirValue is Range Range)
                {
                    SetRange(Range, ResourceIndexList);
                }
                else
                {
                    throw new FormatException($"Unknown FhirType: '{oElement.Type}' for SearchParameterType: '{SearchParameter.Type}'");
                }

                return(ResourceIndexList);
            }
Esempio n. 6
0
        public IList <IDateTimeIndex> Set(IElementNavigator oElement, DtoServiceSearchParameterLight SearchParameter)
        {
            var ResourceIndexList = new List <IDateTimeIndex>();

            _SearchParameter = SearchParameter;

            if (oElement is Hl7.Fhir.ElementModel.PocoNavigator Poco && Poco.FhirValue != null)
            {
                if (Poco.FhirValue is Date Date)
                {
                    SetDate(Date, ResourceIndexList);
                }
                else if (Poco.FhirValue is Period Period)
                {
                    SetPeriod(Period, ResourceIndexList);
                }
                else if (Poco.FhirValue is FhirDateTime FhirDateTime)
                {
                    SetDateTime(FhirDateTime, ResourceIndexList);
                }
                else if (Poco.FhirValue is FhirString FhirString)
                {
                    SetString(FhirString, ResourceIndexList);
                }
                else if (Poco.FhirValue is Instant Instant)
                {
                    SetInstant(Instant, ResourceIndexList);
                }
                else if (Poco.FhirValue is Timing Timing)
                {
                    SetTiming(Timing, ResourceIndexList);
                }
                else
                {
                    throw new FormatException($"Unknown FhirType: '{oElement.Type}' for SearchParameterType: '{SearchParameter.Type}'");
                }

                return(ResourceIndexList);
            }
Esempio n. 7
0
        public IList <IStringIndex> Set(IElementNavigator oElement, DtoServiceSearchParameterLight SearchParameter)
        {
            _SearchParameter = SearchParameter;

            var ResourceIndexList        = new List <IStringIndex>();
            var ServiceSearchParameterId = SearchParameter.Id;

            if (oElement is Hl7.Fhir.ElementModel.PocoNavigator Poco && Poco.FhirValue != null)
            {
                if (Poco.FhirValue is FhirString FhirString)
                {
                    SetFhirString(FhirString, ResourceIndexList);
                }
                else if (Poco.FhirValue is Address address)
                {
                    SetAddress(address, ResourceIndexList);
                }
                else if (Poco.FhirValue is HumanName HumanName)
                {
                    SetHumanName(HumanName, ResourceIndexList);
                }
                else if (Poco.FhirValue is Markdown Markdown)
                {
                    SetMarkdown(Markdown, ResourceIndexList);
                }
                else if (Poco.FhirValue is Annotation Annotation)
                {
                    SetAnnotation(Annotation, ResourceIndexList);
                }
                else if (Poco.FhirValue is Base64Binary Base64Binary)
                {
                    //No good purpose to index base64 content as a search index
                }
                else
                {
                    throw new FormatException($"Unknown FhirType: '{oElement.Type}' for SearchParameterType: '{SearchParameter.Type}'");
                }
            }
Esempio n. 8
0
        public IList <IUriIndex> Set(IElementNavigator oElement, DtoServiceSearchParameterLight SearchParameter)
        {
            _SearchParameter = SearchParameter;

            var ResourceIndexList        = new List <IUriIndex>();
            var ServiceSearchParameterId = SearchParameter.Id;

            if (oElement is Hl7.Fhir.ElementModel.PocoNavigator Poco && Poco.FhirValue != null)
            {
                if (Poco.FhirValue is FhirUri FhirUri)
                {
                    SetUri(FhirUri, ResourceIndexList);
                }
                else if (Poco.FhirValue is Oid Oid)
                {
                    SetOid(Oid, ResourceIndexList);
                }
                else
                {
                    throw new FormatException($"Unknown FhirType: '{oElement.Type}' for SearchParameterType: '{SearchParameter.Type}'");
                }
                return(ResourceIndexList);
            }
Esempio n. 9
0
 public QuantityIndex(IServiceSearchParameterLight ServiceSearchParameterLight)
     : base(ServiceSearchParameterLight)
 {
 }
Esempio n. 10
0
        public IList <ITokenIndex> Set(IElementNavigator oElement, DtoServiceSearchParameterLight SearchParameter)
        {
            _SearchParameter = SearchParameter;

            var ResourceIndexList        = new List <ITokenIndex>();
            var ServiceSearchParameterId = SearchParameter.Id;

            if (oElement is Hl7.Fhir.ElementModel.PocoNavigator Poco && Poco.FhirValue != null)
            {
                if (Poco.FhirValue is Code Code)
                {
                    SetCode(Code, ResourceIndexList);
                }
                else if (Poco.FhirValue is CodeableConcept CodeableConcept)
                {
                    SetCodeableConcept(CodeableConcept, ResourceIndexList);
                }
                else if (Poco.FhirValue is Coding Coding)
                {
                    SetCoding(Coding, ResourceIndexList);
                }
                else if (Poco.FhirValue.TypeName == "code")
                {
                    if (Poco.Value is string CodeValue)
                    {
                        SetCodeTypeT(CodeValue, ResourceIndexList);
                    }
                }
                else if (Poco.FhirValue is ContactPoint ContactPoint)
                {
                    SetContactPoint(ContactPoint, ResourceIndexList);
                }
                else if (Poco.FhirValue is FhirBoolean FhirBoolean)
                {
                    SetFhirBoolean(FhirBoolean, ResourceIndexList);
                }
                else if (Poco.FhirValue is FhirDateTime FhirDateTime)
                {
                    SetFhirDateTime(FhirDateTime, ResourceIndexList);
                }
                else if (Poco.FhirValue is FhirString FhirString)
                {
                    SetFhirString(FhirString, ResourceIndexList);
                }
                else if (Poco.FhirValue is Id Id)
                {
                    SetId(Id, ResourceIndexList);
                }
                else if (Poco.FhirValue is Identifier Identifier)
                {
                    SetIdentifier(Identifier, ResourceIndexList);
                }
                else if (Poco.FhirValue is PositiveInt PositiveInt)
                {
                    SetPositiveInt(PositiveInt, ResourceIndexList);
                }
                else if (Poco.FhirValue is Quantity Quantity)
                {
                    SetQuantity(Quantity, ResourceIndexList);
                }
                else if (Poco.FhirValue is Range Range)
                {
                    SetRange(Range, ResourceIndexList);
                }
                else if (Poco.FhirValue is Location.PositionComponent PositionComponent)
                {
                    SePositionComponent(PositionComponent, ResourceIndexList);
                }
                else
                {
                    throw new FormatException($"Unknown FhirType: '{oElement.Type}' for SearchParameterType: '{SearchParameter.Type}'");
                }
                return(ResourceIndexList);
            }
Esempio n. 11
0
 public TokenIndex(IServiceSearchParameterLight ServiceSearchParameterLight)
     : base(ServiceSearchParameterLight)
 {
 }
Esempio n. 12
0
 public IndexBase(IServiceSearchParameterLight ServiceSearchParameterLight)
 {
     this.ServiceSearchParameterLight = ServiceSearchParameterLight;
 }
Esempio n. 13
0
 public DateTimeIndex(IServiceSearchParameterLight ServiceSearchParameterLight)
     : base(ServiceSearchParameterLight)
 {
 }
Esempio n. 14
0
 public StringIndex(IServiceSearchParameterLight ServiceSearchParameterLight)
     : base(ServiceSearchParameterLight)
 {
 }
Esempio n. 15
0
 public ReferenceIndex(IServiceSearchParameterLight ServiceSearchParameterLight)
     : base(ServiceSearchParameterLight)
 {
 }