Linking openEHR and FHIR
The FHIR Patient resource can be used to store the demographic data of patients and can be linked with an EHR created in the openEHR. FHIR provides us endpoints for posting resources to the server.
To link a FHIR Patient resource and to the openEHR EHR, we can use an exclusive UUID. The ID present in the response JSON after posting a FHIR patient resource can be taken out and used to create an EHR in openEHR by using a PUT request.
To do this, first create an axios instance for FHIR server and openEHR server
1
export const FHIR = axios.create({baseURL:"(insert BaseURL of FHIR server)"});
Copied!
1
export const openehr = axios.create({baseURL:"(insert BaseURL of the openEHR server)",
2
headers: {
3
Accept: "application/json",
4
}});
Copied!
Then send a request to the create a new patient and extract the id from the response JSON
1
const resp = await FHIR.post("/Patient", data);
2
if (resp.status == 201) {
3
ehrId = resp.data.id;
4
}
Copied!
Use this id to create a new EHR by sending a PUT request to the openEHR server
1
const respEHR = await openehr.put(`/ehr/${ehrId}`);
Copied!
Done! The FHIR Patient resource and the EHR of the patient on the openEHR server are linked by a single and unique ID. This ID can be used to retrieve data from both the FHIR and the openEHR servers.
Last modified 1mo ago
Copy link