Module: Ccd::DischargeMedicationTemplate

Included in:
DischargeMedication
Defined in:
lib/ccd/templates/discharge_medication_template.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/ccd/templates/discharge_medication_template.rb', line 2

def self.included(base)
  base.class_eval do
    extend ::Ccd::Dsl
    
    # SHALL contain exactly one [1..1] @classCode="ACT" (CodeSystem: HL7ActClass 2.16.840.1.113883.5.6 STATIC) (CONF:7689).
    constraint 'class_code', {:cardinality=>"1..1", :value=>"ACT"}
    
    # SHALL contain exactly one [1..1] @moodCode="EVN" (CodeSystem: ActMood 2.16.840.1.113883.5.1001 STATIC) (CONF:7690).
    constraint 'mood_code', {:cardinality=>"1..1", :value=>"EVN"}
    
    # SHALL contain exactly one [1..1] templateId (CONF:16760) such that it
    constraint 'template_id', {:cardinality=>"1..1"}
    
    # SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.35" (CONF:16761).
    constraint 'template_id.root', {:cardinality=>"1..1", :value=>"2.16.840.1.113883.10.20.22.4.35"}
    
    # SHALL contain exactly one [1..1] code (CONF:7691).
    constraint 'code', {:cardinality=>"1..1", :value=>{:code=>"10183-2", :display_name=>"Discharge medication", :code_system=>"2.16.840.1.113883.6.1"}}
    
    # SHALL contain at least one [1..*] entryRelationship (CONF:7692) such that it
    constraint 'entry_relationship', {:cardinality=>"1..*"}
    
    # SHALL contain exactly one [1..1] @typeCode="SUBJ" Has Subject (CodeSystem: HL7ActRelationshipType 2.16.840.1.113883.5.1002 STATIC) (CONF:7693).
    constraint 'entry_relationship.type_code', {:cardinality=>"1..1", :value=>"SUBJ"}
    
    # SHALL contain exactly one [1..1] Medication Activity (templateId:2.16.840.1.113883.10.20.22.4.16) (CONF:15525).
    constraint 'entry_relationship.substance_administration', {:cardinality=>"1..1"}
  end
end