Permalink
Browse files

support for zed segment. Zed's dead, baby. Zed's dead

  • Loading branch information...
1 parent 5d09a93 commit 5cf48bcee80b3a5b4abd230d09643590e8990a8c @talbright talbright committed Nov 17, 2011
Showing with 30 additions and 1 deletion.
  1. +6 −0 lib/segments/zed.rb
  2. +1 −1 test/test_speed_parsing.rb
  3. +15 −0 test/test_zed_segment.rb
  4. +8 −0 test_data/zed.hl7
View
6 lib/segments/zed.rb
@@ -0,0 +1,6 @@
+# encoding: UTF-8
+class HL7::Message::Segment::ZED < HL7::Message::Segment
+ add_field :unknown1
+ add_field :unknown2
+ add_field :armband_id
+end
View
2 test/test_speed_parsing.rb
@@ -4,7 +4,7 @@
class SpeedParsing < Test::Unit::TestCase
def setup
- @msg = open( "./test_data/lotsunknowns.hl7" ).readlines
+ @msg = TestHelper.load_hl7(:lotsunknowns)
end
def test_large_unknown_segments
View
15 test/test_zed_segment.rb
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/test_helper'
+class ZedSegment < Test::Unit::TestCase
+
+ def setup
+ @base = "ZED|CARDIAC^Cardiac Symptoms||246315"
+ end
+
+ def test_initial_read
+ zed = HL7::Message::Segment::ZED.new @base
+ assert_equal( "CARDIAC^Cardiac Symptoms", zed.unknown1 )
+ assert_equal( "", zed.unknown2 )
+ assert_equal( "246315", zed.armband_id )
+ end
+
+end
View
8 test_data/zed.hl7
@@ -0,0 +1,8 @@
+MSH|^~\&|AXIAL360|AXIALEXCHANGE|CARESCOPE|CIVICHEALTH|06102011162949639||ADT^A08|CLUP11126-178663|P|2.3
+PID|||2057425^^^^MR||ENADTEST^INPATIENT^JOHN||19220202|M||O|APT 29^456 RENTER'S LANE^RALEIGH^NC^27610^^^^WAKE||(919)444-1111^PRN^^^^919^4441111|||S||70198817^^^^PN|909000099|||Y
+PV1||I|M3B^3BHA^10^1||||222000^JOBE^ROBERT^L^^MD|222000^JOBE^ROBERT^L^^MD||CAR||||||||||||||||||||||||||||||||||201105061105
+PV2|||TESTING ENAD FIELDS
+DG1|0001||999.9^COMP MED CARE NEC & NOS||201105061105|DA|||||||||01|222000
+IN1|0001|J25||TRAVELERS CHARLOTTE/NC
+ZP1|N||||WALMART
+ZED|CARDIAC^Cardiac Symptoms||246315

0 comments on commit 5cf48bc

Please sign in to comment.