How yichenlu0719/cloudmedicine works
Project type and purpose
• This is a small, standalone automation tool (not a full-stack web app or microservice).
• From the README (“CloudMedicine 查詢雲端藥歷自動下載”) and file names, its sole purpose is to automatically query/download cloud-hosted medical records.
File structure
• Top-level files only:
• medicine.py – the main Python script
• chromedriver.exe / LICENSE.chromedriver – the Selenium WebDriver binary & license
• 錯誤紀錄.txt – error log output by the script
• README.md – project description
• No front-end or back-end folders, no database schema, no config directory.
Key architectural insights from the README
• It’s a command-line Python application using a headless or automated Chrome (via Selenium) to fetch records.
• It writes output to the local file system and logs errors.
Main components & their relationships
a. User / Operator
– Invokes medicine.py on the command line, possibly passing credentials or parameters.
b. Python Automation Script (medicine.py)
– Contains application logic for credentials, navigation, downloading.
c. ChromeDriver (chromedriver.exe)
– A bridge: Python’s Selenium library calls ChromeDriver, which drives a real (or headless) Chrome instance.
d. Remote Cloud Medicine Service (external web server)
– The target web interface/API that hosts user’s medical records.
e. Local File System
– Stores downloaded records (e.g., PDF or HTML)
– Appends errors to 錯誤紀錄.txt.
Architectural patterns & design principles
• Single-process, sequential automation script.
• Dependency inversion: medicine.py depends on a well-defined WebDriver interface rather than raw HTTP.
• External dependency isolation: ChromeDriver is kept in the repo alongside the script for portability.
Detail is key
• Even though it’s a small project, capture each piece:
• Python runtime
• Selenium library (optional annotation)
• ChromeDriver binary
• External website endpoints
• Output files & logs