The previousNote field accepts the text of a previous visit note. This is particularly powerful for follow-up visits where continuity of care is important.
import Sully from '@sullyai/sullyai';const sully = new Sully();const previousNote = `SUBJECTIVE: 45-year-old female presenting with migraine headaches occurring 3-4 times per week.Reports throbbing pain, photophobia, and nausea. Current medications ineffective.ASSESSMENT: Chronic migraine without aura, poorly controlled.PLAN:1. Start sumatriptan 50mg PRN for acute episodes2. Begin topiramate 25mg daily for prophylaxis3. Headache diary for 4 weeks4. Return in 4 weeks to assess response`;const note = await sully.notes.create({ transcript: "Doctor: Welcome back. How have the new medications been working for your migraines?...", noteType: { type: 'soap' }, previousNote: previousNote,});
For follow-up visits, providing the previous note is one of the most impactful context enrichments you can make. It enables Sully to generate notes that reflect the ongoing patient journey rather than treating each visit in isolation.
The instructions field accepts free-text instructions that guide how the note should be generated. Use this for specialty-specific requirements or personal preferences.
import Sully from '@sullyai/sullyai';const sully = new Sully();const note = await sully.notes.create({ transcript: "Doctor: Tell me about your chest discomfort...", noteType: { type: 'soap' }, instructions: 'Focus on cardiovascular symptoms. Include differential diagnosis in assessment. Use numbered list for plan items.',});
Instructions work best when they are specific and actionable. “Be thorough” is less effective than “Include all mentioned symptoms with onset, duration, and severity.”
The context field accepts any additional information that doesn’t fit into the other structured fields. This is your catch-all for relevant clinical data.
Here’s a full API call using all available context fields:
import Sully from '@sullyai/sullyai';const sully = new Sully();const note = await sully.notes.create({ // Required: the transcript transcript: `Doctor: Good afternoon, Mrs. Johnson. How have you been since our last visit?Patient: The headaches are much better since starting the new medication. I'm only getting them once a week now instead of every day.Doctor: That's excellent progress. Any side effects from the topiramate?Patient: A little tingling in my fingers sometimes, but nothing too bothersome.Doctor: That's a common side effect and usually improves over time. Let's continue the current regimen. `, noteType: { type: 'soap' }, // Visit date date: '2024-01-15', // Patient demographics patientInfo: { name: 'Sarah Johnson', dateOfBirth: '1979-06-14', gender: 'female', }, // Current medications medicationList: [ 'Topiramate 50mg daily', 'Sumatriptan 50mg PRN', 'Ibuprofen 400mg PRN', ], // Previous visit note for continuity previousNote: `Date: 2023-12-15SUBJECTIVE: 44-year-old female with chronic migraines, occurring daily for past 2 months.ASSESSMENT: Chronic migraine without aura, poorly controlled on current regimen.PLAN: Start topiramate 25mg daily, titrate to 50mg after 1 week. Continue sumatriptan PRN.Return in 4 weeks. `, // Custom instructions instructions: 'Document the improvement in migraine frequency. Note the paresthesia side effect and that it is being tolerated.', // Additional context context: `Patient works as an accountant. Busy season approaching (tax season) -she expressed concern about maintaining productivity.Prefers to avoid additional medications if possible. `,});console.log('Note ID:', note.data.noteId);
For follow-up visits, previousNote provides the most value:
Enables “Patient returns for follow-up of…” language
Allows comparison of symptoms over time
Documents treatment response
Maintains diagnostic continuity
If your EHR can programmatically retrieve the previous note for a patient, automate including it in your API calls. This single enrichment dramatically improves follow-up note quality.