HomeDocumentation

HL7 FHIR Compliance

Telesoft's Healthcare AI API is built with HL7 FHIR (Fast Healthcare Interoperability Resources) compatibility, enabling seamless integration with modern healthcare systems. This documentation outlines our approach to FHIR implementation and provides guidance for developers.

FHIR Overview

HL7 FHIR is a standard for healthcare data exchange that combines the best features of previous HL7 standards while leveraging current web technologies. FHIR enables interoperability between different healthcare systems, facilitating efficient and secure exchange of clinical data.

Key FHIR Concepts

  • Resources: Modular components representing clinical concepts (e.g., Patient, Observation, Medication)
  • RESTful API: HTTP-based interface for resource operations (GET, POST, PUT, DELETE)
  • Formats: JSON, XML, and RDF for data representation
  • References: Links between resources to build comprehensive clinical records
  • Extensions: Mechanism for adding custom data beyond standard resource definitions

FHIR Advantages

Developer-Friendly

Uses familiar web standards and paradigms like REST, JSON, and OAuth

Flexible Implementation

Can be applied to mobile apps, cloud communications, EHR-based data sharing, and server-to-server communication

Human Readable

Resources designed to be understood by clinicians and technical implementers alike

Extensible

Supports customization while maintaining a common core for interoperability

Telesoft FHIR Integration

Telesoft's API supports FHIR integration in the following ways:

FHIR Input Support

Our API accepts standard FHIR resources as input data, allowing you to seamlessly pass patient information from your FHIR-compatible systems directly to our AI models:

// Example: Analyzing patient data from FHIR resources
const analysis = await telesoft.diagnostics.analyze({
  fhir: {
    patient: patientResource,       // FHIR Patient resource
    conditions: conditionsList,     // Array of FHIR Condition resources
    observations: observationsList, // Array of FHIR Observation resources
    medications: medicationsList,   // Array of FHIR MedicationStatement resources
    procedures: proceduresList,     // Array of FHIR Procedure resources
    allergyIntolerances: allergiesList // Array of FHIR AllergyIntolerance resources
  },
  options: {
    includeFhirOutput: true  // Return results in FHIR format
  }
});

FHIR Output Format

Our API can return results as FHIR resources, ready for integration into your clinical systems:

  • AI-generated diagnoses as Condition resources
  • Recommended tests as ServiceRequest resources
  • Treatment suggestions as CarePlan resources
  • Risk assessments as RiskAssessment resources
  • AI interpretations as DiagnosticReport resources

FHIR API Endpoint

Enterprise customers can access our dedicated FHIR API endpoint that follows standard FHIR RESTful conventions:

// Base FHIR API URL
const fhirBaseUrl = "https://fhir.api.telesoft.us/v1";

// Example: Get AI analysis through FHIR-compliant endpoint
const diagnosticReport = await fetch(
  `${fhirBaseUrl}/DiagnosticReport/$ai-analyze`,
  {
    method: "POST",
    headers: {
      "Content-Type": "application/fhir+json",
      "Authorization": `Bearer ${apiKey}`
    },
    body: JSON.stringify({
      resourceType: "Parameters",
      parameter: [
        {
          name: "patient",
          resource: patientResource
        },
        {
          name: "observations",
          resource: observationBundle
        },
        // Additional parameters...
      ]
    })
  }
).then(response => response.json());

Our FHIR implementation is compatible with FHIR R4 (v4.0.1), the most widely adopted version of the standard. We maintain backward compatibility with FHIR STU3 for legacy systems.

Supported FHIR Resources

Telesoft's API supports the following FHIR resources:

Patient

Demographic information and administrative data about an individual

Observation

Measurements, test results, and other clinical findings

Condition

Medical conditions, problems, diagnoses, or other health matters

MedicationStatement

Record of medication usage (past, present, future)

AllergyIntolerance

Allergies, intolerances, and adverse reactions

Procedure

Actions performed on or for a patient

DiagnosticReport

Results and interpretation of diagnostic tests or assessments

CarePlan

Healthcare plan for patient or group

ImagingStudy

Content and context of DICOM imaging studies

ServiceRequest

Request for diagnostic investigations or treatments

RiskAssessment

Potential future outcomes for a subject

FamilyMemberHistory

Health events and conditions for a person related to the patient

For each supported resource, we provide full read functionality and context-appropriate write capability. Our API documentation includes detailed information about how each resource is utilized within our system.

FHIR Implementation Guide

Basic FHIR Integration

Follow these steps to integrate Telesoft's API with your FHIR-based system:

  1. Identify relevant FHIR resources for your use case (e.g., Patient, Observation, Condition)
  2. Extract these resources from your EHR or clinical system using standard FHIR APIs
  3. Pass resources to Telesoft's API using either the standard API with FHIR input format or the dedicated FHIR endpoint
  4. Process the FHIR-formatted results returned by our API
  5. Integrate AI insights back into your clinical workflow

Authentication

Our FHIR API supports standard authentication methods:

  • Bearer Token Authentication: OAuth 2.0 access tokens
  • SMART on FHIR: Healthcare-specific OAuth 2.0 profile
  • Client Certificates: For enhanced security in enterprise environments
// Example: SMART on FHIR authentication
const smartClient = FHIR.client({
  serverUrl: "https://fhir.api.telesoft.us/v1",
  tokenResponse: {
    access_token: "access_token_from_authorization_server",
    token_type: "bearer",
    expires_in: 3600,
    scope: "patient/*.read launch/patient"
  }
});

// Using the SMART client to access Telesoft FHIR API
const patientData = await smartClient.request(`Patient/${patientId}`);

// Post to AI analysis endpoint
const diagnosticReport = await smartClient.request({
  url: "DiagnosticReport/$ai-analyze",
  method: "POST",
  body: analysisParameters,
  headers: {
    "Content-Type": "application/fhir+json"
  }
});

Resource Validation

Before sending FHIR resources to our API, ensure they are properly formatted and contain required data:

  • Validate resources against official FHIR schemas
  • Include all required fields for each resource type
  • Use standard FHIR terminology and coding systems when possible
  • Ensure references between resources are properly maintained

⚠️ Important

While our API will attempt to process incomplete or malformed FHIR resources, providing well-structured and complete data will significantly improve the accuracy of AI analysis results.

FHIR Integration Examples

Example 1: Basic FHIR Integration

This example demonstrates how to analyze patient data using FHIR resources:

// JavaScript example using fetch API
async function analyzePatientWithFHIR(patientId) {
  // Fetch patient and related resources from your FHIR server
  const fhirServer = "https://your-fhir-server.org/fhir";
  
  // Get patient demographics
  const patientRes = await fetch(`${fhirServer}/Patient/${patientId}`);
  const patient = await patientRes.json();
  
  // Get observations (lab results, vitals, etc.)
  const obsRes = await fetch(
    `${fhirServer}/Observation?patient=${patientId}&_count=50`
  );
  const obsBundle = await obsRes.json();
  
  // Get conditions (diagnoses, problems)
  const condRes = await fetch(
    `${fhirServer}/Condition?patient=${patientId}&_count=50`
  );
  const condBundle = await condRes.json();
  
  // Get medications
  const medRes = await fetch(
    `${fhirServer}/MedicationStatement?patient=${patientId}&_count=50`
  );
  const medBundle = await medRes.json();
  
  // Send to Telesoft API for analysis
  const analysis = await fetch("https://api.telesoft.us/v1/diagnostics/analyze", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Authorization": `Bearer ${TELESOFT_API_KEY}`
    },
    body: JSON.stringify({
      fhir: {
        patient: patient,
        observations: obsBundle.entry.map(e => e.resource),
        conditions: condBundle.entry.map(e => e.resource),
        medications: medBundle.entry.map(e => e.resource)
      },
      options: {
        includeFhirOutput: true,
        confidenceThreshold: 0.7
      }
    })
  }).then(response => response.json());
  
  // Process FHIR-formatted results
  const suggestedDiagnoses = analysis.fhirOutput.conditions;
  const recommendedTests = analysis.fhirOutput.serviceRequests;
  const treatmentPlan = analysis.fhirOutput.carePlan;
  
  return {
    suggestedDiagnoses,
    recommendedTests,
    treatmentPlan
  };
}

