#[non_exhaustive]pub enum DiagnosticCode {
NotAViewDefinition,
UnknownKey,
MissingRequired,
WrongType,
EmptyRequired,
DuplicateColumnName,
MultipleIterationDirectives,
SelectWithoutOutput,
FhirPathSyntax,
UndeclaredConstant,
UnknownResourceType,
}Expand description
What kind of problem a Diagnostic reports. #[non_exhaustive]: this
is a POC rule set (see the module docs for what is deliberately out of
scope), and future work is expected to add codes, not just consumers
matching on the ones that exist today.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotAViewDefinition
The document is not {"resourceType": "ViewDefinition", ...}. When
this fires it is always the only diagnostic — nothing else about
the document can be meaningfully checked.
UnknownKey
A key this module’s model does not recognize for its node.
MissingRequired
A key the model marks required is absent.
WrongType
A key’s value is not the JSON type the model expects for it.
EmptyRequired
A required string is empty or all whitespace, or a required array is empty.
DuplicateColumnName
Two columns feeding the same output row share a name.
MultipleIterationDirectives
A select sets more than one of forEach, forEachOrNull, repeat
— the sql-expressions invariant validate_select_with_context
already enforces at run time; this is its structural, all-errors
counterpart.
SelectWithoutOutput
A select has none of column, select, unionAll — it can never
produce a column.
FhirPathSyntax
A FHIRPath expression does not parse.
#[serde(rename)] overrides the enum’s own kebab-case: serde’s
auto-casing splits on every capital, which would turn FhirPath
into fhir-path (two words) instead of the one word fhirpath the
wire contract (RF1’s own example, and the rest of this codebase’s
naming — helios-fhirpath, helios_fhirpath) uses everywhere else.
UndeclaredConstant
A FHIRPath expression parses, but references %name for a name
that is neither declared in constant[] nor a FHIRPath environment
variable the evaluator resolves. See the module docs for the exact
set of names this treats as declared.
UnknownResourceType
resource is a non-empty string that names no resource type of any
FHIR version compiled into this build ("Nope", or "patient" —
the comparison is case-sensitive, as FHIR resource type names are).
A missing, empty or non-string resource is MissingRequired /
EmptyRequired / WrongType instead, never this.
Trait Implementations§
Source§impl Clone for DiagnosticCode
impl Clone for DiagnosticCode
Source§fn clone(&self) -> DiagnosticCode
fn clone(&self) -> DiagnosticCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DiagnosticCode
Source§impl Debug for DiagnosticCode
impl Debug for DiagnosticCode
impl Eq for DiagnosticCode
Source§impl PartialEq for DiagnosticCode
impl PartialEq for DiagnosticCode
Source§impl Serialize for DiagnosticCode
impl Serialize for DiagnosticCode
impl StructuralPartialEq for DiagnosticCode
Auto Trait Implementations§
impl Freeze for DiagnosticCode
impl RefUnwindSafe for DiagnosticCode
impl Send for DiagnosticCode
impl Sync for DiagnosticCode
impl Unpin for DiagnosticCode
impl UnsafeUnpin for DiagnosticCode
impl UnwindSafe for DiagnosticCode
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more