Skip to main content

Define, validate, and use schema-backed semantic conventions for OMOP CDM

Project description

omop_semantics

omop_semantics is a Python library for defining and managing semantic conventions on top of OMOP CDM.

It lets you describe conventions in code

  • which OMOP concepts you want to have on hand as named key concepts to improve ergonomics in analytic code,
  • how they are grouped,
  • what roles they play
  • and provide profiles to render these targets uniformly into CDM tables.

The goal is to make these conventions explicit, versioned, and reusable, instead of being buried in code, SQL, or documentation. They are also extensible so that you can add opinionated layers on top of default specifications that may be relevant in a domain-specific context only.


Current structure

The library has three user-facing surfaces:

  • Value-set runtime For stable named ids and ergonomic downstream access such as from omop_semantics.runtime.default_valuesets import runtime.

  • Template/profile runtime For working with semantic templates, compiled template views, and CDM row shapes via OmopSemanticEngine.

  • Fallback concepts For canonical "unknown", "not recorded", and default concepts via from omop_semantics.unknowns import UNKNOWN.

If you are starting new downstream code today:

  1. use runtime.default_valuesets when you need stable named concept ids,
  2. use OmopSemanticEngine when you need templates, profiles, or profile groups,
  3. use omop_semantics.unknowns when you need standard fallback concepts and their reason codes.

Key ideas

  • Human-authored
    Semantic rules and concept groups are written in YAML and validated with schemas.

  • Portable
    No database or graph store required.

  • Versionable
    Conventions can evolve over time and be tracked in git.

  • Integrates with pipelines
    Can drive ETL logic, validation, and documentation so they stay in sync.


Typical workflow

  1. Define a schema
    Describes what kinds of semantic objects and roles exist (e.g. staging, modifiers).

  2. Write YAML instances
    Lists actual OMOP concepts, profiles, and templates used in your project.

  3. Load the runtime surface you need
    Use value sets for named ids, or the semantic engine for template/profile work.

  4. Use it in code
    For validation, cohort logic, ETL constraints, or documentation.


When should you use this?

Use omop_semantics if you:

  • have project-specific rules about which OMOP concepts are valid,
  • need consistent concept groupings across ETL and analytics,
  • want semantic conventions to be explicit, testable, and versioned,
  • are working in domains like oncology where OMOP alone is too permissive.

Docs map

  • docs/usage.md Recommended loading paths for value sets, templates/profiles, fallback concepts, and lower-level helpers.

  • docs/data-model.md The conceptual distinction between profiles, profile groups, templates, and semantic objects.

  • docs/schema-and-instances.md Canonical authoring assets and how the shipped schema/instance files are organized.

  • docs/internals.md Repo structure, public runtime surfaces, and load-time behavior.

  • docs/unknowns.md Canonical fallback concepts and how to use their reason codes.

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

omop_semantics-0.2.1.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

omop_semantics-0.2.1-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

Details for the file omop_semantics-0.2.1.tar.gz.

File metadata

  • Download URL: omop_semantics-0.2.1.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for omop_semantics-0.2.1.tar.gz
Algorithm Hash digest
SHA256 64bf88c72755cde3ee18b52a36d555d63c4d96e1e4cdceea776d08419bf2567a
MD5 58f7fbf79727ed5e6703f960876f7559
BLAKE2b-256 7831a5232d95f85e09001e3a7f16be376cbc363b82969e15201cec1bb4f56f35

See more details on using hashes here.

Provenance

The following attestation bundles were made for omop_semantics-0.2.1.tar.gz:

Publisher: python-publish.yml on AustralianCancerDataNetwork/omop-semantics

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

File details

Details for the file omop_semantics-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: omop_semantics-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 49.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for omop_semantics-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 285a5aac26c9ff70949f6278f9ca888301f5acaeed04b69e62fd63f01cfdca22
MD5 6376025ca6f80b70242933c0d26cdd6f
BLAKE2b-256 632c98117c7237bc7cf8e2c9c100e2b31a85a532871fef72c92ee2efda91a1d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for omop_semantics-0.2.1-py3-none-any.whl:

Publisher: python-publish.yml on AustralianCancerDataNetwork/omop-semantics

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