code: def match_tcia_ref_uid_in_study(study_uid, ref_sop_uid):
      """
      Match the SeriesInstanceUID from all series in a study according to the input SOPInstanceUID.
  
      Args:
          study_uid: StudyInstanceUID.
          ref_sop_uid: SOPInstanceUID.
  
      """
      series_list = get_tcia_metadata(
          query=f"getSeries?StudyInstanceUID={study_uid}",
          attribute="SeriesInstanceUID",
      )
      for series_id in series_list:
          sop_id_list = get_tcia_metadata(
              query=f"getSOPInstanceUIDs?SeriesInstanceUID={series_id}",
              attribute="SOPInstanceUID",
          )
          if ref_sop_uid in sop_id_list:
              return series_id
      return ""
  
file_path: MONAI/monai/apps/tcia/utils.py
imports: from __future__ import annotations
  import os
  from typing import Iterable
  import monai
  from monai.config.type_definitions import PathLike
  from monai.utils import optional_import
label_desc: Use image node_id 4 for calling a global function with example usage: match_tcia_ref_uid_in_study(study_uid, ref_sop_uid) and returns: str, series_id