"Name" = 'Archetype Query Language (AQL) - {Equal}' "Version" = '0.6' "Date" = '21 Oct 2009' "Author" = 'Chunlan Ma & Heath Frankel' "About" = 'Ocean Informatics' ! Gramma Configuration "Case Sensitive" = 'False' "Start Symbol" = ! ============================================================================= ! Comments ! New features: ! 1. Support matches operator ! 2. Support string RegEx pattern criteria, e.g. ! WHERE composition/name matches {/lab.*/} ! FROM EHR CONTAINS COMPOSITION c[{/openEHR-EHR-COMPOSITION\.problem_list(-[a-zA-Z0-9_]+)*\.v1/}] ! 3. Allow parentheses in both FROM and WHERE clause ! 4. Support matches uri criteria. Uri criteria can be used to represent terminology criteria captured in a webservice call format. For example, ! SELECT problem ! FROM EHR e[ehr_id/value=$ehruid] CONTAINS (COMPOSITION c[openEHR-EHR-COMPOSITION.problem_list.v1] CONTAINS EVALUATION problem[openEHR-EHR-EVALUATION.problem-diagnosis.v1]) ! WHERE problem/data/items[at0002.1]/value/defining_code matches { terminology://Snomed-CT/hierarchy?rootConceptId=73211009 } ! 5. Support NOT and EXISTS in WHERE clause ! ============================================================================= Comment Start = '/*' Comment End = '*/' Comment Line = '!' ! Character Set Definitions {quote} = [''] {String Char} = {Printable} - ["] - {quote} {Hex Char} = {Digit} + [ABCDEF] {NonZeroDigit} = {Digit} - [0] {LetterMinusA} = {Letter} - [aA] {LetterMinusT} = {Letter} - [tT] !{AlphanumericMinusT} = {Alphanumeric} - [t] !{NonZeroAlphanumeric} = {Alphanumeric} - [0] {IdChar} = {Alphanumeric} + [_] - [.] ! not allowing a dot {IdCharMinusT} = {IdChar} - [tT] {UriString} = {Alphanumeric} + [_-/:.?&%$#@!+=* ] !{RegExChar} = {Alphanumeric} + [']'] + ['['] + [_-/:.?&%$#@!+=*() ] {RegExChar} = {Alphanumeric} + [_-/:.?&%$#|@!+=*()\\\^{}] + [']'] + ['['] ! Terminal Definitions !Identifier = {Letter}({Alphanumeric}|'_')* ! Conflicts with UID !Identifier = {Letter}{IdChar}* ! Conflicts with extended NodeId ! restricted to allow only letters after the 4th character due to conflict with extended NodeId !Identifier = {Letter}{IdChar}?{IdChar}?{IdChar}?({Letter}|'_')* !Conficts with NodeId which may have any length of digit, such as at0.9 Identifier = {LetterMinusA}{IdCharMinusT}?{IdChar}* | 'a''t'?(({letter}|'_')*|{LetterMinusT}{Alphanumeric}*) !PathItem = '/'{Letter}({Alphanumeric}|'_')* String = '"'{String Char}*'"' | ''{String Char}*'' Integer = {Digit}+ Float = {Digit}+'.'{Digit}+ Date = ''{Digit}{Digit}{Digit}{Digit}'-'{Digit}{Digit}'-'{Digit}{Digit}'' Boolean = 'true' | 'false' !NodeId = 'a''t'{Digit}{Digit}{Digit}{Digit} ! conflict with Identifier !NodeId = 'at'({Digit}{Digit}{Digit}{Digit}('.0'*('.'{NonZeroDigit}{Digit}*)+|('.'{NonZeroDigit}{Digit}*)*)|'0''.0'*('.'{NonZeroDigit}{Digit}*)+|('.'{NonZeroDigit}{Digit}*)+) NodeId = 'at'({Digit}+('.'{Digit}+)*) !Parameter = '$'{letter}({Alphanumeric}|'_')* Parameter = '$'{letter}{IdChar}* ! could constrain UID further UniqueId = {digit}+('.'{digit}+)+'.'{digit}+ ! OID | {Hex Char}+('-'{Hex Char}+)+ ! UUID ! could constrain ArchetypeId further !ArchetypeId = {Letter}+'-'{Letter}+'-'({Letter}|'_')+'.'({Letter}|'_'|'-')+'.v'{Digit}+('.'{Digit}+)? ! not allow a number in archetype id concept, such as openEHR-EHR-OBSERVATION.laboratory-hba1c.v1 ArchetypeId = {Letter}+'-'{Letter}+'-'({Letter}|'_')+'.'({IdChar}|'-')+'.v'{Digit}+('.'{Digit}+)? ComparableOperator = '=' | '!=' | '>' | '>=' | '<' | '<=' UriValue = {Letter}+'://'({UriString}|'['|']'|', '''|'')* |{Letter}+':'({UriString}|'['|']'|'')* RegExPattern = '{/'{RegExChar}+'/}' ! Rule Definitions ::= |