Skip to main content

SQLAlchemy models for the UKRDC

Project description

UKRDC-SQLA

SQLAlchemy models for the UKRDC and related databases.

Installation

pip install ukrdc-sqla

Example Usage

from datetime import datetime

from ukrdc_sqla.ukrdc import LabOrder, PatientNumber, PatientRecord, ResultItem

def commit_extra_resultitem(session):
    patient_record = PatientRecord(
        pid="PYTEST01:LABORDERS:00000000L",
        sendingfacility="PATIENT_RECORD_SENDING_FACILITY_1",
        sendingextract="PV",
        localpatientid="00000000L",
        ukrdcid="000000001",
        repository_update_date=datetime(2020, 3, 16),
        repository_creation_date=datetime(2020, 3, 16),
    )
    patient_number = PatientNumber(
        id=2,
        pid="PYTEST01:LABORDERS:00000000L",
        patientid="111111111",
        organization="NHS",
        numbertype="NI",
    )
    laborder = LabOrder(
        id="LABORDER_TEST2_1",
        pid="PYTEST01:LABORDERS:00000000L",
        external_id="EXTERNAL_ID_TEST2_1",
        order_category="ORDER_CATEGORY_TEST2_1",
        specimen_collected_time=datetime(2020, 3, 16),
    )
    resultitem = ResultItem(
        id="RESULTITEM_TEST2_1",
        order_id="LABORDER_TEST2_1",
        service_id_std="SERVICE_ID_STD_TEST2_1",
        service_id="SERVICE_ID_TEST2_1",
        service_id_description="SERVICE_ID_DESCRIPTION_TEST2_1",
        value="VALUE_TEST2_1",
        value_units="VALUE_UNITS_TEST2_1",
        observation_time=datetime(2020, 3, 16),
    )

    session.add(patient_record)
    session.add(patient_number)
    session.add(laborder)
    session.add(resultitem)

    session.commit()

Developer notes

Publish updates

  • Iterate the version number (poetry version major/minor/patch)
  • Push to GitHub repo
  • Create a GitHub release
    • GitHub Actions will automatically publish the release to PyPI

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

ukrdc_sqla-3.0.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

ukrdc_sqla-3.0.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file ukrdc_sqla-3.0.0.tar.gz.

File metadata

  • Download URL: ukrdc_sqla-3.0.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.9.25 Linux/6.11.0-1018-azure

File hashes

Hashes for ukrdc_sqla-3.0.0.tar.gz
Algorithm Hash digest
SHA256 f360f9ec0bc8eb912ce12843ac346626b19b9131aacd5cb6cd4bd647ac7513f5
MD5 c6df242a36a68019fb2ecf418b4a120e
BLAKE2b-256 beff6aa57effb1bc7090d1cfb3ffa08e269e7b9296280650d55781a2522edf2e

See more details on using hashes here.

File details

Details for the file ukrdc_sqla-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: ukrdc_sqla-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.9.25 Linux/6.11.0-1018-azure

File hashes

Hashes for ukrdc_sqla-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11217341ba075356de67cff60300da38223027f548157ab1b0155d1be258b24a
MD5 f2c950ef3012dcc67d51e57325957e7b
BLAKE2b-256 cfdcce9ee74e335db425ad2fe3a11e0a43761c63bb4bca75507ea053b43a27f9

See more details on using hashes here.

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