Vetspire. Schedule. Appointment
(vetspire v3.0.0)
View Source
An appointment is an event on the schedule. Appointments can either be appointments with a patient or a block on the schedule. Blocks do not contain patient information.
Example:
- Fluffy (a patient) has an appointment at 5pm on August 12th, 2020 with Dr. Test Dummy. This would appear on the schedule for the clinic to view.
- The clinic has a block with a note, "Lunch" that repeats everyday at 12pm. This wold appear on the schedule but would not contain any patient information.
Summary
Functions
Builds a changeset for an appointment.
Returns true if appointment
Excludes appointments the client has already confirmed.
Types
@type t() :: %Vetspire.Schedule.Appointment{ __meta__: term(), additional_providers: term(), admitted_at: term(), appointment_patient_locations: term(), appointment_recurrence_id: term(), appointment_type: term(), appointment_type_id: term(), arrival_time_at: term(), booked_online: term(), booking_source: term(), cage: term(), cage_id: term(), checked_in_at: term(), checked_out_at: term(), checking_out_at: term(), comments: term(), completed_at: term(), confirmed_at: term(), creator: term(), creator_id: term(), custom_fields: term(), deleted: term(), deleted_by: term(), deleted_by_id: term(), deletion_reason: term(), department: term(), department_id: term(), drop_off_end: term(), drop_off_start: term(), duration: term(), encounters: term(), field_service_address: term(), field_service_address_id: term(), field_service_client_address: term(), field_service_client_address_id: term(), group: term(), group_id: term(), historical_id: term(), id: term(), inserted_at: term(), intake: term(), is_confirmed: term(), is_exception: term(), location: term(), location_id: term(), note: term(), org: term(), org_id: term(), original_start: term(), outlook_id: term(), patient: term(), patient_id: term(), patient_locations: term(), pickup_time: term(), position: term(), previous_encounter: term(), previous_encounter_id: term(), provider: term(), provider_id: term(), ready_at: term(), reason: term(), reason_category: term(), reason_category_id: term(), recurrence: term(), repeat_interval_seconds: term(), repeating_event: term(), reviewed: term(), room: term(), schedule: term(), schedule_id: term(), self_check_in_sent: term(), self_checked_in: term(), sent_pickup: term(), start: term(), started_at: term(), status: term(), tele_session_created: term(), updated_at: term(), visit_type: term(), vitals: term(), vitals_id: term(), waited_at: term(), zone_color_hex: term(), zone_id: term(), zone_name: term() }
Functions
Builds a changeset for an appointment.
Options
:skip_field_service_address_validation- skips theRepo.exists?/1ownership checks onfield_service_address_idandfield_service_client_address_id. Only safe to pass when the caller has already validated that exact(address_id, patient_id)pair itself - e.g. batch callers that resolve the same address once for a whole series and would otherwise repeat an identical query per occurrence. Defaults tofalse. The visit-type-driven clearing step and the alternatives-resolution step still run regardless, since which value they land on can legitimately differ per appointment.:skip_travel_zone_snapshot- skips derivingzone_name/zone_color_hexfrom theTravelZonereferenced byzone_id, trusting whatever values were cast in fromattrsinstead. Only safe to pass when the caller has already resolved that samezone_idfor the series and included itszone_name/zone_color_hexinattrs- e.g. batch callers that would otherwise repeat an identical lookup once per occurrence. Defaults tofalse.
@spec location_display(t()) :: location_display()
Returns true if appointment:
- has not been deleted
- has a start date
- start datetime is after the given minimum time (defaults to utc_now)
NOTE: appointment.start should always be a datetime, but there are instances of bad data in our DB where it is nil.
Excludes appointments the client has already confirmed.
Confirmation is recorded two different ways: the schedule's confirm button only
sets is_confirmed, while the SMS autoconfirm reply also moves status to
:confirmed, so both have to be checked.