Skip to main content

MediCafe

Project description

MediCafe

MediCafe is a mixed local/cloud healthcare workflow automation repository. It combines legacy clinic-side workflows (MediBot, MediLink, and xp_client) with shared package utilities in MediCafe and a newer Gmail ingestion/orchestration path in cloud/orchestrator.

This repository intentionally supports more than one runtime model. It is not a single deployable app with one entrypoint.

Runtime Tracks

Track Primary code Python Primary use
Local / XP-compatible workflow MediCafe, MediBot, MediLink, xp_client 3.4.4-compatible package path Clinic-side claims, eligibility, deductible, reconciliation, download, and Medisoft-oriented automation
Cloud / orchestrator workflow cloud/orchestrator, tools, docs/runbooks 3.11+ repo-run path Gmail ingestion, queueing, preprocessor validation, alerting, setup, and runtime operations
Shared migration / validation tooling MediCafe, scripts/unified_model, sql, tests Mixed Shadow-pipeline, cloud-readiness, schema, validation, and reporting support

setup.py packages the local/XP-compatible path. The cloud orchestrator is maintained as repo-run code.

Primary Entry Points

Package CLI:

medicafe launcher
python -m MediCafe launcher

Current package commands exposed by MediCafe/__main__.py:

  • medicafe launcher
  • medicafe medibot [config_file]
  • medicafe medilink
  • medicafe claims_status
  • medicafe deductible
  • medicafe download_emails
  • medicafe cloud_daemon [config_file]
  • medicafe send_error_report
  • medicafe send_queued_error_reports
  • python -m MediCafe cleanup_local_artifacts
  • medicafe docx_index_rebuild
  • medicafe preflight
  • medicafe reconcile
  • medicafe version

medicafe deductible is kept as the advanced/compatibility checker. The normal operator path for the consolidated deductible form is inside MediLink Claims as Open deductible report (United, 90-day DOS).

Canonical cloud operator path:

py -3.11 cloud/orchestrator/validate_and_complete_setup.py

Repository Map

  • MediCafe/: shared package, CLI entrypoint, launcher, preflight, cloud-readiness helpers (including Layer 1 Readiness for operator system-health and run-evidence bundles; see MediCafe/layer1_readiness_model.py and AGENTS.md), API utilities, reconciliation, error reporting, and shared runtime helpers
  • MediBot/: Medisoft-oriented local preprocessing and data-entry support scripts
  • MediLink/: claims, eligibility, deductible, remittance, Gmail helper, and Apps Script-related assets
  • cloud/orchestrator/: Cloud Run service, auth/config/runtime helpers, preprocessor gate, watch/admin flows, setup scripts, and cloud tests
  • xp_client/: XP-side cloud queue consumer (medilink_cloud_daemon.py)
  • tests/: main regression suite for package/local workflows, API helpers, launcher behavior, preflight, cloud-readiness, and integration coverage
  • scripts/unified_model/: shadow-pipeline and unified relational validation tooling
  • sql/: SQL artifacts used by migration and validation work
  • docs/: maintained documentation surface
  • tools/: operator and build helpers that are outside the packaged runtime

The workspace root also contains operational inputs, artifacts, and generated state such as input/, TEST_CLAIMS/, ERA_TEST_DUMP/, reports_queue/, archive/, build/, dist/, .pytest_cache/, and tmp*. Do not treat those folders as the canonical source layout.

Local artifact cleanup:

python -m MediCafe cleanup_local_artifacts
python -m MediCafe cleanup_local_artifacts --apply --purge-queue

The cleanup command preserves README markers, defaults to dry-run, and skips queued ZIP bundles unless queue purge or queue-age retention is explicitly requested.

Automatic cleanup runs only from a development checkout (.git present) and only when MEDICAFE_LOCAL_ARTIFACT_AUTOCLEAN is not disabled. It is checked at python -m MediCafe ... startup and before support bundle creation. Defaults: at most once every 6 hours; apply cleanup when generated artifacts exceed 200 files, 250 MB, or 50 queued ZIPs. Ordinary generated artifacts and queued ZIP bundles are pruned immediately once a threshold is crossed. Set MEDICAFE_LOCAL_ARTIFACT_AUTOCLEAN_QUEUE_MAX_AGE_DAYS to a positive value only if a machine needs delayed queue retention.

Configuration

Primary local configuration files:

  • json/config.json
  • json/crosswalk.json
  • json/medisoftconfig.json

Cloud/orchestrator runtime settings are managed through cloud/orchestrator/config.py, environment variables, and the validator/setup flow.

Testing

Main test surfaces:

  • tests/
  • cloud/orchestrator/tests/

Canonical automated test entrypoint:

python3 -m pytest -v

Windows equivalent:

py -3.11 -m pytest -v

XP/Python 3.4.4 local test environments should use the pinned legacy pytest versions from requirements.txt (or pip install .[test]) before running pytest-driven files:

py -3.4 -m pip install -r requirements.txt
py -3.4 -m pytest -q tests/test_json_io.py

pytest.ini collects both test surfaces and excludes the current duplicate-name conflicts plus the known api_factory pytest-incompatible file. For focused runs:

python3 -m pytest -q tests/test_preflight.py
python3 -m pytest -q tests/test_config_loader_diagnostics.py
python3 -m pytest -q tests/test_error_reporter_configloader_degraded.py
python3 -m pytest -q tests/test_launcher_next_step_orchestration.py
python3 -m pytest -q tests/test_cloud_readiness_health.py
python3 -m pytest -q tests/test_cloud_readiness_artifacts.py::TestLayer1ReadinessModel tests/test_cloud_readiness_artifacts.py::TestLayer1ReadinessSurfacesAndContract tests/test_cloud_readiness_artifacts.py::TestSystemHealthPackWiring::test_send_latest_system_health_pack_extra_meta_merges_layer1_readiness_shallow_keys tests/test_cloud_readiness_artifacts.py::TestRunCentricArtifactTools::test_send_latest_run_evidence_bundle_extra_meta_merges_layer1_readiness_shallow_keys tests/test_cloud_readiness_recommendations.py
python3 -m pytest -q tests/test_bundle_build_telemetry.py
python3 -m pytest -q cloud/orchestrator/tests

See docs/TESTING_GUIDE.md for the current suite shape, default excludes, and standalone script-style harnesses that are not part of the canonical pytest run.

Documentation

Start here:

  • docs/README.md
  • docs/MEDICAFE_MASTER_GUIDE.md
  • docs/TESTING_GUIDE.md
  • docs/MEDICAFE_API_ARCHITECTURE.md
  • docs/MEDILINK_CLOUD_MIGRATION.md
  • docs/architecture/CSV_DOCX_DAT_JOIN_SCAFFOLDING_INVENTORY.md (shadow CSV/DOCX/DAT correlation, cloud readiness read path, orchestrator context)
  • cloud/orchestrator/README.md

Security and Repo Hygiene

  • Avoid PHI in logs, reports, and committed artifacts.
  • Use send_error_report and send_queued_error_reports for diagnostics instead of ad hoc data exports.
  • Treat tokens, certificates, raw client secrets, build outputs, and downloaded artifacts as operational state, not documentation or source of truth.

License

MIT License. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

medicafe-0.260603.2.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

medicafe-0.260603.2-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

File details

Details for the file medicafe-0.260603.2.tar.gz.

File metadata

  • Download URL: medicafe-0.260603.2.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for medicafe-0.260603.2.tar.gz
Algorithm Hash digest
SHA256 fef775953ffaadcf63948c6f90d358aa1796c8bab0babcae96f9a87b9a64a9d3
MD5 0600ffec4fd72f509d0679bdfb237a83
BLAKE2b-256 e25a6f27b5166ea68de5fed3d1c8c15c81d3cfdf3766bb4929266df4ef237bdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for medicafe-0.260603.2.tar.gz:

Publisher: release-pypi.yml on katanada2/MediCafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file medicafe-0.260603.2-py3-none-any.whl.

File metadata

  • Download URL: medicafe-0.260603.2-py3-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for medicafe-0.260603.2-py3-none-any.whl
Algorithm Hash digest
SHA256 70a57bbb53799de60e36b51fcd48225dd2bee52e7733cca7e7ccc6bb97fae7df
MD5 ca164ca19ed61e4d61ad94d16a7676c9
BLAKE2b-256 36e1cfe6451f2861773808668dfc59f03f01a10bea553e0d6a0162afc1e4cd95

See more details on using hashes here.

Provenance

The following attestation bundles were made for medicafe-0.260603.2-py3-none-any.whl:

Publisher: release-pypi.yml on katanada2/MediCafe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page