Articles
/
Forms

AI Assistant for FHIR SDC and Analytics: Closing the Loop From Collection to Clinical Insights

Olim Saidov, Maria Ryzhikova
September 22, 2025
7 minutes

The AI Assistant represents the first comprehensive solution guiding users through the entire FHIR Questionnaire lifecycle — from intelligent form creation and extraction and population logic setup to generating ViewDefinitions for analysis. This end-to-end approach eliminates the traditional fragmentation where different tools handle different stages of the data capture workflow. 

What Makes This Solution Innovative: Features and Benefits

The no-code AI workflow enables form and logic generation through natural language prompts embedded directly into the Form Builder interface. Users maintain full control, reviewing and modifying AI suggestions at any stage. When a clinician requests "add a depression screening section," the AI creates properly coded items with LOINC annotations, appropriate answer scales, and scoring logic — all through conversational interaction rather than manual configuration. 

Automated ViewDefinition creation transforms nested FHIR QuestionnaireResponse data into flat, analytics-ready formats without technical intervention. The AI generates SQL-mappable views based on questionnaire structure and extraction logic, immediately testable with synthetic data and visualizable through Vega-Lite charts. This bridges the persistent gap between data collection and analysis that has long plagued healthcare organizations. 

The solution remains FHIR-native throughout the entire workflow, ensuring SDC-compliant data capture and HL-7 aligned outputs. Real-time validation allows users to test form behavior, population logic, and extraction rules on the fly, catching errors before deployment. The visual PDF import capability digitizes existing paper forms while preserving clinical intent, automatically inferring appropriate data types and suggesting relevant terminologies. 

Current and Planned Deployment in Real-World Settings 

The AI Assistant was released in August 2025. Core functionality, including AI-driven FHIR Questionnaire generation, extraction, and population rule definition, and ViewDefinition creation, has been implemented and is undergoing internal testing. A testing environment Aidbox Public Builder is available for feedback and validation from select healthcare organizations. 

The deployment strategy targets progressive expansion across healthcare domains: 

  1. Clinical care settings will use the system for triage assessments and patient histories, with emergency departments and primary care practices as early adopters. 
  2. Research organizations will leverage the platform for standardized data collection in multi-site trials. 
  3. Public health agencies are positioned to deploy the system for population surveys and disease surveillance. 

As adoption grows, we aim to support broader healthcare settings, including population-level reporting initiatives and cross-organizational data standardization efforts. 

Realized or Anticipated Impact on Health or Healthcare

Efficiency gains

The primary impact centers on dramatic efficiency gains — reducing form creation time from days to minutes. This acceleration enables healthcare organizations to respond rapidly to emerging needs, whether implementing new clinical protocols, adapting to regulatory changes, or deploying emergency response questionnaires. The time saved translates directly into more resources available for patient care rather than administrative overhead.

Accessibility

Accessibility is another transformative impact.: enabling non-technical staff to author interoperable forms, the solution democratizes FHIR SDC adoption. Clinicians, quality managers, and researchers can create standardized forms without requiring informaticists or developers. This workforce enablement expands the pool of people who can contribute to digital health infrastructure, accelerating standardization efforts across organizations. 

Boosting HL7 adoption

The solution directly boosts HL7 adoption by lowering technical barriers that have historically limited FHIR implementation. Organizations that previously avoided FHIR due to complexity can now leverage its benefits through intuitive AI assistance. This expanded adoption strengthens the entire healthcare interoperability ecosystem, as more organizations both contribute to and benefit from standardized data exchange.

Data quality and reusability

Data quality and reusability improvements ripple throughout the healthcare system. Structured, consistent data capture ensures information collected in one context can be reliably used in another — supporting clinical decision-making, quality reporting, research, and public health surveillance. The automated ViewDefinition generation makes this data immediately analyzable, closing the loop from collection to insight. Healthcare organizations gain the ability to derive value from their data without additional technical infrastructure or expertise, enhancing both individual patient care and population health management. 

Architecture and Implementation Approach 

The AI Assistant implements a tool-based architecture with 50 specialized functions organized into nine categories, each handling specific FHIR SDC operations. 

  • Client-side system
    Runs entirely client-side, establishing direct connections to AI providers. Built on ClojureScript and React with Re-frame state management, the system processes natural language requests through hierarchical prompt engineering that enforces safety constraints, FHIR compliance, and structured workflows. 
  • Specialized tools
    The architecture distributes tools strategically: 
    • Item Management (9 tools), 
    • Choice Configuration (7 tools), 
    • Population strategies (7 tools), 
    • Extraction (5 tools), 
    • ViewDefinition/Analytics (5 tools), 
    • Response Management (5 tools), 
    • Validation (2 tools), 
    • Metadata (4 tools), 
    • Utilities (6 tools). 

