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

Fixes #108 #163

Conversation

t-abdul-basser
Copy link
Contributor

Fixes #108

t-abdul-basser and others added 2 commits January 20, 2017 18:20
add'l characterization/summarization work

added SQL files for summary service from Achilles::ExportToJSON

added data transfer objects (DTOs)

modified CDMResultsService, made several sql translation changes, moved
mappers and DTOs to report package in preparation for refactoring.

added add'l DTOs to report package and stubbed out service and runner classes.

fixed imports

fixed imports in some DTOs and RowMappers
Add generic row mapper, text hack impls

made several sql translation-related changes

Use same method (getTreemap) for all (non-temporal) treemaps

Use AS keyword in all cdm report query aliases

Remove text hack and camel case column names in cdm report queries

Replace all treemap endpoints with a single generic implementation

 * Rename all treemap CDM report files to treemap.sql
 * Enquote aliases in CDM report queries to preserve case
 * Add GenericRowMapper ctor with ObjectMapper for performance
 * CDMResultsAnalysisRunner.getTreemap returns ArrayNode

Fix condition CDM results queries (by concept)

 * include conceptId parameter
 * rename sqlAgeAtFirstDiagnosis to sqlAgeAtFirstOccurrence
 * modify sqlConditionsByType to check vocabulary_id, not domain_id
 * cast xCalendarYear to INT in sqlPrevalenceByGenderAgeYear

added fixes to row mapping in /person and dashboard

implemented /achillesheel, /datadensity
started implementation of /death
refactored CohortAttributeMapper --> CDMAttributeMapper
created new report data objects
drop unused/superfluous CDMResultsAnalysisRunner

fixed /datadensity

Fix queries associated with generic drilldown reports

 * Data types include conditionera, drug, drugera, measurement, observation, procedure, visit
 * Queries include AgeAtFirstOccurrence, PrevalenceByGenderAgeYear, ByType, ByMonth
 * Include parameter @conceptId
 * Cast xCalendarYear to INT (where applicable)

Remove obsoleted code from CDMResultsService (activates observation reports)

Standardize names of "by type" query files for cdm reports to sqlByType.sql

Applies to condition, drug, measurement, observation, procedure

Add cdm_database_schema to CDMResultsAnalysisRunner standard columns (for measurement treemap)

Fix typo in sqlVisitDurationByType.sql

