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
Release history Release notifications | RSS feed
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-2.5.1.tar.gz
(13.9 kB
view details)
Built Distribution
File details
Details for the file ukrdc_sqla-2.5.1.tar.gz
.
File metadata
- Download URL: ukrdc_sqla-2.5.1.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Linux/6.5.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa2ff7ff9e754bec4958daeac57136f119b4666a352a9f4f2844924c180fb419 |
|
MD5 | a690ab5e61d1066aef7ec696fce11bdd |
|
BLAKE2b-256 | 36c61a488c2051fe8655f24cbff9ee88f15ba2a980b1530f04fdc5b76ca5be6f |
File details
Details for the file ukrdc_sqla-2.5.1-py3-none-any.whl
.
File metadata
- Download URL: ukrdc_sqla-2.5.1-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Linux/6.5.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 360eb07b27f810fa0a3502194c918c932b371964c8b246ab3b0a009a14eff414 |
|
MD5 | ecbd943569a3f3df3d876162b7c609bd |
|
BLAKE2b-256 | 9470a6192e353468251f3b0864a144617accee3a7710f09d095bb5c542a4ca2c |