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/evn.rb CHANGED
@@ -1,12 +1,12 @@
1
- # $Id: evn.rb 13 2007-03-09 04:42:29Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::EVN < HL7::Message::Segment
4
4
  weight 0 # should occur after the MSH segment
5
- add_field :name=>:type_code, :idx=>1
6
- add_field :name=>:recorded_date, :idx=>2
7
- add_field :name=>:planned_date, :idx=>3
8
- add_field :name=>:reason_code, :idx=>4
9
- add_field :name=>:operator_id, :idx=>5
10
- add_field :name=>:event_occurred, :idx=>6
11
- add_field :name=>:event_facility, :idx=>6
5
+ add_field :type_code, :idx=>1
6
+ add_field :recorded_date, :idx=>2
7
+ add_field :planned_date, :idx=>3
8
+ add_field :reason_code, :idx=>4
9
+ add_field :operator_id, :idx=>5
10
+ add_field :event_occurred, :idx=>6
11
+ add_field :event_facility, :idx=>6
12
12
  end
data/lib/segments/msa.rb CHANGED
@@ -1,12 +1,12 @@
1
- # $Id: msa.rb 15 2007-03-11 05:21:09Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::MSA < HL7::Message::Segment
4
4
  weight 0 # should occur after the msh segment
5
- add_field :name=>:ack_code
6
- add_field :name=>:control_id
7
- add_field :name=>:text
8
- add_field :name=>:expected_seq
9
- add_field :name=>:delayed_ack_type
10
- add_field :name=>:error_cond
5
+ add_field :ack_code
6
+ add_field :control_id
7
+ add_field :text
8
+ add_field :expected_seq
9
+ add_field :delayed_ack_type
10
+ add_field :error_cond
11
11
  end
12
12
 
data/lib/segments/msh.rb CHANGED
@@ -1,22 +1,22 @@
1
- # $Id: msh.rb 13 2007-03-09 04:42:29Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::MSH < HL7::Message::Segment
4
- weight -1 # the msh should always start a message
5
- add_field :name=>:enc_chars, :idx=>1
6
- add_field :name=>:sending_app, :idx=>2
7
- add_field :name=>:sending_facility, :idx=>3
8
- add_field :name=>:recv_app, :idx=>4
9
- add_field :name=>:recv_facility, :idx=>5
10
- add_field :name=>:time, :idx=>6
11
- add_field :name=>:security, :idx=>7
12
- add_field :name=>:message_type, :idx=>8
13
- add_field :name=>:message_control_id, :idx=>9
14
- add_field :name=>:processing_id, :idx=>10
15
- add_field :name=>:version_id, :idx=>11
16
- add_field :name=>:seq, :idx=>12
17
- add_field :name=>:continue_ptr, :idx=>13
18
- add_field :name=>:accept_ack_type, :idx=>14
19
- add_field :name=>:app_ack_type, :idx=>15
20
- add_field :name=>:country_code, :idx=>16
21
- add_field :name=>:charset, :idx=>17
4
+ weight( -1 ) # the msh should always start a message
5
+ add_field :enc_chars, :idx=>1
6
+ add_field :sending_app, :idx=>2
7
+ add_field :sending_facility, :idx=>3
8
+ add_field :recv_app, :idx=>4
9
+ add_field :recv_facility, :idx=>5
10
+ add_field :time, :idx=>6
11
+ add_field :security, :idx=>7
12
+ add_field :message_type, :idx=>8
13
+ add_field :message_control_id, :idx=>9
14
+ add_field :processing_id, :idx=>10
15
+ add_field :version_id, :idx=>11
16
+ add_field :seq, :idx=>12
17
+ add_field :continue_ptr, :idx=>13
18
+ add_field :accept_ack_type, :idx=>14
19
+ add_field :app_ack_type, :idx=>15
20
+ add_field :country_code, :idx=>16
21
+ add_field :charset, :idx=>17
22
22
  end
data/lib/segments/nte.rb CHANGED
@@ -1,9 +1,9 @@
1
- # $Id: nte.rb 13 2007-03-09 04:42:29Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::NTE < HL7::Message::Segment
4
4
  weight 4
5
- add_field :name=>:set_id, :idx=>1
6
- add_field :name=>:source, :idx=>2
7
- add_field :name=>:comment, :idx=>3
8
- add_field :name=>:comment_type, :idx=>4
5
+ add_field :set_id, :idx=>1
6
+ add_field :source, :idx=>2
7
+ add_field :comment, :idx=>3
8
+ add_field :comment_type, :idx=>4
9
9
  end
data/lib/segments/obr.rb CHANGED
@@ -1,52 +1,53 @@
1
- # $Id: obr.rb 38 2007-06-27 04:56:09Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::OBR < HL7::Message::Segment
4
4
  weight 89 # obr.weight-1
5
5
  has_children [:OBX]
6
- add_field :name=>:set_id
7
- add_field :name=>:placer_order_number
8
- add_field :name=>:filler_order_number
9
- add_field :name=>:priority
10
- add_field :name=>:requested_date
11
- add_field :name=>:observation_date
12
- add_field :name=>:observation_end_date
13
- add_field :name=>:collection_volume
14
- add_field :name=>:collector_identifier
15
- add_field :name=>:specimen_action_code
16
- add_field :name=>:danger_code
17
- add_field :name=>:relevant_clinical_info
18
- add_field :name=>:specimen_received_date
19
- add_field :name=>:specimen_source
20
- add_field :name=>:ordering_provider
21
- add_field :name=>:order_callback_phone_number
22
- add_field :name=>:placer_field_1
23
- add_field :name=>:placer_field_2
24
- add_field :name=>:filer_field_1
25
- add_field :name=>:filer_field_2
26
- add_field :name=>:results_status_change_date
27
- add_field :name=>:charge_to_practice
28
- add_field :name=>:parent_result
29
- add_field :name=>:quantity_timing
30
- add_field :name=>:result_copies_to
31
- add_field :name=>:parent
32
- add_field :name=>:transport_mode
33
- add_field :name=>:reason_for_study
34
- add_field :name=>:principal_result_interpreter
35
- add_field :name=>:assistant_result_interpreter
36
- add_field :name=>:technician
37
- add_field :name=>:transcriptionist
38
- add_field :name=>:scheduled_date
39
- add_field :name=>:number_of_sample_containers
40
- add_field :name=>:transport_logistics_of_sample
41
- add_field :name=>:collectors_comment
42
- add_field :name=>:transport_arrangement_responsibility
43
- add_field :name=>:transport_arranged
44
- add_field :name=>:escort_required
45
- add_field :name=>:planned_patient_transport_comment
46
- add_field :name=>:procedure_code
47
- add_field :name=>:procedure_code_modifier
48
- add_field :name=>:placer_supplemental_service_info
49
- add_field :name=>:filler_supplemental_service_info
50
- add_field :name=>:medically_necessary_dup_procedure_reason #longest method name ever. sry.
51
- add_field :name=>:result_handling
6
+ add_field :set_id
7
+ add_field :placer_order_number
8
+ add_field :filler_order_number
9
+ add_field :universal_service_id
10
+ add_field :priority
11
+ add_field :requested_date
12
+ add_field :observation_date
13
+ add_field :observation_end_date
14
+ add_field :collection_volume
15
+ add_field :collector_identifier
16
+ add_field :specimen_action_code
17
+ add_field :danger_code
18
+ add_field :relevant_clinical_info
19
+ add_field :specimen_received_date
20
+ add_field :specimen_source
21
+ add_field :ordering_provider
22
+ add_field :order_callback_phone_number
23
+ add_field :placer_field_1
24
+ add_field :placer_field_2
25
+ add_field :filer_field_1
26
+ add_field :filer_field_2
27
+ add_field :results_status_change_date
28
+ add_field :charge_to_practice
29
+ add_field :parent_result
30
+ add_field :quantity_timing
31
+ add_field :result_copies_to
32
+ add_field :parent
33
+ add_field :transport_mode
34
+ add_field :reason_for_study
35
+ add_field :principal_result_interpreter
36
+ add_field :assistant_result_interpreter
37
+ add_field :technician
38
+ add_field :transcriptionist
39
+ add_field :scheduled_date
40
+ add_field :number_of_sample_containers
41
+ add_field :transport_logistics_of_sample
42
+ add_field :collectors_comment
43
+ add_field :transport_arrangement_responsibility
44
+ add_field :transport_arranged
45
+ add_field :escort_required
46
+ add_field :planned_patient_transport_comment
47
+ add_field :procedure_code
48
+ add_field :procedure_code_modifier
49
+ add_field :placer_supplemental_service_info
50
+ add_field :filler_supplemental_service_info
51
+ add_field :medically_necessary_dup_procedure_reason #longest method name ever. sry.
52
+ add_field :result_handling
52
53
  end
data/lib/segments/obx.rb CHANGED
@@ -1,25 +1,26 @@
1
- # $Id: obx.rb 38 2007-06-27 04:56:09Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::OBX < HL7::Message::Segment
4
4
  weight 90
5
5
  has_children [:NTE]
6
- add_field :name=>:set_id
7
- add_field :name=>:value_type
8
- add_field :name=>:observation_id
9
- add_field :name=>:observation_sub_id
10
- add_field :name=>:observation_value
11
- add_field :name=>:units
12
- add_field :name=>:references_range
13
- add_field :name=>:probability
14
- add_field :name=>:nature_of_abnormal_test
15
- add_field :name=>:observation_result_status
16
- add_field :name=>:effective_date_of_reference_range
17
- add_field :name=>:user_defined_access_checks
18
- add_field :name=>:observation_date
19
- add_field :name=>:producer_id
20
- add_field :name=>:responsible_observer
21
- add_field :name=>:observation_method
22
- add_field :name=>:equipment_instance_id
23
- add_field :name=>:analysis_date
6
+ add_field :set_id
7
+ add_field :value_type
8
+ add_field :observation_id
9
+ add_field :observation_sub_id
10
+ add_field :observation_value
11
+ add_field :units
12
+ add_field :references_range
13
+ add_field :abnormal_flags
14
+ add_field :probability
15
+ add_field :nature_of_abnormal_test
16
+ add_field :observation_result_status
17
+ add_field :effective_date_of_reference_range
18
+ add_field :user_defined_access_checks
19
+ add_field :observation_date
20
+ add_field :producer_id
21
+ add_field :responsible_observer
22
+ add_field :observation_method
23
+ add_field :equipment_instance_id
24
+ add_field :analysis_date
24
25
  end
25
26
 
data/lib/segments/oru.rb CHANGED
@@ -1,4 +1,4 @@
1
- # $Id: oru.rb 13 2007-03-09 04:42:29Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::ORU < HL7::Message::Segment
4
4
  end
data/lib/segments/pid.rb CHANGED
@@ -1,49 +1,49 @@
1
- # $Id: pid.rb 29 2007-05-06 23:13:04Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::PID < HL7::Message::Segment
4
4
  weight 1
5
- add_field :name=>:set_id
6
- add_field :name=>:patient_id
7
- add_field :name=>:patient_id_list
8
- add_field :name=>:alt_patient_id
9
- add_field :name=>:patient_name
10
- add_field :name=>:mother_maiden_name
11
- add_field :name=>:patient_dob
12
- add_field :name=>:admin_sex do |sex|
5
+ add_field :set_id
6
+ add_field :patient_id
7
+ add_field :patient_id_list
8
+ add_field :alt_patient_id
9
+ add_field :patient_name
10
+ add_field :mother_maiden_name
11
+ add_field :patient_dob
12
+ add_field :admin_sex do |sex|
13
13
  unless /^[FMOUAN]$/.match(sex) || sex == nil || sex == ""
14
14
  raise HL7::InvalidDataError.new( "bad administrative sex value (not F|M|O|U|A|N)" )
15
15
  end
16
16
  sex = "" unless sex
17
17
  sex
18
18
  end
19
- add_field :name=>:patient_alias
20
- add_field :name=>:race
21
- add_field :name=>:address
22
- add_field :name=>:country_code
23
- add_field :name=>:phone_home
24
- add_field :name=>:phone_business
25
- add_field :name=>:primary_language
26
- add_field :name=>:marital_status
27
- add_field :name=>:religion
28
- add_field :name=>:account_number
29
- add_field :name=>:social_security_num
30
- add_field :name=>:mothers_id
31
- add_field :name=>:ethnic_group
32
- add_field :name=>:birthplace
33
- add_field :name=>:multi_birth
34
- add_field :name=>:birth_order
35
- add_field :name=>:citizenship
36
- add_field :name=>:vet_status
37
- add_field :name=>:nationality
38
- add_field :name=>:death_date
39
- add_field :name=>:death_indicator
40
- add_field :name=>:id_unknown_indicator
41
- add_field :name=>:id_readability_code
42
- add_field :name=>:last_update_date
43
- add_field :name=>:last_update_facility
44
- add_field :name=>:species_code
45
- add_field :name=>:breed_code
46
- add_field :name=>:strain
47
- add_field :name=>:production_class_code
48
- add_field :name=>:tribal_citizenship
19
+ add_field :patient_alias
20
+ add_field :race
21
+ add_field :address
22
+ add_field :country_code
23
+ add_field :phone_home
24
+ add_field :phone_business
25
+ add_field :primary_language
26
+ add_field :marital_status
27
+ add_field :religion
28
+ add_field :account_number
29
+ add_field :social_security_num
30
+ add_field :mothers_id
31
+ add_field :ethnic_group
32
+ add_field :birthplace
33
+ add_field :multi_birth
34
+ add_field :birth_order
35
+ add_field :citizenship
36
+ add_field :vet_status
37
+ add_field :nationality
38
+ add_field :death_date
39
+ add_field :death_indicator
40
+ add_field :id_unknown_indicator
41
+ add_field :id_readability_code
42
+ add_field :last_update_date
43
+ add_field :last_update_facility
44
+ add_field :species_code
45
+ add_field :breed_code
46
+ add_field :strain
47
+ add_field :production_class_code
48
+ add_field :tribal_citizenship
49
49
  end
data/lib/segments/pv1.rb CHANGED
@@ -1,57 +1,57 @@
1
- # $Id: pv1.rb 15 2007-03-11 05:21:09Z segfault $
1
+ # $Id$
2
2
  require 'ruby-hl7'
3
3
  class HL7::Message::Segment::PV1 < HL7::Message::Segment
4
4
  weight 2
5
- add_field :name=>:set_id
6
- add_field :name=>:patient_class
7
- add_field :name=>:assigned_location
8
- add_field :name=>:admission_type
9
- add_field :name=>:preadmit_number
10
- add_field :name=>:prior_location
11
- add_field :name=>:attending_doctor
12
- add_field :name=>:referring_doctor
13
- add_field :name=>:consulting_doctor
14
- add_field :name=>:hospital_service
15
- add_field :name=>:temporary_location
16
- add_field :name=>:preadmit_indicator
17
- add_field :name=>:readmit_indicator
18
- add_field :name=>:admit_source
19
- add_field :name=>:ambulatory_status
20
- add_field :name=>:vip_indicator
21
- add_field :name=>:admitting_doctor
22
- add_field :name=>:patient_type
23
- add_field :name=>:visit_number
24
- add_field :name=>:financial_class
25
- add_field :name=>:charge_price_indicator
26
- add_field :name=>:courtesy_code
27
- add_field :name=>:credit_rating
28
- add_field :name=>:contract_code
29
- add_field :name=>:contract_effective_date
30
- add_field :name=>:contract_amount
31
- add_field :name=>:contract_period
32
- add_field :name=>:interest_code
33
- add_field :name=>:transfer_bad_debt_code
34
- add_field :name=>:transfer_bad_debt_date
35
- add_field :name=>:bad_debt_agency_code
36
- add_field :name=>:bad_debt_transfer_amount
37
- add_field :name=>:bad_debt_recovery_amount
38
- add_field :name=>:delete_account_indicator
39
- add_field :name=>:delete_account_date
40
- add_field :name=>:discharge_disposition
41
- add_field :name=>:discharge_to_location
42
- add_field :name=>:diet_type
43
- add_field :name=>:servicing_facility
44
- add_field :name=>:bed_status
45
- add_field :name=>:account_status
46
- add_field :name=>:pending_location
47
- add_field :name=>:prior_temporary_location
48
- add_field :name=>:admit_date
49
- add_field :name=>:discharge_date
50
- add_field :name=>:current_patient_balance
51
- add_field :name=>:total_charges
52
- add_field :name=>:total_adjustments
53
- add_field :name=>:total_payments
54
- add_field :name=>:alternate_visit_id
55
- add_field :name=>:visit_indicator
56
- add_field :name=>:other_healthcare_provider
5
+ add_field :set_id
6
+ add_field :patient_class
7
+ add_field :assigned_location
8
+ add_field :admission_type
9
+ add_field :preadmit_number
10
+ add_field :prior_location
11
+ add_field :attending_doctor
12
+ add_field :referring_doctor
13
+ add_field :consulting_doctor
14
+ add_field :hospital_service
15
+ add_field :temporary_location
16
+ add_field :preadmit_indicator
17
+ add_field :readmit_indicator
18
+ add_field :admit_source
19
+ add_field :ambulatory_status
20
+ add_field :vip_indicator
21
+ add_field :admitting_doctor
22
+ add_field :patient_type
23
+ add_field :visit_number
24
+ add_field :financial_class
25
+ add_field :charge_price_indicator
26
+ add_field :courtesy_code
27
+ add_field :credit_rating
28
+ add_field :contract_code
29
+ add_field :contract_effective_date
30
+ add_field :contract_amount
31
+ add_field :contract_period
32
+ add_field :interest_code
33
+ add_field :transfer_bad_debt_code
34
+ add_field :transfer_bad_debt_date
35
+ add_field :bad_debt_agency_code
36
+ add_field :bad_debt_transfer_amount
37
+ add_field :bad_debt_recovery_amount
38
+ add_field :delete_account_indicator
39
+ add_field :delete_account_date
40
+ add_field :discharge_disposition
41
+ add_field :discharge_to_location
42
+ add_field :diet_type
43
+ add_field :servicing_facility
44
+ add_field :bed_status
45
+ add_field :account_status
46
+ add_field :pending_location
47
+ add_field :prior_temporary_location
48
+ add_field :admit_date
49
+ add_field :discharge_date
50
+ add_field :current_patient_balance
51
+ add_field :total_charges
52
+ add_field :total_adjustments
53
+ add_field :total_payments
54
+ add_field :alternate_visit_id
55
+ add_field :visit_indicator
56
+ add_field :other_healthcare_provider
57
57
  end