Skip to content

Adding diagnostics to assess bug#8

Open
s-janel wants to merge 3 commits into
mainfrom
fix_pregnancy_start
Open

Adding diagnostics to assess bug#8
s-janel wants to merge 3 commits into
mainfrom
fix_pregnancy_start

Conversation

@s-janel

@s-janel s-janel commented Jun 17, 2026

Copy link
Copy Markdown

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

  • [ X] If adding a core feature, I've added related tests.
  • [X ] This is part of a product update, and I've added an explanation of what is different to the changelog.

@s-janel s-janel requested a review from MJC598 June 17, 2026 18:30

@MJC598 MJC598 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread MATERNAL_OUD.sas
SELECT episode_id,
count(*) as n
FROM moud_demo
group by episode_id

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we capitalize GROUP BY here

Comment thread MATERNAL_OUD.sas
episode_id,
sum(moud_init) as n_init
FROM moud_table
group by episode_id

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capitalize GROUP BY

Comment thread MATERNAL_OUD.sas
FROM (
SELECT ID
FROM moud_spine_preg
group by ID

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize GROUP BY

Comment thread MATERNAL_OUD.sas
Comment on lines +4621 to +4622
group by group
order by group;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize GROUP BY and ORDER BY

Comment thread MATERNAL_OUD.sas
Comment on lines +4654 to +4655
group by has_pregnancy, group, moud_start_group
order by has_pregnancy, group, moud_start_group;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize

Comment thread MATERNAL_OUD.sas
a.moud_start_group as episode_group,
b.moud_start_group as collapsed_group
FROM moud_spine_preg a
left join collapsed b

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize LEFT JOIN

Comment thread MATERNAL_OUD.sas
Comment on lines +4805 to +4806
group by has_pregnancy, group
order by has_pregnancy, group;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize

Comment thread MATERNAL_OUD.sas
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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize

Comment thread MATERNAL_OUD.sas
FROM prepared_data
WHERE missing(moud_start_group)
and group in (1,2,3,4,5,6)
group by

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize

Comment thread MATERNAL_OUD.sas
moud_flag,
moud_init,
moud_cessation
order by

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants