Skip to main content

Data validation and normalization

Connectors can import data from multiple source types. The same validation and normalization rules apply regardless of whether the data comes from a file or a database. This page describes which validation rules are applied and gives recommendations on how to format and structure your data.

The cohort's selected schema defines how imported values are interpreted. It specifies the available fields, their data types, whether values are required, and any additional validation rules. During an import, source columns are mapped to these schema fields before the data is stored in the cohort.

Prepare the source files​

  • Encode CSV and TSV files as UTF-8.
  • Use a consistent delimiter and column structure in delimited files.
  • Represent missing values with empty cells rather than placeholder text such as ?, N/A, or unknown, unless that text is an intended value.
  • Ensure that values can be converted to the data types defined by the schema.

Excel .xlsx workbooks are read directly and do not require a text-encoding selection. For format-specific requirements, see the input data formatting guidelines, delimited file extractor, and Excel file extractor.

Correct incompatible source values​

Extraction and transformation tools can prepare source data before schema validation. Use them when the source format or values do not match the representation required by the schema.

For example, a BOOLEAN field accepts true and false, while a source system may represent the same values as 1 and 0. An extraction or transformation tool can convert every 1 to true and every 0 to false before the values are validated and imported.

These tools may also standardize categories, convert units, parse dates, replace placeholder values with nulls, combine columns, or reorganize the input data. Their output must still conform to the cohort's schema.

Supported data organization​

Both horizontal and longitudinal data organizations are supported:

  • Horizontal data stores multiple properties for an entity in the same row. For example, each patient has exactly one row containing their sex, date of birth, and weight:

    Patient IDSexDate of birthWeight (kg)
    P001female1980-04-1268
    P002male1975-09-3082
  • Longitudinal data stores repeated observations across rows and associates them with a visit, date, or timestamp. For example, a patient's weight is measured at several visits, and each measurement is a separate row:

    Patient IDVisit dateWeight (kg)
    P0012025-01-1568
    P0012025-06-2066
    P0022025-02-0382

If the source organization does not match the structure required for mapping, a transformation can convert horizontal data to a longitudinal representation. For repeated measurements, configure the connector's visit and visit time mappings so that observations are associated with the correct entity and point in time.

Visit timestamps follow the general date and timestamp rules.

Data type normalization​

Schema typeAccepted inputNormalization and restrictions
STRINGText or another scalar valueConverted to text. Additional length or pattern rules may apply.
CATEGORICALA value matching an allowed categoryConverted to text and compared with the configured categories.
INTAn integer or numeric textMust represent a whole number. Values such as 42 and 42.0 are accepted; 42.5 is rejected.
FLOATA number or numeric textConverted to a floating-point number.
BOOLEANtrue or falseCase-insensitive; surrounding whitespace is ignored. Values such as 1, 0, yes, and no must be transformed before import.
DATE, DATE_TIMEA supported date or datetime valueNormalized to a UTC point in time. A date without a time is interpreted as start-of-day UTC. See Dates and timestamps.
FILE—Not currently supported.

Dates and timestamps​

ISO 8601 values are recommended because their interpretation is explicit. Supported examples include:

  • Date: 2024-01-01
  • Datetime with UTC: 2024-01-01T12:00:00Z
  • Datetime with an offset: 2024-01-01T12:00:00+02:00
  • Datetime without an offset: 2024-01-01T12:00:00

Datetime values with an offset are converted to UTC. Values without an offset are treated as UTC. A date without a time imported into a DATE_TIME field or used as a visit timestamp is interpreted as the start of that day in UTC. For example, 2025-12-12 becomes 2025-12-12T00:00:00Z. A datetime can be imported into a DATE field only when its UTC time is exactly 00:00:00, because otherwise the conversion would discard information.

Epoch timestamps expressed in seconds or milliseconds are also supported. Values with an absolute value up to 10,000,000,000 are interpreted as seconds; larger values are interpreted as milliseconds. Because this distinction is heuristic, ISO 8601 values are preferred.

Schema validation rules​

After normalization, the schema may apply the following rules to each field:

RuleMeaningApplicable types
REQUIREDA value must be present.All types
MINLENGTHMinimum text length.STRING
MAXLENGTHMaximum text length.STRING
PATTERNThe value must match a regular expression.STRING
MINMinimum accepted value.INT, FLOAT, DATE, DATE_TIME
MAXMaximum accepted value.INT, FLOAT, DATE, DATE_TIME

For a CATEGORICAL field with configured categories, the normalized value must match one of those categories.

Null and empty values​

An empty cell is interpreted as null. Whether it is accepted depends on the corresponding schema field:

  • If the field is optional, null is accepted and other validation rules are skipped for that value.
  • If the field is marked REQUIRED, a null or empty value is rejected.

This allows the schema to require values for selected columns while permitting missing values in others.

Only truly empty cells are treated as missing values. Text that people commonly type into spreadsheets to mean "no value", such as -, NULL, null, N/A, NA, n.a., none, unknown, ?, or 999, is not treated as missing. Instead, it is validated like any other value and may be rejected (for example, N/A in a numeric column) or imported as literal text. Transform such placeholders to empty values before import when appropriate.

Validation errors and import results​

A validation error for one value does not necessarily reject the complete import or the rest of the record. The invalid value is omitted and reported in the connector run as a patient error, while the valid values of the record are still imported.

For example, if a record contains an age of 420 and a BMI of 25, and the schema permits ages only between 0 and 120, the age is rejected while the valid BMI can still be imported.

After running the connector, review Patient Errors, Run Errors, and Run Logs on the run details page. These sections identify rejected values and execution problems. See Import data by running a connector for the complete review workflow.

Examples​

InputSchema typeResult
abcSTRINGAccepted as abc.
123STRINGNormalized to 123 as text.
42.0INTAccepted as 42.
42.5INTRejected because it is fractional.
falseBOOLEANAccepted as false.
1BOOLEANRejected unless transformed to true.
2024-01-01DATEAccepted.
2024-01-01T10:30:00DATERejected because the time would be lost.
2024-01-01T10:30:00+02:00DATE_TIMEConverted to 2024-01-01T08:30:00Z.