build_tm_keys: Build tm (time_map) keys (new)

View source: R/new_patient_id_functions.R

build_tm_keysR Documentation

Build tm (time_map) keys (new)

Description

This function goes to the database and assembles all of the inpatient an outpatient visits (or just the visits specified by a collection table). It then assembles them into a logintudinal time_map of distinct visits (defined by admission/service date and stdplac). Finally, each visit is given a distinct visit key. The time_map and the distinct inpatient and outpatient visit keys are returned as a list. NOTE: This function should generally only be run once after the small DB is build, and it generally should not be called directly. Use the function 'add_tm_keys()' to add the time_map keys to the database.

Usage

build_tm_keys(db_con)

Arguments

db_con

a connection to a database

Value

A list containing three tibbles (timemap, outpatient keys, and inpatient keys)


aarmiller/smallDB documentation built on March 29, 2024, 9:37 a.m.