Class: CandidApiClient::ServiceFacility::Types::EncounterServiceFacility

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/service_facility/types/encounter_service_facility.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service_facility_id:, organization_name:, address:, npi: OMIT, secondary_identification: OMIT, additional_properties: nil) ⇒ CandidApiClient::ServiceFacility::Types::EncounterServiceFacility

Parameters:

  • service_facility_id (String)
  • organization_name (String)
  • npi (String) (defaults to: OMIT)

    An NPI specific to the service facility if applicable, i.e. if it has one and is not under the billing provider’s NPI. Box 32 section (a) of the CMS-1500 claim form.

  • address (CandidApiClient::Commons::Types::StreetAddressLongZip)

    zip_plus_four_code is required for service facility address. When the zip_plus_four_code is not available use “9998” as per CMS documentation.

  • secondary_identification (String) (defaults to: OMIT)

    An additional identifier for the service facility other than the facility’s NPI. Some payers may require this field. Potential examples: state license number, provider commercial number, or location number. Box 32 section (b) of the CMS-1500 claim form.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/candidhealth/service_facility/types/encounter_service_facility.rb', line 50

def initialize(service_facility_id:, organization_name:, address:, npi: OMIT, secondary_identification: OMIT,
               additional_properties: nil)
  @service_facility_id = service_facility_id
  @organization_name = organization_name
  @npi = npi if npi != OMIT
  @address = address
  @secondary_identification = secondary_identification if secondary_identification != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "service_facility_id": service_facility_id,
    "organization_name": organization_name,
    "npi": npi,
    "address": address,
    "secondary_identification": secondary_identification
  }.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



29
30
31
# File 'lib/candidhealth/service_facility/types/encounter_service_facility.rb', line 29

def additional_properties
  @additional_properties
end

#addressCandidApiClient::Commons::Types::StreetAddressLongZip (readonly)

Returns zip_plus_four_code is required for service facility address. When the zip_plus_four_code is not available use “9998” as per CMS documentation.

Returns:



21
22
23
# File 'lib/candidhealth/service_facility/types/encounter_service_facility.rb', line 21

def address
  @address
end

#npiString (readonly)

Returns An NPI specific to the service facility if applicable, i.e. if it has one and is not under the billing provider’s NPI. Box 32 section (a) of the CMS-1500 claim form.

Returns:

  • (String)

    An NPI specific to the service facility if applicable, i.e. if it has one and is not under the billing provider’s NPI. Box 32 section (a) of the CMS-1500 claim form.



18
19
20
# File 'lib/candidhealth/service_facility/types/encounter_service_facility.rb', line 18

def npi
  @npi
end

#organization_nameString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/candidhealth/service_facility/types/encounter_service_facility.rb', line 14

def organization_name
  @organization_name
end

#secondary_identificationString (readonly)

Returns An additional identifier for the service facility other than the facility’s NPI. Some payers may require this field. Potential examples: state license number, provider commercial number, or location number. Box 32 section (b) of the CMS-1500 claim form.

Returns:

  • (String)

    An additional identifier for the service facility other than the facility’s NPI. Some payers may require this field. Potential examples: state license number, provider commercial number, or location number. Box 32 section (b) of the CMS-1500 claim form.



27
28
29
# File 'lib/candidhealth/service_facility/types/encounter_service_facility.rb', line 27

def secondary_identification
  @secondary_identification
end

#service_facility_idString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/candidhealth/service_facility/types/encounter_service_facility.rb', line 12

def service_facility_id
  @service_facility_id
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::ServiceFacility::Types::EncounterServiceFacility

Deserialize a JSON object to an instance of EncounterServiceFacility

Parameters:

  • json_object (String)

Returns:



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/candidhealth/service_facility/types/encounter_service_facility.rb', line 73

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  service_facility_id = struct["service_facility_id"]
  organization_name = struct["organization_name"]
  npi = struct["npi"]
  if parsed_json["address"].nil?
    address = nil
  else
    address = parsed_json["address"].to_json
    address = CandidApiClient::Commons::Types::StreetAddressLongZip.from_json(json_object: address)
  end
  secondary_identification = struct["secondary_identification"]
  new(
    service_facility_id: service_facility_id,
    organization_name: organization_name,
    npi: npi,
    address: address,
    secondary_identification: secondary_identification,
    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)


109
110
111
112
113
114
115
# File 'lib/candidhealth/service_facility/types/encounter_service_facility.rb', line 109

def self.validate_raw(obj:)
  obj.service_facility_id.is_a?(String) != false || raise("Passed value for field obj.service_facility_id is not the expected type, validation failed.")
  obj.organization_name.is_a?(String) != false || raise("Passed value for field obj.organization_name is not the expected type, validation failed.")
  obj.npi&.is_a?(String) != false || raise("Passed value for field obj.npi is not the expected type, validation failed.")
  CandidApiClient::Commons::Types::StreetAddressLongZip.validate_raw(obj: obj.address)
  obj.secondary_identification&.is_a?(String) != false || raise("Passed value for field obj.secondary_identification is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of EncounterServiceFacility to a JSON object

Returns:

  • (String)


99
100
101
# File 'lib/candidhealth/service_facility/types/encounter_service_facility.rb', line 99

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