Class: CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacilityCreate

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(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::OrganizationServiceFacilityCreate

Parameters:



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

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



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

def additional_properties
  @additional_properties
end

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

Returns The address of the service facility.

Returns:



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

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.



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

def aliases
  @aliases
end

#descriptionString (readonly)

Returns A description of the service facility.

Returns:

  • (String)

    A description of the service facility.



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

def description
  @description
end

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

Returns The mode of the service facility.



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

def mode
  @mode
end

#nameString (readonly)

Returns The name of the service facility.

Returns:

  • (String)

    The name of the service facility.



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

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.



26
27
28
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_create.rb', line 26

def npi
  @npi
end

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

Returns The operational status of the service facility.

Returns:



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

def operational_status
  @operational_status
end

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

Returns The physical type of the service facility.

Returns:



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

def physical_type
  @physical_type
end

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

Returns The status of the service facility.



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

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.



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

def telecoms
  @telecoms
end

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

Returns The type of the service facility.



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

def type
  @type
end

Class Method Details

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

Deserialize a JSON object to an instance of OrganizationServiceFacilityCreate



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
126
127
128
129
130
131
132
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_create.rb', line 99

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  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(
    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)


147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_create.rb', line 147

def self.validate_raw(obj:)
  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 OrganizationServiceFacilityCreate to a JSON object

Returns:

  • (String)


137
138
139
# File 'lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_create.rb', line 137

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