curiosityom
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- # IN5320 - Case 1: Commodity dispensing Group 3 ## About the application The application provides and easy way for personell at hospital's or health clinic's pharmacy department to register dispenced medicines and medical equipment in DHIS2. The application also helps personel keep track of inventory and which medicines and medical equipement have been dispensed. Every transactions is being kept track of by using the DHIS2 API to store the number of commodities left and automatically update the “Consumption” and “End balance” in the data set. ## Functionality and implementation ### 1. Core functionality > Users should be able to register when a commodity is dispensed * To dispense commodities through in the application, go to the `Dispense`-tab in the side navigation bar. To add commodities here, simply search for the commodity in the search bar and press the `Add`-button. The selected commodity gets added to the list, where users can view balance and add amount to dispense. A commodity with a balance of 0 cannot be dispensed. * When every commodity is added to the list, and quantities have been selected, the user need to add the name of the person requesting the commodities, as well as their department. When all is selected, users are free to press `Submit form`, which updates the balance of commodities in the data set and adds the dispense to the log > The data set “Life-Saving Commodities” in the DHIS2 instance should be updated accordingly (adding to the consumption, and subtracting from the end-balance of the current month) * The data set “Life-Saving Commodities” is updated through an API-call each time a user submits a dispense of commodities. > The application should retrieve the listed commodities from the “Life-Saving Commodities” data set. If new commodities are added to the data set, these should be available in your application. * Navigating to the `Balance`-tab in the side navigation bar shows every commodity in the "Life Saving Commodities"-data set. The data in the table is retrieved from the data set, which ensures updated balance and commodities if the data set is updated. * There is also an additional feature in the `Balance`-table, where users can view the balance of a commodity in nearby hospitals, in case they want to request some additional stock from each other. #### Technical implementation - We used `useDataQuery` to receive data from the DHIS2 dataValueSet endpoint and received data from the organization units selected. We are using a table to display the data. - After dispensing we used useDataMutation to mutate the `dataValueSet`. This was done after validating that all input fields were valid and after the user pressed the submit button in the form. - The period updates automatically to be in the current period. We assume that a month is from the 14. in each year and that January is month 0. This means that today (19.11) is the period *202110* and that the next period will start 14.12. This takes away the hassle for the HSM to update stock-balances by hand each month. There is yet no functionality to handle a potential difference between expected delivery and actual delivery, but we our understanding from the case that there already exist an application that takes care of this problem in DHIS2. ### 2. Additional features #### Log dispensing - Every time the HSM (hospital store manager) dispenses a commodity, the application logs th commodity dispensed, the amount dispensed, the user who dispensed it, who it was dispensed to, which department it was dispensed to and the time and date it was dispensed. - This is done by using DataStore in DHIS2. We created a namespace for our application; `IN5320-G3` and have one document for each month. Each organisationUnit is a key-value in the document. This works well as a MVP and is not meant for more extensive use in production. The dataStore API is not async-safe and therefore data would be lost if two facilities use the endpoint at the same time. If this application were to be rolled out in production, they would have to create a new endpoint that can be used by several sources at the same time. - The log is useful because you can keep a history and document the dispensing. This was also done manually on paper before. Now they would save time because the log is generated automatically. #### Full offline functionality - Internet connectivity may vary in the hospitals where this application is used. Therefore, we have made this application 100% usable without internet. We think that this would make the application a lot more valuable for the HSM because they will not need to use paper as a supplement to this application when internet is down. This would remove double work and creates a seamless experience for the users. - Offline functionality is done by making the application a PWA. In this way, all required network requests are cached and are used if the network is not available. We store all outgoing network post-requests (dispense-mutations and logging) in local storage. When the network is available once again we send all these network requests. We also store the dispensed amounts of the different commodities to show the correct available amount to the user. If say we had 20 of one commodity when we were connected to the internet last, and then we dispensed 3 of that commodity, we show that it is 17 commodities left. - **We assume** that each hospital only runs one instance of this application at the same time. #### Look up nearby facilities - When the HSM are dealing with stockouts they may have to call the nearby hospitals to receive an amount of a commodity from another hospital. We want to help the managers so they can make a better decision on who to call. Therefor we have added functionality for looking up the stock balance of a commodity for close hospitals in the same district(organisationUnit parent). - This is implemented by receiving data from all the organisationUnits in a district. The district is the parent organisationUnit to the hospital, so we therefore use this district to get all its children, which are the hospitals. We show the nearby district data in our balance overview. #### Select facility - A HSM, we assume, can have access and work at several hospitals. Therefore, we want to let the user decide which of these he or she wants to select. Then we dynamically show the data for this selected hospital. - But for test purposes we have decided to only use the organization unit Wonda. This because the test user has too many organization-units that it would not be efficient for testing and developing purposes. Wonda is a district in Sierra Leone that has 4 organization units in that area. We assume that the test-user in our app has access to all these organization units, and can choose between them. - To make the application ready for production we would get the users organization units and find all the units the user works in. If this is more than one, the user should be able to select the unit he or she wants. ## Missing functionality The application is working just as it should and fulfills our MVP, but if we had time, we would like to add some extra functionality: * We would have liked to add a sorting function to the table in dispense logs, as it would have been practical to sort by either descending or ascending, person dispensed to, commodity or department. Another small issue in logging is that the time saved in the logs is retrieved from a local data function in the code, which results in sometimes being saved in 24-hour format, while other in 12-hour formats based on configuration in local operating system for each user. * Even though you can look up stock on commodities in nearby hospitals in the `Balance`-table, it would be interesting to do even more with this information, such as being able to order stock from nearby hospitals through the application. * While we feel like the UI is looking good and is functional now, we believe we could have done even more work to make it as user-friendly and clean looking as possible. The best way to do this would be to work closer with the end-user and see what is intuitive and what is not. * We would also make the DataStore-logging functionality async-safe. We could at least have done it safer and more efficient by having one document for each organization unit for each year. This would work assuming each hospital only uses one system each.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully