def parse_file(self, user, xml_format=None): xml_format = xml_format or self.xml_format imp = OpenTrialsXMLImport(creator=user) if xml_format == 'opentrials': return imp.parse_opentrials(self.tree) else: return imp.parse_ictrp(self.tree)
def import_file(self, parsed_trials, user): imp = OpenTrialsXMLImport(creator=user) imp._parsed_trials = parsed_trials return imp.import_parsed(if_exists=REPLACE_IF_EXISTS)