Tool descriptions embed cross-references to guide proper sequencing, substantially reducing conflicting operations. The to-do management tool maintains focus across complex operations, dramatically improving completion rates for multi-step tasks. 

  • Privacy by design
    Privacy emerges from architectural design — conversations persist only in the browser’s localStorage, with direct AI provider connections eliminating data interception risks. This zero-infrastructure approach scales linearly as each user provides their own computational resources. 
  • Flexibility
    Organizations switch between eight supported AI providers through configuration changes, adapting to evolving privacy, cost, or performance requirements without code modifications. 

HL7 Standards as the Foundation for AI Success 

The HL7 FHIR ecosystem provided the essential foundation that made this AI Assistant possible. FHIR SDC's comprehensive specification — with its 20+ item types, rich extension model, and standardized operations — gave us a precise target for AI translation. SDC's structured approach to form definition enabled reliable mapping from natural language requests to clinical data structures. 

FHIRPath expressions, despite their complexity, offered a standardized computation language that the AI could learn and validate. SQL on FHIR's ViewDefinition enabled immediate analytics on collected data, transforming hierarchical responses into queryable tables. 

Beyond HL7, Vega-Lite's declarative visualization grammar aligned perfectly with FHIR's resource-oriented philosophy, enabling portable analytics dashboards. The combination of these standards — FHIR for structure, FHIRPath for logic, SQL on FHIR for analytics, and Vega-Lite for visualization — created a complete ecosystem where AI could operate with confidence, knowing that generated artifacts would be valid, interoperable, and immediately useful in production systems. 

AI Technologies and Approaches Used 

The system employs generative AI through large language models from multiple providers (Claude, GPT-4, Gemini) using the Vercel AI SDK, enabling provider-agnostic operation with consistent behavior. This generative AI approach allows the system to understand clinical intent from natural language and synthesize appropriate FHIR structures, going beyond simple classification or extraction. Natural language processing maintains conversational context across interactions through browser-based state management, resolving references like "the same validation" or "all of them" from conversation history. Clinical domain knowledge embedded in prompts enables recognition of patterns like paired blood pressure measurements and BMI calculations. 

Prompt engineering uses a hierarchical control framework with five-level priority constraints (safety → FHIR compliance → user intent → preservation → performance). Workflow templates enforce structured execution: task-first decomposition, context gathering before modifications, and read-modify-write patterns with validation. The system embeds domain patterns and error corrections directly in prompts, preventing common mistakes through proactive guidance. 

Multi-modal AI processes PDF documents, analyzing text and visual layout to extract form structures. The system recognizes grouped checkboxes as choice fields, identifies scoring patterns in assessments, and infers appropriate FHIR types from visual cues. Extracted forms automatically receive suggested LOINC codes and validation rules based on recognized clinical concepts.

Tool orchestration coordinates AI capabilities through 50 specialized functions with semantic APIs optimized for model consumption. Cross-referenced tool descriptions guide sequencing, while the to-do tool maintains focus across complex operations. This decomposition substantially improved success rates for multi-step operations compared to monolithic approaches. 

FHIRPath validation employs an expert sub-agent pattern for enhanced accuracy. When the main assistant needs to validate an expression, it invokes a specialized sub-agent initialized with a dedicated prompt containing comprehensive FHIRPath knowledge, common pitfalls, and correction patterns. This sub-agent receives only the expression and relevant context — not the full conversation history — allowing focused analysis without distraction. The isolation prevents context pollution, while the specialized prompt ensures consistent, accurate validation. This pattern significantly reduced expression errors compared to inline validation by the main assistant. 

Key Learnings from the Work

  1. Tool decomposition
    With semantic APIs, each tool's focused responsibility and clear parameter naming enabled reliable AI operation selection. Controlling data flow by limiting inputs to essential context and constraining outputs to structured results prevented context explosion that degrades performance. 
  2. To-do pattern
    This complex workflow maintains a persistent state across tool invocations. Rather than relying on context memory, the external to-do list ensured consistent completion of multi-step operations that previously failed due to context drift. 
  3. Sub-agents for validation
    Sub-agents for specialized tasks, such as FHIRPath validation, eliminate context pollution. These isolated agents received only relevant data, enabling deeper analysis without distractions from conversation history, while improving response times through parallel processing. 
  4. Standards as advantage
    Well-established standards provided substantial advantages as generative AI models already possess extensive knowledge about FHIR SDC, FHIRPath, and Vega-Lite from their training data. This pre-existing knowledge enabled accurate generation and validation without extensive few-shot learning required for proprietary formats.

