Class: CandidApiClient::InsuranceCards::V2::Types::InsuranceCard

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(insurance_card_id:, member_id:, payer_name:, payer_id:, rx_bin: OMIT, rx_pcn: OMIT, image_url_front: OMIT, image_url_back: OMIT, group_number: OMIT, plan_name: OMIT, plan_type: OMIT, insurance_type: OMIT, additional_properties: nil) ⇒ CandidApiClient::InsuranceCards::V2::Types::InsuranceCard

Parameters:

  • insurance_card_id (String)
  • member_id (String)
  • payer_name (String)
  • payer_id (String)
  • rx_bin (String) (defaults to: OMIT)
  • rx_pcn (String) (defaults to: OMIT)
  • image_url_front (String) (defaults to: OMIT)
  • image_url_back (String) (defaults to: OMIT)
  • group_number (String) (defaults to: OMIT)

    Box 11 on the CMS-1500 claim form.

  • plan_name (String) (defaults to: OMIT)

    Box 11c on the CMS-1500 claim form.

  • plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode) (defaults to: OMIT)
  • insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 59

def initialize(insurance_card_id:, member_id:, payer_name:, payer_id:, rx_bin: OMIT, rx_pcn: OMIT,
               image_url_front: OMIT, image_url_back: OMIT, group_number: OMIT, plan_name: OMIT, plan_type: OMIT, insurance_type: OMIT, additional_properties: nil)
  @insurance_card_id = insurance_card_id
  @member_id = member_id
  @payer_name = payer_name
  @payer_id = payer_id
  @rx_bin = rx_bin if rx_bin != OMIT
  @rx_pcn = rx_pcn if rx_pcn != OMIT
  @image_url_front = image_url_front if image_url_front != OMIT
  @image_url_back = image_url_back if image_url_back != OMIT
  @group_number = group_number if group_number != OMIT
  @plan_name = plan_name if plan_name != OMIT
  @plan_type = plan_type if plan_type != OMIT
  @insurance_type = insurance_type if insurance_type != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "insurance_card_id": insurance_card_id,
    "member_id": member_id,
    "payer_name": payer_name,
    "payer_id": payer_id,
    "rx_bin": rx_bin,
    "rx_pcn": rx_pcn,
    "image_url_front": image_url_front,
    "image_url_back": image_url_back,
    "group_number": group_number,
    "plan_name": plan_name,
    "plan_type": plan_type,
    "insurance_type": insurance_type
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



38
39
40
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 38

def additional_properties
  @additional_properties
end

#group_numberString (readonly)

Returns Box 11 on the CMS-1500 claim form.

Returns:

  • (String)

    Box 11 on the CMS-1500 claim form.



30
31
32
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 30

def group_number
  @group_number
end

#image_url_backString (readonly)

Returns:

  • (String)


28
29
30
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 28

def image_url_back
  @image_url_back
end

#image_url_frontString (readonly)

Returns:

  • (String)


26
27
28
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 26

def image_url_front
  @image_url_front
end

#insurance_card_idString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 14

def insurance_card_id
  @insurance_card_id
end

#insurance_typeCandidApiClient::Commons::Types::InsuranceTypeCode (readonly)



36
37
38
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 36

def insurance_type
  @insurance_type
end

#member_idString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 16

def member_id
  @member_id
end

#payer_idString (readonly)

Returns:

  • (String)


20
21
22
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 20

def payer_id
  @payer_id
end

#payer_nameString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 18

def payer_name
  @payer_name
end

#plan_nameString (readonly)

Returns Box 11c on the CMS-1500 claim form.

Returns:

  • (String)

    Box 11c on the CMS-1500 claim form.



32
33
34
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 32

def plan_name
  @plan_name
end

#plan_typeCandidApiClient::Commons::Types::SourceOfPaymentCode (readonly)



34
35
36
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 34

def plan_type
  @plan_type
end

#rx_binString (readonly)

Returns:

  • (String)


22
23
24
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 22

def rx_bin
  @rx_bin
end

#rx_pcnString (readonly)

Returns:

  • (String)


24
25
26
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 24

def rx_pcn
  @rx_pcn
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::InsuranceCards::V2::Types::InsuranceCard

Deserialize a JSON object to an instance of InsuranceCard

Parameters:

  • json_object (String)

Returns:



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 96

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  insurance_card_id = struct["insurance_card_id"]
  member_id = struct["member_id"]
  payer_name = struct["payer_name"]
  payer_id = struct["payer_id"]
  rx_bin = struct["rx_bin"]
  rx_pcn = struct["rx_pcn"]
  image_url_front = struct["image_url_front"]
  image_url_back = struct["image_url_back"]
  group_number = struct["group_number"]
  plan_name = struct["plan_name"]
  plan_type = struct["plan_type"]
  insurance_type = struct["insurance_type"]
  new(
    insurance_card_id: insurance_card_id,
    member_id: member_id,
    payer_name: payer_name,
    payer_id: payer_id,
    rx_bin: rx_bin,
    rx_pcn: rx_pcn,
    image_url_front: image_url_front,
    image_url_back: image_url_back,
    group_number: group_number,
    plan_name: plan_name,
    plan_type: plan_type,
    insurance_type: insurance_type,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 140

def self.validate_raw(obj:)
  obj.insurance_card_id.is_a?(String) != false || raise("Passed value for field obj.insurance_card_id is not the expected type, validation failed.")
  obj.member_id.is_a?(String) != false || raise("Passed value for field obj.member_id is not the expected type, validation failed.")
  obj.payer_name.is_a?(String) != false || raise("Passed value for field obj.payer_name is not the expected type, validation failed.")
  obj.payer_id.is_a?(String) != false || raise("Passed value for field obj.payer_id is not the expected type, validation failed.")
  obj.rx_bin&.is_a?(String) != false || raise("Passed value for field obj.rx_bin is not the expected type, validation failed.")
  obj.rx_pcn&.is_a?(String) != false || raise("Passed value for field obj.rx_pcn is not the expected type, validation failed.")
  obj.image_url_front&.is_a?(String) != false || raise("Passed value for field obj.image_url_front is not the expected type, validation failed.")
  obj.image_url_back&.is_a?(String) != false || raise("Passed value for field obj.image_url_back is not the expected type, validation failed.")
  obj.group_number&.is_a?(String) != false || raise("Passed value for field obj.group_number is not the expected type, validation failed.")
  obj.plan_name&.is_a?(String) != false || raise("Passed value for field obj.plan_name is not the expected type, validation failed.")
  obj.plan_type&.is_a?(CandidApiClient::Commons::Types::SourceOfPaymentCode) != false || raise("Passed value for field obj.plan_type is not the expected type, validation failed.")
  obj.insurance_type&.is_a?(CandidApiClient::Commons::Types::InsuranceTypeCode) != false || raise("Passed value for field obj.insurance_type is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of InsuranceCard to a JSON object

Returns:

  • (String)


130
131
132
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb', line 130

def to_json(*_args)
  @_field_set&.to_json
end