Changeset 23
- Timestamp:
- May 1, 2008, 8:21:09 AM (16 years ago)
- Location:
- ruby/trunk
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/adl_parser/lib/parser.rb
r22 r23 27 27 class Parser < Racc::Parser 28 28 29 module_eval <<'..end lib/parser.y modeval..id c7c14292e8', 'lib/parser.y', 101029 module_eval <<'..end lib/parser.y modeval..id4cf2f1104b', 'lib/parser.y', 1079 30 30 31 31 def assert_at(file,line, message = "") … … 820 820 821 821 822 ..end lib/parser.y modeval..id c7c14292e8822 ..end lib/parser.y modeval..id4cf2f1104b 823 823 824 824 ##### racc 1.4.5 generates ### … … 852 852 2, 102, :_reduce_none, 853 853 1, 110, :_reduce_26, 854 1, 110, :_reduce_ none,854 1, 110, :_reduce_27, 855 855 5, 111, :_reduce_28, 856 856 5, 111, :_reduce_29, 857 2, 113, :_reduce_ none,857 2, 113, :_reduce_30, 858 858 1, 115, :_reduce_31, 859 859 2, 115, :_reduce_32, … … 870 870 1, 120, :_reduce_none, 871 871 1, 120, :_reduce_none, 872 3, 121, :_reduce_ none,872 3, 121, :_reduce_45, 873 873 4, 122, :_reduce_none, 874 874 3, 122, :_reduce_none, … … 915 915 1, 151, :_reduce_none, 916 916 1, 151, :_reduce_none, 917 1, 152, :_reduce_ none,918 2, 152, :_reduce_ none,919 3, 152, :_reduce_ none,917 1, 152, :_reduce_90, 918 2, 152, :_reduce_91, 919 3, 152, :_reduce_92, 920 920 3, 154, :_reduce_93, 921 921 1, 155, :_reduce_94, … … 929 929 3, 160, :_reduce_102, 930 930 1, 161, :_reduce_103, 931 1, 162, :_reduce_ none,932 2, 162, :_reduce_ none,931 1, 162, :_reduce_104, 932 2, 162, :_reduce_105, 933 933 3, 163, :_reduce_106, 934 934 3, 164, :_reduce_107, 935 1, 158, :_reduce_ none,936 2, 158, :_reduce_ none,935 1, 158, :_reduce_108, 936 2, 158, :_reduce_109, 937 937 2, 166, :_reduce_110, 938 938 3, 166, :_reduce_111, … … 992 992 4, 193, :_reduce_none, 993 993 3, 193, :_reduce_none, 994 1, 176, :_reduce_ none,995 2, 176, :_reduce_ none,996 2, 176, :_reduce_ none,994 1, 176, :_reduce_167, 995 2, 176, :_reduce_168, 996 2, 176, :_reduce_169, 997 997 3, 186, :_reduce_none, 998 998 3, 186, :_reduce_none, … … 1007 1007 4, 194, :_reduce_none, 1008 1008 3, 194, :_reduce_none, 1009 1, 177, :_reduce_ none,1010 1, 177, :_reduce_ none,1009 1, 177, :_reduce_182, 1010 1, 177, :_reduce_183, 1011 1011 3, 187, :_reduce_none, 1012 1012 3, 187, :_reduce_none, … … 1131 1131 1, 210, :_reduce_none, 1132 1132 0, 116, :_reduce_none, 1133 5, 116, :_reduce_ none,1133 5, 116, :_reduce_306, 1134 1134 2, 116, :_reduce_none, 1135 1135 1, 209, :_reduce_none, … … 2106 2106 def _reduce_26( val, _values, result ) 2107 2107 assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT)} 2108 2109 result = val[0] 2110 result 2111 end 2112 .,., 2113 2114 # reduce 27 omitted 2115 2116 module_eval <<'.,.,', 'lib/parser.y', 118 2108 @@log.info("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}") 2109 result = val[0] 2110 result 2111 end 2112 .,., 2113 2114 module_eval <<'.,.,', 'lib/parser.y', 114 2115 def _reduce_27( val, _values, result ) 2116 result = val[0] 2117 result 2118 end 2119 .,., 2120 2121 module_eval <<'.,.,', 'lib/parser.y', 125 2117 2122 def _reduce_28( val, _values, result ) 2118 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new 2119 result 2120 end 2121 .,., 2122 2123 module_eval <<'.,.,', 'lib/parser.y', 125 2123 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object| 2124 c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref] 2125 c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier] 2126 c_complex_object.occurrences = val[0][:c_occurrences] 2127 end 2128 result 2129 end 2130 .,., 2131 2132 module_eval <<'.,.,', 'lib/parser.y', 133 2124 2133 def _reduce_29( val, _values, result ) 2125 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new( 2126 :assumed_value => val[0], 2127 :attributes => val[2] 2128 ) 2129 result 2130 end 2131 .,., 2132 2133 # reduce 30 omitted 2134 2135 module_eval <<'.,.,', 'lib/parser.y', 134 2134 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object| 2135 c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref] 2136 c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier] 2137 c_complex_object.occurrences = val[0][:c_occurrences] 2138 end 2139 result 2140 end 2141 .,., 2142 2143 module_eval <<'.,.,', 'lib/parser.y', 140 2144 def _reduce_30( val, _values, result ) 2145 result = {:c_complex_object_id => val[0], :c_occurrences => val[1]} 2146 result 2147 end 2148 .,., 2149 2150 module_eval <<'.,.,', 'lib/parser.y', 145 2136 2151 def _reduce_31( val, _values, result ) 2137 result = val[0]2138 result 2139 end 2140 .,., 2141 2142 module_eval <<'.,.,', 'lib/parser.y', 1 382152 result = {:type_identifier => val[0]} 2153 result 2154 end 2155 .,., 2156 2157 module_eval <<'.,.,', 'lib/parser.y', 149 2143 2158 def _reduce_32( val, _values, result ) 2144 result = {: c_complex_object_id => {:type_identifier => val[0], :V_LOCAL_TERM_CODE_REF => val[1]}}2159 result = {:type_identifier => val[0], :local_term_code_ref => val[1]} 2145 2160 result 2146 2161 end … … 2149 2164 # reduce 33 omitted 2150 2165 2151 module_eval <<'.,.,', 'lib/parser.y', 1 442166 module_eval <<'.,.,', 'lib/parser.y', 155 2152 2167 def _reduce_34( val, _values, result ) 2153 2168 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(:attributes => val[0]) … … 2156 2171 .,., 2157 2172 2158 module_eval <<'.,.,', 'lib/parser.y', 1 522173 module_eval <<'.,.,', 'lib/parser.y', 163 2159 2174 def _reduce_35( val, _values, result ) 2160 2175 result = val[0] … … 2163 2178 .,., 2164 2179 2165 module_eval <<'.,.,', 'lib/parser.y', 1 562180 module_eval <<'.,.,', 'lib/parser.y', 167 2166 2181 def _reduce_36( val, _values, result ) 2167 2182 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new … … 2170 2185 .,., 2171 2186 2172 module_eval <<'.,.,', 'lib/parser.y', 1 602187 module_eval <<'.,.,', 'lib/parser.y', 171 2173 2188 def _reduce_37( val, _values, result ) 2174 2189 result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF.new … … 2177 2192 .,., 2178 2193 2179 module_eval <<'.,.,', 'lib/parser.y', 1 642194 module_eval <<'.,.,', 'lib/parser.y', 175 2180 2195 def _reduce_38( val, _values, result ) 2181 2196 result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT.new … … 2184 2199 .,., 2185 2200 2186 module_eval <<'.,.,', 'lib/parser.y', 1 682201 module_eval <<'.,.,', 'lib/parser.y', 179 2187 2202 def _reduce_39( val, _values, result ) 2188 2203 result = OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF.new … … 2191 2206 .,., 2192 2207 2193 module_eval <<'.,.,', 'lib/parser.y', 1 722208 module_eval <<'.,.,', 'lib/parser.y', 183 2194 2209 def _reduce_40( val, _values, result ) 2195 2210 result = val[0] … … 2198 2213 .,., 2199 2214 2200 module_eval <<'.,.,', 'lib/parser.y', 1 762215 module_eval <<'.,.,', 'lib/parser.y', 187 2201 2216 def _reduce_41( val, _values, result ) 2202 2217 result = val[0] … … 2205 2220 .,., 2206 2221 2207 module_eval <<'.,.,', 'lib/parser.y', 1 802222 module_eval <<'.,.,', 'lib/parser.y', 191 2208 2223 def _reduce_42( val, _values, result ) 2209 2224 result = val[0] … … 2216 2231 # reduce 44 omitted 2217 2232 2218 # reduce 45 omitted 2233 module_eval <<'.,.,', 'lib/parser.y', 206 2234 def _reduce_45( val, _values, result ) 2235 result = val[1] 2236 result 2237 end 2238 .,., 2219 2239 2220 2240 # reduce 46 omitted … … 2232 2252 # reduce 52 omitted 2233 2253 2234 module_eval <<'.,.,', 'lib/parser.y', 2 122254 module_eval <<'.,.,', 'lib/parser.y', 226 2235 2255 def _reduce_53( val, _values, result ) 2236 2256 assert_at(__FILE__,__LINE__){val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE)} … … 2240 2260 .,., 2241 2261 2242 module_eval <<'.,.,', 'lib/parser.y', 2 182262 module_eval <<'.,.,', 'lib/parser.y', 232 2243 2263 def _reduce_54( val, _values, result ) 2244 2264 @@log.info("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}") … … 2248 2268 .,., 2249 2269 2250 module_eval <<'.,.,', 'lib/parser.y', 2 232270 module_eval <<'.,.,', 'lib/parser.y', 237 2251 2271 def _reduce_55( val, _values, result ) 2252 2272 @@log.info("#{__FILE__}:#{__LINE__}: c_real = #{val[0]} at #{@filename}:#{@lineno}") … … 2256 2276 .,., 2257 2277 2258 module_eval <<'.,.,', 'lib/parser.y', 2 282278 module_eval <<'.,.,', 'lib/parser.y', 242 2259 2279 def _reduce_56( val, _values, result ) 2260 2280 @@log.info("#{__FILE__}:#{__LINE__}: c_date = #{val[0]} at #{@filename}:#{@lineno}") … … 2264 2284 .,., 2265 2285 2266 module_eval <<'.,.,', 'lib/parser.y', 2 332286 module_eval <<'.,.,', 'lib/parser.y', 247 2267 2287 def _reduce_57( val, _values, result ) 2268 2288 @@log.info("#{__FILE__}:#{__LINE__}: c_time = #{val[0]} at #{@filename}:#{@lineno}") … … 2272 2292 .,., 2273 2293 2274 module_eval <<'.,.,', 'lib/parser.y', 2 382294 module_eval <<'.,.,', 'lib/parser.y', 252 2275 2295 def _reduce_58( val, _values, result ) 2276 2296 @@log.info("#{__FILE__}:#{__LINE__}: c_date_time = #{val[0]} at #{@filename}:#{@lineno}") … … 2280 2300 .,., 2281 2301 2282 module_eval <<'.,.,', 'lib/parser.y', 2 432302 module_eval <<'.,.,', 'lib/parser.y', 257 2283 2303 def _reduce_59( val, _values, result ) 2284 2304 @@log.info("#{__FILE__}:#{__LINE__}: c_duration = #{val[0]} at #{@filename}:#{@lineno}") … … 2288 2308 .,., 2289 2309 2290 module_eval <<'.,.,', 'lib/parser.y', 2 482310 module_eval <<'.,.,', 'lib/parser.y', 262 2291 2311 def _reduce_60( val, _values, result ) 2292 2312 @@log.info("#{__FILE__}:#{__LINE__}: c_string = #{val[0]} at #{@filename}:#{@lineno}") … … 2296 2316 .,., 2297 2317 2298 module_eval <<'.,.,', 'lib/parser.y', 2 542318 module_eval <<'.,.,', 'lib/parser.y', 268 2299 2319 def _reduce_61( val, _values, result ) 2300 2320 assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN)} … … 2307 2327 # reduce 62 omitted 2308 2328 2309 module_eval <<'.,.,', 'lib/parser.y', 2 642329 module_eval <<'.,.,', 'lib/parser.y', 278 2310 2330 def _reduce_63( val, _values, result ) 2311 2331 result = [val[0]] … … 2314 2334 .,., 2315 2335 2316 module_eval <<'.,.,', 'lib/parser.y', 2 682336 module_eval <<'.,.,', 'lib/parser.y', 282 2317 2337 def _reduce_64( val, _values, result ) 2318 2338 result = (val[0] << val[1]) … … 2321 2341 .,., 2322 2342 2323 module_eval <<'.,.,', 'lib/parser.y', 2 772343 module_eval <<'.,.,', 'lib/parser.y', 291 2324 2344 def _reduce_65( val, _values, result ) 2325 2345 assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)} … … 2331 2351 .,., 2332 2352 2333 module_eval <<'.,.,', 'lib/parser.y', 2 822353 module_eval <<'.,.,', 'lib/parser.y', 296 2334 2354 def _reduce_66( val, _values, result ) 2335 2355 assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)} … … 2339 2359 .,., 2340 2360 2341 module_eval <<'.,.,', 'lib/parser.y', 2872361 module_eval <<'.,.,', 'lib/parser.y', 301 2342 2362 def _reduce_67( val, _values, result ) 2343 2363 assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)} … … 2347 2367 .,., 2348 2368 2349 module_eval <<'.,.,', 'lib/parser.y', 2982369 module_eval <<'.,.,', 'lib/parser.y', 312 2350 2370 def _reduce_68( val, _values, result ) 2351 2371 @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}") … … 2358 2378 .,., 2359 2379 2360 module_eval <<'.,.,', 'lib/parser.y', 3 082380 module_eval <<'.,.,', 'lib/parser.y', 322 2361 2381 def _reduce_69( val, _values, result ) 2362 2382 assert_at(__FILE__,__LINE__){ val[2].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY) } … … 2371 2391 .,., 2372 2392 2373 module_eval <<'.,.,', 'lib/parser.y', 3 132393 module_eval <<'.,.,', 'lib/parser.y', 327 2374 2394 def _reduce_70( val, _values, result ) 2375 2395 result = Array[val[0]] … … 2378 2398 .,., 2379 2399 2380 module_eval <<'.,.,', 'lib/parser.y', 3 172400 module_eval <<'.,.,', 'lib/parser.y', 331 2381 2401 def _reduce_71( val, _values, result ) 2382 2402 result = (val[0] << val[1]) … … 2385 2405 .,., 2386 2406 2387 module_eval <<'.,.,', 'lib/parser.y', 3 212407 module_eval <<'.,.,', 'lib/parser.y', 335 2388 2408 def _reduce_72( val, _values, result ) 2389 2409 result = Array[val[0]] … … 2416 2436 # reduce 84 omitted 2417 2437 2418 module_eval <<'.,.,', 'lib/parser.y', 3 512438 module_eval <<'.,.,', 'lib/parser.y', 366 2419 2439 def _reduce_85( val, _values, result ) 2440 dadl_sections = val[1] 2420 2441 result = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new 2421 2442 result … … 2431 2452 # reduce 89 omitted 2432 2453 2433 # reduce 90 omitted 2434 2435 # reduce 91 omitted 2436 2437 # reduce 92 omitted 2438 2439 module_eval <<'.,.,', 'lib/parser.y', 370 2454 module_eval <<'.,.,', 'lib/parser.y', 380 2455 def _reduce_90( val, _values, result ) 2456 result = Array[val[0]] 2457 result 2458 end 2459 .,., 2460 2461 module_eval <<'.,.,', 'lib/parser.y', 384 2462 def _reduce_91( val, _values, result ) 2463 result = (val[0] << val[1]) 2464 result 2465 end 2466 .,., 2467 2468 module_eval <<'.,.,', 'lib/parser.y', 388 2469 def _reduce_92( val, _values, result ) 2470 result = (val[0] << val[2]) 2471 result 2472 end 2473 .,., 2474 2475 module_eval <<'.,.,', 'lib/parser.y', 394 2440 2476 def _reduce_93( val, _values, result ) 2441 2477 @@log.info("#{__FILE__}:#{__LINE__}: attr_id = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}") 2442 result 2443 end 2444 .,., 2445 2446 module_eval <<'.,.,', 'lib/parser.y', 376 2478 result = {:attr_id => val[0], :object_block => val[2]} 2479 result 2480 end 2481 .,., 2482 2483 module_eval <<'.,.,', 'lib/parser.y', 400 2447 2484 def _reduce_94( val, _values, result ) 2448 2485 @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}:#{@lineno}") … … 2454 2491 # reduce 95 omitted 2455 2492 2456 module_eval <<'.,.,', 'lib/parser.y', 3822493 module_eval <<'.,.,', 'lib/parser.y', 406 2457 2494 def _reduce_96( val, _values, result ) 2458 2495 result = val[0] … … 2461 2498 .,., 2462 2499 2463 module_eval <<'.,.,', 'lib/parser.y', 3862500 module_eval <<'.,.,', 'lib/parser.y', 410 2464 2501 def _reduce_97( val, _values, result ) 2465 2502 result = val[0] … … 2468 2505 .,., 2469 2506 2470 module_eval <<'.,.,', 'lib/parser.y', 3912507 module_eval <<'.,.,', 'lib/parser.y', 415 2471 2508 def _reduce_98( val, _values, result ) 2472 2509 result = val[0] … … 2475 2512 .,., 2476 2513 2477 module_eval <<'.,.,', 'lib/parser.y', 3952514 module_eval <<'.,.,', 'lib/parser.y', 419 2478 2515 def _reduce_99( val, _values, result ) 2479 2516 result = val[0] … … 2482 2519 .,., 2483 2520 2484 module_eval <<'.,.,', 'lib/parser.y', 4 002521 module_eval <<'.,.,', 'lib/parser.y', 424 2485 2522 def _reduce_100( val, _values, result ) 2486 result = val[0]2487 result 2488 end 2489 .,., 2490 2491 module_eval <<'.,.,', 'lib/parser.y', 4 042523 result = {:untyped_multiple_attr_object_block => val[0]} 2524 result 2525 end 2526 .,., 2527 2528 module_eval <<'.,.,', 'lib/parser.y', 428 2492 2529 def _reduce_101( val, _values, result ) 2493 result = val[0]2494 result 2495 end 2496 .,., 2497 2498 module_eval <<'.,.,', 'lib/parser.y', 4 092530 result = {:type_identifier => val[0], :untyped_multiple_attr_object_block => val[1]} 2531 result 2532 end 2533 .,., 2534 2535 module_eval <<'.,.,', 'lib/parser.y', 433 2499 2536 def _reduce_102( val, _values, result ) 2500 result = val[0]2501 result 2502 end 2503 .,., 2504 2505 module_eval <<'.,.,', 'lib/parser.y', 4 152537 result = {:multiple_attr_object_block_head => val[0], :keyed_objects => val[1]} 2538 result 2539 end 2540 .,., 2541 2542 module_eval <<'.,.,', 'lib/parser.y', 439 2506 2543 def _reduce_103( val, _values, result ) 2507 2544 @@log.info("SYM_START_DBLOCK: #{val[0]} at #{@filename}:#{@lineno}") … … 2511 2548 .,., 2512 2549 2513 # reduce 104 omitted 2514 2515 # reduce 105 omitted 2516 2517 module_eval <<'.,.,', 'lib/parser.y', 423 2550 module_eval <<'.,.,', 'lib/parser.y', 444 2551 def _reduce_104( val, _values, result ) 2552 result = Array[val[0]] 2553 result 2554 end 2555 .,., 2556 2557 module_eval <<'.,.,', 'lib/parser.y', 448 2558 def _reduce_105( val, _values, result ) 2559 result = (val[0] << val[1]) 2560 result 2561 end 2562 .,., 2563 2564 module_eval <<'.,.,', 'lib/parser.y', 454 2518 2565 def _reduce_106( val, _values, result ) 2519 2566 @@log.info("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}") 2520 result 2521 end 2522 .,., 2523 2524 module_eval <<'.,.,', 'lib/parser.y', 429 2567 result = {:object_key => val[0], :object_block => val[1]} 2568 result 2569 end 2570 .,., 2571 2572 module_eval <<'.,.,', 'lib/parser.y', 460 2525 2573 def _reduce_107( val, _values, result ) 2526 2574 @@log.info("object_key: [#{val[1]}] at #{@filename}:#{@lineno}") … … 2530 2578 .,., 2531 2579 2532 # reduce 108 omitted 2533 2534 # reduce 109 omitted 2535 2536 module_eval <<'.,.,', 'lib/parser.y', 437 2580 module_eval <<'.,.,', 'lib/parser.y', 465 2581 def _reduce_108( val, _values, result ) 2582 result = {:untyped_single_attr_object_block => val[0]} 2583 result 2584 end 2585 .,., 2586 2587 module_eval <<'.,.,', 'lib/parser.y', 469 2588 def _reduce_109( val, _values, result ) 2589 result = {:type_identifier => val[0], :untyped_single_attr_object_block => val[1]} 2590 result 2591 end 2592 .,., 2593 2594 module_eval <<'.,.,', 'lib/parser.y', 475 2537 2595 def _reduce_110( val, _values, result ) 2538 2596 @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}") 2539 result = val[0]2540 result 2541 end 2542 .,., 2543 2544 module_eval <<'.,.,', 'lib/parser.y', 4 422597 result = {:single_attr_object_complex_head => val[0]} 2598 result 2599 end 2600 .,., 2601 2602 module_eval <<'.,.,', 'lib/parser.y', 480 2545 2603 def _reduce_111( val, _values, result ) 2546 2604 @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]}, attr_vals = #{val[1]} at #{@filename}:#{@lineno}") 2547 result = val[0]2605 result = {:single_attr_object_complex_head => val[0], :attr_vals => val[1]} 2548 2606 result 2549 2607 end … … 2552 2610 # reduce 112 omitted 2553 2611 2554 module_eval <<'.,.,', 'lib/parser.y', 4 482612 module_eval <<'.,.,', 'lib/parser.y', 486 2555 2613 def _reduce_113( val, _values, result ) 2556 2614 @@log.info("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}") 2557 result = val[0]2558 result 2559 end 2560 .,., 2561 2562 module_eval <<'.,.,', 'lib/parser.y', 4 532615 result = {:untyped_primitive_object_block => val[0]} 2616 result 2617 end 2618 .,., 2619 2620 module_eval <<'.,.,', 'lib/parser.y', 491 2563 2621 def _reduce_114( val, _values, result ) 2564 2622 @@log.info("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}") 2565 result = val[0]2566 result 2567 end 2568 .,., 2569 2570 module_eval <<'.,.,', 'lib/parser.y', 4 582623 result = {:type_identifier => val[0], :untyped_primitive_object_block => val[1]} 2624 result 2625 end 2626 .,., 2627 2628 module_eval <<'.,.,', 'lib/parser.y', 496 2571 2629 def _reduce_115( val, _values, result ) 2572 2630 @@log.info("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}") … … 2576 2634 .,., 2577 2635 2578 module_eval <<'.,.,', 'lib/parser.y', 4622636 module_eval <<'.,.,', 'lib/parser.y', 500 2579 2637 def _reduce_116( val, _values, result ) 2580 2638 result = val[0] … … 2583 2641 .,., 2584 2642 2585 module_eval <<'.,.,', 'lib/parser.y', 4662643 module_eval <<'.,.,', 'lib/parser.y', 504 2586 2644 def _reduce_117( val, _values, result ) 2587 2645 result = val[0] … … 2590 2648 .,., 2591 2649 2592 module_eval <<'.,.,', 'lib/parser.y', 4702650 module_eval <<'.,.,', 'lib/parser.y', 508 2593 2651 def _reduce_118( val, _values, result ) 2594 2652 result = val[0] … … 2597 2655 .,., 2598 2656 2599 module_eval <<'.,.,', 'lib/parser.y', 4742657 module_eval <<'.,.,', 'lib/parser.y', 512 2600 2658 def _reduce_119( val, _values, result ) 2601 2659 result = val[0] … … 2604 2662 .,., 2605 2663 2606 module_eval <<'.,.,', 'lib/parser.y', 4782664 module_eval <<'.,.,', 'lib/parser.y', 516 2607 2665 def _reduce_120( val, _values, result ) 2608 2666 result = val[0] … … 2611 2669 .,., 2612 2670 2613 module_eval <<'.,.,', 'lib/parser.y', 4832671 module_eval <<'.,.,', 'lib/parser.y', 521 2614 2672 def _reduce_121( val, _values, result ) 2615 2673 @@log.info("string_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2619 2677 .,., 2620 2678 2621 module_eval <<'.,.,', 'lib/parser.y', 4882679 module_eval <<'.,.,', 'lib/parser.y', 526 2622 2680 def _reduce_122( val, _values, result ) 2623 2681 @@log.info("integer_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2627 2685 .,., 2628 2686 2629 module_eval <<'.,.,', 'lib/parser.y', 4932687 module_eval <<'.,.,', 'lib/parser.y', 531 2630 2688 def _reduce_123( val, _values, result ) 2631 2689 @@log.info("real_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2635 2693 .,., 2636 2694 2637 module_eval <<'.,.,', 'lib/parser.y', 4982695 module_eval <<'.,.,', 'lib/parser.y', 536 2638 2696 def _reduce_124( val, _values, result ) 2639 2697 @@log.info("boolean_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2643 2701 .,., 2644 2702 2645 module_eval <<'.,.,', 'lib/parser.y', 5 032703 module_eval <<'.,.,', 'lib/parser.y', 541 2646 2704 def _reduce_125( val, _values, result ) 2647 2705 @@log.info("character_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2651 2709 .,., 2652 2710 2653 module_eval <<'.,.,', 'lib/parser.y', 5 082711 module_eval <<'.,.,', 'lib/parser.y', 546 2654 2712 def _reduce_126( val, _values, result ) 2655 2713 @@log.info("date_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2659 2717 .,., 2660 2718 2661 module_eval <<'.,.,', 'lib/parser.y', 5 132719 module_eval <<'.,.,', 'lib/parser.y', 551 2662 2720 def _reduce_127( val, _values, result ) 2663 2721 @@log.info("time_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2667 2725 .,., 2668 2726 2669 module_eval <<'.,.,', 'lib/parser.y', 5 182727 module_eval <<'.,.,', 'lib/parser.y', 556 2670 2728 def _reduce_128( val, _values, result ) 2671 2729 @@log.info("date_time_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2675 2733 .,., 2676 2734 2677 module_eval <<'.,.,', 'lib/parser.y', 5 232735 module_eval <<'.,.,', 'lib/parser.y', 561 2678 2736 def _reduce_129( val, _values, result ) 2679 2737 @@log.info("duration_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2683 2741 .,., 2684 2742 2685 module_eval <<'.,.,', 'lib/parser.y', 5 282743 module_eval <<'.,.,', 'lib/parser.y', 566 2686 2744 def _reduce_130( val, _values, result ) 2687 2745 @@log.info("uri_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2721 2779 # reduce 145 omitted 2722 2780 2723 module_eval <<'.,.,', 'lib/parser.y', 5 512781 module_eval <<'.,.,', 'lib/parser.y', 589 2724 2782 def _reduce_146( val, _values, result ) 2725 2783 @@log.info("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}") … … 2729 2787 .,., 2730 2788 2731 module_eval <<'.,.,', 'lib/parser.y', 5 562789 module_eval <<'.,.,', 'lib/parser.y', 594 2732 2790 def _reduce_147( val, _values, result ) 2733 2791 @@log.info("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}") … … 2737 2795 .,., 2738 2796 2739 module_eval <<'.,.,', 'lib/parser.y', 5622797 module_eval <<'.,.,', 'lib/parser.y', 600 2740 2798 def _reduce_148( val, _values, result ) 2741 2799 @@log.info("V_STRING: #{val[0]} at #{@filename}:#{@lineno}") … … 2751 2809 # reduce 151 omitted 2752 2810 2753 module_eval <<'.,.,', 'lib/parser.y', 5762811 module_eval <<'.,.,', 'lib/parser.y', 614 2754 2812 def _reduce_152( val, _values, result ) 2755 2813 begin … … 2763 2821 .,., 2764 2822 2765 module_eval <<'.,.,', 'lib/parser.y', 5852823 module_eval <<'.,.,', 'lib/parser.y', 623 2766 2824 def _reduce_153( val, _values, result ) 2767 2825 begin … … 2775 2833 .,., 2776 2834 2777 module_eval <<'.,.,', 'lib/parser.y', 5942835 module_eval <<'.,.,', 'lib/parser.y', 632 2778 2836 def _reduce_154( val, _values, result ) 2779 2837 begin … … 2811 2869 # reduce 166 omitted 2812 2870 2813 # reduce 167 omitted 2814 2815 # reduce 168 omitted 2816 2817 # reduce 169 omitted 2871 module_eval <<'.,.,', 'lib/parser.y', 658 2872 def _reduce_167( val, _values, result ) 2873 begin 2874 real = Float(val[0]) 2875 rescue 2876 raise 2877 end 2878 result = real 2879 result 2880 end 2881 .,., 2882 2883 module_eval <<'.,.,', 'lib/parser.y', 667 2884 def _reduce_168( val, _values, result ) 2885 begin 2886 real = Float(val[0]) 2887 rescue 2888 raise 2889 end 2890 result = real 2891 result 2892 end 2893 .,., 2894 2895 module_eval <<'.,.,', 'lib/parser.y', 676 2896 def _reduce_169( val, _values, result ) 2897 begin 2898 real = Float(val[0]) 2899 rescue 2900 raise 2901 end 2902 result = - real 2903 result 2904 end 2905 .,., 2818 2906 2819 2907 # reduce 170 omitted … … 2841 2929 # reduce 181 omitted 2842 2930 2843 # reduce 182 omitted 2844 2845 # reduce 183 omitted 2931 module_eval <<'.,.,', 'lib/parser.y', 696 2932 def _reduce_182( val, _values, result ) 2933 result = true 2934 result 2935 end 2936 .,., 2937 2938 module_eval <<'.,.,', 'lib/parser.y', 700 2939 def _reduce_183( val, _values, result ) 2940 result = false 2941 result 2942 end 2943 .,., 2846 2944 2847 2945 # reduce 184 omitted … … 2937 3035 # reduce 229 omitted 2938 3036 2939 module_eval <<'.,.,', 'lib/parser.y', 6983037 module_eval <<'.,.,', 'lib/parser.y', 764 2940 3038 def _reduce_230( val, _values, result ) 2941 3039 @@log.info("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}") … … 2969 3067 # reduce 242 omitted 2970 3068 2971 module_eval <<'.,.,', 'lib/parser.y', 7 173069 module_eval <<'.,.,', 'lib/parser.y', 783 2972 3070 def _reduce_243( val, _values, result ) 2973 3071 @@log.info("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}") … … 2982 3080 # reduce 246 omitted 2983 3081 2984 module_eval <<'.,.,', 'lib/parser.y', 7 263082 module_eval <<'.,.,', 'lib/parser.y', 792 2985 3083 def _reduce_247( val, _values, result ) 2986 3084 @@log.info("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}") … … 3069 3167 # reduce 287 omitted 3070 3168 3071 module_eval <<'.,.,', 'lib/parser.y', 7953169 module_eval <<'.,.,', 'lib/parser.y', 861 3072 3170 def _reduce_288( val, _values, result ) 3073 3171 @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") … … 3076 3174 .,., 3077 3175 3078 module_eval <<'.,.,', 'lib/parser.y', 7993176 module_eval <<'.,.,', 'lib/parser.y', 865 3079 3177 def _reduce_289( val, _values, result ) 3080 3178 @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") … … 3083 3181 .,., 3084 3182 3085 module_eval <<'.,.,', 'lib/parser.y', 8 103183 module_eval <<'.,.,', 'lib/parser.y', 876 3086 3184 def _reduce_290( val, _values, result ) 3087 3185 result = Range.new(1,1) … … 3090 3188 .,., 3091 3189 3092 module_eval <<'.,.,', 'lib/parser.y', 8 143190 module_eval <<'.,.,', 'lib/parser.y', 880 3093 3191 def _reduce_291( val, _values, result ) 3094 3192 result = val[3] … … 3097 3195 .,., 3098 3196 3099 module_eval <<'.,.,', 'lib/parser.y', 8 243197 module_eval <<'.,.,', 'lib/parser.y', 890 3100 3198 def _reduce_292( val, _values, result ) 3101 3199 begin … … 3109 3207 .,., 3110 3208 3111 module_eval <<'.,.,', 'lib/parser.y', 8343209 module_eval <<'.,.,', 'lib/parser.y', 900 3112 3210 def _reduce_293( val, _values, result ) 3113 3211 begin … … 3122 3220 .,., 3123 3221 3124 module_eval <<'.,.,', 'lib/parser.y', 8393222 module_eval <<'.,.,', 'lib/parser.y', 905 3125 3223 def _reduce_294( val, _values, result ) 3126 3224 result = OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY.new … … 3151 3249 # reduce 305 omitted 3152 3250 3153 # reduce 306 omitted 3251 module_eval <<'.,.,', 'lib/parser.y', 924 3252 def _reduce_306( val, _values, result ) 3253 result = val[3] 3254 result 3255 end 3256 .,., 3154 3257 3155 3258 # reduce 307 omitted … … 3245 3348 # reduce 352 omitted 3246 3349 3247 module_eval <<'.,.,', 'lib/parser.y', 9 253350 module_eval <<'.,.,', 'lib/parser.y', 994 3248 3351 def _reduce_353( val, _values, result ) 3249 3352 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true) … … 3252 3355 .,., 3253 3356 3254 module_eval <<'.,.,', 'lib/parser.y', 9 293357 module_eval <<'.,.,', 'lib/parser.y', 998 3255 3358 def _reduce_354( val, _values, result ) 3256 3359 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false) … … 3259 3362 .,., 3260 3363 3261 module_eval <<'.,.,', 'lib/parser.y', 9333364 module_eval <<'.,.,', 'lib/parser.y', 1002 3262 3365 def _reduce_355( val, _values, result ) 3263 3366 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false) … … 3266 3369 .,., 3267 3370 3268 module_eval <<'.,.,', 'lib/parser.y', 9373371 module_eval <<'.,.,', 'lib/parser.y', 1006 3269 3372 def _reduce_356( val, _values, result ) 3270 3373 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true) … … 3273 3376 .,., 3274 3377 3275 module_eval <<'.,.,', 'lib/parser.y', 9423378 module_eval <<'.,.,', 'lib/parser.y', 1011 3276 3379 def _reduce_357( val, _values, result ) 3277 3380 result = val[0] … … 3280 3383 .,., 3281 3384 3282 module_eval <<'.,.,', 'lib/parser.y', 9463385 module_eval <<'.,.,', 'lib/parser.y', 1015 3283 3386 def _reduce_358( val, _values, result ) 3284 3387 raise 'Not implemented yet' … … 3287 3390 .,., 3288 3391 3289 module_eval <<'.,.,', 'lib/parser.y', 9503392 module_eval <<'.,.,', 'lib/parser.y', 1019 3290 3393 def _reduce_359( val, _values, result ) 3291 3394 raise 'Not implemented yet' … … 3304 3407 # reduce 364 omitted 3305 3408 3306 module_eval <<'.,.,', 'lib/parser.y', 9633409 module_eval <<'.,.,', 'lib/parser.y', 1032 3307 3410 def _reduce_365( val, _values, result ) 3308 3411 @in_interval = false … … 3328 3431 # reduce 373 omitted 3329 3432 3330 module_eval <<'.,.,', 'lib/parser.y', 9853433 module_eval <<'.,.,', 'lib/parser.y', 1054 3331 3434 def _reduce_374( val, _values, result ) 3332 3435 @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}") -
ruby/trunk/adl_parser/lib/parser.y
r22 r23 106 106 { 107 107 assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT)} 108 108 @@log.info("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}") 109 109 result = val[0] 110 110 } 111 111 | assertions 112 { 113 result = val[0] 114 } 112 115 # | error 113 116 … … 115 118 c_complex_object: c_complex_object_head SYM_MATCHES START_REGEXP_BLOCK REGEXP_BODY END_REGEXP_BLOCK # added by akimichi 116 119 { 117 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new 120 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object| 121 c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref] 122 c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier] 123 c_complex_object.occurrences = val[0][:c_occurrences] 124 end 118 125 } 119 126 | c_complex_object_head SYM_MATCHES SYM_START_CBLOCK c_complex_object_body SYM_END_CBLOCK 120 127 { 121 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new( 122 :assumed_value => val[0], 123 :attributes => val[2] 124 ) 128 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object| 129 c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref] 130 c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier] 131 c_complex_object.occurrences = val[0][:c_occurrences] 132 end 125 133 } 126 134 # | c_complex_object_head error SYM_END_CBLOCK … … 128 136 129 137 c_complex_object_head: c_complex_object_id c_occurrences 138 { 139 result = {:c_complex_object_id => val[0], :c_occurrences => val[1]} 140 } 130 141 131 142 c_complex_object_id: type_identifier 132 143 { 133 result = val[0]144 result = {:type_identifier => val[0]} 134 145 } 135 146 | type_identifier V_LOCAL_TERM_CODE_REF 136 147 { 137 result = {: c_complex_object_id => {:type_identifier => val[0], :V_LOCAL_TERM_CODE_REF => val[1]}}148 result = {:type_identifier => val[0], :local_term_code_ref => val[1]} 138 149 } 139 150 … … 191 202 192 203 v_c_domain_type: START_V_C_DOMAIN_TYPE_BLOCK dadl_section END_V_C_DOMAIN_TYPE_BLOCK 204 { 205 result = val[1] 206 } 193 207 194 208 # 'archetype_internal_ref' is a node that refers to a previously defined object node in the same archetype. … … 348 362 arch_ontology: SYM_ONTOLOGY dadl_section 349 363 { 364 dadl_sections = val[1] 350 365 result = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new 351 366 } … … 361 376 362 377 attr_vals: attr_val 378 { 379 result = Array[val[0]] 380 } 363 381 | attr_vals attr_val 382 { 383 result = (val[0] << val[1]) 384 } 364 385 | attr_vals Semicolon_code attr_val 365 # | attr_vals ';' attr_val 386 { 387 result = (val[0] << val[2]) 388 } 366 389 367 390 attr_val: attr_id SYM_EQ object_block 368 391 { 369 392 @@log.info("#{__FILE__}:#{__LINE__}: attr_id = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}") 393 result = {:attr_id => val[0], :object_block => val[2]} 370 394 } 371 395 … … 397 421 multiple_attr_object_block: untyped_multiple_attr_object_block 398 422 { 399 result = val[0]423 result = {:untyped_multiple_attr_object_block => val[0]} 400 424 } 401 425 | type_identifier untyped_multiple_attr_object_block 402 426 { 403 result = val[0]427 result = {:type_identifier => val[0], :untyped_multiple_attr_object_block => val[1]} 404 428 } 405 429 406 430 untyped_multiple_attr_object_block: multiple_attr_object_block_head keyed_objects SYM_END_DBLOCK 407 431 { 408 result = val[0]432 result = {:multiple_attr_object_block_head => val[0], :keyed_objects => val[1]} 409 433 } 410 434 … … 416 440 417 441 keyed_objects: keyed_object 442 { 443 result = Array[val[0]] 444 } 418 445 | keyed_objects keyed_object 446 { 447 result = (val[0] << val[1]) 448 } 419 449 420 450 keyed_object: object_key SYM_EQ object_block 421 451 { 422 452 @@log.info("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}") 453 result = {:object_key => val[0], :object_block => val[1]} 423 454 } 424 455 … … 430 461 431 462 single_attr_object_block: untyped_single_attr_object_block 463 { 464 result = {:untyped_single_attr_object_block => val[0]} 465 } 432 466 | type_identifier untyped_single_attr_object_block 467 { 468 result = {:type_identifier => val[0], :untyped_single_attr_object_block => val[1]} 469 } 470 433 471 untyped_single_attr_object_block: single_attr_object_complex_head SYM_END_DBLOCK # <> 434 472 { 435 473 @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}") 436 result = val[0]474 result = {:single_attr_object_complex_head => val[0]} 437 475 } 438 476 | single_attr_object_complex_head attr_vals SYM_END_DBLOCK 439 477 { 440 478 @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]}, attr_vals = #{val[1]} at #{@filename}:#{@lineno}") 441 result = val[0]479 result = {:single_attr_object_complex_head => val[0], :attr_vals => val[1]} 442 480 } 443 481 single_attr_object_complex_head: SYM_START_DBLOCK … … 445 483 { 446 484 @@log.info("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}") 447 result = val[0]485 result = {:untyped_primitive_object_block => val[0]} 448 486 } 449 487 | type_identifier untyped_primitive_object_block 450 488 { 451 489 @@log.info("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}") 452 result = val[0]490 result = {:type_identifier => val[0], :untyped_primitive_object_block => val[1]} 453 491 } 454 492 untyped_primitive_object_block: SYM_START_DBLOCK primitive_object_value SYM_END_DBLOCK … … 611 649 612 650 real_value: V_REAL 651 { 652 begin 653 real = Float(val[0]) 654 rescue 655 raise 656 end 657 result = real 658 } 613 659 | Plus_code V_REAL 660 { 661 begin 662 real = Float(val[0]) 663 rescue 664 raise 665 end 666 result = real 667 } 614 668 | Minus_code V_REAL 615 # | '+' V_REAL 616 # | '-' V_REAL 669 { 670 begin 671 real = Float(val[0]) 672 rescue 673 raise 674 end 675 result = - real 676 } 617 677 618 678 real_list_value: real_value Comma_code real_value … … 632 692 633 693 boolean_value: SYM_TRUE 694 { 695 result = true 696 } 634 697 | SYM_FALSE 698 { 699 result = false 700 } 635 701 636 702 boolean_list_value: boolean_value Comma_code boolean_value … … 854 920 c_occurrences: #-- default to 1..1 855 921 | SYM_OCCURRENCES SYM_MATCHES SYM_START_CBLOCK occurrence_spec SYM_END_CBLOCK 922 { 923 result = val[3] 924 } 856 925 | SYM_OCCURRENCES error 857 926 -
ruby/trunk/adl_parser/tests/parser_test.rb
r22 r23 18 18 assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, result.description 19 19 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, result.definition 20 # assert_equal '', result.definition 20 21 end 21 22 -
ruby/trunk/models/Rakefile
r21 r23 48 48 # s.require_paths += [".","am","rm"] 49 49 s.require_path = "." 50 #s.has_rdoc = true50 s.has_rdoc = true 51 51 # s.extra_rdoc_files = ["README"] 52 52 end -
ruby/trunk/models/am.rb
r21 r23 27 27 module Constraint_Model 28 28 autoload :ARCHETYPE_CONSTRAINT, "am/archetype/constraint_model/archetype_constraint.rb" 29 autoload :Assertion, "am/archetype/constraint_model/assertion.rb"30 29 autoload :Primitive, "am/archetype/constraint_model/primitive.rb" 31 30 end #end of ConstraintModel 31 32 module Assertion 33 autoload :ASSERTION, "am/archetype/constraint_model/assertion.rb" 34 end 35 32 36 end # of Archetype 37 38 module OpenEHR_Profile 39 module Data_Types 40 module Basic 41 autoload :C_DV_STATE, "am/openehr_profile/data_types/basic.rb" 42 end 43 44 module Text 45 autoload :C_CODE_PHASE, "am/openehr_profile/data_types/text.rb" 46 end 47 48 module Quantity 49 autoload :C_DV_QUANTITY, "am/openehr_profile/data_types/quantity.rb" 50 autoload :C_DV_ORDINAL, "am/openehr_profile/data_types/quantity.rb" 51 autoload :C_QUANTITY_ITEM, "am/openehr_profile/data_types/quantity.rb" 52 end 53 end 54 end 33 55 end # of AM 34 56 end # of OpenEHR -
ruby/trunk/models/am/archetype/archetype.rb
r21 r23 77 77 def version 78 78 end 79 end 79 end # end of ARCHETYPE 80 80 # original file: 81 81 # ref_imple_eiffel/components/adl_parser/src/interface/adl_definition.e 82 end # end of Archetype 82 83 class VALIDITY_KIND 84 end 85 end 86 87 83 88 end # end of AM 84 89 end # end of OpenEHR -
ruby/trunk/models/am/archetype/archetype_description/archetype_description.rb
r21 r23 11 11 end 12 12 13 class A rchetype_Description_Item13 class ARCHETYPE_DESCRIPTION_ITEM 14 14 attr_accessor :archetype_package_uri, :lifecycle_state, :original_author, :other_contributors, :other_details 15 15 end -
ruby/trunk/models/am/archetype/constraint_model/archetype_constraint.rb
r21 r23 8 8 end 9 9 10 class C _OBJECT < ARCHETYPE_CONSTRAINT10 class CARDINALITY 11 11 12 12 end 13 13 14 class C_OBJECT < ARCHETYPE_CONSTRAINT 15 attr_accessor :node_id, :occurrences, :rm_type_name 16 17 def initialize(args = { }) 18 @node_id = args[:node_id] if args[:node_id] 19 @occurrences = args[:occurrences] if args[:occurrences] 20 @rm_type_name = args[:rm_type_name] if args[:rm_type_name] 21 end 22 end 23 14 24 class C_ATTRIBUTE < ARCHETYPE_CONSTRAINT 15 25 attr_accessor :rm_attribute_name, :existence, :children 26 27 def initialize(args = { }) 28 @rm_attribute_name = args[:rm_attribute_name] if args[:rm_attribute_name] 29 @existence = args[:existence] if args[:existence] 30 @children = args[:children] ? args[:children] : [] 31 32 end 16 33 end 17 34 18 35 class C_DEFINED_OBJECT < C_OBJECT 36 attr_accessor :assumed_value 19 37 38 def initialize(args = { }) 39 @assumed_value = args[:assumed_value] if args[:assumed_value] 40 super 41 end 20 42 end 21 43 22 44 class C_PRIMITIVE_OBJECT < C_DEFINED_OBJECT 45 attr_accessor :item 23 46 47 def initialize(args = { }) 48 @attributes = args[:item] if args[:item] 49 super 50 end 24 51 end 25 52 … … 27 54 attr_accessor :attributes, :attributes_valid 28 55 56 def initialize(args = { }) 57 @attributes = args[:attributes] ? args[:attributes] : [] 58 super 59 end 60 61 def self.create(args = { }, &block) 62 c_complex_object = new(args) 63 if block_given? 64 yield c_complex_object 65 end 66 return c_complex_object 67 end 29 68 end 30 69 … … 49 88 end 50 89 90 class C_SINGLE_ATTRIBUTE < C_ATTRIBUTE 91 attr_accessor :alternatives 92 93 def initialize(args = { }) 94 @alternatives = args[:alternatives] ? args[:alternatives] : [] 95 super 96 end 97 end 98 99 class C_MULTIPLE_ATTRIBUTE < C_ATTRIBUTE 100 attr_accessor :members, :cardinality 101 102 def initialize(args = { }) 103 @members = args[:members] ? args[:members] : [] 104 @cardinality = args[:cardinality] if args[:cardinality] 105 super 106 end 107 end 51 108 end 52 109 end -
ruby/trunk/models/am/archetype/constraint_model/assertion.rb
r4 r23 2 2 module AM 3 3 module Archetype 4 module Constraint_Model 5 module Assertion 6 class Assertion 7 end 4 module Assertion 5 class ASSERTION 6 end 7 8 class ASSERTION_VARIABLE 9 end 10 11 class OPERATOR_KIND 12 end 13 14 class EXPR_ITEM 15 end 16 17 class EXPR_LEAF < EXPR_ITEM 18 end 19 20 class EXPR_OPERATOR < EXPR_ITEM 21 end 22 23 class EXPR_UNARY_OPERATOR < EXPR_OPERATOR 24 end 25 26 class EXPR_BINARY_OPERATOR < EXPR_OPERATOR 8 27 end 9 28 end -
ruby/trunk/models/am/archetype/constraint_model/primitive.rb
r21 r23 6 6 module Primitive 7 7 8 class C_P rimitive8 class C_PRIMITIVE 9 9 def assumed_value 10 10 raise NotImplementedError, "assumed_value should be implemented" … … 21 21 end 22 22 23 class C_Boolean < C_Primitive 24 attr_accessor :assumed_value 25 def initialize(true_valid, false_valid, assumed_value) 26 binary_consistency(true_valid, false_valid) 27 @true_valid = true_valid 28 @false_valid = false_valid 29 @assumed_value = assumed_value 23 class C_BOOLEAN < C_PRIMITIVE 24 attr_reader :true_valid, :false_valid, :assumed_value 25 26 def initialize(args = { }) 27 @true_valid = args[:true_valid] ? args[:true_valid] : false 28 @false_valid = args[:false_valid] ? args[:false_valid] : false 29 @assumed_value = args[:assumed_value] ? args[:assumed_value] : false 30 binary_consistency(@true_valid, @false_valid) 30 31 end 31 def set_true_valid(true_valid) 32 33 def true_valid=(true_valid) 32 34 binary_consistency(true_valid, @false_valid) 33 35 @true_valid = true_valid 34 36 end 35 def set_false_valid(false_valid) 37 38 def false_valid=(false_valid) 36 39 binary_consistency(@true_valid,false_valid) 37 40 @false_valid = false_valid 38 41 end 39 def true_valid? 40 @true_valid 41 end 42 def false_valid? 43 @false_valid 44 end 42 45 43 def valid_value? 46 44 47 45 end 48 def default_value(a_value=nil) 46 47 def default_value(a_value = nil) 49 48 if a_value == nil 50 49 @true_valid … … 63 62 end # of C_Boolean 64 63 65 class C_ Integer < C_Primitive64 class C_STRING < C_PRIMITIVE 66 65 67 66 end 67 68 class C_INTEGER < C_PRIMITIVE 69 70 end 71 72 class C_REAL < C_PRIMITIVE 73 74 end 75 76 class C_TIME < C_PRIMITIVE 77 78 end 79 80 class C_DATE < C_PRIMITIVE 81 82 end 83 84 class C_DATE_TIME < C_PRIMITIVE 85 86 end 87 88 class C_DURATION < C_PRIMITIVE 89 90 end 91 92 93 68 94 end # of Primitive 69 95 end # of Constraint_Model -
ruby/trunk/models/am/archetype/ontology.rb
r4 r23 3 3 module Archetype 4 4 module Ontology 5 class A rchetype_Ontology5 class ARCHETYPE_ONTOLOGY 6 6 attr_accessor :constraint_codes, :specialisation_depth 7 7 attr_accessor :term_attribute_names, :term_codes 8 8 attr_accessor :terminologies_available 9 9 10 def constraint_binding(a_terminology, a_code) 10 11 end 12 11 13 def constraint_definition(a_lang, a_code) 12 14 end 15 13 16 def has_language?(a_lang) 14 17 end 18 15 19 def has_terminology?(a_terminology) 16 20 end 21 17 22 def term_binding(a_terminology, a_code) 18 23 end 24 19 25 def term_definition(a_lang, a_code) 20 26 end 21 27 end 22 class Archetype_Term 28 29 class ARCHETYPE_TERM 23 30 attr_accessor :code, :items 24 def initialize(code, items) 25 if code == nil 26 raise ArgumentError, "Code is empty" 27 end 28 if items.keys == nil 29 raise ArgumentError, "Items is empty" 30 end 31 @code = code 32 @items = items 31 32 def initialize(args = { }) 33 34 @code = if args[:code] 35 args[:code] 36 else 37 raise ArgumentError, "Code is empty" 38 end 39 @items = if args[:items] 40 args[:items] 41 else 42 raise ArgumentError, "Items is empty" 43 end 33 44 end 45 34 46 def keys 35 items.keys47 @items.keys 36 48 end 37 49 end -
ruby/trunk/models/am/openehr_profile/data_types/basic.rb
r4 r23 1 1 module OpenEHR 2 module RM2 module AM 3 3 module OpenEHR_Profile 4 4 module Data_Types 5 module Basic 6 class C_DV_STATE 7 end 8 9 class STATE_MACHINE 10 end 11 12 class STATE 13 end 14 15 class TERMINAL_STATE < STATE 16 end 17 18 class NON_TERMINAL_STATE < STATE 19 end 20 21 class TRANSITION 22 end 23 end 24 25 5 26 end # of Data_Types 6 27 end # of OpenEHR Profile -
ruby/trunk/models/tests/test_archetype_model.rb
r21 r23 5 5 class ArchetypeModelTest < Test::Unit::TestCase 6 6 def setup 7 @archetype = OpenEHR::AM::Archetype::ARCHETYPE.new #(nil,nil,nil,nil,nil,nil,nil,nil) 7 @archetype = OpenEHR::AM::Archetype::ARCHETYPE.new 8 @validity_kind = OpenEHR::AM::Archetype::VALIDITY_KIND.new 9 8 10 @archetype_description = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION.new 11 @archetype_description_item = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION_ITEM.new 12 end 13 14 def test_init 15 assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype 16 assert_instance_of OpenEHR::AM::Archetype::VALIDITY_KIND, @validity_kind 17 assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, @archetype_description 18 assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION_ITEM, @archetype_description_item 19 assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype 20 end 21 end 22 23 class ArchetypeModelConstraintTest < Test::Unit::TestCase 24 def setup 9 25 @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new 10 @assertion = OpenEHR::AM::Archetype::Constraint_Model::Assertion::Assertion.new 11 @c_primitive = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Primitive.new 12 @c_boolean = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean.new(true, true, true) 13 @c_integer = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Integer.new 14 @archetype_ontology = OpenEHR::AM::Archetype::Ontology::Archetype_Ontology.new 15 26 @cardinality = OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY.new 27 16 28 @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new 17 29 @c_object = OpenEHR::AM::Archetype::Constraint_Model::C_OBJECT.new 18 30 @c_defined_object = OpenEHR::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT.new 19 31 @c_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE.new 32 @c_single_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE.new 33 @c_multiple_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE.new(:rm_attribute_name => 'attribute_name', :cardinality => @cardinality) 20 34 @c_primitive_object = OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT.new 21 35 @c_reference_object = OpenEHR::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT.new … … 24 38 @constraint_ref = OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF.new 25 39 @c_domain_type = OpenEHR::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE.new 26 @c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new 40 @c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(:attributes => [@c_single_attribute]) 27 41 end 28 42 29 43 def test_init 30 assert_instance_of OpenEHR::AM::Archetype::Ontology::Archetype_Ontology, @archetype_ontology31 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint32 assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, @archetype_description33 assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype34 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Assertion::Assertion, @assertion35 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Primitive, @c_primitive36 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean, @c_boolean37 44 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint 38 45 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_OBJECT, @c_object 39 46 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT, @c_defined_object 40 47 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE, @c_attribute 48 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE, @c_single_attribute 49 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE, @c_multiple_attribute 50 assert_equal 'attribute_name', @c_multiple_attribute.rm_attribute_name 51 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY, @c_multiple_attribute.cardinality 41 52 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT, @c_primitive_object 42 53 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT, @c_reference_object … … 46 57 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE, @c_domain_type 47 58 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, @c_complex_object 59 assert_instance_of Array, @c_complex_object.attributes 60 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint 61 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY, @cardinality 62 end 63 64 def test_create 65 c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:node_id => 'test_node', 66 :attributes => [1,2], 67 :assumed_value => Array 68 ) 69 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, c_complex_object 70 assert_equal 'test_node', c_complex_object.node_id 71 end 72 end 73 74 class ArchetypeModelPrimitiveTest < Test::Unit::TestCase 75 def setup 76 @c_primitive = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE.new 77 @c_boolean = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true, 78 :false_valid => true, 79 :assumed_value => true) 80 @c_string = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_STRING.new 81 @c_integer = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.new 82 @c_real = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_REAL.new 83 @c_time = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_TIME.new 84 @c_date = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE.new 85 @c_date_time = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME.new 86 @c_duration = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DURATION.new 87 end 88 89 def test_init 90 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE, @c_primitive 91 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN, @c_boolean 92 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_STRING, @c_string 93 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER, @c_integer 94 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_REAL, @c_real 95 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_TIME, @c_time 96 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE, @c_date 97 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME, @c_date_time 98 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DURATION, @c_duration 48 99 end 49 100 50 101 def test_primitive 51 assert @c_boolean.true_valid ?52 assert @c_boolean.false_valid ?102 assert @c_boolean.true_valid 103 assert @c_boolean.false_valid 53 104 assert @c_boolean.assumed_value 54 105 assert @c_boolean.has_assumed_value? 55 106 assert @c_boolean.default_value 56 107 assert @c_boolean.default_value(true) 57 assert_raise(ArgumentError) {@c_boolean.set_true_valid(false); @c_boolean.set_false_valid(false)} 58 assert_raise(ArgumentError) {OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean.new(false,false,false)} 108 assert_raise(ArgumentError) do 109 @c_boolean.true_valid = false 110 @c_boolean.false_valid = false 111 end 112 assert_raise(ArgumentError) do 113 OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid =>false, 114 :false_valid => false, 115 :assumed_value => false) 116 end 117 end 118 119 end 120 121 class ArchetypeModelOntologyTest < Test::Unit::TestCase 122 def setup 123 @archetype_ontology = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new 124 @archetype_term = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_TERM.new(:code => '', :items => '') 125 end 126 127 def test_init 128 assert_instance_of OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY, @archetype_ontology 129 assert_instance_of OpenEHR::AM::Archetype::Ontology::ARCHETYPE_TERM, @archetype_term 130 end 131 end 132 133 class ArchetypeModelAssertionTest < Test::Unit::TestCase 134 def setup 135 @assertion = OpenEHR::AM::Archetype::Assertion::ASSERTION.new 136 @assertion_variable = OpenEHR::AM::Archetype::Assertion::ASSERTION_VARIABLE.new 137 @operator_kind = OpenEHR::AM::Archetype::Assertion::OPERATOR_KIND.new 138 @expr_item = OpenEHR::AM::Archetype::Assertion::EXPR_ITEM.new 139 @expr_leaf = OpenEHR::AM::Archetype::Assertion::EXPR_LEAF.new 140 @expr_operator = OpenEHR::AM::Archetype::Assertion::EXPR_OPERATOR.new 141 @expr_unary_operator = OpenEHR::AM::Archetype::Assertion::EXPR_UNARY_OPERATOR.new 142 @expr_binary_operator = OpenEHR::AM::Archetype::Assertion::EXPR_BINARY_OPERATOR.new 143 end 144 145 def test_init 146 assert_instance_of OpenEHR::AM::Archetype::Assertion::ASSERTION, @assertion 147 assert_instance_of OpenEHR::AM::Archetype::Assertion::ASSERTION_VARIABLE, @assertion_variable 148 assert_instance_of OpenEHR::AM::Archetype::Assertion::OPERATOR_KIND, @operator_kind 149 assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_ITEM, @expr_item 150 assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_LEAF, @expr_leaf 151 assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_OPERATOR, @expr_operator 152 assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_UNARY_OPERATOR, @expr_unary_operator 153 assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_BINARY_OPERATOR, @expr_binary_operator 59 154 end 60 155 end 61 156 157 class ArchetypeModelProfileTest < Test::Unit::TestCase 158 def setup 159 @c_dv_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::C_DV_STATE.new 160 @state_machine = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE_MACHINE.new 161 @state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE.new 162 @terminal_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TERMINAL_STATE.new 163 @non_terminal_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::NON_TERMINAL_STATE.new 164 @transition = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TRANSITION.new 165 166 @c_code_phase = OpenEHR::AM::OpenEHR_Profile::Data_Types::Text::C_CODE_PHASE.new 167 168 @c_dv_quantity = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_QUANTITY.new 169 @c_dv_ordinal = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_ORDINAL.new 170 @c_quantity_item = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_QUANTITY_ITEM.new 171 end 172 173 def test_init 174 assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::C_DV_STATE, @c_dv_state 175 assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE_MACHINE, @state_machine 176 assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE, @state 177 assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TERMINAL_STATE, @terminal_state 178 assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::NON_TERMINAL_STATE, @non_terminal_state 179 assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TRANSITION, @transition 180 assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Text::C_CODE_PHASE, @c_code_phase 181 assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_QUANTITY, @c_dv_quantity 182 assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_ORDINAL, @c_dv_ordinal 183 assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_QUANTITY_ITEM, @c_quantity_item 184 end 185 end
Note:
See TracChangeset
for help on using the changeset viewer.