ruby-hl7 0.2.50 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/segments/pv2.rb CHANGED
@@ -1,53 +1,53 @@
1
- # $Id: pv2.rb 15 2007-03-11 05:21:09Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::PV2 < HL7::Message::Segment
4
4
  weight 3
5
- add_field :name=>:prior_pending_location
6
- add_field :name=>:accommodation_code
7
- add_field :name=>:admit_reason
8
- add_field :name=>:transfer_reason
9
- add_field :name=>:patient_valuables
10
- add_field :name=>:patient_valuables_location
11
- add_field :name=>:visit_user_code
12
- add_field :name=>:expected_admit_date
13
- add_field :name=>:expected_discharge_date
14
- add_field :name=>:estimated_inpatient_stay_length
15
- add_field :name=>:actual_inpatient_stay_length
16
- add_field :name=>:visit_description
17
- add_field :name=>:referral_source_code
18
- add_field :name=>:previous_service_date
19
- add_field :name=>:employment_illness_related_indicator
20
- add_field :name=>:purge_status_code
21
- add_field :name=>:purge_status_date
22
- add_field :name=>:special_program_code
23
- add_field :name=>:retention_indicator
24
- add_field :name=>:expected_number_of_insurance_plans
25
- add_field :name=>:visit_publicity_code
26
- add_field :name=>:visit_protection_indicator
27
- add_field :name=>:clinic_organization_name
28
- add_field :name=>:patient_status_code
29
- add_field :name=>:visit_priority_code
30
- add_field :name=>:previous_treatment_date
31
- add_field :name=>:expected_discharge_disposition
32
- add_field :name=>:signature_on_file
33
- add_field :name=>:first_similar_illness_date
34
- add_field :name=>:patient_charge_adjustment_code
35
- add_field :name=>:recurring_service_code
36
- add_field :name=>:billing_media_code
37
- add_field :name=>:expected_surgery_date
38
- add_field :name=>:military_partnership_code
39
- add_field :name=>:military_non_availibility_code
40
- add_field :name=>:newborn_baby_indicator
41
- add_field :name=>:baby_detained_indicator
42
- add_field :name=>:mode_of_arrival_code
43
- add_field :name=>:recreational_drug_use_code
44
- add_field :name=>:precaution_code
45
- add_field :name=>:patient_condition_code
46
- add_field :name=>:living_will_code
47
- add_field :name=>:organ_donor_code
48
- add_field :name=>:advance_directive_code
49
- add_field :name=>:patient_status_effective_date
50
- add_field :name=>:expected_loa_return_date
51
- add_field :name=>:expected_preadmission_testing_date
52
- add_field :name=>:notify_clergy_code
5
+ add_field :prior_pending_location
6
+ add_field :accommodation_code
7
+ add_field :admit_reason
8
+ add_field :transfer_reason
9
+ add_field :patient_valuables
10
+ add_field :patient_valuables_location
11
+ add_field :visit_user_code
12
+ add_field :expected_admit_date
13
+ add_field :expected_discharge_date
14
+ add_field :estimated_inpatient_stay_length
15
+ add_field :actual_inpatient_stay_length
16
+ add_field :visit_description
17
+ add_field :referral_source_code
18
+ add_field :previous_service_date
19
+ add_field :employment_illness_related_indicator
20
+ add_field :purge_status_code
21
+ add_field :purge_status_date
22
+ add_field :special_program_code
23
+ add_field :retention_indicator
24
+ add_field :expected_number_of_insurance_plans
25
+ add_field :visit_publicity_code
26
+ add_field :visit_protection_indicator
27
+ add_field :clinic_organization_name
28
+ add_field :patient_status_code
29
+ add_field :visit_priority_code
30
+ add_field :previous_treatment_date
31
+ add_field :expected_discharge_disposition
32
+ add_field :signature_on_file
33
+ add_field :first_similar_illness_date
34
+ add_field :patient_charge_adjustment_code
35
+ add_field :recurring_service_code
36
+ add_field :billing_media_code
37
+ add_field :expected_surgery_date
38
+ add_field :military_partnership_code
39
+ add_field :military_non_availibility_code
40
+ add_field :newborn_baby_indicator
41
+ add_field :baby_detained_indicator
42
+ add_field :mode_of_arrival_code
43
+ add_field :recreational_drug_use_code
44
+ add_field :precaution_code
45
+ add_field :patient_condition_code
46
+ add_field :living_will_code
47
+ add_field :organ_donor_code
48
+ add_field :advance_directive_code
49
+ add_field :patient_status_effective_date
50
+ add_field :expected_loa_return_date
51
+ add_field :expected_preadmission_testing_date
52
+ add_field :notify_clergy_code
53
53
  end
data/lib/segments/qrd.rb CHANGED
@@ -1,17 +1,17 @@
1
- # $Id: qrd.rb 17 2007-03-14 05:25:11Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::QRD < HL7::Message::Segment
4
4
  weight 84
5
- add_field :name=>:query_date
6
- add_field :name=>:query_format_code
7
- add_field :name=>:query_priority
8
- add_field :name=>:query_id
9
- add_field :name=>:deferred_response_type
10
- add_field :name=>:deferred_response_date
11
- add_field :name=>:quantity_limited_request
12
- add_field :name=>:who_subject_filter
13
- add_field :name=>:what_subject_filter
14
- add_field :name=>:what_department_code
15
- add_field :name=>:what_data_code
16
- add_field :name=>:query_results_level
5
+ add_field :query_date
6
+ add_field :query_format_code
7
+ add_field :query_priority
8
+ add_field :query_id
9
+ add_field :deferred_response_type
10
+ add_field :deferred_response_date
11
+ add_field :quantity_limited_request
12
+ add_field :who_subject_filter
13
+ add_field :what_subject_filter
14
+ add_field :what_department_code
15
+ add_field :what_data_code
16
+ add_field :query_results_level
17
17
  end
data/lib/segments/qrf.rb CHANGED
@@ -1,15 +1,15 @@
1
- # $Id: qrf.rb 17 2007-03-14 05:25:11Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::QRF < HL7::Message::Segment
4
4
  weight 85
5
- add_field :name=>:where_subject_filter
6
- add_field :name=>:when_start_date
7
- add_field :name=>:when_end_date
8
- add_field :name=>:what_user_qualifier
9
- add_field :name=>:other_qry_subject_filter
10
- add_field :name=>:which_date_qualifier
11
- add_field :name=>:which_date_status_qualifier
12
- add_field :name=>:date_selection_qualifier
13
- add_field :name=>:when_timing_qualifier
14
- add_field :name=>:search_confidence_threshold
5
+ add_field :where_subject_filter
6
+ add_field :when_start_date
7
+ add_field :when_end_date
8
+ add_field :what_user_qualifier
9
+ add_field :other_qry_subject_filter
10
+ add_field :which_date_qualifier
11
+ add_field :which_date_status_qualifier
12
+ add_field :date_selection_qualifier
13
+ add_field :when_timing_qualifier
14
+ add_field :search_confidence_threshold
15
15
  end
@@ -1,4 +1,4 @@
1
- # $Id: test_basic_parsing.rb 41 2007-06-30 08:06:04Z segfault $
1
+ # $Id$
2
2
  $: << '../lib'
3
3
  require 'test/unit'
4
4
  require 'ruby-hl7'
@@ -9,6 +9,7 @@ class BasicParsing < Test::Unit::TestCase
9
9
  @empty_txt = open( './test_data/empty.hl7' ).readlines.first
10
10
  @empty_segments_txt = open( './test_data/empty_segments.hl7' ).readlines.first
11
11
  @base_msh = "MSH|^~\\&|LAB1||DESTINATION||19910127105114||ORU^R03|LAB1003929"
12
+ @base_msh_alt_delims = "MSH$@~\\&|LAB1||DESTINATION||19910127105114||ORU^R03|LAB1003929"
12
13
  end
13
14
 
14
15
  def test_simple_msh
@@ -16,6 +17,16 @@ class BasicParsing < Test::Unit::TestCase
16
17
  msg.parse @simple_msh_txt
17
18
  assert_equal( @simple_msh_txt, msg.to_hl7 )
18
19
  end
20
+
21
+ def test_parse_delims
22
+ msg = HL7::Message.new( @base_msh )
23
+ assert_equal( "|", msg.element_delim )
24
+ assert_equal( "^", msg.item_delim )
25
+
26
+ msg = HL7::Message.new( @base_msh_alt_delims )
27
+ assert_equal( "$", msg.element_delim )
28
+ assert_equal( "@", msg.item_delim )
29
+ end
19
30
 
20
31
  def test_constructor_parse
21
32
  msg = HL7::Message.new( @simple_msh_txt )
@@ -1,4 +1,4 @@
1
- # $Id: test_child_segment.rb 41 2007-06-30 08:06:04Z segfault $
1
+ # $Id$
2
2
  $: << '../lib'
3
3
  require 'test/unit'
4
4
  require 'ruby-hl7'
@@ -1,4 +1,4 @@
1
- # $Id: test_default_segment.rb 40 2007-06-30 01:29:19Z segfault $
1
+ # $Id$
2
2
  $: << '../lib'
3
3
  require 'test/unit'
4
4
  require 'ruby-hl7'
@@ -1,4 +1,4 @@
1
- # $Id: test_dynamic_segment_def.rb 40 2007-06-30 01:29:19Z segfault $
1
+ # $Id$
2
2
  $: << '../lib'
3
3
  require 'test/unit'
4
4
  require 'ruby-hl7'
@@ -1,4 +1,4 @@
1
- # $Id: test_msa_segment.rb 40 2007-06-30 01:29:19Z segfault $
1
+ # $Id$
2
2
  $: << '../lib'
3
3
  require 'test/unit'
4
4
  require 'ruby-hl7'
@@ -1,11 +1,11 @@
1
- # $Id: test_obr_segment.rb 40 2007-06-30 01:29:19Z segfault $
1
+ # $Id$
2
2
  $: << '../lib'
3
3
  require 'test/unit'
4
4
  require 'ruby-hl7'
5
5
 
6
6
  class ObrSegment < Test::Unit::TestCase
7
7
  def setup
8
- @base = "OBR|2|^DMCRES|0000000567^RADIS1|37956^CT ABDOMEN^L|||199405021550|||||||||||||0000763|||||P||||||R/O TUMOR|202300^BAKER^MARK^E|||01^LOCHLEAR, JUDY"
8
+ @base = "OBR|2|^USSSA|0000000567^USSSA|37956^CT ABDOMEN^LN|||199405021550|||||||||||||0000763|||||P||||||R/O TUMOR|202300&BAKER&MARK&E|||01&LOCHLEAR&JUDY"
9
9
  end
10
10
 
11
11
  def test_read
@@ -13,9 +13,9 @@ class ObrSegment < Test::Unit::TestCase
13
13
  assert_equal( @base, obr.to_s )
14
14
  assert_equal( "2", obr.e1 )
15
15
  assert_equal( "2", obr.set_id )
16
- assert_equal( "^DMCRES", obr.placer_order_number )
17
- assert_equal( "0000000567^RADIS1", obr.filler_order_number )
18
- assert_equal( "37956^CT ABDOMEN^L", obr.priority )
16
+ assert_equal( "^USSSA", obr.placer_order_number )
17
+ assert_equal( "0000000567^USSSA", obr.filler_order_number )
18
+ assert_equal( "37956^CT ABDOMEN^LN", obr.universal_service_id )
19
19
  end
20
20
 
21
21
  def test_create
@@ -1,4 +1,4 @@
1
- # $Id: test_obx_segment.rb 40 2007-06-30 01:29:19Z segfault $
1
+ # $Id$
2
2
  $: << '../lib'
3
3
  require 'test/unit'
4
4
  require 'ruby-hl7'
@@ -1,4 +1,4 @@
1
- # $Id: test_pid_segment.rb 40 2007-06-30 01:29:19Z segfault $
1
+ # $Id$
2
2
  $: << '../lib'
3
3
  require 'test/unit'
4
4
  require 'ruby-hl7'
@@ -1 +1 @@
1
- MSH|^~\&|LAB1||DESTINATION||19910127105114||ORU^R03|LAB1003929
2
1
 
2
+ MSH|^~\&|LAB1||DESTINATION||19910127105114||ORU^R03|LAB1003929
3
3
 
metadata CHANGED
@@ -1,36 +1,48 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: ruby-hl7
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.2.50
7
- date: 2007-10-18 00:00:00 -04:00
8
- summary: Ruby HL7 Library
9
- require_paths:
10
- - lib
11
- email: segfault@hasno.info
12
- homepage: http://rubyforge.org/ruby-hl7
13
- rubyforge_project: ruby-hl7
14
- description: A simple library to parse and generate HL7 2.x messages
15
- autorequire: ruby-hl7
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: "0.3"
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Mark Guzman
8
+ autorequire: ruby-hl7
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-20 00:00:00 -04:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.8.7
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rubyforge
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.4
34
+ version:
35
+ description: A simple library to parse and generate HL7 2.x messages
36
+ email: segfault@hasno.info
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - README
43
+ - LICENSE
31
44
  files:
32
45
  - lib/ruby-hl7.rb
33
- - lib/segments
34
46
  - lib/segments/evn.rb
35
47
  - lib/segments/msa.rb
36
48
  - lib/segments/msh.rb
@@ -53,6 +65,34 @@ files:
53
65
  - test_data/test2.hl7
54
66
  - README
55
67
  - LICENSE
68
+ has_rdoc: true
69
+ homepage: http://rubyforge.org/ruby-hl7
70
+ licenses: []
71
+
72
+ post_install_message:
73
+ rdoc_options: []
74
+
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: "0"
82
+ version:
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: "0"
88
+ version:
89
+ requirements: []
90
+
91
+ rubyforge_project: ruby-hl7
92
+ rubygems_version: 1.3.4
93
+ signing_key:
94
+ specification_version: 3
95
+ summary: Ruby HL7 Library
56
96
  test_files:
57
97
  - test/test_basic_parsing.rb
58
98
  - test/test_child_segment.rb
@@ -63,42 +103,3 @@ test_files:
63
103
  - test/test_obx_segment.rb
64
104
  - test/test_pid_segment.rb
65
105
  - test/test_speed_parsing.rb
66
- rdoc_options: []
67
-
68
- extra_rdoc_files:
69
- - README
70
- - LICENSE
71
- executables: []
72
-
73
- extensions: []
74
-
75
- requirements: []
76
-
77
- dependencies:
78
- - !ruby/object:Gem::Dependency
79
- name: facets
80
- version_requirement:
81
- version_requirements: !ruby/object:Gem::Version::Requirement
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- version: "2.0"
86
- version:
87
- - !ruby/object:Gem::Dependency
88
- name: rake
89
- version_requirement:
90
- version_requirements: !ruby/object:Gem::Version::Requirement
91
- requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: 0.7.3
95
- version:
96
- - !ruby/object:Gem::Dependency
97
- name: rubyforge
98
- version_requirement:
99
- version_requirements: !ruby/object:Gem::Version::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: 0.4.4
104
- version: