-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/bi 1189 - 4.0 Exp Preview & Commit: Create Exp Independent Variables #187
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e77ac44
[BI-1146] WIP
davedrp 8245f0b
[BI-1146] experiment import: fix import template migration
f345aab
[BI-1146] support for summary stats
davedrp ef1d80d
[BI-1146] refactor. added code for coditionally required cells
davedrp 4b9e373
[BI-1146] refactor. added getNewBrapiData()
davedrp 565be9f
[BI-1146] remove unneeded Classes, clean up code
davedrp 15c37be
[BI-1146] added validation for unique observation Unit Id
davedrp 3facc3d
[BI-1146] Fixed bug. If spreadsheet cell is 'T', tableSaw assumes t…
davedrp 0f21719
[BI-1189] WIP
davedrp 2520ecc
[BI-1189] added studySequence to Program model object
davedrp d2193e8
BI-1189 WIP
davedrp 84fb5a1
[BI-1189] added external references
davedrp 21c775d
[BI-1189] fixed bugs, convert year to season DbId
davedrp ab9cad4
[BI-1189] Add experiment sequence number to study name
davedrp 4bf78f1
[BI-1189] remove references to study sequence
davedrp b87056a
[BI-1189] caching for year-to-seasonDbId
davedrp c56f5a7
[BI-1189]Addrssed the PR comments by HMS17
davedrp 4d6ac34
[BI-1189]Addrssed more PR comments by HMS17
davedrp 14e5f7b
[BI-1189] responses of PR comments from Chris T
davedrp 4ca4dfe
[BI-1189]Addrssed more PR comments by Chris T
davedrp ae77f3b
Merge branch 'future/1.0' into feature/BI-1189
timparsons 71b5351
[BI-1189] appending experiment number to study names when searching f…
timparsons 2bfdf31
[BI-1189] added experiment sequence number to study name
davedrp 5d3ac00
[BI-1189] fixed bug. Added ExternalReferenceSource.java to emumerate …
davedrp 6bfe649
[BI-1189] two small changes suggested by Tim in PR
davedrp be90382
Merge branch 'future/1.0' into feature/BI-1189
davedrp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
73 changes: 73 additions & 0 deletions
73
src/main/java/org/breedinginsight/brapps/importer/daos/BrAPISeasonDAO.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| package org.breedinginsight.brapps.importer.daos; | ||
|
|
||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.brapi.client.v2.ApiResponse; | ||
| import org.brapi.client.v2.model.exceptions.ApiException; | ||
| import org.brapi.client.v2.model.queryParams.core.SeasonQueryParams; | ||
| import org.brapi.client.v2.modules.core.ListsApi; | ||
| import org.brapi.client.v2.modules.core.SeasonsApi; | ||
| import org.brapi.v2.model.BrAPIExternalReference; | ||
| import org.brapi.v2.model.BrAPIResponse; | ||
| import org.brapi.v2.model.BrAPIResponseResult; | ||
| import org.brapi.v2.model.core.BrAPIListSummary; | ||
| import org.brapi.v2.model.core.BrAPIListTypes; | ||
| import org.brapi.v2.model.core.BrAPISeason; | ||
| import org.brapi.v2.model.core.request.BrAPIListNewRequest; | ||
| import org.brapi.v2.model.core.request.BrAPIListSearchRequest; | ||
| import org.brapi.v2.model.core.response.BrAPIListsSingleResponse; | ||
| import org.brapi.v2.model.core.response.BrAPISeasonListResponse; | ||
| import org.brapi.v2.model.core.response.BrAPISeasonListResponseResult; | ||
| import org.brapi.v2.model.pheno.BrAPIObservation; | ||
| import org.breedinginsight.brapps.importer.model.ImportUpload; | ||
| import org.breedinginsight.daos.ProgramDAO; | ||
| import org.breedinginsight.utilities.BrAPIDAOUtil; | ||
|
|
||
| import javax.inject.Inject; | ||
| import java.util.ArrayList; | ||
| import java.util.Arrays; | ||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| @Slf4j | ||
| public class BrAPISeasonDAO { | ||
|
|
||
| private ProgramDAO programDAO; | ||
| private ImportDAO importDAO; | ||
|
|
||
| @Inject | ||
| public BrAPISeasonDAO(ProgramDAO programDAO, ImportDAO importDAO) { | ||
| this.programDAO = programDAO; | ||
| this.importDAO = importDAO; | ||
| } | ||
|
|
||
| public List<BrAPISeason> getSeasonByYear(String year, UUID programId) throws ApiException { | ||
| SeasonsApi api = new SeasonsApi(programDAO.getCoreClient(programId)); | ||
| SeasonQueryParams queryParams = | ||
| SeasonQueryParams.builder() | ||
| .year( year ) | ||
| .pageSize( 10000 ) | ||
| .build(); | ||
| List<BrAPISeason> seasons = new ArrayList<>(); | ||
| ApiResponse<BrAPISeasonListResponse> apiResponse = api.seasonsGet( queryParams ); | ||
| BrAPISeasonListResponse seasonListResponse = apiResponse.getBody(); | ||
| BrAPISeasonListResponseResult result = seasonListResponse.getResult(); | ||
| seasons = result.getData(); | ||
|
|
||
| return seasons; | ||
| } | ||
|
|
||
| public BrAPISeason addOneSeason(BrAPISeason season, UUID programId) throws ApiException { | ||
| BrAPISeason resultSeason = null; | ||
| SeasonsApi api = new SeasonsApi(programDAO.getCoreClient(programId)); | ||
|
|
||
| ApiResponse<BrAPISeasonListResponse> apiResponse = api.seasonsPost(Arrays.asList(season)); | ||
| BrAPISeasonListResponse seasonListResponse = apiResponse.getBody(); | ||
| BrAPISeasonListResponseResult result = seasonListResponse.getResult(); | ||
| List<BrAPISeason> seasons = result.getData(); | ||
| if (seasons.size() > 0) { | ||
| resultSeason = seasons.get(0); | ||
| } | ||
| return resultSeason; | ||
| } | ||
|
|
||
| } | ||
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
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
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
18 changes: 18 additions & 0 deletions
18
src/main/java/org/breedinginsight/brapps/importer/services/ExternalReferenceSource.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package org.breedinginsight.brapps.importer.services; | ||
|
|
||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| public enum ExternalReferenceSource { | ||
| PROGRAMS("programs"), | ||
| TRIALS("trials"), | ||
| STUDIES("studies"), | ||
| OBSERVATION_UNITS("observationunits"); | ||
|
|
||
| private String name; | ||
|
|
||
| ExternalReferenceSource(String name) { | ||
| this.name = name; | ||
| } | ||
| } | ||
|
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.