-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add file, file_parameter and scanner SQLAlchemy models (#1207)
* add tables * rename file model * rename parameter_file
- Loading branch information
1 parent
9810e93
commit 7d87ea9
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from datetime import date | ||
from typing import Optional | ||
|
||
from sqlalchemy.orm import Mapped, mapped_column | ||
|
||
from lib.db.base import Base | ||
|
||
|
||
class DbFile(Base): | ||
__tablename__ = 'files' | ||
|
||
id : Mapped[int] = mapped_column('FileID', primary_key=True) | ||
session_id : Mapped[int] = mapped_column('SessionID') | ||
file_name : Mapped[str] = mapped_column('File') | ||
series_uid : Mapped[Optional[str]] = mapped_column('SeriesUID') | ||
echo_time : Mapped[Optional[float]] = mapped_column('EchoTime') | ||
phase_encoding_direction : Mapped[Optional[str]] = mapped_column('PhaseEncodingDirection') | ||
echo_number : Mapped[Optional[str]] = mapped_column('EchoNumber') | ||
coordinate_space : Mapped[Optional[str]] = mapped_column('CoordinateSpace') | ||
output_type : Mapped[str] = mapped_column('OutputType') | ||
acquisition_protocol_id : Mapped[Optional[int]] = mapped_column('AcquisitionProtocolID') | ||
file_type : Mapped[Optional[str]] = mapped_column('FileType') | ||
inserted_by_user_id : Mapped[str] = mapped_column('InsertedByUserID') | ||
insert_time : Mapped[int] = mapped_column('InsertTime') | ||
source_pipeline : Mapped[Optional[str]] = mapped_column('SourcePipeline') | ||
pipeline_date : Mapped[Optional[date]] = mapped_column('PipelineDate') | ||
source_file_id : Mapped[Optional[int]] = mapped_column('SourceFileID') | ||
process_protocol_id : Mapped[Optional[int]] = mapped_column('ProcessProtocolID') | ||
caveat : Mapped[Optional[bool]] = mapped_column('Caveat') | ||
dicom_archive_id : Mapped[Optional[int]] = mapped_column('TarchiveSource') | ||
hrrt_archive_id : Mapped[Optional[int]] = mapped_column('HrrtArchiveID') | ||
scanner_id : Mapped[Optional[int]] = mapped_column('ScannerID') | ||
acquisition_order_per_modality : Mapped[Optional[int]] = mapped_column('AcqOrderPerModality') | ||
acquisition_date : Mapped[Optional[date]] = mapped_column('AcquisitionDate') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from typing import Optional | ||
|
||
from sqlalchemy.orm import Mapped, mapped_column | ||
|
||
from lib.db.base import Base | ||
|
||
|
||
class DbMriScanner(Base): | ||
__tablename__ = 'mri_scanner' | ||
|
||
id : Mapped[int] = mapped_column('ID', primary_key=True) | ||
manufacturer : Mapped[Optional[str]] = mapped_column('Manufacturer') | ||
model : Mapped[Optional[str]] = mapped_column('Model') | ||
serial_number : Mapped[Optional[str]] = mapped_column('Serial_number') | ||
software_version : Mapped[Optional[str]] = mapped_column('Software') | ||
cand_id : Mapped[Optional[int]] = mapped_column('CandID') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from typing import Optional | ||
|
||
from sqlalchemy.orm import Mapped, mapped_column | ||
|
||
from lib.db.base import Base | ||
|
||
|
||
class DbParameterFile(Base): | ||
__tablename__ = 'parameter_file' | ||
|
||
id : Mapped[int] = mapped_column('ParameterFileID', primary_key=True) | ||
file_id : Mapped[int] = mapped_column('FileID') | ||
parameter_type_id : Mapped[int] = mapped_column('ParameterTypeID') | ||
value : Mapped[Optional[str]] = mapped_column('Value') | ||
insert_time : Mapped[int] = mapped_column('InsertTime') |