Use TryFrom to handle enum errors, get definition loading working with demo definitions
This commit is contained in:
@@ -10,7 +10,10 @@ use polars::lazy::dsl::*;
|
||||
use polars::prelude::*;
|
||||
use serde::Serialize;
|
||||
|
||||
use super::csv::{read_definitions, BuildFrom, Component, ConstraintType, Definition, SourceType};
|
||||
use super::csv::{
|
||||
read_definitions, BuildFrom, Component, ComponentSourceType, ConstraintType, Definition,
|
||||
SourceType,
|
||||
};
|
||||
|
||||
// TODO: Polars suggests this, but docs suggest it doesn't have very good platform support
|
||||
//use jemallocator::Jemalloc;
|
||||
@@ -251,7 +254,7 @@ pub fn build_encounters_polars(
|
||||
.iter()
|
||||
.any(|f| f.source_type == SourceType::Patient)
|
||||
|| definition.components.iter().any(|c| match c {
|
||||
Component::Field(source, _) => source == "P",
|
||||
Component::Field(source, _) => *source == ComponentSourceType::Patient,
|
||||
_ => false,
|
||||
})
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user