Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release-1.51.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
drferreira committed Mar 31, 2021
2 parents 55167e6 + 425ed1e commit fa596c3
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class ExamResult {
private String value;
private Boolean isValid;
private String releaseDate;
private String realizationDate;
private String cutOffValue;
private List<Observation> observations;

Expand All @@ -33,6 +34,9 @@ public class ExamResult {
private Sex sex;
private ImmutableDate birthdate;

public String getRealizationDate() { return this.realizationDate; }
public void setRealizationDate(String realizationDate) { this.realizationDate = realizationDate; }

public List<ExtraVariable> getExtraVariables() {
return this.extraVariables;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public enum ExamUploadExtractionHeaders {
RESULT_NAME("result_name"),
RESULT("result"),
RELEASE_DATE("release_date"),
REALIZATION_DATE("realization_date"),
OBSERVATIONS("observations"),
CUTOFFVALUE("cutoff_value"),
EXTRAVARIABLES("extra_variables");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ private void buildHeader() {
this.headers.add(ExamUploadExtractionHeaders.RESULT_NAME.getValue());
this.headers.add(ExamUploadExtractionHeaders.RESULT.getValue());
this.headers.add(ExamUploadExtractionHeaders.RELEASE_DATE.getValue());
this.headers.add(ExamUploadExtractionHeaders.REALIZATION_DATE.getValue());
this.headers.add(ExamUploadExtractionHeaders.OBSERVATIONS.getValue());
this.headers.add(ExamUploadExtractionHeaders.CUTOFFVALUE.getValue());
this.headers.add(ExamUploadExtractionHeaders.EXTRAVARIABLES.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ private List<String> createRecordsAnswers(ParticipantExamUploadResultExtraction
answers.add(record.getResultName());
answers.add(record.getValue());
answers.add(record.getReleaseDate());
answers.add(record.getRealizationDate());

String observations = "";
for (Observation observation : record.getObservations()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class ParticipantExamUploadResultExtraction {
private String resultName;
private String value;
private String releaseDate;
private String realizationDate;
private List<Observation> observations;
private String cutOffValue;
private List<ExtraVariable> extraVariables;
Expand All @@ -33,6 +34,10 @@ public String getReleaseDate() {
return releaseDate;
}

public String getRealizationDate() {
return realizationDate;
}

public String getCode() {
return code;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public void getHeaders_method_should_return_list_with_information_headers() {
contains = headers.contains(ExamUploadExtractionHeaders.RELEASE_DATE.getValue());
Assert.assertTrue(contains);

contains = headers.contains(ExamUploadExtractionHeaders.REALIZATION_DATE.getValue());
Assert.assertTrue(contains);

contains = headers.contains(ExamUploadExtractionHeaders.OBSERVATIONS.getValue());
Assert.assertTrue(contains);
}
Expand Down Expand Up @@ -77,6 +80,9 @@ public void getHeaders_method_should_return_list_with_expected_order() {
Assert.assertEquals(ExamUploadExtractionHeaders.RELEASE_DATE.getValue(), header);

header = headers.get(6);
Assert.assertEquals(ExamUploadExtractionHeaders.REALIZATION_DATE.getValue(), header);

header = headers.get(7);
Assert.assertEquals(ExamUploadExtractionHeaders.OBSERVATIONS.getValue(), header);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class ExamUploadExtractionRecordsFactoryTest {
private static final String VALUE_1 = "10";
private static final String VALUE_2 = "20";
private static final String RELEASE_DATE = "1000330";
private static final String REALIZATION_DATE = "1000330";
private static final String CUT_OFF_VALUE = "1000330";

private List<String> headers;
Expand Down Expand Up @@ -50,6 +51,7 @@ public void buildResultInformation_method_should_call_createRecordsAnswers_metho
CODE, EXAM_NAME, RESULT_NAME,
VALUE_1,
RELEASE_DATE,
REALIZATION_DATE,
observations,
CUT_OFF_VALUE,
extraVariables);
Expand All @@ -64,7 +66,7 @@ public void getRecords_method_should_only_return_one_line() {
List<ExtraVariable> extraVariables = new ArrayList<ExtraVariable>();
extraVariables.add(new ExtraVariable("any", "any"));
this.records.add(this.createFakeParticipantExamUploadRecord(RECRUITMENT_NUMBER, CODE, EXAM_NAME, RESULT_NAME, VALUE_1,
RELEASE_DATE, observations, CUT_OFF_VALUE, extraVariables));
RELEASE_DATE, REALIZATION_DATE, observations, CUT_OFF_VALUE, extraVariables));
this.examUploadExtractionRecordsFactory.buildResultInformation();
List<List<Object>> records = this.examUploadExtractionRecordsFactory.getRecords();

Expand All @@ -77,7 +79,7 @@ public void getRecords_method_should_return_list_with_expected_values() {
List<ExtraVariable> extraVariables = new ArrayList<ExtraVariable>();
extraVariables.add(new ExtraVariable("any", "any"));
this.records.add(this.createFakeParticipantExamUploadRecord(RECRUITMENT_NUMBER, CODE, EXAM_NAME, RESULT_NAME, VALUE_1,
RELEASE_DATE, observations, CUT_OFF_VALUE, extraVariables));
RELEASE_DATE, REALIZATION_DATE, observations, CUT_OFF_VALUE, extraVariables));
this.examUploadExtractionRecordsFactory.buildResultInformation();
List<List<Object>> records = this.examUploadExtractionRecordsFactory.getRecords();

Expand All @@ -88,10 +90,11 @@ public void getRecords_method_should_return_list_with_expected_values() {
Assert.assertEquals(RESULT_NAME, results.get(3));
Assert.assertEquals(VALUE_1, results.get(4));
Assert.assertEquals(RELEASE_DATE, results.get(5));
Assert.assertEquals("", results.get(6));
Assert.assertEquals(REALIZATION_DATE, results.get(6));
Assert.assertEquals("", results.get(7));
}

private ParticipantExamUploadResultExtraction createFakeParticipantExamUploadRecord(Long rn, String code, String examName, String resultName, String value, String releaseDate, List<Observation> observations, String cutOffValue, List<ExtraVariable> extraVariables) {
private ParticipantExamUploadResultExtraction createFakeParticipantExamUploadRecord(Long rn, String code, String examName, String resultName, String value, String releaseDate, String realizationDate, List<Observation> observations, String cutOffValue, List<ExtraVariable> extraVariables) {
ParticipantExamUploadResultExtraction participantExamUploadRecordExtraction = new ParticipantExamUploadResultExtraction();

Whitebox.setInternalState(participantExamUploadRecordExtraction, "recruitmentNumber", rn);
Expand All @@ -100,6 +103,7 @@ private ParticipantExamUploadResultExtraction createFakeParticipantExamUploadRec
Whitebox.setInternalState(participantExamUploadRecordExtraction, "resultName", resultName);
Whitebox.setInternalState(participantExamUploadRecordExtraction, "value", value);
Whitebox.setInternalState(participantExamUploadRecordExtraction, "releaseDate", releaseDate);
Whitebox.setInternalState(participantExamUploadRecordExtraction, "realizationDate", realizationDate);
Whitebox.setInternalState(participantExamUploadRecordExtraction, "observations", observations);
Whitebox.setInternalState(participantExamUploadRecordExtraction, "cutOffValue", cutOffValue);
Whitebox.setInternalState(participantExamUploadRecordExtraction, "extraVariables", extraVariables);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class ParticipantExamUploadRecordExtractionTest {
private static final String RESULT_NAME = "1000330";
private static final String VALUE = "1000330";
private static final String RELEASE_DATE = "1000330";
private static final String REALIZATION_DATE = "1000330";
private List<Observation> observations;
private static final Long RECRUITMENT_NUMBER = 1000330L;
private ParticipantExamUploadRecordExtraction participantExamUploadRecordExtraction;
Expand Down Expand Up @@ -48,6 +49,7 @@ private List<ParticipantExamUploadResultExtraction> createFakeParticipantExamUpl
Whitebox.setInternalState(result, "resultName", RESULT_NAME);
Whitebox.setInternalState(result, "value", VALUE);
Whitebox.setInternalState(result, "releaseDate", RELEASE_DATE);
Whitebox.setInternalState(result, "realizationDate", REALIZATION_DATE);
Whitebox.setInternalState(result, "observations", observations);
results.add(result);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class ParticipantExamUploadResultExtractionTest {
private static final String RESULT_NAME = "1000330";
private static final String VALUE = "1000330";
private static final String RELEASE_DATE = "1000330";
private static final String REALIZATION_DATE = "1000330";
private List<Observation> observations;

private ParticipantExamUploadResultExtraction participantExamUploadResultExtraction;
Expand All @@ -27,6 +28,7 @@ public void setup() {
Whitebox.setInternalState(participantExamUploadResultExtraction, "resultName", RESULT_NAME);
Whitebox.setInternalState(participantExamUploadResultExtraction, "value", VALUE);
Whitebox.setInternalState(participantExamUploadResultExtraction, "releaseDate", RELEASE_DATE);
Whitebox.setInternalState(participantExamUploadResultExtraction, "realizationDate", REALIZATION_DATE);
Whitebox.setInternalState(participantExamUploadResultExtraction, "observations", observations);
}

Expand All @@ -36,6 +38,7 @@ public void getters_methods_should_return_values_expected() {
Assert.assertEquals(RESULT_NAME, participantExamUploadResultExtraction.getResultName());
Assert.assertEquals(VALUE, participantExamUploadResultExtraction.getValue());
Assert.assertEquals(RELEASE_DATE, participantExamUploadResultExtraction.getReleaseDate());
Assert.assertEquals(REALIZATION_DATE, participantExamUploadResultExtraction.getRealizationDate());
Assert.assertEquals(observations, participantExamUploadResultExtraction.getObservations());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public ExamResultQueryBuilder getGroupOfExamResultsToExtraction() {
" \"resultName\":\"$resultName\",\n" +
" \"value\":\"$value\",\n" +
" \"releaseDate\":\"$releaseDate\",\n" +
" \"realizationDate\":\"$realizationDate\",\n" +
" \"observations\":\"$observations\",\n" +
" \"cutOffValue\":\"$cutOffValue\",\n" +
" \"extraVariables\":\"$extraVariables\"\n" +
Expand Down

0 comments on commit fa596c3

Please sign in to comment.