MSH|^~\&|<%= hl7.sending_application %>|<%= hl7.sending_facility %>|<%= hl7.receiving_application %>|<%= hl7.receiving_facility %>|<%= hl7.message_datetime.to_hl7datetime() %>||<%= hl7.message_type %>^<%= hl7.trigger_event %>|<%= hl7.message_control_id %>|<%= hl7.processing_id %>|<%= hl7.version %> EVN|<%= hl7.trigger_event %>|<%= hl7.message_datetime.to_hl7datetime() %> PID|||<%= patient.medical_record_number.identifier %>||<%= patient.names[0].family_name %>^<%= patient.names[0].given_name %>^<%= patient.names[0].middle_name%>^||<%= patient.date_of_birth.to_hl7date %>|<%= patient.gender.code %>||<%= patient.races[0].code %>|<%= patient.addresses[0].address_line1 %>^<%= patient.addresses[0].address_line2 %>^<%= patient.addresses[0].city %>^<%= patient.addresses[0].state %>^<%= patient.addresses[0].postal_code %>||(<%= patient.home_phone.area_code %>)<%= patient.home_phone.exchange_code %>-<%= patient.home_phone.subscriber_number %>~(<%= patient.cell_phone.area_code %>)<%= patient.cell_phone.exchange_code %>-<%= patient.cell_phone.subscriber_number %>|(<%= patient.work_phone.area_code %>)<%= patient.work_phone.exchange_code %>-<%= patient.work_phone.subscriber_number %>||||<%= patient.account_number.identifier %>|<%= patient.ssn %> PV1||<%= visit.patient_class %>