crawler package

Submodules

crawler.app module

crawler.app.acc()[source]
crawler.app.batch()[source]
crawler.app.debug()[source]
crawler.app.execute()[source]
crawler.app.main()[source]
crawler.app.search()[source]
crawler.app.to_date(date_as_int)[source]
crawler.app.upload()[source]

crawler.command module

crawler.command.accs_per_day(configuration, day)[source]

Query for all studyinstanceuids for a given day.

crawler.command.add_day(query, day)[source]

Adds the StudyDate and SeriesDate to the query.

crawler.command.add_day_range(query, from_day, to_day)[source]

Limit by a day range

crawler.command.add_modality(query, modality)[source]

Adds the modality to the query.

crawler.command.add_study_description(query, study_description)[source]

Search only for specific study descriptions

crawler.command.add_study_uid(query, study_uid)[source]

Limit by Accession Number with StudyInstanceUID

crawler.command.add_time(query, time)[source]

Adds the Series time to the query.

crawler.command.basic_query(configuration)[source]

Returns a basic findscu command with no query parameters set.

crawler.command.study_uid_query(configuration, accession_number)[source]

It is not possible to query by accession number therefore we need to first fetch the studyinstanceuid.

crawler.command.year_start_end(year)[source]

crawler.config module

crawler.config.get_report_show_url(file='config.ini')[source]

Reads the configuration from the config.ini file :param file: config file name (optional, default=’config.ini’) :return: str: report settings

crawler.config.get_solr_upload_url(file='config.ini')[source]

Reads the configuration from the config.ini file :param file: config file name (optional, default=’config.ini’) :return: str: solr settings

crawler.config.pacs_settings(config)[source]

Reads the configuration from the default flask instance folder :param PACS configuration :return: str: PACS settings

crawler.convert module

This file contains the locic associated with the tasks in the file ‘ris_pacs_merge_upload.py’

crawler.convert.add_child(parent, entry)[source]

add child entry

crawler.convert.convert_pacs_file(json_in)[source]

Convert: pacs_date.json -> pacs_convert_date.json The converted file contains only one entry per accession number structured into one parent and one child for each series

crawler.convert.merge_pacs_ris(pacs)[source]

Insert ris report into converted pacs json file

crawler.dicom module

A simple regex based parser for DICOM (DCMTK output to be more precise).

crawler.dicom.get_results(strings: List[str]) → List[Dict[str, str]][source]

Get list of results found. A single result is a dictionary where the keys are the DICOM tags and the value is the DICOM value. :param strings: list of strings :return: list of results (result is a dictionary)

crawler.executor module

crawler.executor.run(query: str) → Tuple[List[Dict[str, str]], int][source]

Executes a findscu query and parses the result :param query: findscu query :return: a tuple where the first value is a list of DICOM tags and values and second value is result size

crawler.query module

crawler.query.get_months_of_year(year: str) → List[Dict[str, str]][source]
crawler.query.query_accession_number(config, study_uid)[source]
crawler.query.query_day(config, day: str) → List[Dict[str, str]][source]
crawler.query.query_day_accs(config, day) → List[Dict[str, str]][source]
crawler.query.query_day_extended(config, mod: str, day: datetime.datetime, time_range: str) → List[Dict[str, str]][source]
crawler.query.query_for_study_uid(config, accession_number)[source]

There could be different study_uids for a single accession number. An example would be GRASP sequences.

crawler.query.query_month(config, year_month: str) → List[Dict[str, str]][source]
crawler.query.query_study_description(config, study_description, from_date, to_date)[source]

crawler.writer module

crawler.writer.write_file(results: List[Dict[str, str]], filename: str) → str[source]
crawler.writer.write_results(results: List[Dict[str, str]], month: str, day: str, mod: str) → str[source]

Module contents