886: Configure Adjusted Consumption (N)


Test Case #:886

Test Case Name: Configure Adjusted Consumption (N)

System: OpenLMIS

Subsystem: blue

Test case designed by: Paulina Borowa

Design Date:13.01.2017

Short description

Acceptance Criteria
Verify that:

  • in the APIs for configuring a requisition template, this new field can be added into the requisition template (by an admin with permissions to configure the template for their program)
  • if this field is NOT configured/associated to a requisition template, it does not appear on the requisition form
  • the field can be configured with a display order that controls where it appears on the requisition
  • in the APIs for initiating and saving a requisition, if this field is part of the template, then this field appears on the requisitions. Its display order should be based on the requisition template.
  • The field is a calculated field, read only.
  • value in the requsitions is calculated based on the calculation above (upholding the assumptions around F)
  • For this field to be added to the template, variables C and X are also required.
    • Data validation for C and X to be done during the admin template configuration.
  • Variable F is not required to be configured
  • If F isn't used in the template, zero is is used (meaning the second half of the formula is 0).
  • Display order is enforced on the requisition
  • Display order is set on the requisition template
  • UI: For any requisition with this field, the requisition form displays it in the proper display order.

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       

 

 

Step

Action

Expected system response

Comment

1

  Check if: 

  • The field is a calculated field, read only.
  • Display order is enforced on the requisition
  • Display order is set on the requisition template

  


                                                 

2

Check :

if this field is NOT configured/associated to a requisition template, it does not appear on the requisition form

API:

Method: PUT

In URL: http://test.openlmis.org/api/requisitionTemplates/5a268780-fafd-4243-9551-5c7daa824913?access_token=975189c1-429b-4cd9-bcdb-6df4f1780dcb&program=dce17f2e-af3e-40ad-8e00-3496adef44c3

{
  "id": "5a268780-fafd-4243-9551-5c7daa824913",
  "createdDate": [
    2016,
    6,
    14,
    12,
    0
  ],
  "programId": "dce17f2e-af3e-40ad-8e00-3496adef44c3",
  "numberOfPeriodsToAverage": 5,
  "columnsMap": {
    "adjustedConsumption": {
      "name": "adjustedConsumption",
      "label": "Adjusted Consumption",
      "indicator": "N",
      "displayOrder": 20,
      "isDisplayed": false,
      "source": "CALCULATED",
      "columnDefinition": {
        "id": "720dd95b-b765-4afb-b7f2-7b22261c32f3",
        "name": "adjustedConsumption",
        "sources": [
          "CALCULATED"
        ],
        "options": [],
        "label": "adjustedConsumption",
        "indicator": "N",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "numberOfNewPatientsAdded": {
      "name": "numberOfNewPatientsAdded",
      "label": "Number Of New Patients Added",
      "indicator": "F",
      "displayOrder": 18,
      "isDisplayed": true,
      "source": "USER_INPUT",
      "columnDefinition": {
        "id": "5708ebf9-9317-4420-85aa-71b2ae92643d",
        "name": "numberOfNewPatientsAdded",
        "sources": [
          "USER_INPUT"
        ],
        "options": [
          {
            "id": "34b8e763-71a0-41f1-86b4-1829963f0704",
            "optionName": "newPatientCount",
            "optionLabel": "New Patient Count"
          },
          {
            "id": "4957ebb4-297c-459e-a291-812e72286eff",
            "optionName": "dispensingUnitsForNewPatients",
            "optionLabel": "Dispensing units for new patients"
          }
        ],
        "label": "Number Of New Patients Added",
        "indicator": "F",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": {
        "id": "34b8e763-71a0-41f1-86b4-1829963f0704",
        "optionName": "newPatientCount",
        "optionLabel": "New Patient Count"
      }
    },
    "beginningBalance": {
      "name": "beginningBalance",
      "label": "Beginning Balance",
      "indicator": "A",
      "displayOrder": 4,
      "isDisplayed": true,
      "source": "USER_INPUT",
      "columnDefinition": {
        "id": "33b2d2e9-3167-46b0-95d4-1295be9afc22",
        "name": "beginningBalance",
        "sources": [
          "USER_INPUT"
        ],
        "options": [],
        "label": "Beginning Balance",
        "indicator": "A",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "dispensingUnit": {
      "name": "orderableProduct.dispensable.dispensingUnit",
      "label": "Unit/Unit of Issue",
      "indicator": "U",
      "displayOrder": 15,
      "isDisplayed": true,
      "source": "REFERENCE_DATA",
      "columnDefinition": {
        "id": "61e6d059-10ef-40c4-a6e3-fa7b9ad741ec",
        "name": "dispensingUnit",
        "sources": [
          "REFERENCE_DATA"
        ],
        "options": [],
        "label": "Unit/Unit of Issue",
        "indicator": "U",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "TEXT"
      },
      "option": null
    },
    "totalLossesAndAdjustments": {
      "name": "totalLossesAndAdjustments",
      "label": "Total Losses And Adjustments",
      "indicator": "D",
      "displayOrder": 7,
      "isDisplayed": true,
      "source": "USER_INPUT",
      "columnDefinition": {
        "id": "cd57f329-f549-4717-882e-ecbf98122c38",
        "name": "totalLossesAndAdjustments",
        "sources": [
          "USER_INPUT"
        ],
        "options": [],
        "label": "Total Losses And Adjustments",
        "indicator": "D",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "totalStockoutDays": {
      "name": "totalStockoutDays",
      "label": "Total Stockout Days",
      "indicator": "X",
      "displayOrder": 13,
      "isDisplayed": true,
      "source": "USER_INPUT",
      "columnDefinition": {
        "id": "750b9359-c097-4612-8328-d21671f88920",
        "name": "totalStockoutDays",
        "sources": [
          "USER_INPUT"
        ],
        "options": [],
        "label": "Total Stockout Days",
        "indicator": "X",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "packsToShip": {
      "name": "packsToShip",
      "label": "Packs To Ship",
      "indicator": "V",
      "displayOrder": 16,
      "isDisplayed": true,
      "source": "CALCULATED",
      "columnDefinition": {
        "id": "dc9dde56-593d-4929-81be-d1faec7025a8",
        "name": "packsToShip",
        "sources": [
          "CALCULATED"
        ],
        "options": [],
        "label": "Packs To Ship",
        "indicator": "V",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "productName": {
      "name": "orderableProduct.name",
      "label": "Product",
      "indicator": "N",
      "displayOrder": 3,
      "isDisplayed": true,
      "source": "REFERENCE_DATA",
      "columnDefinition": {
        "id": "e53e80de-fc63-4ecb-b6b2-ef376b34c926",
        "name": "productName",
        "sources": [
          "REFERENCE_DATA"
        ],
        "options": [],
        "label": "Product",
        "indicator": "N",
        "mandatory": false,
        "isDisplayRequired": true,
        "canChangeOrder": false,
        "canBeChangedByUser": false,
        "columnType": "TEXT"
      },
      "option": null
    },
    "approvedQuantity": {
      "name": "approvedQuantity",
      "label": "Approved Quantity",
      "indicator": "K",
      "displayOrder": 11,
      "isDisplayed": true,
      "source": "USER_INPUT",
      "columnDefinition": {
        "id": "a62a5fed-c0b6-4d49-8a96-c631da0d0113",
        "name": "approvedQuantity",
        "sources": [
          "USER_INPUT"
        ],
        "options": [],
        "label": "Approved Quantity",
        "indicator": "K",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "skipped": {
      "name": "skipped",
      "label": "Skip",
      "indicator": "S",
      "displayOrder": 1,
      "isDisplayed": true,
      "source": "USER_INPUT",
      "columnDefinition": {
        "id": "c6dffdee-3813-40d9-8737-f531d5adf420",
        "name": "skipped",
        "sources": [
          "USER_INPUT"
        ],
        "options": [],
        "label": "skipped",
        "indicator": "S",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": false,
        "canBeChangedByUser": false,
        "columnType": "BOOLEAN"
      },
      "option": null
    },
    "totalReceivedQuantity": {
      "name": "totalReceivedQuantity",
      "label": "Total Received Quantity",
      "indicator": "B",
      "displayOrder": 5,
      "isDisplayed": true,
      "source": "USER_INPUT",
      "columnDefinition": {
        "id": "5ba8b72d-277a-4da8-b10a-23f0cda23cb4",
        "name": "totalReceivedQuantity",
        "sources": [
          "USER_INPUT"
        ],
        "options": [],
        "label": "Total Received Quantity",
        "indicator": "B",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "total": {
      "name": "total",
      "label": "Total",
      "indicator": "Y",
      "displayOrder": 14,
      "isDisplayed": true,
      "source": "CALCULATED",
      "columnDefinition": {
        "id": "ef524868-9d0a-11e6-80f5-76304dec7eb7",
        "name": "total",
        "sources": [
          "CALCULATED"
        ],
        "options": [],
        "label": "Total",
        "indicator": "Y",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "productCode": {
      "name": "orderableProduct.productCode",
      "label": "Product Code",
      "indicator": "O",
      "displayOrder": 2,
      "isDisplayed": true,
      "source": "REFERENCE_DATA",
      "columnDefinition": {
        "id": "bde01507-3837-47b7-ae08-cec92c0c3cd2",
        "name": "productCode",
        "sources": [
          "REFERENCE_DATA"
        ],
        "options": [],
        "label": "Product Code",
        "indicator": "O",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": false,
        "canBeChangedByUser": false,
        "columnType": "TEXT"
      },
      "option": null
    },
    "totalConsumedQuantity": {
      "name": "totalConsumedQuantity",
      "label": "Total Consumed Quantity",
      "indicator": "C",
      "displayOrder": 6,
      "isDisplayed": true,
      "source": "USER_INPUT",
      "columnDefinition": {
        "id": "9e825396-269d-4873-baa4-89054e2722f4",
        "name": "totalConsumedQuantity",
        "sources": [
          "USER_INPUT",
          "CALCULATED"
        ],
        "options": [],
        "label": "Total Consumed Quantity",
        "indicator": "C",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "pricePerPack": {
      "name": "pricePerPack",
      "label": "Price Per Pack",
      "indicator": "T",
      "displayOrder": 17,
      "isDisplayed": true,
      "source": "REFERENCE_DATA",
      "columnDefinition": {
        "id": "df524868-9d0a-18e6-80f5-76304ded7ab9",
        "name": "pricePerPack",
        "sources": [
          "REFERENCE_DATA"
        ],
        "options": [],
        "label": "Price Per Pack",
        "indicator": "T",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "averageConsumption": {
      "name": "averageConsumption",
      "label": "Average Consumption",
      "indicator": "P",
      "displayOrder": 21,
      "isDisplayed": true,
      "source": "CALCULATED",
      "columnDefinition": {
        "id": "89113ec3-40e9-4d81-9516-b56adba7f8cd",
        "name": "averageConsumption",
        "sources": [
          "CALCULATED"
        ],
        "options": [],
        "label": "averageConsumption",
        "indicator": "P",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "requestedQuantity": {
      "name": "requestedQuantity",
      "label": "Requested Quantity",
      "indicator": "J",
      "displayOrder": 9,
      "isDisplayed": true,
      "source": "USER_INPUT",
      "columnDefinition": {
        "id": "4a2e9fd3-1127-4b68-9912-84a5c00f6999",
        "name": "requestedQuantity",
        "sources": [
          "USER_INPUT"
        ],
        "options": [],
        "label": "Requested Quantity",
        "indicator": "J",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "requestedQuantityExplanation": {
      "name": "requestedQuantityExplanation",
      "label": "Requested Quantity Explanation",
      "indicator": "W",
      "displayOrder": 10,
      "isDisplayed": true,
      "source": "USER_INPUT",
      "columnDefinition": {
        "id": "6b8d331b-a0dd-4a1f-aafb-40e6a72ab9f5",
        "name": "requestedQuantityExplanation",
        "sources": [
          "USER_INPUT"
        ],
        "options": [],
        "label": "Requested Quantity Explanation",
        "indicator": "W",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "TEXT"
      },
      "option": null
    },
    "stockOnHand": {
      "name": "stockOnHand",
      "label": "Stock On Hand",
      "indicator": "E",
      "displayOrder": 8,
      "isDisplayed": true,
      "source": "CALCULATED",
      "columnDefinition": {
        "id": "752cda76-0db5-4b6e-bb79-0f531ab78e2c",
        "name": "stockOnHand",
        "sources": [
          "USER_INPUT",
          "CALCULATED"
        ],
        "options": [],
        "label": "Stock On Hand",
        "indicator": "E",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "calculatedOrderQuantity": {
      "name": "calculatedOrderQuantity",
      "label": "Calculated Order Quantity",
      "indicator": "I",
      "displayOrder": 23,
      "isDisplayed": true,
      "source": "CALCULATED",
      "columnDefinition": {
        "id": "5528576b-b1e7-48d9-bf32-fd0eefefaa9a",
        "name": "calculatedOrderQuantity",
        "sources": [
          "CALCULATED"
        ],
        "options": [],
        "label": "calculatedOrderQuantity",
        "indicator": "I",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "remarks": {
      "name": "remarks",
      "label": "Remarks",
      "indicator": "L",
      "displayOrder": 12,
      "isDisplayed": true,
      "source": "USER_INPUT",
      "columnDefinition": {
        "id": "2ed8c74a-f424-4742-bd14-cfbe67b6e7be",
        "name": "remarks",
        "sources": [
          "USER_INPUT"
        ],
        "options": [],
        "label": "Remarks",
        "indicator": "L",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "TEXT"
      },
      "option": null
    },
    "totalCost": {
      "name": "totalCost",
      "label": "Total Cost",
      "indicator": "Q",
      "displayOrder": 19,
      "isDisplayed": true,
      "source": "CALCULATED",
      "columnDefinition": {
        "id": "e3a0c1fc-c2d5-11e6-af2d-3417eb83144e",
        "name": "pricePerPack",
        "sources": [
          "CALCULATED"
        ],
        "options": [],
        "label": "Total Cost",
        "indicator": "Q",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": null
    },
    "maximumStockQuantity": {
      "name": "maximumStockQuantity",
      "label": "Maximum Stock Quantity",
      "indicator": "H",
      "displayOrder": 22,
      "isDisplayed": true,
      "source": "CALCULATED",
      "columnDefinition": {
        "id": "913e1a4f-f3b0-40c6-a422-2f73608c6f3d",
        "name": "maximumStockQuantity",
        "sources": [
          "CALCULATED"
        ],
        "options": [
          {
            "id": "ff2b350c-37f2-4801-b21e-27ca12c12b3c",
            "optionName": "default",
            "optionLabel": "Default"
          }
        ],
        "label": "maximumStockQuantity",
        "indicator": "H",
        "mandatory": false,
        "isDisplayRequired": false,
        "canChangeOrder": true,
        "canBeChangedByUser": false,
        "columnType": "NUMERIC"
      },
      "option": {
        "id": "ff2b350c-37f2-4801-b21e-27ca12c12b3c",
        "optionName": "default",
        "optionLabel": "Default"
      }
    }
  }


UI:

Go to Administration → Configure → Configure R & R Template

→ select e.g Family Palninning

-> uncheck display check box for Adjustment Consumtion

→ inititate new requisition for that program

 

 

3

 Check:

  • the field can be configured with a display order that controls where it appears on the requisition

API:

change display order from 20 to 4

"displayOrder": 4,

UI:

Go to Administration → Configure → Configure R & R Template

→ select e.g Family Palninning

Change order for Adjustment Consumtion

→ inititate new requisition for that program


 

 

4

 The calculation has two parts: N = (adjusted consumption +quantity for new patients)

Adjusted Consumption is one of two options:

  1. Adjusted Consumption = RoundUp(C * (total days in the period / non-stockout days))
  2. Adjusted Consumption = C, if non-stockout days is zero (cannot divide by zero)

1 case: Adjusted Consumption = RoundUp(C * (total days in the period / non-stockout days))

2 case: Adjusted Consumption = C, if non-stockout days is zero (cannot divide by zero)

(C= consumed quantity in the period):

 

5

   

6

  

 

7

  

 

8

                                                 

 

OpenLMIS: the global initiative for powerful LMIS software