Commit 690f8872 authored by Mark Hymers's avatar Mark Hymers Committed by Joe Lyons
Browse files

Rename routines to allow both MRI/MEG handling


Signed-off-by: Mark Hymers's avatarMark Hymers <mark.hymers@hankel.co.uk>
parent cef935fe
......@@ -89,7 +89,7 @@ class IncomingProcessor(object):
# The final configured destination should be a catch-all
return DESTINATIONS[-1] # pragma: nocover
def __process_series(self, study, series):
def __process_mri_series(self, study, series):
patientid = study.SanitisedPatientID
origstudydesc = study.SanitisedStudyDescription.upper()
......@@ -179,7 +179,7 @@ class IncomingProcessor(object):
series.unlink_files()
study.remove_series(series)
def process_directory(self, ihandler):
def process_mri_directory(self, ihandler):
"""
Given an incoming handler, handle the directory
"""
......@@ -203,7 +203,7 @@ class IncomingProcessor(object):
# Make this a list so that we can safely modify it as we go
# in the called routines
for series in list(study.sorted_series()):
self.__process_series(study, series)
self.__process_mri_series(study, series)
# By this point, nothing should be left in the incoming directory
if self.remove_incoming_after:
......
......@@ -83,7 +83,7 @@ class TestCaseIncomingProcessor(BaseIncomingTest):
self.i = IncomingHandler(self.idir)
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
......@@ -102,7 +102,7 @@ class TestCaseIncomingProcessor(BaseIncomingTest):
self.iproc = IncomingProcessor(self.dests, self.error, self.tmpout)
self.i = IncomingHandler(self.idir)
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
# Check that the incoming directory is removed
......@@ -118,7 +118,7 @@ class TestCaseIncomingProcessor(BaseIncomingTest):
self.iproc = IncomingProcessor(self.dests, self.error, self.tmpout)
self.i = IncomingHandler(self.idir)
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
# Check that the incoming directory is removed
......@@ -138,7 +138,7 @@ class TestCaseIncomingProcessor(BaseIncomingTest):
self.iproc = IncomingProcessor(self.dests, self.error, self.tmpout)
self.i = IncomingHandler(self.idir)
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
# Check that the incoming directory is removed
......@@ -167,7 +167,7 @@ class TestCaseIncomingProcessorForceDestination(BaseIncomingTest):
self.i = IncomingHandler(self.idir)
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
......@@ -200,7 +200,7 @@ class TestCaseIncomingProcessorModifyStudyName(BaseIncomingTest):
# Use the ynic_fixup_studydesc routine to test the postproc
self.iproc.study_description_postproc = ynic_fixup_studydesc
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
......@@ -234,7 +234,7 @@ class TestCaseIncomingProcessorDTI(BaseIncomingTest):
self.i = IncomingHandler(self.idir)
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
......@@ -269,7 +269,7 @@ class TestCaseIncomingProcessorStudySubDescription(BaseIncomingTest):
# Use the ynic_fixup_studydesc routine to test the postproc
self.iproc.study_description_postproc = ynic_fixup_studydesc
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
......@@ -301,7 +301,7 @@ class TestCaseIncomingProcessorRawNotAnon(BaseIncomingTest):
# Use the ynic_fixup_studydesc routine to test the postproc
self.iproc.study_description_postproc = ynic_fixup_studydesc
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
......@@ -342,7 +342,7 @@ class TestCaseIncomingErrorProcessor(BaseIncomingTest):
self.iproc = IncomingProcessor(self.dests, self.error, self.tmpout)
self.i = IncomingHandler(self.idir)
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
# Check that the incoming directory is removed
......@@ -390,7 +390,7 @@ class TestCaseIncomingAlreadyExistingProcessor(BaseIncomingTest):
self.iproc = IncomingProcessor(self.dests, self.error, self.tmpout)
self.i = IncomingHandler(self.idir)
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
# Check that the incoming directory is removed
......@@ -409,7 +409,7 @@ class TestCaseIncomingAlreadyExistingProcessor(BaseIncomingTest):
symlink(join(TEST_BASEDIR, 'siemens/12/MR.X.1.2.276.0.7230010.3.1.4.2836010529.1187.1490799878.150091'),
join(self.idir, 'testextrafile'))
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
# Check that the incoming directory is removed
......@@ -426,7 +426,7 @@ class TestCaseIncomingAlreadyExistingProcessor(BaseIncomingTest):
# Need to create the dir after we create the handler
makedirs(join(self.idir, 'testemptydir'))
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
# Check that the incoming directory is removed
......@@ -464,7 +464,7 @@ class TestCaseIncomingProcessorPhysioData(BaseIncomingTest):
# Use the ynic_fixup_studydesc routine to test the postproc
self.iproc.study_description_postproc = ynic_fixup_studydesc
self.iproc.process_directory(self.i)
self.iproc.process_mri_directory(self.i)
self.check_files()
......
......@@ -42,7 +42,7 @@ def process_incoming_directory(incomingdir):
i = IncomingHandler(incomingdir)
# and process it
iproc.process_directory(i)
iproc.process_mri_directory(i)
# Finally remove the .complete and .queued file
try:
......
......@@ -57,4 +57,4 @@ iproc.study_description_postproc = ynic_fixup_studydesc
# Load our incoming controller
i = IncomingHandler(args.incomingdir)
iproc.process_directory(i)
iproc.process_mri_directory(i)
......@@ -100,7 +100,7 @@ with TemporaryDirectory() as tmpdir:
series.OverrideSeriesDescription(args.series_description)
# Now process the directory
iproc.process_directory(i)
iproc.process_mri_directory(i)
# If it worked, remove the tarball
if not args.keep_tarball:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment