Skip to content

Patient Appointment Type Setup

Overview

Appointment Types categorize appointments (e.g., "Consultation", "Follow Up", "Emergency", "Dental Checkup"). Each type defines default duration, calendar color, booking scope, and billing items with OP/IP pricing.

Navigate to: Healthcare workspace > Appointment Type > New

Fields

Basic Configuration

FieldTypeDescription
appointment_typeDataUnique name (e.g., "Consultation", "Follow Up")
default_durationIntDuration in minutes. Used to calculate slot intervals.
colorColorCalendar display color (hex, e.g., #4CAF50)
allow_booking_forSelectPractitioner (default), Department, or Service Unit — determines what the user selects when booking

Billing Items

The items child table (Appointment Type Service Item) lets you define different billing items for different departments or service units:

FieldTypeDescription
dtLink → DocTypeScope: "Medical Department" or "Healthcare Service Unit" (blank = generic/default)
dnDynamic LinkThe specific department or service unit
op_consulting_charge_itemLink → ItemERPNext Item for outpatient charge
op_consulting_chargeCurrencyOutpatient fee amount
inpatient_visit_charge_itemLink → ItemERPNext Item for inpatient charge
inpatient_visit_chargeCurrencyInpatient fee amount

Example configuration:

ScopeOP ItemOP ChargeIP ItemIP Charge
(generic)Consultation Fee₹500IP Visit Fee₹300
Cardiology DeptCardio Consultation₹800Cardio IP Visit₹500
Ortho DeptOrtho Consultation₹700Ortho IP Visit₹450

Medical Coding

FieldTypeDescription
codification_tableTable (Codification Table)Medical codes linked to this appointment type (e.g., CPT codes)

Price List Integration

FieldTypeDescription
price_listLink → Price ListERPNext Price List for auto-creating Item Prices

Billing Lookup Logic

When an appointment is booked, get_billing_details() (appointment_type.py line 41) resolves the correct charges:

  1. Check department-specific items first: If the practitioner's department matches an entry in the items table with dt = "Medical Department", use those items
  2. Fall back to generic items: If no department match, use entries where dt is blank
  3. Final fallback: If no items defined on the appointment type, use Practitioner-level charges, then Healthcare Settings defaults

Auto Item Price Creation

On validate() (appointment_type.py line 10):

  • If price_list is set and items have charges configured
  • Calls make_item_price() (line 75) for each charge item
  • Creates/updates Item Price documents in the specified Price List
  • This ensures appointment charges appear correctly in billing

The "Unavailable" Type

The system auto-creates a special "Unavailable" appointment type for blocking time:

  • Created by setup_appointment_type_for_unavailability()
  • default_duration: 60 minutes
  • color: #ff5858 (red)
  • price: 0
  • See Appointment Unavailability
  • DocType: healthcare/healthcare/doctype/appointment_type/appointment_type.json
  • Python: healthcare/healthcare/doctype/appointment_type/appointment_type.py
    • validate() — line 10
    • get_billing_details() — line 41
    • make_item_price() — line 75
  • Child table: healthcare/healthcare/doctype/appointment_type_service_item/appointment_type_service_item.json