Changeset 409 for ruby/trunk
- Timestamp:
- Apr 13, 2010, 12:01:17 AM (14 years ago)
- Location:
- ruby/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/lib/open_ehr/serializer.rb
r408 r409 81 81 82 82 def definition 83 ad = @archetype.definition 84 definition = 'definition'+NL 85 definition << INDENT+ad.rm_type_name+"[#{ad.node_id}] matches {" 86 if ad.any_allowed? 87 definition << '*}'+NL 88 else 89 definition << NL 90 if ad.attributes 91 attributes = ad.attributes 92 indents = 2 93 while attributes 94 definition << INDENT*indents+attributes.rm_type_name 95 definition << "[#{attributes.node_id}] " 96 definition << existence(attributes.existence) 97 definition << " matches {" 98 end 99 end 100 end 83 101 end 84 102 … … 91 109 def merge 92 110 return header + description + definition + ontology 111 end 112 113 private 114 def c_object 115 end 116 117 def existence(existence) 118 "existence matches {#{existence.lower}..#{existence.upper}}" 93 119 end 94 120 end … … 136 162 end 137 163 xml.purpose item.purpose 164 if item.keywords then 165 item.keywords.each do |word| 166 xml.keywords word 167 end 168 end 138 169 xml.use item.use if item.use 139 170 xml.misuse item.misuse if item.misuse -
ruby/trunk/spec/lib/open_ehr/serializer/adl_serializer_spec.rb
r408 r409 14 14 @sample_header = adl[0..7].join 15 15 @sample_description = adl[9..22].join 16 @sample_definition = adl[24..25].join 16 17 adl_file.close 17 18 end … … 32 33 @adl_serializer.description.should == @sample_description 33 34 end 35 36 it 'definition should return ADL formatted definition' do 37 @adl_serializer.definition.should == @sample_definition 38 end 34 39 end -
ruby/trunk/spec/lib/open_ehr/serializer/xml_serializer_spec.rb
r408 r409 50 50 END 51 51 end 52 53 it 'should return XML formatted definition' 54 52 55 end
Note:
See TracChangeset
for help on using the changeset viewer.