Project: Scaling up the mobileHBS/DHIS2 Tracker and Trainer applications

This is fine and it seems to be working correctly from the desktop or mobile browser. You need to figure out a mechanism that will download the data from the URL and save it in the app. Then it should be viewable through the app once someone is offline.

The /documents Web API documentation is here : Developer Manual - DHIS2 Documentation

@bhavesh3005sharma, I am triaging some of the old issues in Gitlab for the two repos. I am moving the issues to the appropriate project and tagging you on the ones that you need to work on. Please assign yourself or comment on the issue that you are working on.

@sunbiz I have some doubts regarding our codebase.

  1. I think initially you had made one repo iupui-soic/ mHBS-trainer and in its master branch you are coding for trainer app in HTML, CSS & JS and in mhbs-alpha you are coding for tracker app which is cloned version of origin dhis2 app and you had made changes in it for mhbs tracker app. And later on, I think this mhbs-alpha get shifted to a new repository iupui-soic/ mHBS-tracker. Am I right? Please correct me if I am understanding wrong.

  2. I think that the master branch of iupui-soic/ mHBS-tracker is not up to date we had merged it with the new dhis2 app and shifted this repo to GitLab. Can you tell me the branch where the other work are done before and are updated if exists so that I can merge that with our updated GitLab master branch then we can check for all issues. Currently, I am not seeing any commits for the issues you have mentioned I think they are not merged.

@sunbiz currently as stated earlier I had shown the document in a list and Now I had added support to play video media files within our app and it is working fine. But I am not getting what do you mean by

do you mean that whenever a user is online we will refresh or download all the video media files from the server and store them locally and will be shown when the user is offline. But I don’t think it is right to download all media files from the server and store it locally on the device without user permission as if we have a lot of files on the server then downloading them over and over consumes a lot of data and even the storage space as may be user doesn’t want all video to be stored locally.

I suggest that there is a download option in every media files from where a user can download a particular media file that he wants to be present offline instead of downloading all videos.

And for the list of documents that particular data will not consume much space and internet we can directly store it locally to be present when a user is offline. So that the list of documents will be refreshed whenever the user comes online but to view a media either it should be downloaded by the user before or the internet connection should be alive.

Please give your point of view on this.

You should be able to click on a media (video/PDF, etc.) from that list and it gets downloaded. Once downloaded to the device, it should be available for playing and clicking on the item from the list should start the video.

Off course, this should be based on the user clicking and downloading the media to their device. Only those that have been downloaded should be available offline.

1 Like

Please have a look at this as well.

Please look at the issues in these two repos:

  1. mHBS-tracker - LibreHealth / LibreHealth Incubating Projects / mhbs / mHBS-tracker · GitLab
  2. mHBS-trainer - LibreHealth / LibreHealth Incubating Projects / mhbs / mHBS-trainer · GitLab

The ones that are high priority should be done first, then Medium… If there are any regressions, then that is something else that you need to prioritize. Any new bugs found also will need to be worked on. If you still have time till the end of the GSoC, then look for any remaining ones.

1 Like

This weeks blog Third Week of Coding : 19 June - 25 June

@sunbiz we have 2 ways to upload media on dhis2 one is files upload and the other is an external link. For files upload media if we hit an API call we get back a response of blob object and I am showing this in our app. But the problem is with files uploaded as the link they will give us an HTML response while hitting the API and for some of the files the origin link is directly available and in some of the files it is not directly available, I had checked it. And in fact, if we somehow manage to get an original link from that HTML response then the problem is that its uses depend on the type of link it is. As like if we simply post a youtube video URL on the dhis2 and get it in the trainer app even then we need some extra things to put on in the iframe, similar is the case if it’s a link of google drive and all.

The point is that try to upload media as a file on the dhis2 to get it to work properly on the trainer app as it expects a blob object. And for the link, we are not able to download the content.

You have to provide me with download files of these videos Webinars (aap.org) if they needs to uploaded on the dhis2.

I had sent an MR with this work please have a look Added mediaPage and Populated with real data Fetched from bmgfdev instance and Added support to play all media files of type blob (!194)

For offline support, I had decided to use the SQLite database and will be sending a separate PR for that.

@sunbiz Work related to offline support or SQLite is completed. I had created an MR ( Link ) please have a look at that.

I had made small changes in the UI as well to show the synced status of the documents. And the SQL database storage logic is also modified from one discussed in the last blog because we need to take care of the updates ( deleting a document from dhis2 & updating the name of document ) related to the documents, so to take care of them I had modified my logic.

I had well-commented everything in the comments. Please have a look at it. And we have one more MR pending ( (!194) ·Merge requests ·GitLab) please merge it before and then the offline support one. The new one has modifications on the files committed on the previous one to make the files available offline.

I had added Gitlab- CI to the project as well and both MR has passed that one.

This weeks blog Fourth Week of Coding : 26 June - 2 July (bhavesh3005sharma-gsoc21.blogspot.com)

@sunbiz please have a look at the MR sent earlier days.

I added comments on both the MRs. Please remove build files and keep only the source files in your commits. Please do that through the gitignore so that these files do not get added again in your commits.

okay, I will make the changes accordingly.

Till then please have a look at this - In the app usage track issue, I want some clarifications. Would you want that for every page in our app it should be noted that how many users had visited this page as counter only means no details of the person’s visited this page just a number states that this much times this page is visited or you want the page visits separated by users means how many times a particular user visits that page?

And do you want that page visit counter should increase only for unique user visits or for every visit by a user? Please try to clarify these points as early as possible.

Yes - visits per page, time per page, no. of pages. Doesn’t necessarily have to be associated with each user, but simply aggregate time per user is fine to be reported.

@sunbiz I had removed build files from both of the MRs in the last commits you may seen too many changes due to deletion of these files other commits are fines. Please have a look at the MRs again.

@sunbiz mhbs-trainer is not building it is throwing errors like

I had checked my proxy setting it is turned off. Even our past code which builds successfully over GitLab CI is not building now showing the same error I had find out a possible cause for that please let me know is it correct. There is a dependency “io.fabric.tools:gradle:1.+” in build.gradle and shown in error I go to the URL and see this I think the error is due to maven.fabric.io security certificate expiration. Is it right because this appears from today only?

I want to discuss some points for the app usage tracker also. Currently, I had made Page Usage Tracker tracker entity type and mHBS Trainer Usage Tracker program to track usage. For every page, I had made a tei in this program and it will keep a record of total visits by all users & time spent by all users.

For the page visits and time spent on-page in the app, I had made a new SQL table to store data locally and I will keep updating its visits and time spent for every page on user’s action.

Now I have a doubt should we send this data continuously to dhis2 means every time when users visit the page update it to dhis2 or we can do it in a way like when visits in local DB become greater than 50 ( or some threshold value ) we will update it to dhis2 will make fewer API calls and saves a lot of data for users. Similar for time spent on each page.

And I want clarifications about the login system of the app. I think there is not any login screen in the app. How the users enter the app? Till now the overall usage of the app can be tracked but to track usage over per user we need total users of the app.

fabric is a deprecated service. We should use a different one and remove all references to this service.

This will be too much data and so we should likely not have separate tracker entity type for this purpose. For the time being, we only need aggregate data and this is likely best stored as a user attribute, and not as a program. I know the initial design was like that, but I think it was suited for a research study where we wanted to discover how app usage affected training outcomes, for multiple apps. Now that we want to scale this, I think it is better stored and tracked through user attributes ( /api/33/userDataStore), rather than a separate program.

I like this idea, but instead of POSTing to the program, lets just POST it to the user .

@sunbiz did you mean that in users datastore we should store the app usage of the trainer app by every user. What I had understood is for every page I will create a namespace in the user’s datastore and key for elements like page visits, time spent, etc and update their values there in JSON format. Is it right to mean I should implement it in that way? And one more point in this way we can track the usage by each person but I think we need the overall app usage as well how we can do that in this? or usage for every person is enough to be recorded an we can left overall usage?

Yes, that’s what I was suggesting. The app usage, for now, will be for the mHBS trainer, but could later be expanded for ECEB and other apps in the mHBS suite.

Yes, we need the usage of every user and that should be enough.

1 Like

I want to discuss for this as well Role based restricted access for viewing tracked entities (#44) · Issues · LibreHealth / LibreHealth Incubating Projects / mhbs / mHBS-trainer · GitLab

I think you want that only the TEI created by logged in user should be visible to logged in user. I don’t find any field in tracked entities that can suggest which user has created this tei than how can I filter this? Please give some idea here also.

searchTrackedEntities() this is the function of app/src/main/java/org/dhis2/usescases/searchTrackEntity/SearchRepositoryImpl.java · master · LibreHealth / LibreHealth Incubating Projects / mhbs / mHBS-tracker · GitLab from where the tei are currently loaded in the tracker app.

Fifth Week of Coding 5th July - 9th July (bhavesh3005sharma-gsoc21.blogspot.com)

@bhavesh3005sharma this is one of those issues that doesn’t have to be solved urgently. It would be good to find a generic solution, but there is a workaround from the DHIS2 side by limiting the search for certain user roles.

Please review and work on issues that have been triaged and labeled with some priority.

1 Like