Automates the creation of Borang RO for quarantined patients of Malaysia
- Internet connection (only during first setup)
- Python >= 3.6 (make sure to add
pythontoPATH; Check out Setup section) openpyxl~=3.0.7module (check out Setup section)docxtpl~=3.0.7module (check out Setup section)
This setup only covers Windows. Linux and MacOS setup steps will be added in future updates. Other OSes are not covered, but the setup is generally the same on other OSes.
- Open command prompt, type
python --version, and pressENTER. If your output isPython <version>and the version is >= 3.6, proceed to step 6.
- Download Python from the official website.
- Run the downloaded
exefile, selectAdd Python <version> to PATH. If you do not have admin privileges (i.e. using laptops provided by the CAC), uncheckInstall launcher for all users (recommended). Then, proceed with the installation by clickingInstall Now.
- You may want to disable PATH limit for future use of
python. Not needed if you are not usingpythonfor anything else. If you do not have admin privileges, skip this step.
- Click
close. Repeat step1again. You should see the outputPython <version>. If it still says'python' is not recognized as an internal or external command, operable program or batch file, you may need to restart your computer. - If you have
gitinstalled, simply clone this repository to your computer by using the commandgit clone https://github.com/FROST8ytes/Borang-RO-Generator.git. Else, on the GitHub page, click onCode > Download ZIP. Then, extract the ZIP archive. - Proceed to the unzipped folder/cloned repository, and copy the path to the folder/repo (i.e.
C:\Users\user\Downloads\Borang-RO-Generator). - Open command prompt, type
cd <path to folder/repo>(i.e.cd https://github.com/FROST8ytes/Borang-RO-Generator) and pressENTER. - Type
pip install -r requirements.txtand pressENTER. This step will install all the required modules to rungenerate_borang_ro.py.
Will be written in future updates.
Will be written in future updates.
This section covers the use and format requirements to use the script.
| A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|
| BIL | NAMA | NO KAD PENGENALAN/PASPORT | UMUR | NO TELEFON | ALAMAT | TARIKH HSO | TARIKH RO |
Requirements:
- patient's name in column
B - patient's MyKad/Passport in column
C - patient's phone number in column
E - patient's address in column
F - patient's HSO date in column
G - patient's RO date in column 'H'
Future updates will include the flexibility of the column locations for patient's field.
- Open
generate_borang_ro.pywith Notepad, VIM, or others. - Only change the
MODIFIABLE GLOBAL VARIABLESsection with proper info;template_file_with_path: the name of the docx template (borang RO)excel_filename: the name of the xlsx file to generate fromsheets_to_read: list of sheets to read from inexcel_filenamequarantine_days_required: number of days required for patient to be quarantined before generating an RO form for themdoctors_name: doctor's name (pegawai yang diberi kuasa)doctors_position: doctor's position (jawatan pegawai)doctors_appointed_place: CAC nameappointed_place_phone_number: CAC's phone numbertime: time shown in the RO form before the signature field
- Make sure that the
template_file_with_pathfile is in the same folder asgenerate_borang_ro.pyfile if the path is not explicitly written. - Make sure that the
excel_filename_with_pathfile is in the same folder asgenerate_borang_ro.pyfile if the path is not explicitly written.
2 ways of running the program:
- command prompt:
python generate_borang_ro.py - double-click on the file
generate_borang_ro.py- if you are on Linux/MacOS, make sure that the file is executable by running the command
chmod +x generate_borang_ro.py.
- if you are on Linux/MacOS, make sure that the file is executable by running the command
The forms are generated into folders named based on which sheet they are from.
Author: Ammar Farhan Mohamad Rizam



