Exemplo n.º 1
0
    def __get_worklist_rack_markers(self, worklist):
        """
        Parses the worklist label (see :func:`LABELS.parse_worklist_label`).
        Returns *None* if the worklist is not accepted.

        This can be the case for worklists with unknown rack markers (in this
        case there are preparation plates involved that do not belong to the
        entity) or if the worklist might be part of both entity processings.
        The second is the case for some final plate worklists.
        """
        values = LABELS.parse_worklist_label(worklist.label)
        trg_marker = values[LABELS.MARKER_WORKLIST_TARGET]
        if not self.__rack_containers.has_key(trg_marker): return None
        src_marker = None
        if values.has_key(LABELS.MARKER_WORKLIST_SOURCE):
            src_marker = values[LABELS.MARKER_WORKLIST_SOURCE]
            if not self.__rack_containers.has_key(src_marker): return None

        if worklist.transfer_type == TRANSFER_TYPES.SAMPLE_DILUTION:
            if trg_marker == LABELS.ROLE_FINAL and \
                            self._expected_iso_status == ISO_STATUS.IN_PROGRESS:
                for rack_container in self.__rack_containers[trg_marker]:
                    if rack_container.rack.status.name == ITEM_STATUSES.MANAGED:
                        return None

        return trg_marker, src_marker
Exemplo n.º 2
0
    def __get_worklist_rack_markers(self, worklist):
        """
        Parses the worklist label (see :func:`LABELS.parse_worklist_label`).
        Returns *None* if the worklist is not accepted.

        This can be the case for worklists with unknown rack markers (in this
        case there are preparation plates involved that do not belong to the
        entity) or if the worklist might be part of both entity processings.
        The second is the case for some final plate worklists.
        """
        values = LABELS.parse_worklist_label(worklist.label)
        trg_marker = values[LABELS.MARKER_WORKLIST_TARGET]
        if not self.__rack_containers.has_key(trg_marker): return None
        src_marker = None
        if values.has_key(LABELS.MARKER_WORKLIST_SOURCE):
            src_marker = values[LABELS.MARKER_WORKLIST_SOURCE]
            if not self.__rack_containers.has_key(src_marker): return None

        if worklist.transfer_type == TRANSFER_TYPES.SAMPLE_DILUTION:
            if trg_marker == LABELS.ROLE_FINAL and \
                            self._expected_iso_status == ISO_STATUS.IN_PROGRESS:
                for rack_container in self.__rack_containers[trg_marker]:
                    if rack_container.rack.status.name == ITEM_STATUSES.MANAGED:
                        return None

        return trg_marker, src_marker
Exemplo n.º 3
0
 def __create_stock_transfer_jobs(self, stock_rack):
     """
     Convenience method creating a :class:`SampleTransferJob` for a transfer
     from stock rack to a plate.
     """
     stock_worklists = stock_rack.worklist_series.get_sorted_worklists()
     for worklist in stock_worklists:
         values = LABELS.parse_worklist_label(worklist.label)
         src_marker = values[LABELS.MARKER_WORKLIST_SOURCE]
         if not src_marker in stock_rack.label:
             msg = 'Inconsistent stock rack for worklist "%s" '  \
                   '(stock rack: %s).' % (worklist.label, stock_rack.label)
             self.add_error(msg)
         trg_marker = values[LABELS.MARKER_WORKLIST_TARGET]
         for rack_container in self.__rack_containers[trg_marker]:
             self.__create_and_store_transfer_job(worklist=worklist,
                                     target_plate=rack_container.rack,
                                     source_rack=stock_rack.rack)
Exemplo n.º 4
0
 def __create_stock_transfer_jobs(self, stock_rack):
     """
     Convenience method creating a :class:`SampleTransferJob` for a transfer
     from stock rack to a plate.
     """
     stock_worklists = stock_rack.worklist_series.get_sorted_worklists()
     for worklist in stock_worklists:
         values = LABELS.parse_worklist_label(worklist.label)
         src_marker = values[LABELS.MARKER_WORKLIST_SOURCE]
         if not src_marker in stock_rack.label:
             msg = 'Inconsistent stock rack for worklist "%s" '  \
                   '(stock rack: %s).' % (worklist.label, stock_rack.label)
             self.add_error(msg)
         trg_marker = values[LABELS.MARKER_WORKLIST_TARGET]
         for rack_container in self.__rack_containers[trg_marker]:
             self.__create_and_store_transfer_job(
                 worklist=worklist,
                 target_plate=rack_container.rack,
                 source_rack=stock_rack.rack)