cleaned up and changes /achillesheel --> /heel

	Add cdm_database_schema to CDMResultsAnalysisRunner standard columns as per mark-velez/* #e862d53

changed endpoint signature (/heel -->/achillesheel), fixed summary yob and yob in person report

fixed null totalRecords element in Data Density report

added summary to dashboard report in CDM results service

implemented death report

removed superfluous code (imports, methods, etc)

Reorganize sql files for cdm drilldowns (to reduce text wrangling) (#2)

* Remove sql prefix from files names
 * Camel-case filename
 * Move drilldown files to folders
 * Delete treemap files that were reverted back

removed unused method - renderDrillDownSql()

changed access modifier on several fields and methods

removed unused test and related resource

made post-rebase reconciliations in prep for PR
@mark-velez
Copy link
Contributor

Any updates regarding this PR? We also have mark-velez/achilles-integration-pr on standby with the accompanying client-side stuff. Not sure if you were waiting on that. We understand the release crunch can be hectic, please let us know if we can do anything to help.

@chrisknoll chrisknoll self-assigned this Jan 26, 2017
@chrisknoll
Copy link
Collaborator

I'll take this one on.

@t-abdul-basser , @mark-velez : This is going to take a bit of validation, but my plan is to invoke the various web service calls, and try to see about comparing output from the REST calls to the exportToJson files we get from Achilles...I'm assuming that there weren't changes in the raw data structures to do this. Do you have any other suggestion to do a 'respectable' amount of verification on this PR?

@chrisknoll
Copy link
Collaborator

Hey, @t-abdul-basser , @mark-velez . I'm going through a lot of these changes, and I'm finding that (at least the first 6 or 8) are just formatting changes. And oddly there's some sort of leading space on some of these lines that shouldn't have an indent at all.

Should I call out in a code comment where I'm seeing all these happen, or would you like to comb through these changes and revert the ones that are just indentation/formatting changes?

@chrisknoll
Copy link
Collaborator

Sorry, I take it back (somewhat) re: the leading spacing, the diff viewer confused me for a bit. But the point still stands: if you guys could look at the files changed tab above, and just scroll through the changes (that's how I'm going through the changes) you'll notice that there's just pages and pages of red followed by pages and pages of green that I think is just copies of the code, but different spacing/indentation. Making it much harder to digest what's really changing in those files (if anything at all).

So don't mean to be a snob about this, but i'd really appreciate the cleanup.

-Chris

@mark-velez
Copy link
Contributor

Thanks for getting back so quickly, @chrisknoll. The structure of the output from the REST calls will be very different from the exportToJson output. They will more closely resemble that of analogous calls to the cohort results service (i.e. CohortResultsService). It may be more useful to compare to those or to test with the Atlas branch I refer to above (but I know there are limitations either way). This is part of our effort to eliminate redundant server- and client-side code and instead reuse components that are doing awfully similar things in achilles/heracles. We discussed this in detail during the 12/15 Architecture Workgroup meeting (see slides).

Regarding the formatting changes- I may be to blame for much of them; I understand this problem and typically create explicit formatting-only commits, but it seems to me that this gets obscured by the squash workflow. How do you recommend we handle reformatting changes for future reference? Please pardon my ignorance on the matter.

I think you're right though that there are reformats and duplicates that shouldn't be here. We'll look at it, clean it up and report back. In the meantime, it may still be useful to carry out functional testing as I described above. Thanks again!

@chrisknoll
Copy link
Collaborator

I'm going to hold off on reviewing until after all cleanup is made in case I do verify something and then a subsequent cleanup might break something.

Re: squashing: squashing just folds multiple commits into a single commit. If the diff for the entire PR says that 500 lines are removed and the exact same (but reformatted) lines are inserted back, squashing doesn't do anything here.

What you need to do is:

  1. Use the files changed tab above
  2. Scroll through the page,and identify blocks of code that are just reformatted but not changed.
  3. Use your local GIT client to look at the previous commit for that file (this should be easy be cause there's only 2 commits in the entire PR, so finding the previous commit should be straightforward.
  4. Copy the entire block from the prior commit into your local file, and commit. This will make it look like that block of code hasn't changed. Just make sure you don't reformat again after you copy the prior :)

If you do this all in one commit, they'rell just be 1 additional commit added to this PR (called something like 'reverted code format changes'). When the squash and merge is done on the PR, all the commits here will be pushed into one commit with all the comments of all the commits put into a single commit message. You can even do it across multiple commits, whatever is easier for you.

-Chris

@t-abdul-basser
Copy link
Contributor Author

I will look at these formatting issues and address them. Thank you for bringing this to our attention @chrisknoll.

I would second @mark-velez: I would suggest that we move forward with review (e.g. review of substantive changes) while I address these formatting issues.

Thanks.

import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Component;

/**
*
* @author fdefalco
*/
@Path("{sourceKey}/cdmresults/")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we move away from using the webapi path starting with the source key? This has always been something that's been counter-intuitive....most of the time you have WebAPI/{service}/{sub-route path...} but other cases you start with a source key.

