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

Cohort Definition Validation Feature API #1929

Draft
wants to merge 60 commits into
base: master
Choose a base branch
from

Conversation

charhart
Copy link
Contributor

This PR complements this Atlas pull request. It includes the needed tables and API calls to create validation studies. This feature corresponds to this ticket.

@BSCrumpton and @jduke99 can answer questions and provide additional details about this pull request.

jduke99 and others added 30 commits February 1, 2021 12:04
…ntity. Also added additional param searches
@chrisknoll
Copy link
Collaborator

no need to worry about that test error, it seems to be something related to the OS used to run the unit tests on the CI env, and temporary directories. I'd like that fixed, but you can ignore it for purposes of this PR.

@@ -0,0 +1,11 @@
IF OBJECT_ID('@results_schema.annotation_result', 'U') IS NULL
CREATE TABLE @results_schema.annotation_result(
result_id integer NOT NULL AUTO_INCREMENT,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't believe this is appropriate. Very few MMP systems (redshift, pdw, impala) support an AUTO_INCREMENT field type.

For CDM results type of data, you just have to provide your own row id (or multi-column row id) that is sent to the server via insert into....

Choose a reason for hiding this comment

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

@chrisknoll I believe my last push (aa9f441) should have fixed this. We're testing now!

…id from results table as it isn't necessary
@chrisknoll
Copy link
Collaborator

2 open issues that we need to investigate are:

  • Security
  • Internationalization

@anthonysena and @chrisknoll will look at adding the elements to secure the endpoints, and provide a PR or branch that will add the changes to this PR branch (so not to interrupt anything @cahilton is woring on here), and after that we will look at the changes required for internationalization.

@chrisknoll
Copy link
Collaborator

@cahilton could you merge your upsstream branch from the latest commits from master and then merge that into your PR branch? I want to ensure we're working off a PR that is based off of the latest commits to master.

@chrisknoll
Copy link
Collaborator

Actually, I take it back, I think since commits were already merged into your master's branch on your fork, the git history is already set on your master's history, so there's no real easy way to adjust that. In the future, please do new work on a feature branch and make your PRs based off that branch instead of making changes directly into master. When dealing with multiple forks from different contributors, if everyone pushes their own chagnes into their own master branch, it gets really difficult to synchronize it.

@chrisknoll
Copy link
Collaborator

chrisknoll commented Oct 21, 2021

I think I've identified the following endpoints (and HTTP verbs associated):

GET:annotations/
GET:annotations/{id}
GET:annotations/fullquestion
POST:annotations/
POST:annotations/sample
POST:annotation/answers
GET:annotations/navigation
GET:annotations/questions
POST:annotations/questions
GET:annotations/results/
GET:annotations/results/{id}
GET:annotations/results/completeResults
GET:annotations/sets
POST:annotations/sets
GET:annotations/getsets
GET:annotations/deleteSet/{questionSetId}

I can create the migration script that registers these to shiro, but wanted to ask about one of them:

POST:annotation/answers

In this one case, the path is singular annotation instead of plural annotations of the others. I think this could be confusing. Can the endpoint in AnswerController be modified to specify annotations as the root? Atlas PR will probably need to be modified to handle this change.

Let me know because I need a final list of endpoint paths in order to apply the migration script.

@cahilton

@chrisknoll
Copy link
Collaborator

chrisknoll commented Nov 8, 2021

Update: I've looked at other places of annotations, and most, if not all, are singular, so I'm updating the path to be annotation and so here is the list of endpoints:

GET:annotation/
GET:annotation/{id}
GET:annotation/fullquestion
POST:annotation/
POST:annotation/sample
POST:annotation/answers
GET:annotation/navigation
GET:annotation/questions
POST:annotation/questions
GET:annotation/results/
GET:annotation/results/{id}
GET:annotation/results/completeResults
GET:annotation/sets
POST:annotation/sets
GET:annotation/getsets
GET:annotation/deleteset/{questionSetId}

It would be helpful if the Atlas PR could be updated to reflect these changes. Also note, the case-change in annotation/deleteset.

@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public void addResult(@RequestBody String payload) {
System.out.println(payload);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't usually parse raw JSON text from the POST. Instead, you define a class that represents the data structure, and the service will automatically serialize the request body into the JSON form.

In addition, we shouldn't leave 'System.out.println' in the sourcecode. Use a logger.

) {
List<Annotation> returnAnnotations=null;
if (cohortSampleId != 0 && subjectId != 0 && setId != 0) {
System.out.println("made it into the search function");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need to find and remove all System.out calls and move to logging or remove entirely.

@Path("answers")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public void addQuestion(Answer answer) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

/answers maps over to a function addQuestion which calls answerService.addAnswer?

chrisknoll and others added 2 commits November 10, 2021 13:31
Renamed end point from 'annotations' to 'annotation'
@anthonysena anthonysena added this to the V2.12 milestone Feb 15, 2022
@chrisknoll chrisknoll self-assigned this Feb 21, 2022
@chrisknoll chrisknoll modified the milestones: V2.12, 2.x Backlog Jul 27, 2022
@chrisknoll chrisknoll marked this pull request as draft May 23, 2023 17:26
@anthonysena anthonysena removed this from the [LEGACY] 2.x Backlog milestone Jun 13, 2023
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.

5 participants