Java library
HAPI FHIR
Describes itself as a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java, under the Apache Software License 2.0. If your stack is on the JVM, look there first.
FHIR
@cosyte/fhir reads FHIR R4 JSON and XML into an immutable model and writes it back without dropping a trailing zero, a primitive extension or a status flag, then validates structure, cardinality and the profiles you supply. Its README lists exactly what is built and what is not yet.
npm install @cosyte/fhirNeed it integrated? Talk to us.
The standard
@cosyte/fhir
A FHIR document should come back out exactly as it went in, and a validator should say where a problem is without repeating the patient data that caused it. That is the order this toolkit was built in.
import { parseResource, readObservationValue, validateResource } from "@cosyte/fhir";
const document = `{
"resourceType": "Observation",
"id": "syn-0001",
"status": "final",
"code": { "coding": [{ "system": "http://loinc.org", "code": "8480-6" }] },
"subject": { "reference": "Patient/syn-0001" },
"effectiveDateTime": "2026-01-05",
"valueQuantity": {
"value": 120.0,
"unit": "mmHg",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
}
}`;
const { resource, issues } = parseResource(document);
// The magnitude was written 120.0: the read keeps that exact form and says the protection mattered.
issues.map((issue) => issue.code); // => ["DECIMAL_PRECISION_AT_RISK"]
// Branch on the value[x] type before touching a magnitude, and compare on the UCUM code.
const reading = readObservationValue(resource);
reading?.type; // => "Quantity"
reading?.quantity?.value?.raw; // => "120.0"
reading?.quantity?.code; // => "mm[Hg]"
validateResource(resource).valid; // => trueFrom the @cosyte/fhir README on GitHub, verbatim. Every value in it is synthetic.
Limits
Its README is specific about what is not built yet. The main points:
Alternatives
Each description comes from the project’s own documentation or npm listing, linked below.
Java library
Describes itself as a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java, under the Apache Software License 2.0. If your stack is on the JVM, look there first.
TypeScript library
A pure TypeScript library for calling a FHIR server, with FHIR validation and operations, FHIRPath evaluation and no external dependencies, under Apache-2.0. It includes an HTTP client, which @cosyte/fhir does not.
JavaScript library
An ISC-licensed library for handling FHIR resources: serialization between JSON and XML, validation and FHIRPath evaluation.
JavaScript library
A JavaScript library for connecting SMART apps to FHIR servers, in modern browsers and on Node 18 or later. Use it for the SMART launch and the server calls.
TypeScript types
Community-maintained TypeScript type definitions for FHIR. Types check your code at compile time; they do not parse or validate a document at run time.
Converter
Converts HL7 v2, C-CDA, JSON and FHIR STU3 data to FHIR R4 with Liquid templates, through the $convert-data operation of Azure's FHIR service.
Works with
It is free and MIT-licensed. If it saves you a day, a star on GitHub helps other engineers find it.
Need it integrated? Talk to us, or see what our integration services cover.