Class: CandidApiClient::ServiceLines::V2::Types::DrugIdentification
- Inherits:
-
Object
- Object
- CandidApiClient::ServiceLines::V2::Types::DrugIdentification
- Defined in:
- lib/candidhealth/service_lines/v_2/types/drug_identification.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #conversion_formula ⇒ String readonly
- #drug_description ⇒ String readonly
- #link_sequence_number ⇒ String readonly
- #measurement_unit_code ⇒ CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode readonly
- #national_drug_code ⇒ String readonly
- #national_drug_unit_count ⇒ String readonly
- #pharmacy_prescription_number ⇒ String readonly
- #service_id_qualifier ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceIdQualifier readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::ServiceLines::V2::Types::DrugIdentification
Deserialize a JSON object to an instance of DrugIdentification.
-
.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.
Instance Method Summary collapse
- #initialize(service_id_qualifier:, national_drug_code:, national_drug_unit_count:, measurement_unit_code:, link_sequence_number: OMIT, pharmacy_prescription_number: OMIT, conversion_formula: OMIT, drug_description: OMIT, additional_properties: nil) ⇒ CandidApiClient::ServiceLines::V2::Types::DrugIdentification constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of DrugIdentification to a JSON object.
Constructor Details
#initialize(service_id_qualifier:, national_drug_code:, national_drug_unit_count:, measurement_unit_code:, link_sequence_number: OMIT, pharmacy_prescription_number: OMIT, conversion_formula: OMIT, drug_description: OMIT, additional_properties: nil) ⇒ CandidApiClient::ServiceLines::V2::Types::DrugIdentification
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 47 def initialize(service_id_qualifier:, national_drug_code:, national_drug_unit_count:, measurement_unit_code:, link_sequence_number: OMIT, pharmacy_prescription_number: OMIT, conversion_formula: OMIT, drug_description: OMIT, additional_properties: nil) @service_id_qualifier = service_id_qualifier @national_drug_code = national_drug_code @national_drug_unit_count = national_drug_unit_count @measurement_unit_code = measurement_unit_code @link_sequence_number = link_sequence_number if link_sequence_number != OMIT @pharmacy_prescription_number = pharmacy_prescription_number if pharmacy_prescription_number != OMIT @conversion_formula = conversion_formula if conversion_formula != OMIT @drug_description = drug_description if drug_description != OMIT @additional_properties = additional_properties @_field_set = { "service_id_qualifier": service_id_qualifier, "national_drug_code": national_drug_code, "national_drug_unit_count": national_drug_unit_count, "measurement_unit_code": measurement_unit_code, "link_sequence_number": link_sequence_number, "pharmacy_prescription_number": pharmacy_prescription_number, "conversion_formula": conversion_formula, "drug_description": drug_description }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
30 31 32 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 30 def additional_properties @additional_properties end |
#conversion_formula ⇒ String (readonly)
26 27 28 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 26 def conversion_formula @conversion_formula end |
#drug_description ⇒ String (readonly)
28 29 30 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 28 def drug_description @drug_description end |
#link_sequence_number ⇒ String (readonly)
22 23 24 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 22 def link_sequence_number @link_sequence_number end |
#measurement_unit_code ⇒ CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode (readonly)
20 21 22 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 20 def measurement_unit_code @measurement_unit_code end |
#national_drug_code ⇒ String (readonly)
16 17 18 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 16 def national_drug_code @national_drug_code end |
#national_drug_unit_count ⇒ String (readonly)
18 19 20 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 18 def national_drug_unit_count @national_drug_unit_count end |
#pharmacy_prescription_number ⇒ String (readonly)
24 25 26 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 24 def pharmacy_prescription_number @pharmacy_prescription_number end |
#service_id_qualifier ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceIdQualifier (readonly)
14 15 16 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 14 def service_id_qualifier @service_id_qualifier end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::ServiceLines::V2::Types::DrugIdentification
Deserialize a JSON object to an instance of DrugIdentification
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 76 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) service_id_qualifier = struct["service_id_qualifier"] national_drug_code = struct["national_drug_code"] national_drug_unit_count = struct["national_drug_unit_count"] measurement_unit_code = struct["measurement_unit_code"] link_sequence_number = struct["link_sequence_number"] pharmacy_prescription_number = struct["pharmacy_prescription_number"] conversion_formula = struct["conversion_formula"] drug_description = struct["drug_description"] new( service_id_qualifier: service_id_qualifier, national_drug_code: national_drug_code, national_drug_unit_count: national_drug_unit_count, measurement_unit_code: measurement_unit_code, link_sequence_number: link_sequence_number, pharmacy_prescription_number: pharmacy_prescription_number, conversion_formula: conversion_formula, drug_description: drug_description, 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.
112 113 114 115 116 117 118 119 120 121 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 112 def self.validate_raw(obj:) obj.service_id_qualifier.is_a?(CandidApiClient::ServiceLines::V2::Types::ServiceIdQualifier) != false || raise("Passed value for field obj.service_id_qualifier is not the expected type, validation failed.") obj.national_drug_code.is_a?(String) != false || raise("Passed value for field obj.national_drug_code is not the expected type, validation failed.") obj.national_drug_unit_count.is_a?(String) != false || raise("Passed value for field obj.national_drug_unit_count is not the expected type, validation failed.") obj.measurement_unit_code.is_a?(CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode) != false || raise("Passed value for field obj.measurement_unit_code is not the expected type, validation failed.") obj.link_sequence_number&.is_a?(String) != false || raise("Passed value for field obj.link_sequence_number is not the expected type, validation failed.") obj.pharmacy_prescription_number&.is_a?(String) != false || raise("Passed value for field obj.pharmacy_prescription_number is not the expected type, validation failed.") obj.conversion_formula&.is_a?(String) != false || raise("Passed value for field obj.conversion_formula is not the expected type, validation failed.") obj.drug_description&.is_a?(String) != false || raise("Passed value for field obj.drug_description is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of DrugIdentification to a JSON object
102 103 104 |
# File 'lib/candidhealth/service_lines/v_2/types/drug_identification.rb', line 102 def to_json(*_args) @_field_set&.to_json end |