Exchange data using FHIR model
As explained earlier, the iCure data model offers you the needed flexibility in order to represent your medical data. To have more information about it and understand fully the possibilities of it, we encourage you to visit this page.
However, it can seem difficult for you at the beginning to understand how to "map" your own data to the iCure data model. As said earlier, iCure Data Model has been built in order to be compatible with higher level Medical Data conceptual Data Models. That's why you have the possibility to make requests to iCure using FHIR format, in order to exchange your data in a more "familiar" / common way.
If you decide to use the FHIR APIs, iCure will by itself transform it to the corresponding iCure Data Model representation.
At the end of this tutorial, you will be able to exchange FHIR Patient and Observation data, using the iCure - FHIR Bridge API.
Register on iCure platform
Make sure you created your iCure environment, and that you possess the following information :
Your iCure user login - password;
Your iCure user private encryption key;
Load private encryption key in local storage
To guarantee the security of your data, iCure encrypts all of them, based on the keys pair you generated during your registration.
As your private encryption key is not stocked in iCure, you will need to provide it first in your web session to the iCure - FHIR Bridge API before making your requests.
import fetch from "node-fetch";
const host = 'https://dxm.icure.dev';
const hcpId = '2d205ac4-c8c9-428b-b68e-d9381da235d2';
let key = {
key: '308204bd02...8b40fdc0bc'
}
let credentials = 'Y3ZAdGFrdG...MzOGY1MTQ='
let keyPutInCache = await fetch(`${host}/rest/icdx/v1/keychain/${hcpId}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Basic ${credentials}`
},
body: JSON.stringify(key)
})
.then(response => response.json());
console.log(`Key put in cache : ${keyPutInCache}`)In the above example, do not forget to :
Use your own login - password;
Use your private encryption key;
Supported FHIR APIs
Based on the FHIR Specification, iCure is currently supporting the following FHIR APIs :
FHIR Resource Id
For Create requests, the id provided in FHIR resources will be transformed as a new identifier, using system https://dxm.icure.dev. At its place, iCure will provide its own generated id to guarantee the data coherence.
Create a patient
Import a new patient in your iCure environment, based on FHIR r4 Patient. All the references you are passing into the patient (generalPractitioner, organization, ...) need to be previously imported into the iCure environment.
Read a patient
Find a patient, using either its FHIR id or its iCure id.
Delete a patient
Delete a patient, using either its FHIR id or its iCure id.
Search patients
Search patients based on FHIR Specification. For now, iCure permits you to search patients by :
_id;
gender;
name;
_has:Observation:_tag;
_has:Observation:code;
Create an observation
Import a new observation in your iCure environment, based on FHIR r4 Observation.
All the references you are passing into the observation (subject, ...) need to be previously imported into the iCure environment.
Read an observation
Find an observation, using either its FHIR id or its iCure id.
Search observations
Search observations based on FHIR Specification. For now, iCure permits you to search observations by :
_tag;
code;
_has:Patient:_id;
_has:Patient:gender;
_has:Patient:name;
Last updated
Was this helpful?