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.6.3.tar.gz
(15.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ukrdc_sqla-2.6.3.tar.gz.
File metadata
- Download URL: ukrdc_sqla-2.6.3.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.9.23 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0452a598ef8332120270bf55e18b1f198305f942895762508d075e9e4b34c121
|
|
| MD5 |
4ffd6dcbbe116be991de19b493de9ef7
|
|
| BLAKE2b-256 |
19cd60a0c6c38ec70c21132e162c5840dee99eb57e4cb780d89a32a9c416a627
|
File details
Details for the file ukrdc_sqla-2.6.3-py3-none-any.whl.
File metadata
- Download URL: ukrdc_sqla-2.6.3-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.9.23 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
435422d3b807a5b3e76cd8b5dd97b5ad8d3d2b86e508ae39a957f9fb2cf394e7
|
|
| MD5 |
bd70900fe4fda2c00b7571c32fd967b4
|
|
| BLAKE2b-256 |
e07237ab78728e7db16a8335f0d4323a9d1979afaa57aa9991812e8898ed0dd9
|