Class: HealthcarePhony::VisitAdmission

Inherits:
Object
  • Object
show all
Defined in:
lib/healthcare_phony/visit_admission.rb

Overview

Public: Creates admission information for a patient visit.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(init_args = {}) ⇒ VisitAdmission

Public: Initializes an EthnicGroup. Pass in hash of different parameters, currently this includes: admit_source - Array of Admit Source codes (PV1.14) to randomly choose from. Specified as comma separated String or Ruby array. Otherwise default HL7 v2.5.1 Table 0023 values are used. admission_type - Array of Admission Type (PV1.4) to randomly choose from. Specified as comma separated String or Ruby array. Otherwise default HL7 v2.5.1. Table 0007 values are used. admit_reason - Array of values to use as Admit Reason (PV2.3) to randomly choose from. Specified as comma separated String or Ruby array. Otherwise a string of data is generated with Faker::Lorem.sentence



15
16
17
18
19
20
# File 'lib/healthcare_phony/visit_admission.rb', line 15

def initialize(init_args = {})
  @source = define_source(init_args)
  @type = define_type(init_args)
  @datetime = Faker::Time.backward(days: Faker::Number.number(digits: 1))
  @reason = define_reason(init_args)
end

Instance Attribute Details

#datetimeObject

Returns the value of attribute datetime.



6
7
8
# File 'lib/healthcare_phony/visit_admission.rb', line 6

def datetime
  @datetime
end

#reasonObject

Returns the value of attribute reason.



6
7
8
# File 'lib/healthcare_phony/visit_admission.rb', line 6

def reason
  @reason
end

#sourceObject

Returns the value of attribute source.



6
7
8
# File 'lib/healthcare_phony/visit_admission.rb', line 6

def source
  @source
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/healthcare_phony/visit_admission.rb', line 6

def type
  @type
end