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

Only review recent requests, not all 11,000 requests in the LIMS #344

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,23 @@ public String execute() {
}
return String.format("%s is not cmo request", requestId);
}
// if projectid is not passed to the endpoint, run for all requests in LIMS.
List<DataRecord> requests = dataRecordManager.queryDataRecords("Request", "IsCmoRequest = 0", user);


// if projectid is not passed to the endpoint, run for all requests in LIMS created after Sept. 2023
List<DataRecord> requests = dataRecordManager.queryDataRecords("Request", "IsCmoRequest = 0 AND ReceivedDate > 1692367976923", user);
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it better to restrict it compared to the current time?

log.info("Total Requests: " + requests.size());
for (DataRecord request : requests) {
DataRecord[] samples = request.getChildrenOfType(SampleModel.DATA_TYPE_NAME, user);
if (samples.length == 0) {
if (samples == null || samples.length == 0) {
continue;
}
//get parent project's projectid for request.
String requestId = (String)getValueFromDataRecord(request, RequestModel.REQUEST_ID, "String", user);
String projectId = requestId.split("_")[0];
boolean bicAnalysis = false;
if(request.getValue(RequestModel.BICANALYSIS, user) != null){
if (request.getValue(RequestModel.BICANALYSIS, user) != null){
bicAnalysis = request.getBooleanVal(RequestModel.BICANALYSIS, user);
}
String requestId = (String)getValueFromDataRecord(request, RequestModel.REQUEST_ID, "String", user);
String projectId = requestId.split("_")[0];
String contactEmail = (String)getValueFromDataRecord(request, RequestModel.MAIL_TO, "String", user);
DataRecord sample = samples[0];
String sampleName = (String)getValueFromDataRecord(sample, SampleModel.OTHER_SAMPLE_ID, "String", user);
Expand Down