Skip to main content
SofIA SDK enables automation of clinical documentation workflows, from information capture during consultations to structured report generation. This guide explains how automation works and how to integrate it effectively.

Automation architecture

Automatic generation workflow

1

Interaction

The healthcare professional interacts with the SofIA SDK via voice or text during the consultation.
2

Transcription and context

The SDK captures the conversation and sends it along with patient context to the Cognitive Framework.
3

AI processing

Specialized agents process the information, generating structured clinical documentation.
4

Report delivery

The structured report is returned to the SDK, which delivers it to the EHR/HIS via the handleReport callback.

System components

  • Data capture: Audio transcription and patient contextual data
  • Intelligent processing: Cognitive framework with specialized agents
  • Structured generation: Reports conforming to predefined JSON schemas
  • Automatic integration: Data delivery through callbacks for persistence

Types of automation

Automatic document generation

SofIA automatically generates structured clinical documentation based on:
  • Consultation transcription: Real-time processed doctor-patient conversation
  • Patient contextual data: Information provided in patientdata
  • Predefined schema: Structure defined in template that specifies what information to generate
  • Automatic validation: Clinical coherence verification before report delivery

Structured report integration

SofIA’s automation focuses on report generation from consultation transcripts. The SDK generates structured JSON reports matching your template schema, which your application can then use to populate forms, update EHR fields, or create clinical documents. SofIA uses specialized AI agents for documentation generation and quality review.

Automation configuration

Required properties for automation

To enable automation, SofIA SDK requires:
  • template: JSON schema that defines what information to generate and how to structure it
  • handleReport: Callback function that receives the generated report
  • userid and patientid: Identifiers for traceability and context
  • patientdata (optional): Patient contextual information to enrich generation

Complete automation example

<sofia-sdk
  baseurl="https://api.omniloy.com"
  wssurl="wss://wss.omniloy.com"
  apikey="your-api-key"
  userid="dr-smith-789"
  patientid="patient-123"
  templateid="soap-general-v1"
  template='{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "SOAP Note",
    "type": "object",
    "properties": {
      "subjective": { "type": "string", "description": "Patient reported symptoms" },
      "objective": { "type": "string", "description": "Clinical examination findings" },
      "assessment": { "type": "string", "description": "Diagnosis" },
      "plan": { "type": "string", "description": "Treatment plan" }
    },
    "required": ["subjective", "assessment"]
  }'
  handle-report="handleReport"
  patientdata='{"fullName":"Jane Doe","birthDate":"1985-05-15","extraData":{"medical_practice":"Internal Medicine"}}'
></sofia-sdk>

<script>
function handleReport(report) {
  console.log('Report received:', report);
  // Send to your EHR/HIS system
  fetch('/api/clinical-reports', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      patientId: 'patient-123',
      report: report,
      generatedAt: new Date().toISOString()
    })
  });
}
</script>

handleReport callback operation

The handleReport callback is the main integration point:
  • Data reception: Receives structured report according to defined schema
  • JSON format: Data arrives in validated JSON format
  • Execution timing: Executes when user requests documentation generation
  • Persistence responsibility: Callback must manage saving in EHR/HIS system

Implementation best practices

Schema design

  • Define fields relevant to the specific consultation type
  • Provide detailed description values for each field to guide AI extraction
  • Use reference to enable automatic clinical coding (SNOMED CT, ICD-10, LOINC)
  • Include required only for fields that are essential to every consultation

Integration management

  • Validate structure and content of received reports before persisting
  • Implement error handling for network or save failures
  • Maintain audit records of who generated what and when
  • Control schema versions for backward compatibility

Quality considerations

  • Establish professional review processes for generated documentation
  • Start with partial automation and increase scope gradually
  • Use feedback to refine schemas and improve output quality

Limitations and considerations

Technical limitations

  • Schema dependency: Automation quality depends on JSON schema design
  • Available context: Generation is based on information available during consultation
  • Audio processing: Requires sufficient audio quality for accurate transcription
  • Connectivity: Needs stable connection for real-time processing
  • The healthcare professional maintains responsibility for all generated content and clinical decisions
  • Review and validate information before final persistence in your EHR/HIS
  • Ensure patient consent for AI-assisted documentation per applicable regulations
  • Maintain traceability records for compliance audits

Next steps