
                         J    d Z ddlmZ ddlmZ ddlmZ ddlmZ d Zd Zd Z	y	)
z/General utilties for Cloud Healthcare commands.    )absolute_import)division)unicode_literals)apisc                       fd}|S )Nc                 V    | sy t        j                  d      }|j                         S )N
healthcare)r   GetMessagesModule
FhirConfig)flagmessagesapi_versions     1lib/googlecloudsdk/command_lib/healthcare/util.pyVersionedInsertEmptyFhirConfigz=InsertEmptyFhirConfig.<locals>.VersionedInsertEmptyFhirConfig   s*    %%lK@H       )r   r   s   ` r   InsertEmptyFhirConfigr      s    !
 
('r   c                       fd}|S )Nc                 \    | sy t        j                  d      }|j                  | d      S )Nr	   T)annotationStoreName
storeQuote)r   r
   AnnotationConfig)annotation_storer   r   s     r   VersionedInsertAnnotationConfigz?InsertAnnotationConfig.<locals>.VersionedInsertAnnotationConfig'   s8    %%lK@H$$, % ? ?r   r   )r   r   s   ` r   InsertAnnotationConfigr   &   s    ? 
)(r   c                       fd}|S )zReturns a function that inserts a DicomStreamingConfig of a Dicom Store.

  Args:
    api_version: the version of the API that is currently being used.

  Returns:
    A DicomStreamConfig object with provided BigQueryDestinations.
  c                    | sy | j                  d      }t        j                  d      }g }dk(  r:|D ]3  }|j                  |j	                  |j                  |                   5 |S dk(  r:|D ]3  }|j                  |j                  |j                  |                   5 |S |D ]3  }|j                  |j                  |j                  |                   5 |S )N,r	   v1alpha2)tableUri)bigqueryDestinationv1beta1)
splitr   r
   append.GoogleCloudHealthcareV1alpha2DicomStreamConfig5GoogleCloudHealthcareV1alpha2DicomBigQueryDestination-GoogleCloudHealthcareV1beta1DicomStreamConfig4GoogleCloudHealthcareV1beta1DicomBigQueryDestination(GoogleCloudHealthcareV1DicomStreamConfig/GoogleCloudHealthcareV1DicomBigQueryDestination)argbq_destinationsr   stream_configsdestr   s        r    VersionedInsertDicomStreamConfigzAInsertDicomStreamConfig.<locals>.VersionedInsertDicomStreamConfig9   s   iinO%%lK@HNj !$hUUJJ K  V   	! ""  
		!!$hTTII J  U   	! "  "$hOODD E  P   	! "
 r   r   )r   r/   s   ` r   InsertDicomStreamConfigr0   0   s    2 
*)r   N)
__doc__
__future__r   r   r   googlecloudsdk.api_lib.utilr   r   r   r0   r   r   r   <module>r4      s%     6 &  ' ,
()"*r   