GithubHelp home page GithubHelp logo

welthungerhilfe / cgm-scanner Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 8.0 221.26 MB

Child Growth Monitor Scanner App

Home Page: https://childgrowthmonitor.org

License: GNU General Public License v3.0

Java 99.62% Shell 0.38%

cgm-scanner's People

Contributors

jaydesai111 avatar jdunn9516 avatar lev-stupka avatar lvonasek avatar mmatiaschek avatar prajurock avatar sblisztomaniac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cgm-scanner's Issues

manual measures

captions of fields for measures should be the same during entering and presentation

  • 01 Scan Date //filled automatically
  • 02 Scan Location
  • 03 Height
  • 04 Weight
  • 05 MUAC
  • 06 Head Circumference
  • 07 Oedema

List of measures should be sorted with latest on top, oldest on the bottom of the list

IDs

As a data scientist working with the database I want a simple way to determine what kind of data point I have when I see just the ID.

Therefore we already implemented the following schema:
UUID of App_object-type_epoch ms_random string

but for person it is the last name instead of "person"
and for measures it should be "manual" or "scan" instead of "measure"

qrcode set to null

sometimes the qrcode of a person is set to null. It looks like it happens sometimes when swiping down on the person list.

  • remove swipe down as it is not necessary anymore with LiveData´
  • make sure there are no direct reads / writes to Firebase Database outside of Sync
  • throw Exception and make call to Crashlytics when loading a person with qrcode null
try {
    methodThatThrows();
} catch (Exception e) {
    Crashlytics.logException(e);
    // handle your exception here
}

i18n

  • All Strings that are shown to the user must be in strings.xml
  • As a user i want to be able to choose my main language (default from system language)
  • the app should be able to display hindi हिन्दी letters

show data in overview

as a user i want to see names, height and weight of the children in the overview

the personaldata in the recyclerview should show the height and weight from the last measures where both were not null or 0.0

image

fix crash during sync

see Crashlytics Issue and Stacktrace below

steps to reproduce:

  • start App (online)
  • add manual measures
  • wait a few minutes

growth chart over-expanded

  • check qr code v132-test1

the growth chart is over-expanded because of the scan measurement.
scan measurement should be current timestamp / days of age

image

growth charts workflow

as a user when i save a manual measurement i want the screen to change to the GROWTH tab to see the measurement on the chart

  • saving a manual measurement should switch tab/fragment to GROWTH
  • newly added measurement should appear to show the user the progress
  • if there is only one measurement it should show up as a big black dot

last location

as a user i want to know where a child was scanned the last time.

currently lastLocation is not set in measures:
https://console.firebase.google.com/u/0/project/child-growth-monitor-dev/database/firestore/data~2Fpersons~2Fc99eac07f31db1e7_test10_1529077465187_J04sSXrt2CLyyIbs~2Fmeasures~2Fc99eac07f31db1e7_measure_1529077530408_bOedQdTFsxQBRQ7P

how to reproduce: set location in manual measurement - it is not saved

only write/overwrite lastLocation on person when location of measure is not null or ""

adding manual measures

make manual measure input easier

default values/input formats should be:

  • height: 0.0 cm
  • weight: 0.0 kg expandable to 12.595 kg
  • muac: 0.0 cm
  • head circumference: 0.0 cm

currently when entering manual measures floats are not exact

height: 95
headCircumference: 56.9
muac: 26.1
weight: 22.6

the backend saves:

height: 95
headCircumference: 56.90000152587891
muac: 26.10000038146973
weight: 22.60000038146973

All values must be saved exactly with the precision that they have been entered, minimum of one digit after the point:

height: 95.0
headCircumference: 56.9
muac: 26.1
weight: 22.6

for values above 120 and values with less then .1 precision a tooltip (similar to currently "please input height" etc. should appear:

  • tooltip for height:
- value in kilograms
- at least one digit after the decimal point
- i.e. 12.595
  • tooltip for height, muac, head circumference:
- value in centimeters
- use millimeter precision
- i.e. 95.6

image

image

Growth Charts

  • use MPAndroidChart "Time Chart" but with multiple lines like the "Multiple Lines Chart" Example
  • start with Age/Height --> Length/height-for-age

include the following files as a static asset into the app:
for girls: http://www.who.int/childgrowth/standards/lhfa_girls_p_exp.txt
for boys: http://www.who.int/childgrowth/standards/lhfa_boys_p_exp.txt

  • draw lines from day 0 to current age in days + 100 for the data in the following columns
    • P3
    • P15
    • P50
    • P85
    • P97

It should look something like this for a child that is 5 years old. For younger children the chart is cut off.
http://www.who.int/childgrowth/standards/cht_lhfa_girls_p_0_5.pdf

  • also draw a thick black line for the measurements of the child

do the same with

Visual Feedback when enough data was gathered

add progress bar to RecorderActivity
image

  • set visible and to 0 percent in BABY_FULL_BODY_FRONT_SCAN, BABY_LEFT_RIGHT_SCAN, BABY_FULL_BODY_BACK_SCAN
  • set to 50 percent when FAB is touched to start recording (fab = red)
  • set to 100 percent when the FAB is touched again to stop recording

100% probably will not be visible because the progressbar should be hidden again in the onboarding steps: BABY_FULL_BODY_FRONT_ONBOARDING, BABY_LEFT_RIGHT_ONBOARDING, BABY_FULL_BODY_BACK_ONBOARDING
i will use it to show progress in data collection instead of just using it through the FAB.

The Progress Bar should be visible on top of the camera picture, something like this:
image

artefacts log

As a User logged into the App i want to make sure that all scan artefacts are being uploaded and that data that is saved in the cloud will be automatically deleted from the device.

To upload all files the app should check the contents of the local storage and build a log table in the local Room database from it.
This log is then used to check if a file was successfully uploaded.
if the file gets set the "delete" flag it can be deleted from the local storage.

  • table in room database
    • id
    • type (consent,pcd,rgb)
    • full path and filename
    • hash value (SHA-1)
    • file size
    • date of successful upload
    • CreatedBy
    • boolean delete
  • sync with Firestore upload only (don't download logs from other devices)
  • is used by the FirebaseUploadService as source of work

measures are not being displayed

after fresh install measures are empty
looks like measures are only uploaded but not downloaded
all measures should be available from the start and be updated via LiveData

the current state should be

child name manual measures scan measures
offline child24 1 0
test1005 child 2 4
test2 m 0 1
test6 mo 1 0

possibly related to
https://console.firebase.google.com/u/0/project/child-growth-monitor-dev/crashlytics/app/android:de.welthungerhilfe.cgm.scanner/issues/5b1a524e6007d59fcd3cd8fd?time=last-hour&sessionId=5B216FBC024A000153E63C6D118EC198_DNE_0_v2

overview of growth

As a user i want to see the growth for the next 100 days from now on so i can see how the child should be developing

  • show chart from day 0 to current day + 100

service for syncing local storage with Firebase Storage

The service will be used to store and sync:

  • picture of the consent of parents with QR code
  • scan artefacts
    • mp4 video files from RecorderActivity
    • .vtk or .pcd files with point clouds from RecorderActivity

TODOs:

  • use local storage for getting consent pictures
  • if consent picture is not available from local storage get it from Firebase Storage
  • make it optional to delete files from local storage after sync

location update

as a user i want to update the scan location to my current location

workflow

same timestamp for scan and manual measures that belong together

Accountability

As a nutritionist i need to know which user added which measurement in order to document the nutrition survey and do statistical analysis on accuracy of measurements.

save currentUser with each document (person/measurement)
every person document/dataset and every measures document/dataset should have the userID of the creator of the document/dataset

the UUIDs saved with each object in their ID can change. Also Users can switch phones. In any case we have no relation between UUIDs and logged in user, so we need additional createdBy fields.
String createdBy = mAuth.getCurrentUser().getEmail();

  • in Room database Person

  • in Room database Measure

  • where is the mapping between Room database and Firestore?

personal data --> measures

as a user i want to know when i have filled out all fields in order to save current persons data.
as i user i want to know that the persons data has been saved so i can scan and measure the person.

the save button (btnNext in fragment_personal.xml) in the CreateDataActivity

  • when pressed while active (green) should save person and go to measures tab
    if easy to do:
  • should turn from grey to green when all mandatory fields are filled

also it should give positive affirmation
when person is saved blend in:
image

uniform nomenclature

name description
person person or folder for persons subfolders
measurement
measure
scan

deleting data

  • mark as deleted
  • deleted by
  • remove from local storage
  • person
  • measures

gender

currently male/female/other
remove other

Login while offline

When trying to login while offline please add an error message/toast
"can not connect"

Fix Warnings in RecorderActivity

  • Warning:(2, 1) Dangling Javadoc comment
  • Warning:(114, 13) Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)
  • Warning:(115, 13) Do not place Android context classes in static fields (static reference to OverlaySurface which has field mContext pointing to Context); this is a memory leak (and also breaks Instant Run)
  • Warning:(434, 35) Number formatting does not take into account locale settings. Consider using String.format instead.
  • Warning:(542, 45) Explicit type argument float[] can be replaced with <>
  • Warning:(543, 48) Explicit type argument float[] can be replaced with <>
  • Warning:(544, 46) Explicit type argument Float can be replaced with <>
  • Warning:(545, 51) Explicit type argument String can be replaced with <>
  • Warning:(574, 28) Result of 'File.mkdir()' is ignored
  • Warning:(759, 31) Explicit type argument TangoCoordinateFramePair can be replaced with <>
  • Warning:(809, 17) 'if' statement has empty body
  • Warning:(824, 23) This AsyncTask class should be static or leaks might occur (SendCommandTask)
  • Warning:(903, 31) This AsyncTask class should be static or leaks might occur (SendCommandTask)
  • Warning:(949, 30) Result of 'File.mkdirs()' is ignored
  • Warning:(1010, 13) Local variable 'offset' is redundant
  • Warning:(1186, 75) Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead
  • Warning:(1210, 17) The value myBuffer.getFloat((4 * i + 3) * 4) assigned to 'confidence' is never used
  • Warning:(1257, 19) This AsyncTask class should be static or leaks might occur (SendCommandTask)
  • Warning:(1309, 17) Dangling Javadoc comment
  • Warning:(1389, 13) 'for' loop replaceable with 'foreach'

delete persons

as a admin i want to delete persons and their measurements that have been created for test purposes.

the problem is to sync the deletion with the local Room databases of the clients

maps key

remove google_maps_key from repository

document test cases for release

  • logout
  • login
  • add person
    • check firebase database for person
    • check firebase storage for consent
  • add manual measures
  • add scan measures
  • save existing person with/without changes (#70)

Performance

  • trace performance of scanning process (frames per second)
  • trace upload performance
  • trace writeToFile performance

improved Room<-->Firestore sync

When a new entry to the Room DB is saved and the device is online (WiFi or mobile-network) the app should immediately sync it to Firestore.

  • sync every 5 minutes
  • sync when connection changes
  • make time period of period sync (5m) part of settings
  • user setting for sync (WiFi or mobile / WiFi only)
  • Firebase Remote Config for time period (default 5m)
  • Firebase Remote Config for sync connection (default WiFi or mobile)

Android Lint

In Android Studio Menu:

Analyze --> Inspect code...

  • remove all errors
  • check warnings

growth chart improvements

  • measure line should only show measures of type: "manual"

x and y labels

  • set labels for x and y-axis
    • age --> days
    • height --> cm
    • weight --> kg
    • MUAC --> cm
    • Head circumference --> cm

implement the other charts

make location reliable

Scanning process:

scan QR code, enter personal data, scan, manual measurement.

problem: location is not updated when phone has been moved

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.