Configure Average Consumption

Description

As an implementer, I want the option to include the "Average Consumption" (P) attribute on the requisition forms so that the user (storeroom and program manger) can see and understand what the typical or average consumption for that commodity is while he/she is making a request for more products.

Note: if the periods within a schedule are monthly, this calculation will serve as Average Monthly Consumption (AMC)

New Feature: implement the option for an implementer user to define the number of periods to average. This is a new option and part of the P attribute.

Acceptance Criteria
Verify that:

  • an implementer (who is an authorized API user) can configure this field to appear in the Requisition template for their program

  • an implementer (who is an authorized API user) can configure it with a field label string

  • P is available to be associated with a requisition template by program

  • can be assigned a display order in the requisition form

  • average consumption is based on a period moving-average window of adjusted consumption (N) from most recent period(s)

    • (N t0 + N t-1 + N t-2 + N t-(n-1)) / ( n )

  • user defines "n" (to indicate how many periods will be averaged)

  • "n" cannot be 1 or 0, must be greater than or equal to 2

  • "n" must have a value if (P) is selected to be displayed/included in the template

  • n = number of periods

  • t = indicates relative period (t0 = current reporting period)

For data entry, if not enough periods exist, compute based on the following:

  • if no previous periods, and there is only t0 ; use P = N (instead of the formula above)

  • if one previous period, so t0 and t-1 ; use P = Roundup( (N t0 + N t-1) / 2)

  • if more than one previous period, just compute the average of what periods are available (even if less than the defined "n")

If

Then

no data exists for a specific product lineitem in previous periods, and there is only t0 (the current requisition is being filled out)

use P = N (instead of the formula above)

there is only data for one previous period for a specific product lineitem, so data is available for t0 and t-1

use P = Roundup( (N t0 + N t-1) / 2)

more than one previous period exits but fewer than "n"

compute the average of what periods are available and Roundup

Variable

Indicator

Associated Table

Remarks

Adjusted consumption for a reporting period

N

RequisitionLineItems table

saved for prior periods in the RequisitionLineItems table—t subscript indicates relative period

Attachments

13
  • 26 Jan 2017, 09:24 AM
  • 24 Jan 2017, 02:08 PM
  • 24 Jan 2017, 02:07 PM
  • 24 Jan 2017, 02:07 PM
  • 24 Jan 2017, 02:07 PM
  • 24 Jan 2017, 02:06 PM
  • 24 Jan 2017, 01:41 PM
  • 24 Jan 2017, 01:41 PM
  • 24 Jan 2017, 12:02 PM
  • 24 Jan 2017, 07:02 AM
  • 23 Jan 2017, 04:14 PM
  • 23 Jan 2017, 04:14 PM
100% Done
Loading...

QAlity Plus - Test Management

Checklists

Activity

Lucyna LaskaJanuary 26, 2017 at 11:44 AM

Okay, so now everything looks to be fine.

Summary:
1. Average Consumption is round up on UI and API.
2. Average Consumption is calculated properly (based on "n" value in requisition Template. When emergency requisition from previous period is created, the value of Adjusted Consumption is not taken into account; when there is no previous period -> P=N; when more than 1 period, average is calculated based on what periods are available)
3. Column "Average Consumption" can be reorder or not displayed.
4. Requisition Template cannot be saved when "n" field is empty or n =0 or n=1.

More details in test case: https://openlmis.atlassian.net/wiki/x/C16dBg

Paweł AlbeckiJanuary 26, 2017 at 9:27 AM

it's ok. Display can be false. is displayed != in template.

Lucyna LaskaJanuary 26, 2017 at 9:24 AM

I am aware of that. When source is set to CALCULATED, I can set isDisplayed to FALSE.

Paweł AlbeckiJanuary 26, 2017 at 9:16 AM

I don't think it's possible (Average Consumption requires Adjusted Consumption, C and X are required by Adjusted Consumption). Please give me repro steps.

Lucyna LaskaJanuary 26, 2017 at 8:36 AM

demo data is fixed properly, roundUp has been added too.

Anyhow, in subtask OLMIS-1526, one of the AC is described as: "For this field to be added to the template, variables C and X are also required." So, when I want to add Average Consumption column to the requisition Template, TCQ and Total Stockout Days should be also added (I understand this that way). Now, I can add Average Consumption column without adding the TCQ to the Requisition Template (on UI and API). What do you think?

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Original estimate

Time tracking

3w 2d 2h logged5h remaining

Components

Sprint

Fix versions

Priority

Time Assistant

Created August 10, 2016 at 11:02 PM
Updated January 31, 2017 at 2:30 PM
Resolved January 26, 2017 at 11:45 AM