Overview
FHIR (Fast Healthcare Interoperability Resources) is an HL7 standard for representing and exchanging healthcare data. It defines structured resource schemas (such as Observation, Patient, Encounter, etc.) along with RESTful APIs, allowing disparate systems to share clinical information without bespoke integrations.
In Shen.AI, the SDK allows you to convert measurement results into FHIR-compliant Observation resources, allowing you to push data such as HR, HRV, BR, BP, Stress Index, Cardiac Workload, or BMI into electronic health records (EHRs), research databases, or other services that already consume FHIR.
The SDK includes:
- A method for mapping measurement results to the appropriate fields in the FHIR
Observationresource. - A method for sending the generated FHIR resources to an external FHIR server. Error handling is limited - the method does not throw exceptions. If the request fails, the server response provided via the callback will be an empty string.
Example Observation:
{
"code": {
"coding": [
{
"code": "survey-composite",
"display": "Composite Physiological Metrics",
"system": "http://loinc.org"
}
],
"text": "Composite Physiological Metrics"
},
"component": [
{
"code": {
"coding": [
{
"code": "8867-4",
"display": "Heart rate",
"system": "http://loinc.org"
}
],
"text": "Heart rate"
},
"valueQuantity": {
"unit": "beats/min",
"value": 67.85840012097415
}
},
{
"code": {
"coding": [
{
"code": "SDNN",
"display": "Standard Deviation of NN intervals",
"system": "custom"
}
],
"text": "Standard Deviation of NN intervals"
},
"valueQuantity": {
"unit": "ms",
"value": 34.06930255557805
}
},
{
"code": {
"coding": [
{
"code": "STRESS_IDX",
"display": "Stress Index",
"system": "custom"
}
],
"text": "Stress Index"
},
"valueQuantity": {
"unit": "unitless",
"value": 2.2
}
},
{
"code": {
"coding": [
{
"code": "9279-1",
"display": "Respiratory rate",
"system": "http://loinc.org"
}
],
"text": "Respiratory rate"
},
"valueQuantity": {
"unit": "breaths/min",
"value": 15.065817475830594
}
},
{
"code": {
"coding": [
{
"code": "39156-5",
"display": "Body Mass Index",
"system": "http://loinc.org"
}
],
"text": "Body Mass Index"
},
"valueQuantity": {
"unit": "kg/m2",
"value": 24.114038467407227
}
},
{
"code": {
"coding": [
{
"code": "CW",
"display": "Cardiac Workload",
"system": "custom"
}
],
"text": "Cardiac Workload"
},
"valueQuantity": {
"unit": "mmHg/s",
"value": 129
}
},
{
"code": {
"coding": [
{
"code": "8480-6",
"display": "Systolic blood pressure",
"system": "http://loinc.org"
}
],
"text": "Systolic blood pressure"
},
"valueQuantity": {
"unit": "mmHg",
"value": 114.0851821899414
}
},
{
"code": {
"coding": [
{
"code": "8462-4",
"display": "Diastolic blood pressure",
"system": "http://loinc.org"
}
],
"text": "Diastolic blood pressure"
},
"valueQuantity": {
"unit": "mmHg",
"value": 71.01000213623047
}
}
],
"effectiveDateTime": "2025-10-13T10:28:12Z",
"resourceType": "Observation",
"status": "final"
}ShenaiSdk.getResultAsFhirObservation();
final response = await ShenaiSdk.sendResultFhirObservation("https://hapi.fhir.org/baseR4/Observation/");