Interface HealthcareApiClient

All Known Implementing Classes:
HttpHealthcareApiClient

public interface HealthcareApiClient
Defines a client to communicate with the GCP HCLS API (version v1).
  • Method Details

    • getHL7v2Message

      Message getHL7v2Message(String msgName) throws IOException, ParseException
      Gets a Hl7v2 message by its name from a Hl7v2 store.
      Parameters:
      msgName - The message name to be retrieved.
      Returns:
      The HL7v2 message.
      Throws:
      IOException - The IO Exception.
      ParseException - The Parse Exception.
    • deleteHL7v2Message

      Empty deleteHL7v2Message(String msgName) throws IOException
      Deletes an HL7v2 message.
      Parameters:
      msgName - The message name to be deleted.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • getHL7v2Store

      Hl7V2Store getHL7v2Store(String storeName) throws IOException
      Gets an HL7v2 store.
      Parameters:
      storeName - The store name to be retrieved.
      Returns:
      The HL7v2 store.
      Throws:
      IOException - The IO Exception.
    • getEarliestHL7v2SendTime

      Instant getEarliestHL7v2SendTime(String hl7v2Store, @Nullable String filter) throws IOException
      Gets the earliest HL7v2 send time.
      Parameters:
      hl7v2Store - The HL7v2 store.
      filter - the filter to be matched on.
      Returns:
      The earliest HL7v2 send time.
      Throws:
      IOException - The IO Exception.
    • getLatestHL7v2SendTime

      Instant getLatestHL7v2SendTime(String hl7v2Store, @Nullable String filter) throws IOException
      Gets the latest HL7v2 send time.
      Parameters:
      hl7v2Store - The HL7v2 store.
      filter - The filter to be matched on.
      Returns:
      The latest HL7v2 send time.
      Throws:
      IOException - The IO Exception.
    • makeSendTimeBoundHL7v2ListRequest

      ListMessagesResponse makeSendTimeBoundHL7v2ListRequest(String hl7v2Store, Instant start, @Nullable Instant end, @Nullable String otherFilter, @Nullable String orderBy, @Nullable String pageToken) throws IOException
      Time Bound HL7v2 list request.
      Parameters:
      hl7v2Store - The HL7v2 store.
      start - Start time.
      end - End time.
      otherFilter - The filter outside of the sendTime.
      orderBy - Order by.
      pageToken - The page token.
      Returns:
      HTTP List response.
      Throws:
      IOException - The IO Exception.
    • makeHL7v2ListRequest

      ListMessagesResponse makeHL7v2ListRequest(String hl7v2Store, @Nullable String filter, @Nullable String orderBy, @Nullable String pageToken) throws IOException
      Make hl 7 v 2 list request list messages response.
      Parameters:
      hl7v2Store - The HL7v2 Store.
      filter - The Filter.
      orderBy - Order by.
      pageToken - The Page Token.
      Returns:
      HTTP List response.
      Throws:
      IOException - The IO Exception.
    • ingestHL7v2Message

      IngestMessageResponse ingestHL7v2Message(String hl7v2Store, Message msg) throws IOException
      Ingest an HL7v2 message.
      Parameters:
      hl7v2Store - The HL7v2 store of the message.
      msg - The message.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • createHL7v2Message

      Message createHL7v2Message(String hl7v2Store, Message msg) throws IOException
      Creates an HL7v2 message.
      Parameters:
      hl7v2Store - The HL7v2 store to create a message in.
      msg - The message to create.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • deleteHL7v2Store

      Empty deleteHL7v2Store(String store) throws IOException
      Deletes an HL7v2 store.
      Parameters:
      store - The HL7v2 store to be deleted.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • importFhirResource

      Operation importFhirResource(String fhirStore, String gcsSourcePath, @Nullable String contentStructure) throws IOException
      Importing a FHIR resource from GCS.
      Parameters:
      fhirStore - the FhirStore to import into.
      gcsSourcePath - the GCS Path of resource.
      contentStructure - The content structure.
      Returns:
      Empty.
      Throws:
      IOException - the io exception
    • exportFhirResourceToGcs

      Operation exportFhirResourceToGcs(String fhirStore, String gcsDestinationPrefix) throws IOException
      Export a FHIR Resource to GCS.
      Parameters:
      fhirStore - the FhirStore of the resource.
      gcsDestinationPrefix - GCS Destination Prefix to export to.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • exportFhirResourceToBigQuery

      Operation exportFhirResourceToBigQuery(String fhirStore, String bigQueryDatasetUri) throws IOException
      Export a FHIR Resource to BigQuery.
      Parameters:
      fhirStore - the FhirStore of the resource.
      bigQueryDatasetUri - The BQ Dataset URI to export to.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • deidentifyFhirStore

      Operation deidentifyFhirStore(String sourceFhirStore, String destinationFhirStore, DeidentifyConfig deidConfig) throws IOException
      Deidentify a GCP FHIR Store and write the result into a new FHIR Store.
      Parameters:
      sourceFhirStore - the FhirStore to be deidentified.
      destinationFhirStore - the FhirStore that the deidentified data will be written to.
      deidConfig - the deidCongig specifying form of deidentification.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • pollOperation

      Operation pollOperation(Operation operation, Long sleepMs) throws InterruptedException, IOException
      Poll operation.
      Parameters:
      operation - to be polled.
      sleepMs - length of time to wait between requests.
      Returns:
      HTTP Request (that returns status of operation).
      Throws:
      IOException - The IO Exception.
      InterruptedException
    • executeFhirBundle

      HttpBody executeFhirBundle(String fhirStore, String bundle) throws IOException, HttpHealthcareApiClient.HealthcareHttpException
      Execute fhir bundle http body.
      Parameters:
      fhirStore - the fhir store
      bundle - the bundle
      Returns:
      the http body
      Throws:
      IOException - The IO Exception.
      HttpHealthcareApiClient.HealthcareHttpException
    • readFhirResource

      HttpBody readFhirResource(String resourceName) throws IOException
      Read fhir resource http body.
      Parameters:
      resourceName - the resource name, in format projects/{p}/locations/{l}/datasets/{d}/fhirStores/{f}/fhir/{resourceType}/{id}
      Returns:
      the http body
      Throws:
      IOException - The IO Exception.
    • searchFhirResource

      HttpBody searchFhirResource(String fhirStore, String resourceType, @Nullable Map<String,Object> parameters, String pageToken) throws IOException
      Search fhir resource http body.
      Parameters:
      fhirStore - the fhir store
      resourceType - the resource type
      parameters - The parameters (in the form of key-value pairs).
      Returns:
      the http body
      Throws:
      IOException - The IO Exception.
    • getPatientEverything

      HttpBody getPatientEverything(String resourceName, @Nullable Map<String,Object> filters, String pageToken) throws IOException
      Fhir get patient everything http body.
      Parameters:
      resourceName - the resource name, in format projects/{p}/locations/{l}/datasets/{d}/fhirStores/{f}/fhir/{resourceType}/{id}
      filters - optional request filters (in key value pairs).
      Returns:
      the http body
      Throws:
      IOException - The IO Exception.
    • createHL7v2Store

      Hl7V2Store createHL7v2Store(String dataset, String name) throws IOException
      Create hl 7 v 2 store hl 7 v 2 store.
      Parameters:
      dataset - The dataset to create the HL7v2 store in.
      name - The name of the store to be created.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • createFhirStore

      FhirStore createFhirStore(String dataset, String name, String version, String pubsubTopic) throws IOException
      Create FHIR Store with a PubSub topic listener.
      Parameters:
      dataset - The name of Dataset for the FHIR store to be created in.
      name - The name of the FHIR store.
      version - The version of the FHIR store (DSTU2, STU3, R4).
      pubsubTopic - The pubsub topic listening to the FHIR store.
      Throws:
      IOException - The IO Exception.
    • createFhirStore

      FhirStore createFhirStore(String dataset, String name, String version) throws IOException
      Create FHIR Store.
      Parameters:
      dataset - The name of the Dataset for the FHIR store to be created in.
      name - The name of the FHIR store.
      version - The version of the FHIR store (DSTU2, STU3, R4).
      Throws:
      IOException - The IO Exception.
    • listAllFhirStores

      List<FhirStore> listAllFhirStores(String dataset) throws IOException
      List all FHIR stores in a dataset.
      Parameters:
      dataset - The dataset, in the format: projects/project_id/locations/location_id/datasets/dataset_id
      Returns:
      A list of all FHIR stores in the dataset.
      Throws:
      IOException - The IO Exception.
    • deleteFhirStore

      Empty deleteFhirStore(String store) throws IOException
      Delete Fhir store.
      Parameters:
      store - The FHIR store to be deleted.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • retrieveDicomStudyMetadata

      String retrieveDicomStudyMetadata(String dicomWebPath) throws IOException
      Retrieve DicomStudyMetadata.
      Parameters:
      dicomWebPath - The Dicom Web Path to retrieve the metadata from.
      Returns:
      The study metadata.
      Throws:
      IOException - The IO Exception.
    • createDicomStore

      DicomStore createDicomStore(String dataset, String name) throws IOException
      Create a DicomStore.
      Parameters:
      dataset - The dataset that the Dicom Store should be in, in the format: projects/project_id/locations/location_id/datasets/dataset_id.
      name - The name of the Dicom Store to be created.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • createDicomStore

      DicomStore createDicomStore(String dataset, String name, String pubsubTopic) throws IOException
      Create a DicomStore with a PubSub listener.
      Parameters:
      dataset - The dataset that the Dicom Store should be in, in the format: projects/project_id/locations/location_id/datasets/dataset_id
      name - The name of the Dicom Store to be created.
      pubsubTopic - Name of PubSub topic connected with the Dicom store.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • deleteDicomStore

      Empty deleteDicomStore(String name) throws IOException
      Delete a Dicom Store.
      Parameters:
      name - The name of the Dicom Store to be deleted.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
    • uploadToDicomStore

      Empty uploadToDicomStore(String webPath, String filePath) throws IOException, URISyntaxException
      Upload to a Dicom Store.
      Parameters:
      webPath - String format of webPath to upload into.
      filePath - filePath of file to upload.
      Returns:
      Empty.
      Throws:
      IOException - The IO Exception.
      URISyntaxException