FHIRConnect RESTful Implementation Guide
0.1.0 - ci-build
FHIRConnect RESTful Implementation Guide - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
Converts an openEHR Composition to FHIR resources.
Endpoint: POST [base]/$tofhir
{
"resourceType": "Parameters",
"parameter": [
{
"name": "composition",
"valueString": "<stringified openEHR Composition JSON>"
},
{
"name": "ehr_id",
"valueString": "53d89df2-5501-4455-9a65-565a5d1ddb7c"
},
{
"name": "patient",
"valueReference": { "reference": "Patient/123" }
},
{
"name": "provenance",
"part": [
{
"name": "policy",
"valueUri": "http://example.org/policy/data-sharing"
}
]
}
]
}
Parameter notes:
| Name | Required | Type | Description |
|---|---|---|---|
composition |
yes | string | openEHR Composition as stringified JSON |
ehr_id |
no | string | openEHR EHR identifier |
patient |
no | Reference(Patient) | FHIR Patient to populate subject/patient references |
provenance |
no | — | Provenance policy; engine resolves remaining provenance data |
The response is a FHIR Bundle. The Bundle type is implementation-dependent. An OperationOutcome MAY be included as an entry.
Converts a FHIR Bundle to an openEHR Composition.
Endpoint: POST [base]/$toopenehr
The request body is a FHIR Bundle containing the resources to be converted.
On success, the response contains only the composition parameter:
{
"resourceType": "Parameters",
"parameter": [
{
"name": "composition",
"valueString": "{\"_type\": \"COMPOSITION\", \"name\": {\"_type\": \"DV_TEXT\", \"value\": \"International Patient Summary\"}, ...}"
}
]
}
When a mapping issue occurs — e.g. a source element could not be mapped, a required field was absent, or only a partial result could be produced — an additional return parameter carrying an OperationOutcome SHOULD be included alongside composition. The presence of an OperationOutcome does not imply the composition is absent; a partial result MAY be returned together with issues describing what could not be mapped.
{
"resourceType": "Parameters",
"parameter": [
{
"name": "composition",
"valueString": "{\"_type\": \"COMPOSITION\", \"name\": {\"_type\": \"DV_TEXT\", \"value\": \"International Patient Summary\"}, ...}"
},
{
"name": "outcome",
"resource": {
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "warning",
"code": "incomplete",
"details": {
"text": "Element Observation.effectivePeriod could not be mapped; no corresponding openEHR archetype path found."
}
}
]
}
}
]
}
Parameter notes:
| Name | Required | Type | Description |
|---|---|---|---|
composition |
yes | string | Resulting openEHR Composition as stringified JSON |
outcome |
no | OperationOutcome | Present when mapping issues occurred; describes elements that could not be mapped or partial failures |