Rule = TruthStatement / Clause Clause = (ClauseFinding / ClauseObservable) [ ws ANDOP ws (ClauseFinding / ClauseObservable) ] ws TruthStatement = ws 1*1("true" / "otherwise true") ws ;;; A Rule is either a truth statement or a clause ;;; A truth statement is either "true" or "otherwise true" ;;; A clause is either a clause with a finding or a clause with an observable ;;; and value optionally followed by the AND operator and a clause with a finding or observable and value. ClauseObservable = "IFA" ws ( AttributeObservable ws NumericOperator ws Value ) ;;; Observable clause has a mandatory value ClauseFinding = "IFA" ws ( AttributeFinding ) ;;; AttributeObservable = ConceptObservable ;;; This could be removed and AttributeObservable changed to ;;; ConceptObservable without affecting the grammar AttributeFinding = ConceptFinding ;;; This could be removed and AttributeFinding changed to ;;; ConceptFinding without affecting the grammar NumericOperator = ("<" / ">=") ;;;Age at onset rules use greaterthanorequals for lower bounds and lessthan for upper bound Value = ConceptAny / Numeric / OtherText ;;; Added in ConceptAny, which allows any Concept to be used as a Value, ;;; although clearly not all concepts are suitable ConceptObservable = SctId ws pipe ws FullySpecifiedNameObservable ws pipe ConceptFinding = SctId ws pipe ws FullySpecifiedNameFinding ws pipe ConceptAny = SctId ws pipe ws FullySpecifiedName ws pipe SctId = 6*18( digit ) ;;; The SctId must be a valid SNOMED CT Concept.id value FullySpecifiedNameObservable = 1*nonwsnonpipe *( ( 1*SP "(" *SP 1*nonwsnonparennonpipe *SP ")" !( ws pipe ) ) / ( 1*SP 1*nonwsnonparennonpipe !( ws pipe ) ) ) *SP 1*1( "(observable entity)" ) ;;; The FSN of an observable must have a semantic tag = "observable entity" ;;; and may contain other embedded parenthesised strings. The ! (NOT) ;;; look-ahead operator serves to prevent the parser consuming the ;;; semantic tag when it's looking for words before the tag.
FullySpecifiedNameFinding = 1*nonwsnonpipe *( ( 1*SP "(" *SP 1*nonwsnonparennonpipe *SP ")" !( ws pipe ) ) / ( 1*SP 1*nonwsnonparennonpipe !( ws pipe ) ) ) *SP 1*1( "(finding)" / "(disorder)" ) ;;; The FSN of a finding must have a semantic tag = "disorder" or ;;; "finding" and may contain other embedded parenthesised strings. ;;; The ! (NOT) look-ahead operator serves to prevent the parser consuming ;;; the semantic tag when it's looking for words before the tag. FullySpecifiedName = 1*nonwsnonpipe *( ( 1*SP "(" *SP 1*nonwsnonparennonpipe *SP ")" !( ws pipe ) ) / ( 1*SP 1*nonwsnonparennonpipe !( ws pipe ) ) ) *SP 1*1( "(" SemanticTag ")" ) ;;; Any FSN must have a semantic tag and may contain other embedded ;;; parenthesised strings. The ! (NOT) look-ahead operator serves to ;;; prevent the parser consuming the semantic tag when it's looking for ;;; words before the tag. Numeric = 1*(digit) !( *ws /OtherText ) OtherText = 1*(nonwsnonsemicolonnonpipe) *( 1*SP 1*nonwsnonsemicolonnonpipe ) ;;; OtherText is used in Value and may not contain a semicolon because ;;; semicolon is the AND operator and follows a Value. Note that FSNs in ;;; Values may containg semicolons. SemanticTag = 1*(nonwsnonparennonpipe) *( 1*SP 1*nonwsnonparennonpipe ) ;;; A Semantic Tag may consist of words separated by whitespace, but may contain whitespace. digit = %x30-39 ws = *( SP / HTAB / CR / LF ) SP = %x20 HTAB = %x09 CR = %x0D LF = %x0A pipe = %x7C nonwsnonparennonpipe = %x21-27 / %x2A-7B / %x7D-7E / UTF8-2 / UTF8-3 / UTF8-4 ; no parentheses nonwsnonsemicolonnonpipe = %x21-3A / %x3C-7B / %x7D-7E / UTF8-2 / UTF8-3 / UTF8-4 ; no parentheses nonwsnonpipe = %x28-29 / nonwsnonparennonpipe ANDOP = "AND" ; UTF8-2 = %xC2-DF UTF8-tail UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) / %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail ) UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) / %xF4 %x80-8F 2( UTF8-tail ) UTF8-tail = %x80-BF
Versão traduzida:
Rule = TruthStatement / Clause Clause = (ClauseFinding / ClauseObservable) [ ws ANDOP ws (ClauseFinding / ClauseObservable) ] ws TruthStatement = ws 1*1("true" / "otherwise true") ws ;;; Uma regra é uma afirmação verdadeira ou uma cláusula ;;; Uma afirmação verdadeira é "verdadeira" ou "de outra forma verdadeira" ;;; Uma cláusula pode ser uma cláusula com um achado ou uma cláusula com um observável ;;; e valor opcionalmente seguido pelo operador E e uma cláusula com um achado ou observável e valor. ClauseObservable = "IFA" ws ( AttributeObservable ws NumericOperator ws Value ) ;;; Cláusula observável tem um valor mandatório ClauseFinding = "IFA" ws ( AttributeFinding ) ;;; AttributeObservable = ConceptObservable ;;; Esse pode ser removido e AttributeObservable mudado para ;;; ConceptObservable sem afetar a gramática AttributeFinding = ConceptFinding ;;; Este pode ser removido e AttributeFinding mudado para ;;; ConceptFinding sem afetar a gramática NumericOperator = ("<" / ">=") ;;;Regras de idade no surgimento são maior ou igual para limites inferiores e menorque para limites superiores Value = ConceptAny / Numeric / OtherText ;;; Adicionado em ConceptAny, que permite que qualquer conceito seja usado como um valor, ;;; embora claramente nem todos os conceitos sejam adequados ConceptObservable = SctId ws pipe ws FullySpecifiedNameObservable ws pipe ConceptFinding = SctId ws pipe ws FullySpecifiedNameFinding ws pipe ConceptAny = SctId ws pipe ws FullySpecifiedName ws pipe SctId = 6*18( digit ) ;;; A SctId precisa ser um conceito válido do SNOMED CT.id value FullySpecifiedNameObservable = 1*nonwsnonpipe *( ( 1*SP "(" *SP 1*nonwsnonparennonpipe *SP ")" !( ws pipe ) ) / ( 1*SP 1*nonwsnonparennonpipe !( ws pipe ) ) ) *SP 1*1( "(observable entity)" ) ;;; O FSN de um observável tem que ter uma etiqueta semântica = "observable entity" ;;; e pode conter outra série de parênteses incorporados. O operador look-ahead ! (NOT) ;;; serve para impedir que o interpretador consuma a ;;; etiqueta semântica quando ele estiver procurando por palavras antes da etiqueta.
FullySpecifiedNameFinding = 1*nonwsnonpipe *( ( 1*SP "(" *SP 1*nonwsnonparennonpipe *SP ")" !( ws pipe ) ) / ( 1*SP 1*nonwsnonparennonpipe !( ws pipe ) ) ) *SP 1*1( "(finding)" / "(disorder)" ) ;;; O FSN de um achado deve ter uma etiqueta semântica = "disorder" ou ;;; "finding" e pode conter outra série de parênteses incorporados. ;;; O operador look-ahead ! (NOT) serve para impedir que o interpretador consuma ;;; a etiqueta semântica quando ele estiver procurando por palavras antes da etiqueta. FullySpecifiedName = 1*nonwsnonpipe *( ( 1*SP "(" *SP 1*nonwsnonparennonpipe *SP ")" !( ws pipe ) ) / ( 1*SP 1*nonwsnonparennonpipe !( ws pipe ) ) ) *SP 1*1( "(" SemanticTag ")" ) ;;; Qualquer FSN precisa ter uma etiqueta semântica e pode conter outra ;;; série de parênteses incorporados. O operador look-ahead ! (NOT) serve para ;;; impedir que o interpretador consuma a etiqueta semântica quando ele estiver procurando por ;;; palavras antes da etiqueta. Numeric = 1*(digit) !( *ws /OtherText ) OtherText = 1*(nonwsnonsemicolonnonpipe) *( 1*SP 1*nonwsnonsemicolonnonpipe ) ;;; OtherText é usado em Valor e não pode conter ponto-e-vírgula porque ;;; ponto-e-vírgula é operador E segue um Valor. Note que os FSNs em ;;; Valores podem conter ponto-e-vírgula. SemanticTag = 1*(nonwsnonparennonpipe) *( 1*SP 1*nonwsnonparennonpipe ) ;;; Uma etiqueta semântica pode consistir de palavras separadas por espaço, mas pode conter espaço. digit = %x30-39 ws = *( SP / HTAB / CR / LF ) SP = %x20 HTAB = %x09 CR = %x0D LF = %x0A pipe = %x7C nonwsnonparennonpipe = %x21-27 / %x2A-7B / %x7D-7E / UTF8-2 / UTF8-3 / UTF8-4 ; no parentheses nonwsnonsemicolonnonpipe = %x21-3A / %x3C-7B / %x7D-7E / UTF8-2 / UTF8-3 / UTF8-4 ; no parentheses nonwsnonpipe = %x28-29 / nonwsnonparennonpipe ANDOP = "AND" ; UTF8-2 = %xC2-DF UTF8-tail UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) / %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail ) UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) / %xF4 %x80-8F 2( UTF8-tail ) UTF8-tail = %x80-BF
Feedback