Class: Caren::Dossier::DossierEntry
- Inherits:
-
Base
- Object
- Base
- Caren::Dossier::DossierEntry
show all
- Defined in:
- lib/caren/dossier/dossier_entry.rb
Instance Attribute Summary
Attributes inherited from Base
#attributes, #original_xml
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
from_xml, hash_from_image, init_dependent_objects, #initialize, #node_root, search_url, to_xml, #to_xml
Constructor Details
This class inherits a constructor from Caren::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Caren::Base
Class Method Details
.all(subject_id, session) ⇒ Object
24
25
26
|
# File 'lib/caren/dossier/dossier_entry.rb', line 24
def self.all subject_id, session
from_xml session.get(self.resource_url(subject_id))
end
|
.array_root ⇒ Object
37
38
39
|
# File 'lib/caren/dossier/dossier_entry.rb', line 37
def self.array_root
:dossier_entries
end
|
.find(subject_id, id, session) ⇒ Object
28
29
30
|
# File 'lib/caren/dossier/dossier_entry.rb', line 28
def self.find subject_id, id, session
from_xml session.get(self.resource_url(subject_id,id))
end
|
.keys ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/caren/dossier/dossier_entry.rb', line 4
def self.keys
[ :id, :type, :value, :reporting_time, :person_name, :external_id, :external_person_id, :care_provider_id, :comment, :subject_id, :systolic_pressure, :diastolic_pressure, :heart_rate, :bmi, :weight, :length ] + super
end
|
.node_root ⇒ Object
41
42
43
|
# File 'lib/caren/dossier/dossier_entry.rb', line 41
def self.node_root
:dossier_entry
end
|
.resource_location ⇒ Object
62
63
64
|
# File 'lib/caren/dossier/dossier_entry.rb', line 62
def self.resource_location
"/api/pro/people/%i/dossier_entries"
end
|
Instance Method Details
#as_xml ⇒ Object
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/caren/dossier/dossier_entry.rb', line 45
def as_xml
{ :type => self.type,
:external_id => self.external_id,
:external_person_id => self.external_person_id,
:subject_id => self.subject_id,
:person_name => self.person_name,
:comment => self.,
:value => self.value,
:reporting_time => self.reporting_time,
:systolic_pressure => self.systolic_pressure,
:diastolic_pressure => self.diastolic_pressure,
:heart_rate => self.heart_rate,
:bmi => self.bmi,
:weight => self.weight,
:length => self.length }
end
|
#create(session) ⇒ Object
32
33
34
|
# File 'lib/caren/dossier/dossier_entry.rb', line 32
def create session
self.class.from_xml session.post self.class.resource_url(self.subject_id), self.to_xml
end
|