AnpherosAnpheros PlatformDevelopers

Virtual care and AI doctors: the data they need

A virtual visit as FHIR R4 data — booking, intake, home readings, the visit, follow-up — and how an AI assistant gets a consented, source-labelled view. Tested flow.

A virtual clinic — whether the clinician is a person on video or an AI assistant helping them — is only as good as the patient data it can see before, during and after the visit: recent measurements, active problems and medications, what the patient reported, and a record of what was decided. The video call is the easy part. This page maps a virtual visit to HL7 FHIR R4 resources, shows how an AI assistant can be given a consented, source-labelled view of the record, and runs the whole flow against the Anpheros Platform, including one limitation we found while doing it.

A virtual visit as data

Phase What happens FHIR R4 resources
Booking The patient picks a time for a video visit Appointment
Intake The patient answers questions and reports symptoms QuestionnaireResponse, Observation (category symptom)
Home data Readings from a blood pressure cuff, scale or watch since the last visit Observation (vital signs, activity), marked as device data
Preparation The clinician, or an AI assistant for them, reviews the record read: Condition, MedicationStatement, AllergyIntolerance, Observation, DocumentReference
The visit Who, when, why, and that it was virtual Encounter with class = VR (virtual)
Outcome Diagnosis, medication changes, tests ordered, follow-up Condition, MedicationStatement, ServiceRequest, CarePlan, Appointment
Trace Who wrote each item, from which system Provenance on every write

Two things make this different from an in-person visit. The clinician depends more on data the patient produced (home readings, questionnaires), so the record must show which values came from a device or the patient and which from a clinician. And the preparation step is where AI is most useful today — summarising months of readings into what changed — so the record must be readable by software within the patient's consent.

Where AI fits, and what it should see

AI role Data it needs Data it should not get
Intake assistant (talks to the patient before the visit) Active problems and medications, to ask relevant questions Notes and documents it does not need
Pre-visit summary for the clinician Trends of recent measurements, new symptoms, medication changes, recent results Raw years of history beyond the question
Documentation draft after the visit The encounter, what was discussed, the outcome Other patients' data, ever
Follow-up check-ins The care plan and the measurements it asks for Anything outside the plan

The common rules: give each AI role the smallest slice that answers its question, label the source of every value so the model and the clinician can weigh a home reading against a lab result, log every read so the patient can see what an AI saw, and keep a human in the loop for anything diagnostic. AI that diagnoses or recommends treatment may be regulated as medical device software (by the FDA in the United States; under the Medical Device Regulation and the AI Act in the European Union); a data platform does not change that.

The flow on Anpheros, step by step

The code below uses the Anpheros TypeScript SDK and was run against a local instance of the platform with a sandbox key. The patient already has three home blood pressure readings from a cuff (author_type: device), hypertension as a condition and enalapril as a medication.

import { Anpheros, apiKey } from '@anpheros/sdk';

const anpheros = new Anpheros({ auth: apiKey(process.env.ANPHEROS_KEY!) });
const subject = { reference: `Patient/${patientId}` };

// 1. Before the visit: the booking and the intake questionnaire
await anpheros.fhir.create({ resourceType: 'Appointment', status: 'booked', description: 'Video visit: blood pressure follow-up',
  start: '2026-10-14T15:00:00-05:00', end: '2026-10-14T15:20:00-05:00',
  participant: [{ actor: subject, status: 'accepted' }] } as any);
await anpheros.fhir.create({ resourceType: 'QuestionnaireResponse', status: 'completed', subject, authored: '2026-10-14T09:12:00-05:00',
  item: [
    { linkId: 'reason', text: 'What would you like to discuss?', answer: [{ valueString: 'Higher readings this week and dizziness in the morning' }] },
    { linkId: 'missed-doses', text: 'Did you miss any doses in the last 7 days?', answer: [{ valueBoolean: false }] },
  ] } as any, { author_type: 'patient' });

// The symptom itself, as a patient-reported Observation, so it reaches the context below
await anpheros.observations.create(patientId, { code: 'R42', system: 'http://hl7.org/fhir/sid/icd-10', display: 'Dizziness and giddiness',
  category: 'symptom', effective_at: '2026-10-13T07:45:00-05:00', value_text: 'Dizzy for a few minutes after getting up', author_type: 'patient' });

