Class: CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(organization_service_facility_id:, name:, aliases:, telecoms:, address:, description: OMIT, npi: OMIT, status: OMIT, operational_status: OMIT, mode: OMIT, type: OMIT, physical_type: OMIT, additional_properties: nil) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility

Parameters:



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
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 67

def initialize(organization_service_facility_id:, name:, aliases:, telecoms:, address:, description: OMIT, npi: OMIT,
               status: OMIT, operational_status: OMIT, mode: OMIT, type: OMIT, physical_type: OMIT, additional_properties: nil)
  @organization_service_facility_id = organization_service_facility_id
  @name = name
  @aliases = aliases
  @description = description if description != OMIT
  @npi = npi if npi != OMIT
  @status = status if status != OMIT
  @operational_status = operational_status if operational_status != OMIT
  @mode = mode if mode != OMIT
  @type = type if type != OMIT
  @physical_type = physical_type if physical_type != OMIT
  @telecoms = telecoms
  @address = address
  @additional_properties = additional_properties
  @_field_set = {
    "organization_service_facility_id": organization_service_facility_id,
    "name": name,
    "aliases": aliases,
    "description": description,
    "npi": npi,
    "status": status,
    "operational_status": operational_status,
    "mode": mode,
    "type": type,
    "physical_type": physical_type,
    "telecoms": telecoms,
    "address": address
  }.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



44
45
46
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 44

def additional_properties
  @additional_properties
end

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

Returns The address of the service facility.

Returns:



42
43
44
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 42

def address
  @address
end

#aliasesArray<String> (readonly)

Returns A list of alternate names for the service facility.

Returns:

  • (Array<String>)

    A list of alternate names for the service facility.



22
23
24
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 22

def aliases
  @aliases
end

#descriptionString (readonly)

Returns A description of the service facility.

Returns:

  • (String)

    A description of the service facility.



24
25
26
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 24

def description
  @description
end

#modeCandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityMode (readonly)

Returns The mode of the service facility.



34
35
36
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 34

def mode
  @mode
end

#nameString (readonly)

Returns The name of the service facility.

Returns:

  • (String)

    The name of the service facility.



20
21
22
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 20

def name
  @name
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.



28
29
30
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 28

def npi
  @npi
end

#operational_statusCandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityOperationalStatus (readonly)

Returns The operational status of the service facility.

Returns:



32
33
34
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 32

def operational_status
  @operational_status
end

#organization_service_facility_idString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 18

def organization_service_facility_id
  @organization_service_facility_id
end

#physical_typeCandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityPhysicalType (readonly)

Returns The physical type of the service facility.

Returns:



38
39
40
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 38

def physical_type
  @physical_type
end

#statusCandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityStatus (readonly)

Returns The status of the service facility.



30
31
32
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 30

def status
  @status
end

#telecomsArray<String> (readonly)

Returns A list of contact methods for the service facility.

Returns:

  • (Array<String>)

    A list of contact methods for the service facility.



40
41
42
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 40

def telecoms
  @telecoms
end

#typeCandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityType (readonly)

Returns The type of the service facility.



36
37
38
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 36

def type
  @type
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility

Deserialize a JSON object to an instance of OrganizationServiceFacility



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 104

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  organization_service_facility_id = struct["organization_service_facility_id"]
  name = struct["name"]
  aliases = struct["aliases"]
  description = struct["description"]
  npi = struct["npi"]
  status = struct["status"]
  operational_status = struct["operational_status"]
  mode = struct["mode"]
  type = struct["type"]
  physical_type = struct["physical_type"]
  telecoms = struct["telecoms"]
  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
  new(
    organization_service_facility_id: organization_service_facility_id,
    name: name,
    aliases: aliases,
    description: description,
    npi: npi,
    status: status,
    operational_status: operational_status,
    mode: mode,
    type: type,
    physical_type: physical_type,
    telecoms: telecoms,
    address: address,
    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)


154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 154

def self.validate_raw(obj:)
  obj.organization_service_facility_id.is_a?(String) != false || raise("Passed value for field obj.organization_service_facility_id is not the expected type, validation failed.")
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.aliases.is_a?(Array) != false || raise("Passed value for field obj.aliases is not the expected type, validation failed.")
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description 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.")
  obj.status&.is_a?(CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
  obj.operational_status&.is_a?(CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityOperationalStatus) != false || raise("Passed value for field obj.operational_status is not the expected type, validation failed.")
  obj.mode&.is_a?(CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityMode) != false || raise("Passed value for field obj.mode is not the expected type, validation failed.")
  obj.type&.is_a?(CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
  obj.physical_type&.is_a?(CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityPhysicalType) != false || raise("Passed value for field obj.physical_type is not the expected type, validation failed.")
  obj.telecoms.is_a?(Array) != false || raise("Passed value for field obj.telecoms is not the expected type, validation failed.")
  CandidApiClient::Commons::Types::StreetAddressLongZip.validate_raw(obj: obj.address)
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of OrganizationServiceFacility to a JSON object

Returns:

  • (String)


144
145
146
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb', line 144

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