Validating Us Core logo

Validating Us Core

CommunityPopular
maziyarpanahi
validating-us-core

Validate FHIR R4 resources and Bundles against US Core / USCDI profiles with the official HL7 FHIR validator before submitting to an EHR. Covers running validator_cli.jar (or the public validator.fhir.org), declaring meta.profile, must-support elements, common conformance gaps (missing code/category/status), and turning validator output into a FHIR OperationOutcome. Use after exporting-to-fhir / assembling-fhir-bundles to check OpenMed-produced FHIR for US Core conformance, when the user mentions US Core, USCDI, must-support, profile validation, or Epic/Cerner ingestion requirements. Pairs after.

Overview

Publishermaziyarpanahi
Repositoryopenmed
Skill namevalidating-us-core
Stars
5.6K
Forks
708
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by maziyarpanahi on GitHub. Read the source before you install it.

Installation

Install the Validating Us Core AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/maziyarpanahi/openmed/tree/master/skills/validating-us-core
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maziyarpanahi/openmed.git /tmp/openmed
mkdir -p .claude/skills
cp -r /tmp/openmed/skills/validating-us-core .claude/skills/validating-us-core
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Validating Us Core in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Validating Us Core on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Validating Us Core is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Validating US Core

Producing syntactically valid R4 (which exporting-to-fhir and assembling-fhir-bundles do) is not the same as conforming to US Core — the HL7 US realm profiles that EHRs (Epic, Cerner/Oracle Health) require for ingestion and that USCDI mandates for certified exchange. This skill validates OpenMed-produced FHIR against US Core before you submit it.

When to use

Use it as the gate right before submission, after you have assembled a Bundle. Reach for it when the user says "US Core", "USCDI", "must-support", "will Epic accept this", or "validate my FHIR". It is the conformance counterpart to the mechanical builders — OpenMed builds the JSON; the HL7 validator judges it.

Quick start: run the official validator

The reference implementation is the HL7 validator_cli.jar (the same engine behind https://validator.fhir.org). Validate against the US Core package by IG:

bash
# One-time: get the validator
curl -L -o validator_cli.jar \
  https://github.com/hapifhir/org.hl7.fhir.core/releases/latest/download/validator_cli.jar

# Validate a resource/Bundle against the current US Core IG
java -jar validator_cli.jar condition.json \
  -version 4.0.1 \
  -ig hl7.fhir.us.core \
  -tx https://tx.fhir.org            # terminology server for code validation

-ig hl7.fhir.us.core pulls the current published US Core package; pin a version (e.g. -ig hl7.fhir.us.core#6.1.0) for reproducible CI. The validator exits non-zero on errors and prints issues with FHIRPath locations.

For ad-hoc checks without a JVM, paste the JSON into the public validator UI at https://validator.fhir.org (do not paste real PHI — validate synthetic or de-identified resources only).

Declare the profile you claim

US Core only validates against a profile if the resource claims it via meta.profile. Add the canonical URL for the profile you target:

json
{
  "resourceType": "Condition",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition-problems-health-concerns"
    ]
  }
}

Then java -jar validator_cli.jar condition.json -ig hl7.fhir.us.core checks it against that profile's constraints, including must-support elements.

Common conformance gaps (from OpenMed output)

OpenMed NER gives you the clinical mention; US Core wants structured context. The recurring gaps when going from raw spans to US Core:

GapUS Core expectsFix in the exporter
Missing code.codingA coded value (SNOMED/ICD-10 for Condition; LOINC for Observation; RxNorm for medication)Ground the span; codeable_concept([...]) with a real coding, not just text
Missing categoryencounter-diagnosis/problem-list-item (Condition), laboratory/vital-signs (Observation)Set category in the resource shell
Missing clinicalStatus / statusRequired status fieldsSet them per the exporting-to-fhir cheat-sheet
Missing subjectA resolvable Patient referenceReference an in-Bundle Patient; let to_bundle rewrite it
Unbound valueQuantity.codeUCUM unit codeUse system: http://unitsofmeasure.org + UCUM code
Vital signs not on the vitals profileus-core-vital-signs shape (LOINC code, vital-signs category)Use the vitals LOINC + category

"Must-support" means the producer must populate the element when the data exists. The validator flags must-support omissions as warnings; certified systems may reject them.

Workflow

  1. Export + assemble the Bundle (exporting-to-fhir, assembling-fhir-bundles).
  2. Add meta.profile for the US Core profile each resource targets.
  3. Run validator_cli.jar with -ig hl7.fhir.us.core and a -tx server.
  4. Read the issues: error = will be rejected; warning = must-support / best practice. Fix errors in the exporter, not by hand-editing JSON.
  5. Re-validate until clean; wire the validator into CI on synthetic fixtures.
  6. Submit (assembling-fhir-bundles for the transaction POST).

Turn validator output into an OperationOutcome

If you run validation programmatically, adapt the result into a FHIR OperationOutcome with OpenMed's helper so the rest of your pipeline speaks one shape:

python
from openmed.clinical.exporters.fhir import from_validation_result

# `result` exposes issues, or errors/warnings/information buckets
outcome = from_validation_result(result)   # -> R4 OperationOutcome dict

from_validation_result understands either an issues collection or errors/warnings/information buckets (strings or issue objects) and emits a clean R4 OperationOutcome (all-ok when empty). It only reads structural metadata — keep diagnostics PHI-free.

Hand-off to / from OpenMed

  • Validate OpenMed-produced FHIR: the input is the Bundle from assembling-fhir-bundles; the output is conformance issues you fix back in exporting-to-fhir.
  • OperationOutcome bridge: from_validation_result / to_operation_outcome / OperationOutcomeIssue (all in openmed.clinical.exporters.fhir) convert validator findings to R4.
  • No PHI in validation: validate synthetic or de-identified resources. If a narrative might carry PHI, run openmed.interop.fhir_operations.de_identify_bundle first.

Edge cases & gotchas

  • No meta.profile, no profile check. The validator validates base R4 only unless the resource claims the profile (or you force it with -profile <url>).
  • Terminology binding needs a -tx server. Without -tx, code-system / value-set bindings are not fully checked; many US Core required bindings will be missed. Point -tx at https://tx.fhir.org or your own Ontoserver.
  • Pin the IG version in CI (hl7.fhir.us.core#<version>). US Core revisions change must-support and bindings; an unpinned run drifts.
  • Reference resolution in Bundles. Validate the whole Bundle so urn:uuid references resolve; validating a lone resource flags references it cannot see.
  • USCDI ≠ US Core. USCDI is the data-element regulation; US Core is the FHIR profile set that implements it. Conform to the US Core profile for the matching USCDI class.
  • Warnings can still block ingestion. Some EHRs reject must-support omissions even though the validator calls them warnings. Treat must-support as required for production.

Standards & references

Frequently asked questions

What does the Validating Us Core AI skill do?

Validate FHIR R4 resources and Bundles against US Core / USCDI profiles with the official HL7 FHIR validator before submitting to an EHR. Covers running validator_cli.jar (or the public validator.fhir.org), declaring meta.profile, must-support elements, common conformance gaps (missing code/category/status), and turning validator output into a FHIR OperationOutcome. Use after exporting-to-fhir / assembling-fhir-bundles to check OpenMed-produced FHIR for US Core conformance, when the user mentions US Core, USCDI, must-support, profile validation, or Epic/Cerner ingestion requirements. Pairs...

Why use Validating Us Core on TypingMind?

Because you install it once and use it with any model. Validating Us Core is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Validating Us Core in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/maziyarpanahi/openmed/tree/master/skills/validating-us-core. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Validating Us Core?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Validating Us Core?

As many as you like. As long as a model supports skills, you can use Validating Us Core with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Validating Us Core AI skill free?

Yes. It is published on GitHub by maziyarpanahi under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