profile
viewpoint

chethandeshpande/openmrs-core 0

OpenMRS API and web application code

chethandeshpande/openmrs-module-legacyui 0

The legacy user interface for OpenMRS 1.9 is chiefly comprised of administrative functions and the patient dashboard. Apparently, a new and more contemporary UI has been introduced via a UI framework and the legacy UI is kept around for administrative functions that are not yet implemented in the new UI. To retire the Legacy UI as planned, it is required to move the implementations and modules that still rely on it in order to maintain backwards compatibility. The main idea behind this project is to move legacy UI functions into an OpenMRS module that these implementations can install until they are able to migrate away from it, since most of the implementations of OpenMRS around the world are running OpenMRS 1.9.

preethi29/angular_app 0

trying forking

preethi29/debezium 0

Change data capture for a variety of databases. https://debezium.io Please log issues in our JIRA at https://issues.jboss.org/projects/DBZ/issues

preethi29/goverreport 0

Command line tool for coverage reporting and validation

issue openedBahmni/bahmni-playbooks

Successfully installed bahmni, but failed to install dcm4chee.

Use docker container (centos 7.6) and bahmni install command to deploy bahmni(0.92) successfully, and can access services such as Bahmni-EMR and Bahmni-LAB through the web. But cannot access http://172.17.0.2/dcm4chee-web3, because dcm4chee has not been installed correctly. Querying Bahmni Wiki: Advanced Installation Options did not find out how to install dcm4chee through bahmni install. Any help would be appreciated.

bahmni start:
PLAY [pacs-integration-db:pacs-integration-db-slave] ***************************
skipping: no hosts matched
 [WARNING]: Could not match supplied host pattern, ignoring: pacs-integration
PLAY [pacs-integration] ********************************************************
skipping: no hosts matched
PLAY [atomfeed-console] ********************************************************
META: ran handlers
META: ran handlers
META: ran handlers
 [WARNING]: Could not match supplied host pattern, ignoring: dcm4chee-db
 [WARNING]: Could not match supplied host pattern, ignoring: dcm4chee-db-slave
PLAY [dcm4chee-db,dcm4chee-db-slave] *******************************************
skipping: no hosts matched
 [WARNING]: Could not match supplied host pattern, ignoring: dcm4chee
PLAY [dcm4chee] ****************************************************************
skipping: no hosts matched
 [WARNING]: Could not match supplied host pattern, ignoring: bahmni-event-log-
service
PLAY [bahmni-event-log-service] ************************************************
skipping: no hosts matched

created time in 2 days

Pull request review commentBahmni/bahmni-offline-sync

BAh-1106 | Gopi,Shriram | Changes Related To Zipping of AddressHierarchy and OfflineConcepts

