Class: Mindee::Product::US::HealthcareCard::HealthcareCardV1Document

Inherits:
Mindee::Parsing::Common::Prediction show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb

Overview

Healthcare Card API version 1.3 document data.

Direct Known Subclasses

HealthcareCardV1PagePrediction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ HealthcareCardV1Document

Returns a new instance of HealthcareCardV1Document.

Parameters:

  • prediction (Hash)
  • page_id (Integer, nil)


58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 58

def initialize(prediction, page_id)
  super
  @company_name = Parsing::Standard::StringField.new(
    prediction['company_name'],
    page_id
  )
  @copays = Product::US::HealthcareCard::HealthcareCardV1Copays.new(prediction['copays'], page_id)
  @dependents = [] # : Array[Parsing::Standard::StringField]
  prediction['dependents'].each do |item|
    @dependents.push(Parsing::Standard::StringField.new(item, page_id))
  end
  @enrollment_date = Parsing::Standard::DateField.new(
    prediction['enrollment_date'],
    page_id
  )
  @group_number = Parsing::Standard::StringField.new(
    prediction['group_number'],
    page_id
  )
  @issuer80840 = Parsing::Standard::StringField.new(
    prediction['issuer_80840'],
    page_id
  )
  @member_id = Parsing::Standard::StringField.new(
    prediction['member_id'],
    page_id
  )
  @member_name = Parsing::Standard::StringField.new(
    prediction['member_name'],
    page_id
  )
  @payer_id = Parsing::Standard::StringField.new(
    prediction['payer_id'],
    page_id
  )
  @plan_name = Parsing::Standard::StringField.new(
    prediction['plan_name'],
    page_id
  )
  @rx_bin = Parsing::Standard::StringField.new(
    prediction['rx_bin'],
    page_id
  )
  @rx_grp = Parsing::Standard::StringField.new(
    prediction['rx_grp'],
    page_id
  )
  @rx_id = Parsing::Standard::StringField.new(prediction['rx_id'], page_id)
  @rx_pcn = Parsing::Standard::StringField.new(
    prediction['rx_pcn'],
    page_id
  )
end

Instance Attribute Details

#company_nameMindee::Parsing::Standard::StringField (readonly)

The name of the company that provides the healthcare plan.



15
16
17
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 15

def company_name
  @company_name
end

#copaysMindee::Product::US::HealthcareCard::HealthcareCardV1Copays (readonly)

Copayments for covered services.



18
19
20
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 18

def copays
  @copays
end

#dependentsArray<Mindee::Parsing::Standard::StringField> (readonly)

The list of dependents covered by the healthcare plan.



21
22
23
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 21

def dependents
  @dependents
end

#enrollment_dateMindee::Parsing::Standard::DateField (readonly)

The date when the member enrolled in the healthcare plan.



24
25
26
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 24

def enrollment_date
  @enrollment_date
end

#group_numberMindee::Parsing::Standard::StringField (readonly)

The group number associated with the healthcare plan.



27
28
29
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 27

def group_number
  @group_number
end

#issuer80840Mindee::Parsing::Standard::StringField (readonly)

The organization that issued the healthcare plan.



30
31
32
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 30

def issuer80840
  @issuer80840
end

#member_idMindee::Parsing::Standard::StringField (readonly)

The unique identifier for the member in the healthcare system.



33
34
35
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 33

def member_id
  @member_id
end

#member_nameMindee::Parsing::Standard::StringField (readonly)

The name of the member covered by the healthcare plan.



36
37
38
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 36

def member_name
  @member_name
end

#payer_idMindee::Parsing::Standard::StringField (readonly)

The unique identifier for the payer in the healthcare system.



39
40
41
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 39

def payer_id
  @payer_id
end

#plan_nameMindee::Parsing::Standard::StringField (readonly)

The name of the healthcare plan.



42
43
44
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 42

def plan_name
  @plan_name
end

#rx_binMindee::Parsing::Standard::StringField (readonly)

The BIN number for prescription drug coverage.



45
46
47
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 45

def rx_bin
  @rx_bin
end

#rx_grpMindee::Parsing::Standard::StringField (readonly)

The group number for prescription drug coverage.



48
49
50
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 48

def rx_grp
  @rx_grp
end

#rx_idMindee::Parsing::Standard::StringField (readonly)

The ID number for prescription drug coverage.



51
52
53
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 51

def rx_id
  @rx_id
end

#rx_pcnMindee::Parsing::Standard::StringField (readonly)

The PCN number for prescription drug coverage.



54
55
56
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 54

def rx_pcn
  @rx_pcn
end

Instance Method Details

#to_sString

Returns:

  • (String)


113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb', line 113

def to_s
  dependents = @dependents.join("\n #{' ' * 12}")
  copays = copays_to_s
  out_str = String.new
  out_str << "\n:Company Name: #{@company_name}".rstrip
  out_str << "\n:Plan Name: #{@plan_name}".rstrip
  out_str << "\n:Member Name: #{@member_name}".rstrip
  out_str << "\n:Member ID: #{@member_id}".rstrip
  out_str << "\n:Issuer 80840: #{@issuer80840}".rstrip
  out_str << "\n:Dependents: #{dependents}".rstrip
  out_str << "\n:Group Number: #{@group_number}".rstrip
  out_str << "\n:Payer ID: #{@payer_id}".rstrip
  out_str << "\n:RX BIN: #{@rx_bin}".rstrip
  out_str << "\n:RX ID: #{@rx_id}".rstrip
  out_str << "\n:RX GRP: #{@rx_grp}".rstrip
  out_str << "\n:RX PCN: #{@rx_pcn}".rstrip
  out_str << "\n:Copays:"
  out_str << copays
  out_str << "\n:Enrollment Date: #{@enrollment_date}".rstrip
  out_str[1..].to_s
end