Consider if instead we have the cdmresults service directly off of WebAPI. We can choose to handle this route by returning a response that returns the list of sources that have cdmresults generated, or we can not have a handler for this 'default service route' (requiring the source like we do today, but in a form of /{servicename}/{source} format. But if we do implement the service route, this default route could be the thing that drives the datasource selection dropdown (ie: the datasources.json in the old achilles web). Then using one of the datasources will take you to routes beginning with /cdmresults/{sourcekey}/{path to specific reports}.

@t-abdul-basser
Copy link
Contributor Author

t-abdul-basser commented Jan 27, 2017

@chrisknoll I agree. I suggest that we do this later however, outside the scope of this PR.

@chrisknoll
Copy link
Collaborator

I think the scope of the PR is to introduce the new endpoints. Shouldn't we add the endpoints with the correct format rather that release it incorrect and then have to deal with backwards compatibility later?

@chrisknoll
Copy link
Collaborator

@mark-velez , I took a look at the fork of atlas, but couldn't create any issues in your fork to discuss some of the things I'm seeing. I'm not sure if forked repos have their own issues and I just can't do it becuase it's restricted some way? Not sure, but I'll try to reach out to you via email about what I'm seeing.

@mark-velez
Copy link
Contributor

@chrisknoll I, well, perhaps we just learned that you have to explicitly enable the issues feature on forks. You should be able to submit issues on my Atlas fork now. Please note that @fdefalco asked me to look into rebasing from the branch v2-integration-candidate-pr. I just completed that on my branch achilles-integration-pr-1.

@chrisknoll
Copy link
Collaborator

Excellent, thanks, I see it now.

@t-abdul-basser
Copy link
Contributor Author

Yes, the PR is intended to introduce the new endpoints. However, there were endpoints that existed prior to my introduction of the achilles report-related endpoints so this change would essentially be an cdmresults-level change i.e. one that effects the course-grained service. While that is not conceptually difficult, since I did not introduce this format (it appears that @fdefalco might have done so) and this would change client side invocations in Atlas I would still prefer to undertake the refactoring later.

@chrisknoll
Copy link
Collaborator

Unfortunately, those existing endpoints where introduced in Oct of '15 when we didn't have the benefit of reviewing and experience that we do today.

It feels like the path forward is to accept the PR as as and try to make changes later. So I'll approve the PR and create issues of things I see separately.

@t-abdul-basser
Copy link
Contributor Author

I understand fully. I see that you have open #166. Thanks for taking time to do that. Pleae assign to me and I will handle that on next pass.

@chrisknoll
Copy link
Collaborator

I'll handle #166, I reviewed where the changes also need to occur on the Atlas side so I can coordinate both changes.

@chrisknoll chrisknoll changed the base branch from master to v2.0-integration-candidate January 27, 2017 19:41
@chrisknoll chrisknoll merged commit 7998ab5 into OHDSI:v2.0-integration-candidate Jan 27, 2017
anthonysena added a commit that referenced this pull request Feb 22, 2017
* Apache Shiro integration.

* Reflect HTTP verb normalization.

* Final updates to Shiro implementation
* Added hibernate dialect to POM.xml.
* Added schema qualifier for FK references in migraiton scripts

* Fixes #108 (#163)

* ignore IntelliJ files
add'l characterization/summarization work
added SQL files for summary service from Achilles::ExportToJSON
added data transfer objects (DTOs)
modified CDMResultsService, made several sql translation changes, moved
mappers and DTOs to report package in preparation for refactoring.
added add'l DTOs to report package and stubbed out service and runner classes.
fixed imports in some DTOs and RowMappers

* Use same method (getTreemap) for all (non-temporal) treemaps
Add generic row mapper, text hack impls
made several sql translation-related changes
Use same method (getTreemap) for all (non-temporal) treemaps
Use AS keyword in all cdm report query aliases
Remove text hack and camel case column names in cdm report queries
Replace all treemap endpoints with a single generic implementation
 * Rename all treemap CDM report files to treemap.sql
 * Enquote aliases in CDM report queries to preserve case
 * Add GenericRowMapper ctor with ObjectMapper for performance
 * CDMResultsAnalysisRunner.getTreemap returns ArrayNode

Fix condition CDM results queries (by concept)

 * include conceptId parameter
 * rename sqlAgeAtFirstDiagnosis to sqlAgeAtFirstOccurrence
 * modify sqlConditionsByType to check vocabulary_id, not domain_id
 * cast xCalendarYear to INT in sqlPrevalenceByGenderAgeYear

added fixes to row mapping in /person and dashboard

implemented /achillesheel, /datadensity
started implementation of /death
refactored CohortAttributeMapper --> CDMAttributeMapper
created new report data objects
drop unused/superfluous CDMResultsAnalysisRunner

fixed /datadensity

Fix queries associated with generic drilldown reports

 * Data types include conditionera, drug, drugera, measurement, observation, procedure, visit
 * Queries include AgeAtFirstOccurrence, PrevalenceByGenderAgeYear, ByType, ByMonth
 * Include parameter @conceptId
 * Cast xCalendarYear to INT (where applicable)

Remove obsoleted code from CDMResultsService (activates observation reports)

Standardize names of "by type" query files for cdm reports to sqlByType.sql

Applies to condition, drug, measurement, observation, procedure

Add cdm_database_schema to CDMResultsAnalysisRunner standard columns (for measurement treemap)

Fix typo in sqlVisitDurationByType.sql

cleaned up and changes /achillesheel --> /heel

	Add cdm_database_schema to CDMResultsAnalysisRunner standard columns as per mark-velez/* #e862d53

changed endpoint signature (/heel -->/achillesheel), fixed summary yob and yob in person report

fixed null totalRecords element in Data Density report

added summary to dashboard report in CDM results service

implemented death report

removed superfluous code (imports, methods, etc)

Reorganize sql files for cdm drilldowns (to reduce text wrangling) (#2)

* Remove sql prefix from files names
 * Camel-case filename
 * Move drilldown files to folders
 * Delete treemap files that were reverted back

removed unused method - renderDrillDownSql()

changed access modifier on several fields and methods

removed unused test and related resource

made post-rebase reconciliations in prep for PR

* Fixes #167 (#168)

* Fixes #170

* removed extraneous folder

* Added support for user-defined OP start and end dates.

* Route cleanup.

Made service routes for CDMResutlsService, CohortResultsService, EvidenceService and Vocabulary service to stem from the url of the service (such as /cdmresults) vs. stemming from a source key.

Added a default handler for vocabulary searching as an example of where it's advantageous to use a route of /vocabulary/search/{query} directly instead of coding to a specific source key (which may not always be available).

Fixes #173.

* Exposing default routes for vocabulary service endpoints that previously required a source key.

* Added WebAPI endpoint: /info.

Currently only contains version information, stored in pom.xml property 'webapi.version'.

Fixes #176.

* Fixes #177

* Fixes #178
@t-abdul-basser t-abdul-basser deleted the achilles-integration-pr branch August 28, 2017 17:30
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.

3 participants