Class: CandidApiClient::Diagnoses::Types::DiagnosisCreate

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Parameters:

  • 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



54
55
56
57
58
59
60
61
62
# File 'lib/candidhealth/diagnoses/types/diagnosis_create.rb', line 54

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



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

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



28
29
30
# File 'lib/candidhealth/diagnoses/types/diagnosis_create.rb', line 28

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.



19
20
21
# File 'lib/candidhealth/diagnoses/types/diagnosis_create.rb', line 19

def code_type
  @code_type
end

#nameString (readonly)

Returns Empty string not allowed.

Returns:

  • (String)

    Empty string not allowed.



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

def name
  @name
end

Class Method Details

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

Deserialize a JSON object to an instance of DiagnosisCreate

Parameters:

  • json_object (String)

Returns:



68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/candidhealth/diagnoses/types/diagnosis_create.rb', line 68

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


94
95
96
97
98
# File 'lib/candidhealth/diagnoses/types/diagnosis_create.rb', line 94

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.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 DiagnosisCreate to a JSON object

Returns:

  • (String)


84
85
86
# File 'lib/candidhealth/diagnoses/types/diagnosis_create.rb', line 84

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