// 2. What the clinician (or an AI assistant helping them) reads: a budgeted, source-labelled context
const ctx = await anpheros.context.build({ patient: patientId, task: 'prepare a video visit',
  question: 'blood pressure trend and dizziness in the last 2 weeks', budget_tokens: 700, format: 'text' });

// 3. After the visit: the encounter, written as the clinician
const encounter = await anpheros.fhir.create({ resourceType: 'Encounter', status: 'finished',
  class: { system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode', code: 'VR', display: 'virtual' },
  subject, period: { start: '2026-10-14T15:02:00-05:00', end: '2026-10-14T15:18:00-05:00' },
  reasonCode: [{ text: 'Blood pressure follow-up' }] } as any, { author_type: 'practitioner', source_system: 'video-clinic' });

The context returned in step 2 (487 of the 700 tokens; this is what you would put in front of a model or show the clinician):

## Summary
Maria Lopez, 58 y, female. Active conditions: Essential (primary) hypertension. Active medications: Enalapril 10 mg.
Allergies: none recorded. Record: 0 lab values, 3 vital signs, 0 documents. As of 2026-10-13.
## Vitals
- Blood pressure panel: latest 2026-10-12 146/90 mm[Hg] ; weekly 2026-10-05: 150/93.5; 2026-10-12: 146/90 [device]
## Symptoms
- Dizziness and giddiness: 1 occurrence(s): 2026-10-13 [patient]
## Timeline
- 2026-10-13 symptom: Dizziness and giddiness: Dizzy for a few minutes after getting up [patient]

Every line carries its source — [device] for the cuff, [patient] for the symptom — and the read is recorded in the access log. The encounter's provenance shows practitioner from video-clinic, and the patient's timeline now reads: virtual encounter, the video-visit appointment, the dizziness, the three blood pressure readings, the medication and the condition.

What we found while running it: the context API does not include QuestionnaireResponse answers today. The first run, with the dizziness only in the questionnaire, produced a summary with no mention of it. Record symptoms the patient reports as Observations with category symptom (as above), or pass the questionnaire to your model yourself.

Giving an AI agent access with consent

When the AI runs in someone else's application, it does not get your project key. The application asks the patient for consent through OAuth 2.1 and SMART on FHIR, with scopes as narrow as patient/Observation.rs?category=vital-signs, for a fixed period, revocable at any time. An agent can also reach the record through the Anpheros MCP server, read-only unless the patient allows more. See How to give an AI agent access to medical records and the FHIR MCP server.

What Anpheros does and does not do

Anpheros provides the record and the controls around it: FHIR R4 storage for every resource in the table above, consent per application, provenance on every write, an access log the patient can see, and the context API that turns the record into a budgeted, labelled summary for a model.

It does not provide video calls, scheduling screens, e-prescribing, billing or clinical decision support, and it does not host or choose AI models. A virtual clinic built on it brings those, and the clinical responsibility, itself.

Frequently asked questions

What is a virtual doctor?

A clinician who sees patients remotely, by video, phone or messaging. The term is also used for AI assistants that talk to patients; in practice those assist a human clinician rather than replace one, and depend on the same patient data.

Which FHIR resource marks a visit as virtual?

Encounter.class with the v3 ActCode VR ("virtual"). The booking is an Appointment; the intake is a QuestionnaireResponse and, for symptoms, Observations.

What data does an AI medical assistant need?

Only what its task requires: for a pre-visit summary, recent measurement trends, new symptoms, active problems and medications, and recent results — each labelled with its source and time. Give it a budgeted context rather than the whole record.

How do I keep patient-reported and device data apart from clinical data?

Record who wrote each item. In Anpheros every write carries an author type — patient, device, practitioner, import or AI — and the context given to a model labels each line with it.

Can an AI assistant read a patient's record without their consent?

Not on Anpheros. An application other than the one that created the record needs the patient's OAuth consent, limited to the scopes and period they chose, and every read appears in their access log.

Related