Adding diagnostics to assess bug#8
Open
s-janel wants to merge 3 commits into
Open
Conversation
MJC598
requested changes
Jun 18, 2026
MJC598
left a comment
There was a problem hiding this comment.
A couple more capitalization issues. My thought process is using capitalization for SQL Keywords helps us determine what is a SAS statement (e.g. your proc and quit keywords are lowercase) vs the SQL.
I'm not gonna flag AS, AND, OR, or HAVING because I can go either way and know they appear in SAS just as well, but to me I personally would say they should be capitalized in the SQL too just to follow the consistency. The key functionality operations though (JOINs, GROUP BY and ORDER BY) should be capitalized as well.
| SELECT episode_id, | ||
| count(*) as n | ||
| FROM moud_demo | ||
| group by episode_id |
| episode_id, | ||
| sum(moud_init) as n_init | ||
| FROM moud_table | ||
| group by episode_id |
| FROM ( | ||
| SELECT ID | ||
| FROM moud_spine_preg | ||
| group by ID |
Comment on lines
+4621
to
+4622
| group by group | ||
| order by group; |
Comment on lines
+4654
to
+4655
| group by has_pregnancy, group, moud_start_group | ||
| order by has_pregnancy, group, moud_start_group; |
| a.moud_start_group as episode_group, | ||
| b.moud_start_group as collapsed_group | ||
| FROM moud_spine_preg a | ||
| left join collapsed b |
Comment on lines
+4805
to
+4806
| group by has_pregnancy, group | ||
| order by has_pregnancy, group; |
Comment on lines
+4944
to
+4945
| group by group, moud_flag, moud_init, moud_start_group | ||
| order by group, moud_flag, moud_init, moud_start_group; |
| FROM prepared_data | ||
| WHERE missing(moud_start_group) | ||
| and group in (1,2,3,4,5,6) | ||
| group by |
| moud_flag, | ||
| moud_init, | ||
| moud_cessation | ||
| order by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds diagnostic cascade to see if the bug in output is fundamental issue with integrity of MOUD episode table or introduce by joins/collapsing datasets downstream
What Wrike task is this associated with?
https://www.wrike.com/open.htm?id=4315737851
Checklist before merging