Example #1
0
 def projectSubjectSummary(self):
     match = re.match(r"^/?projects/([^/]+)/subjects/([^/]+)/?$",
                      self.command)
     subject = Navigate.normalizeSingleSubjectToUUID(
         self.nidm_files, match.group(2))
     self.restLog("Returning info about subject {}".format(match.group(2)),
                  2)
     return self.subjectSummaryFormat(
         Query.GetParticipantDetails(self.nidm_files, match.group(1),
                                     subject))
Example #2
0
 def derivativesList(self):
     result = []
     match = re.match(r"^/?projects/([^/]+)/subjects/([^/]+)", self.command)
     self.restLog(
         "Returning derivatives in subject {}".format(match.group(2)), 2)
     subject = Navigate.normalizeSingleSubjectToUUID(
         self.nidm_files, match.group(2))
     derivatives = Query.GetDerivativesDataForSubject(
         self.nidm_files, match.group(1), subject)
     for s in derivatives:
         result.append(s)
     return self.format(result)
Example #3
0
 def instrumentSummary(self):
     match = re.match(
         r"^/?projects/([^/]+)/subjects/([^/]+)/instruments/([^/]+)$",
         self.command)
     self.restLog(
         "Returning instrument {} in subject {}".format(
             match.group(3), match.group(2)), 2)
     subject = Navigate.normalizeSingleSubjectToUUID(
         self.nidm_files, match.group(2))
     instruments = Query.GetParticipantInstrumentData(
         self.nidm_files, match.group(1), subject)
     return self.format(instruments[match.group(3)],
                        headers=["Category", "Value"])
Example #4
0
 def instrumentsList(self):
     result = []
     match = re.match(
         r"^/?projects/([^/]+)/subjects/([^/]+)/instruments/?$",
         self.command)
     self.restLog(
         "Returning instruments in subject {}".format(match.group(2)), 2)
     subject = Navigate.normalizeSingleSubjectToUUID(
         self.nidm_files, match.group(2))
     instruments = Query.GetParticipantInstrumentData(
         self.nidm_files, match.group(1), subject)
     for i in instruments:
         result.append(i)
     return self.format(result)
Example #5
0
    def derivativeSummary(self):
        match = re.match(
            r"^/?projects/([^/]+)/subjects/([^/]+)/derivatives/([^/]+)",
            self.command)
        subject = Navigate.normalizeSingleSubjectToUUID(
            self.nidm_files, match.group(2))
        uri = match.group(3)
        self.restLog(
            "Returning stat {} in subject {}".format(uri, match.group(2)), 2)
        derivatives = Query.GetDerivativesDataForSubject(
            self.nidm_files, match.group(1), subject)

        single_derivative = {uri: derivatives[uri]}

        self.restLog("Formatting single derivative", 5)

        return self.formatDerivatives(single_derivative)