Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAH 1109, BAH 1106 | Shriram , Gopi , Rakesh , Aakash , Som | Zipping and importing AddressHierarchy & OfflineConcepts Data in BahmniConnect & Selective Sync Strategy #22

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

gopikrishna-yaramothu
Copy link

@gopikrishna-yaramothu gopikrishna-yaramothu commented Dec 21, 2020

Description

As per existing functionality, during initial sync process( I.e. enable new Tablet/Device to use BAHMNI in fields i.e. Offline BAHMNI) , all offline concepts, address hierarchy and patient information for a specific login location is being synced from BAHMNI server to connect device. This is time consuming process and take around 8 to 10 hours to complete the initial sync. As part of this story card, need to modify the existing workflow of the Initial sync process for initial sync performance improvement.

  1. Need to modify existing initial Sync Functionality to sync only offline-sync-data and address hierarchy data upon login. Includes changes on UI code to save offline-concepts + Address_Hierarchy to indexedDB
  2. Patients and encounters should not get imported to PWA till user initiates the sync for Patient information.
  3. Patient information and encounters needs to be synced upon user clicks on the Sync Button available on the right most top corner of the Bahmni Connect Home Page / from selectiveSync Page.

Contributors ::

@shriram-k
@Aakash16
@rakesh-1010
@gopikrishnayaramothu
@sombhattacharyya1983

shriram-k and others added 3 commits December 21, 2020 11:41
…and offline concepts and importing them on page load.
BAH-1109 | Rakesh, Gopi | Fix dist folder not showing syndatrules folder and its content on build

BAH-1109 | Rakesh, Gopi | Fix Filter issue

BAH-1109 | Gopi,Rakesh | Added an Alert to check whether user connected to Network or not
@gopikrishna-yaramothu gopikrishna-yaramothu changed the title BAH 1109 BAH 1106 BAH 1109, BAH 1106 | Shriram , Gopi , Rakesh , Aakash , Som | Zipping and importing AddressHierarchy & OfflineConcepts Data in BahmniConnect & Selective Sync Strategy Dec 21, 2020
var getAddressHierarchyDataForFiles = function (fileNames, count, eventLogUuid, dbName) {
if (count !== fileNames.length) {
return $http.get(Bahmni.Common.Constants.preprocessedAddressHierarchyUrl + fileNames[count]).then(function (response) {
updatePendingEventsCount("addressHierarchy", response.data.addressHierarchy.length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gopikrishna-yaramothu can we have the constants defined instead of hardcoding the names here like "addressHierarchy", "eventLogCategories", "forms", "offline-concepts"..etc

headers: { "Accept": "application/text", "Content-Type": "text/plain" }
}).then((response) => {
let value = response.data;
if (value.includes("SelectiveSyncStrategy")) { $scope.isSelectiveSyncStrategy = true; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gopikrishna-yaramothu try to use constants instead of hardcoded text here

@binduak
Copy link
Contributor

binduak commented Dec 31, 2020

@gopikrishna-yaramothu @sombhattacharyya1983 test coverage is not as expected for the newly implemented code. Requesting you to add more test cases. Thanks !

var verifySelectiveSync = function () {
$http.get('/openmrs/ws/rest/v1/eventlog/filter/globalProperty/', {
method: "GET",
params: { q: 'bahmniOfflineSync.strategy' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be part of controller. Do we have any service that it talks to. If yes, we can move the code to the service file @gopikrishna-yaramothu

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't have any service that will do the needful Bindu. if it's better to use service we will create a new service . please suggest us .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@binduak
This has been fixed

var verifySelectiveSync = function () {
$http.get('/openmrs/ws/rest/v1/eventlog/filter/globalProperty/', {
method: "GET",
params: { q: 'bahmniOfflineSync.strategy' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gopikrishna-yaramothu same as mentioned above

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@binduak
this has been fixed

@binduak
Copy link
Contributor

binduak commented Jan 25, 2021

@gopikrishna-yaramothu the below files doesn't have any new test cases added
selectiveSyncService.js , selectiveSchedulerService.js 

@CLAassistant
Copy link

CLA assistant check
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.
1 out of 2 committers have signed the CLA.

✅ rakesh-1010
❌ gopiyaramothu
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants