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 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)

Returns The internal mirah id of the patient.

Returns:

  • (string)

    The internal mirah id of the patient


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

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

#end_dateDate (readonly)

Returns The appointment end date.

Returns:

  • (Date)

    The appointment end date


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

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

#external_idstring (readonly)

Returns The identifier provided by your system.

Returns:

  • (string)

    The identifier provided by your system


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

attribute :external_id

#external_organization_idstring (readonly)

Returns Your system identifier for the organization this appointment is with.

Returns:

  • (string)

    Your system identifier for the organization this appointment is with


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

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

#external_patient_idstring (readonly)

Returns Your system identifier for the patient.

Returns:

  • (string)

    Your system identifier for the patient


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

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

#external_practitioner_idstring (readonly)

Returns Your system identifier for the practitioner this appointment is with.

Returns:

  • (string)

    Your system identifier for the practitioner this appointment is with


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

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

#idstring (readonly)

Returns The internal Mirah identifier.

Returns:

  • (string)

    The internal Mirah identifier


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

attribute :id

#invitationsArray<Invitation> (readonly)

Returns An array of invitations for measurements associated with this appointment.

Returns:

  • (Array<Invitation>)

    An array of invitations for measurements associated with this appointment.


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)

Returns The legnth of this appointment in minutes.

Returns:

  • (Integer)

    The legnth of this appointment in minutes


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

attribute :minutes_duration

#organization_idstring (readonly)

Returns The internal mirah id of the organization this appointment is with.

Returns:

  • (string)

    The internal mirah id of the organization this appointment is with


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

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

#patient_idstring (readonly)

Returns The internal mirah id of the patient.

Returns:

  • (string)

    The internal mirah id of the patient


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

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

#practitioner_idstring (readonly)

Returns The internal mirah id of the practitioner this appointment is with.

Returns:

  • (string)

    The internal mirah id of the practitioner this appointment is with


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

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

#start_dateDate (readonly)

Returns The appointment start date.

Returns:

  • (Date)

    The appointment start date


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

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

#statusstring (readonly)

Returns The appointment status.

Returns:

  • (string)

    The appointment status


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.

Returns:

  • (Boolean)

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

def measured?
  !!encounter_id
end