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

Breakup sql 4714 #85

Merged
merged 22 commits into from
Jun 12, 2017
Merged

Breakup sql 4714 #85

merged 22 commits into from
Jun 12, 2017

Conversation

mprittie
Copy link

This update to the code does the following:

  • Moves most DDL statements out of PCORNetLoader.sql into a new file PCORNetInit.sql so that preparing the transform space is separated from running the transform.
  • Updates the PCORNetLoader procedure with a parameter to declare which transform procedure in the sequence to start with.
  • Cleaned up and reorganized the SQL so that related statements are co-located.

@mprittie mprittie requested a review from dckc June 12, 2017 13:17
Copy link

@dckc dckc left a comment

Choose a reason for hiding this comment

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

I'm not inclined to put off adding a file header.

The other comments are mostly suggestions.

--------------------------------------------------------------------------------

BEGIN
PMN_DROPSQL('DROP TABLE enrollment');
Copy link

Choose a reason for hiding this comment

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

not PMN_DROPSQL('enrollment')?

Copy link
Author

Choose a reason for hiding this comment

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

That is an update we had talked about and that I would like to make, but time constraints are pushing me to wrap this up for now. Perhaps we can make a note of it and revisit.

Copy link

Choose a reason for hiding this comment

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

OK.

@@ -0,0 +1,1000 @@

Copy link

Choose a reason for hiding this comment

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

no file header?

Copy link
Author

@mprittie mprittie Jun 12, 2017

Choose a reason for hiding this comment

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

Fair enough, I will add a header



--------------------------------------------------------------------------------
-- I2P REPORT
Copy link

Choose a reason for hiding this comment

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

I think I saw something in the SCILHS issue tracker that I2P REPORT is now dead code. I'd prefer not to maintain it. Move it to its own file?

Copy link
Author

Choose a reason for hiding this comment

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

This issue? If it is dead code, I'd just assume remove it all together.

Copy link

Choose a reason for hiding this comment

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

removing it works for me.

@@ -896,7 +158,9 @@ union --6 -- NS, NR, nH
begin
pcornet_popcodelist;

PMN_DROPSQL('drop index demographic_patid');
PMN_DROPSQL('drop index demographic_idx');
Copy link

Choose a reason for hiding this comment

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

As we discussed, I doubt consolidating indexes is a good idea.

@@ -924,12 +188,26 @@ ORA-00904: "FACILITY_ID": invalid identifier
ORA-00904: "LOCATION_ZIP": invalid identifier
*/
create or replace procedure PCORNetEncounter as

sqltext varchar2(4000);
Copy link

Choose a reason for hiding this comment

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

yay! no more sqltext in procedure PCORNetEncounter

@@ -1495,137 +719,70 @@ end PCORNetHarvest;



/* TODO: When compiling PCORNetPrescribing, I got Error(93,15):
Copy link

Choose a reason for hiding this comment

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

happy to see cleaning up these TODOs

END;
create or replace PROCEDURE PCORNetLoader(start_with VARCHAR2) AS
begin
if start_with in ('PCORNetDemographic') then
Copy link

Choose a reason for hiding this comment

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

suggest: add a comment to acknowledge that this pile of if statements is ugly

Copy link
Author

Choose a reason for hiding this comment

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

Agree, this could use some documentation.

PCORNetEncounter;
end if;

if start_with in (
Copy link

Choose a reason for hiding this comment

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

perhaps map start_with to a number called, let's say start_with_step and use start_with_step <= 3?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, this guy is magic string city. Your suggestion could clean this procedure up a bit w/ the right documentation. I'm a little hesitant to do so because the name wouldn't get logged in the Jenkins console, but I know if that's a strong reason not to.

Copy link

Choose a reason for hiding this comment

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

The map-to-number idea was for inside this procedure; the jenkins logs wouldn't change, if I understand things correctly. But the destabilization risk is probably not worthwhile at this point.

@dckc dckc mentioned this pull request Jun 12, 2017
@dckc dckc merged commit 26b31b3 into master Jun 12, 2017
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