Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PACS Series API #551

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 11 additions & 21 deletions chris_backend/collectionjson/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-06-10 19:48
from __future__ import unicode_literals
# Generated by Django 4.2.5 on 2024-04-10 04:24

from django.db import migrations, models
import django.db.models.deletion
Expand All @@ -15,41 +13,33 @@ class Migration(migrations.Migration):

operations = [
migrations.CreateModel(
name='Dummy',
name='Idiot',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name='Idiot',
name='Moron',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name='Moron',
name='Simple',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name='Simple',
name='Dummy',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('idiots', models.ManyToManyField(to='collectionjson.idiot')),
('moron', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='collectionjson.moron')),
],
),
migrations.AddField(
model_name='dummy',
name='idiots',
field=models.ManyToManyField(to='collectionjson.Idiot'),
),
migrations.AddField(
model_name='dummy',
name='moron',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='collectionjson.Moron'),
),
]

This file was deleted.

2 changes: 0 additions & 2 deletions chris_backend/config/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@
'plugins',
'plugininstances',
'pipelines',
'pipelineinstances',
'userfiles',
'pacsfiles',
'servicefiles',
'filebrowser',
'users',
'workflows'
Expand Down
6 changes: 3 additions & 3 deletions chris_backend/config/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
}
}

for app in ['collectionjson', 'core', 'feeds', 'plugins', 'plugininstances', 'pipelines',
'pipelineinstances', 'userfiles', 'pacsfiles', 'servicefiles', 'users',
'filebrowser', 'workflows']:
for app in ['collectionjson', 'core', 'feeds', 'plugins', 'plugininstances',
'pipelines', 'userfiles', 'pacsfiles', 'users', 'filebrowser',
'workflows']:
LOGGING['loggers'][app] = {
'level': 'DEBUG',
'handlers': ['console_verbose', 'file'],
Expand Down
68 changes: 24 additions & 44 deletions chris_backend/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
from plugins import views as plugin_views
from plugininstances import views as plugininstance_views
from pipelines import views as pipeline_views
from pipelineinstances import views as pipelineinstance_views
from workflows import views as workflow_views
from userfiles import views as userfile_views
from pacsfiles import views as pacsfile_views
from servicefiles import views as servicefile_views
from filebrowser import views as filebrowser_views
from users import views as user_views

Expand Down Expand Up @@ -274,27 +272,6 @@
name='unextpathparameter-detail'),


path('v1/pipelines/<int:pk>/instances/',
pipelineinstance_views.PipelineInstanceList.as_view(),
name='pipelineinstance-list'),

path('v1/pipelines/instances/',
pipelineinstance_views.AllPipelineInstanceList.as_view(),
name='allpipelineinstance-list'),

path('v1/pipelines/instances/search/',
pipelineinstance_views.AllPipelineInstanceListQuerySearch.as_view(),
name='allpipelineinstance-list-query-search'),

path('v1/pipelines/instances/<int:pk>/',
pipelineinstance_views.PipelineInstanceDetail.as_view(),
name='pipelineinstance-detail'),

path('v1/pipelines/instances/<int:pk>/plugininstances/',
pipelineinstance_views.PipelineInstancePluginInstanceList.as_view(),
name='pipelineinstance-plugininstance-list'),


path('v1/pipelines/<int:pk>/workflows/',
workflow_views.WorkflowList.as_view(),
name='workflow-list'),
Expand Down Expand Up @@ -333,40 +310,35 @@
name='userfile-resource'),