+package org.bahmni.module.bahmniOfflineSync.strategy;++import org.apache.commons.logging.Log;+import org.apache.commons.logging.LogFactory;+import org.bahmni.module.bahmniOfflineSync.eventLog.EventLog;+import org.bahmni.module.bahmniOfflineSync.utils.AddressHierarchyLevelWithLevelEntryName;+import org.bahmni.module.bahmniOfflineSync.utils.SelectiveSyncStrategyHelper;+import org.ict4h.atomfeed.server.domain.EventRecord;+import org.openmrs.*;+import org.openmrs.api.context.Context;+import org.openmrs.module.addresshierarchy.AddressHierarchyEntry;+import org.openmrs.module.addresshierarchy.AddressHierarchyLevel;+import org.openmrs.module.addresshierarchy.service.AddressHierarchyService;+import org.springframework.util.StringUtils;++import java.sql.SQLException;+import java.util.*;++public class SelectiveSyncStrategy extends AbstractOfflineSyncStrategy {+    private static final String ATTRIBUTE_TYPE_NAME = "addressCode";+    protected static Log log = LogFactory.getLog(SelectiveSyncStrategy.class);+    private static AddressHierarchyService addressHierarchyService = Context.getService(AddressHierarchyService.class);++    public SelectiveSyncStrategy() throws SQLException {+        super();++    }++    protected String evaluateFilterForPatient(String uuid) {+        String patientFilter = null;+        Patient patient = patientService.getPatientByUuid(uuid);++        if (patient != null && patient.getAttribute(ATTRIBUTE_TYPE_NAME) != null) {+            patientFilter = patient.getAttribute(ATTRIBUTE_TYPE_NAME).getValue();+        }++        return patientFilter;+    }++    private String evaluateFilterForEncounter(String uuid) {+        String filter = null;+        Encounter encounter = encounterService.getEncounterByUuid(uuid);+        if (encounter != null)+            filter = evaluateFilterForPatient(encounter.getPatient().getUuid());+        return filter;+    }++    private String evaluateFilterForAddressHierarchy(String uuid) {+        String addressHierarchyFilter = null;+        AddressHierarchyService addressHierarchyService = Context.getService(AddressHierarchyService.class);+        AddressHierarchyEntry addressHierarchyEntry = addressHierarchyService.getAddressHierarchyEntryByUuid(uuid);+        if (addressHierarchyEntry != null && addressHierarchyEntry.getLevel() != null && addressHierarchyEntry.getLevel().getId() > 3) {+            addressHierarchyFilter = addressHierarchyEntry.getUserGeneratedId();+        }+        return addressHierarchyFilter;+    }+++    public Map<String, List<String>> getFilterForDevice(String providerUuid, String addressUuid, String loginLocationUuid) {+        if(addressUuid.equals("null") || addressUuid.isEmpty()) {+            throw new RuntimeException("Please give address for this login location in openmrs");+        }+        Map<String, List<String>> categoryFilterMap = new HashMap();+        AddressHierarchyService addressHierarchyService = Context.getService(AddressHierarchyService.class);+        AddressHierarchyEntry addressHierarchyEntry = addressHierarchyService.getAddressHierarchyEntryByUuid(addressUuid);+        List transactionalDataFilters = getTransactionalDataFilters(loginLocationUuid, addressHierarchyService, addressHierarchyEntry);+        categoryFilterMap.put("patient", transactionalDataFilters);+        categoryFilterMap.put("encounter", transactionalDataFilters);+        categoryFilterMap.put("addressHierarchy", getFiltersForAddressHierarchy(addressHierarchyEntry));+        //categoryFilterMap.put("parentAddressHierarchy", new ArrayList<String>());+        categoryFilterMap.put("offline-concepts", new ArrayList<String>());+        categoryFilterMap.put("forms", new ArrayList<>());+        return categoryFilterMap;+    }++    private List getTransactionalDataFilters(String loginLocationUuid, AddressHierarchyService addressHierarchyService, AddressHierarchyEntry addressHierarchyEntry) {+        List transactionalDataFilters = new ArrayList();+        if (addressHierarchyEntry != null) {+            LocationAttributeType catchmentFiltersAttribute = locationService.getLocationAttributeTypeByName("catchmentFilters");+            String userGeneratedId = addressHierarchyEntry.getUserGeneratedId();+            LocationAttribute catchmentFilters = getCatchmentFilters(loginLocationUuid, catchmentFiltersAttribute);+            List<AddressHierarchyEntry> childAddressHierarchyEntries = addressHierarchyService.getChildAddressHierarchyEntries(addressHierarchyEntry);+            List<String> transactionalFilters = getCatchmentIds(catchmentFilters, childAddressHierarchyEntries, addressHierarchyService, addressHierarchyEntry);+            transactionalDataFilters.add(userGeneratedId);+            transactionalDataFilters.addAll(transactionalFilters);+        }+        return transactionalDataFilters;+    }++    private LocationAttribute getCatchmentFilters(String loginLocationUuid, LocationAttributeType catchmentFiltersAttribute) {+        Location location = locationService.getLocationByUuid(loginLocationUuid);+        List<LocationAttribute> attributes = (List<LocationAttribute>) location.getActiveAttributes();+        for (LocationAttribute attribute : attributes) {+            if (attribute.getAttributeType().equals(catchmentFiltersAttribute)) {+                return attribute;+            }+        }+        return null;+    }++    private List<String> getCatchmentIds(LocationAttribute catchmentFilters, List<AddressHierarchyEntry> childAddressHierarchyEntries, AddressHierarchyService addressHierarchyService, AddressHierarchyEntry addressHierarchyEntry) {+        List<String> wardIDs = new ArrayList();+        if (catchmentFilters != null) {+            String wardsName = trim(catchmentFilters.getValue().toString());+            Set<String> wardsNameList = StringUtils.commaDelimitedListToSet(wardsName);+            for (String wardName : wardsNameList) {+                AddressHierarchyEntry childAddressHierarchyEntry = addressHierarchyService.getChildAddressHierarchyEntryByName(addressHierarchyEntry, wardName);+                if (childAddressHierarchyEntry == null) {+                    throw new RuntimeException("Please check your catchmentFilters configuration in openmrs!!");+                } else {+                    getAllWardIds(childAddressHierarchyEntry, addressHierarchyService, wardIDs);+                }+            }+        } else {+            updateWardIds(addressHierarchyService, wardIDs, childAddressHierarchyEntries);+        }+        return wardIDs;+    }++    private void getAllWardIds(AddressHierarchyEntry addressHierarchyEntry, AddressHierarchyService addressHierarchyService, List<String> wardIDs) {+        if (addressHierarchyEntry == null) {+            return;+        }+        wardIDs.add(addressHierarchyEntry.getUserGeneratedId());+        List<AddressHierarchyEntry> childAddressHierarchyEntries = addressHierarchyService.getChildAddressHierarchyEntries(addressHierarchyEntry);+        updateWardIds(addressHierarchyService, wardIDs, childAddressHierarchyEntries);+    }++    private void updateWardIds(AddressHierarchyService addressHierarchyService, List<String> wardIDs, List<AddressHierarchyEntry> childAddressHierarchyEntries) {+        for (AddressHierarchyEntry childAddressHierarchyEntry : childAddressHierarchyEntries) {+            getAllWardIds(childAddressHierarchyEntry, addressHierarchyService, wardIDs);+        }+    }++    private String trim(String content) {+        content = content.trim();+        return content.replaceAll("(\\s*,\\s*)", ",");+    }++    @Override+    public List<String> getEventCategoriesList() {+        List<String> eventCategoryList = new ArrayList();++        eventCategoryList.add("patient");+        eventCategoryList.add("encounter");+        eventCategoryList.add("addressHierarchy");+        eventCategoryList.add("parentAddressHierarchy");+        eventCategoryList.add("offline-concepts");+        eventCategoryList.add("forms");++        return eventCategoryList;+    }++++    private List<String> getFiltersForAddressHierarchy(AddressHierarchyEntry addressHierarchyEntry) {+        List addressHierarchyFilters = new ArrayList();+        while (addressHierarchyEntry.getParent() != null) {+            if (addressHierarchyEntry.getUserGeneratedId().length() == 6) {+                addressHierarchyFilters.add(addressHierarchyEntry.getUserGeneratedId());+                break;+            }+            addressHierarchyEntry = addressHierarchyEntry.getParent();+        }+        return addressHierarchyFilters;+    }++    @Override+    public List<EventLog> getEventLogsFromEventRecords(List<EventRecord> eventRecords) {+        List<EventLog> eventLogs = new ArrayList<EventLog>();++        for (EventRecord er : eventRecords) {+            EventLog eventLog = new EventLog(er.getUuid(),er.getCategory(),er.getTimeStamp(),er.getContents(), null, er.getUuid());+            String category = er.getCategory();+            String uuid = getUuidFromURL(er.getContents());+            String filter = null;++            if (!uuid.isEmpty()) {+                if (category.equalsIgnoreCase("all-concepts")) {+                    if (isOfflineConceptEvent(uuid)) {+                        eventLog.setCategory("offline-concepts");+                    } else {+                        eventLog.setCategory("concepts");+                    }+                }++                if (category.equalsIgnoreCase("Patient")|| category.equalsIgnoreCase("LabOrderResults")) {+                   // filter = evaluateFilterForPatient(uuid);

Removed comments @binduak

gopikrishna-yaramothu

comment created time in 3 days

Pull request review commentBahmni/bahmni-offline-sync

BAh-1106 | Gopi,Shriram | Changes Related To Zipping of AddressHierarchy and OfflineConcepts

+package org.bahmni.module.bahmniOfflineSync.strategy;++import org.apache.commons.logging.Log;+import org.apache.commons.logging.LogFactory;+import org.bahmni.module.bahmniOfflineSync.eventLog.EventLog;+import org.bahmni.module.bahmniOfflineSync.utils.AddressHierarchyLevelWithLevelEntryName;+import org.bahmni.module.bahmniOfflineSync.utils.SelectiveSyncStrategyHelper;+import org.ict4h.atomfeed.server.domain.EventRecord;+import org.openmrs.*;+import org.openmrs.api.context.Context;+import org.openmrs.module.addresshierarchy.AddressHierarchyEntry;+import org.openmrs.module.addresshierarchy.AddressHierarchyLevel;+import org.openmrs.module.addresshierarchy.service.AddressHierarchyService;+import org.springframework.util.StringUtils;++import java.sql.SQLException;+import java.util.*;++public class SelectiveSyncStrategy extends AbstractOfflineSyncStrategy {+    private static final String ATTRIBUTE_TYPE_NAME = "addressCode";+    protected static Log log = LogFactory.getLog(SelectiveSyncStrategy.class);+    private static AddressHierarchyService addressHierarchyService = Context.getService(AddressHierarchyService.class);++    public SelectiveSyncStrategy() throws SQLException {+        super();++    }++    protected String evaluateFilterForPatient(String uuid) {+        String patientFilter = null;+        Patient patient = patientService.getPatientByUuid(uuid);++        if (patient != null && patient.getAttribute(ATTRIBUTE_TYPE_NAME) != null) {+            patientFilter = patient.getAttribute(ATTRIBUTE_TYPE_NAME).getValue();+        }++        return patientFilter;+    }++    private String evaluateFilterForEncounter(String uuid) {+        String filter = null;+        Encounter encounter = encounterService.getEncounterByUuid(uuid);+        if (encounter != null)+            filter = evaluateFilterForPatient(encounter.getPatient().getUuid());+        return filter;+    }++    private String evaluateFilterForAddressHierarchy(String uuid) {+        String addressHierarchyFilter = null;+        AddressHierarchyService addressHierarchyService = Context.getService(AddressHierarchyService.class);+        AddressHierarchyEntry addressHierarchyEntry = addressHierarchyService.getAddressHierarchyEntryByUuid(uuid);+        if (addressHierarchyEntry != null && addressHierarchyEntry.getLevel() != null && addressHierarchyEntry.getLevel().getId() > 3) {+            addressHierarchyFilter = addressHierarchyEntry.getUserGeneratedId();+        }+        return addressHierarchyFilter;+    }+++    public Map<String, List<String>> getFilterForDevice(String providerUuid, String addressUuid, String loginLocationUuid) {+        if(addressUuid.equals("null") || addressUuid.isEmpty()) {+            throw new RuntimeException("Please give address for this login location in openmrs");+        }+        Map<String, List<String>> categoryFilterMap = new HashMap();+        AddressHierarchyService addressHierarchyService = Context.getService(AddressHierarchyService.class);+        AddressHierarchyEntry addressHierarchyEntry = addressHierarchyService.getAddressHierarchyEntryByUuid(addressUuid);+        List transactionalDataFilters = getTransactionalDataFilters(loginLocationUuid, addressHierarchyService, addressHierarchyEntry);+        categoryFilterMap.put("patient", transactionalDataFilters);+        categoryFilterMap.put("encounter", transactionalDataFilters);+        categoryFilterMap.put("addressHierarchy", getFiltersForAddressHierarchy(addressHierarchyEntry));+        //categoryFilterMap.put("parentAddressHierarchy", new ArrayList<String>());+        categoryFilterMap.put("offline-concepts", new ArrayList<String>());+        categoryFilterMap.put("forms", new ArrayList<>());+        return categoryFilterMap;+    }++    private List getTransactionalDataFilters(String loginLocationUuid, AddressHierarchyService addressHierarchyService, AddressHierarchyEntry addressHierarchyEntry) {+        List transactionalDataFilters = new ArrayList();+        if (addressHierarchyEntry != null) {+            LocationAttributeType catchmentFiltersAttribute = locationService.getLocationAttributeTypeByName("catchmentFilters");+            String userGeneratedId = addressHierarchyEntry.getUserGeneratedId();+            LocationAttribute catchmentFilters = getCatchmentFilters(loginLocationUuid, catchmentFiltersAttribute);+            List<AddressHierarchyEntry> childAddressHierarchyEntries = addressHierarchyService.getChildAddressHierarchyEntries(addressHierarchyEntry);+            List<String> transactionalFilters = getCatchmentIds(catchmentFilters, childAddressHierarchyEntries, addressHierarchyService, addressHierarchyEntry);+            transactionalDataFilters.add(userGeneratedId);+            transactionalDataFilters.addAll(transactionalFilters);+        }+        return transactionalDataFilters;+    }++    private LocationAttribute getCatchmentFilters(String loginLocationUuid, LocationAttributeType catchmentFiltersAttribute) {+        Location location = locationService.getLocationByUuid(loginLocationUuid);+        List<LocationAttribute> attributes = (List<LocationAttribute>) location.getActiveAttributes();+        for (LocationAttribute attribute : attributes) {+            if (attribute.getAttributeType().equals(catchmentFiltersAttribute)) {+                return attribute;+            }+        }+        return null;+    }++    private List<String> getCatchmentIds(LocationAttribute catchmentFilters, List<AddressHierarchyEntry> childAddressHierarchyEntries, AddressHierarchyService addressHierarchyService, AddressHierarchyEntry addressHierarchyEntry) {+        List<String> wardIDs = new ArrayList();+        if (catchmentFilters != null) {+            String wardsName = trim(catchmentFilters.getValue().toString());+            Set<String> wardsNameList = StringUtils.commaDelimitedListToSet(wardsName);+            for (String wardName : wardsNameList) {+                AddressHierarchyEntry childAddressHierarchyEntry = addressHierarchyService.getChildAddressHierarchyEntryByName(addressHierarchyEntry, wardName);+                if (childAddressHierarchyEntry == null) {+                    throw new RuntimeException("Please check your catchmentFilters configuration in openmrs!!");+                } else {+                    getAllWardIds(childAddressHierarchyEntry, addressHierarchyService, wardIDs);+                }+            }+        } else {+            updateWardIds(addressHierarchyService, wardIDs, childAddressHierarchyEntries);+        }+        return wardIDs;+    }++    private void getAllWardIds(AddressHierarchyEntry addressHierarchyEntry, AddressHierarchyService addressHierarchyService, List<String> wardIDs) {+        if (addressHierarchyEntry == null) {+            return;+        }+        wardIDs.add(addressHierarchyEntry.getUserGeneratedId());+        List<AddressHierarchyEntry> childAddressHierarchyEntries = addressHierarchyService.getChildAddressHierarchyEntries(addressHierarchyEntry);+        updateWardIds(addressHierarchyService, wardIDs, childAddressHierarchyEntries);+    }++    private void updateWardIds(AddressHierarchyService addressHierarchyService, List<String> wardIDs, List<AddressHierarchyEntry> childAddressHierarchyEntries) {+        for (AddressHierarchyEntry childAddressHierarchyEntry : childAddressHierarchyEntries) {+            getAllWardIds(childAddressHierarchyEntry, addressHierarchyService, wardIDs);+        }+    }++    private String trim(String content) {+        content = content.trim();+        return content.replaceAll("(\\s*,\\s*)", ",");+    }++    @Override+    public List<String> getEventCategoriesList() {+        List<String> eventCategoryList = new ArrayList();++        eventCategoryList.add("patient");+        eventCategoryList.add("encounter");+        eventCategoryList.add("addressHierarchy");+        eventCategoryList.add("parentAddressHierarchy");+        eventCategoryList.add("offline-concepts");+        eventCategoryList.add("forms");++        return eventCategoryList;+    }++++    private List<String> getFiltersForAddressHierarchy(AddressHierarchyEntry addressHierarchyEntry) {+        List addressHierarchyFilters = new ArrayList();+        while (addressHierarchyEntry.getParent() != null) {+            if (addressHierarchyEntry.getUserGeneratedId().length() == 6) {+                addressHierarchyFilters.add(addressHierarchyEntry.getUserGeneratedId());+                break;+            }+            addressHierarchyEntry = addressHierarchyEntry.getParent();+        }+        return addressHierarchyFilters;+    }++    @Override+    public List<EventLog> getEventLogsFromEventRecords(List<EventRecord> eventRecords) {+        List<EventLog> eventLogs = new ArrayList<EventLog>();++        for (EventRecord er : eventRecords) {+            EventLog eventLog = new EventLog(er.getUuid(),er.getCategory(),er.getTimeStamp(),er.getContents(), null, er.getUuid());+            String category = er.getCategory();+            String uuid = getUuidFromURL(er.getContents());+            String filter = null;++            if (!uuid.isEmpty()) {+                if (category.equalsIgnoreCase("all-concepts")) {+                    if (isOfflineConceptEvent(uuid)) {+                        eventLog.setCategory("offline-concepts");+                    } else {+                        eventLog.setCategory("concepts");+                    }+                }++                if (category.equalsIgnoreCase("Patient")|| category.equalsIgnoreCase("LabOrderResults")) {+                   // filter = evaluateFilterForPatient(uuid);

@gopikrishna-yaramothu not realised before.. i see comments here too. are these required here ?

gopikrishna-yaramothu

comment created time in 3 days

startedabelljs/abell-renderer

started time in 4 days

PR opened Bahmni/form-controls

Supriya, Tarun | BAH-1132 | MOBN-1188 | Fix issues with complex concepts when addMore is enabled
  • Tarun,Supriya | MOBN-1188 | Fix issues with complex concepts when addMore is enabled

  • Supriya, Tarun | MOBN-1188 | Fix unit tests

  • Supriya, Tarun | MOBN-1188 | Fix issues for complex concepts with addMore enabled

  • Supriya, Tarun | MOBN-1188 | Fix issues for complex concepts with addMore enabled

  • Supriya, Tarun | MOBN-1188 | Add unit tests for canAddNextFormFieldPath Co-authored-by: Supriya Muppiri supriya.muppiri@thoughtworks.com

https://bahmni.atlassian.net/browse/BAH-1132

+83 -2

0 comment

2 changed files

pr created time in 7 days

PR opened Bahmni/form-controls

Supriya, Vinisha | BAH-1131 | MOBN-1559 | Add step attribute to numeric input field
  • Supriya, Vinisha | MOBN-1559 | Add step attribute to numeric input field

  • Supriya, Vinisha | MOBN-1559 | Bump up version to 0.93.1

https://bahmni.atlassian.net/browse/BAH-1131

+4 -4

0 comment

2 changed files

pr created time in 7 days

PR opened Bahmni/form-controls

Bindu, Tarun | BAH-1017 | MOBN-1551 | Save event not working in Preview Tab
  • Bindu, Tarun | MOBN-1551 | added callback method to get the container data object

  • Bindu, Tarun | MOBN-1551 | Refactor code and fix unit tests

  • Bindu, Tarun | MOBN-1551 | Bump up form-controls version to 0.93.3

Co-authored-by: tarunkumar-tw tarunkumar.s@thoughtworks.com

+14 -1

0 comment

1 changed file

pr created time in 7 days

push eventBahmni/bahmni-playbooks

buvaneswari-arun

commit sha 122d8e0e46e04b598334c9bd62f894a459c858d5

BAH-1124|Buvaneswari|Odoo page distortion - lessc downgrade issue (#63) * BAH-1124|Buvaneswari|Odoo page distortion - lessc downgrade issue * BAH-1124|Buvaneswari|Choosing lessc version to be 3.11.1

view details

push time in 13 days

PR merged Bahmni/bahmni-playbooks

BAH-1124|Buvaneswari|Odoo page distortion - lessc downgrade issue

The downgraded version is 3.5.3 as it was the supported version w.r.t odoo 10.

+1 -1

0 comment

1 changed file

buvaneswari-arun

pr closed time in 13 days

PR opened Bahmni/bahmni-playbooks

BAH-1124|Buvaneswari|Odoo page distortion - lessc downgrade issue

The downgraded version is 3.5.3 as it was the supported version w.r.t odoo 10.

+1 -1

0 comment

1 changed file

pr created time in 17 days

startedlirantal/nodejs-cli-apps-best-practices

started time in 22 days

startedahmadawais/nodejs-cli-apps-best-practices

started time in 22 days

startedreezpatel/dev_punk

started time in 22 days

Pull request review commentBahmni/event-log-service

BAH-1109 | Gopi , Shriram | Selective Sync Feature - EventLogService

 public void shouldGetPatientEventLogExcludingCategories() throws Exception {         EventLog lastReadEventLog = new EventLog();         lastReadEventLog.setId(1000);         when(eventLogRepository.findTop1ByUuid(uuid)).thenReturn(lastReadEventLog);-        when(eventLogRepository.findTop100ByFilterInAndIdAfterAndCategoryNotIn(filtersList, lastReadEventLog.getId(), categoryList)).thenReturn(eventLogs);-        when(eventLogRepository.countByFilterInAndIdAfterAndCategoryNotIn(filtersList, lastReadEventLog.getId(), categoryList)).thenReturn(1);+        for(String filter: filterBy) {+            when(eventLogRepository.findTop100ByFilterContainsAndIdAfterAndCategoryNotIn(filter, lastReadEventLog.getId(), categoryList)).thenReturn(eventLogs);+        }++//        when(eventLogRepository.countByFilterInAndIdAfterAndCategoryNotIn(filtersList, lastReadEventLog.getId(), categoryList)).thenReturn(1);

@gopikrishna-yaramothu do we need this commented code ?

gopikrishna-yaramothu

comment created time in a month

Pull request review commentBahmni/bahmni-offline-sync

BAh-1106 | Gopi,Shriram | Changes Related To Zipping of AddressHierarchy and OfflineConcepts

 public void execute() {                  log.info(String.format("Creating zip files for %s is successfully completed", filter));             }+             log.info("InitialSyncArtifactsPublisher job completed");         } catch (SQLException | IOException | InterruptedException e) {             e.printStackTrace();         }++    }++    private void zipOfflineConcepts(String initSyncDirectory) {+        createInitSyncDirectory(initSyncDirectory);+        try{+            SimpleObject lastEvent = getLastEvent();+            Integer lastEventId = new Integer(lastEvent.get("id"));+            log.info("LastEventId: + " + lastEventId);+            String preTextTemplate = "{\"lastReadEventUuid\":\"%s\", \"offlineconcepts\":[";+            String postText = "]}";+            Connection connection = getTransactionManager().getConnection();+            String filter = "offline-concepts";+            String sql = getObjectUUIDSql(lastEventId, filter);+            EventLogProcessor eventLogProcessor = new EventLogProcessor(sql, connection, null);+            List<SimpleObject> urls = eventLogProcessor.getUrlObjects();+            log.info("Number of offline concepts records -> "+ urls.size());+            for (int index = 0; index < urls.size(); index += JUMP_SIZE) {+                String fileName = getFileName(filter, index);+                List<SimpleObject> subUrls = urls.subList(index, getUpperLimit(index, urls.size()));+                PatientProfileWriter patientProfileWriter = getWriter(fileName, initSyncDirectory, "offline-concepts");+                String lastEventUuid = (index + JUMP_SIZE < urls.size()) ?+                        subUrls.get(subUrls.size() - 1).get("uuid").toString() : lastEvent.get("uuid").toString();+                String preText = String.format(preTextTemplate, lastEventUuid);+                patientProfileWriter.write(preText);+                try {+                    for (int fileCount = 0; fileCount < subUrls.size(); fileCount++) {+                        SimpleObject event = subUrls.get(fileCount);+                        String temp = getOpenMRSResource("http://localhost"+event.get("object")+"/");+                        if (fileCount != 0) {+                            patientProfileWriter.append(",");+                        }+                        patientProfileWriter.write(SimpleObject.parseJson(temp));+                    }+                    log.info(String.format("Creating zip file for %s is successfully completed", fileName));+                } catch (IOException e) {+                    throw new EventLogIteratorException("Error while writing with provided writer [" + patientProfileWriter.toString() + "]", e);+                }+                patientProfileWriter.write(postText);+                patientProfileWriter.close();+                Thread.sleep(1000);+            }+        } catch (SQLException | IOException | InterruptedException e) {+            e.printStackTrace();+            log.error(e.getMessage());+        }+    }++//    private void zipOfflineConcepts(String initSyncDirectory){+//        createInitSyncDirectory(initSyncDirectory);+//        try{+//            SimpleObject lastEvent = getLastEvent();+//            Integer lastEventId = new Integer(lastEvent.get("id"));+//            log.error("LastEventId: + " + lastEventId);+//            String preTextTemplate = "{\"lastReadEventUuid\":\"%s\", \"addressHierarchy\":[";+//            String postText = "]}";+//            Connection connection = getTransactionManager().getConnection();+//            String filter = "offline-concepts";+//            String sql = getObjectUUIDSql(lastEventId, filter);+//            EventLogProcessor eventLogProcessor = new EventLogProcessor(sql, connection, new OfflineConceptsTransformer());+//            List<SimpleObject> urls = eventLogProcessor.getUrlObjects();+//            for (int index = 0; index < urls.size(); index += JUMP_SIZE) {+//                String fileName = getFileName(filter, index);+//                log.error(String.format("Creating zip file for %s is started", fileName));+//                List<SimpleObject> subUrls = urls.subList(index, getUpperLimit(index, urls.size()));+//                PatientProfileWriter patientProfileWriter = getWriter(fileName, initSyncDirectory, "addressHierarchy");+//                String lastEventUuid = (index + JUMP_SIZE < urls.size()) ?+//                        subUrls.get(subUrls.size() - 1).get("uuid").toString() : lastEvent.get("uuid").toString();+//                String preText = String.format(preTextTemplate, lastEventUuid);+//                patientProfileWriter.write(preText);+//                eventLogProcessor.process(subUrls, patientProfileWriter);+//                patientProfileWriter.write(postText);+//                patientProfileWriter.close();+//                Thread.sleep(1000);+//                // break; //TODO+//            }+//        } catch (SQLException | IOException | InterruptedException e) {+//            e.printStackTrace();+//        }+//    }

@gopikrishna-yaramothu Do we need this commented code here ?

gopikrishna-yaramothu

comment created time in a month

Pull request review commentBahmni/bahmni-offline-sync

BAh-1106 | Gopi,Shriram | Changes Related To Zipping of AddressHierarchy and OfflineConcepts

+package org.bahmni.module.bahmniOfflineSync.job;++import org.apache.commons.logging.Log;+import org.apache.commons.logging.LogFactory;+import org.bahmni.module.bahmniOfflineSync.constants.KeyMapping;+import org.bahmni.module.bahmniOfflineSync.eventLog.RowTransformer;+import org.openmrs.api.context.Context;+import org.openmrs.module.addresshierarchy.AddressHierarchyEntry;+import org.openmrs.module.addresshierarchy.AddressHierarchyLevel;+import org.openmrs.module.addresshierarchy.service.AddressHierarchyService;+import org.openmrs.module.emrapi.concept.EmrConceptService;+import org.openmrs.module.webservices.rest.SimpleObject;++import java.util.regex.Matcher;+import java.util.regex.Pattern;++public class AddressHierarchyTransformer implements RowTransformer {++    protected Log log = LogFactory.getLog(getClass());++    @Override+    public SimpleObject transform(String url) {+        AddressHierarchyService addressHierarchyService = Context.getService(AddressHierarchyService.class);+        String uuid = getUuidFromUrl(url);+        if (uuid == null) {+            return null;+        }+        try {+            AddressHierarchyEntry addressHierarchyEntry = addressHierarchyService.getAddressHierarchyEntryByUuid(uuid);+            if(addressHierarchyEntry != null && addressHierarchyEntry.getAddressHierarchyEntryId() != null) {+                StringBuilder sbr = new StringBuilder();+                sbr.append("{");+                sbr.append(KeyMapping.AddressHierarchyEntry_ID + addressHierarchyEntry.getAddressHierarchyEntryId() + ",");+                sbr.append(KeyMapping.Name + addressHierarchyEntry.getName() + "\",");+                sbr.append(KeyMapping.Level_ID + addressHierarchyEntry.getLevel().getId() + ",");+                sbr.append(KeyMapping.AddressHierarchyLevel);+                sbr.append(KeyMapping.AddressHierarchyLevelID + addressHierarchyEntry.getLevel().getId() + ",");+                sbr.append(KeyMapping.AddressHierarchyLevelName + addressHierarchyEntry.getLevel().getName() + "\",");+                sbr.append(KeyMapping.AddressHierarchyLevelParent_ID + getParentLevelID(addressHierarchyEntry.getLevel().getParent()) + ",");+                sbr.append(KeyMapping.AddressHierarchyLevel_AddressFiled + addressHierarchyEntry.getLevel().getAddressField() + "\",");+                sbr.append(KeyMapping.AddressHierarchyLevel_Required + addressHierarchyEntry.getLevel().getRequired() + ",");+                sbr.append(KeyMapping.AddressHierarchyLevel_UUID + addressHierarchyEntry.getLevel().getUuid() + "\",");+                sbr.append(KeyMapping.AddressHierarchyLevel_ID + addressHierarchyEntry.getLevel().getId() + "},");+                sbr.append(KeyMapping.Parent_ID + getParentID(addressHierarchyEntry.getParent()) + ",");+                sbr.append(KeyMapping.UserGenerated_ID + addressHierarchyEntry.getUserGeneratedId() + "\",");+                sbr.append(KeyMapping.UUID + addressHierarchyEntry.getUuid()+"\"");+                sbr.append("}");+                SimpleObject simpleObject = new SimpleObject();+                simpleObject.add("address",  SimpleObject.parseJson(sbr.toString()));+                //log.error("converted response ->" + simpleObject.get("address"));

@gopikrishna-yaramothu Please remove the commented if its no longer required here

gopikrishna-yaramothu

comment created time in a month

push eventBahmni/bahmni-gauge

shridhar kalagi

commit sha dbcae6c6e6e251f5220f59e3ca1da92fa4ca3fa3

update webdrivermanager

view details

push time in a month

delete branch Bahmni/bahmni-offline

delete branch : addCI-android

delete time in a month

push eventBahmni/bahmni-offline

Shridhar Kalagi

commit sha 389f203db2bf5a17fd882c6a595a1d366da85856

Generate APK using artefacts from bahmni-connect repo (#13) add github actions to generate APK using artefacts from connect repo

view details

push time in a month

PR merged Bahmni/bahmni-offline

Generate APK using artefacts from bahmni-connect repo

Generate APK using artefacts from bahmni-connect repo

+73 -1

0 comment

3 changed files

shridharkalagi

pr closed time in a month

PR opened Bahmni/bahmni-offline

Generate APK using artefacts from bahmni-connect repo

Generate APK using artefacts from bahmni-connect repo

+73 -1

0 comment

3 changed files

pr created time in a month

push eventBahmni/bahmni-playbooks

Buvaneswari Arun

commit sha c733a1f3aa79d186d3afbae6e2b36f763d8deae2

BAH-984|Buvaneswari|OpenElis hibernate.cfg.xml gets overridden by the Jinja template during installation

view details

buvaneswari-arun

commit sha 816364afe411adf919d7ee6304542034630d1584

Merge pull request #62 from buvaneswari-arun/BAH-984 BAH-984|Buvaneswari|OpenElis hibernate.cfg.xml gets overridden by the…

view details

push time in a month

PR opened Bahmni/bahmni-playbooks

BAH-984|Buvaneswari|OpenElis hibernate.cfg.xml gets overridden by the…

… Jinja template during installation

+4 -0

0 comment

1 changed file

pr created time in a month

pull request commentBahmni/bahmni-offline-sync

BAh-1109 | Gopi, Shriram | Selective sync Strategy Changes in OMOD

CLA assistant check <br/>Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.<br/>1 out of 2 committers have signed the CLA.<br/><br/>:white_check_mark: gopikrishna-yaramothu<br/>:x: gopikrishnayaramothu<br/><sub>You have signed the CLA already but the status is still pending? Let us recheck it.</sub>

gopikrishna-yaramothu

comment created time in a month

PR opened Bahmni/bahmni-offline-sync

BAh-1106 | Gopi,Shriram | Changes Related To Zipping of AddressHierarchy and OfflineConcepts

…lineConcepts

(cherry picked from commit 54be5d5ea614296b4b50b53834cdb97a0e720b69)

+648 -3

0 comment

8 changed files

pr created time in a month

pull request commentBahmni/event-log-service

BAH-1109 | Gopi , Shriram | Selective Sync Feature - EventLogService

CLA assistant check <br/>Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.<br/>0 out of 2 committers have signed the CLA.<br/><br/>:x: gopikrishna-yaramothu<br/>:x: gopikrishnayaramothu<br/><sub>You have signed the CLA already but the status is still pending? Let us recheck it.</sub>

gopikrishna-yaramothu

comment created time in a month

more