Class: HealthcarePhony::Adt
- Inherits:
-
Object
- Object
- HealthcarePhony::Adt
- Defined in:
- lib/healthcare_phony.rb
Instance Attribute Summary collapse
-
#adt_arguments ⇒ Object
readonly
Returns the value of attribute adt_arguments.
-
#hl7_message ⇒ Object
readonly
Returns the value of attribute hl7_message.
-
#patient ⇒ Object
readonly
Returns the value of attribute patient.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
-
#visit ⇒ Object
readonly
Returns the value of attribute visit.
Instance Method Summary collapse
-
#initialize(init_args = {}) ⇒ Adt
constructor
A new instance of Adt.
- #to_s ⇒ Object
Constructor Details
#initialize(init_args = {}) ⇒ Adt
Returns a new instance of Adt.
16 17 18 19 20 21 22 23 |
# File 'lib/healthcare_phony.rb', line 16 def initialize(init_args = {}) @adt_arguments = init_args @adt_arguments[:message_types] = 'ADT' set_template = Hl7Message.new(@adt_arguments) @patient = Patient.new(@adt_arguments) @visit = PatientVisit.new(@adt_arguments.merge({ visit_type: set_visit_type })) end |
Instance Attribute Details
#adt_arguments ⇒ Object (readonly)
Returns the value of attribute adt_arguments.
14 15 16 |
# File 'lib/healthcare_phony.rb', line 14 def adt_arguments @adt_arguments end |
#hl7_message ⇒ Object (readonly)
Returns the value of attribute hl7_message.
14 15 16 |
# File 'lib/healthcare_phony.rb', line 14 def end |
#patient ⇒ Object (readonly)
Returns the value of attribute patient.
14 15 16 |
# File 'lib/healthcare_phony.rb', line 14 def patient @patient end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
14 15 16 |
# File 'lib/healthcare_phony.rb', line 14 def template @template end |
#visit ⇒ Object (readonly)
Returns the value of attribute visit.
14 15 16 |
# File 'lib/healthcare_phony.rb', line 14 def visit @visit end |
Instance Method Details
#to_s ⇒ Object
25 26 27 28 |
# File 'lib/healthcare_phony.rb', line 25 def to_s erb_template = ERB.new(@template) erb_template.result_with_hash({ patient: @patient, hl7: , visit: @visit }) end |