Clarotech.OpenEHR.RM.Json provides canonical JSON serialisation and deserialisation
for Clarotech.OpenEHR.RM and Clarotech.OpenEHR.RM.Datatypes using System.Text.Json.
Key characteristics
Feature
Detail
JSON format
openEHR Canonical JSON — snake_case property names, _type discriminator on every RM object
⚠️ Reflection-based; not trim-safe (annotated with [RequiresUnreferencedCode])
Installation
dotnet add package Clarotech.OpenEHR.RM.Json
# Clarotech.OpenEHR.RM and Clarotech.OpenEHR.RM.Datatypes come in automatically
Quick example
using Clarotech.OpenEHR.RM.Json;
// Serialise — picks up _type from the runtime type of composition
string json = OpenEhrJsonSerializer.Serialize(composition, writeIndented: true);
// Deserialise
var restored = OpenEhrJsonSerializer.Deserialize<Composition>(json);