What Template Sync Does
Template sync imports your EHR's encounter templates into Doctora so the system knows which clinical fields to extract, display, and write back for each visit type. Instead of configuring templates manually, Doctora reads the template structure directly from your EHR and converts it into a standardized format it can use.
The result: your "Comprehensive Exam," "Contact Lens Follow-Up," and every other template you have built in your EHR appear in Doctora automatically, with the correct fields already mapped.
Supported EHR Systems
| EHR | Sync Method | Trigger | |-----|------------|---------| | RevolutionEHR | Chrome extension (automatic) | Detects EHR on page load | | CrystalPM | Windows agent | Agent reads template data from CrystalPM on the clinic PC | | Eyefinity | Chrome extension | Reads exam template structure via Eyefinity's API |
Each EHR has a different internal structure, but the sync pipeline normalizes everything into the same DoctoraTemplate format with a consistent set of field paths.
How the Sync Pipeline Works
The process follows the same pattern regardless of EHR, though the specifics differ per system.
1. Fetch the template list. Doctora retrieves all active encounter templates from your EHR. For RevolutionEHR this means calling the encounter template API; for CrystalPM the Windows agent reads template definitions locally.
2. Traverse each template's structure. EHR templates are hierarchical. In RevolutionEHR the hierarchy looks like:
Encounter Template (e.g., "Comprehensive Exam") -> Workflow Steps (e.g., "Pre-Testing", "Doctor Exam") -> Screens (e.g., "Posterior Segment", "Refraction") -> Tests (e.g., "Macula OD", "Final Refraction")
Doctora walks this tree to collect every test and screen the template includes.
3. Map tests to Doctora fields. Each EHR test name is matched against Doctora's internal test registry. A test called "Slit Lamp" maps to examination.anteriorSegment; "GAT" maps to examination.tonometryReadings with a Goldmann capability flag. Tests that do not have a mapping are recorded as "unmapped" for diagnostics but do not block the sync.
4. Extract capabilities. From the list of mapped tests, Doctora derives fine-grained capabilities---which tonometry methods, special testing types, and posterior segment tests the template supports. These capabilities drive UI filtering (e.g., only showing Goldmann and iCare in the tonometry dropdown if those are the instruments in the template).
5. Store the template. The finished template is saved to Firestore under your practice. It includes the template name, field paths, EHR test metadata, capabilities, display color, duration, category, and a source record linking it back to the EHR template ID.
When Sync Happens
- Automatically on first connection. The first time the Chrome extension detects your EHR (or the Windows agent connects to CrystalPM), a full template sync runs in the background.
- Periodically. The extension re-syncs templates when it detects changes or on reconnection.
- On demand. You can trigger a manual sync from the extension's side panel---useful after you have added or modified templates in your EHR.
How to Force a Re-Sync
If you have made changes to your EHR templates and want Doctora to pick them up immediately:
- Open the Doctora extension side panel in your browser.
- Navigate to your EHR integration settings.
- Click Sync Templates (or the refresh icon next to your template list).
- The extension will re-traverse all active templates and update Doctora's records.
For CrystalPM users, the Windows agent handles sync automatically. If templates are not updating, verify the agent is running in the system tray and connected.
What Gets Synced
- Template names --- exactly as they appear in your EHR.
- Field lists --- which clinical sections and tests the template includes, converted to Doctora schema paths.
- Test mappings --- the relationship between EHR test IDs and Doctora fields, used for routing data back to the correct EHR screens during write-back.
- Display properties --- color, duration, abbreviation, and whether the exam is comprehensive (affects billing code selection).
- Category --- inferred from the template name (e.g., "CL Follow-Up" is categorized as contact lens) or set explicitly by the EHR's isComprehensive flag.
- Capabilities --- derived from the test list (tonometry methods, imaging modalities, posterior segment test structure).
What Does Not Sync
- Custom instructions. Any notes or AI prompting rules you set in Doctora (like "always summarize dry eye findings") are Doctora-only and are not affected by sync.
- Doctor preferences. Your personal additions and disabled paths are stored separately and layered on top of the template during encounters. Sync never overwrites them.
- Inactive templates. Only templates marked as active in your EHR are imported. If you deactivate a template in your EHR, it will not appear in the next sync.
Troubleshooting
Templates not showing up after sync
- Confirm the template is marked active in your EHR. Inactive templates are excluded.
- Check that the Chrome extension (or Windows agent for CrystalPM) is connected. The extension icon should show a green status indicator.
- Try a manual re-sync from the extension side panel.
Wrong fields in a template
- This usually means a test in your EHR template has a name Doctora does not recognize yet. Open the template in Settings > Templates and check the unmapped tests list. Contact support if critical tests are unmapped.
Template colors or durations are wrong
- Colors and durations are read directly from your EHR. Update them in your EHR and re-sync, or override them manually in Doctora's template settings.
Duplicate templates appearing
- This can happen if a template was deleted and recreated in the EHR with a new ID. Deactivate the old copy in Settings > Templates.