ruby-hl7 1.3.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/lib/configuration.rb +30 -0
  3. data/lib/core_ext/date_time.rb +19 -15
  4. data/lib/core_ext/string.rb +2 -0
  5. data/lib/helpers/time_formatter_helper.rb +42 -0
  6. data/lib/message.rb +72 -75
  7. data/lib/message_parser.rb +17 -15
  8. data/lib/ruby-hl7.rb +26 -16
  9. data/lib/segment.rb +63 -47
  10. data/lib/segment_default.rb +6 -4
  11. data/lib/segment_fields.rb +27 -25
  12. data/lib/segment_generator.rb +12 -15
  13. data/lib/segment_list_storage.rb +15 -14
  14. data/lib/segments/aig.rb +2 -0
  15. data/lib/segments/ail.rb +2 -0
  16. data/lib/segments/aip.rb +2 -0
  17. data/lib/segments/ais.rb +2 -0
  18. data/lib/segments/dg1.rb +2 -10
  19. data/lib/segments/err.rb +2 -0
  20. data/lib/segments/evn.rb +2 -1
  21. data/lib/segments/ft1.rb +13 -13
  22. data/lib/segments/fts.rb +2 -0
  23. data/lib/segments/gt1.rb +4 -6
  24. data/lib/segments/in1.rb +2 -1
  25. data/lib/segments/mfe.rb +2 -0
  26. data/lib/segments/mfi.rb +2 -0
  27. data/lib/segments/mrg.rb +2 -0
  28. data/lib/segments/msa.rb +2 -2
  29. data/lib/segments/msh.rb +3 -2
  30. data/lib/segments/nk1.rb +48 -8
  31. data/lib/segments/nte.rb +6 -5
  32. data/lib/segments/obr.rb +4 -3
  33. data/lib/segments/obx.rb +2 -1
  34. data/lib/segments/orc.rb +8 -10
  35. data/lib/segments/oru.rb +2 -1
  36. data/lib/segments/pid.rb +19 -10
  37. data/lib/segments/prd.rb +2 -1
  38. data/lib/segments/prt.rb +23 -0
  39. data/lib/segments/pv1.rb +2 -1
  40. data/lib/segments/pv2.rb +64 -51
  41. data/lib/segments/qrd.rb +2 -1
  42. data/lib/segments/qrf.rb +2 -1
  43. data/lib/segments/rf1.rb +2 -1
  44. data/lib/segments/rgs.rb +2 -0
  45. data/lib/segments/rol.rb +22 -0
  46. data/lib/segments/sch.rb +2 -0
  47. data/lib/segments/sft.rb +2 -0
  48. data/lib/segments/spm.rb +2 -0
  49. data/lib/segments/tq1.rb +2 -0
  50. data/lib/segments/txa.rb +30 -0
  51. data/lib/test/hl7_messages.rb +118 -117
  52. data/lib/version.rb +5 -0
  53. metadata +18 -165
  54. data/.gitignore +0 -7
  55. data/.rubocop.yml +0 -127
  56. data/.travis.yml +0 -20
  57. data/Gemfile +0 -3
  58. data/Gemfile.lock +0 -66
  59. data/LICENSE +0 -19
  60. data/NOTES.md +0 -141
  61. data/README.rdoc +0 -47
  62. data/Rakefile +0 -76
  63. data/VERSION +0 -1
  64. data/VERSION.yml +0 -4
  65. data/examples/proxy_server.rb +0 -26
  66. data/ruby-hl7.gemspec +0 -39
  67. data/spec/ail_segment_spec.rb +0 -28
  68. data/spec/aip_segment_spec.rb +0 -31
  69. data/spec/basic_parsing_spec.rb +0 -319
  70. data/spec/batch_parsing_spec.rb +0 -52
  71. data/spec/child_segment_spec.rb +0 -66
  72. data/spec/core_ext/date_time_spec.rb +0 -43
  73. data/spec/default_segment_spec.rb +0 -31
  74. data/spec/dg1_spec.rb +0 -42
  75. data/spec/dynamic_segment_def_spec.rb +0 -37
  76. data/spec/err_segment_spec.rb +0 -26
  77. data/spec/evn_segment_spec.rb +0 -23
  78. data/spec/ft1_segment_spec.rb +0 -35
  79. data/spec/fts_segment_spec.rb +0 -19
  80. data/spec/gt1_segment_spec.rb +0 -32
  81. data/spec/in1_segment_spec.rb +0 -34
  82. data/spec/message_spec.rb +0 -53
  83. data/spec/messages_spec.rb +0 -24
  84. data/spec/mfe_segment_spec.rb +0 -28
  85. data/spec/mfi_segment_spec.rb +0 -28
  86. data/spec/msa_segment_spec.rb +0 -27
  87. data/spec/msh_segment_spec.rb +0 -28
  88. data/spec/nk1_segment_spec.rb +0 -26
  89. data/spec/obr_segment_spec.rb +0 -45
  90. data/spec/obx_segment_spec.rb +0 -68
  91. data/spec/orc_segment_spec.rb +0 -27
  92. data/spec/pid_segment_spec.rb +0 -78
  93. data/spec/prd_segment_spec.rb +0 -29
  94. data/spec/pv1_segment_spec.rb +0 -23
  95. data/spec/rf1_segment_spec.rb +0 -29
  96. data/spec/sch_segment_spec.rb +0 -32
  97. data/spec/segment_field_spec.rb +0 -110
  98. data/spec/segment_generator_spec.rb +0 -32
  99. data/spec/segment_list_storage_spec.rb +0 -47
  100. data/spec/segment_spec.rb +0 -38
  101. data/spec/sft_segment_spec.rb +0 -26
  102. data/spec/spec_helper.rb +0 -13
  103. data/spec/speed_parsing_spec.rb +0 -19
  104. data/spec/spm_segment_spec.rb +0 -26
data/lib/segments/msa.rb CHANGED
@@ -1,4 +1,5 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::MSA < HL7::Message::Segment
3
4
  weight 1 # should occur after the msh segment
4
5
  add_field :ack_code
@@ -8,4 +9,3 @@ class HL7::Message::Segment::MSA < HL7::Message::Segment
8
9
  add_field :delayed_ack_type
9
10
  add_field :error_cond
10
11
  end
11
-
data/lib/segments/msh.rb CHANGED
@@ -1,6 +1,7 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::MSH < HL7::Message::Segment
3
- weight( -1 ) # the msh should always start a message
4
+ weight(-1) # the msh should always start a message
4
5
  add_field :enc_chars
5
6
  add_field :sending_app
6
7
  add_field :sending_facility
data/lib/segments/nk1.rb CHANGED
@@ -1,13 +1,53 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::NK1 < HL7::Message::Segment
3
- add_field :set_id
4
- add_field :name
5
- add_field :relationship
6
- add_field :address
7
- add_field :phone_number
4
+ add_field :set_id, :idx => 1
5
+ add_field :name, :idx => 2
6
+ add_field :relationship, :idx => 3
7
+ add_field :address, :idx => 4
8
+ add_field :phone_number, :idx => 5
9
+ add_field :business_phone_number, :idx => 6
10
+ add_field :contact_role, :idx => 7
11
+ add_field :start_date, :idx => 8 do |value|
12
+ convert_to_ts(value)
13
+ end
14
+ add_field :end_date, :idx => 9 do |value|
15
+ convert_to_ts(value)
16
+ end
17
+ add_field :job_title, :idx => 10
18
+ add_field :job_code, :idx => 11
19
+ add_field :employee_number, :idx => 12
8
20
  add_field :organization_name, :idx => 13
21
+ add_field :marital_status, :idx => 14
22
+ add_field :admin_sex, :idx => 15 do |sex|
23
+ sanitize_admin_sex!(sex)
24
+ end
25
+ add_field :date_of_birth, :idx => 16 do |value|
26
+ convert_to_ts(value)
27
+ end
28
+ add_field :living_dependency, :idx => 17
29
+ add_field :ambulatory_status, :idx => 18
30
+ add_field :citizenship, :idx => 19
9
31
  add_field :primary_language, :idx => 20
32
+ add_field :living_arrangement, :idx => 21
33
+ add_field :publicity_code, :idx => 22
34
+ add_field :protection_indicator, :idx => 23
35
+ add_field :student_indicator, :idx => 24
36
+ add_field :religion, :idx => 25
37
+ add_field :mother_maiden_name, :idx => 26
38
+ add_field :nationality, :idx => 27
39
+ add_field :ethnic_group, :idx => 28
40
+ add_field :contact_reason, :idx => 29
10
41
  add_field :contact_persons_name, :idx => 30
11
- add_field :contact_persons_telephone_number
12
- add_field :contact_persons_address
42
+ add_field :contact_persons_telephone_number, :idx => 31
43
+ add_field :contact_persons_address, :idx => 32
44
+ add_field :identifiers, :idx => 33
45
+ add_field :job_status, :idx => 34
46
+ add_field :race, :idx => 35
47
+ add_field :handicap, :idx => 36
48
+ add_field :contact_persons_ssn, :idx => 37
49
+ add_field :birth_place, :idx => 38
50
+ add_field :vip_indicator, :idx => 39
51
+ add_field :telecommunication_information, :idx => 40
52
+ add_field :contact_persons_telecommunication_information, :idx => 41
13
53
  end
data/lib/segments/nte.rb CHANGED
@@ -1,8 +1,9 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::NTE < HL7::Message::Segment
3
4
  weight 4
4
- add_field :set_id, :idx=>1
5
- add_field :source, :idx=>2
6
- add_field :comment, :idx=>3
7
- add_field :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
8
9
  end
data/lib/segments/obr.rb CHANGED
@@ -1,7 +1,8 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::OBR < HL7::Message::Segment
3
4
  weight 89 # obx.weight-1
4
- has_children [:NTE,:OBX,:SPM]
5
+ has_children %i[NTE OBX SPM]
5
6
  add_field :set_id
6
7
  add_field :placer_order_number
7
8
  add_field :filler_order_number
@@ -61,7 +62,7 @@ class HL7::Message::Segment::OBR < HL7::Message::Segment
61
62
  add_field :procedure_code_modifier
62
63
  add_field :placer_supplemental_service_info
63
64
  add_field :filler_supplemental_service_info
64
- add_field :medically_necessary_dup_procedure_reason #longest method name ever. sry.
65
+ add_field :medically_necessary_dup_procedure_reason # longest method name ever. sry.
65
66
  add_field :result_handling
66
67
  add_field :parent_universal_service_identifier
67
68
  end
data/lib/segments/obx.rb CHANGED
@@ -1,4 +1,5 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::OBX < HL7::Message::Segment
3
4
  weight 90
4
5
  has_children [:NTE]
data/lib/segments/orc.rb CHANGED
@@ -1,4 +1,5 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::ORC < HL7::Message::Segment
3
4
  weight 88 # obr.weight-1
4
5
  has_children [:OBR]
@@ -32,18 +33,15 @@ class HL7::Message::Segment::ORC < HL7::Message::Segment
32
33
  add_field :ordering_provider_address
33
34
  add_field :order_status_modifier
34
35
  add_field :advanced_beneficiary_notice_override_reason
35
- add_field :fillers_expected_availability_date_time
36
+ add_field :fillers_expected_availability_date_time
36
37
  add_field :confidentiality_code
37
38
  add_field :order_type
38
39
  add_field :enterer_authorization_mode
39
40
  add_field :parent_universal_service_identifier
40
-
41
- private
42
- def self.convert_to_ts(value) #:nodoc:
43
- if value.is_a?(Time) or value.is_a?(Date)
44
- return value.to_hl7
45
- else
46
- return value
47
- end
41
+
42
+ def self.convert_to_ts(value) # :nodoc:
43
+ return value.to_hl7 if value.is_a?(Time) || value.is_a?(Date)
44
+
45
+ value
48
46
  end
49
47
  end
data/lib/segments/oru.rb CHANGED
@@ -1,3 +1,4 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::ORU < HL7::Message::Segment
3
4
  end
data/lib/segments/pid.rb CHANGED
@@ -1,7 +1,8 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::PID < HL7::Message::Segment
3
4
  weight 1
4
- has_children [:NK1,:NTE,:PV1,:PV2]
5
+ has_children %i[NK1 NTE PV1 PV2]
5
6
  add_field :set_id
6
7
  add_field :patient_id
7
8
  add_field :patient_id_list
@@ -12,11 +13,7 @@ class HL7::Message::Segment::PID < HL7::Message::Segment
12
13
  convert_to_ts(value)
13
14
  end
14
15
  add_field :admin_sex do |sex|