path('v1/pacsfiles/',
path('v1/pacs/series/',
pacsfile_views.PACSSeriesList.as_view(),
name='pacsseries-list'),

path('v1/pacs/series/search/',
pacsfile_views.PACSSeriesListQuerySearch.as_view(),
name='pacsseries-list-query-search'),

path('v1/pacs/series/<int:pk>/',
pacsfile_views.PACSSeriesDetail.as_view(),
name='pacsseries-detail'),

path('v1/pacs/files/',
pacsfile_views.PACSFileList.as_view(),
name='pacsfile-list'),

path('v1/pacsfiles/search/',
path('v1/pacs/files/search/',
pacsfile_views.PACSFileListQuerySearch.as_view(),
name='pacsfile-list-query-search'),

path('v1/pacsfiles/<int:pk>/',
path('v1/pacs/files/<int:pk>/',
pacsfile_views.PACSFileDetail.as_view(),
name='pacsfile-detail'),

re_path(r'^v1/pacsfiles/(?P<pk>[0-9]+)/.*$',
re_path(r'^v1/pacs/files/(?P<pk>[0-9]+)/.*$',
pacsfile_views.PACSFileResource.as_view(),
name='pacsfile-resource'),


path('v1/servicefiles/',
servicefile_views.ServiceFileList.as_view(),
name='servicefile-list'),

path('v1/servicefiles/search/',
servicefile_views.ServiceFileListQuerySearch.as_view(),
name='servicefile-list-query-search'),

path('v1/servicefiles/<int:pk>/',
servicefile_views.ServiceFileDetail.as_view(),
name='servicefile-detail'),

re_path(r'^v1/servicefiles/(?P<pk>[0-9]+)/.*$',
servicefile_views.ServiceFileResource.as_view(),
name='servicefile-resource'),


path('v1/filebrowser/',
filebrowser_views.FileBrowserFolderList.as_view(),
name='chrisfolder-list'),
Expand All @@ -391,6 +363,14 @@
filebrowser_views.FileBrowserFolderLinkFileList.as_view(),
name='chrisfolder-linkfile-list'),

path('v1/filebrowser/files/<int:pk>/',
filebrowser_views.FileBrowserFileDetail.as_view(),
name='chrisfile-detail'),

re_path(r'^v1/filebrowser/files/(?P<pk>[0-9]+)/.*$',
filebrowser_views.FileBrowserFileResource.as_view(),
name='chrisfile-resource'),

path('v1/filebrowser/linkfiles/<int:pk>/',
filebrowser_views.FileBrowserLinkFileDetail.as_view(),
name='chrislinkfile-detail'),
Expand Down
57 changes: 55 additions & 2 deletions chris_backend/core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Generated by Django 2.2.12 on 2020-09-22 21:53
# Generated by Django 4.2.5 on 2024-04-10 04:24

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


Expand All @@ -9,21 +11,72 @@ class Migration(migrations.Migration):
initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='ChrisFolder',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('creation_date', models.DateTimeField(auto_now_add=True)),
('path', models.CharField(max_length=1024, unique=True)),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='core.chrisfolder')),
],
options={
'ordering': ('-path',),
},
),
migrations.CreateModel(
name='ChrisInstance',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('creation_date', models.DateTimeField(auto_now_add=True)),
('name', models.CharField(default='ChRIS instance', max_length=100)),
('uuid', models.UUIDField(default=uuid.uuid4)),
('job_id_prefix', models.CharField(blank=True, default='chris-jid-', max_length=100)),
('description', models.CharField(blank=True, max_length=600)),
],
options={
'verbose_name': 'ChRIS instance',
'verbose_name_plural': 'ChRIS instance',
},
),
migrations.CreateModel(
name='FileDownloadToken',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('creation_date', models.DateTimeField(auto_now_add=True)),
('token', models.CharField(db_index=True, max_length=300)),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ('owner', 'creation_date'),
},
),
migrations.CreateModel(
name='ChrisLinkFile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('creation_date', models.DateTimeField(auto_now_add=True)),
('path', models.CharField(db_index=True, max_length=1024)),
('fname', models.FileField(max_length=1024, unique=True, upload_to='')),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('parent_folder', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chris_link_files', to='core.chrisfolder')),
],
),
migrations.CreateModel(
name='ChrisFile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('creation_date', models.DateTimeField(auto_now_add=True)),
('fname', models.FileField(max_length=1024, unique=True, upload_to='')),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('parent_folder', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chris_files', to='core.chrisfolder')),
],
options={
'ordering': ('-fname',),
},
),
]
18 changes: 0 additions & 18 deletions chris_backend/core/migrations/0002_chrisinstance_job_id_prefix.py

This file was deleted.

18 changes: 0 additions & 18 deletions chris_backend/core/migrations/0003_alter_chrisinstance_id.py

This file was deleted.

42 changes: 0 additions & 42 deletions chris_backend/core/migrations/0004_chrisfolder_chrislinkfile.py

This file was deleted.

Loading
Loading