Skip to content

Commit

Permalink
Add status field to PACS operations' filters and serializers
Browse files Browse the repository at this point in the history
  • Loading branch information
jbernal0019 committed Dec 13, 2024
1 parent 05847e4 commit eca2c9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions chris_backend/pacsfiles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ class PACSQueryFilter(FilterSet):
class Meta:
model = PACSQuery
fields = ['id', 'min_creation_date', 'max_creation_date', 'title_exact',
'title', 'description', 'pacs_id', 'pacs_identifier', 'owner_username']
'title', 'status', 'description', 'pacs_id', 'pacs_identifier',
'owner_username']


PACS_RETRIEVE_STATUS_CHOICES = PACS_QUERY_STATUS_CHOICES
Expand Down Expand Up @@ -161,7 +162,8 @@ class PACSRetrieveFilter(FilterSet):

class Meta:
model = PACSRetrieve
fields = ['id', 'min_creation_date', 'max_creation_date', 'owner_username']
fields = ['id', 'min_creation_date', 'max_creation_date', 'status',
'owner_username']


class PACSSeries(models.Model):
Expand Down
4 changes: 3 additions & 1 deletion chris_backend/pacsfiles/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,15 @@ class PACSRetrieveSerializer(serializers.HyperlinkedModelSerializer):
pacs_identifier = serializers.ReadOnlyField(source='pacs_query.pacs.identifier')
owner_username = serializers.ReadOnlyField(source='owner.username')
result = serializers.ReadOnlyField()
status = serializers.ReadOnlyField()
pacs_query = serializers.HyperlinkedRelatedField(view_name='pacsquery-detail',
read_only=True)

class Meta:
model = PACSRetrieve
fields = ('url', 'id', 'creation_date', 'pacs_query_id', 'pacs_query_title',
'query', 'pacs_identifier', 'owner_username', 'result', 'pacs_query')
'query', 'pacs_identifier', 'status', 'owner_username', 'result',
'pacs_query')


class PACSSeriesSerializer(serializers.HyperlinkedModelSerializer):
Expand Down

0 comments on commit eca2c9c

Please sign in to comment.