15
- unless /^[FMOUANC]$/.match(sex) || sex == nil || sex == ""
16
- raise HL7::InvalidDataError.new( "bad administrative sex value (not F|M|O|U|A|N|C)" )
17
- end
18
- sex = "" unless sex
19
- sex
16
+ sanitize_admin_sex!(sex)
20
17
  end
21
18
  add_field :patient_alias
22
19
  add_field :race
@@ -43,7 +40,7 @@ class HL7::Message::Segment::PID < HL7::Message::Segment
43
40
  end
44
41
  add_field :death_indicator
45
42
  add_field :id_unknown_indicator
46
- add_field :id_readability_code
43
+ add_field :id_reliability_code
47
44
  add_field :last_update_date do |value|
48
45
  convert_to_ts(value)
49
46
  end
@@ -55,14 +52,26 @@ class HL7::Message::Segment::PID < HL7::Message::Segment
55
52
  add_field :tribal_citizenship
56
53
 
57
54
  def country_code
58
- warn "DEPRECATION WARNING: PID-12 is defined as 'county_code'; "+
55
+ warn "DEPRECATION WARNING: PID-12 is defined as 'county_code'; " \
59
56
  "the 'country_code' alias is retained for backwards compatibility only."
60
57
  county_code
61
58
  end
62
59
 
63
60
  def country_code=(country_code)
64
- warn "DEPRECATION WARNING: PID-12 is defined as 'county_code'; "+
61
+ warn "DEPRECATION WARNING: PID-12 is defined as 'county_code'; " \
65
62
  "the 'country_code' alias is retained for backwards compatibility only."
66
63
  self.county_code = country_code
67
64
  end
65
+
66
+ def id_readability_code
67
+ warn "DEPRECATION WARNING: PID-32 is defined as 'id_reliability_code'; " \
68
+ "the 'id_readability_code' alias is retained for backwards compatibility only."
69
+ id_reliability_code
70
+ end
71
+
72
+ def id_readability_code=(code)
73
+ warn "DEPRECATION WARNING: PID-32 is defined as 'id_reliability_code'; " \
74
+ "the 'id_readability_code' alias is retained for backwards compatibility only."
75
+ self.id_reliability_code = code
76
+ end
68
77
  end
data/lib/segments/prd.rb CHANGED
@@ -1,4 +1,5 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::PRD < HL7::Message::Segment
3
4
  weight 2
4
5
  add_field :provider_role
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ class HL7::Message::Segment::PRT < HL7::Message::Segment
4
+ add_field :participation_instance_id, :idx => 1
5
+ add_field :action_code, :idx => 2
6
+ add_field :action_reason, :idx => 3
7
+ add_field :participation, :idx => 4
8
+ add_field :participation_person, :idx => 5
9
+ add_field :participation_person_provider_type, :idx => 6
10
+ add_field :participation_organization_unit_type, :idx => 7
11
+ add_field :participation_organization, :idx => 8
12
+ add_field :participation_location, :idx => 9
13
+ add_field :participation_device, :idx => 10
14
+ add_field :participation_begin_date_time, :idx => 11 do |value|
15
+ convert_to_ts(value)
16
+ end
17
+ add_field :participation_end_date_time, :idx => 12 do |value|
18
+ convert_to_ts(value)
19
+ end
20
+ add_field :participation_qualitative_duration, :idx => 13
21
+ add_field :participation_address, :idx => 14
22
+ add_field :participation_telecommunication_address, :idx => 15
23
+ end
data/lib/segments/pv1.rb CHANGED
@@ -1,4 +1,5 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::PV1 < HL7::Message::Segment
3
4
  weight 2
4
5
  add_field :set_id
data/lib/segments/pv2.rb CHANGED
@@ -1,55 +1,68 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::PV2 < HL7::Message::Segment
3
4
  weight 3