Challenges and Obstacles That Could Be Improved by HL7 

The verbosity of FHIR SDC models proved to be a double-edged sword. While the expressiveness and extensiveness enable incredible flexibility and interoperability, this complexity consistently challenged AI generation. The AI frequently made errors when generating questionnaire items because many properties are defined through extensions rather than direct attributes. Properties like calculated expressions, enable-when conditions, and population configurations exist as extensions, creating a nested structure that AI models struggle to navigate consistently. 

We overcame this challenge by building a compact representation that flattens item properties, extension values, and questionnaire properties with their extensions into direct attributes. This simplified model merges extensions into first-class properties while preserving the questionnaire's hierarchical structure, making it easier for AI to understand and manipulate. This transformation dramatically improved AI accuracy in form generation. 

This experience highlights an important tension: FHIR's extension-based model exists for excellent reasons — interoperability, extensibility, and backward compatibility. These are perfectly justified design decisions for a standard that must evolve while maintaining compatibility. However, AI systems struggle with these nested structures, requiring workarounds like our simplified representation to achieve reliable generation. 

Legal and Policy Implications 

The system architecture reflects careful consideration of healthcare regulatory requirements. By design, the solution works with synthetic or de-identified data by default, ensuring compliance with privacy regulations during form development and testing phases. No protected health information (PHI) passes through AI models in the standard cloud deployment — all AI interactions occur with form structures and logic, not patient data. 

For organizations requiring complete data isolation, the system supports fully private on-premises deployments where AI models can process PHI within the organization's security perimeter. This flexibility allows healthcare organizations to choose deployment models that align with their specific regulatory interpretations and risk tolerance.

Licensing models explicitly consider HIPAA and GDPR obligations, with clear delineation of responsibilities between the software provider and healthcare organizations. The browser-based architecture, where AI conversations remain in local storage and connect directly to AI providers, simplifies compliance by eliminating intermediate data processors. Organizations maintain control over their data governance policies while leveraging AI capabilities. 

Ethical Adjustments to the Solution 

The system enforces human oversight as a fundamental design principle. All AI outputs are explicitly designed to be human-reviewed and editable before production use. The AI Assistant never autonomously deploys forms or modifies live clinical workflows — every change requires human confirmation. This approach ensures clinical judgment remains paramount while AI serves as an augmentation tool rather than a replacement for human expertise. 

Clear boundaries define the AI's role: it supports data structuring and transformation, but never makes medical decisions. The system cannot diagnose conditions, recommend treatments, or interpret clinical results. Its scope remains strictly limited to technical assistance with form creation, logic configuration, and data transformation. This limitation is communicated clearly in the interface to prevent misuse or over-reliance on AI capabilities. 

Comprehensive audit trails maintain accountability for AI-assisted development. Version control tracks all changes, with attribution to both the AI Assistant and the reviewing user. Audit logs record every AI interaction, tool invocation, and modification, creating a complete history of how forms evolved. This transparency enables quality assurance, regulatory compliance, and continuous improvement of both the AI system and clinical workflows. 

Conclusion

The AI Assistant demonstrates how generative AI, grounded in HL7 FHIR and SDC standards, can transform data capture from a fragmented process into an integrated lifecycle. By uniting natural language–driven form creation, automated extraction and population logic, and the direct generation of analytics-ready views, it establishes a seamless workflow that reduces complexity while preserving clinical intent.

What emerges is more than a tool — it is a model for how AI and open standards can work together to close the loop between data collection and actionable insights. In doing so, it empowers clinicians, researchers, and public health organizations to build a more responsive, interoperable, and data-driven healthcare ecosystem.

Try the AI Assistant yourself in Aidbox Public Builder — and see the demo that shows how forms turn into insights.

How did you like the article?
No items found.
Be the first to know!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

contact us

Get in touch with us today!

By submitting the form you agree to Privacy Policy and Cookie Policy.
Thank you!
We’ll be in touch soon.

In the meantime, you can:
Oops! Something went wrong while submitting the form.

Never miss a thing
Subscribe for more content!

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
By clicking “Subscribe” you agree to Health Samurai Privacy Policy and consent to Health Samurai using your contact data for newsletter purposes