Example 2: Using the FHIR API Endpoint

This example shows how to use our dedicated FHIR endpoint:

// Using a FHIR client library (e.g., fhir.js)
const client = new FHIR.client({
  baseUrl: "https://fhir.api.telesoft.us/v1",
  auth: {
    type: "bearer",
    token: TELESOFT_API_KEY
  }
});

// Create a Parameters resource for the AI analysis
const parameters = {
  resourceType: "Parameters",
  parameter: [
    {
      name: "patient",
      resource: patient // FHIR Patient resource
    },
    {
      name: "observations",
      resource: {
        resourceType: "Bundle",
        type: "collection",
        entry: observations.map(obs => ({ resource: obs }))
      }
    },
    {
      name: "conditions",
      resource: {
        resourceType: "Bundle",
        type: "collection",
        entry: conditions.map(cond => ({ resource: cond }))
      }
    },
    {
      name: "analysisType",
      valueString: "diagnostic"
    },
    {
      name: "options",
      valueString: JSON.stringify({
        confidenceThreshold: 0.7,
        includeRationale: true
      })
    }
  ]
};

// Call the AI analysis operation
const result = await client.operation({
  name: "$ai-analyze",
  resourceType: "DiagnosticReport",
  method: "POST",
  body: parameters
});

// The result is a FHIR DiagnosticReport with AI analysis results
console.log("AI Analysis:", result.conclusion);
console.log("Suggested diagnoses:", result.conclusionCode);

// Recommendations are included as referenced resources
const recommendations = result.presentedForm[0].data;
console.log("Recommendations:", JSON.parse(recommendations));

FHIR Terminology

Our FHIR implementation supports the following standardized terminology systems:

Terminology SystemURIUsage
SNOMED CThttp://snomed.info/sctClinical findings, disorders, procedures
LOINChttp://loinc.orgLaboratory observations, clinical measurements
ICD-10http://hl7.org/fhir/sid/icd-10Diagnoses, billing codes
RxNormhttp://www.nlm.nih.gov/research/umls/rxnormMedications, drug products
UCUMhttp://unitsofmeasure.orgUnits of measure

When submitting FHIR resources to our API, using these standard terminology systems improves interoperability and ensures accurate AI analysis.

Best Practices

Data Quality

  • Use standard terminologies (SNOMED CT, LOINC, RxNorm) when coding clinical concepts
  • Include relevant metadata (e.g., dates, provenance) with each resource
  • Provide complete patient context for more accurate AI analysis
  • Use consistent units of measure (preferably UCUM)
  • Include original text alongside coded entries when available

Performance Optimization

  • Limit resource retrieval to clinically relevant time periods
  • Filter observations to those relevant to the current clinical question
  • Use appropriate search parameters when querying FHIR servers
  • Consider using FHIR bulk data API for large datasets
  • Implement client-side caching for frequently accessed resources

Integration Approaches

  • EHR Integration: Use SMART on FHIR to embed AI capabilities within existing EHR workflows
  • Standalone Applications: Leverage FHIR API for secure data exchange with clinical systems
  • Batch Processing: Use FHIR bulk data API for population health analysis
  • Clinical Decision Support: Implement CDS Hooks with AI-powered suggestions
  • Data Warehouse Integration: Transform FHIR data for analytics and reporting

ℹ️ Enterprise Support

Enterprise customers can access additional FHIR integration support, including custom implementation guides, terminology mapping services, and dedicated integration specialists. Contact enterprise@telesoft.us for more information.