Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the top 5 code tables show what they should #109

Open
LFISHER7 opened this issue Apr 17, 2023 · 1 comment
Open

Make the top 5 code tables show what they should #109

LFISHER7 opened this issue Apr 17, 2023 · 1 comment
Assignees
Labels

Comments

@LFISHER7
Copy link
Contributor

The top 5 codes table for a codelist is currently calculated by specifying a measure in the study definition that is grouped by code. The code is the latest recorded code from the codelist. This was initially used as it was an easy way to give some insight into what individual codes are recorded in patients that satisfy the chosen measure.

There are a couple of issues with this:

  1. It means the top 5 table does not show the true proportion that each code makes up. Where a patient has multiple codes recorded from a single codelist within a single time period, only the latest will be recorded.
  2. Due to have a rolling monthly measure, for codelist 2, which has a time window longer than a month, a single recording of a code can contribute multiple times to the counts that are used to calculate the top 5 tables. For example, if the window for codelist 2 is in the same month as codelist 1 or up to 2 months before the start of the month, this code could be picked up 3 times, if it remains the latest code for that patient.

To solve 1), we can return number_of_matches_in_period for each code in each codelist and use this to calculate the top 5 table. Every code instance is then included in the count. 2) is harder to fix. We can't return the date for each code that contributes to number_of_matches_in_period. I think this means we can't use number_of_matches_in_period whilst only including counts that contribute to satisfying the measure. Instead number_of_matches_in_period can be extracted once for each code, for the entire study period and we will have to clearly explain what this table represents.

@LFISHER7 LFISHER7 changed the title Check the top 5 code tables are as expected. Make the top 5 code tables show what they should Apr 17, 2023
@LFISHER7
Copy link
Contributor Author

Using number_of_matches_in_period is the easiest solution and easiest to understand, so we'll go for that.

@LFISHER7 LFISHER7 mentioned this issue Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants