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.1.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.1-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ukrdc_sqla-3.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 1dec3ef4248a64b430b7dc5ac15375d00a36760ed9d15e04ef1597e8c6bb1db5
MD5 2a56466266eb96aec0dca2b395044839
BLAKE2b-256 69f42a397264c64ea302faebd1130a774d18c78420f1d74063db5a954bfa7417

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ukrdc_sqla-3.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f8c128a5b106479aba46cdfa6b29c44599bcc9c87e7fd0f7e70a2b34de01b19e
MD5 927737c67d8c620adfae6e394d3fa092
BLAKE2b-256 e39a4f034a2440851baf07b57c1cc909d55cf49d9a88677cf50400d462df88f0

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