Skip to content

Data Specifications

Spencer Childress edited this page Dec 1, 2022 · 24 revisions

KRI Results

This dataset contains the output of the KRI analysis. For each group (typically site) the dataset provides the KRI metric, its score, and the flagging of the score given the defined thresholds. This dataset applies to these modules:

  • scatter plot
  • bar chart

Data must be filtered on a single workflow ID prior to initializing a chart. For example:

const results = results_summary
    .filter(result => result.workflowid === 'kri0001');

Structure

  • array with one item/record per:
    • workflow ID
    • group ID

Specification

Property Type Description
studyid string Unique study identifier
workflowid string Unique workflow identifier
groupid string Unique group identifier
numerator number Numerator in KRI calculation
denominator number Denominator in KRI calculation
metric number KRI value
score number Group score given KRI value
flag number Flag assigned to group given score and defined thresholds

Example data

KRI Metadata

This dataset contains the metadata associated with each KRI. This dataset applies to these modules:

  • scatter plot
  • bar chart
  • time series
  • sparkline of score/metric
  • sparkline of flag counts by KRI

Data must be filtered on a single workflow ID prior to initializing a chart. For example:

const metadata = results_summary
    .filter(workflow => workflow.workflowid === 'kri0001');

Structure

  • object representing a single workflow ID

Specification

Property Type Description
workflowid string Unique workflow identifier
gsm_version string {gsm} version
group string Analysis stratification (site, country, etc.)
metric string KRI definition
numerator string Numerator in KRI calculation
denominator string Denominator in KRI calculation
outcome string KRI type (rate, percent, etc.)
model string Statistical method
score string Analysis output measure with which to score KRI value
data_inputs string Input data domains required to evaluate KRI
data_filters string KRI-specific subset applied to input data

Example data

KRI Bounds

This dataset contains the calculated bounds associated with the score returned by the KRI analysis. This dataset applies to these modules:

  • scatter plot

Data must be filtered on a single workflow ID prior to initializing a chart. For example:

const bounds = results_bounds
    .filter(bound => bound.workflowid === 'kri0001');

Structure

  • array with one item/record per:
    • workflow ID
    • threshold
    • x-value

Specification

Property Type Description
studyid string Unique study identifier
workflowid string Unique workflow identifier
threshold number KRI score threshold
denominator number X-value
numerator number Y-value

Example data

KRI Parameters

This dataset contains the parameters of the KRI analysis, including thresholds. This dataset applies to these modules:

  • bar chart of score
  • time series of score
  • sparkline of score

Data must be filtered on a single workflow ID prior to initializing a chart and custom parameters take precedence over default parameters. For example:

const parameters_default = meta_param
    .filter(parameter_default => (
        parameter_default.workflowid === 'kri0001'
    ));

const parameters_custom = status_param
    .filter(parameter_custom => (
        parameter_custom.workflowid === 'kri0001'
    ));

// TODO: use a join here
const parameters = parameters_default.map(parameter_default => {
    const parameter_custom = parameters_custom
        .find(parameter_custom => (
            parameter_custom.param === parameter_default.param &&
            parameter_custom.index === parameter_default.index
        ));

    return parameter_custom === undefined ? parameter_default : parameter_custom;
});

Structure

  • array with one item/record per:
    • workflow ID
    • parameter
    • parameter index

Specification

Property Type Description
workflowid string Unique workflow identifier
gsm_version string version of {gsm} used to generate output
param string KRI parameter
index number index of KRI parameter
default string default KRI parameter value
configurable boolean configurable by user?

Example data

KRI Parameters Over Time

This dataset contains the parameters of the KRI analysis, including thresholds, across snapshots. This dataset applies to these modules:

  • time series of score

Data must be filtered on a single workflow ID prior to initializing a chart and custom parameters take precedence over default parameters. For example:

const parametersDefault = meta_param
    .filter(parameter_default => (
        parameter_default.workflowid === 'kri0001'
    ));

const parametersCustom = status_param_over_time
    .filter(parameterCustom => (
        parameterCustom.workflowid === 'kri0001'
    ));

const snapshotDates = [
    ...new Set(parametersCustom.map(parameter => parameter.snapshot_date)).values()
];

// TODO: use a join here
const parameters = parameters_default.map(parameter_default => {
    const parameter_custom = parameters_custom
        .find(parameter_custom => (
            parameter_custom.param === parameter_default.param &&
            parameter_custom.index === parameter_default.index
        ));

    return parameter_custom === undefined ? parameter_default : parameter_custom;
});

Structure

  • array with one item/record per:
    • snapshot date
    • workflow ID
    • parameter
    • parameter index

Specification

