Skip to main content

attribute_definitions

Creates, updates, deletes, gets or lists a attribute_definitions resource.

Overview

Nameattribute_definitions
TypeResource
Idgoogle.healthcare.attribute_definitions

Fields

NameDatatypeDescription
namestringIdentifier. Resource name of the Attribute definition, of the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/attributeDefinitions/{attribute_definition_id}. Cannot be changed after creation.
descriptionstringOptional. A description of the attribute.
allowedValuesarrayRequired. Possible values for the attribute. The number of allowed values must not exceed 500. An empty list is invalid. The list can only be expanded after creation.
categorystringRequired. The category of the attribute. The value of this field cannot be changed after creation.
consentDefaultValuesarrayOptional. Default values of the attribute in Consents. If no default values are specified, it defaults to an empty value.
dataMappingDefaultValuestringOptional. Default value of the attribute in User data mappings. If no default value is specified, it defaults to an empty value. This field is only applicable to attributes of the category RESOURCE.

Methods

NameAccessible byRequired ParamsDescription
getSELECTattributeDefinitionsId, consentStoresId, datasetsId, locationsId, projectsIdGets the specified Attribute definition.
listSELECTconsentStoresId, datasetsId, locationsId, projectsIdLists the Attribute definitions in the specified consent store.
createINSERTconsentStoresId, datasetsId, locationsId, projectsIdCreates a new Attribute definition in the parent consent store.
deleteDELETEattributeDefinitionsId, consentStoresId, datasetsId, locationsId, projectsIdDeletes the specified Attribute definition. Fails if the Attribute definition is referenced by any User data mapping, or the latest revision of any Consent.
patchUPDATEattributeDefinitionsId, consentStoresId, datasetsId, locationsId, projectsIdUpdates the specified Attribute definition.

SELECT examples

Lists the Attribute definitions in the specified consent store.

SELECT
name,
description,
allowedValues,
category,
consentDefaultValues,
dataMappingDefaultValue
FROM google.healthcare.attribute_definitions
WHERE consentStoresId = '{{ consentStoresId }}'
AND datasetsId = '{{ datasetsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new attribute_definitions resource.

/*+ create */
INSERT INTO google.healthcare.attribute_definitions (
consentStoresId,
datasetsId,
locationsId,
projectsId,
name,
description,
category,
allowedValues,
consentDefaultValues,
dataMappingDefaultValue
)
SELECT
'{{ consentStoresId }}',
'{{ datasetsId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ description }}',
'{{ category }}',
'{{ allowedValues }}',
'{{ consentDefaultValues }}',
'{{ dataMappingDefaultValue }}'
;

UPDATE example

Updates a attribute_definitions resource.

/*+ update */
UPDATE google.healthcare.attribute_definitions
SET
name = '{{ name }}',
description = '{{ description }}',
category = '{{ category }}',
allowedValues = '{{ allowedValues }}',
consentDefaultValues = '{{ consentDefaultValues }}',
dataMappingDefaultValue = '{{ dataMappingDefaultValue }}'
WHERE
attributeDefinitionsId = '{{ attributeDefinitionsId }}'
AND consentStoresId = '{{ consentStoresId }}'
AND datasetsId = '{{ datasetsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified attribute_definitions resource.

/*+ delete */
DELETE FROM google.healthcare.attribute_definitions
WHERE attributeDefinitionsId = '{{ attributeDefinitionsId }}'
AND consentStoresId = '{{ consentStoresId }}'
AND datasetsId = '{{ datasetsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';