Skip to main content

i2b2 to BFF

Mapping status

Tests cover the i2b2 star-schema profile with synthetic fixtures. Local ontologies and dimension conventions may differ between installations.

The route groups PATIENT_DIMENSION, OBSERVATION_FACT, and optional context tables by PATIENT_NUM. It creates one BFF individuals record per patient.

Patient​

i2b2 sourceBFF targetBehavior
PATIENT_DIMENSION.PATIENT_NUMidRequired and unique
SEX_CD, fallback SEX, GENDER_CD, GENDERsexMale, female, other, and unknown values use Beacon-compatible defaults
BIRTH_DATE, fallback BIRTHDATE, DATE_OF_BIRTHinfo.phenopacket.dateOfBirthSupported dates become UTC timestamps for later PXF conversion
DEATH_DATE, fallback DEATH_DATE_TIME, DODinfo.phenopacket.vitalStatusSets DECEASED and retains timeOfDeath.timestamp

Observation Facts​

i2b2 source ruleBFF targetBehavior
numeric VALTYPE_CD=N or a LOINC: conceptmeasures[]CONCEPT_CD becomes assayCode; numeric or text result becomes measurementValue
ICD-9, ICD-10, ICD-11, SNOMED, or DX prefixdiseases[].diseaseCodePrefix matching is case-insensitive and punctuation-normalized
CPT, HCPCS, ICD procedure, PROC, or PX prefixinterventionsOrProcedures[].procedureCodeSTART_DATE or OBS_DATE also becomes dateOfProcedure
RxNorm, NDC, MED, MEDICATION, or DRUG prefixtreatments[].treatmentCodeThe coded observation becomes a treatment
any other coded factphenotypicFeatures[].featureTypePreserves the source concept rather than guessing its clinical category
non-@ MODIFIER_CDsource provenance onlyModifier rows are not emitted as duplicate clinical events

When CONCEPT_DIMENSION is supplied, NAME_CHAR, CONCEPT_NAME, NAME, or DESCRIPTION supplies the term label for a matching CONCEPT_CD. Otherwise, the code is also used as its label.

Measurements​

i2b2 sourceBFF targetBehavior
NVAL_NUM, fallback NUMERIC_VALUEmeasurementValue.quantity.valueRetained as a JSON number
UNITS_CD, fallback UNITmeasurementValue.quantity.unitRetained as an i2b2:Unit.* source term
TVAL_CHAR, fallback TEXT_VALUEcategorical measurementValueUsed when no numeric result is available
START_DATE, fallback OBS_DATEmeasures[].dateSupported date component is retained

Visit Context​

ENCOUNTER_NUM, ENCOUNTERID, or VISIT_ID links a fact to VISIT_DIMENSION. Convert-Pheno attaches the encounter identifier, optional start and end timestamps, and visit type to the mapped event through the private _visit extension. _visit preserves encounter relationships in BFF but is not a native Beacon v2 or Phenopackets property.

Terminology And Provenance​

Existing CURIE-like CONCEPT_CD values are retained, with known prefixes normalized where possible. Local or unrecognized identifiers remain source-derived i2b2 terms; Convert-Pheno does not infer an external ontology crosswalk.

By default, the source patient row and patient-scoped table rows are copied to info.i2b2. Use --no-source-info to omit this raw copy. For OMOP output, the second conversion stage resolves supported terms against the Athena-OHDSI vocabulary; use --term-audit to review each resolution and fallback.

See the i2b2 format guide for accepted packages, commands, and memory behavior.