From 812f4a9efa7cd2ee84a5fc98b05624624427fffd Mon Sep 17 00:00:00 2001 From: Allan O Date: Tue, 21 Dec 2021 16:26:14 +0300 Subject: [PATCH 1/6] :arrow_up: Update server-core version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6f0410b3a..5c95433f7 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ opensrp-server-web war - 3.0.15-SNAPSHOT + 3.0.16-SNAPSHOT opensrp-server-web OpenSRP Server Web Application https://github.com/OpenSRP/opensrp-server-web @@ -25,7 +25,7 @@ 5.2.2.RELEASE always 1.5.1 - 3.0.11-SNAPSHOT + 3.0.12-SNAPSHOT 2.3.4-SNAPSHOT 2.0.1-SNAPSHOT 2.0.3-SNAPSHOT From 9b6f7bf7615f1f3a8a03ff1efd2fae250395ddf1 Mon Sep 17 00:00:00 2001 From: Allan O Date: Tue, 21 Dec 2021 16:26:41 +0300 Subject: [PATCH 2/6] :white_check_mark: Update PractitionerResource test --- .../web/rest/PractitionerResourceTest.java | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/test/java/org/opensrp/web/rest/PractitionerResourceTest.java b/src/test/java/org/opensrp/web/rest/PractitionerResourceTest.java index b73279ed2..7a2f24e97 100755 --- a/src/test/java/org/opensrp/web/rest/PractitionerResourceTest.java +++ b/src/test/java/org/opensrp/web/rest/PractitionerResourceTest.java @@ -3,6 +3,7 @@ import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; import com.google.gson.reflect.TypeToken; +import org.joda.time.DateTime; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -54,16 +55,16 @@ public void setUp() { } @Test - public void testGetPractitionersSHouldReturnAllPractitioners() throws Exception { - List expectedPractitoiners = new ArrayList<>(); + public void testGetPractitionersShouldReturnAllPractitioners() throws Exception { + List expectedPractitioners = new ArrayList<>(); Practitioner expectedPractitioner = initTestPractitioner1(); - expectedPractitoiners.add(expectedPractitioner); + expectedPractitioners.add(expectedPractitioner); expectedPractitioner = initTestPractitioner2(); - expectedPractitoiners.add(expectedPractitioner); + expectedPractitioners.add(expectedPractitioner); - doReturn(expectedPractitoiners).when(practitionerService).getAllPractitioners(any(PractitionerSearchBean.class)); + doReturn(expectedPractitioners).when(practitionerService).getAllPractitioners(any(PractitionerSearchBean.class)); String actualPractitionersString = getResponseAsString(BASE_URL, null, MockMvcResultMatchers.status().isOk()); List actualPractitioners = new Gson() @@ -71,15 +72,15 @@ public void testGetPractitionersSHouldReturnAllPractitioners() throws Exception }.getType()); - assertListsAreSameIgnoringOrder(actualPractitioners, expectedPractitoiners); + assertListsAreSameIgnoringOrder(actualPractitioners, expectedPractitioners); } @Test - public void testGetPractitionerByUniqueIdShouldReturnCorrectPractititoner() throws Exception { - List expectedPractitoiners = new ArrayList<>(); + public void testGetPractitionerByUniqueIdShouldReturnCorrectPractitioner() throws Exception { + List expectedPractitioners = new ArrayList<>(); Practitioner expectedPractitioner = initTestPractitioner1(); - expectedPractitoiners.add(expectedPractitioner); + expectedPractitioners.add(expectedPractitioner); List practitionerIdList = new ArrayList<>(); practitionerIdList.add(expectedPractitioner.getIdentifier()); @@ -110,7 +111,7 @@ public void testGetPractitionerByUniqueIdSWithBlankIdentifierShouldReturnAnError assertEquals("Practitioner Id is required", actualPractitioner); } @Test - public void testGetPractitionerByUserIdShouldReturnCorrectPractititoner() throws Exception { + public void testGetPractitionerByUserIdShouldReturnCorrectPractitioner() throws Exception { List expectedPractitioners = new ArrayList<>(); Practitioner expectedPractitioner = initTestPractitioner1(); @@ -296,22 +297,30 @@ public void testCountAllPractitionersWithException() throws Exception { } private Practitioner initTestPractitioner1() { + DateTime dateCreated = new DateTime(); Practitioner practitioner = new Practitioner(); practitioner.setIdentifier("practitoner-1-identifier"); practitioner.setActive(true); practitioner.setName("Practitioner"); practitioner.setUsername("Practioner1"); practitioner.setUserId("user1"); + practitioner.setDateCreated(dateCreated); + practitioner.setDateEdited(dateCreated); + practitioner.setServerVersion(1); return practitioner; } private Practitioner initTestPractitioner2() { + DateTime dateCreated = new DateTime(); Practitioner practitioner = new Practitioner(); practitioner.setIdentifier("practitoner-2-identifier"); practitioner.setActive(false); practitioner.setName("Second Practitioner"); practitioner.setUsername("Practioner2"); practitioner.setUserId("user2"); + practitioner.setDateCreated(dateCreated); + practitioner.setDateEdited(dateCreated); + practitioner.setServerVersion(2); return practitioner; } From 7a87f7c0437dbac0db68679f801072f99ca2280e Mon Sep 17 00:00:00 2001 From: Allan O Date: Wed, 22 Dec 2021 15:05:56 +0300 Subject: [PATCH 3/6] :white_check_mark: Update Practitioner and Org resources tests --- .../web/rest/PractitionerResource.java | 5 +-- .../web/rest/OrganizationResourceTest.java | 16 +++++---- .../web/rest/PractitionerResourceTest.java | 33 +++++++++++++------ 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/opensrp/web/rest/PractitionerResource.java b/src/main/java/org/opensrp/web/rest/PractitionerResource.java index 7bc3c8d4f..f9830b077 100644 --- a/src/main/java/org/opensrp/web/rest/PractitionerResource.java +++ b/src/main/java/org/opensrp/web/rest/PractitionerResource.java @@ -14,6 +14,7 @@ import org.opensrp.service.PractitionerService; import org.opensrp.util.DateTypeConverter; import org.smartregister.domain.Practitioner; +import org.smartregister.utils.DateTimeTypeConverter; import org.smartregister.utils.TaskDateTimeTypeConverter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -40,8 +41,8 @@ public class PractitionerResource { private static Logger logger = LogManager.getLogger(PractitionerResource.class.toString()); - public static Gson gson = new GsonBuilder().registerTypeAdapter(DateTime.class, new TaskDateTimeTypeConverter()) - .registerTypeAdapter(LocalDate.class, new DateTypeConverter()).create(); + public static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") + .registerTypeAdapter(DateTime.class, new DateTimeTypeConverter()).create(); private PractitionerService practitionerService; diff --git a/src/test/java/org/opensrp/web/rest/OrganizationResourceTest.java b/src/test/java/org/opensrp/web/rest/OrganizationResourceTest.java index e19e3d235..691347092 100644 --- a/src/test/java/org/opensrp/web/rest/OrganizationResourceTest.java +++ b/src/test/java/org/opensrp/web/rest/OrganizationResourceTest.java @@ -5,6 +5,8 @@ import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.joda.JodaModule; import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Before; import org.junit.Rule; @@ -113,7 +115,7 @@ public class OrganizationResourceTest { private String BASE_URL = "/rest/organization/"; - private String organizationJSON = "{\"identifier\":\"801874c0-d963-11e9-8a34-2a2ae2dbcce4\",\"active\":true,\"name\":\"B Team\",\"partOf\":1123,\"type\":{\"coding\":[{\"system\":\"http://terminology.hl7.org/CodeSystem/organization-type\",\"code\":\"team\",\"display\":\"Team\"}]}}"; + private String organizationJSON = "{\"identifier\":\"801874c0-d963-11e9-8a34-2a2ae2dbcce4\",\"active\":true,\"name\":\"B Team\",\"partOf\":1123,\"type\":{\"coding\":[{\"system\":\"http://terminology.hl7.org/CodeSystem/organization-type\",\"code\":\"team\",\"display\":\"Team\"}]},\"dateCreated\":\"2021-12-20T13:16:02.457Z\",\"dateEdited\":\"2021-12-20T13:16:02.457Z\",\"serverVersion\":1}"; private ObjectMapper objectMapper; @@ -130,6 +132,8 @@ public void setUp() { organizationResource.setLocationService(locationService); organizationResource.setPlanService(planService); objectMapper = new ObjectMapper(); + objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + objectMapper.registerModule(new JodaModule()); } @Test @@ -272,6 +276,7 @@ public void testAssignLocationAndPlanWithInternalError() throws Exception { @Test public void testGetAssignedLocationAndPlan() throws Exception { + objectMapper.enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); String identifier = UUID.randomUUID().toString(); List expected = getOrganizationLocationsAssigned(true); when(organizationService.findAssignedLocationsAndPlans(identifier, true, null, null, null, null)) @@ -282,7 +287,6 @@ public void testGetAssignedLocationAndPlan() throws Exception { verify(organizationService).findAssignedLocationsAndPlans(identifier, true, null, null, null, null); verifyNoMoreInteractions(organizationService); assertEquals(objectMapper.writeValueAsString(expected), result.getResponse().getContentAsString()); - } @Test @@ -322,6 +326,7 @@ public void testGetAssignedLocationAndPlanWithInternalError() throws Exception { @Test public void testGetAssignedLocationsAndPlansByPlanId() throws Exception { + objectMapper.enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); String identifier = UUID.randomUUID().toString(); List expected = getOrganizationLocationsAssigned(true); when(organizationService.findAssignedLocationsAndPlansByPlanIdentifier(identifier, null, null, null, null)) @@ -332,7 +337,6 @@ public void testGetAssignedLocationsAndPlansByPlanId() throws Exception { verify(organizationService).findAssignedLocationsAndPlansByPlanIdentifier(identifier, null, null, null, null); verifyNoMoreInteractions(organizationService); assertEquals(objectMapper.writeValueAsString(expected), result.getResponse().getContentAsString()); - } @Test @@ -495,7 +499,7 @@ private OrganizationAssigmentBean[] getOrganizationAssignment() { } private List getOrganizationLocationsAssigned(boolean includePlans) { - List organizationAssigmentBeans = new ArrayList<>(); + List organizationAssignmentBeans = new ArrayList<>(); Random random = new Random(); for (int i = 0; i < 5; i++) { AssignedLocations bean = new AssignedLocations(); @@ -508,10 +512,10 @@ private List getOrganizationLocationsAssigned(boolean include bean.setFromDate(new Date()); if (random.nextBoolean()) bean.setToDate(new Date()); - organizationAssigmentBeans.add(bean); + organizationAssignmentBeans.add(bean); } - return organizationAssigmentBeans; + return organizationAssignmentBeans; } diff --git a/src/test/java/org/opensrp/web/rest/PractitionerResourceTest.java b/src/test/java/org/opensrp/web/rest/PractitionerResourceTest.java index 7a2f24e97..39ac78b27 100755 --- a/src/test/java/org/opensrp/web/rest/PractitionerResourceTest.java +++ b/src/test/java/org/opensrp/web/rest/PractitionerResourceTest.java @@ -1,6 +1,7 @@ package org.opensrp.web.rest; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; import com.google.gson.reflect.TypeToken; import org.joda.time.DateTime; @@ -10,6 +11,7 @@ import org.opensrp.search.PractitionerSearchBean; import org.opensrp.service.PractitionerService; import org.smartregister.domain.Practitioner; +import org.smartregister.utils.DateTimeTypeConverter; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.web.server.MvcResult; @@ -47,6 +49,9 @@ public class PractitionerResourceTest extends BaseResourceTest { private final String practitionerJson = "{\"identifier\":\"practitoner-1-identifier\",\"active\":true,\"name\":\"Practitioner\",\"userId\":\"user1\",\"username\":\"Practioner1\"}"; + private final Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HHmm.ss.SSSZ") + .registerTypeAdapter(DateTime.class, new DateTimeTypeConverter()).create(); + @Before public void setUp() { practitionerService = mock(PractitionerService.class); @@ -67,8 +72,7 @@ public void testGetPractitionersShouldReturnAllPractitioners() throws Exception doReturn(expectedPractitioners).when(practitionerService).getAllPractitioners(any(PractitionerSearchBean.class)); String actualPractitionersString = getResponseAsString(BASE_URL, null, MockMvcResultMatchers.status().isOk()); - List actualPractitioners = new Gson() - .fromJson(actualPractitionersString, new TypeToken>() { + List actualPractitioners = gson.fromJson(actualPractitionersString, new TypeToken>() { }.getType()); @@ -89,7 +93,7 @@ public void testGetPractitionerByUniqueIdShouldReturnCorrectPractitioner() throw String actualPractitionersString = getResponseAsString(BASE_URL + "practitoner-1-identifier", null, MockMvcResultMatchers.status().isOk()); - Practitioner actualPractitioner = new Gson().fromJson(actualPractitionersString, new TypeToken() { + Practitioner actualPractitioner = gson.fromJson(actualPractitionersString, new TypeToken() { }.getType()); @@ -99,6 +103,9 @@ public void testGetPractitionerByUniqueIdShouldReturnCorrectPractitioner() throw assertEquals(actualPractitioner.getName(), expectedPractitioner.getName()); assertEquals(actualPractitioner.getUsername(), expectedPractitioner.getUsername()); assertEquals(actualPractitioner.getActive(), expectedPractitioner.getActive()); + assertEquals(actualPractitioner.getDateCreated(), expectedPractitioner.getDateCreated()); + assertEquals(actualPractitioner.getDateEdited(), expectedPractitioner.getDateEdited()); + assertEquals(actualPractitioner.getServerVersion(), expectedPractitioner.getServerVersion()); } @@ -124,7 +131,7 @@ public void testGetPractitionerByUserIdShouldReturnCorrectPractitioner() throws String actualPractitionersString = getResponseAsString(BASE_URL + "/user/" + "user1", null, MockMvcResultMatchers.status().isOk()); - Practitioner actualPractitioner = new Gson().fromJson(actualPractitionersString, new TypeToken() { + Practitioner actualPractitioner = gson.fromJson(actualPractitionersString, new TypeToken() { }.getType()); @@ -134,6 +141,9 @@ public void testGetPractitionerByUserIdShouldReturnCorrectPractitioner() throws assertEquals(actualPractitioner.getName(), expectedPractitioner.getName()); assertEquals(actualPractitioner.getUsername(), expectedPractitioner.getUsername()); assertEquals(actualPractitioner.getActive(), expectedPractitioner.getActive()); + assertEquals(actualPractitioner.getDateCreated(), expectedPractitioner.getDateCreated()); + assertEquals(actualPractitioner.getDateEdited(), expectedPractitioner.getDateEdited()); + assertEquals(actualPractitioner.getServerVersion(), expectedPractitioner.getServerVersion()); } @Test @@ -162,7 +172,7 @@ public void testCreateShouldCreateNewPractitionerResource() throws Exception { public void testUpdateShouldUpdateExistingPractitionerResource() throws Exception { Practitioner expectedPractitioner = initTestPractitioner1(); - String practitionerJson = new Gson().toJson(expectedPractitioner, new TypeToken() { + String practitionerJson = gson.toJson(expectedPractitioner, new TypeToken() { }.getType()); putRequestWithJsonContent(BASE_URL, practitionerJson, MockMvcResultMatchers.status().isCreated()); @@ -228,8 +238,7 @@ public void testGetPractitionersByPractitionerRoleIdentifierAndCode() throws Exc String actualPractitionersString = getResponseAsString( BASE_URL + "/report-to?practitionerIdentifier=test&code=testCode", null, MockMvcResultMatchers.status().isOk()); - List actualPractitioners = new Gson() - .fromJson(actualPractitionersString, new TypeToken>() { + List actualPractitioners = gson.fromJson(actualPractitionersString, new TypeToken>() { }.getType()); @@ -239,6 +248,10 @@ public void testGetPractitionersByPractitionerRoleIdentifierAndCode() throws Exc assertEquals(actualPractitioners.get(0).getName(), expectedPractitioner.getName()); assertEquals(actualPractitioners.get(0).getUsername(), expectedPractitioner.getUsername()); assertEquals(actualPractitioners.get(0).getActive(), expectedPractitioner.getActive()); + assertEquals(actualPractitioners.get(0).getDateCreated(), expectedPractitioner.getDateCreated()); + assertEquals(actualPractitioners.get(0).getDateEdited(), expectedPractitioner.getDateEdited()); + assertEquals(actualPractitioners.get(0).getServerVersion(), expectedPractitioner.getServerVersion()); + } @Override @@ -276,7 +289,7 @@ public void testBatchSaveWithJsonSyntaxException() throws Exception { } @Test - public void testCountAllPractitioners() throws Exception { + public void testCountAllPractitioners() throws Exception { doReturn(2L).when(practitionerService).countAllPractitioners(); MvcResult mvcResult = this.mockMvc.perform(get(BASE_URL + "count").accept(MediaType.APPLICATION_JSON)) .andExpect(MockMvcResultMatchers.status().isOk()).andReturn(); @@ -297,7 +310,7 @@ public void testCountAllPractitionersWithException() throws Exception { } private Practitioner initTestPractitioner1() { - DateTime dateCreated = new DateTime(); + DateTime dateCreated = DateTime.now(); Practitioner practitioner = new Practitioner(); practitioner.setIdentifier("practitoner-1-identifier"); practitioner.setActive(true); @@ -311,7 +324,7 @@ private Practitioner initTestPractitioner1() { } private Practitioner initTestPractitioner2() { - DateTime dateCreated = new DateTime(); + DateTime dateCreated = DateTime.now(); Practitioner practitioner = new Practitioner(); practitioner.setIdentifier("practitoner-2-identifier"); practitioner.setActive(false); From 8352d4d905a3bac531d4fc6286016528cbac2555 Mon Sep 17 00:00:00 2001 From: Allan O Date: Thu, 23 Dec 2021 16:36:33 +0300 Subject: [PATCH 4/6] :construction: Filter Org & Practitioner by server version --- src/main/java/org/opensrp/web/Constants.java | 2 ++ .../web/rest/OrganizationResource.java | 20 +++++++++++-------- .../web/rest/PractitionerResource.java | 18 ++++++++++------- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/opensrp/web/Constants.java b/src/main/java/org/opensrp/web/Constants.java index edbddcac3..bcaabe6ff 100644 --- a/src/main/java/org/opensrp/web/Constants.java +++ b/src/main/java/org/opensrp/web/Constants.java @@ -26,6 +26,8 @@ public interface Constants { public static final String PAGE_SIZE = "pageSize"; + public static final String SERVER_VERSION = "serverVersion"; + public static final String ORDER_BY_TYPE = "orderByType"; public static final String ORDER_BY_FIELD_NAME = "orderByFieldName"; diff --git a/src/main/java/org/opensrp/web/rest/OrganizationResource.java b/src/main/java/org/opensrp/web/rest/OrganizationResource.java index 288c1fdc7..66fcdab92 100644 --- a/src/main/java/org/opensrp/web/rest/OrganizationResource.java +++ b/src/main/java/org/opensrp/web/rest/OrganizationResource.java @@ -43,11 +43,7 @@ import java.util.Set; import java.util.stream.Collectors; -import static org.opensrp.web.Constants.ORDER_BY_FIELD_NAME; -import static org.opensrp.web.Constants.ORDER_BY_TYPE; -import static org.opensrp.web.Constants.PAGE_NUMBER; -import static org.opensrp.web.Constants.PAGE_SIZE; -import static org.opensrp.web.Constants.TOTAL_RECORDS; +import static org.opensrp.web.Constants.*; /** * @author Samuel Githengi created on 09/10/19 @@ -115,10 +111,17 @@ public List getAllOrganizations(@RequestParam(value = "location_id @RequestParam(value = PAGE_NUMBER, required = false) Integer pageNumber, @RequestParam(value = PAGE_SIZE, required = false) Integer pageSize, @RequestParam(value = ORDER_BY_TYPE, required = false) String orderByType, - @RequestParam(value = ORDER_BY_FIELD_NAME, required = false) String orderByFieldName + @RequestParam(value = ORDER_BY_FIELD_NAME, required = false) String orderByFieldName, + @RequestParam(value = SERVER_VERSION, required = false) String serverVersionParam ) { + + Long serverVersion = null; + if (serverVersionParam != null) { + serverVersion = Long.parseLong(serverVersionParam); + } + OrganizationSearchBean organizationSearchBean = createOrganizationSearchBeanForPagination(pageNumber, pageSize, - orderByType, orderByFieldName); + orderByType, orderByFieldName, serverVersion); if (StringUtils.isNotBlank(locationID)) { return organizationService.selectOrganizationsEncompassLocations(locationID); @@ -329,7 +332,7 @@ public ResponseEntity searchOrganization(OrganizationSearchBean organiza } private OrganizationSearchBean createOrganizationSearchBeanForPagination(Integer pageNumber, Integer pageSize, - String orderByType, String orderByFieldName) { + String orderByType, String orderByFieldName, Long serverVersion) { OrganizationSearchBean organizationSearchBean = new OrganizationSearchBean(); OrganizationSearchBean.OrderByType orderByTypeEnum = orderByType != null ? OrganizationSearchBean.OrderByType.valueOf(orderByType) : @@ -341,6 +344,7 @@ private OrganizationSearchBean createOrganizationSearchBeanForPagination(Integer organizationSearchBean.setPageSize(pageSize); organizationSearchBean.setOrderByFieldName(fieldName); organizationSearchBean.setOrderByType(orderByTypeEnum); + organizationSearchBean.setServerVersion(serverVersion); return organizationSearchBean; } diff --git a/src/main/java/org/opensrp/web/rest/PractitionerResource.java b/src/main/java/org/opensrp/web/rest/PractitionerResource.java index f9830b077..e1688d49d 100644 --- a/src/main/java/org/opensrp/web/rest/PractitionerResource.java +++ b/src/main/java/org/opensrp/web/rest/PractitionerResource.java @@ -30,10 +30,7 @@ import java.util.List; import java.util.Set; -import static org.opensrp.web.Constants.ORDER_BY_FIELD_NAME; -import static org.opensrp.web.Constants.ORDER_BY_TYPE; -import static org.opensrp.web.Constants.PAGE_NUMBER; -import static org.opensrp.web.Constants.PAGE_SIZE; +import static org.opensrp.web.Constants.*; @Controller @RequestMapping(value = "/rest/practitioner") @@ -73,10 +70,16 @@ public ResponseEntity getPractitionerByUniqueId(@PathVariable(IDENTIFIER public ResponseEntity getPractitioners(@RequestParam(value = PAGE_NUMBER, required = false) Integer pageNumber, @RequestParam(value = PAGE_SIZE, required = false) Integer pageSize, @RequestParam(value = ORDER_BY_TYPE, required = false) String orderByType, - @RequestParam(value = ORDER_BY_FIELD_NAME, required = false) String orderByFieldName) { + @RequestParam(value = ORDER_BY_FIELD_NAME, required = false) String orderByFieldName, + @RequestParam(value = SERVER_VERSION, required = false) String serverVersionParam) { + + Long serverVersion = null; + if (serverVersionParam != null) { + serverVersion = Long.parseLong(serverVersionParam); + } PractitionerSearchBean practitionerSearchBean = createPractitionerSearchBean(pageNumber, pageSize, orderByType, - orderByFieldName); + orderByFieldName, serverVersion); return new ResponseEntity<>(gson.toJson( practitionerService.getAllPractitioners(practitionerSearchBean)), RestUtils.getJSONUTF8Headers(), HttpStatus.OK); @@ -150,7 +153,7 @@ public List getPractitionersByPractitionerRoleIdentifierAndCode( } private PractitionerSearchBean createPractitionerSearchBean(Integer pageNumber, Integer pageSize, String orderByType, - String orderByFieldName) { + String orderByFieldName, Long serverVersion) { BaseSearchBean.OrderByType orderByTypeEnum; BaseSearchBean.FieldName fieldName; @@ -164,6 +167,7 @@ private PractitionerSearchBean createPractitionerSearchBean(Integer pageNumber, .pageSize(pageSize) .orderByType(orderByTypeEnum) .orderByFieldName(fieldName) + .serverVersion(serverVersion) .build(); } From eea8d14e5d3e312cac31771c0bdc8539cc4b836b Mon Sep 17 00:00:00 2001 From: Allan O Date: Tue, 8 Feb 2022 19:59:05 +0300 Subject: [PATCH 5/6] :recycle: Trigger checks From 335dd800b0059ec93e5d07fb8930432566bebf8e Mon Sep 17 00:00:00 2001 From: Allan O Date: Wed, 9 Feb 2022 10:11:33 +0300 Subject: [PATCH 6/6] :recycle: Trigger checks