Class: HealthcarePhony::PatientVisit
- Inherits:
-
Object
- Object
- HealthcarePhony::PatientVisit
- Defined in:
- lib/healthcare_phony/patient_visit.rb
Overview
Public: Randomly generates data for a PatientVisit (PV1 segment)
Instance Attribute Summary collapse
-
#admission ⇒ Object
Returns the value of attribute admission.
-
#ambulatory_status ⇒ Object
Returns the value of attribute ambulatory_status.
-
#bed_status ⇒ Object
Returns the value of attribute bed_status.
-
#discharge ⇒ Object
Returns the value of attribute discharge.
-
#doctors ⇒ Object
Returns the value of attribute doctors.
-
#hospital_service ⇒ Object
Returns the value of attribute hospital_service.
-
#location ⇒ Object
Returns the value of attribute location.
-
#patient_class ⇒ Object
Returns the value of attribute patient_class.
-
#patient_type ⇒ Object
Returns the value of attribute patient_type.
-
#readmission_indicator ⇒ Object
Returns the value of attribute readmission_indicator.
-
#vip_indicator ⇒ Object
Returns the value of attribute vip_indicator.
-
#visit_number ⇒ Object
Returns the value of attribute visit_number.
Instance Method Summary collapse
-
#initialize(init_args = {}) ⇒ PatientVisit
constructor
Public: Initializes an Address.
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. visit_type - VisitType of the patient’s visit
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/healthcare_phony/patient_visit.rb', line 27 def initialize(init_args = {}) @doctors = VisitDoctors.new(init_args) @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
#admission ⇒ Object
Returns the value of attribute admission.
6 7 8 |
# File 'lib/healthcare_phony/patient_visit.rb', line 6 def admission @admission end |
#ambulatory_status ⇒ Object
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_status ⇒ Object
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 |
#discharge ⇒ Object
Returns the value of attribute discharge.
6 7 8 |
# File 'lib/healthcare_phony/patient_visit.rb', line 6 def discharge @discharge end |
#doctors ⇒ Object
Returns the value of attribute doctors.
6 7 8 |
# File 'lib/healthcare_phony/patient_visit.rb', line 6 def doctors @doctors end |
#hospital_service ⇒ Object
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 |
#location ⇒ Object
Returns the value of attribute location.
6 7 8 |
# File 'lib/healthcare_phony/patient_visit.rb', line 6 def location @location end |
#patient_class ⇒ Object
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_type ⇒ Object
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_indicator ⇒ Object
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_indicator ⇒ Object
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_number ⇒ Object
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 |