Difference between revisions of "Three developers walk into a bar(code)"

From mn/ifi/inf5750
Jump to: navigation, search
(Summary of Requirements)
 
(34 intermediate revisions by 3 users not shown)
Line 1: Line 1:
/* Task Description */[http://www.uio.no/studier/emner/matnat/ifi/INF5750/h15/group-projects/bar-codes/ Patient IDs and bar code input and output] __TOC__
+
[http://www.uio.no/studier/emner/matnat/ifi/INF5750/h15/group-projects/bar-codes/ Patient IDs and bar code input and output] __TOC__
 
== Group Members ==
 
== Group Members ==
 
{| class="wikitable"
 
{| class="wikitable"
Line 17: Line 17:
 
== Summary of Requirements ==
 
== Summary of Requirements ==
 
=== Features ===
 
=== Features ===
* Appen skal kunne scanne og tolke en pasients barcode, og finne pasienten ved hjelp av denne
+
* The app should both scan and interpret a patient's personal bar code, that is used for identifying patients.
* Appen skal kunne be brukeren om å registrere en ny pasient dersom det ikke finnes treff på pasientens barcode.
+
* It should be able to find a patient in the database based on its bar code.
* Skal fungere som web app + android app.
+
* If there is no patient entry found after the bar code search, the system should make a new patient entry.
 +
* The app should exist as a web app, and also an android app.
  
 
=== Architecture ===
 
=== Architecture ===
![App-struktur](App-struktur.png)
+
 
<gallery>
+
The new architecture for our application is an edited version of the Tracker Capture-application to support the barcode scan.  
File:App-struktur.png|Strukturen til appen
+
* HTML/JS/CSS/JQuery + AngularJS
</gallery>https://serratus.github.io/quaggaJS/ - QuaggaJS virker som et bra JS-bibliotek for scanning og tolkning av barcodes.
+
* QuaggaJS to scan barcodes with a connected camera.
* Spring/Maven/Hibernate på backenden
+
* [https://github.com/lindell/JsBarcode JSBarcode] - an open source library to generate bar codes.
* HTML/JS/CSS/JQuery + kanskje AngularJS på frontend
 
* Oversetter frontendkoden med Cordova for å få Android-støtte
 
  
 
== Time Schedule ==
 
== Time Schedule ==
Line 42: Line 41:
 
** Project should be finished
 
** Project should be finished
 
* Final Delivery: 11th December
 
* Final Delivery: 11th December
 +
 
== Task Delegation ==
 
== Task Delegation ==
 +
 +
We have met weekly to program together and agree on what needs to be done.
 +
 +
We have then delegated smaller parts of the project every week.
 +
 +
== Implementation details ==
 +
Our barcodes use the 11-character UID - the Tracked Entity Instance's unique ID - for generating barcodes. This is because this is an ID that can identify a patient with 100% accuracy, and is also accessible in every Organization Unit and Program.
 +
 +
<s>A new barcode search field has been made on the main page of the Tracker Capture application. This field can be merged with the original search field if desired without much hassle.</s>
 +
 +
<s>When the barcode is scanned and the barcode search field is filled with the 11-character UID, the system calls the web API to find the user.</s>
 +
 +
The search fields are now merged to one field, for the sake of simplicity and so that ordinary users now caring about the barcode can ignore it and search normally.
 +
 +
When pressing the barcode search button, the contents of the search field are used to call the web API to find the correct user.
 +
 +
If found, the system fills the list of found patients with the found patient.
 +
 +
If not found, the system informs the user that this barcode doesn't exist on this server, and if the user wants to register a new patient. If the user says no, they are taken to the page they were at before the search started.
 +
 +
If the user says yes, the user is taken to an edited registration screen, that registers a new patient the same way as the original registration, but with a specified UID identical to the barcode that was scanned.
 +
 +
In addition to the search-and-registering-functionality described above, there is also a barcode generation on the patient dashboard page, where you can press the "Print barcode label" button, and a print page opens with the generated barcode based on the UID.
 +
 +
===== Known bugs =====
 +
* We forgot to stop the camera when aborting the scan. It only stops when a successful scan goes through
 +
* With the right sequence of button presses, you can get an old table to load when pressing Cancel - this is a state change gone awry, but doesn't impact functionality.
 +
 +
== Suggested changes to the Tracker Capture App / API ==
 +
We have no suggested changes to the API - it works really well.
 +
 +
We did, however, find a bug with the Tracker Capture app that we thought we had introduced, but after testing it, it seems that it is in the original app as well:
 +
 +
Here are steps that reproduce the bug:
 +
# Press the "Register"-button
 +
# Fill out the form
 +
# Press "Register and add new"
 +
# Fill out the form to register another patient
 +
# Press "Register and Continue"
 +
# Press the "Back"-button
 +
# Only the last patient registered is now in the system. The first patient is not present.
 +
This means that if someone wants to register several patients in one go, the system makes the person go back to the main page and press "Register" every time to not lose data.
 +
 
== Screenshot and Screen flows ==
 
== Screenshot and Screen flows ==
 +
The Tracker Capture web application with barcode:
 +
 +
[[File:TrackerCaptureBarcode.png|thumb|none|1000px]]
 +
 
== Documented Learning throughout the Project ==
 
== Documented Learning throughout the Project ==
== Suggested improvements to the APIs ==
+
We have learnt a lot throughout this project, both about the DHIS system as a whole, but also generally about development, open-source development and some frameworks.
 +
 
 +
=== The system ===
 +
The basics of the tracker capture applications architecture and API.
 +
 
 +
=== Open-source development ===
 +
Implementing open source libraries, such as QuaggaJS and JSBarcode.
 +
 
 +
=== Frameworks ===
 +
Front-end dev, angular, setting up Postgres etc.
 +
 
 +
== Android ==
 +
=== The app ===
 +
We started developing an android application in the later stages of the project.
 +
 
 +
The app does not contain as many features as the web-app duo to less development time.
 +
 
 +
 
 +
The front page with the barcode scanner button in the top right.
 +
[[File:android-image1.png|thumb|none|200px]]
 +
 
 +
The barcode app with a scanned barcode.
 +
[[File:android-image2.png|thumb|none|200px]]
 +
 
 +
Searching for the given result in the app.
 +
[[File:android-image3.png|thumb|none|200px]]
 +
 
 +
=== Features ===
 +
The app has a button for scanning barcodes.
 +
This opens a program for scanning of barcode and stores the barcode value for further use.
 +
 
 +
=== Improvements ===
 +
Implement lookup function with the barcode string as input.
 +
 
 +
 
 
== Link to Repository ==
 
== Link to Repository ==
  
== Download link to Sample Web/Android Application ==
+
Our [https://bitbucket.org/dhis2barcode/barcode barcode repo] is located on Bitbucket.
 +
 
 +
== Download link to Sample Web/Android Application ==

Latest revision as of 23:34, 15 December 2015

Patient IDs and bar code input and output

Group Members

Navn e-mail
Espen Bay Fevolden espenbf@ifi.uio.no
Vegard Søyseth vegardds@ifi.uio.no
Kjetil Bugge Kristoffersen kjetilbk@ifi.uio.no

Summary of Requirements

Features

  • The app should both scan and interpret a patient's personal bar code, that is used for identifying patients.
  • It should be able to find a patient in the database based on its bar code.
  • If there is no patient entry found after the bar code search, the system should make a new patient entry.
  • The app should exist as a web app, and also an android app.

Architecture

The new architecture for our application is an edited version of the Tracker Capture-application to support the barcode scan.

  • HTML/JS/CSS/JQuery + AngularJS
  • QuaggaJS to scan barcodes with a connected camera.
  • JSBarcode - an open source library to generate bar codes.

Time Schedule

  • Milestone 1: 8th Novemeber
    • Document Features and Architechture on the Wiki
    • Show understanding of DHIS2 web applications
    • Set up GIT-repostitory
    • Delegate the tasks
  • Milestone 2: 22th Novemeber
    • First bare-bone version
    • Uploadable as DHIS2 web application
  • Milestone 3: 4th December
    • Project should be finished
  • Final Delivery: 11th December

Task Delegation

We have met weekly to program together and agree on what needs to be done.

We have then delegated smaller parts of the project every week.

Implementation details

Our barcodes use the 11-character UID - the Tracked Entity Instance's unique ID - for generating barcodes. This is because this is an ID that can identify a patient with 100% accuracy, and is also accessible in every Organization Unit and Program.

A new barcode search field has been made on the main page of the Tracker Capture application. This field can be merged with the original search field if desired without much hassle.

When the barcode is scanned and the barcode search field is filled with the 11-character UID, the system calls the web API to find the user.

The search fields are now merged to one field, for the sake of simplicity and so that ordinary users now caring about the barcode can ignore it and search normally.

When pressing the barcode search button, the contents of the search field are used to call the web API to find the correct user.

If found, the system fills the list of found patients with the found patient.

If not found, the system informs the user that this barcode doesn't exist on this server, and if the user wants to register a new patient. If the user says no, they are taken to the page they were at before the search started.

If the user says yes, the user is taken to an edited registration screen, that registers a new patient the same way as the original registration, but with a specified UID identical to the barcode that was scanned.

In addition to the search-and-registering-functionality described above, there is also a barcode generation on the patient dashboard page, where you can press the "Print barcode label" button, and a print page opens with the generated barcode based on the UID.

Known bugs
  • We forgot to stop the camera when aborting the scan. It only stops when a successful scan goes through
  • With the right sequence of button presses, you can get an old table to load when pressing Cancel - this is a state change gone awry, but doesn't impact functionality.

Suggested changes to the Tracker Capture App / API

We have no suggested changes to the API - it works really well.

We did, however, find a bug with the Tracker Capture app that we thought we had introduced, but after testing it, it seems that it is in the original app as well:

Here are steps that reproduce the bug:

  1. Press the "Register"-button
  2. Fill out the form
  3. Press "Register and add new"
  4. Fill out the form to register another patient
  5. Press "Register and Continue"
  6. Press the "Back"-button
  7. Only the last patient registered is now in the system. The first patient is not present.

This means that if someone wants to register several patients in one go, the system makes the person go back to the main page and press "Register" every time to not lose data.

Screenshot and Screen flows

The Tracker Capture web application with barcode:

TrackerCaptureBarcode.png

Documented Learning throughout the Project

We have learnt a lot throughout this project, both about the DHIS system as a whole, but also generally about development, open-source development and some frameworks.

The system

The basics of the tracker capture applications architecture and API.

Open-source development

Implementing open source libraries, such as QuaggaJS and JSBarcode.

Frameworks

Front-end dev, angular, setting up Postgres etc.

Android

The app

We started developing an android application in the later stages of the project.

The app does not contain as many features as the web-app duo to less development time.


The front page with the barcode scanner button in the top right.

Android-image1.png

The barcode app with a scanned barcode.

Android-image2.png

Searching for the given result in the app.

Android-image3.png

Features

The app has a button for scanning barcodes. This opens a program for scanning of barcode and stores the barcode value for further use.

Improvements

Implement lookup function with the barcode string as input.


Link to Repository

Our barcode repo is located on Bitbucket.

Download link to Sample Web/Android Application