Implement patient vital signs monitoring system with Contec CMS7000PLUS integration and real-time dashboard
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import json
|
||||
import os
|
||||
from pydantic_settings import BaseSettings
|
||||
|
||||
class Settings(BaseSettings):
|
||||
hl7_host: str = "0.0.0.0"
|
||||
hl7_port: int = 6060
|
||||
contec_ports: list = [511, 515, 516, 517, 518, 519, 520]
|
||||
monitor_ip: str = ""
|
||||
monitor_model: str = "CMS7000PLUS"
|
||||
target_api_url: str = "https://api.example.com/vitals"
|
||||
api_token: str = ""
|
||||
retry_interval_seconds: int = 60
|
||||
log_file: str = "hl7_forwarder.log"
|
||||
database_url: str = "sqlite:///./hl7_forwarder.db"
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
|
||||
def get_settings() -> Settings:
|
||||
config_file = "config.json"
|
||||
if os.path.exists(config_file):
|
||||
with open(config_file, "r") as f:
|
||||
try:
|
||||
data = json.load(f)
|
||||
return Settings(**data)
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
return Settings()
|
||||
|
||||
settings = get_settings()
|
||||
Reference in New Issue
Block a user