Skip to content

Commit 3acbc14

Browse files
committed
Publications report for the EDRN Quarterly Report
1 parent 466e092 commit 3acbc14

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# encoding: utf-8
2+
3+
'''🧬 EDRN Site: Publications Report.
4+
5+
To support reporting of numbers of publications for the EDRN quarterly report.
6+
'''
7+
8+
from django.core.management.base import BaseCommand
9+
from eke.knowledge.models import Publication
10+
11+
12+
class Command(BaseCommand):
13+
'''The EDRN Jackie's report command.'''
14+
15+
help = 'Report on the numbers of publications'
16+
17+
def handle(self, *args, **options):
18+
'''Handle the EDRN `edrn_publications_report` command.'''
19+
dmcc_pubs = Publication.objects.filter(
20+
subject_uris__identifier__startswith='http://edrn.nci.nih.gov/data/pubs/'
21+
)
22+
grant_pubs = Publication.objects.filter(
23+
subject_uris__identifier__startswith='urn:edrn:knowledge:publication:via-grants:'
24+
)
25+
26+
on_page = dmcc_pubs.filter(year__isnull=False).union(grant_pubs.filter(year__isnull=False)).count()
27+
self.stdout.write(f'Reported on Publications page: {on_page}')
28+
self.stdout.write('The number on the publications page includes only those from the DMCC and the grant numbers and omits publications without year-of-publication information and omits those from the BMDB.')
29+
self.stdout.write()
30+
31+
without_year = dmcc_pubs.union().count()
32+
self.stdout.write(f'Including publications without a year (and not from BMDB): {without_year}')
33+
self.stdout.write()
34+
35+
total = Publication.objects.count()
36+
self.stdout.write(f'All publications, including those from BMDB: {total}')

0 commit comments

Comments
 (0)