Class: Mirah::Data::Appointment

Inherits:
BaseObject show all
Defined in:
lib/mirah/data/appointment.rb

Overview

Appointments represent a planned or past meeting between a patient and a practitioner. This is based on https://www.hl7.org/fhir/appointment.html As part of the integration flow, Mirah will work out whether this appointments needs an accompanying measurement encounter and automatically create one as appropriate. Mirah's ETL will generally make a best effort to estimate where and what context the measurement should be taken. The more information (Episode of Care, Organization, etc) that you supply, the more likely it is to be correct. Note that as part of this processing, Mirah may immediately choose to create assessments and trigger communications with the patient or other participants, for example by text message or email. In order to keep adherence statistics up to date, Mirah also requires that updates on past appointments are sent, so that we can calculate whether e.g. the appointment was a no-show.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseObject

from_graphql_hash, #initialize, #to_graphql_hash

Constructor Details

This class inherits a constructor from Mirah::BaseObject

Instance Attribute Details

#encounter_idstring (readonly)



66
# File 'lib/mirah/data/appointment.rb', line 66

attribute :encounter_id, path: %w[measurementEncounter], target: 'id'

#end_dateDate (readonly)



30
# File 'lib/mirah/data/appointment.rb', line 30

attribute :end_date, serializer: Serializers::DateTimeSerializer.new

#external_idstring (readonly)



22
# File 'lib/mirah/data/appointment.rb', line 22

attribute :external_id

#external_organization_idstring (readonly)



62
# File 'lib/mirah/data/appointment.rb', line 62

attribute :external_organization_id, path: %w[organization], target: 'externalId'

#external_patient_idstring (readonly)



46
# File 'lib/mirah/data/appointment.rb', line 46

attribute :external_patient_id, path: %w[patient], target: 'externalId'

#external_practitioner_idstring (readonly)



54
# File 'lib/mirah/data/appointment.rb', line 54

attribute :external_practitioner_id, path: %w[practitioner], target: 'externalId'

#idstring (readonly)



18
# File 'lib/mirah/data/appointment.rb', line 18

attribute :id

#invitationsArray<Invitation> (readonly)



70
71
# File 'lib/mirah/data/appointment.rb', line 70

attribute :invitations, path: %w[measurementEncounter], target: 'measurementInvitations',
serializer: Serializers::NestedObjectSerializer.new(Invitation)

#minutes_durationInteger (readonly)



34
# File 'lib/mirah/data/appointment.rb', line 34

attribute :minutes_duration

#organization_idstring (readonly)



58
# File 'lib/mirah/data/appointment.rb', line 58

attribute :organization_id, path: %w[organization], target: 'id'

#patient_idstring (readonly)



42
# File 'lib/mirah/data/appointment.rb', line 42

attribute :patient_id, path: %w[patient], target: 'id'

#practitioner_idstring (readonly)



50
# File 'lib/mirah/data/appointment.rb', line 50

attribute :practitioner_id, path: %w[practitioner], target: 'id'

#start_dateDate (readonly)



26
# File 'lib/mirah/data/appointment.rb', line 26

attribute :start_date, serializer: Serializers::DateTimeSerializer.new

#statusstring (readonly)



38
# File 'lib/mirah/data/appointment.rb', line 38

attribute :status

Instance Method Details

#measured?Boolean

Whether this appointment has a Mirah measurement encounter associated with it.



74
75
76
# File 'lib/mirah/data/appointment.rb', line 74

def measured?
  !!encounter_id
end