Test: Dispensary - msupply-foundation/open-msupply GitHub Wiki
Patients
Creating a New Patient
- Navigate to
Dispensary -> Patients
and clickNew Patient
to create a new patient in your system. - A new window will pop up, allowing you to enter basic information
-
First Name
andLast Name
are compulsory - ensure the form cannot be saved unless those details are entered. The rest of the fields are optional. - The second step is search results: if there is already a patient in the system with similar/same details, they will be shown and available for selection.
- If the matching patient is found and belongs to the home store (logged-in store), you will see a Home icon
- If the matching patient is found and belongs to another store, you will see a Download icon
- If you choose to download a patient, it'll download/fetch patient details from the server
- In no matching patients are found, click
Ok & Next
to add a new patient to your store - Fill out the mandatory fields (Code, First Name and Last Name), afterwards
Create
button will be enabled and you will be able to save the patient.Add Program
,History
&Print buttons
are disabled at this stage.
Detailed Patient View
- When clicking into a specific patient, you will see a page where you can see further details and also edit existing ones. Currently, there are 5 tabs you will be able to edit:
Details, Programs, Encounters, Contact Tracing and Vaccination Cards
.
Details
- All of the fields are editable, and the
Generate
button next to the code is enabled. If you enterAge
instead ofDate of Birth
, the field defaults to the first day of first month of the year before (e.g. if the age is 25, the D.O.B. will be defaulted to 01/01/1999).
Programs
- If you have Programs enabled in your store, you will be able to enrol patients into a program. The Add Program at the top right corner should be enabled. Click the button -> a list of available programs will pop up in a new window. If you don't see any programs available, they might not be configured for your store in mSupply -> please follow this guide on how to get one setup.
- Once the program is chosen, you will see a screen where you can enter the rest of the enrolment details.
Enrolment Date
andEnrolment ID
fields should be editable. - Click on a
+
sign next to Patient Status History to enter new information.Status
andDatetime
fields are compulsory, and Comment is an optional field. Click on a-
sign to remote the entry. - Click on a
+
sign next to Patient Notes to enter a new note. Click on a-
sign to remove the note. - Once all the information is entered, you will see the program enrolment details under the tab.
Encounters
- Encounters are connected to Programs, so at the moment only the enrolled patients in a store with enabled programs can have an Encounter. To add an
Encounter
, switch over to the tab and click the button in the right top corner. - A new window pops up, where in the dropdown menu you need to select a program against which you want to record an Encounter. Once selected, you are able to populate
Visit Date
,Clinician
andNotes
fields. Only theVisit Date
field is compulsory. - Once entered and Saved, you are able to see the encounter under the tab. You are able to click on it and add some extra details and continue testing, however this will be covered in the
Encounters
testing suite.
Contact Tracing
- You are able to add
Contact Tracing
to track possible exposure of a patient. You will need to have an additional setup:hiv_index_partner_testing.json
andhiv_index_partner_testing_ui_schema.json
. Contact tracing needs to be linked to the same Master List as you are using to test Programs and Encounters, and the patient needs to be enrolled into that program. - Click the
Add Contact
button on the top right corner of the screen to add a new one. In theType of Contact
dropdown field, select your Program. This will bring you to a new window, designed for HIV Contact Tracing. - You will see 4 sections in front of you -
Index Client Information, Family/Partner Information, Tracking Outcome
andPost PNS IPV Screening
. Click on each one and ensure all the fields are clickable, editable and work as expected. - Once a contact has been added to mSupply, they can then be linked to patient who came into contact with them. Click
Link to Patient
to search up a patient -> you can then search up that patient by theirID, First Name or Last Name
. ClickUnlink Patient
to choose another one or undo the action all together. - When you navigate back to
Dispensary -> Patient -> the patient
you were testing on just now, then under theContact Tracing
tab you will be able to see the changes. Ensure all the details match the ones you entered, e.g. contact's gender, relationship, age etc.
Vaccination Cards
- You are able to see a read-only view of a patient's vaccination status. Click on the tab and then on the program you want to see vaccination status of. A new window will pop up, showing a read-only view. Ensure the status and the rest of the details match the details for the same patient/program under encounters. Any changes you make to the vaccination details should be shown on this screen.
Patient List
- Make sure sorting works on each column, it should be either ascending or descending.
- Make sure the Filtering works, e.g. try and search by First Name, Last Name, Program Enrolments etc. Use multiple filters, make sure the filter fields are aligned nicely even when selecting multiple ones.
Prescriptions
Create a new prescription:
- Go to dispensary, 'Prescriptions' and click ‘+ New Prescription’ to create a new prescription. Input form for Prescription will show
- Enter the Name of the Patient and the Prescriber to use
- Add a prescription line. Click the (+) New line. Choose some items(with price and input Quantity and Directions. Click Ok & next - to add the next one.
- Ensure FEFO (first to expire ie the first to go out) is being used to select which batch should be allocated.
- Input a second item, then try to delete it. The item should be erased from the form
- Click on 'More' on the right and add a comment.
- Change the colour of the prescription and it should be saved.
- Delete any item line by selecting it + clicking on 'Actions' >delete selected lines. The lines selected should be erased.
- Delete the whole prescription. The record should be erased.
- As soon as you add at least 1 item the status should change to 'picked', instead of 'New'. You can edit the prescription.
- Click on 'Confirm as Verified'. The status should change to 'Verified' and you cannot edit the prescription.
- You will see a field next to Patient and Clinician, which says Date -> this is functionality to backdate prescriptions. Add one or more items to the prescription -> at this point we are going to start playing around with the field and making sure the changes are reflected in the Ledger.
- When clicked on the field, you should be able to choose the date in the past, but not in the future. Choose the date and click
Ok
-> you just backdated the prescription. - To make QA easier, find an item which has a few stock movements on different dates. Here is a hypothetical product to make scenarios easier:
Backdating prescriptions:
Pfizer Vaccine
Date | Movement | Balance |
---|---|---|
26.05.2025 | +500 | 500 |
26.05.2025 | +100 | 600 |
27.05.2025 | +225 | 825 |
27.05.2025 | +300 | 1125 |
27.05.2025 | +145 | 1270 |
27.05.2025 | +45 | 1315 |
27.05.2025 | -145 | 1170 |
27.05.2025 | -5 | 1165 |
29.05.2025 | -34 | 1131 |
30.05.2025 | -20 | 1111 |
30.05.2025 | -135 | 976 |
- Ordering before 26.05.2025 should not be allowed as the stock was not in the system 🚫
- Ordering more than 976 at any given point of time should not be allowed - you only have 976 units in stock now, and if you try to backdate for more than 976, it should give an error as it should account for future transactions 🚫
- Backdating prescriptions manipulates stock in the system at the end of the day - meaning any changes to stock movement will be noted down as 23:59PM in the system. E.g. if your backdated prescription is for last Monday, it will be 23:59PM of that Monday.
- At any given point of time, the system is looking for the lowest number and helps you figure out how much you can dispense. For example, if you were to dispense a backdated prescription on 26th of May, the system will be looking at the in-between of these two transactions:
Date | Movement | Balance |
---|---|---|
26.05.2025 | +100 | 600 |
27.05.2025 | +225 | 825 |
Therefore you should be able to dispense 600 ✅
- If you are looking at dispensing on 28th of May, you will be looking at the in-between of these two:
Date | Movement | Balance |
---|---|---|
27.05.2025 | -5 | 1165 |
29.05.2025 | -34 | 1131 |
But because you only have 976 units in stock now, you should be able to dispense 976 units ✅
Make sure to test not only recently created prescriptions (e.g. if you create one on the day you are testing), but also repeat the actions for prescriptions that have been created previously and have been in the system for a few days/weeks.
- Should not be able to edit a finalised prescription
Ledger
- Prescription is New/Picked: creating a Prescription and adding an item to it will be reflected in the Ledger as
Type: Prescription
- Prescription is Verified: stays the same as above - reflected in the Ledger as
Type: Prescription
Encounters
Adding an Encounter
- To add an encounter, navigate to
Dispensary -> Patients
and select a patient you would like to add an encounter for - At the moment,
Encounters
are related toPrograms
, so to add an Encounter, your patient needs to be enrolled into any programs configured for your store. - If the patient is not enrolled, the button to add an encounter should be disabled and the
Encounters
tab should be blank. - A window will appear, allowing you to add basic information about the encounter - the dropdown fields should be clickable, allowing you to choose an encounter and a clinician. Visit date is a compulsory field, and notes are optional. Once entered, click
Save
. - This will create a new entry under
Encounters
tab. Click on a newly created entry to edit further details.
Detailed View
- In a more detailed view, you can edit more fields and see the Vaccination course as well as set the Encounter type. Working from the top of the page, you are able to edit the
Visit Date, Clinician, Status, Start and End times
. Patient's Names, Program and Date of Birth are uneditable. - In the top right corner, you will see different statuses of the Encounter
-
Encounter Scheduled
: Status = Pending and the time of the encounter is in the past -
Encounter Missed: Status
= Pending and the time of the encounter is in the past
-
- You are able to delete an Encounter, and by clicking
More
you can see extra details. - If you update
Visit Date
, make sure it is updated in the side menu too. UnderPrevious Encounters
, you are able to view patient's previous visits. Create a new one or delete a previous one and make sure it is reflected in the side menu.
Vaccinations
- You should see a Vaccine course in front of you, with different doses that need to be administered to the patient.
- Click on any of them to see the detailed view and fill out the rest of the information.
- Under Facility, you can choose either the store you logged into or you can choose
Other
. If Other selected, you will see a message 'Stock Transactions are not recorded for vaccinations given in other facilities'. - You are able to select Clinician and choose a Date. If Vaccine is given, you are able to select Vaccine item, Batch and leave a comment. If Vaccine is not given, you are able to leave a reason and a comment.
- You then should see the details updated on the main screen - make sure the information showing is the one you entered eg. the status is correct, the facility showing is correct, etc.
- If you allocate a vaccine, the stock for it should go down - make sure to check the stock level and the item's Ledger.
- You can create new vaccinations for an "other" facility. In this case, if you select
Given
, you cannot select a batch - You can also create for a date in the past. In this case, if you select
Given
, you are asked whether or not to create a stock transaction. If you leave the toggle OFF, no prescription is created when you press save. - You can edit existing vaccinations
- You will be asked if you want to update/revert existing transactions
-
Given -> Not Given
(if you toggle ON revert transaction) should create customer return -
Given (but changing batch)
should create customer return for old batch and new prescription -
Not Given -> Given
should create prescription - If you leave the toggle off, no invoices should be created!
-
- You will be asked if you want to update/revert existing transactions
- Suggested date in the card should match the LATTER of
- Last dose date + min interval (defined one the vaccine course dose)
- The date at which the patient reaches the min age (defined on the vaccine course dose)