1

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.

rahulg510
  • 53
  • 5
  • I've never used the Healthcare service but I'm very familiar with Google's services generally. It sounds correct that you would enumerate the datasets and then, for each dataset, fetch the data stores. Is it really *expensive* ($$$) to make multiple calls? I would be surprised. This is generally the way that REST APIs work. – DazWilkin Jun 04 '22 at 00:17
  • i was referring to computational time when saying costly, i will update my question to make it clear. – rahulg510 Jun 04 '22 at 00:24
  • Regardless, the shape of the API appears to provide no alternative. You will need to enumerate the datasets and then, for each dataset, enumerate the data stores. – DazWilkin Jun 04 '22 at 01:42
  • Mind adding a link to the documentation for the exact method you are calling It makes it easer for people trying to help. – Linda Lawton - DaImTo Jun 04 '22 at 16:43

1 Answers1

1

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.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449