Class: FHIR::MedicationKnowledgeRegulatoryMaxDispense
- Inherits:
-
BackboneElement
- Object
- Type
- Element
- BackboneElement
- FHIR::MedicationKnowledgeRegulatoryMaxDispense
- Includes:
- Mongoid::Document
- Defined in:
- app/models/fhir/medication_knowledge_regulatory_max_dispense.rb
Overview
fhir/medication_knowledge_regulatory_max_dispense.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_json(json_hash, target = MedicationKnowledgeRegulatoryMaxDispense.new) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'app/models/fhir/medication_knowledge_regulatory_max_dispense.rb', line 24 def self.transform_json(json_hash, target = MedicationKnowledgeRegulatoryMaxDispense.new) result = self.superclass.transform_json(json_hash, target) result['quantity'] = SimpleQuantity.transform_json(json_hash['quantity']) unless json_hash['quantity'].nil? result['period'] = Duration.transform_json(json_hash['period']) unless json_hash['period'].nil? result end |
Instance Method Details
#as_json(*args) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/models/fhir/medication_knowledge_regulatory_max_dispense.rb', line 8 def as_json(*args) result = super unless self.quantity.nil? result['quantity'] = self.quantity.as_json(*args) end unless self.period.nil? result['period'] = self.period.as_json(*args) end result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result end |