Sources
Most applications should construct
ICD10KnowledgeBase
instead of instantiating a provider directly. Providers are public extension
points for applications that need a custom material source.
cms_icd.sources.MaterialProvider
Abstract provider of local paths for individual ICD materials.
paths
abstractmethod
cms_icd.sources.CMSProvider
CMSProvider(release: Release, *, service_date: date | None = None, cache_dir: str | Path | None = None, fallback: str | None = None, offline: bool = False, session: Session | None = None)
Lazily resolve and cache materials from official CMS catalog pages.
Exact revisions represent snapshots: each material resolves to the latest artifact effective on or before the requested revision. The requested date must itself be a revision advertised by CMS unless an explicit fallback is enabled.
Source code in src/cms_icd/sources.py
cms_icd.sources.DirectoryProvider
DirectoryProvider(directory: str | Path, release: Release)
Discover CMS-format files in an existing directory.
Source code in src/cms_icd/sources.py
cms_icd.sources.CatalogEntry
dataclass
CatalogEntry(system: str, material: str, fiscal_year: int, release_date: date, label: str, url: str, page_url: str)
One downloadable material advertised by CMS.
cms_icd.sources.fiscal_year_for
Return the CMS fiscal year containing a date.
Examples:
Source code in src/cms_icd/sources.py
cms_icd.sources.refresh_cms_catalog
Fetch and atomically replace the cached CMS material catalog.
Normal online constructors reuse a valid cached catalog indefinitely. Call this function when newly advertised CMS releases should become discoverable.