extract-clinical-entities-to-fhir
/extract-clinical-entities-to-fhir
Wydobywa jednostki kliniczne z syntetycznego lub zanonimizowanego tekstu za pomocą OpenMed i mapuje je na zasoby FHIR R4 oraz Bundle bez zgadywania kodów terminologii.
- Autor
- maziyarpanahi ↗
- Repozytorium
- openmed ↗
- Licencja
- Apache-2.0
- Ostatnia zmiana repozytorium
- 27.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 2
Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
Co robi i kiedy
Wydobywa jednostki kliniczne z syntetycznego lub zanonimizowanego tekstu za pomocą OpenMed i mapuje je na zasoby FHIR R4 oraz Bundle bez zgadywania kodów terminologii.
Oryginalny opis (EN)
Extract clinical entities from synthetic or already de-identified text with OpenMed and map them into deterministic FHIR R4 resources and a Bundle. Use when an agent must turn local clinical NER output into Conditions, MedicationStatements, Observations, or other FHIR resources without inventing terminology codes.
Jak działa
- Procedure
- Runnable synthetic example
- Safety checks
- Repository example
Podgląd SKILL.md
---
name: extract-clinical-entities-to-fhir
description: "Extract clinical entities from synthetic or already de-identified text with OpenMed and map them into deterministic FHIR R4 resources and a Bundle. Use when an agent must turn local clinical NER output into Conditions, MedicationStatements, Observations, or other FHIR resources without inventing terminology codes."
---
# Extract clinical entities to FHIR
Separate extraction from clinical coding. OpenMed finds spans and supplies the
mechanical FHIR builders; the application decides which resource type and
status are clinically appropriate.
## Procedure
1. Keep the source synthetic, or de-identify it inside the trusted boundary
before extraction.
2. Run `openmed.analyze_text` with the task-appropriate clinical model.
3. Filter predictions by label and confidence; preserve offsets in a
PHI-safe audit record.
4. Map each accepted span to the correct FHIR resource type.
5. Add terminology codes only from a user-approved mapping or terminology
service. Never invent a code.
6. Assemble resources with `to_bundle` and validate against the target profile.
## Runnable synthetic example
Install the model runtime first with `python -m pip install "openmed[hf]"`.
```python
import json
from openmed import analyze_text
from openmed.clinical.exporters.fhir import to_bundle
note = "Assessment: type 2 diabetes mellitus is stable on metformin."
result = analyze_text(
note,
model_name="disease_detection_superclinical",
confidence_threshold=0.5,
)
resources = [{"resourceType": "Patient", "id": "synthetic-patient"}]
for index, entity in enumerate(result.entities, start=1):
if entity.label.upper() not in {"CONDITION", "DIAGNOSIS", "DISEASE"}:
continue
resources.append(
{
"resourceType": "Condition",
"id": f"condition-{index}",
"clinicalStatus": {
"coding": [
{
"system": (
"http://terminology.hl7.org/CodeSystem/"
"condition-clinical"
),
"code": "active",
}
]
},
"verificationStatus": {
"coding": [
{
"system": (
"http://terminology.hl7.org/CodeSystem/"
"condition-ver-status"
),
"code": "confirmed",
}
]
},
# A text-only CodeableConcept is preferable to an invented code.
"code": {"text": entity.text},
"subject": {"reference": "Patient/synthetic-patient"},
}
)
if len(resources) == 1:
raise RuntimeError("No condition spans met the label and confidence rules")
bundle = to_bundle(resources, doc_id="synthetic-note-001")
print(json.dumps(bundle, indent=2))
```
## Safety checks
- Do not put raw identifiers, source text, or reversible mappings in logs,
`OperationOutcome.diagnostics`, or trace metadata.
- Keep a patient identity service separate from extracted clinical facts.
- Preserve negation, temporality, and experiencer context before asserting a
resource as active or confirmed.
- Use a text-only `CodeableConcept` when no approved code is available.
- Validate the Bundle against the receiver's FHIR and profile requirements.
- Do not bundle restricted terminologies; use the user's licensed service.
## Repository example
Read and run
[the redaction-to-FHIR walkthrough](../../examples/first_five_minutes_redact_extract_fhir.py)
for an offline-friendly pipeline with deterministic extraction.
Wersje
W bazie nie ma innych skilli o nazwie extract-clinical-entities-to-fhir.
Migawka bazy z 28.10.2026 · wersja paczki 74401df33233 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100exporting-to-fhir
Zamienia wyniki rozpoznawania encji OpenMed na zasoby FHIR R4, takie jak Condition, MedicationStatement i Observation, za pomocą wbudowanych eksporterów OpenMed. - 100assembling-fhir-bundles
Pakuje zasoby FHIR R4 z wyników OpenMed w jeden poprawny Bundle transakcyjny gotowy do wysłania do EHR, z urn:uuid, przepisywaniem referencji i warunkowym tworzeniem. - 95healthchain
Pomaga pisać Pythona łączącego się z API FHIR: tworzy i waliduje zasoby FHIR, obsługuje CDS Hooks i MCP, z Epic i Medplum. - 100ehr-data-parsing
Parsuje i wyciąga dane kliniczne z wiadomości HL7v2 i zasobów FHIR R4 w Pythonie: segmenty PID, OBX i MSH, zasoby Patient i Observation, wiadomości ADT i ORU oraz konwersja HL7 do FHIR. - 90healthcare-fhir
Projektuje RESTowe wymiany danych klinicznych w standardzie HL7 FHIR z terminologią SNOMED i LOINC. - 100fhir-api
Wspiera implementację serwerów i klientów FHIR REST zgodnie ze specyfikacją HL7: operacje, wyszukiwanie, historia, bundle, transakcje i negocjacja treści.