use of gov.cms.ab2d.common.model.JobOutput in project ab2d by CMSgov.
the class TestUtil method createJobOutput.
public JobOutput createJobOutput(String testFile) {
JobOutput jobOutput = new JobOutput();
jobOutput.setFhirResourceType(EOB);
jobOutput.setFilePath(testFile);
jobOutput.setError(false);
jobOutput.setChecksum("testoutput");
jobOutput.setFileLength(20L);
return jobOutput;
}
use of gov.cms.ab2d.common.model.JobOutput in project ab2d by CMSgov.
the class StatusCommon method getJobCompletedResponse.
private JobCompletedResponse getJobCompletedResponse(JobPollResult jobPollResult, String jobUuid, HttpServletRequest request, String apiPrefix) {
final JobCompletedResponse resp = new JobCompletedResponse();
final String jobStartedAt = jobPollResult.getTransactionTime();
resp.setTransactionTime(jobStartedAt);
resp.setRequest(jobPollResult.getRequestUrl());
resp.setRequiresAccessToken(true);
resp.setOutput(jobPollResult.getJobOutputs().stream().filter(o -> !o.getError()).map(o -> {
List<JobCompletedResponse.FileMetadata> valueOutputs = generateValueOutputs(o);
return new JobCompletedResponse.Output(o.getFhirResourceType(), getUrlPath(jobUuid, o.getFilePath(), request, apiPrefix), valueOutputs);
}).toList());
resp.setError(jobPollResult.getJobOutputs().stream().filter(JobOutput::getError).map(o -> {
List<JobCompletedResponse.FileMetadata> valueOutputs = generateValueOutputs(o);
return new JobCompletedResponse.Output(o.getFhirResourceType(), getUrlPath(jobUuid, o.getFilePath(), request, apiPrefix), valueOutputs);
}).toList());
return resp;
}
Aggregations