[BI-1818] View exp: Obs dataset tab, details, and summary stats#268
[BI-1818] View exp: Obs dataset tab, details, and summary stats#268
Conversation
| throw new DoesNotExistException("list not returned from BrAPI service"); | ||
| } | ||
|
|
||
| for (BrAPIListSummary list: lists) { |
There was a problem hiding this comment.
In this for loop, I think you should also ensure that the program ID matches the program.id value that was passed in to the method.
There was a problem hiding this comment.
ok, that check was added
| private String name; | ||
| private String description; | ||
| private String size; | ||
| private ExternalReferenceSource externalReferenceSource; |
There was a problem hiding this comment.
I don't think this should be the enum that we have internally, but should be a String. This would make the query params BrAPI compliant
There was a problem hiding this comment.
ok, made the change
| if (type == null) { | ||
| type = BrAPIListTypes.GERMPLASM; | ||
| } | ||
| ExternalReferenceSource source = queryParams.getExternalReferenceSource() == null ? |
There was a problem hiding this comment.
This should be a String instead of the BI enum
| ExternalReferenceSource xrefSource, | ||
| UUID xrefId, |
There was a problem hiding this comment.
I think both of these fields should be of type String
There was a problem hiding this comment.
ok, made the change
| type = BrAPIListTypes.GERMPLASM; | ||
| } | ||
| String source = queryParams.getExternalReferenceSource() == null ? | ||
| ExternalReferenceSource.PROGRAMS.getName() : queryParams.getExternalReferenceSource(); |
There was a problem hiding this comment.
if the externalReferenceSource is null, then the source value will be "programs". I think the default code should be referenceSource + ExternalReferenceSource.PROGRAMS.getName()
| List<BrAPIListSummary> lists = listDAO.getListByTypeAndExternalRef( | ||
| type, | ||
| program.getId(), | ||
| String.format("%s/%s", referenceSource, xrefSource), |
There was a problem hiding this comment.
I think this will cause problems. If the xrefSource coming in is "breedinginsight.net/program", then this line will result in a string of "breedinginsight.net/breedinginsight.net/program"
| String source = queryParams.getExternalReferenceSource() == null ? | ||
| String.format("%s/%s", referenceSource, ExternalReferenceSource.PROGRAMS.getName()) : | ||
| queryParams.getExternalReferenceSource(); | ||
| UUID id = queryParams.getExternalReferenceId() == null || queryParams.getExternalReferenceId().isBlank() ? |
There was a problem hiding this comment.
I tried testing with only setting the externalReferenceSource query param and got no results back. This line appears to be the reason why. I don't think a default should be set for this (maybe not even for the externalReferenceSource either). Changing this to allow nulls may require changes to downstream code in this call stack
There was a problem hiding this comment.
I removed the default settings for the xref params in ListController, added checks in BrAPIListService so that the a search request could be formed from the params, and added BrAPIListDAO::getListsBySearch. The xrefSource and XrefId params can now be set independently and return any lists. The service and DAO are set up to treat listType as an independent search param, too; however, the default value of germplasm is still being set in the controller unitl the existing germplasm code is updated. So, just setting xrefSource=breeding-insight.net/dataset will return no data because a listType=germplasm is also being used in the search.
75ff82b to
84e14c7
Compare
Description
Story: BI-1818
In ExperimentController created a method to fetch a dataset’s data for an experiment
method: GET
url: /${micronaut.bi.api.version}/programs/{programId}/experiments/{experimentId}/datasets/{datasetId}?stats=[true|false]
the result field of the response is of typeDataset
In BrAPITrialService created a method to fetch a dataset’s data for an experiment parameters
Dependencies
these backend changes are a dependency for BI-1645
Testing
Checklist: