Skip to main content

User medications fact table (Redshift)

Bi_FactUserMedications

Fact table recording medications logged against guests, including medication names, start and expiry dates, status, and clinical context.

Field

Field type

Description

Primary Key

Mapped Dimension table

Mapped Dimension field

FactUserMedicationsWId

BIGINT IDENTITY

Surrogate warehouse key for the user medication fact record

PK

FactSegmentId

DECIMAL(19,0)

Business/natural key for the fact segment

UserMedicationPK

BIGINT

Source system primary key of the user medication record

medicationmasterwid

BIGINT

Foreign key to the medication master dimension

Bi_DimEMRMedicationMaster

EMRMedicationMasterWId

MedicationId

VARCHAR(36)

Unique identifier (GUID) of the medication record

MedicationName

NVARCHAR(255)

Name of the medication

StartDate

TIMESTAMP

Date when the medication was started

ExpiryDate

TIMESTAMP

Date when the medication expires or is expected to end

Notes

NVARCHAR(512)

Clinical notes associated with the medication record

UserWid

BIGINT

Foreign key to the user dimension

Bi_DimUser

userwid

UserId

VARCHAR(36)

Unique identifier (GUID) of the user/guest

OrganizationId

VARCHAR(36)

Unique identifier (GUID) of the organization

Status

SMALLINT

Status code of the medication record; see EMR domain definition

RelatedType

INT

Code indicating the type of entity this medication is related to; see EMR domain definition

RelatedId

VARCHAR(36)

Unique identifier (GUID) of the related entity

FormId

VARCHAR(36)

Unique identifier (GUID) of the form through which the record was captured

RelatedTime

TIMESTAMP

Timestamp of the related entity event

CriticalType

SMALLINT

Criticality classification code; see EMR domain definition

CreatedByWid

BIGINT

Foreign key to the user dimension for the record creator

Bi_DimUser

userwid

CreatedBy

VARCHAR(36)

Identifier (GUID) of the user who created the record

CreatedDate

TIMESTAMP

Timestamp when the record was created

UpdatedByWid

BIGINT

Foreign key to the user dimension for the last updater

Bi_DimUser

userwid

UpdatedBy

VARCHAR(36)

Identifier (GUID) of the user who last updated the record

UpdatedDate

TIMESTAMP

Timestamp when the record was last updated

centerwid

BIGINT

Foreign key to the center dimension

Bi_DimCenter

centerwid

CenterId

VARCHAR(36)

Unique identifier (GUID) of the center

EtlCreatedBy

BIGINT

ID of the ETL process/user that created this record

EtlCreatedDate

TIMESTAMP

Timestamp when the ETL process created this record

Void

BOOLEAN

Indicates whether the record has been voided/soft-deleted

PodName

NVARCHAR(100)

Name of the source pod from which the data originated

groupid

BIGINT

Group identifier for multi-tenant partitioning