Class: HealthcarePhony::PatientVisit

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

Overview

Public: Randomly generates data for a PatientVisit (PV1 segment)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**init_args) ⇒ PatientVisit

Public: Initializes an Address. Pass in hash of different parameters, currently this includes: hospital_service - Array of Hospital Service codes (PV1.10) to randomly choose from. Specified as comma separated String or Ruby array. Otherwise default HL7 v2.5.1 Table 0069 values are used. patient_class - Array of Patient Class codes (PV1.2) to randomly choose from. Specified as comma separated String or Ruby array. Otherwise default HL7 v2.5.1 Table 0004 values are used. ambulatory_status - Array of Ambulatory Status codes (PV1.15) to randomly choose from. Specified as comma separated String or Ruby array. Otherwise default HL7 v2.5.1 Table 0009 values are used. bed_status - Array of Bed Status codes (PV1.40) to randomly choose from. Specified as comma separated String or Ruby array. Otherwise default HL7 v2.5.1 Table 0116 values are used. patient_type - Array of Patient Type codes (PV1.18) to randomly choose from. Specified as comma separated String or Ruby array. Otherwise this field is left blank. vip_indicator - Array of Patient Type codes (PV1.18) to randomly choose from. Specified as comma separated String or Ruby array. Otherwise this field is left blank.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/healthcare_phony/patient_visit.rb', line 26

def initialize(**init_args)
  @doctors = VisitDoctors.new
  @location = VisitLocation.new(init_args)
  @admission = VisitAdmission.new(init_args)
  @bed_status = define_bed_status(init_args)
  @visit_number = Identifier.new(type_code: 'VN')
  @readmission_indicator = Helper.random_with_blank('R', 50)
  @patient_type = define_patient_type(init_args)
  @vip_indicator = define_vip(init_args)
  @ambulatory_status = define_ambulatory_status(init_args)
  @patient_class = define_patient_class(init_args)
  @hospital_service = define_hospital_service(init_args)
  @discharge = VisitDischarge.new(init_args.merge({ admit_datetime: @admission.datetime }))
end

Instance Attribute Details

#admissionObject

Returns the value of attribute admission.



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

def admission
  @admission
end

#ambulatory_statusObject

Returns the value of attribute ambulatory_status.



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

def ambulatory_status
  @ambulatory_status
end

#bed_statusObject

Returns the value of attribute bed_status.



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

def bed_status
  @bed_status
end

#dischargeObject

Returns the value of attribute discharge.



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

def discharge
  @discharge
end

#doctorsObject

Returns the value of attribute doctors.



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

def doctors
  @doctors
end

#hospital_serviceObject

Returns the value of attribute hospital_service.



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

def hospital_service
  @hospital_service
end

#locationObject

Returns the value of attribute location.



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

def location
  @location
end

#patient_classObject

Returns the value of attribute patient_class.



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

def patient_class
  @patient_class
end

#patient_typeObject

Returns the value of attribute patient_type.



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

def patient_type
  @patient_type
end

#readmission_indicatorObject

Returns the value of attribute readmission_indicator.



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

def readmission_indicator
  @readmission_indicator
end

#vip_indicatorObject

Returns the value of attribute vip_indicator.



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

def vip_indicator
  @vip_indicator
end

#visit_numberObject

Returns the value of attribute visit_number.



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

def visit_number
  @visit_number
end