skoba / openehr-ruby

Ruby implementation of the openEHR specification
http://openehr.jp/projects/ref-impl-ruby/
Apache License 2.0
35 stars 12 forks source link

ADL Parser not working #25

Closed danfaiole closed 9 years ago

danfaiole commented 9 years ago

Hi, I'm trying to do an ADL repository in Ruby on Rails. Like the one openEHR has, but in Ruby, and not using flash for the mindmap section. I was trying to use your lib but it doesn't matter what i do i can't pass this error:

NameError: undefined local variable or method `_nt_SYM_IS_CONTROLED' for #<OpenEHR::Parser::ADLGrammarParser:0x000000086a6320>
        from (eval):522:in `_nt_arch_meta_data_item'
        from (eval):409:in `block in _nt_arch_meta_data_items'
        from (eval):398:in `loop'
        from (eval):398:in `_nt_arch_meta_data_items'
        from (eval):327:in `_nt_arch_meta_data'
        from (eval):259:in `_nt_arch_head'
        from (eval):197:in `_nt_arch_identification'
        from (eval):93:in `_nt_archetype'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/treetop-1.6.3/lib/treetop/runtime/compiled_parser.rb:18:in `parse'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/openehr-1.2.9999/lib/openehr/parser/adl_parser.rb:28:in `parsed_data'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/openehr-1.2.9999/lib/openehr/parser/adl_parser.rb:40:in `archetype_id'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/openehr-1.2.9999/lib/openehr/parser/adl_parser.rb:79:in `archetype'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/openehr-1.2.9999/lib/openehr/parser/adl_parser.rb:17:in `parse'
        from (irb):5
        from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/commands/console.rb:110:in `start'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/commands/console.rb:9:in `start'
... 9 levels...
        from /usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `block in load'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/commands/rails.rb:6:in `call'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/command_wrapper.rb:38:in `call'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:183:in `block in serve'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:156:in `fork'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:156:in `serve'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'

I tought maybe i was doing something wrong. I tried to go back to ruby 1.9.3, but the error keeps happening. I'd like to know if this lib accepts ISO13306 archetypes as well... i don't know a lot of ruby, but i can try to help. Regards!

skoba commented 9 years ago

OK, I will check it.

skoba commented 9 years ago

Could you give us the adl file? I have never tested with ISO 13606 archetype file.

danfaiole commented 9 years ago

I tested the lib with an archetype file i downloaded from openEHR - CKM. (This one: openEHR-EHR-CLUSTER.anatomical_location.v1)

The archetypes we will deal with are in the ISO13606 format, the repository we are using is this one: http://sres.saude.mg.gov.br/arquetipo/listar a direct example: http://sres.saude.mg.gov.br/upload/arquetipo/CEN-EN13606-COMPOSITION.Controle.v2.adl

Thanks for the attention, anything i can do to help

skoba commented 9 years ago

I proved that the current ADL parser raise parse error with CEN-EN13606 archetype. I am much sorry and writing some.

skoba commented 9 years ago

The dADL parser fails SYM_LIST_CONTINUE. mmm. need further investigation.

danfaiole commented 9 years ago

thanks, can i do anythig to help?

skoba commented 9 years ago

2 options. 1) remove "..." from your ADL files 2) correct adl_grammar.tt to pass your ADL files.

I can catch up this in the next week.

skoba commented 9 years ago

Finally fixed this bug(?). I still think ambiguous terminology set should not be assigned.