Skip to content

Multiple Results Example

  • Use Case: A data clearinghouse receives test results from a number of environmental testing services and labs. The company employs several data processing and analytic pipelines to parse raw input, notify residential and commercial property owners of the risks and options for results that surpass government thresholds, and model data to reveal trends.
  • Example Recipe: In this example, the recipe variation extracts new test data and determines its test type (air quality, radon exposure, or water quality). Each test type has its own path of analytic nodes, but this example looks specifically at the path for radon test results. Variation processing moves radon data through another check for the radon level that was measured. High test results continue processing to add anonymized data to existing data stores with locale and medical data, since there are correlations between radon exposure and certain types of cancers. Data for lower test results simply gets recorded.
  • Conditional Node Role: Two conditional nodes determine the paths that each test input takes in this variation. The first evaluates a "test_type" variable and executes one of three outgoing nodes based on a string value of "air," "radon," or "water." The second conditional node checks the numeric value of the "radon_test_level" variable to determine which of its two outgoing nodes should be executed. This variable value is either less than 2.0 picocurries per liter (pCi/L) or greater than/equal to 2.0 pCi/L.

()

Two conditional nodes determine the paths an order run will take in processing this graph.

Web App Configuration

The following images show how the conditional nodes and their condition statements are configured using the web app form.

()

The first conditional node evaluates the test_type variable for one of three possible string values.

()

The second conditional node evaluates values of the radon_result variable against a 2.0 pCi/L indicator.

File Contents

The platform records the condition node configuration shown above in the recipe's variations.json file.

{
    "variation-list": {
        "test_results_processing": {
            "description": "Parses, joins, and records individual results from environmental tests.",
            "graph-setting": "test_results_graph"
        }
    },
    "graph-setting-list": {
        "test_results_graph": [
            [
                "Extract_Test_Result",
                "Determine_Test_Type"
            ],
            [
                "Determine_Test_Type",
                "Process_AirQuality_Tests",
                {
                    "condition": "condition_1"
                }
            ],
            [
                "Determine_Test_Type",
                "Check_RadonTest_Level",
                {
                    "condition": "condition_2"
                }
            ],
            [
                "Determine_Test_Type",
                "Process_WaterQuality_Tests",
                {
                    "condition": "condition_3"
                }
            ],
            [
                "Check_RadonTest_Level",
                "Send_Alert_Email",
                {
                    "condition": "condition_4"
                }
            ],
            [
                "Check_RadonTest_Level",
                "Record_LowTest_Result",
                {
                    "condition": "condition_5"
                }
            ],
            [
                "Send_Alert_Email",
                "Anonymize_Test_Data"
            ],
            [
                "Anonymize_Test_Data",
                "Merge_Locale_and_Health_Data"
            ],
            [
                "Merge_Locale_and_Health_Data",
                "Record_HighTest_Result"
            ]
        ]
    },
    "conditions-list": {
        "condition_1": {
            "mode": "variable",
            "index": 1,
            "condition": {
                "list": [
                    {
                        "metric": "air",
                        "variable": "test_type",
                        "compare": "equal-to",
                        "type": "test-contents-as-string",
                        "execute": [
                            "Process_AirQuality_Tests"
                        ]
                    }
                ]
            },
            "node": "Determine_Test_Type"
        },
        "condition_2": {
            "mode": "variable",
            "index": 2,
            "condition": {
                "list": [
                    {
                        "metric": "radon",
                        "variable": "test_type",
                        "compare": "equal-to",
                        "type": "test-contents-as-string",
                        "execute": [
                            "Check_RadonTest_Level"
                        ]
                    }
                ]
            },
            "node": "Determine_Test_Type"
        },
        "condition_3": {
            "mode": "variable",
            "index": 3,
            "condition": {
                "list": [
                    {
                        "metric": "water",
                        "variable": "test_type",
                        "compare": "equal-to",
                        "type": "test-contents-as-string",
                        "execute": [
                            "Process_WaterQuality_Tests"
                        ]
                    }
                ]
            },
            "node": "Determine_Test_Type"
        },
        "condition_4": {
            "mode": "variable",
            "index": 4,
            "condition": {
                "list": [
                    {
                        "metric": "2.0",
                        "variable": "radon_result",
                        "compare": "greater-than-equal-to",
                        "type": "test-contents-as-float",
                        "execute": [
                            "Send_Alert_Email"
                        ]
                    }
                ]
            },
            "node": "Check_RadonTest_Level"
        },
        "condition_5": {
            "mode": "variable",
            "index": 5,
            "condition": {
                "list": [
                    {
                        "metric": "2.0",
                        "variable": "radon_result",
                        "compare": "less-than",
                        "type": "test-contents-as-float",
                        "execute": [
                            "Record_LowTest_Result"
                        ]
                    }
                ]
            },
            "node": "Check_RadonTest_Level"
        },
    },
    "schedule-setting-list": {
        "Quarterly": {
            "schedule": "0 0 1 */3 *",
            "scheduleTimeZone": "US/Eastern"
        }
    }
}