build_time_map_keys: Build time_map keys

View source: R/generate_time_map.R

build_time_map_keysR Documentation

Build time_map keys

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_time_map_keys()' to add the time_map keys to the database.

Usage

build_time_map_keys(collect_tab = collect_table(), db_con)

Arguments

collect_tab

a collection table to build time_map from. By default all years will be used

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.