Skip to content

Design DataElement model and resolve naming collision #61

@matthewhorridge

Description

@matthewhorridge

Problem

DataElement in src/harmonization_framework/element.py is a placeholder with only type annotations and no initialization, validation, or serialization. There is also a different DataElement ORM model in api/models.py, creating a naming collision.

Questions

  • Should the core library use a dedicated, serializable DataElement model (e.g., dataclass/pydantic)?
  • Should it reuse or mirror the API ORM model?
  • What should be the stable identifier for DataElement (id/label/URI)?
  • How do we align with the RADx Data Dictionary Spec for Data Elements?

Proposal

Define a real DataElement model with:

  • explicit fields (id, label, type, enumerations)
  • __eq__/__hash__ based on a stable id
  • to_dict/from_dict for rule serialization

Also rename one of the DataElement classes or namespace it clearly to avoid confusion.

Files

  • src/harmonization_framework/element.py
  • src/harmonization_framework/api/models.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions