Przejdź do głównej zawartości

Visit Templates

Visit Templates pozwalają na szybkie tworzenie wizyt z pre-filled zawartością. Redukują czas dokumentacji dla typowych procedur.


Vista zawiera wbudowane szablony dla najczęstszych typów wizyt:

TemplateVisit TypeDescription
ConsultationconsultationStandardowa wizyta konsultacyjna
VaccinationvaccinationSzczepienie profilaktyczne
Follow-upfollowupWizyta kontrolna
SurgerysurgeryZabieg chirurgiczny
EmergencyemergencyNagły przypadek

interface VisitTemplate {
id: string;
name: string;
visitType: string;
description?: string;
// Pre-filled SOAP sections
defaultSubjective?: string;
defaultObjective?: string;
defaultAssessment?: string;
defaultPlan?: string;
// Optional defaults
defaultDuration?: number; // minutes
defaultInternalNotes?: string;
// Metadata
isBuiltIn: boolean;
createdBy?: string;
createdAt?: string;
}

sequenceDiagram
participant User
participant UI as Create Visit Dialog
participant API as visitApi
participant DB as Database
User->>UI: Select template
UI->>UI: Load template defaults
User->>UI: Select patient
User->>UI: Click "Create"
UI->>API: create({...templateDefaults, patient_id})
API->>DB: INSERT visit
DB-->>API: New visit
API-->>UI: Visit created
UI->>UI: Open in editor
┌─────────────────────────────────────┐
│ New Visit │
├─────────────────────────────────────┤
│ Select Template: │
│ │
│ ○ Consultation (default) │
│ ○ Vaccination │
│ ○ Follow-up │
│ ○ Surgery │
│ ○ Emergency │
│ ○ Custom templates... │
├─────────────────────────────────────┤
│ Patient: [Select patient] │
├─────────────────────────────────────┤
│ [Cancel] [Create Visit] │
└─────────────────────────────────────┘

{
id: 'consultation',
name: 'Konsultacja',
visitType: 'consultation',
defaultSubjective: '',
defaultObjective: 'Pacjent w stanie ogólnym dobrym. Błony śluzowe różowe, wilgotne. Węzły chłonne niepowiększone.',
defaultAssessment: '',
defaultPlan: '',
defaultDuration: 30,
}
{
id: 'vaccination',
name: 'Szczepienie',
visitType: 'vaccination',
defaultSubjective: 'Szczepienie profilaktyczne. Brak zgłaszanych dolegliwości.',
defaultObjective: 'Pacjent w stanie ogólnym dobrym. Temperatura w normie. Błony śluzowe różowe.',
defaultAssessment: 'Pacjent zakwalifikowany do szczepienia.',
defaultPlan: 'Szczepienie wykonane. Obserwacja przez 15 minut. Kontrola za rok.',
defaultDuration: 15,
}
{
id: 'followup',
name: 'Kontrola',
visitType: 'followup',
defaultSubjective: 'Wizyta kontrolna. ',
defaultObjective: '',
defaultAssessment: '',
defaultPlan: '',
defaultDuration: 20,
}
{
id: 'surgery',
name: 'Zabieg',
visitType: 'surgery',
defaultSubjective: 'Pacjent zakwalifikowany do zabiegu. ',
defaultObjective: 'Badanie przedoperacyjne: ',
defaultAssessment: '',
defaultPlan: 'Zalecenia pooperacyjne:\n- \n- \n- ',
defaultDuration: 60,
}
{
id: 'emergency',
name: 'Nagły przypadek',
visitType: 'emergency',
defaultSubjective: 'NAGŁY PRZYPADEK. Czas zgłoszenia: ',
defaultObjective: 'Stan pacjenta przy przyjęciu: ',
defaultAssessment: '',
defaultPlan: 'Działania podjęte:\n- \n\nDalsze postępowanie:\n- ',
defaultDuration: 45,
}

  • Tworzenie własnych szablonów
  • Edycja istniejących szablonów
  • Szablony per lekarz lub per klinika
  • Import/export szablonów
  • Szablony z placeholderami
// Future: dynamic placeholders
{
defaultPlan: 'Kontrola za {{follow_up_days}} dni. Tel: {{clinic_phone}}',
}

// useWorkspaceDraftActions
handleCreateDraft(patientId, template) {
const visit = await visitApi.create({
patient_id: patientId,
visit_type: template.visitType,
soap_subjective: template.defaultSubjective,
soap_objective: template.defaultObjective,
soap_assessment: template.defaultAssessment,
soap_plan: template.defaultPlan,
});
}
// From appointment → visit
onStartVisit(appointment) {
const template = getTemplateForType(appointment.appointment_type);
await visitApi.create({
...templateDefaults,
patient_id: appointment.patient_id,
appointment_id: appointment.appointment_id,
});
}

function getTemplateForType(visitType: string): VisitTemplate | null {
// 1. Check custom templates (future)
// 2. Check built-in templates
return BUILT_IN_TEMPLATES.find(t => t.visitType === visitType) || null;
}
function applyTemplate(template: VisitTemplate): Partial<CreateVisitInput> {
return {
visit_type: template.visitType,
soap_subjective: template.defaultSubjective || '',
soap_objective: template.defaultObjective || '',
soap_assessment: template.defaultAssessment || '',
soap_plan: template.defaultPlan || '',
};
}