Ignixa.Search 0.0.127

dotnet add package Ignixa.Search --version 0.0.127
                    
NuGet\Install-Package Ignixa.Search -Version 0.0.127
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ignixa.Search" Version="0.0.127" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ignixa.Search" Version="0.0.127" />
                    
Directory.Packages.props
<PackageReference Include="Ignixa.Search" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ignixa.Search --version 0.0.127
                    
#r "nuget: Ignixa.Search, 0.0.127"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ignixa.Search@0.0.127
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ignixa.Search&version=0.0.127
                    
Install as a Cake Addin
#tool nuget:?package=Ignixa.Search&version=0.0.127
                    
Install as a Cake Tool

Ignixa.Search

FHIR search parameter indexing and query infrastructure. Provides comprehensive support for FHIR search operations including parameter definitions, indexing, and query parsing.

Why Use This Package?

  • Full FHIR search support: Implements all FHIR search parameter types (string, token, reference, date, quantity, number, composite)
  • High-performance indexing: Extract search values from FHIR resources using FHIRPath
  • Query parsing: Parse FHIR search queries from URL parameters
  • Custom search parameters: Support for custom SearchParameter definitions from Implementation Guides

Installation

dotnet add package Ignixa.Search

Quick Start

Creating a Search Indexer (Easy Way)

For a specific FHIR version, use the factory:

using Ignixa.Search.Indexing;
using Ignixa.Specification.Generated;
using Microsoft.Extensions.Logging;

// Create logger factory
var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());

// Get FHIR schema provider for your version
var schemaProvider = new R4CoreSchemaProvider();
// Also available: R4BCoreSchemaProvider, R5CoreSchemaProvider, STU3CoreSchemaProvider

// Create indexer with all dependencies automatically configured
var indexer = SearchIndexerFactory.CreateInstance(
    schemaProvider,
    loggerFactory);

// That's it! Now you can index resources

Indexing a Resource

Extract search values from a FHIR resource:

using Ignixa.Abstractions;

// Index a Patient resource
IElement patientElement = GetPatientElement();
var searchIndexEntries = indexer.Extract(patientElement);

// searchIndexEntries contains:
// - name -> "John", "Doe" (string search params)
// - birthdate -> DateTime (date search params)
// - identifier -> token values (token search params)
// - etc.

foreach (var entry in searchIndexEntries)
{
    Console.WriteLine($"{entry.SearchParameter.Code}: {entry.Value}");
}

Parsing Search Queries

Parse FHIR search queries from URL parameters:

using Ignixa.Search.Parsing;

// Parse query string into parameters
var parameterParser = new QueryParameterParser();
var parameters = parameterParser.Parse("name=John&birthdate=gt2000-01-01&_count=50");

// Build search options
var expressionParser = new SearchParameterExpressionParser(...); // from DI
var builder = new SearchOptionsBuilder(expressionParser, searchParameterDefinitionManager);

var searchOptions = builder.Build("Patient", parameters);

// searchOptions contains parsed search criteria:
// - Expression: parsed search conditions
// - MaxItemCount: 50
// - ContinuationToken: for pagination

Search Parameter Types

Matches partial strings (case-insensitive, ignoring accents):

GET /Patient?name=John
GET /Patient?address=Boston

Exact match on codes, identifiers, booleans:

GET /Patient?identifier=123456
GET /Patient?gender=male
GET /Patient?active=true

// Token with system
GET /Patient?identifier=http://hospital.org|123456
// Reference to another resource
GET /Observation?patient=Patient/123
GET /Observation?subject=Patient/456

// Reference by identifier (chaining)
GET /Observation?patient.identifier=123456
// Date comparisons
GET /Patient?birthdate=2000-01-01         // equals
GET /Patient?birthdate=gt2000-01-01       // greater than
GET /Patient?birthdate=lt2010-12-31       // less than
GET /Patient?birthdate=ge2000-01-01       // greater or equal
GET /Patient?birthdate=le2010-12-31       // less or equal

// Date ranges
GET /Patient?birthdate=ge2000-01-01&birthdate=lt2001-01-01
// Quantity with value and unit
GET /Observation?value-quantity=5.4|http://unitsofmeasure.org|mg

// Quantity comparisons
GET /Observation?value-quantity=gt100|http://unitsofmeasure.org|mg
// Numeric values
GET /RiskAssessment?probability=0.8
GET /RiskAssessment?risk=gt0.5

Search Modifiers

// String modifiers
GET /Patient?name:exact=John              // Exact match
GET /Patient?name:contains=oh             // Contains
GET /Patient?address-city:exact=Boston

// Token modifiers
GET /Patient?identifier:of-type=MR|12345  // Identifier of type

// Reference modifiers
GET /Observation?subject:Patient=123      // Type modifier

Common Scenarios

Building Search Indices for Storage

// Index all patients in database
foreach (var patient in patients)
{
    var entries = indexer.Extract(patient);

    foreach (var entry in entries)
    {
        // Store in search parameter table
        await SaveSearchIndexEntry(
            patient.Id,
            entry.SearchParameter.Code,
            entry.SearchParameter.Type,
            entry.Value);
    }
}

Implementing FHIR Search API

using Ignixa.Search.Parsing;
using Microsoft.AspNetCore.Http;

// Parse incoming HTTP query string
var parameterParser = new QueryParameterParser();
var parameters = parameterParser.Parse(httpContext.Request.Query);

// Build search options
var searchOptions = searchOptionsBuilder.Build(resourceType, parameters);

// Execute search against database
var results = await ExecuteSearch(resourceType, searchOptions);

Custom Search Parameters

// Load custom SearchParameter from Implementation Guide
var customSearchParam = new SearchParameterInfo
{
    Code = "custom-identifier",
    Type = SearchParamType.Token,
    Expression = "Patient.extension.where(url='http://example.org/custom').value as Identifier",
    Url = "http://example.org/SearchParameter/custom-identifier"
};

// Register with definition manager
searchParameterDefinitionManager.AddSearchParameter(customSearchParam);

// Now indexer will extract values for custom-identifier
var entries = indexer.Extract(patient);

Integration with Other Packages

  • Ignixa.Specification: Provides default SearchParameter definitions for R4/R4B/R5
  • Ignixa.FhirPath: Used to evaluate SearchParameter expressions
  • Ignixa.PackageManagement: Load custom SearchParameters from Implementation Guides
  • Ignixa.DataLayer.*: Storage implementations use search indices for querying

Performance Considerations

  • Compiled FHIRPath: Search parameter expressions are compiled for faster indexing
  • Incremental indexing: Only re-index changed resources
  • Selective indexing: Skip indexing for search parameters not used in your queries

FHIR Specification Compliance

This implementation follows:

License

MIT License - see LICENSE file in repository root

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.127 84 12/29/2025
0.0.109 263 12/18/2025
0.0.101 261 12/16/2025
0.0.96 401 12/10/2025
0.0.87 405 12/8/2025
0.0.70 285 12/7/2025
0.0.68 200 12/7/2025
0.0.62 207 12/6/2025
0.0.59 159 12/5/2025
0.0.58 179 12/5/2025
0.0.57 185 12/3/2025
0.0.56 646 12/3/2025
0.0.55 408 12/1/2025
0.0.54 399 11/30/2025
0.0.53 405 11/30/2025
0.0.51 111 11/29/2025
0.0.50 92 11/29/2025