0.0.2 • Published 1 year ago

@medic/cht-stock-monitoring-workflow v0.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

@medic/cht-stock-monitoring-workflow

Tool to add stock monitoring workflows to an existing CHT application.

Installation

npm install @medic/cht-stock-monitoring-workflow

Features

Known issues

After adding an item, or any other action that update the existing forms, this form may be broken. To fix it, you need to try to repair manually by opening it with excel.

Initialization

cht-stock-monitoring-workflow init

Initialize the project and create a file with name stock-monitoring.config.json. This add by default the stock count form empty and update the cht app messages.

Question parameters

NameTypeDescriptionRequired
monitoring_type2_levels or 3_levelsStock monitoring type. 2 levels means monitoring between a supervisor (level 2) and a chw (level 1). 3 levels add a Health center levels feature like Stock ordertrue
levels[x]contact_typestringContact type of each level (c52_supervisor or c52_supervisor)true
useItemCategorybooleanWhether to categorize items or nottrue
stock_count.form_namestringID of the stock count form name (will be the form and properties file name alse)true
stock_count.contact_typesstringFor which contacts types to display the stock accounttrue
stock_count.typeaction or taskIf stock count form is an action of task.true
stock_count.frequencyend_of_week or middle_of_month or end_of_monthIf stock_count.type = task, display the task at the end of each week (end_of_week), middle of each month (middle_of_month) or end of each monthtrue, if stock_count.type = task
stock_count.title[lang]stringStock count form title in each cht app languagestrue

Results

  1. File stock-monitoring.config.json: It is the most important change in the projet. This can regenarate all the stock monitoring changes in the app
  2. Stock count form and properties file
  3. translations-[lang].properties updated with new strings

Note: Stock monitoring starts with a stock count. It means that without stock count report stock status won't be display on contact summary

Add item

cht-stock-monitoring-workflow add item

Add item in an existing form

Questions parameters

NameTypeDescriptionRequired
categoy.namestringThe item category name (It is possible to select an existing category)true
category.label[lang]stringThe category label in each app languagetrue
category.description[lang]stringThe category description in each app languagetrue
item.namestringThe item nametrue
item.label[lang]stringThe item label in each app languagetrue
item.unitstringThe item unittrue
item.warning_totalnumberItem total will be displayed in orange in total <= item.warning_total and total > item.danger_totaltrue
item.danger_totalnumberItem total will be displayed in red in total <= item.danger_totaltrue
item[form].deduced_typeby_user or custom_formularWhether user enter the quantity used (by_user) or it's calculated using the form values (custom_formular)true
item[form].formularstringIf deduced_type = by_user, it's the field relevant and field calculation if deduced_type = custom_formulartrue

Add features

cht-stock-monitoring-workflow add feature

Stock Logs

Create a stock form for level 3

Questions parameters

NameTypeDescriptionRequired
form_namestringThe stock logs form name/IDtrue
title[lang]stringThe stock logs form titletrue

Stock Supply

  1. Create a stock supply form for level 2
  2. Create a supply confirmation task for level 1 when level 2 submit a stock supply form
  3. If there is a difference between supplied quantity and received quantity a stock discrepancy resolution task will be create for level 2

Questions parameters

NameTypeDescriptionRequired
form_namestringThe stock supply form name/IDtrue
title[lang]stringThe stock supply form titletrue
confirm_supply.activeyes or noIf stock supply need confirmation. If not quantities will be deducted without confirmationtrue
confirm_supply.form_namestringThe confirmation form nametrue, if confirm_supply.active = 'yes'
confirm_supply.title[lang]stringThe confirmation form titletrue, if confirm_supply.active = 'yes'
discrepancy.form_namestringThe discrepancy resolution form nametrue, if confirm_supply.active = 'yes'
discrepancy.title[lang]stringThe discrepancy resolution form titletrue, if confirm_supply.active = 'yes'

Stock Return

  1. Create a stock return form for level 1
  2. Create a stock return confirmation task for level 2

Questions parameters

NameTypeDescriptionRequired
form_namestringThe stock return form name/IDtrue
title[lang]stringThe stock return form titletrue
confirmation.form_namestringThe confirmation form nametrue
confirmation.title[lang]stringThe confirmation form titletrue

Stock Order

  1. Create a stock order form for level 2
  2. Create a stock order supply task for level 3
  3. Follow the Stock Supply steps

Questions parameters

NameTypeDescriptionRequired
form_namestringThe stock order form name/IDtrue
title[lang]stringThe stock order form titletrue
stock_supply.form_namestringThe supply form nametrue
stock_supply.title[lang]stringThe supply form titletrue

Stock Out

Create a stock Out task for level 2 if level 1 has low stock

Questions parameters

NameTypeDescriptionRequired
form_namestringThe stock out form name/IDtrue
title[lang]stringThe stock order form titletrue
formularitem_danger_qty or weekly_qtyif weekly_qty, there is low stock if stock count < 2 * estimated weekly consumption. Else, there is low stock if stock count < item.danger_totaltrue