Class: OpenEHR::Serializer::OPTSerializer
- Inherits:
-
BaseSerializer
- Object
- BaseSerializer
- OpenEHR::Serializer::OPTSerializer
- Defined in:
- lib/openehr/serializer/opt_serializer.rb
Instance Method Summary collapse
- #content ⇒ Object
-
#context ⇒ Object
The root archetype's context/content constraint subtrees (what the template actually constrains for those attributes), as JSON via JSONSerializer - the same generic walker RMJSONSerializer uses for RM instances.
-
#header ⇒ Object
Template-level metadata, as JSON.
-
#initialize(opt, format:) ⇒ OPTSerializer
constructor
A new instance of OPTSerializer.
- #name ⇒ Object
Methods inherited from BaseSerializer
Constructor Details
Instance Method Details
#content ⇒ Object
37 38 39 |
# File 'lib/openehr/serializer/opt_serializer.rb', line 37 def content attribute_json('content') end |
#context ⇒ Object
The root archetype's context/content constraint subtrees (what the template actually constrains for those attributes), as JSON via JSONSerializer - the same generic walker RMJSONSerializer uses for RM instances.
33 34 35 |
# File 'lib/openehr/serializer/opt_serializer.rb', line 33 def context attribute_json('context') end |
#header ⇒ Object
Template-level metadata, as JSON. An operational template carries constraints, not instance data - it has no composer or territory to report - so this is the concept/ids/language the OPT actually captures, rather than a simulated RM COMPOSITION.
20 21 22 23 24 25 26 27 |
# File 'lib/openehr/serializer/opt_serializer.rb', line 20 def header JSON.generate( 'concept' => @opt.concept, 'archetype_id' => @opt.definition.archetype_id.value, 'template_id' => @opt.template_id.value, 'language' => @opt.original_language.code_string ) end |
#name ⇒ Object
12 13 14 |
# File 'lib/openehr/serializer/opt_serializer.rb', line 12 def name @opt.definition.archetype_id.concept_name end |