Class: Stupidedi::Schema::SegmentReq

Inherits:
Object
  • Object
show all
Defined in:
lib/stupidedi/schema/segment_req.rb

Overview

The 5010 X12 "data segment requirement designator"s include M - Mandatory O - Optional

The HIPAA implementation guides "industry usage" include SITUATIONAL REQUIRED

See Also:

  • B.1.3.12.6 Data Segment Requirement Designators

Instance Method Summary collapse

Constructor Details

#initialize(required, forbidden, to_s) ⇒ SegmentReq


18
19
20
21
# File 'lib/stupidedi/schema/segment_req.rb', line 18

def initialize(required, forbidden, to_s)
  @required, @forbidden, @to_s =
    required, forbidden, to_s
end

Instance Method Details

#forbidden?Boolean


27
28
29
# File 'lib/stupidedi/schema/segment_req.rb', line 27

def forbidden?
  @forbidden
end

#inspectString


41
42
43
# File 'lib/stupidedi/schema/segment_req.rb', line 41

def inspect
  @to_s
end

#optional?Boolean


31
32
33
# File 'lib/stupidedi/schema/segment_req.rb', line 31

def optional?
  not (@required or @forbidden)
end

#pretty_print(q)


36
37
38
# File 'lib/stupidedi/schema/segment_req.rb', line 36

def pretty_print(q)
  q.text @to_s
end

#required?Boolean


23
24
25
# File 'lib/stupidedi/schema/segment_req.rb', line 23

def required?
  @required
end