https://github.com/susannnnnna/cpp_patientdatabasecli
Simple CLI application with Google Tests (demo based on IEC 62304)
https://github.com/susannnnnna/cpp_patientdatabasecli
bdd ci-pipeline cli cmake cpp demo-iec-62304 gtest integration-testing powershell regression-testing req-iec-62304 system-testing tasks-json unit-testing vscode
Last synced: about 1 month ago
JSON representation
Simple CLI application with Google Tests (demo based on IEC 62304)
- Host: GitHub
- URL: https://github.com/susannnnnna/cpp_patientdatabasecli
- Owner: Susannnnnna
- Created: 2025-05-11T16:16:01.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-07-06T18:39:45.000Z (11 months ago)
- Last Synced: 2025-07-06T19:40:40.357Z (11 months ago)
- Topics: bdd, ci-pipeline, cli, cmake, cpp, demo-iec-62304, gtest, integration-testing, powershell, regression-testing, req-iec-62304, system-testing, tasks-json, unit-testing, vscode
- Language: C++
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Patient Database CLI
## ๐ฏ Objective
This repository contains a simulated **medical data management CLI application**.
The project includes a **traceability matrix** mapping requirements (REQ) to corresponding tests.
โ ๏ธ *Note: This is a **learning/demo project** created to simulate professional development workflows, including requirements management, traceability and structured testing (based on IEC 62304).*
## โ
Key Features
- Store patient data in a `.csv` file
- Add, view, edit, delete patient records via command line
- Includes unit, integration, system, and regression tests
- Behavior-Driven Development (BDD)
- CI pipeline using PowerShell and tasks in VS Code
## ๐ Project Structure
- `src/` โ main application source code
- `tests/` โ unit and integration tests
- `data/` โ stored `.csv` patient data
- `tests-report/` โ tests report result available in XML
- `ci-pipeline.ps1` โ CI build & run script
## ๐ Requirements (REQ)
The system is designed to meet the following requirements:
| **ID** | **Description** |
|-----------|------------------------------------------------------------------------------------------------------|
| **REQ-001** | The system must allow creation of `Patient` objects with correct field initialization. |
| **REQ-002** | The system must validate PESEL numbers according to Polish rules (11 digits and correct checksum). |
| **REQ-003** | The system must allow capturing patient data from user input (stdin). |
| **REQ-004** | The system must allow displaying a list of patients to the user (stdout). |
| **REQ-005** | The system must save patient data to a CSV file in the correct format. |
| **REQ-006** | The system must load patient data from a CSV file. |
| **REQ-007** | The system must allow deleting patient data by PESEL and update the CSV file. |
| **REQ-008** | The system must allow editing patient data and saving updates to the CSV file. |
| **REQ-009** | The system must offer a CLI menu with CRUD operations and exit functionality. |
## ๐งช Traceability Matrix
Each test in the project covers specific requirements:
| **Test Name** | **Covers Requirements** |
|-------------------------------------|--------------------------|
| `PatientTest` | REQ-001 |
| `ValidatorTest` | REQ-002 |
| `PatientInputCollectorTest` | REQ-003 |
| `PatientPrinterTest` | REQ-004 |
| `SavePatientDataToCsvFile` | REQ-005 |
| `ReadPatientDataFromCsvFile` | REQ-006 |
| `DeletePatientDataFromCsvFile` | REQ-007 |
| `EditPatientDataInCsvFile` | REQ-008 |
| `RunMenu` | REQ-009, REQ-003 |
| `CheckIfCsvFileCanBeRead` | REQ-006 |
## ๐งช Testing
Detailed structure and description: [`tests/README.md`](./tests/README.md)
## โถ๏ธ How to Run the App
### ๐ป Environment
- Tested on **Windows 11**
- Visual Studio Code + CMake toolchain
### ๐ ๏ธ Used Technologies
- C++
- CMake
- GoogleTest
- PowerShell (CI pipeline)
- JSON (only for vscode tasks)
### ๐๏ธ Data Handling
- Patient data stored in `.csv` file
- CLI-based interactions (add/view/edit/delete)
### ๐ Run the App
1. **Clone the repository:**
```bash
git clone https://github.com/Susannnnnna/Cpp_PatientDatabaseCLI
cd Cpp_PatientDatabaseCLI
```
2. Open in VS Code and install recommended extensions
- GitHub Pull Requests and Issues
- CMake Tools
- CMake
- PowerShell
3. Build and run
Press `Ctrl + Shift + B` in VS Code
Or use terminal:
```bash
mkdir build
cd build
cmake ..
cmake --build . --config Debug
```
4. Run main application
```bash
./src/Debug/PatientDatabaseCLIApp.exe
```
### ๐ Useful Links
- [DDD, Hexagonal, Onion, Clean, CQRS, โฆ How I put it all together](https://herbertograca.com/2017/11/16/explicit-architecture-01-ddd-hexagonal-onion-clean-cqrs-how-i-put-it-all-together/)
## License
[MIT license](https://opensource.org/licenses/MIT)