Class: CandidApiClient::Diagnoses::Types::StandaloneDiagnosisCreate

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(encounter_id:, code_type:, code:, name: OMIT, additional_properties: nil) ⇒ CandidApiClient::Diagnoses::Types::StandaloneDiagnosisCreate

Parameters:

  • encounter_id (String)
  • name (String) (defaults to: OMIT)

    Empty string not allowed.

  • code_type (CandidApiClient::Diagnoses::Types::DiagnosisTypeCode)

    Typically, providers submitting claims to Candid are using ICD-10 diagnosis codes. If you are using ICD-10 codes, the primary diagnosis code listed on the claim should use the ABK code_type. If more than one diagnosis is being submitted on a claim, please use ABF for the rest of the listed diagnoses. If you are using ICD-9 diagnosis codes, use BK and BF for the principal and following diagnosis code(s) respectively.

  • code (String)

    Empty string not allowed. Should be of the appropriate format for the provided ‘code_type`. Must obey the ICD-10 format if an ICD-10 code_type is provided, specifically:

    • Letter

    • Digit

    • Digit or the letter ‘A` or `B`

    • (Optional) Period ‘.`

    • Up to 4 (or as few as 0) letters and digits

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb', line 57

def initialize(encounter_id:, code_type:, code:, name: OMIT, additional_properties: nil)
  @encounter_id = encounter_id
  @name = name if name != OMIT
  @code_type = code_type
  @code = code
  @additional_properties = additional_properties
  @_field_set = {
    "encounter_id": encounter_id,
    "name": name,
    "code_type": code_type,
    "code": code
  }.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



32
33
34
# File 'lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb', line 32

def additional_properties
  @additional_properties
end

#codeString (readonly)

Returns Empty string not allowed. Should be of the appropriate format for the provided ‘code_type`. Must obey the ICD-10 format if an ICD-10 code_type is provided, specifically:

  • Letter

  • Digit

  • Digit or the letter ‘A` or `B`

  • (Optional) Period ‘.`

  • Up to 4 (or as few as 0) letters and digits.

Returns:

  • (String)

    Empty string not allowed. Should be of the appropriate format for the provided ‘code_type`. Must obey the ICD-10 format if an ICD-10 code_type is provided, specifically:

    • Letter

    • Digit

    • Digit or the letter ‘A` or `B`

    • (Optional) Period ‘.`

    • Up to 4 (or as few as 0) letters and digits



30
31
32
# File 'lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb', line 30

def code
  @code
end

#code_typeCandidApiClient::Diagnoses::Types::DiagnosisTypeCode (readonly)

Returns Typically, providers submitting claims to Candid are using ICD-10 diagnosis codes. If you are using ICD-10 codes, the primary diagnosis code listed on the claim should use the ABK code_type. If more than one diagnosis is being submitted on a claim, please use ABF for the rest of the listed diagnoses. If you are using ICD-9 diagnosis codes, use BK and BF for the principal and following diagnosis code(s) respectively.

Returns:

  • (CandidApiClient::Diagnoses::Types::DiagnosisTypeCode)

    Typically, providers submitting claims to Candid are using ICD-10 diagnosis codes. If you are using ICD-10 codes, the primary diagnosis code listed on the claim should use the ABK code_type. If more than one diagnosis is being submitted on a claim, please use ABF for the rest of the listed diagnoses. If you are using ICD-9 diagnosis codes, use BK and BF for the principal and following diagnosis code(s) respectively.



21
22
23
# File 'lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb', line 21

def code_type
  @code_type
end

#encounter_idString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb', line 12

def encounter_id
  @encounter_id
end

#nameString (readonly)

Returns Empty string not allowed.

Returns:

  • (String)

    Empty string not allowed.



14
15
16
# File 'lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb', line 14

def name
  @name
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::Diagnoses::Types::StandaloneDiagnosisCreate

Deserialize a JSON object to an instance of StandaloneDiagnosisCreate

Parameters:

  • json_object (String)

Returns:



77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb', line 77

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  encounter_id = struct["encounter_id"]
  name = struct["name"]
  code_type = struct["code_type"]
  code = struct["code"]
  new(
    encounter_id: encounter_id,
    name: name,
    code_type: code_type,
    code: code,
    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)


105
106
107
108
109
110
# File 'lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb', line 105

def self.validate_raw(obj:)
  obj.encounter_id.is_a?(String) != false || raise("Passed value for field obj.encounter_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.code_type.is_a?(CandidApiClient::Diagnoses::Types::DiagnosisTypeCode) != false || raise("Passed value for field obj.code_type is not the expected type, validation failed.")
  obj.code.is_a?(String) != false || raise("Passed value for field obj.code is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of StandaloneDiagnosisCreate to a JSON object

Returns:

  • (String)


95
96
97
# File 'lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb', line 95

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