Class: FHIR::ActionPrecheckBehavior

Inherits:
PrimitiveCode show all
Includes:
Mongoid::Document
Defined in:
app/models/fhir/action_precheck_behavior.rb

Overview

fhir/action_precheck_behavior.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.transform_json(json_hash, extension_hash, target = ActionPrecheckBehavior.new) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'app/models/fhir/action_precheck_behavior.rb', line 16

def self.transform_json(json_hash, extension_hash, target = ActionPrecheckBehavior.new)

  result = target
  unless extension_hash.nil?
    result['fhirId'] = extension_hash['id'] unless extension_hash['id'].nil?
    result['extension'] = extension_hash['extension'].map { |ext| Extension.transform_json(ext) }
  end
  result['value'] = json_hash
  result
end

Instance Method Details

#as_json(*args) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'app/models/fhir/action_precheck_behavior.rb', line 6

def as_json(*args)
  result = super      
  result.delete('id')
  unless self.fhirId.nil?
    result['id'] = self.fhirId
    result.delete('fhirId')
  end  
  result
end