eancom 0.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +190 -5
- data/.gitlab-ci.yml +25 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +22 -18
- data/README.md +46 -0
- data/bin/console +3 -2
- data/definitions/desadv/d01b.rb +251 -0
- data/definitions/desadv/d96a.rb +208 -87
- data/definitions/invoic/d01b.rb +559 -0
- data/definitions/invoic/d96a.rb +389 -0
- data/definitions/invrpt/d01b.rb +134 -0
- data/definitions/invrpt/d96a.rb +125 -0
- data/definitions/orders/d01b.rb +182 -0
- data/definitions/orders/d96b.rb +198 -0
- data/definitions/ordrsp/d01b.rb +251 -0
- data/definitions/ordrsp/d96b.rb +226 -0
- data/definitions/pricat/d01b.rb +225 -0
- data/definitions/pricat/d96b.rb +207 -0
- data/definitions/retann/d01b.rb +172 -0
- data/definitions/retann/d96b.rb +221 -0
- data/definitions/segments/ajt.rb +47 -0
- data/definitions/segments/alc.rb +328 -0
- data/definitions/segments/ali.rb +93 -0
- data/definitions/segments/bgm.rb +395 -0
- data/definitions/segments/cav.rb +122 -0
- data/definitions/segments/cci.rb +136 -0
- data/definitions/segments/cdi.rb +39 -0
- data/definitions/segments/cnt.rb +82 -0
- data/definitions/segments/cps.rb +76 -0
- data/definitions/segments/cta.rb +89 -0
- data/definitions/segments/cux.rb +174 -0
- data/definitions/segments/dgs.rb +34 -0
- data/definitions/segments/doc.rb +45 -0
- data/definitions/segments/dtm.rb +243 -0
- data/definitions/segments/efi.rb +67 -0
- data/definitions/segments/eqd.rb +37 -0
- data/definitions/segments/ftx.rb +165 -0
- data/definitions/segments/gin.rb +113 -0
- data/definitions/segments/imd.rb +360 -0
- data/definitions/segments/inv.rb +94 -0
- data/definitions/segments/lin.rb +133 -0
- data/definitions/segments/loc.rb +137 -0
- data/definitions/segments/mea.rb +189 -0
- data/definitions/segments/moa.rb +228 -0
- data/definitions/segments/nad.rb +314 -0
- data/definitions/segments/pac.rb +262 -0
- data/definitions/segments/pat.rb +171 -0
- data/definitions/segments/pcd.rb +72 -0
- data/definitions/segments/pci.rb +110 -0
- data/definitions/segments/pgi.rb +152 -0
- data/definitions/segments/pia.rb +501 -0
- data/definitions/segments/pri.rb +208 -0
- data/definitions/segments/qty.rb +293 -0
- data/definitions/segments/rff.rb +210 -0
- data/definitions/segments/rte.rb +52 -0
- data/definitions/segments/tax.rb +266 -0
- data/definitions/segments/tdt.rb +278 -0
- data/definitions/segments/tod.rb +64 -0
- data/definitions/segments/tru.rb +34 -0
- data/definitions/segments/una.rb +85 -0
- data/definitions/segments/unb.rb +284 -0
- data/definitions/segments/unh.rb +183 -0
- data/definitions/segments/uns.rb +40 -0
- data/definitions/segments/unt.rb +48 -0
- data/definitions/segments/unz.rb +48 -0
- data/definitions/slsrpt/d01b.rb +206 -0
- data/definitions/slsrpt/d96a.rb +199 -0
- data/eancom.gemspec +2 -1
- data/lib/eancom.rb +61 -16
- data/lib/eancom/definition.rb +1 -1
- data/lib/eancom/edifact.rb +60 -13
- data/lib/eancom/edifact/body.rb +63 -0
- data/lib/eancom/edifact/composite.rb +38 -0
- data/lib/eancom/edifact/data.rb +108 -0
- data/lib/eancom/edifact/document.rb +43 -11
- data/lib/eancom/edifact/document_element.rb +26 -0
- data/lib/eancom/edifact/footer.rb +7 -0
- data/lib/eancom/edifact/header.rb +15 -0
- data/lib/eancom/edifact/item.rb +40 -0
- data/lib/eancom/edifact/message.rb +24 -16
- data/lib/eancom/edifact/segment.rb +131 -12
- data/lib/eancom/edifact/segments/ajt.rb +32 -0
- data/lib/eancom/edifact/segments/alc.rb +61 -0
- data/lib/eancom/edifact/segments/ali.rb +50 -0
- data/lib/eancom/edifact/segments/bgm.rb +46 -0
- data/lib/eancom/edifact/segments/cav.rb +47 -0
- data/lib/eancom/edifact/segments/cci.rb +53 -0
- data/lib/eancom/edifact/segments/cdi.rb +30 -0
- data/lib/eancom/edifact/segments/cnt.rb +40 -0
- data/lib/eancom/edifact/segments/cps.rb +33 -0
- data/lib/eancom/edifact/segments/cta.rb +30 -0
- data/lib/eancom/edifact/segments/cux.rb +60 -0
- data/lib/eancom/edifact/segments/dgs.rb +31 -0
- data/lib/eancom/edifact/segments/doc.rb +30 -0
- data/lib/eancom/edifact/segments/dtm.rb +47 -0
- data/lib/eancom/edifact/segments/efi.rb +38 -0
- data/lib/eancom/edifact/segments/eqd.rb +30 -0
- data/lib/eancom/edifact/segments/ftx.rb +63 -0
- data/lib/eancom/edifact/segments/gin.rb +45 -0
- data/lib/eancom/edifact/segments/imd.rb +69 -0
- data/lib/eancom/edifact/segments/inv.rb +43 -0
- data/lib/eancom/edifact/segments/lin.rb +47 -0
- data/lib/eancom/edifact/segments/loc.rb +46 -0
- data/lib/eancom/edifact/segments/mea.rb +54 -0
- data/lib/eancom/edifact/segments/moa.rb +45 -0
- data/lib/eancom/edifact/segments/nad.rb +112 -0
- data/lib/eancom/edifact/segments/pac.rb +56 -0
- data/lib/eancom/edifact/segments/pat.rb +37 -0
- data/lib/eancom/edifact/segments/pcd.rb +33 -0
- data/lib/eancom/edifact/segments/pci.rb +40 -0
- data/lib/eancom/edifact/segments/pgi.rb +45 -0
- data/lib/eancom/edifact/segments/pia.rb +108 -0
- data/lib/eancom/edifact/segments/pri.rb +53 -0
- data/lib/eancom/edifact/segments/qty.rb +44 -0
- data/lib/eancom/edifact/segments/rff.rb +47 -0
- data/lib/eancom/edifact/segments/rte.rb +33 -0
- data/lib/eancom/edifact/segments/tax.rb +78 -0
- data/lib/eancom/edifact/segments/tdt.rb +57 -0
- data/lib/eancom/edifact/segments/tod.rb +33 -0
- data/lib/eancom/edifact/segments/tru.rb +31 -0
- data/lib/eancom/edifact/segments/una.rb +52 -0
- data/lib/eancom/edifact/segments/unb.rb +68 -0
- data/lib/eancom/edifact/segments/unh.rb +50 -0
- data/lib/eancom/edifact/segments/uns.rb +32 -0
- data/lib/eancom/edifact/segments/unt.rb +28 -0
- data/lib/eancom/edifact/segments/unz.rb +28 -0
- data/lib/eancom/edifact/structure.rb +90 -0
- data/lib/eancom/factory.rb +9 -8
- data/lib/eancom/parser.rb +7 -0
- data/lib/eancom/parser/document.rb +60 -0
- data/lib/eancom/parser/segment.rb +71 -0
- data/lib/eancom/version.rb +1 -1
- data/pricat.json +1 -0
- metadata +141 -9
- data/lib/eancom/edifact/element.rb +0 -16
- data/lib/eancom/edifact/envelope.rb +0 -24
@@ -0,0 +1,38 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class EFI < Segment
|
4
|
+
TAG = 'EFI'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
file_name: nil,
|
12
|
+
file_format_name:,
|
13
|
+
data_format_description_code:
|
14
|
+
)
|
15
|
+
|
16
|
+
@tag = tag
|
17
|
+
@file_name = file_name
|
18
|
+
@file_format_name = file_format_name
|
19
|
+
@data_format_description_code = data_format_description_code
|
20
|
+
|
21
|
+
super(tag: tag || TAG)
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
def to_json_hash
|
26
|
+
hash = {}
|
27
|
+
hash.merge!(file_name: file_name) if @file_name
|
28
|
+
hash.merge!(file_format_name: file_format_name) if @file_format_name
|
29
|
+
hash.merge!(data_format_description_code: find_identifier(:data_format_description_code)) if @data_format_description_code
|
30
|
+
hash
|
31
|
+
end
|
32
|
+
|
33
|
+
def segment_type
|
34
|
+
TYPE
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class EQD < Segment
|
4
|
+
TAG = 'EQD'.freeze
|
5
|
+
TYPE = :header
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
equipment_code_qualifier: nil
|
12
|
+
)
|
13
|
+
|
14
|
+
@tag = tag
|
15
|
+
@equipment_code_qualifier = equipment_code_qualifier
|
16
|
+
|
17
|
+
super(tag: tag || TAG)
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_json_hash
|
21
|
+
hash = {}
|
22
|
+
hash.merge!(equipment_code_qualifier: find_identifier(:equipment_code_qualifier)) if @equipment_code_qualifier
|
23
|
+
end
|
24
|
+
|
25
|
+
def segment_type
|
26
|
+
TYPE
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class FTX < Segment
|
4
|
+
TAG = 'FTX'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
text_subject_code_qualifier:,
|
12
|
+
free_text_function_code: nil,
|
13
|
+
free_text_value_code: nil,
|
14
|
+
code_list_identification_code: nil,
|
15
|
+
code_list_responsible_agency_code: nil,
|
16
|
+
free_text_value_1: nil,
|
17
|
+
free_text_value_2: nil,
|
18
|
+
free_text_value_3: nil,
|
19
|
+
free_text_value_4: nil,
|
20
|
+
free_text_value_5: nil
|
21
|
+
)
|
22
|
+
@tag = tag
|
23
|
+
@text_subject_code_qualifier = text_subject_code_qualifier
|
24
|
+
@free_text_function_code = free_text_function_code
|
25
|
+
@free_text_value_code = free_text_value_code
|
26
|
+
@code_list_identification_code = code_list_identification_code
|
27
|
+
@code_list_responsible_agency_code = code_list_responsible_agency_code
|
28
|
+
@free_text_value_1 = free_text_value_1
|
29
|
+
@free_text_value_2 = free_text_value_2
|
30
|
+
@free_text_value_3 = free_text_value_3
|
31
|
+
@free_text_value_4 = free_text_value_4
|
32
|
+
@free_text_value_5 = free_text_value_5
|
33
|
+
|
34
|
+
super(tag: tag || TAG)
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_json_hash
|
38
|
+
hash = {}
|
39
|
+
hash.merge!(text_subject_code_qualifier: @text_subject_code_qualifier) if @text_subject_code_qualifier
|
40
|
+
hash.merge!(free_text_function_code: find_identifier(:free_text_function_code)) if @free_text_function_code
|
41
|
+
hash.merge!(free_text_value_code: find_identifier(:free_text_value_code)) if @free_text_value_code
|
42
|
+
hash.merge!(code_list_identification_code: @code_list_identification_code) if @code_list_identification_code
|
43
|
+
hash.merge!(code_list_responsible_agency_code: find_identifier(:code_list_responsible_agency_code)) if @code_list_responsible_agency_code
|
44
|
+
hash.merge!(free_text_value_1: @free_text_value_1) if @free_text_value_1
|
45
|
+
hash.merge!(free_text_value_2: @free_text_value_2) if @free_text_value_2
|
46
|
+
hash.merge!(free_text_value_3: @free_text_value_3) if @free_text_value_3
|
47
|
+
hash.merge!(free_text_value_4: @free_text_value_4) if @free_text_value_4
|
48
|
+
hash.merge!(free_text_value_5: @free_text_value_5) if @free_text_value_5
|
49
|
+
hash
|
50
|
+
end
|
51
|
+
|
52
|
+
def segment_type
|
53
|
+
TYPE
|
54
|
+
end
|
55
|
+
|
56
|
+
def group_name
|
57
|
+
'free_texts'
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class GIN < Segment
|
4
|
+
TAG = 'GIN'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
object_identification_code_qualifier:,
|
12
|
+
object_identifier_1: nil,
|
13
|
+
object_identifier_2: nil,
|
14
|
+
object_identifier_3: nil,
|
15
|
+
object_identifier_4: nil,
|
16
|
+
object_identifier_5: nil
|
17
|
+
)
|
18
|
+
@tag = tag
|
19
|
+
@object_identification_code_qualifier = object_identification_code_qualifier
|
20
|
+
@object_identifier_1 = object_identifier_1
|
21
|
+
@object_identifier_2 = object_identifier_2
|
22
|
+
@object_identifier_3 = object_identifier_3
|
23
|
+
@object_identifier_4 = object_identifier_4
|
24
|
+
@object_identifier_5 = object_identifier_5
|
25
|
+
|
26
|
+
super(tag: @tag || TAG)
|
27
|
+
end
|
28
|
+
|
29
|
+
def to_json_hash
|
30
|
+
hash = {}
|
31
|
+
hash.merge!(object_identification_code_qualifier: @object_identification_code_qualifier) if @object_identification_code_qualifier
|
32
|
+
hash.merge!(object_identifier_1: @object_identifier_1) if @object_identifier_1
|
33
|
+
hash.merge!(object_identifier_2: @object_identifier_2) if @object_identifier_2
|
34
|
+
hash.merge!(object_identifier_3: @object_identifier_3) if @object_identifier_3
|
35
|
+
hash.merge!(object_identifier_4: @object_identifier_4) if @object_identifier_4
|
36
|
+
hash.merge!(object_identifier_5: @object_identifier_5) if @object_identifier_5
|
37
|
+
hash
|
38
|
+
end
|
39
|
+
|
40
|
+
def segment_type
|
41
|
+
TYPE
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class IMD < Segment
|
4
|
+
TAG = 'IMD'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
def initialize(
|
8
|
+
tag: nil,
|
9
|
+
description_format_code:,
|
10
|
+
item_characteristic_code: nil,
|
11
|
+
code_list_identification_code: nil,
|
12
|
+
code_list_responsible_agency_code: nil,
|
13
|
+
item_description_code: nil,
|
14
|
+
code_list_identification_code_1: '',
|
15
|
+
code_list_responsible_agency_code_1: nil,
|
16
|
+
item_description_1: nil,
|
17
|
+
item_description_2: nil,
|
18
|
+
language_name_code: nil,
|
19
|
+
surface_or_layer_code: nil
|
20
|
+
)
|
21
|
+
@tag = tag
|
22
|
+
@description_format_code = description_format_code
|
23
|
+
@item_characteristic_code = item_characteristic_code
|
24
|
+
@code_list_identification_code = code_list_identification_code
|
25
|
+
@code_list_responsible_agency_code = code_list_responsible_agency_code
|
26
|
+
@item_description_code = item_description_code
|
27
|
+
@code_list_identification_code_1 = code_list_identification_code_1
|
28
|
+
@code_list_responsible_agency_code_1 = code_list_responsible_agency_code_1
|
29
|
+
@item_description_1 = item_description_1
|
30
|
+
@item_description_2 = item_description_2
|
31
|
+
@language_name_code = language_name_code
|
32
|
+
@surface_or_layer_code = surface_or_layer_code
|
33
|
+
|
34
|
+
super(tag: tag || TAG)
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_json_hash
|
38
|
+
hash = {}
|
39
|
+
hash.merge!(description_format_code: find_identifier(:description_format_code)) if @description_format_code
|
40
|
+
hash.merge!(item_characteristic_code: find_identifier(:item_characteristic_code)) if @item_characteristic_code
|
41
|
+
hash.merge!(code_list_identification_code: find_identifier(:code_list_identification_code)) if @code_list_identification_code
|
42
|
+
hash.merge!(code_list_responsible_agency_code: find_identifier(:code_list_responsible_agency_code)) if @code_list_responsible_agency_code
|
43
|
+
if @item_description_code
|
44
|
+
identifier = find_identifier(:item_description_code)
|
45
|
+
if identifier
|
46
|
+
hash.merge!(item_description_code: identifier)
|
47
|
+
else
|
48
|
+
hash.merge!(item_description_code: @item_description_code)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
hash.merge!(code_list_identification_code_1: @code_list_identification_code_1) if @code_list_identification_code_1
|
52
|
+
hash.merge!(code_list_responsible_agency_code_1: find_identifier(:code_list_responsible_agency_code_1)) if @code_list_responsible_agency_code_1
|
53
|
+
hash.merge!(item_description_1: @item_description_1) if @item_description_1
|
54
|
+
hash.merge!(item_description_2: @item_description_2) if @item_description_2
|
55
|
+
hash.merge!(language_name_code: @language_name_code) if @language_name_code
|
56
|
+
hash.merge!(surface_or_layer_code: @surface_or_layer_code) if @surface_or_layer_code
|
57
|
+
hash
|
58
|
+
end
|
59
|
+
|
60
|
+
def group_name
|
61
|
+
'item_descriptions'
|
62
|
+
end
|
63
|
+
|
64
|
+
def segment_type
|
65
|
+
TYPE
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class INV < Segment
|
4
|
+
TAG = 'INV'.freeze
|
5
|
+
TYPE = :body
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
inventory_movement_direction_code:,
|
12
|
+
inventory_type_code: nil,
|
13
|
+
inventory_movement_reason_code: nil,
|
14
|
+
inventory_balance_method_code: nil
|
15
|
+
)
|
16
|
+
|
17
|
+
@tag = tag
|
18
|
+
@inventory_movement_direction_code = inventory_movement_direction_code
|
19
|
+
@inventory_type_code = inventory_type_code
|
20
|
+
@inventory_movement_reason_code = inventory_movement_reason_code
|
21
|
+
@inventory_balance_method_code = inventory_balance_method_code
|
22
|
+
super(tag: tag || TAG)
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_json_hash
|
26
|
+
hash = {}
|
27
|
+
hash.merge!(inventory_movement_direction_code: find_identifier(:inventory_movement_direction_code)) if @inventory_movement_direction_code
|
28
|
+
hash.merge!(inventory_type_code: @inventory_type_code) if @inventory_type_code
|
29
|
+
hash.merge!(inventory_movement_reason_code: @inventory_movement_reason_code) if @inventory_movement_reason_code
|
30
|
+
hash.merge!(inventory_balance_method_code: @inventory_balance_method_code) if @inventory_balance_method_code
|
31
|
+
hash
|
32
|
+
end
|
33
|
+
|
34
|
+
def group_name
|
35
|
+
'inventory'
|
36
|
+
end
|
37
|
+
|
38
|
+
def segment_type
|
39
|
+
TYPE
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class LIN < Segment
|
4
|
+
TAG = 'LIN'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
def initialize(
|
8
|
+
tag: nil,
|
9
|
+
line_item_identifier_1:,
|
10
|
+
action_request_notification_description_code: '',
|
11
|
+
item_identifier:,
|
12
|
+
item_type_identification_code:,
|
13
|
+
sub_line_indicator_code: nil,
|
14
|
+
line_item_identifier_2: nil
|
15
|
+
)
|
16
|
+
@tag = tag
|
17
|
+
@line_item_identifier_1 = line_item_identifier_1
|
18
|
+
@action_request_notification_description_code = action_request_notification_description_code
|
19
|
+
@item_identifier = item_identifier
|
20
|
+
@item_type_identification_code = item_type_identification_code
|
21
|
+
@sub_line_indicator_code = sub_line_indicator_code
|
22
|
+
@line_item_identifier_2 = line_item_identifier_2
|
23
|
+
|
24
|
+
super(tag: tag || TAG )
|
25
|
+
end
|
26
|
+
|
27
|
+
def starts_item?
|
28
|
+
true
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_json_hash
|
32
|
+
hash = {}
|
33
|
+
hash.merge!(ean: @item_identifier) if @item_identifier
|
34
|
+
hash.merge!(action_request_notification_description_code: @action_request_notification_description_code) if @action_request_notification_description_code
|
35
|
+
hash.merge!(item_type_identification_code: find_identifier(:item_type_identification_code)) if @item_type_identification_code
|
36
|
+
hash.merge!(sub_line_indicator_code: @sub_line_indicator_code) if @sub_line_indicator_code
|
37
|
+
hash.merge!(line_item_identifier_2: @line_item_identifier_2) if @line_item_identifier_2
|
38
|
+
hash
|
39
|
+
end
|
40
|
+
|
41
|
+
def segment_type
|
42
|
+
TYPE
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class LOC < Segment
|
4
|
+
TAG = 'LOC'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
location_function_qualifier:,
|
12
|
+
location_name_code: nil,
|
13
|
+
first_related_name_code: nil,
|
14
|
+
code_list_identification_code: nil,
|
15
|
+
code_list_responsible_agency_code: nil
|
16
|
+
)
|
17
|
+
@tag = tag
|
18
|
+
@location_function_qualifier = location_function_qualifier
|
19
|
+
@location_name_code = location_name_code
|
20
|
+
@first_related_name_code = first_related_name_code
|
21
|
+
@code_list_identification_code = code_list_identification_code
|
22
|
+
@code_list_responsible_agency_code = code_list_responsible_agency_code
|
23
|
+
|
24
|
+
super(tag: tag || TAG)
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_json_hash
|
28
|
+
hash = {}
|
29
|
+
hash.merge!(location_function_qualifier: find_identifier(:location_function_qualifier)) if @location_function_qualifier
|
30
|
+
hash.merge!(location_name_code: @location_name_code) if @location_name_code
|
31
|
+
hash.merge!(first_related_name_code: @first_related_name_code) if @first_related_name_code
|
32
|
+
hash.merge!(code_list_identification_code: @code_list_identification_code) if @code_list_identification_code
|
33
|
+
hash.merge!(code_list_responsible_agency_code: find_identifier(:code_list_responsible_agency_code)) if @code_list_responsible_agency_code
|
34
|
+
hash
|
35
|
+
outer_hash = {}
|
36
|
+
outer_hash.merge!({ location: hash })
|
37
|
+
outer_hash
|
38
|
+
end
|
39
|
+
|
40
|
+
def segment_type
|
41
|
+
TYPE
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class MEA < Segment
|
4
|
+
TAG = 'MEA'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
measurement_purpose_code_qualifier:,
|
12
|
+
measured_attribute_code:,
|
13
|
+
measurement_significance_code: nil,
|
14
|
+
measurment_unit_code:,
|
15
|
+
measurement_value:,
|
16
|
+
range_minimum_value: nil,
|
17
|
+
range_maximum_value: nil
|
18
|
+
)
|
19
|
+
@tag = tag
|
20
|
+
|
21
|
+
@measurement_purpose_code_qualifier = measurement_purpose_code_qualifier
|
22
|
+
@measured_attribute_code = measured_attribute_code
|
23
|
+
@measurement_significance_code = measurement_significance_code
|
24
|
+
@measurment_unit_code = measurment_unit_code
|
25
|
+
@measurement_value = measurement_value
|
26
|
+
@range_minimum_value = range_minimum_value
|
27
|
+
@range_maximum_value = range_maximum_value
|
28
|
+
|
29
|
+
super(tag: tag || TAG)
|
30
|
+
end
|
31
|
+
|
32
|
+
def to_json_hash
|
33
|
+
hash = {}
|
34
|
+
hash.merge!(measurement_purpose_code_qualifier: find_identifier(:measurement_purpose_code_qualifier)) if @measurement_purpose_code_qualifier
|
35
|
+
hash.merge!(measured_attribute_code: find_identifier(:measured_attribute_code)) if @measured_attribute_code
|
36
|
+
hash.merge!(measurement_significance_code: find_identifier(:measurement_significance_code)) if @measurement_significance_code
|
37
|
+
hash.merge!(measurment_unit_code: find_identifier(:measurment_unit_code)) if @measurment_unit_code
|
38
|
+
hash.merge!(measurement_value: @measurement_value) if @measurement_value
|
39
|
+
hash.merge!(range_minimum_value: @range_minimum_value) if @range_minimum_value
|
40
|
+
hash.merge!(range_maximum_value: @range_maximum_value) if @range_maximum_value
|
41
|
+
hash
|
42
|
+
end
|
43
|
+
|
44
|
+
def group_name
|
45
|
+
'characterisitcs'
|
46
|
+
end
|
47
|
+
|
48
|
+
def segment_type
|
49
|
+
TYPE
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|