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

Returns a new instance of SegmentReq.



14
15
16
17
# File 'lib/stupidedi/schema/segment_req.rb', line 14

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

Instance Method Details

#forbidden?Boolean

Returns:

  • (Boolean)


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

def forbidden?
  @forbidden
end

#inspectString

Returns:



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

def inspect
  @to_s
end

#optional?Boolean

Returns:

  • (Boolean)


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

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

#pretty_print(q) ⇒ void

This method returns an undefined value.



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

def pretty_print(q)
  q.text @to_s
end

#required?Boolean

Returns:

  • (Boolean)


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

def required?
  @required
end