4
- add_field :prior_pending_location
5
- add_field :accommodation_code
6
- add_field :admit_reason
7
- add_field :transfer_reason
8
- add_field :patient_valuables
9
- add_field :patient_valuables_location
10
- add_field :visit_user_code
11
- add_field :expected_admit_date
12
- add_field :expected_discharge_date
13
- add_field :estimated_inpatient_stay_length
14
- add_field :actual_inpatient_stay_length
15
- add_field :visit_description
16
- add_field :referral_source_code
17
- add_field :previous_service_date
18
- add_field :employment_illness_related_indicator
19
- add_field :purge_status_code
20
- add_field :purge_status_date
21
- add_field :special_program_code
22
- add_field :retention_indicator
23
- add_field :expected_number_of_insurance_plans
24
- add_field :visit_publicity_code
25
- add_field :visit_protection_indicator
26
- add_field :clinic_organization_name
27
- add_field :patient_status_code
28
- add_field :visit_priority_code
29
- add_field :previous_treatment_date
30
- add_field :expected_discharge_disposition
31
- add_field :signature_on_file
32
- add_field :first_similar_illness_date
33
- add_field :patient_charge_adjustment_code
34
- add_field :recurring_service_code
35
- add_field :billing_media_code
36
- add_field :expected_surgery_date
5
+ add_field :prior_pending_location, :idx => 1
6
+ add_field :accommodation_code, :idx => 2
7
+ add_field :admit_reason, :idx => 3
8
+ add_field :transfer_reason, :idx => 4
9
+ add_field :patient_valuables, :idx => 5
10
+ add_field :patient_valuables_location, :idx => 6
11
+ add_field :visit_user_code, :idx => 7
12
+ add_field :expected_admit_date, :idx => 8
13
+ add_field :expected_discharge_date, :idx => 9
14
+ add_field :estimated_inpatient_stay_length, :idx => 10
15
+ add_field :actual_inpatient_stay_length, :idx => 11
16
+ add_field :visit_description, :idx => 12
17
+ add_field :referral_source_code, :idx => 13
18
+ add_field :previous_service_date, :idx => 14
19
+ add_field :employment_illness_related_indicator, :idx => 15
20
+ add_field :purge_status_code, :idx => 16
21
+ add_field :purge_status_date, :idx => 17
22
+ add_field :special_program_code, :idx => 18
23
+ add_field :retention_indicator, :idx => 19
24
+ add_field :expected_number_of_insurance_plans, :idx => 20
25
+ add_field :visit_publicity_code, :idx => 21
26
+ add_field :visit_protection_indicator, :idx => 22
27
+ add_field :clinic_organization_name, :idx => 23
28
+ add_field :patient_status_code, :idx => 24
29
+ add_field :visit_priority_code, :idx => 25
30
+ add_field :previous_treatment_date, :idx => 26
31
+ add_field :expected_discharge_disposition, :idx => 27
32
+ add_field :signature_on_file, :idx => 28
33
+ add_field :first_similar_illness_date, :idx => 29
34
+ add_field :patient_charge_adjustment_code, :idx => 30
35
+ add_field :recurring_service_code, :idx => 31
36
+ add_field :billing_media_code, :idx => 32
37
+ add_field :expected_surgery_date, :idx => 33
38
+ add_field :military_partnership_code, :idx => 34
39
+ add_field :military_non_availability_code, :idx => 35
40
+ add_field :newborn_baby_indicator, :idx => 36
41
+ add_field :baby_detained_indicator, :idx => 37
42
+ add_field :mode_of_arrival_code, :idx => 38
43
+ add_field :recreational_drug_use_code, :idx => 39
44
+ add_field :admission_level_of_care_code, :idx => 40
45
+ add_field :precaution_code, :idx => 41
46
+ add_field :patient_condition_code, :idx => 42
47
+ add_field :living_will_code, :idx => 43
48
+ add_field :organ_donor_code, :idx => 44
49
+ add_field :advance_directive_code, :idx => 45
50
+ add_field :patient_status_effective_date, :idx => 46
51
+ add_field :expected_loa_return_date, :idx => 47
52
+ add_field :expected_preadmission_testing_date, :idx => 48
53
+ add_field :notify_clergy_code, :idx => 49
54
+
55
+ def military_non_availibility_code
56
+ warn "DEPRECATION WARNING: PV2-35 is defined as 'military_non_availability_code'; " \
57
+ "the 'military_non_availibility_code' alias is retained for backwards compatibility only."
58
+
59
+ military_non_availability_code
60
+ end
61
+
62
+ def military_non_availibility_code=(code)
63
+ warn "DEPRECATION WARNING: PV2-35 is defined as 'military_non_availability_code'; " \
64
+ "the 'military_non_availibility_code' alias is retained for backwards compatibility only."
37
65
 
38
- # Adding military fields
39
- [ :military_partnership_code,
40
- :military_non_availibility_code,
41
- :newborn_baby_indicator,
42
- :baby_detained_indicator,
43
- :mode_of_arrival_code,
44
- :recreational_drug_use_code,
45
- :precaution_code,
46
- :patient_condition_code,
47
- :living_will_code,
48
- :organ_donor_code,
49
- :advance_directive_code,
50
- :patient_status_effective_date,
51
- :expected_loa_return_date,
52
- :expected_preadmission_testing_date,
53
- :notify_clergy_code
54
- ].each { |f| add_field f }
66
+ self.military_non_availability_code = code
67
+ end
55
68
  end
data/lib/segments/qrd.rb CHANGED
@@ -1,4 +1,5 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::QRD < HL7::Message::Segment
3
4
  weight 84
4
5
  add_field :query_date
data/lib/segments/qrf.rb CHANGED
@@ -1,4 +1,5 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::QRF < HL7::Message::Segment
3
4
  weight 85
4
5
  add_field :where_subject_filter
data/lib/segments/rf1.rb CHANGED
@@ -1,4 +1,5 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  class HL7::Message::Segment::RF1 < HL7::Message::Segment
3
4
  weight 0 # should occur after the MSH segment
4
5
  add_field :referral_status
data/lib/segments/rgs.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class HL7::Message::Segment::RGS < HL7::Message::Segment
2
4
  weight 3
3
5
  add_field :set_id
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ class HL7::Message::Segment::ROL < HL7::Message::Segment
4
+ add_field :role_instance, :idx => 1
5
+ add_field :action_code, :idx => 2
6
+ add_field :role, :idx => 3
7
+ add_field :role_person, :idx => 4
8
+ add_field :role_begin_date_time, :idx => 5 do |value|
9
+ convert_to_ts(value)
10
+ end
11
+ add_field :role_end_date_time, :idx => 6 do |value|
12
+ convert_to_ts(value)
13
+ end
14
+ add_field :role_duration, :idx => 7
15
+ add_field :role_action_reason, :idx => 8
16
+ add_field :provider_type, :idx => 9
17
+ add_field :organization_unit_type, :idx => 10
18
+ add_field :office_home_address_birthplace, :idx => 11
19
+ add_field :phone_number, :idx => 12
20
+ add_field :person_location, :idx => 13
21
+ add_field :organization, :idx => 14
22
+ end
data/lib/segments/sch.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class HL7::Message::Segment::SCH < HL7::Message::Segment
2
4
  weight 0
3
5
  add_field :placer_appointment_id
data/lib/segments/sft.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class HL7::Message::Segment::SFT < HL7::Message::Segment
2
4
  weight 0
3
5
  add_field :software_vendor_organization
data/lib/segments/spm.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class HL7::Message::Segment::SPM < HL7::Message::Segment
2
4
  # Weight doesn't really matter, since this always occurs as a child
3
5
  # of an OBR segment.
data/lib/segments/tq1.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class HL7::Message::Segment::TQ1 < HL7::Message::Segment
2
4
  weight 2
3
5
  add_field :set_id
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ class HL7::Message::Segment::TXA < HL7::Message::Segment
4
+ add_field :set_id
5
+ add_field :document_type
6
+ add_field :document_content_presentation
7
+ add_field :activity_date_time
8
+ add_field :primary_activity_provider_code
9
+ add_field :origination_date_time
10
+ add_field :transcription_date_time
11
+ add_field :edit_date_time
12
+ add_field :originator_code
13
+ add_field :assigned_document_authenticator
14
+ add_field :transcriptionist_code
15
+ add_field :unique_document_number
16
+ add_field :parent_document_number
17
+ add_field :placer_order_number
18
+ add_field :filler_order_number
19
+ add_field :unique_document_file_name
20
+ add_field :document_completion_status
21
+ add_field :document_confidentiality_status
22
+ add_field :document_availability_status
23
+ add_field :document_storage_status
24
+ add_field :document_change_reason
25
+ add_field :authentication_person_time_stamp
26
+ add_field :distributed_copies_code
27
+ add_field :folder_assignment
28
+ add_field :document_title
29
+ add_field :agreed_due_date_time
30
+ end