1818import java .util .ArrayList ;
1919import java .util .Collections ;
2020import java .util .Comparator ;
21+ import java .util .Date ;
2122import java .util .HashMap ;
2223import java .util .List ;
2324import java .util .Map ;
@@ -72,7 +73,9 @@ public List<BAGExportCaseDto> getCaseExportList(int first, int max) {
7273 Join <Case , Person > person = caseJoins .getPerson ();
7374 Join <Person , Location > homeAddress = caseJoins .getPersonAddress ();
7475
76+ Expression <String > homeAddressCountry = cb .literal (TODO_VALUE );
7577 Expression <String > mobileNumber = cb .literal (TODO_VALUE );
78+ Expression <String > activityMappingYn = cb .literal (TODO_VALUE );
7679
7780 cq .multiselect (
7881 caseRoot .get (Case .CASE_ID_ISM ),
@@ -84,6 +87,7 @@ public List<BAGExportCaseDto> getCaseExportList(int first, int max) {
8487 homeAddress .get (Location .HOUSE_NUMBER ),
8588 homeAddress .get (Location .CITY ),
8689 homeAddress .get (Location .POSTAL_CODE ),
90+ homeAddressCountry ,
8791 person .get (Person .PHONE ),
8892 mobileNumber ,
8993 person .get (Person .EMAIL_ADDRESS ),
@@ -92,14 +96,23 @@ public List<BAGExportCaseDto> getCaseExportList(int first, int max) {
9296 person .get (Person .BIRTHDATE_MM ),
9397 person .get (Person .BIRTHDATE_YYYY ),
9498 person .get (Person .OCCUPATION_TYPE ),
99+
95100 caseJoins .getSymptoms ().get (Symptoms .SYMPTOMATIC ),
96101 caseRoot .get (Case .COVID_TEST_REASON ),
97102 caseRoot .get (Case .COVID_TEST_REASON_DETAILS ),
98103 caseJoins .getSymptoms ().get (Symptoms .ONSET_DATE ),
104+
105+ activityMappingYn ,
106+
99107 caseRoot .get (Case .CONTACT_TRACING_FIRST_CONTACT_DATE ),
108+
109+ caseRoot .get (Case .WAS_IN_QUARANTINE_BEFORE_ISOLATION ),
110+ caseRoot .get (Case .QUARANTINE_REASON_BEFORE_ISOLATION ),
111+ caseRoot .get (Case .QUARANTINE_REASON_BEFORE_ISOLATION_DETAILS ),
112+
100113 caseRoot .get (Case .QUARANTINE ),
101114 caseRoot .get (Case .QUARANTINE_TYPE_DETAILS ),
102- caseRoot .get (Case .FOLLOW_UP_UNTIL ),
115+ caseRoot .get (Case .QUARANTINE_FROM ),
103116 caseRoot .get (Case .QUARANTINE_TO ),
104117 caseRoot .get (Case .END_OF_ISOLATION_REASON ),
105118 caseRoot .get (Case .END_OF_ISOLATION_REASON_DETAILS ));
@@ -151,20 +164,26 @@ public List<BAGExportCaseDto> getCaseExportList(int first, int max) {
151164 List <Location > addresses = personAddresses .getOrDefault (caze .getPersonId (), Collections .emptyList ());
152165
153166 addresses .stream ().filter (a -> PersonAddressType .PLACE_OF_WORK .equals (a .getAddressType ())).findFirst ().ifPresent (workAddress -> {
167+ caze .setWorkPlaceName (TODO_VALUE );
154168 caze .setWorkPlaceStreet (workAddress .getStreet ());
155169 caze .setWorkPlaceStreetNumber (workAddress .getHouseNumber ());
156- caze .setWorkPlaceLocation (workAddress .getCity ());
170+ caze .setWorkPlaceCity (workAddress .getCity ());
157171 caze .setWorkPlacePostalCode (workAddress .getPostalCode ());
172+ caze .setWorkPlaceCountry (TODO_VALUE );
158173 });
159174
160- caze .setInfectionLocationYn (YesNoUnknown .NO );
175+ caze .setExposureLocationYn (YesNoUnknown .NO );
161176 addresses .stream ().filter (a -> PersonAddressType .PLACE_OF_EXPOSURE .equals (a .getAddressType ())).findFirst ().ifPresent (exposureAddress -> {
162- caze .setInfectionLocationYn (YesNoUnknown .YES );
163-
164- caze .setInfectionLocationStreet (exposureAddress .getStreet ());
165- caze .setInfectionLocationStreetNumber (exposureAddress .getHouseNumber ());
166- caze .setInfectionLocationCity (exposureAddress .getCity ());
167- caze .setInfectionLocationPostalCode (exposureAddress .getPostalCode ());
177+ caze .setExposureLocationYn (YesNoUnknown .YES );
178+ caze .setExposureCountry (TODO_VALUE );
179+ caze .setExposureLocationType (exposureAddress .getFacilityType ());
180+ caze .setExposureLocationFlightDetail (exposureAddress .getFacilityDetails ());
181+ caze .setExposureLocationName (TODO_VALUE );
182+ caze .setExposureLocationStreet (exposureAddress .getStreet ());
183+ caze .setExposureLocationStreetNumber (exposureAddress .getHouseNumber ());
184+ caze .setExposureLocationCity (exposureAddress .getCity ());
185+ caze .setExposureLocationPostalCode (exposureAddress .getPostalCode ());
186+ caze .setExposureLocationFlightDetail (TODO_VALUE );
168187 });
169188
170189 addresses .stream ()
@@ -175,6 +194,7 @@ public List<BAGExportCaseDto> getCaseExportList(int first, int max) {
175194 caze .setIsolationLocationStreetNumber (isolationAddress .getHouseNumber ());
176195 caze .setIsolationLocationCity (isolationAddress .getCity ());
177196 caze .setIsolationLocationPostalCode (isolationAddress .getPostalCode ());
197+ caze .setIsolationLocationCountry (TODO_VALUE );
178198 });
179199
180200 List <Sample > caseSamples = samples .get (caze .getCaseId ());
@@ -208,8 +228,10 @@ public List<BAGExportContactDto> getContactExportList(int first, int max) {
208228
209229 Join <Contact , Person > person = contactJoins .getPerson ();
210230 Join <Person , Location > homeAddress = contactJoins .getPersonAddress ();
231+ Join <Contact , Case > caze = contactJoins .getCaze ();
211232
212233 Expression <String > mobileNumber = cb .literal (TODO_VALUE );
234+ Expression <Date > caseLinkContactDate = cb .nullLiteral (Date .class );
213235
214236 cq .multiselect (
215237 contactRoot .get (Contact .ID ),
@@ -222,15 +244,17 @@ public List<BAGExportContactDto> getContactExportList(int first, int max) {
222244 homeAddress .get (Location .POSTAL_CODE ),
223245 person .get (Person .PHONE ),
224246 mobileNumber ,
225- person .get (Person .EMAIL_ADDRESS ),
226247 person .get (Person .SEX ),
227248 person .get (Person .BIRTHDATE_DD ),
228249 person .get (Person .BIRTHDATE_MM ),
229250 person .get (Person .BIRTHDATE_YYYY ),
230251 person .get (Person .OCCUPATION_TYPE ),
231252 contactRoot .get (Contact .QUARANTINE ),
232253 contactRoot .get (Contact .QUARANTINE_TYPE_DETAILS ),
233- contactRoot .get (Contact .FOLLOW_UP_UNTIL ),
254+ caze .get (Case .CASE_ID_ISM ),
255+ caze .get (Case .ID ),
256+ caseLinkContactDate ,
257+ contactRoot .get (Contact .QUARANTINE_FROM ),
234258 contactRoot .get (Contact .QUARANTINE_TO ),
235259 contactRoot .get (Contact .END_OF_QUARANTINE_REASON ),
236260 contactRoot .get (Contact .END_OF_QUARANTINE_REASON_DETAILS ));
@@ -282,32 +306,24 @@ public List<BAGExportContactDto> getContactExportList(int first, int max) {
282306 List <Location > addresses = personAddresses .getOrDefault (contact .getPersonId (), Collections .emptyList ());
283307
284308 addresses .stream ().filter (a -> PersonAddressType .PLACE_OF_WORK .equals (a .getAddressType ())).findFirst ().ifPresent (workAddress -> {
285- contact .setWorkPlaceStreet (workAddress .getStreet ());
286- contact .setWorkPlaceStreetNumber (workAddress .getHouseNumber ());
287- contact .setWorkPlaceLocation (workAddress .getCity ());
309+ contact .setWorkPlaceName (TODO_VALUE );
288310 contact .setWorkPlacePostalCode (workAddress .getPostalCode ());
311+ contact .setWorkPlaceName (TODO_VALUE );
289312 });
290313
291- contact .setExposureLocationYn (YesNoUnknown .NO );
292314 addresses .stream ().filter (a -> PersonAddressType .PLACE_OF_EXPOSURE .equals (a .getAddressType ())).findFirst ().ifPresent (exposureAddress -> {
293- contact .setExposureLocationYn (YesNoUnknown .YES );
294-
315+ contact .setExposureLocationCountry (TODO_VALUE );
316+ contact .setExposureLocationType (exposureAddress .getFacilityType ());
317+ contact .setExposureLocationTypeDetails (exposureAddress .getFacilityDetails ());
318+ contact .setExposureLocationName (TODO_VALUE );
319+ contact .setOtherExposureLocation (exposureAddress .getFacilityDetails ());
295320 contact .setExposureLocationStreet (exposureAddress .getStreet ());
296321 contact .setExposureLocationStreetNumber (exposureAddress .getHouseNumber ());
297322 contact .setExposureLocationCity (exposureAddress .getCity ());
298323 contact .setExposureLocationPostalCode (exposureAddress .getPostalCode ());
324+ contact .setExposureLocationFlightDetail (TODO_VALUE );
299325 });
300326
301- addresses .stream ()
302- .filter (a -> PersonAddressType .PLACE_OF_ISOLATION .equals (a .getAddressType ()))
303- .findFirst ()
304- .ifPresent (isolationAddress -> {
305- contact .setQuarantineLocationStreet (isolationAddress .getStreet ());
306- contact .setQuarantineLocationStreetNumber (isolationAddress .getHouseNumber ());
307- contact .setQuarantineLocationCity (isolationAddress .getCity ());
308- contact .setQuarantineLocationPostalCode (isolationAddress .getPostalCode ());
309- });
310-
311327 List <Sample > contactSamples = samples .get (contact .getContactId ());
312328 if (contactSamples != null && contactSamples .size () > 0 ) {
313329 Sample firstSample = contactSamples .get (0 );
@@ -336,7 +352,6 @@ private void setCasePathogenTestData(BAGExportCaseDto caze, PathogenTest test) {
336352 }
337353
338354 private void setContactPathogenTestData (BAGExportContactDto contact , PathogenTest test ) {
339- contact .setLabReportDate (test .getTestDateTime ());
340355 contact .setTestType (test .getTestType ());
341356 contact .setTestResult (test .getTestResult ());
342357 }
0 commit comments