Sha256: 74a57338536339c6c4b2915209e01ee33705abc2f11d5515ff2c2d51dbff26a0

Contents?: true

Size: 946 Bytes

Versions: 4

Compression:

Stored size: 946 Bytes

Contents

# encoding: UTF-8
require 'spec_helper'

describe HL7::Message::Segment::MSH do
  context 'general' do
    before :all do
      @base = "MSH|^~\\&||ABCHS||AUSDHSV|20070101112951||ADT^A04^ADT_A01|12334456778890|P|2.5|||NE|NE|AU|ASCII|ENGLISH|||AN ORG|||RECNET.ORG"
    end

    it 'allows access to an MSH segment' do
      msh = HL7::Message::Segment::MSH.new @base
      msh.enc_chars='^~\\&'
      expect(msh.version_id).to eq '2.5'
      expect(msh.country_code).to eq 'AU'
      expect(msh.charset).to eq 'ASCII'
      expect(msh.sending_responsible_org).to eq 'AN ORG'
      expect(msh.receiving_network_address).to eq 'RECNET.ORG'
    end

    it 'allows creation of an MSH segment' do
      msh = HL7::Message::Segment::MSH.new
      msh.sending_facility="A Facility"
      expect(msh.sending_facility).to eq 'A Facility'
      msh.time = DateTime.iso8601('20010203T040506')
      expect(msh.time).to eq '20010203040506'
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-hl7-1.3.3 spec/msh_segment_spec.rb
ruby-hl7-1.3.2 spec/msh_segment_spec.rb
ruby-hl7-1.3.1 spec/msh_segment_spec.rb
ruby-hl7-1.3.0 spec/msh_segment_spec.rb