pipehat 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rubocop.yml +18 -0
- data/.travis.yml +10 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +184 -0
- data/Rakefile +10 -0
- data/bin/console +10 -0
- data/bin/setup +8 -0
- data/lib/pipehat.rb +22 -0
- data/lib/pipehat/component/base.rb +30 -0
- data/lib/pipehat/define_type.rb +68 -0
- data/lib/pipehat/field/base.rb +59 -0
- data/lib/pipehat/message.rb +32 -0
- data/lib/pipehat/node.rb +53 -0
- data/lib/pipehat/parser.rb +149 -0
- data/lib/pipehat/repeat/base.rb +31 -0
- data/lib/pipehat/segment/aip.rb +21 -0
- data/lib/pipehat/segment/ais.rb +21 -0
- data/lib/pipehat/segment/al1.rb +15 -0
- data/lib/pipehat/segment/base.rb +124 -0
- data/lib/pipehat/segment/dg1.rb +30 -0
- data/lib/pipehat/segment/err.rb +21 -0
- data/lib/pipehat/segment/evn.rb +16 -0
- data/lib/pipehat/segment/in1.rb +64 -0
- data/lib/pipehat/segment/msa.rb +17 -0
- data/lib/pipehat/segment/msh.rb +52 -0
- data/lib/pipehat/segment/obr.rb +63 -0
- data/lib/pipehat/segment/obx.rb +37 -0
- data/lib/pipehat/segment/orc.rb +43 -0
- data/lib/pipehat/segment/pid.rb +49 -0
- data/lib/pipehat/segment/prd.rb +23 -0
- data/lib/pipehat/segment/pv1.rb +63 -0
- data/lib/pipehat/segment/rf1.rb +34 -0
- data/lib/pipehat/segment/rgs.rb +12 -0
- data/lib/pipehat/segment/sch.rb +36 -0
- data/lib/pipehat/subcomponent/base.rb +27 -0
- data/lib/pipehat/types/aui.rb +8 -0
- data/lib/pipehat/types/ce.rb +11 -0
- data/lib/pipehat/types/cne.rb +27 -0
- data/lib/pipehat/types/cnn.rb +16 -0
- data/lib/pipehat/types/cp.rb +11 -0
- data/lib/pipehat/types/cq.rb +7 -0
- data/lib/pipehat/types/cwe.rb +27 -0
- data/lib/pipehat/types/cx.rb +17 -0
- data/lib/pipehat/types/dld.rb +7 -0
- data/lib/pipehat/types/dt.rb +4 -0
- data/lib/pipehat/types/dtm.rb +4 -0
- data/lib/pipehat/types/ei.rb +9 -0
- data/lib/pipehat/types/eip.rb +7 -0
- data/lib/pipehat/types/erl.rb +11 -0
- data/lib/pipehat/types/fn.rb +10 -0
- data/lib/pipehat/types/hd.rb +8 -0
- data/lib/pipehat/types/id.rb +4 -0
- data/lib/pipehat/types/is.rb +4 -0
- data/lib/pipehat/types/mo.rb +7 -0
- data/lib/pipehat/types/moc.rb +7 -0
- data/lib/pipehat/types/msg.rb +8 -0
- data/lib/pipehat/types/ndl.rb +16 -0
- data/lib/pipehat/types/nm.rb +4 -0
- data/lib/pipehat/types/pl.rb +16 -0
- data/lib/pipehat/types/pln.rb +9 -0
- data/lib/pipehat/types/prl.rb +8 -0
- data/lib/pipehat/types/pt.rb +7 -0
- data/lib/pipehat/types/rc.rb +7 -0
- data/lib/pipehat/types/sad.rb +8 -0
- data/lib/pipehat/types/si.rb +4 -0
- data/lib/pipehat/types/snm.rb +4 -0
- data/lib/pipehat/types/st.rb +4 -0
- data/lib/pipehat/types/ts.rb +7 -0
- data/lib/pipehat/types/tx.rb +4 -0
- data/lib/pipehat/types/varies.rb +28 -0
- data/lib/pipehat/types/vid.rb +8 -0
- data/lib/pipehat/types/xad.rb +28 -0
- data/lib/pipehat/types/xcn.rb +30 -0
- data/lib/pipehat/types/xon.rb +15 -0
- data/lib/pipehat/types/xpn.rb +20 -0
- data/lib/pipehat/types/xtn.rb +22 -0
- data/lib/pipehat/version.rb +3 -0
- data/pipehat.gemspec +27 -0
- metadata +127 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Pipehat
|
4
|
+
module Segment
|
5
|
+
# Referral Information
|
6
|
+
class RF1 < Base
|
7
|
+
add_field :referral_status, :CWE
|
8
|
+
add_field :referral_priority, :CWE
|
9
|
+
add_field :referral_type, :CWE
|
10
|
+
add_field :referral_disposition, :CWE
|
11
|
+
add_field :referral_category, :CWE
|
12
|
+
add_field :originating_referral_identifier, :EI
|
13
|
+
add_field :effective_date, :DTM
|
14
|
+
add_field :expiration_date, :DTM
|
15
|
+
add_field :process_date, :DTM
|
16
|
+
add_field :referral_reason, :CWE
|
17
|
+
add_field :external_referral_identifier, :EI
|
18
|
+
add_field :referral_documentation_completion_status, :CWE
|
19
|
+
add_field :planned_treatment_stop_date, :DTM
|
20
|
+
add_field :referral_reason_text, :ST
|
21
|
+
add_field :number_of_authorized_treatments_units, :CQ
|
22
|
+
add_field :number_of_used_treatments_units, :CQ
|
23
|
+
add_field :number_of_schedule_treatments_units, :CQ
|
24
|
+
add_field :remaining_benefit_amount, :MO
|
25
|
+
add_field :authorized_provider, :XCN
|
26
|
+
add_field :authorized_health_professional, :XCN
|
27
|
+
add_field :source_text, :ST
|
28
|
+
add_field :source_date, :DTM
|
29
|
+
add_field :source_phone, :XTN
|
30
|
+
add_field :comment, :ST
|
31
|
+
add_field :action_code, :ID
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Pipehat
|
4
|
+
module Segment
|
5
|
+
# Scheduling Activity Information
|
6
|
+
class SCH < Base
|
7
|
+
add_field :placer_appointment_id, :EI
|
8
|
+
add_field :filler_appointment_id, :EI
|
9
|
+
add_field :occurrence_number, :NM
|
10
|
+
add_field :placer_group_number, :EI
|
11
|
+
add_field :schedule_id, :CWE
|
12
|
+
add_field :event_reason, :CWE
|
13
|
+
add_field :appointment_reason, :CWE
|
14
|
+
add_field :appointment_type, :CWE
|
15
|
+
add_field :appointment_duration, :NM
|
16
|
+
add_field :appointment_duration_units, :CNE
|
17
|
+
add_field :appointment_timing_quantity, :ST
|
18
|
+
add_field :placer_contact_person, :XCN
|
19
|
+
add_field :placer_contact_phone_number, :XTN
|
20
|
+
add_field :placer_contact_address, :XAD
|
21
|
+
add_field :placer_contact_location, :PL
|
22
|
+
add_field :filler_contact_person, :XCN
|
23
|
+
add_field :filler_contact_phone_number, :XTN
|
24
|
+
add_field :filler_contact_address, :XAD
|
25
|
+
add_field :filler_contact_location, :PL
|
26
|
+
add_field :entered_by_person, :XCN
|
27
|
+
add_field :entered_by_phone_number, :XTN
|
28
|
+
add_field :entered_by_location, :PL
|
29
|
+
add_field :parent_placer_appointment_id, :EI
|
30
|
+
add_field :parent_filler_appointment_id, :EI
|
31
|
+
add_field :filler_status_code, :CWE
|
32
|
+
add_field :placer_order_number, :EI
|
33
|
+
add_field :filler_order_number, :EI
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Pipehat
|
2
|
+
module Subcomponent
|
3
|
+
class Base < Pipehat::Node
|
4
|
+
def initialize(segment, fnum, rnum, cnum, snum)
|
5
|
+
@segment = segment
|
6
|
+
@fnum = fnum
|
7
|
+
@rnum = rnum
|
8
|
+
@cnum = cnum
|
9
|
+
@snum = snum
|
10
|
+
end
|
11
|
+
|
12
|
+
attr_reader :segment, :fnum, :rnum, :cnum, :snum
|
13
|
+
|
14
|
+
def set(value)
|
15
|
+
segment.set_subcomponent(fnum, rnum, cnum, snum, value)
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_hl7
|
19
|
+
segment.tree(fnum, rnum, cnum, snum)
|
20
|
+
end
|
21
|
+
|
22
|
+
def inspect
|
23
|
+
inspect_node(fnum, rnum, cnum, snum)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Coded Element
|
4
|
+
Pipehat.define_type :CE do
|
5
|
+
add_component :identifier, :ST
|
6
|
+
add_component :text, :ST
|
7
|
+
add_component :name_of_coding_system, :ID
|
8
|
+
add_component :alternate_identifier, :ST
|
9
|
+
add_component :alternate_text, :ST
|
10
|
+
add_component :name_of_alternate_coding_system, :ID
|
11
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Coded with No Exceptions
|
4
|
+
Pipehat.define_type :CNE do
|
5
|
+
add_component :identifier, :ST
|
6
|
+
add_component :text, :ST
|
7
|
+
add_component :name_of_coding_system, :ID
|
8
|
+
add_component :alternate_identifier, :ST
|
9
|
+
add_component :alternate_text, :ST
|
10
|
+
add_component :name_of_alternate_coding_system, :ID
|
11
|
+
add_component :coding_system_version_id, :ST
|
12
|
+
add_component :alternate_coding_system_version_id, :ST
|
13
|
+
add_component :original_text, :ST
|
14
|
+
add_component :second_alternate_identifier, :ST
|
15
|
+
add_component :second_alternate_text, :ST
|
16
|
+
add_component :name_of_second_alternate_coding_system, :ID
|
17
|
+
add_component :second_alternate_coding_system_version_id, :ST
|
18
|
+
add_component :coding_system_oid, :ST
|
19
|
+
add_component :value_set_oid, :ST
|
20
|
+
add_component :value_set_version_id, :DTM
|
21
|
+
add_component :alternate_coding_system_oid, :ST
|
22
|
+
add_component :alternate_value_set_oid, :ST
|
23
|
+
add_component :alternate_value_set_version_id, :DTM
|
24
|
+
add_component :second_alternate_coding_system_oid, :ST
|
25
|
+
add_component :second_alternate_value_set_oid, :ST
|
26
|
+
add_component :second_alternate_value_set_version_id, :DTM
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Composite ID Number and Name Simplified
|
4
|
+
Pipehat.define_type :CNN do
|
5
|
+
add_component :id_number, :ST
|
6
|
+
add_component :family_name, :ST
|
7
|
+
add_component :given_name, :ST
|
8
|
+
add_component :second_and_further_given_names_or_initials_thereof, :ST
|
9
|
+
add_component :suffix, :ST
|
10
|
+
add_component :prefix, :ST
|
11
|
+
add_component :degree, :IS
|
12
|
+
add_component :source_table, :IS
|
13
|
+
add_component :assigning_authority_namespace_id, :IS
|
14
|
+
add_component :assigning_authority_universal_id, :ST
|
15
|
+
add_component :assigning_authority_universal_id_type, :ID
|
16
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Composite Price
|
4
|
+
Pipehat.define_type :CP do
|
5
|
+
add_component :price, :MO
|
6
|
+
add_component :price_type, :ID
|
7
|
+
add_component :from_value, :NM
|
8
|
+
add_component :to_value, :NM
|
9
|
+
add_component :range_units, :CE
|
10
|
+
add_component :range_type, :ID
|
11
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Coded with Exceptions
|
4
|
+
Pipehat.define_type :CWE do
|
5
|
+
add_component :identifier, :ST
|
6
|
+
add_component :text, :ST
|
7
|
+
add_component :name_of_coding_system, :ID
|
8
|
+
add_component :alternate_identifier, :ST
|
9
|
+
add_component :alternate_text, :ST
|
10
|
+
add_component :name_of_alternate_coding_system, :ID
|
11
|
+
add_component :coding_system_version_id, :ST
|
12
|
+
add_component :alternate_coding_system_version_id, :ST
|
13
|
+
add_component :original_text, :ST
|
14
|
+
add_component :second_alternate_identifier, :ST
|
15
|
+
add_component :second_alternate_text, :ST
|
16
|
+
add_component :name_of_second_alternate_coding_system, :ID
|
17
|
+
add_component :second_alternate_coding_system_version_id, :ST
|
18
|
+
add_component :coding_system_oid, :ST
|
19
|
+
add_component :value_set_oid, :ST
|
20
|
+
add_component :value_set_version_id, :DTM
|
21
|
+
add_component :alternate_coding_system_oid, :ST
|
22
|
+
add_component :alternate_value_set_oid, :ST
|
23
|
+
add_component :alternate_value_set_version_id, :DTM
|
24
|
+
add_component :second_alternate_coding_system_oid, :ST
|
25
|
+
add_component :second_alternate_value_set_oid, :ST
|
26
|
+
add_component :second_alternate_value_set_version_id, :DTM
|
27
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Extended Composite ID with Check Digit
|
4
|
+
Pipehat.define_type :CX do
|
5
|
+
add_component :id_number, :ST
|
6
|
+
add_component :identifier_check_digit, :ST
|
7
|
+
add_component :check_digit_scheme, :ID
|
8
|
+
add_component :assigning_authority, :HD
|
9
|
+
add_component :identifier_type_code, :ID
|
10
|
+
add_component :assigning_facility, :HD
|
11
|
+
add_component :effective_date, :DT
|
12
|
+
add_component :expiration_date, :DT
|
13
|
+
add_component :assigning_jurisdiction, :CWE
|
14
|
+
add_component :assigning_agency_or_department, :CWE
|
15
|
+
add_component :security_check, :ST
|
16
|
+
add_component :security_check_scheme, :ID
|
17
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Error Location
|
4
|
+
Pipehat.define_type :ERL do
|
5
|
+
add_component :segment_id, :ST
|
6
|
+
add_component :segment_sequence, :NM
|
7
|
+
add_component :field_position, :NM
|
8
|
+
add_component :field_repetition, :NM
|
9
|
+
add_component :component_number, :NM
|
10
|
+
add_component :subcomponent_number, :NM
|
11
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Family Name
|
4
|
+
Pipehat.define_type :FN do
|
5
|
+
add_component :surname, :ST
|
6
|
+
add_component :own_surname_prefix, :ST
|
7
|
+
add_component :own_surname, :ST
|
8
|
+
add_component :surname_prefix_from_partner, :ST
|
9
|
+
add_component :surname_from_partner, :ST
|
10
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Name with Date and Location
|
4
|
+
Pipehat.define_type :NDL do
|
5
|
+
add_component :name, :CNN
|
6
|
+
add_component :start_date_time, :DTM
|
7
|
+
add_component :end_date_time, :DTM
|
8
|
+
add_component :point_of_care, :IS
|
9
|
+
add_component :room, :IS
|
10
|
+
add_component :bed, :IS
|
11
|
+
add_component :facility, :HD
|
12
|
+
add_component :location_status, :IS
|
13
|
+
add_component :patient_location_type, :IS
|
14
|
+
add_component :building, :IS
|
15
|
+
add_component :floor, :IS
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Person Location
|
4
|
+
Pipehat.define_type :PL do
|
5
|
+
add_component :point_of_care, :HD
|
6
|
+
add_component :room, :HD
|
7
|
+
add_component :bed, :HD
|
8
|
+
add_component :facility, :HD
|
9
|
+
add_component :location_status, :IS
|
10
|
+
add_component :person_location_type, :IS
|
11
|
+
add_component :building, :HD
|
12
|
+
add_component :floor, :HD
|
13
|
+
add_component :location_description, :ST
|
14
|
+
add_component :comprehensive_location_identifier, :EI
|
15
|
+
add_component :assigning_authority_for_location, :HD
|
16
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Practitioner License or Other ID Number
|
4
|
+
Pipehat.define_type :PLN do
|
5
|
+
add_component :id_number, :ST
|
6
|
+
add_component :type_of_id_number, :CWE
|
7
|
+
add_component :state_other_qualifying_information, :ST
|
8
|
+
add_component :expiration_date, :DT
|
9
|
+
end
|