Apply Trimester Hierarchy to Patients
apply_trimester_hierarchy.Rd
Identify duplicate trimester codes for the same service day and apply hierarchy logic to resolve conflicts. Group procedures performed on eligible women by enrolid and date of procedure. Multiple conflicting trimester codes could occur on the same day, so the trimester group code for that service day needs to be reassigned based on the logic within the function.
Arguments
- patients
A data frame containing patient data with the format of the exported dataset extraction example dataset.
Value
A data frame with the applied trimester hierarchy logic, containing variables such as enrolid, svcdate, code, claims_file, description, final_trimester_code, secondary_outcome, srv_year, outcome, pdx, and trimester_code_clean.
Examples
if (FALSE) {
patients <- arrow::read_parquet("patients.parquet")
trimester_hierarchy_final <- apply_trimester_hierarchy(patients)
}