Property Type Description
workflowid string Unique workflow identifier
gsm_version string version of {gsm} used to generate output
param string KRI parameter
index number index of KRI parameter
default string default KRI parameter value
configurable boolean configurable by user?
snapshot_date string Snapshot date (yyyy-mm-dd)

Example data

KRI Results Over Time

This dataset contains KRI results for each snapshot. The only difference is an additional variable, snapshot_date, that identifies the date of the analysis. This dataset applies to these modules:

  • time series of score/metric
  • sparkline of score/metric

Data must be filtered on a single workflow ID prior to initializing a chart. For example:

const resultsSummaryOverTime = results_summary_over_time.filter(
    d => d.workflowid === 'kri0001'
);

Structure

  • array with one item/record per:
    • snapshot date
    • workflow ID
    • group ID

Specification

Property Type Description
studyid string Unique study identifier
workflowid string Unique workflow identifier
groupid string Unique group identifier
numerator number Numerator in KRI calculation
denominator number Denominator in KRI calculation
metric number KRI value
score number Group score given KRI value
flag number Flag assigned to group given score and defined thresholds
snapshot_date string date of analysis (yyyy-mm-dd)

Example data

Flag Counts by KRI

This dataset contains the number of at risk and flagged groups at each snapshot by KRI. This dataset applies to these modules:

  • sparkline of flag counts by KRI

Longitudinal data must be aggregated by workflowid and snapshot_date prior to initializing the sparkline. For example:

const n = new Set(
    results_summary_over_time.map(d => d.groupid)
).size;

const flag_counts_by_kri = d3.flatRollup(
    results_summary_over_time,
    workflowid => {
        const n_at_risk = workflowid
            .filter(d => Math.abs(+d.flag) === 1)
            .length;
        const n_flagged = workflowid
            .filter(d => Math.abs(+d.flag) === 2)
            .length;
        const n_at_risk_or_flagged = n_at_risk + n_flagged;

        return {
            n,
            n_at_risk,
            n_flagged
            n_at_risk_or_flagged,
        };
    },
    d => d.snapshot_date,
    d => d.workflowid
);

Structure

  • array with one item/record per:
    • snapshot date
    • workflow ID

Flags

Property Type Description
studyid string Unique study identifier
workflowid string Unique KRI identifier
snapshot_date string date of analysis (yyyy-mm-dd)
n number Number of groups
n_at_risk number Number of groups where flag is -1 or 1
n_flagged number Number of groups where flag is -2 or 2
n_at_risk_or_flagged number number of groups where flag is -2, -1, 1, or 1

Example data

Flag Counts by Group

This dataset contains the number of at risk and flagged KRIs at each snapshot by group. This dataset applies to these modules:

  • sparkline of flag counts by group

Longtiduinal data must be aggregated by groupid and snapshot_date prior to initializing the sparkline. For example:

const n = new Set(
    results_summary_over_time.map(d => d.groupid)
).size;

const flag_counts_by_group = d3.flatRollup(
    results_summary_over_time,
    groupid => {
        const n_at_risk = groupid
            .filter(d => Math.abs(+d.flag) === 1)
            .length;
        const n_flagged = groupid
            .filter(d => Math.abs(+d.flag) === 2)
            .length;
        const n_at_risk_or_flagged = n_at_risk + n_flagged;

        return {
            n,
            n_at_risk,
            n_flagged,
            n_at_risk_or_flagged,
        };
    },
    d => d.snapshot_date,
    d => d.groupid
);

Structure

  • array with one item/record per:
    • snapshot date
    • group ID

Flags

Property Type Description
studyid string Unique study identifier
groupid string Unique group identifier
snapshot_date string date of analysis (yyyy-mm-dd)
n number Number of KRIs
n_at_risk number Number of KRIs where flag is -1 or 1
n_flagged number Number of KRIs where flag is -2 or 2
n_at_risk_or_flagged number number of KRIs where flag is -2, -1, 1, or 1

Example data

Additional Analysis Ouput

This dataset contains additional analysis output for each snapshot, including confidence intervals of QTL analysis results. This dataset applies to these modules:

  • time series of QTL metric
  • sparkline of score/metric

Data must be filtered on a single workflow ID prior to initializing a chart. For example:

const resultsAnalysisOverTime = results_summary_over_time.filter(
    d => d.workflowid === 'qtl0004'
);

Structure

  • array with one item/record per:
    • snapshot date
    • workflow ID

Specification

Property Type Description
studyid string Unique study identifier
workflowid string Unique workflow identifier
param string Name of statistic
value number Value
gsm_analysis_date string date of analysis (yyyy-mm-dd)
snapshot_date string date of data snapshot (yyyy-mm-dd)

Clone this wiki locally