Method: Abstractor::Abstractable::InstanceMethods#abstract
- Defined in:
- lib/abstractor/abstractable.rb
#abstract(options = {}) ⇒ void
This method returns an undefined value.
The method for generating abstractions from the abstractable entity.
The generation of abstactions is based on the setup of Abstactor::AbstractorAbstactionSchema, Abstractor::AbstractorSubject, Abstractor::AbstractorSubjectGroup and Abstractor::AbstractorAbstractionSource associated to the abstractable entity.
Namespacing allows for different sets data points to be associated to the same abstractable entity.
Namespacing is achieved by setting the Abstractor::AbstractorSubject#namespace_type and Abstractor::AbstractorSubject#namespace_id attributes.
Passing a namespace to this method will restrict the generation of abstractions to the given namespace. Otherwise, all configured abstractions associated to the abstractable entity will be generated.
A practical example of the use of a namespace would be two different clincal departments wanting to chart abstract two distinct sets of datapoints for progress notes extracted from an electronic medical record system.
89 90 91 92 93 94 95 96 97 |
# File 'lib/abstractor/abstractable.rb', line 89 def abstract( = {}) = { namespace_type: nil, namespace_id: nil, abstractor_abstraction_schema_ids: [] }.merge() sentinental_groups = [] self.class.abstractor_subjects().each do |abstractor_subject| abstractor_subject.abstract(self) sentinental_groups << abstractor_subject.abstractor_subject_group if abstractor_subject.abstractor_subject_group && abstractor_subject.abstractor_subject_group.has_subtype?(Abstractor::Enum::ABSTRACTOR_GROUP_SENTINENTAL_SUBTYPE) end sentinental_groups.uniq.map{|sentinental_group| regroup_sentinental_suggestions(sentinental_group, )} end |