Site Link: SRS Training App
- Introduction
- User Experience
- Technical Design
- Features
- Future Features
- Testing
- Bugs
- Deployment
- Credits
- Acknowledgements
Site Link: (https://srs-training-tracker.herokuapp.com/)
This application is developed to assist a manager in a busy clinical hospital environment, by tracking staff skill training, and allowing the user to query staff and skills as needed.
Stereotactic Radiosurgery (SRS) is a highly skilled discpline. in a busy Radiotherapy department it can be difficult to ensure enough staff are trained in the various sub-techniques (skills) of SRS, and to track who is trained in which area. Along with this difficulty there can be frequent challenges maintaining a suitable staff base to deliver treatment, particular due to factors such as covid, high staff turnover, and other unexpected staffing shortages, and a manager is often required to adjust staffing across various units at short notice.
This application is designed to record the training of staff members in each or any SRS skill they are trained in. This acts as a training record for each staff member. This is also a daily tool for the person managing the skill mix of the department - if there is a roster shortage the user can search the app for available staff members to see if their skills match the need for the day (with staff position displayed to aid in roster decision making), or search by staff member to see if an available staff member has the required skills. This can improve staffing decisions by providing the required information in an easy to access manner, and reduce stress as managers don't have to memorise what skill each staff member possesses (particularly in cases where the skill is not often applied clinically).
Managers and senior clinical staff responsible for staff training, and staff rostering, within the designated clinical area.
- Understand what the application is for
- so I can use it successfully
- Be given feedback if my input is successful
- so I know the application is working
- be given feedback if my input is incorrect
- so I know if I'm using the application correctly
- Search for staff by name
- so I don't have to remember staff ids
- Add a new staff member
- to track newly trained staff members
- Add skills for a staff member
- to update staff records for accuracy
- Search for a staff member to see what skills they have
- so I know if I can roster a staff member to treat a certain technique
- Search for a skill to see which staff have that skill
- so I can find staff to treat a certain technique
- see staff positions when presented with a list of staff who have a selected skill
- so I can consider skill mix when rostering staff
- Information storage to be spreadsheet based
- to allow for efficient data storage and retrieval
- User input to be validated
- so I know the data being collected is useful & relevant
- The user to be given feedback if their entry/search is successful
- so they know the application is working
- The user to be given feedback if their input is incorrect
- to help them input good data
- The user to be able to search for skills or staff
- to facilitate training monitoring and rostering decisions
- The user to understand how to navigate through the application at all times
- so they feel confident using the application
Designed at planning stage of application, the chart was used to guide the development process while building the application. The initial flowchart closely reflects the structure of the finished application.
Functional programming was used as the primary approach for development of this application. OOP could have be employed an an effective alternative to manage staff as a class. One global variable was used in the application - it is acknowledged that is not considered best practice, and would be refactored in a future version of this application.
Introduction: display logo, explain purpose of application, give menu option to enter application.
- User story 1
- User story 15
There are two main menus, allowing the user to select options to proceed, or return to main menu. Menu options and headings are displayed in blue for consistency and to highlight purpose to user.
- User story 15
User can enter a new staff member, adding first name, last name, and position (with prompts for position). User cannot enter a duplicate staff member.
- User story 5
- User story 6
- User story 4
User can search for an existing staff member, and when successfully found, can enter a new skill for that staff member. Staff members current skill status is displayed to user, along with a list of available skills to add. After skill entry user is prompted to enter another skill or return to main menu. User cannot enter duplicate skills for the staff member.
- User story 4
- User story 7
- User story 14
User can search for a staff member and see a list of their assigned skills. User given option to search for another staff member or update that staff member's skills.
- User story 8
- User story 9
- User story 14
User can search by skill. User is presented with a list of skill to choose from. Then presented with a list of staff assigned that skill. Staff position is displayed in this list as it can assist with decision making in rostering situations to ensure correct skill mix. User then given option to search for another skill or search by staff member. User cannot search for a skill that is not on the list.
- User story 3
- User story 11
- User story 13
- User story 15
Throughout the application the user is given warnings for incorrect entries such as entering numbers out of range, entering letters instead of numbers (and vice versa), failed searches (e.g. no staff found by name entered), entering duplicate information. Warnings are displayed in red to highlight to user. After each warning a new input is requested or a menu selection is provided.
- User story 2
- User story 11
- User story 12
- User story 15
User is given feedback through the application. Feedback is displayed in green for user experience. User is informed when information is successfully stored (with a short time delay added to give the impression the system is doing "work"). User entries are displayed to user at all times to check user is satisfied with their input before further action.
- User story 10
Google sheets showing data entry. Can be used for reference if testing the application (i.e. to find existing users or skills etc).
- Administrator log-in with password to restrict application use/misuse
- Ability to inactivate staff members (e.g. at end of service, maternity leave)
- 3-tier training status per skill (basic, advanced, expert)
- Ability to search by staff position
- Ability to view the date skill was entered (this data is currently available in the spreadsheets & ready for future implementation)
- Display staff and/or skills in order (numerical or alphabetical as relevant)
- Display all staff & skills in one table
- Expand for other sub-specialities, such as adding a module for tracking virtual simulation skills
- Improve visual layout of application with screen centering and background image
The code was regularly tested using the Code Institute PEP Validator substitute CI Python Linter. All tests passed with no warnings or errors.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Main Menu | Select 0 to exit | Exits program | Works as expected |
Main Menu | Select 1 to enter new staff member | Sends user to: Enter new staff member section | Works as expected |
Main Menu | Select 2 to update skills for a staff member | Sends user to: Find staff member section | Works as expected |
Main Menu | Select 3 to search records by skill or staff member | Sends user to: Search menu options section | Works as expected |
Main Menu | Select number other than 0-3 | Warning message to user: "Please choose number 0 -3 from the menu" | Works as expected |
Main Menu | Select non-number input e.g. 'g' | Warning message to user: "Please choose a number (only) from the menu" | Works as expected |
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
User input prompts | Enter first name, last name & position in successive input prompts | Validation of input occurs | Works as expected |
Input validation | Entry of a non-alpha character in any of above fields | Warning to user, specifying the first invalid entry Menu option to exit or try again | Works as expected |
Menu option to exit or try again | User selects 0 or 1 | Reloads user input prompts (first/last names, position) or returns to main menu | Works as expected |
Present user with inputted data | User prompted to confirm if entry correct or not | No = Menu option to try again or go to main menu Yes = success message, returns user to main menu | Works as expected |
Final validation | User inputs invalid number or invalid alpha characters to confirmation query | Warning to user Menu option to exit or try again | Works as expected |
Final validation | User inputs previously registered staff member | Warning to user re duplication, Menu option to exit or try again | Works as expected |
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
User input prompts | Enter first name, last name in successive input prompts | Validation of input occurs | Works as expected |
Input validation | User enters name (using alpha characters) for staff that is not registered | Warning to user (staff does not exist). Menu options: main menu, search menu, try again | Works as expected |
User enters number in first name field for staff | Warning to user, menu options try again or go to main menu | Bug found - see bug 1 | |
User enters number in last name field for staff | Warning to user, menu options try again or go to main menu | Works as expected | |
User enters existing staff name correctly | User skills are displayed, list of skills to add display, option to enter more skills presented | Works as expected | |
Enter skill | User enters skill number from list | Skill added, confirmation text shown, option to accept or reject (Y/N) | Works as expected |
User enters duplicate skill number from list | Warning to user, return to skill entry | Works as expected | |
User enters incorrect number or a letter | Warning to user, skills list re-presented, enter skill prompt | Works as expected | |
User selects No to confirm skill selected is not what intended | Skill list reloaded, input skill requested again | Works as expected | |
User selects Yes to add skill | Option to add further skill given | Works as expected | |
Option to enter further skill | User chooses from menu option to enter skill or not (Y/N) | Staff skills and skill list re-presented if Y, return to main menu if N | Works as expected |
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Menu options | User selects 1 for staff search, 2 for skill search, 0 for main menu | Selected menu loads | Works as expected |
Input validation | User selects a letter or invalid number | Warning message to user, menu reloads | Works as expected |
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
User input prompts | Enter first name, last name in successive input prompts | Validation of input occurs | Works as expected |
Input validation | User enters name (using alpha characters) for staff that is not registered | Warning to user (staff does not exist). Menu options: main menu, search menu, try again | Works as expected |
User enters number in first name field for staff | Warning to user, menu options try again or go to main menu | Bug found - see bug 1 | |
User enters number in last name field for staff | Warning to user, menu options try again or go to main menu | Works as expected | |
User enters existing staff name correctly | User skills are displayed, menu presented to search for another staff member, add skills to this staff member, return to main menu | Works as expected | |
Search staff again | User performs search for different staff member | Search works as previously | Works as expected |
User enters incorrect number or a letter | Warning to user, search menu re-presented | Works as expected | |
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Menu options | Skills list displayed, user prompted to enter skill number | List of staff with skill (and staff position) is displayed | Works as expected |
Input validation | User selects a letter or invalid number | Warning message to user, menu reloads | Works as expected |
Menu options | Search menu displayed, user prompted to go to staff or skill search or main menu | User directed to selected menu | Works as expected |
- When searching for existing staff member to update skills - if a user enters a number in the first name field (but not the last name field), then selects try again, the name input is re-presented to user. If user then enters a known existing user, the application returns warning to user that staff does not exist. if user then searches for same staff again the search is then successful.
- When updating skills for a user unwanted decoration is displayed at the top of the screen.
- When entering a second skill for a user the skills list (for selection reference) does not display.
- If there are no staff with a skill, no message is given to user (system returns to search menu).
- Early testing showed that user could not break out of loops when searching for staff name that could not be found, or unsuccessfully trying to add a new user (through entry error or searching for staff that did not exist). Loop breaker functions were added to give user option to continue trying or return to main menu in these cases.
- Validation checks for number entries (e.g. selecting 1-9 for a skill search) did not include a check for entry of '0'. Code was amended to include 0 e.g. changed from 'if int(skill_to_input) <= len(skills.get_all_values())' to 'if 0 < int(skill_to_input) <= len(skills.get_all_values())'.
- When user received a warning, the menu options presented (e.g. 'select 1 to try again, 0 to exit' ) controlled for user entering an invalid number, but not for a letter e.g. 'g' (which gave a value error). All loop breaker functions were amended to try/except/else blocks with value error raised in the exception clause to solve this.
- When user searched for a staff member, this worked correctly the first time, however if user searched for another staff member they were incorrectly given a warning and presented with menu options. To solve this the try/except blocks were changed in the get_id_breaker and find_staff_breaker functions to move the else clause (checking for number errors) into the try block, instead of placing this after the except clause.
- When searching for staff skills no message was given to the user if the staff member had no skills logged (i.e. nothing to display). To correct: added an empty key_dict to display_staff_skills(). If skill exists item added to key_dict, and if key dict false (empty) then warning printed to user re no skills.
This site can be forked using Github as follows (to make a copy in your own repo)
- Go to Fork button on the right-side ribbon menu (between Unwatch and Star)
- Click the button to make a copy automatically into your own respository
- Owner will default to your own github name
- Add a repository name and an optional
- Add a repository name and an optional description
- Select Create Fork button
This site can be cloned using Github as follows (to make a copy on your own machine):
- Enter the relevant Github repository
- Click the green Code from the menu (to the left of the green Gitpod button)
- Click the green Code button from the menu (to the left of the green Gitpod button)
- Copy the link under https (to copy using HTTPS)
- Open git bash on your own machine, and select the directory you want to save into
- Type 'git clone' then copy in your link The site github link is here:
- Ensure all input methods have a new line at the end of the text (due to software behaviour of the mock terminal)
- Create requirements.txt file so Heroku can load required dependancies
- in workspace terminal, type 'Pip3 freeze > requirements.txt' to automatically update the requirements.txt file
- push to GitHub
- In Heroku dashboard click Create New App button
- Give app a unique name
- Select region e.g. Europe
- Click Create App
- Go to Settings tab
- Add Config Vars:
- Click on Reveal Config Vars button
- Type CREDS in the KEY field
- Copy & paste the contents of the creds.json file from github workspace into the VALUE field
- Click *Add button
- In the next config var row, type PORT in the KEY field, and add 8000 to the VALUE field
- Add Buildpacks:
- Click Add Buildpack button
- Click Python in pop-up window and click Save changes
- Click Add Buildpack button again
- Click nodejs in pop-up window and click Save changes
- Ensure python buildpack is first in the list (click and drag to re-order if needed)
- Go to Deploy tab
- Click on Github icon
- Click on Connect to Github button
- In search field, search for repo name and click Search
- Click Connect button
- Scroll to bottom of page to select deployment method
- Click Deploy Branch to manually deploy, ensuring desired branch is selected
- Click Enable Automatic Deploys to enable automatic deployment based on every git push (ensuring desired branch is selected)
- Click View to go to deployed link
-
Guidance on the use of colorama was from pythonpool
-
Idea for truth value testing to solve 'Solved Bug #5' from flexiple
-
Working with lists and dictionaries was initally guided by finxter
-
List to dictionary conversions were informed by builtin
-
Code Institute Love Sandwiches walk-through - API set-up, scoping, creds
All written content was created by the site author based on professional knowledge. All code was written by the site author.
Languages
Libraries
- OS Gives functions for interacting with the operating system. Allows use of clear screen function (used to improve user experience to declutter screen).
- Sys Interacts with the runtime environment. Allows program exit function to run.
- Datetime For getting & manipulation dates & time. The date is added to the database when user adds a skill. The date display (attached to a skill & user) will be implemented in user display in future versions of the applicationn.
- Time Sleep was imported from Time to give a delay when sending information to worksheets, to enhance user experience (gives impression program is doing "work".)
- Gspread An API for google sheets, used to enable interaction between sheet and application.
- Colorama Used to enhance user experience & expectations by colouring warnings red, menus and important information in blue, and input sections in green.
- google-auth Enables service account between application and google service.
During the creation of this site I used the following technologies:
- Git Hub used for online programming, change tracking and storage respository for this project.
- Heroku cloud platform service to deploy, use & manage the application.
- Google Sheets used as online spreadsheet editor to store application data.
- Google Cloud Services used as public cloud service.
- Draw.io for flowchart creation during devlopment phase.
- ASCII art generator used to generate the welcome title.
- Tables Generator used to create tables in manual testing section for README.
Thanks to my mentor Maranatha Ilesanmi for his advice and support, and my fellow students on Slack for advice and colleagiality.