helios-sof 0.1.47

This crate provides a complete implementation of the SQL-on-FHIR specification for Rust, enabling the transformation of FHIR resources into tabular data using declarative ViewDefinitions. It supports all major FHIR versions (R4, R4B, R5, R6) through a version-agnostic abstraction layer.
Documentation
#[test]
fn test_boolean_validation_improvements() {
    // Test case that should pass: comparison operation
    let view_with_comparison = r#"{
        "resourceType": "ViewDefinition",
        "resource": "Patient",
        "select": [
            {
                "column": [
                    {
                        "name": "id",
                        "path": "id",
                        "type": "id"
                    }
                ]
            }
        ],
        "where": [
            {
                "path": "active = true"
            }
        ]
    }"#;

    // Test case that should fail: simple member access that might not be boolean
    let view_with_simple_member = r#"{
        "resourceType": "ViewDefinition",
        "resource": "Patient",
        "select": [
            {
                "column": [
                    {
                        "name": "id",
                        "path": "id",
                        "type": "id"
                    }
                ]
            }
        ],
        "where": [
            {
                "path": "name.family"
            }
        ]
    }"#;

    // Test case that should pass: boolean function
    let view_with_boolean_function = r#"{
        "resourceType": "ViewDefinition",
        "resource": "Patient",
        "select": [
            {
                "column": [
                    {
                        "name": "id",
                        "path": "id",
                        "type": "id"
                    }
                ]
            }
        ],
        "where": [
            {
                "path": "name.exists()"
            }
        ]
    }"#;

    // Parse as FHIR resources directly to test validation
    println!("Testing comparison operation (should pass):");
    let view_def1: Result<helios_fhir::r4::ViewDefinition, _> =
        serde_json::from_str(view_with_comparison);
    assert!(
        view_def1.is_ok(),
        "Should parse ViewDefinition successfully"
    );

    println!("Testing simple member access 'name.family' (should fail):");
    let view_def2: Result<helios_fhir::r4::ViewDefinition, _> =
        serde_json::from_str(view_with_simple_member);
    assert!(
        view_def2.is_ok(),
        "Should parse ViewDefinition successfully"
    );

    println!("Testing boolean function 'name.exists()' (should pass):");
    let view_def3: Result<helios_fhir::r4::ViewDefinition, _> =
        serde_json::from_str(view_with_boolean_function);
    assert!(
        view_def3.is_ok(),
        "Should parse ViewDefinition successfully"
    );

    // Note: The actual validation happens when creating SofViewDefinition from parsed FHIR resources
    // This test just ensures our changes don't break basic parsing
}