Ignixa.Models.R4 0.6.74-beta

This is a prerelease version of Ignixa.Models.R4.
dotnet add package Ignixa.Models.R4 --version 0.6.74-beta
                    
NuGet\Install-Package Ignixa.Models.R4 -Version 0.6.74-beta
                    
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.Models.R4" Version="0.6.74-beta" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ignixa.Models.R4" Version="0.6.74-beta" />
                    
Directory.Packages.props
<PackageReference Include="Ignixa.Models.R4" />
                    
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.Models.R4 --version 0.6.74-beta
                    
#r "nuget: Ignixa.Models.R4, 0.6.74-beta"
                    
#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.Models.R4@0.6.74-beta
                    
#: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.Models.R4&version=0.6.74-beta&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Ignixa.Models.R4&version=0.6.74-beta&prerelease
                    
Install as a Cake Tool

Ignixa.Models.R4

FHIR R4 strongly-typed POCO facades over the Ignixa element/JSON runtime. Opt-in: subclasses the shared Ignixa.Models base layer in Ignixa.Serialization, so it adds Firely-grade ergonomics (patient.Name[0].Family, compile-time safety, IntelliSense over every element, enums for every value set) without becoming a second source of truth — every generated type is a zero-copy view over the same JsonObject/IElement runtime the rest of the SDK already uses.

Why Use This Package?

  • Zero-copy: typed facades read and write directly against the backing JSON; there is no POCO↔JSON serialization step, so extensions, primitive shadow elements (_birthDate), and unknown elements all survive untouched.
  • Shared base, R4-specific deltas: types identical across versions (e.g. Coding) live once in Ignixa.Serialization; R4-specific shape lives here. You get the base type's ergonomics for free and only pull in this package for the R4-specific delta.
  • Cross-version safe by construction: As<T>() validates that a version-tagged node is only reinterpreted through a facade that actually supports that version, so R4 data can't silently be misread through another version's shaped accessor.
  • Opt-in, never on the core request path: the server runs without this package. Add it only where you want typed R4 ergonomics.

Installation

dotnet add package Ignixa.Models.R4 --prerelease

Quick Start

using Ignixa.Abstractions;
using Ignixa.Models.R4;
using Ignixa.Serialization;
using Ignixa.Serialization.SourceNodes;

const string json = """
{
  "resourceType": "Patient",
  "id": "example",
  "gender": "female",
  "birthDate": "1974-12-25",
  "name": [ { "family": "Chalmers", "given": [ "Jean" ] } ]
}
""";

// Parse once, view as the R4-typed facade -- zero-copy over the same backing JsonObject.
Patient patient = ResourceJsonNode.Parse(json).As<Patient>();

Console.WriteLine(patient.Name[0].Family);       // "Chalmers"
Console.WriteLine(patient.Gender);                // AdministrativeGender.Female

// Mutate through the typed facade; writes land directly on the backing JSON.
patient.Active = true;

string serialized = patient.SerializeToString();

Cross-version dispatch

using Ignixa.Abstractions;

ResourceJsonNode resource = ResourceJsonNode.Parse(json);

// Explicit, version-aware dispatch -- throws InvalidOperationException on a registry miss rather than
// silently returning a wrong-typed facade.
ResourceJsonNode viaR4 = resource.AsVersion(FhirVersion.R4);

// Or the best-effort variant:
if (resource.TryAsVersion(FhirVersion.R4, out var versioned))
{
    // ...
}

Integration with Other Packages

  • Ignixa.Serialization: provides the shared Ignixa.Models base layer this package subclasses, plus the ResourceJsonNode/BaseJsonNode runtime every facade is built on.
  • Ignixa.Models.R5: the R5 counterpart. Both can be referenced from the same project — a single parsed node can be viewed as Ignixa.Models.R4.Patient and Ignixa.Models.R5.Patient simultaneously, since neither owns the underlying data.
  • Ignixa.Abstractions: supplies FhirVersion and other cross-cutting contracts.

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 is compatible.  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.6.74-beta 64 9/3/2026
0.6.73-beta 58 9/2/2026
0.6.68-beta 66 8/24/2026
0.6.41-beta 72 7/27/2026
0.6.28-beta 69 7/22/2026
0.6.19-beta 72 7/12/2026