I am using the Google cloud healthcare api to store dicom images. I need a way to fetch a list of all the dataset in a project with names of all the data stores in each dataset.

so possible output would look like this:

{ dataset1: [ "dataStoreA", "dataStoreB", ], 
  dataset2: [ "dataStoreC", "dataStoreD", ],
  dataset3: [ "dataStoreE", "dataStoreF", ], 
 }

I am able to fetch the list of all the datasets using

healthcare.projects.locations.datasets.list({
  parent: `projects/${project}/locations/${location}`
 })

but that only returns an object for each dataset containing only the name of the dataset. I want to get name of all the data stores in that datasets as well.

My current way is to fetch a list of all the datasets and then for each dataset, fetch all the data stores in it. Using

healthcare.projects.locations.datasets.dicomStores
  .list({
    parent: `projects/${project}/locations/${location}/datasets/${dataset}`,
  })

but this very time consuming because if there are 5 datasets, then I have to make 5 different requests to the api. I have looked the Google docs for the api and searched around without any luck.

1

There are 1 best solutions below

0
On BEST ANSWER

The method dicomStores.list is designed to list the DICOM stores in the given dataset.

There is no method that will list all of the DICOM stores across datasets.

The current method you are using is the only option.