Skip to content

QS: Initial Queries Computation #201

@jthompson-arcus

Description

@jthompson-arcus

clinsight/R/mod_queries.R

Lines 110 to 113 in 60507ac

df <- with(r$query_data, r$query_data[n == 1, ] )
if(identical(nrow(df),0)) return(df)
df <- df |>
dplyr::slice_min(timestamp, by = c(subject_id, event_label, query_id)) |>

@LDSamson handful of questions here:

  1. Why are we grabbing queries with n == 1? In what scenario would there be query data without an initial query of n == 1? I ask this in part because our EDC queries have an audit ID which is sequential across all items. Does n signify anything outside marking subsequent query records for a query_id?
  2. Why slice by minimum timestamp instead of n? This seems to imply that there can be multiple queries with n==1. Is that somehow the case?

I would think that we should be able to slice the data frame at minimum n by query_id and call it a day.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions