diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/MANIFEST.in b/sdk/healthinsights/azure-healthinsights-radiologyinsights/MANIFEST.in index d2fd55d2d2ad..ce2ab375de56 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/MANIFEST.in +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/MANIFEST.in @@ -4,4 +4,4 @@ include azure/healthinsights/radiologyinsights/py.typed recursive-include tests *.py recursive-include samples *.py *.md include azure/__init__.py -include azure/healthinsights/__init__.py \ No newline at end of file +include azure/healthinsights/__init__.py diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/_meta.json b/sdk/healthinsights/azure-healthinsights-radiologyinsights/_meta.json new file mode 100644 index 000000000000..46d6d68aa651 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/_meta.json @@ -0,0 +1,6 @@ +{ + "commit": "b21d3a9d67eaa53f6aa9a2781f4e7fd32df7ed87", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/ai/HealthInsights/HealthInsights.RadiologyInsights", + "@azure-tools/typespec-python": "0.44.2" +} \ No newline at end of file diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/apiview-properties.json b/sdk/healthinsights/azure-healthinsights-radiologyinsights/apiview-properties.json new file mode 100644 index 000000000000..397f0c185c78 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/apiview-properties.json @@ -0,0 +1,88 @@ +{ + "CrossLanguagePackageId": "AzureHealthInsights", + "CrossLanguageDefinitionId": { + "azure.healthinsights.radiologyinsights.models.RadiologyInsightsInference": "AzureHealthInsights.RadiologyInsightsInference", + "azure.healthinsights.radiologyinsights.models.AgeMismatchInference": "AzureHealthInsights.AgeMismatchInference", + "azure.healthinsights.radiologyinsights.models.Element": "Fhir.R4.Element", + "azure.healthinsights.radiologyinsights.models.Annotation": "Fhir.R4.Annotation", + "azure.healthinsights.radiologyinsights.models.AssessmentValueRange": "AzureHealthInsights.AssessmentValueRange", + "azure.healthinsights.radiologyinsights.models.CodeableConcept": "Fhir.R4.CodeableConcept", + "azure.healthinsights.radiologyinsights.models.Coding": "Fhir.R4.Coding", + "azure.healthinsights.radiologyinsights.models.CompleteOrderDiscrepancyInference": "AzureHealthInsights.CompleteOrderDiscrepancyInference", + "azure.healthinsights.radiologyinsights.models.CriticalResult": "AzureHealthInsights.CriticalResult", + "azure.healthinsights.radiologyinsights.models.CriticalResultInference": "AzureHealthInsights.CriticalResultInference", + "azure.healthinsights.radiologyinsights.models.DocumentAdministrativeMetadata": "AzureHealthInsights.DocumentAdministrativeMetadata", + "azure.healthinsights.radiologyinsights.models.DocumentAuthor": "AzureHealthInsights.DocumentAuthor", + "azure.healthinsights.radiologyinsights.models.DocumentContent": "AzureHealthInsights.DocumentContent", + "azure.healthinsights.radiologyinsights.models.Resource": "Fhir.R4.Resource", + "azure.healthinsights.radiologyinsights.models.DomainResource": "Fhir.R4.DomainResource", + "azure.healthinsights.radiologyinsights.models.Extension": "Fhir.R4.Extension", + "azure.healthinsights.radiologyinsights.models.FindingInference": "AzureHealthInsights.FindingInference", + "azure.healthinsights.radiologyinsights.models.FindingOptions": "AzureHealthInsights.FindingOptions", + "azure.healthinsights.radiologyinsights.models.FollowupCommunicationInference": "AzureHealthInsights.FollowupCommunicationInference", + "azure.healthinsights.radiologyinsights.models.FollowupRecommendationInference": "AzureHealthInsights.FollowupRecommendationInference", + "azure.healthinsights.radiologyinsights.models.FollowupRecommendationOptions": "AzureHealthInsights.FollowupRecommendationOptions", + "azure.healthinsights.radiologyinsights.models.ProcedureRecommendation": "AzureHealthInsights.ProcedureRecommendation", + "azure.healthinsights.radiologyinsights.models.GenericProcedureRecommendation": "AzureHealthInsights.GenericProcedureRecommendation", + "azure.healthinsights.radiologyinsights.models.GuidanceInference": "AzureHealthInsights.GuidanceInference", + "azure.healthinsights.radiologyinsights.models.GuidanceOptions": "AzureHealthInsights.GuidanceOptions", + "azure.healthinsights.radiologyinsights.models.HealthInsightsErrorResponse": "AzureHealthInsights.HealthInsightsErrorResponse", + "azure.healthinsights.radiologyinsights.models.Identifier": "Fhir.R4.Identifier", + "azure.healthinsights.radiologyinsights.models.ImagingProcedure": "AzureHealthInsights.ImagingProcedure", + "azure.healthinsights.radiologyinsights.models.ImagingProcedureRecommendation": "AzureHealthInsights.ImagingProcedureRecommendation", + "azure.healthinsights.radiologyinsights.models.LateralityDiscrepancyInference": "AzureHealthInsights.LateralityDiscrepancyInference", + "azure.healthinsights.radiologyinsights.models.LimitedOrderDiscrepancyInference": "AzureHealthInsights.LimitedOrderDiscrepancyInference", + "azure.healthinsights.radiologyinsights.models.Meta": "Fhir.R4.Meta", + "azure.healthinsights.radiologyinsights.models.Narrative": "Fhir.R4.Narrative", + "azure.healthinsights.radiologyinsights.models.Observation": "Fhir.R4.Observation", + "azure.healthinsights.radiologyinsights.models.ObservationComponent": "Fhir.R4.ObservationComponent", + "azure.healthinsights.radiologyinsights.models.ObservationReferenceRange": "Fhir.R4.ObservationReferenceRange", + "azure.healthinsights.radiologyinsights.models.OrderedProcedure": "AzureHealthInsights.OrderedProcedure", + "azure.healthinsights.radiologyinsights.models.PatientDetails": "AzureHealthInsights.PatientDetails", + "azure.healthinsights.radiologyinsights.models.PatientDocument": "AzureHealthInsights.PatientDocument", + "azure.healthinsights.radiologyinsights.models.PatientEncounter": "AzureHealthInsights.PatientEncounter", + "azure.healthinsights.radiologyinsights.models.PatientRecord": "AzureHealthInsights.PatientRecord", + "azure.healthinsights.radiologyinsights.models.Period": "Fhir.R4.Period", + "azure.healthinsights.radiologyinsights.models.PresentGuidanceInformation": "AzureHealthInsights.PresentGuidanceInformation", + "azure.healthinsights.radiologyinsights.models.QualityMeasureInference": "AzureHealthInsights.QualityMeasureInference", + "azure.healthinsights.radiologyinsights.models.QualityMeasureOptions": "AzureHealthInsights.QualityMeasureOptions", + "azure.healthinsights.radiologyinsights.models.Quantity": "Fhir.R4.Quantity", + "azure.healthinsights.radiologyinsights.models.RadiologyCodeWithTypes": "AzureHealthInsights.RadiologyCodeWithTypes", + "azure.healthinsights.radiologyinsights.models.RadiologyInsightsData": "AzureHealthInsights.RadiologyInsightsData", + "azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceOptions": "AzureHealthInsights.RadiologyInsightsInferenceOptions", + "azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult": "AzureHealthInsights.RadiologyInsightsInferenceResult", + "azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob": "AzureHealthInsights.RadiologyInsightsJob", + "azure.healthinsights.radiologyinsights.models.RadiologyInsightsModelConfiguration": "AzureHealthInsights.RadiologyInsightsModelConfiguration", + "azure.healthinsights.radiologyinsights.models.RadiologyInsightsPatientResult": "AzureHealthInsights.RadiologyInsightsPatientResult", + "azure.healthinsights.radiologyinsights.models.RadiologyProcedureInference": "AzureHealthInsights.RadiologyProcedureInference", + "azure.healthinsights.radiologyinsights.models.Range": "Fhir.R4.Range", + "azure.healthinsights.radiologyinsights.models.Ratio": "Fhir.R4.Ratio", + "azure.healthinsights.radiologyinsights.models.RecommendationFinding": "AzureHealthInsights.RecommendationFinding", + "azure.healthinsights.radiologyinsights.models.Reference": "Fhir.R4.Reference", + "azure.healthinsights.radiologyinsights.models.SampledData": "Fhir.R4.SampledData", + "azure.healthinsights.radiologyinsights.models.ScoringAndAssessmentInference": "AzureHealthInsights.ScoringAndAssessmentInference", + "azure.healthinsights.radiologyinsights.models.SexMismatchInference": "AzureHealthInsights.SexMismatchInference", + "azure.healthinsights.radiologyinsights.models.TimePeriod": "AzureHealthInsights.TimePeriod", + "azure.healthinsights.radiologyinsights.models.PatientSex": "AzureHealthInsights.PatientSex", + "azure.healthinsights.radiologyinsights.models.EncounterClass": "AzureHealthInsights.EncounterClass", + "azure.healthinsights.radiologyinsights.models.DocumentType": "AzureHealthInsights.DocumentType", + "azure.healthinsights.radiologyinsights.models.ClinicalDocumentType": "AzureHealthInsights.ClinicalDocumentType", + "azure.healthinsights.radiologyinsights.models.SpecialtyType": "AzureHealthInsights.SpecialtyType", + "azure.healthinsights.radiologyinsights.models.DocumentContentSourceType": "AzureHealthInsights.DocumentContentSourceType", + "azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceType": "AzureHealthInsights.RadiologyInsightsInferenceType", + "azure.healthinsights.radiologyinsights.models.QualityMeasureType": "AzureHealthInsights.QualityMeasureType", + "azure.healthinsights.radiologyinsights.models.ResearchStudyStatusCodeType": "Fhir.R4.ResearchStudyStatusCodeType", + "azure.healthinsights.radiologyinsights.models.ContactPointSystem": "Fhir.R4.ContactPointSystem", + "azure.healthinsights.radiologyinsights.models.ContactPointUse": "Fhir.R4.ContactPointUse", + "azure.healthinsights.radiologyinsights.models.ObservationStatusCodeType": "Fhir.R4.ObservationStatusCodeType", + "azure.healthinsights.radiologyinsights.models.MedicalProfessionalType": "AzureHealthInsights.MedicalProfessionalType", + "azure.healthinsights.radiologyinsights.models.RecommendationFindingStatusType": "AzureHealthInsights.RecommendationFindingStatusType", + "azure.healthinsights.radiologyinsights.models.GuidanceRankingType": "AzureHealthInsights.GuidanceRankingType", + "azure.healthinsights.radiologyinsights.models.LateralityDiscrepancyType": "AzureHealthInsights.LateralityDiscrepancyType", + "azure.healthinsights.radiologyinsights.models.QualityMeasureComplianceType": "AzureHealthInsights.QualityMeasureComplianceType", + "azure.healthinsights.radiologyinsights.models.ScoringAndAssessmentCategoryType": "AzureHealthInsights.ScoringAndAssessmentCategoryType", + "azure.healthinsights.radiologyinsights.models.JobStatus": "AzureHealthInsights.JobStatus", + "azure.healthinsights.radiologyinsights.RadiologyInsightsClient.begin_infer_radiology_insights": "ClientForAzureHealthInsights.RadiologyInsightsClient.inferRadiologyInsights", + "azure.healthinsights.radiologyinsights.aio.RadiologyInsightsClient.begin_infer_radiology_insights": "ClientForAzureHealthInsights.RadiologyInsightsClient.inferRadiologyInsights" + } +} \ No newline at end of file diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/__init__.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/__init__.py index 6b6d1d35581a..4933e190f6a7 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/__init__.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/__init__.py @@ -5,18 +5,28 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._patch import RadiologyInsightsClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import RadiologyInsightsClient # type: ignore from ._version import VERSION __version__ = VERSION - +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] from ._patch import patch_sdk as _patch_sdk __all__ = [ "RadiologyInsightsClient", ] - +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_client.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_client.py index 744299e0905c..a452f0f59198 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_client.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_client.py @@ -17,26 +17,24 @@ from ._configuration import RadiologyInsightsClientConfiguration from ._operations import RadiologyInsightsClientOperationsMixin -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class RadiologyInsightsClient( - RadiologyInsightsClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword +class RadiologyInsightsClient(RadiologyInsightsClientOperationsMixin): """RadiologyInsightsClient. :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: - https://westus2.api.cognitive.microsoft.com). Required. + `https://westus2.api.cognitive.microsoft.com `_). + Required. :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Is either a - AzureKeyCredential type or a TokenCredential type. Required. + :param credential: Credential used to authenticate requests to the service. Is either a key + credential type or a token credential type. Required. :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2024-04-01". + :keyword api_version: The API version to use for this operation. Default value is "2024-10-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -46,6 +44,7 @@ class RadiologyInsightsClient( def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: _endpoint = "{endpoint}/health-insights" self._config = RadiologyInsightsClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_configuration.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_configuration.py index 209906a0759e..b8f2e314a19c 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_configuration.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_configuration.py @@ -14,30 +14,30 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class RadiologyInsightsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class RadiologyInsightsClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for RadiologyInsightsClient. Note that all parameters used to create this instance are saved as instance attributes. :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: - https://westus2.api.cognitive.microsoft.com). Required. + `https://westus2.api.cognitive.microsoft.com `_). + Required. :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Is either a - AzureKeyCredential type or a TokenCredential type. Required. + :param credential: Credential used to authenticate requests to the service. Is either a key + credential type or a token credential type. Required. :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2024-04-01". + :keyword api_version: The API version to use for this operation. Default value is "2024-10-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-04-01") + api_version: str = kwargs.pop("api_version", "2024-10-01") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/__init__.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/__init__.py index 24be3b0c64fc..ba57f3464683 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/__init__.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import RadiologyInsightsClientOperationsMixin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import RadiologyInsightsClientOperationsMixin # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "RadiologyInsightsClientOperationsMixin", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/_operations.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/_operations.py index 72fc5d89cbc2..38fe5a005428 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/_operations.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys -from typing import Any, Callable, Dict, IO, Iterator, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union, cast, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -29,15 +29,12 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Serializer -from .._vendor import RadiologyInsightsClientMixinABC - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +from .._configuration import RadiologyInsightsClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Serializer +from .._utils.utils import ClientMixinABC + +JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +49,7 @@ def build_radiology_insights_infer_radiology_insights_request( # pylint: disabl _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +73,9 @@ def build_radiology_insights_infer_radiology_insights_request( # pylint: disabl return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -class RadiologyInsightsClientOperationsMixin(RadiologyInsightsClientMixinABC): +class RadiologyInsightsClientOperationsMixin( + ClientMixinABC[PipelineClient[HttpRequest, HttpResponse], RadiologyInsightsClientConfiguration] +): def _infer_radiology_insights_initial( self, @@ -86,7 +85,7 @@ def _infer_radiology_insights_initial( expand: Optional[List[str]] = None, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -134,7 +133,7 @@ def _infer_radiology_insights_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.HealthInsightsErrorResponse, response.json()) + error = _failsafe_deserialize(_models.HealthInsightsErrorResponse, response.json()) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -295,7 +294,7 @@ def get_long_running_output(pipeline_response): "str", response.headers.get("Operation-Location") ) - deserialized = _deserialize(_models.RadiologyInsightsJob, response.json().get("result")) + deserialized = _deserialize(_models.RadiologyInsightsJob, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/_patch.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/_patch.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_patch.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_patch.py index d599e61e8554..8bcb627aa475 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_patch.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_patch.py @@ -1,270 +1,15 @@ -# pylint: disable=protected-access -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import ( - Any, - IO, - Optional, - Dict, - Union, - cast, - overload, - List, - MutableMapping, - TypeVar, - Callable, - TYPE_CHECKING, -) # pylint: disable=line-too-long -from azure.core.credentials import AzureKeyCredential -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.polling.base_polling import LROBasePolling -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict +from typing import List -from . import models as _models -from ._model_base import _deserialize -from ._client import RadiologyInsightsClient as _RadiologyInsightsClient - - -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class RadiologyInsightsClient: # pylint: disable=client-accepts-api-version-keyword - """RadiologyInsightsClient. - - :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: - https://westus2.api.cognitive.microsoft.com). Required. - :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Is either a - AzureKeyCredential type or a TokenCredential type. Required. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials.TokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2024-04-01". - Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: - self._client = _RadiologyInsightsClient(endpoint=endpoint, credential=credential, **kwargs) - - @overload - def begin_infer_radiology_insights( - self, - id: str, - resource: _models.RadiologyInsightsJob, - *, - expand: Optional[List[str]] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RadiologyInsightsInferenceResult]: - # pylint: disable=line-too-long - """Create Radiology Insights inference result. - - Creates a Radiology Insights inference result with the given request body. - - :param id: The unique ID of the inference result. Required. - :type id: str - :param resource: The resource instance. Required. - :type resource: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob - :keyword expand: Expand the indicated resources into the response. Default value is None. - :paramtype expand: list[str] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsResult] - :raises ~azure.core.exceptions.HttpResponseError:""" - - @overload - def begin_infer_radiology_insights( - self, - id: str, - resource: JSON, - *, - expand: Optional[List[str]] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RadiologyInsightsInferenceResult]: - # pylint: disable=line-too-long - """Create Radiology Insights inference result. - - Creates a Radiology Insights inference result with the given request body. - - :param id: The unique ID of the inference result. Required. - :type id: str - :param resource: The resource instance. Required. - :type resource: JSON - :keyword expand: Expand the indicated resources into the response. Default value is None. - :paramtype expand: list[str] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult] - :raises ~azure.core.exceptions.HttpResponseError:""" - - @overload - def begin_infer_radiology_insights( - self, - id: str, - resource: IO[bytes], - *, - expand: Optional[List[str]] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RadiologyInsightsInferenceResult]: - # pylint: disable=line-too-long - """Create Radiology Insights inference result. - - Creates a Radiology Insights inference result with the given request body. - - :param id: The unique ID of the inference result. Required. - :type id: str - :param resource: The resource instance. Required. - :type resource: IO[bytes] - :keyword expand: Expand the indicated resources into the response. Default value is None. - :paramtype expand: list[str] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult] - :raises ~azure.core.exceptions.HttpResponseError:""" - - @distributed_trace - def begin_infer_radiology_insights( - self, - id: str, - resource: Union[_models.RadiologyInsightsJob, JSON, IO[bytes]], - *, - expand: Optional[List[str]] = None, - **kwargs: Any - ) -> LROPoller[_models.RadiologyInsightsInferenceResult]: - # pylint: disable=line-too-long - """Create Radiology Insights inference result. - - Creates a Radiology Insights inference result with the given request body. - - :param id: The unique ID of the inference result. Required. - :type id: str - :param resource: The resource instance. Is one of the following types: RadiologyInsightsJob, JSON, IO[bytes] Required. - :type resource: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob or JSON or IO[bytes] - :keyword expand: Expand the indicated resources into the response. Default value is None. - :paramtype expand: list[str] - :return: An instance of LROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult] - :raises ~azure.core.exceptions.HttpResponseError:""" - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RadiologyInsightsJob] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop( - "polling_interval", self._client._config.polling_interval # pylint: disable=protected-access - ) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._client._infer_radiology_insights_initial( # pylint: disable=protected-access - id=id, - resource=resource, - expand=expand, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["x-ms-request-id"] = self._client._deserialize( # pylint: disable=protected-access - "str", response.headers.get("x-ms-request-id") - ) - response_headers["Operation-Location"] = self._client._deserialize( # pylint: disable=protected-access - "str", response.headers.get("Operation-Location") - ) - deserialized = _deserialize(_models.RadiologyInsightsInferenceResult, response.json().get("result")) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._client._serialize.url( # pylint: disable=protected-access - "self._client._config.endpoint", self._client._config.endpoint, "str", skip_quote=True - ), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.RadiologyInsightsInferenceResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client._client, # pylint: disable=protected-access - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.RadiologyInsightsInferenceResult]( - self._client._client, raw_result, get_long_running_output, polling_method # type: ignore # pylint: disable=protected-access - ) - - def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client.send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - return self._client.send_request(request, stream=stream, **kwargs) # type: ignore - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "RadiologyInsightsClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) - - -__all__: List[str] = [ - "RadiologyInsightsClient" -] # Add all objects you want publicly available to users at this package level # pylint: disable=line-too-long +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_types.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/__init__.py similarity index 54% rename from sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_types.py rename to sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/__init__.py index b2586801fb70..8026245c2abc 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_types.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/__init__.py @@ -1,17 +1,6 @@ -# coding=utf-8 -# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- - -import sys -from typing import Union - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -RepeatabilityResult = Union[Literal["accepted"], Literal["rejected"]] diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_model_base.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/model_base.py similarity index 91% rename from sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_model_base.py rename to sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/model_base.py index 12ad7f29c71e..49d5c7259389 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_model_base.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/model_base.py @@ -1,10 +1,12 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines +# pylint: disable=protected-access, broad-except import copy import calendar @@ -20,6 +22,7 @@ from datetime import datetime, date, time, timedelta, timezone from json import JSONEncoder import xml.etree.ElementTree as ET +from collections.abc import MutableMapping from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError @@ -27,11 +30,6 @@ from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping - _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -346,7 +344,7 @@ def _get_model(module_name: str, model_name: str): _UNSET = object() -class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object +class _MyMutableMapping(MutableMapping[str, typing.Any]): def __init__(self, data: typing.Dict[str, typing.Any]) -> None: self._data = data @@ -372,50 +370,97 @@ def __ne__(self, other: typing.Any) -> bool: return not self.__eq__(other) def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ return self._data.items() def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ try: return self[key] except KeyError: return default @typing.overload - def pop(self, key: str) -> typing.Any: ... + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ @typing.overload - def pop(self, key: str, default: _T) -> _T: ... + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: ... + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ if default is _UNSET: return self._data.pop(key) return self._data.pop(key, default) def popitem(self) -> typing.Tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ return self._data.popitem() def clear(self) -> None: + """ + Remove all items from D. + """ self._data.clear() - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ self._data.update(*args, **kwargs) @typing.overload def setdefault(self, key: str, default: None = None) -> None: ... @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ if default is _UNSET: return self._data.setdefault(key) return self._data.setdefault(key, default) @@ -573,7 +618,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: def copy(self) -> "Model": return Model(self.__dict__) - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' @@ -584,8 +629,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di annotations = { k: v for mro_class in mros - if hasattr(mro_class, "__annotations__") # pylint: disable=no-member - for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() } for attr, rf in attr_to_rest_field.items(): rf._module = cls.__module__ @@ -596,12 +641,12 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - return super().__new__(cls) # pylint: disable=no-value-for-parameter + return super().__new__(cls) def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: - if hasattr(base, "__mapping__"): # pylint: disable=no-member - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore @classmethod def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: @@ -612,7 +657,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField @classmethod def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): # pylint: disable=no-member + if not hasattr(cls, "__mapping__"): return cls(data) discriminator = cls._get_discriminator(exist_discriminators) if discriminator is None: @@ -636,7 +681,7 @@ def _deserialize(cls, data, exist_discriminators): return mapped_cls._deserialize(data, exist_discriminators) def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: - """Return a dict that can be JSONify using json.dump. + """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. :returns: A dict JSON compatible object @@ -733,7 +778,7 @@ def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.An ) -def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912 +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -753,7 +798,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, except AttributeError: model_name = annotation if module is not None: - annotation = _get_model(module, model_name) + annotation = _get_model(module, model_name) # type: ignore try: if module and _is_model(annotation): @@ -893,6 +938,35 @@ def _deserialize( return _deserialize_with_callable(deserializer, value) +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + value: typing.Any, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, value) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + class _RestField: def __init__( self, diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_serialization.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/serialization.py similarity index 93% rename from sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_serialization.py rename to sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/serialization.py index 01a226bd7f14..eb86ea23c965 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_serialization.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/serialization.py @@ -1,28 +1,10 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pyright: reportUnnecessaryTypeIgnoreComment=false @@ -48,9 +30,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, ) @@ -61,13 +41,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -185,73 +165,7 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0. - - :param datetime.datetime dt: The datetime - :returns: The offset - :rtype: datetime.timedelta - """ - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation. - - :param datetime.datetime dt: The datetime - :returns: The timestamp representation - :rtype: str - """ - return "Z" - - def dst(self, dt): - """No daylight saving for UTC. - - :param datetime.datetime dt: The datetime - :returns: The daylight saving time - :rtype: datetime.timedelta - """ - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -479,8 +393,8 @@ def from_dict( :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -507,7 +421,6 @@ def _flatten_subtype(cls, key, objects): def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. :param dict response: The initial data :param dict objects: The class objects @@ -519,7 +432,7 @@ def _classify(cls, response, objects): if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -564,7 +477,7 @@ def _decode_attribute_map_key(key): return key.replace("\\.", ".") -class Serializer(object): # pylint: disable=too-many-public-methods +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -599,7 +512,7 @@ class Serializer(object): # pylint: disable=too-many-public-methods "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -627,7 +540,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) @@ -737,8 +650,8 @@ def body(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized request body """ @@ -782,8 +695,8 @@ def url(self, name, data, data_type, **kwargs): :param str data_type: The type to be serialized from. :rtype: str :returns: The serialized URL path - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -806,8 +719,8 @@ def query(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized query parameter """ try: @@ -836,8 +749,8 @@ def header(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized header """ try: @@ -856,9 +769,9 @@ def serialize_data(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. :returns: The serialized data. :rtype: str, int, float, bool, dict, list """ @@ -1193,7 +1106,7 @@ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. :return: serialized rfc """ try: @@ -1219,7 +1132,7 @@ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. :return: serialized iso """ if isinstance(attr, str): @@ -1252,7 +1165,7 @@ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid :return: serialied unix """ if isinstance(attr, int): @@ -1430,7 +1343,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument # Iter and wrapped, should have found one node only (the wrap one) if len(children) != 1: raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( xml_name ) ) @@ -1442,7 +1355,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1453,7 +1366,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1489,7 +1402,7 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1503,7 +1416,7 @@ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1684,17 +1597,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None): subtype = getattr(response, "_subtype_map", {}) try: readonly = [ - k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") ] const = [ - k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore @@ -1714,7 +1631,7 @@ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return- :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1796,7 +1713,7 @@ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return :param dict attr: Dictionary to be deserialized. :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1842,7 +1759,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1933,7 +1850,7 @@ def deserialize_bytearray(attr): :param str attr: response string to be deserialized. :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1946,7 +1863,7 @@ def deserialize_base64(attr): :param str attr: response string to be deserialized. :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1961,7 +1878,7 @@ def deserialize_decimal(attr): :param str attr: response string to be deserialized. :return: Deserialized decimal - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. :rtype: decimal """ if isinstance(attr, ET.Element): @@ -1979,7 +1896,7 @@ def deserialize_long(attr): :param str attr: response string to be deserialized. :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1992,7 +1909,7 @@ def deserialize_duration(attr): :param str attr: response string to be deserialized. :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2010,7 +1927,7 @@ def deserialize_date(attr): :param str attr: response string to be deserialized. :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2026,7 +1943,7 @@ def deserialize_time(attr): :param str attr: response string to be deserialized. :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2041,14 +1958,14 @@ def deserialize_rfc(attr): :param str attr: response string to be deserialized. :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) @@ -2064,7 +1981,7 @@ def deserialize_iso(attr): :param str attr: response string to be deserialized. :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2102,7 +2019,7 @@ def deserialize_unix(attr): :param int attr: Object to be serialized. :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_vendor.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/utils.py similarity index 62% rename from sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_vendor.py rename to sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/utils.py index cea1829f79e3..35c9c836f85f 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_vendor.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_utils/utils.py @@ -6,21 +6,20 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import TYPE_CHECKING - -from ._configuration import RadiologyInsightsClientConfiguration +from typing import Generic, TYPE_CHECKING, TypeVar if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient + from .serialization import Deserializer, Serializer + - from ._serialization import Deserializer, Serializer +TClient = TypeVar("TClient") +TConfig = TypeVar("TConfig") -class RadiologyInsightsClientMixinABC(ABC): +class ClientMixinABC(ABC, Generic[TClient, TConfig]): """DO NOT use this class. It is for internal typing use only.""" - _client: "PipelineClient" - _config: RadiologyInsightsClientConfiguration + _client: TClient + _config: TConfig _serialize: "Serializer" _deserialize: "Deserializer" diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_version.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_version.py index 83602e6274bc..ed0855dea5e6 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_version.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.1" +VERSION = "1.1.0" diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/__init__.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/__init__.py index 1dcea5894741..63659dada473 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/__init__.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/__init__.py @@ -5,15 +5,25 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._patch import RadiologyInsightsClient +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import +from ._client import RadiologyInsightsClient # type: ignore + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] from ._patch import patch_sdk as _patch_sdk __all__ = [ "RadiologyInsightsClient", ] - +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_client.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_client.py index 958b0baba68b..bf856719b5c9 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_client.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_client.py @@ -15,28 +15,26 @@ from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import RadiologyInsightsClientConfiguration from ._operations import RadiologyInsightsClientOperationsMixin if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class RadiologyInsightsClient( - RadiologyInsightsClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword +class RadiologyInsightsClient(RadiologyInsightsClientOperationsMixin): """RadiologyInsightsClient. :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: - https://westus2.api.cognitive.microsoft.com). Required. + `https://westus2.api.cognitive.microsoft.com `_). + Required. :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Is either a - AzureKeyCredential type or a TokenCredential type. Required. + :param credential: Credential used to authenticate requests to the service. Is either a key + credential type or a token credential type. Required. :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2024-04-01". + :keyword api_version: The API version to use for this operation. Default value is "2024-10-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -48,6 +46,7 @@ def __init__( ) -> None: _endpoint = "{endpoint}/health-insights" self._config = RadiologyInsightsClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_configuration.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_configuration.py index b42d868a8896..3ca6cc3c8fb4 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_configuration.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_configuration.py @@ -14,24 +14,24 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class RadiologyInsightsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class RadiologyInsightsClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for RadiologyInsightsClient. Note that all parameters used to create this instance are saved as instance attributes. :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: - https://westus2.api.cognitive.microsoft.com). Required. + `https://westus2.api.cognitive.microsoft.com `_). + Required. :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Is either a - AzureKeyCredential type or a TokenCredential type. Required. + :param credential: Credential used to authenticate requests to the service. Is either a key + credential type or a token credential type. Required. :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2024-04-01". + :keyword api_version: The API version to use for this operation. Default value is "2024-10-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -39,7 +39,7 @@ class RadiologyInsightsClientConfiguration: # pylint: disable=too-many-instance def __init__( self, endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-04-01") + api_version: str = kwargs.pop("api_version", "2024-10-01") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/__init__.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/__init__.py index 24be3b0c64fc..ba57f3464683 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/__init__.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import RadiologyInsightsClientOperationsMixin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import RadiologyInsightsClientOperationsMixin # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "RadiologyInsightsClientOperationsMixin", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/_operations.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/_operations.py index edcb1f1d5894..8457b5fdc4f6 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/_operations.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -29,20 +30,19 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize from ..._operations._operations import build_radiology_insights_infer_radiology_insights_request -from .._vendor import RadiologyInsightsClientMixinABC +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.utils import ClientMixinABC +from .._configuration import RadiologyInsightsClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class RadiologyInsightsClientOperationsMixin(RadiologyInsightsClientMixinABC): +class RadiologyInsightsClientOperationsMixin( + ClientMixinABC[AsyncPipelineClient[HttpRequest, AsyncHttpResponse], RadiologyInsightsClientConfiguration] +): async def _infer_radiology_insights_initial( self, @@ -52,7 +52,7 @@ async def _infer_radiology_insights_initial( expand: Optional[List[str]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -100,7 +100,7 @@ async def _infer_radiology_insights_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.HealthInsightsErrorResponse, response.json()) + error = _failsafe_deserialize(_models.HealthInsightsErrorResponse, response.json()) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -261,7 +261,7 @@ def get_long_running_output(pipeline_response): "str", response.headers.get("Operation-Location") ) - deserialized = _deserialize(_models.RadiologyInsightsJob, response.json().get("result")) + deserialized = _deserialize(_models.RadiologyInsightsJob, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/_patch.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/_patch.py index 455941122974..8bcb627aa475 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/_patch.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/_patch.py @@ -1,12 +1,12 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - from typing import List __all__: List[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_patch.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_patch.py index 1a00f5c523e0..8bcb627aa475 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_patch.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_patch.py @@ -1,281 +1,15 @@ -# pylint: disable=too-many-lines, protected-access -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import ( - Any, - Callable, - Dict, - IO, - TYPE_CHECKING, - List, - Optional, - Awaitable, - TypeVar, - Union, - cast, - overload, - MutableMapping, -) # pylint: disable=line-too-long +from typing import List -from azure.core.pipeline import PipelineResponse -from azure.core.credentials import AzureKeyCredential -from azure.core.polling import AsyncLROPoller, AsyncPollingMethod, AsyncNoPolling -from azure.core.polling.async_base_polling import AsyncLROBasePolling -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ._client import RadiologyInsightsClient as _RadiologyInsightsClient -from .._model_base import _deserialize -from .. import models as _models - - -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class RadiologyInsightsClient: # pylint: disable=client-accepts-api-version-keyword - """RadiologyInsightsClient. - - :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: - https://westus2.api.cognitive.microsoft.com). Required. - :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Is either a - AzureKeyCredential type or a TokenCredential type. Required. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2024-04-01". - Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any - ) -> None: # pylint: disable=line-too-long - self._client = _RadiologyInsightsClient(endpoint=endpoint, credential=credential, **kwargs) - - @overload # type: ignore[override] - async def begin_infer_radiology_insights( - self, - id: str, - resource: _models.RadiologyInsightsJob, - *, - expand: Optional[List[str]] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RadiologyInsightsInferenceResult]: - # pylint: disable=line-too-long - """Create Radiology Insights inference result. - - Creates a Radiology Insights inference result with the given request body. - - :param id: The unique ID of the inference result. Required. - :type id: str - :param resource: The resource instance. Required. - :type resource: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob - :keyword expand: Expand the indicated resources into the response. Default value is None. - :paramtype expand: list[str] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult] - :raises ~azure.core.exceptions.HttpResponseError:""" - - @overload # type: ignore[override] - async def begin_infer_radiology_insights( - self, - id: str, - resource: JSON, - *, - expand: Optional[List[str]] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RadiologyInsightsInferenceResult]: - # pylint: disable=line-too-long - """Create Radiology Insights inference result. - - Creates a Radiology Insights inference result with the given request body. - - :param id: The unique ID of the inference result. Required. - :type id: str - :param resource: The resource instance. Required. - :type resource: JSON - :keyword expand: Expand the indicated resources into the response. Default value is None. - :paramtype expand: list[str] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload # type: ignore[override] - async def begin_infer_radiology_insights( - self, - id: str, - resource: IO[bytes], - *, - expand: Optional[List[str]] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RadiologyInsightsInferenceResult]: - # pylint: disable=line-too-long - """Create Radiology Insights inference result. - - Creates a Radiology Insights inference result with the given request body. - - :param id: The unique ID of the inference result. Required. - :type id: str - :param resource: The resource instance. Required. - :type resource: IO[bytes] - :keyword expand: Expand the indicated resources into the response. Default value is None. - :paramtype expand: list[str] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async # type: ignore[override] - async def begin_infer_radiology_insights( - self, - id: str, - resource: Union[_models.RadiologyInsightsJob, JSON, IO[bytes]], - *, - expand: Optional[List[str]] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.RadiologyInsightsInferenceResult]: - # pylint: disable=line-too-long - """Create Radiology Insights inference result. - - Creates a Radiology Insights inference result with the given request body. - - :param id: The unique ID of the inference result. Required. - :type id: str - :param resource: The resource instance. Is one of the following types: RadiologyInsightsJob, JSON, IO[bytes] Required. - :type resource: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob or JSON or IO[bytes] - :keyword expand: Expand the indicated resources into the response. Default value is None. - :paramtype expand: list[str] - :return: An instance of AsyncLROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult] - :raises ~azure.core.exceptions.HttpResponseError: - - """ - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RadiologyInsightsJob] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop( - "polling_interval", self._client._config.polling_interval - ) # pylint: disable=protected-access - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._client._infer_radiology_insights_initial( # pylint: disable=protected-access - id=id, - resource=resource, - expand=expand, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["x-ms-request-id"] = self._client._deserialize( - "str", response.headers.get("x-ms-request-id") - ) # pylint: disable=protected-access - response_headers["Operation-Location"] = self._client._deserialize( - "str", response.headers.get("Operation-Location") - ) # pylint: disable=protected-access - deserialized = _deserialize(_models.RadiologyInsightsInferenceResult, response.json().get("result")) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._client._serialize.url( - "self._client._config.endpoint", self._client._config.endpoint, "str", skip_quote=True - ), # pylint: disable=protected-access - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.RadiologyInsightsInferenceResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - - return AsyncLROPoller[_models.RadiologyInsightsInferenceResult]( - self._client._client, raw_result, get_long_running_output, polling_method # type: ignore # pylint: disable=protected-access - ) - - def send_request( - self, request: HttpRequest, *, stream: bool = False, **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client.send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - return self._client.send_request(request, stream=stream, **kwargs) # type: ignore - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "RadiologyInsightsClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) - - -__all__: List[str] = [ - "RadiologyInsightsClient" -] # Add all objects you want publicly available to users at this package level +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_vendor.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_vendor.py deleted file mode 100644 index e2c3b938b89d..000000000000 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_vendor.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from abc import ABC -from typing import TYPE_CHECKING - -from ._configuration import RadiologyInsightsClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import AsyncPipelineClient - - from .._serialization import Deserializer, Serializer - - -class RadiologyInsightsClientMixinABC(ABC): - """DO NOT use this class. It is for internal typing use only.""" - - _client: "AsyncPipelineClient" - _config: RadiologyInsightsClientConfiguration - _serialize: "Serializer" - _deserialize: "Deserializer" diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/__init__.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/__init__.py index 0d91f6e06980..cb8b1bb767e1 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/__init__.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/__init__.py @@ -5,85 +5,108 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models import AgeMismatchInference -from ._models import Annotation -from ._models import CodeableConcept -from ._models import Coding -from ._models import CompleteOrderDiscrepancyInference -from ._models import CriticalResult -from ._models import CriticalResultInference -from ._models import DocumentAdministrativeMetadata -from ._models import DocumentAuthor -from ._models import DocumentContent -from ._models import DomainResource -from ._models import Element -from ._models import Extension -from ._models import FindingInference -from ._models import FindingOptions -from ._models import FollowupCommunicationInference -from ._models import FollowupRecommendationInference -from ._models import FollowupRecommendationOptions -from ._models import GenericProcedureRecommendation -from ._models import HealthInsightsErrorResponse -from ._models import Identifier -from ._models import ImagingProcedure -from ._models import ImagingProcedureRecommendation -from ._models import LateralityDiscrepancyInference -from ._models import LimitedOrderDiscrepancyInference -from ._models import Meta -from ._models import Narrative -from ._models import Observation -from ._models import ObservationComponent -from ._models import ObservationReferenceRange -from ._models import OrderedProcedure -from ._models import PatientDetails -from ._models import PatientDocument -from ._models import PatientEncounter -from ._models import PatientRecord -from ._models import Period -from ._models import ProcedureRecommendation -from ._models import Quantity -from ._models import RadiologyCodeWithTypes -from ._models import RadiologyInsightsData -from ._models import RadiologyInsightsInference -from ._models import RadiologyInsightsInferenceOptions -from ._models import RadiologyInsightsInferenceResult -from ._models import RadiologyInsightsJob -from ._models import RadiologyInsightsModelConfiguration -from ._models import RadiologyInsightsPatientResult -from ._models import RadiologyProcedureInference -from ._models import Range -from ._models import Ratio -from ._models import RecommendationFinding -from ._models import Reference -from ._models import Resource -from ._models import SampledData -from ._models import SexMismatchInference -from ._models import TimePeriod +from typing import TYPE_CHECKING -from ._enums import ClinicalDocumentType -from ._enums import ContactPointSystem -from ._enums import ContactPointUse -from ._enums import DocumentContentSourceType -from ._enums import DocumentType -from ._enums import EncounterClass -from ._enums import JobStatus -from ._enums import LateralityDiscrepancyType -from ._enums import MedicalProfessionalType -from ._enums import ObservationStatusCodeType -from ._enums import PatientSex -from ._enums import RadiologyInsightsInferenceType -from ._enums import RecommendationFindingStatusType -from ._enums import ResearchStudyStatusCodeType -from ._enums import SpecialtyType +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + AgeMismatchInference, + Annotation, + AssessmentValueRange, + CodeableConcept, + Coding, + CompleteOrderDiscrepancyInference, + CriticalResult, + CriticalResultInference, + DocumentAdministrativeMetadata, + DocumentAuthor, + DocumentContent, + DomainResource, + Element, + Extension, + FindingInference, + FindingOptions, + FollowupCommunicationInference, + FollowupRecommendationInference, + FollowupRecommendationOptions, + GenericProcedureRecommendation, + GuidanceInference, + GuidanceOptions, + HealthInsightsErrorResponse, + Identifier, + ImagingProcedure, + ImagingProcedureRecommendation, + LateralityDiscrepancyInference, + LimitedOrderDiscrepancyInference, + Meta, + Narrative, + Observation, + ObservationComponent, + ObservationReferenceRange, + OrderedProcedure, + PatientDetails, + PatientDocument, + PatientEncounter, + PatientRecord, + Period, + PresentGuidanceInformation, + ProcedureRecommendation, + QualityMeasureInference, + QualityMeasureOptions, + Quantity, + RadiologyCodeWithTypes, + RadiologyInsightsData, + RadiologyInsightsInference, + RadiologyInsightsInferenceOptions, + RadiologyInsightsInferenceResult, + RadiologyInsightsJob, + RadiologyInsightsModelConfiguration, + RadiologyInsightsPatientResult, + RadiologyProcedureInference, + Range, + Ratio, + RecommendationFinding, + Reference, + Resource, + SampledData, + ScoringAndAssessmentInference, + SexMismatchInference, + TimePeriod, +) + +from ._enums import ( # type: ignore + ClinicalDocumentType, + ContactPointSystem, + ContactPointUse, + DocumentContentSourceType, + DocumentType, + EncounterClass, + GuidanceRankingType, + JobStatus, + LateralityDiscrepancyType, + MedicalProfessionalType, + ObservationStatusCodeType, + PatientSex, + QualityMeasureComplianceType, + QualityMeasureType, + RadiologyInsightsInferenceType, + RecommendationFindingStatusType, + ResearchStudyStatusCodeType, + ScoringAndAssessmentCategoryType, + SpecialtyType, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "AgeMismatchInference", "Annotation", + "AssessmentValueRange", "CodeableConcept", "Coding", "CompleteOrderDiscrepancyInference", @@ -101,6 +124,8 @@ "FollowupRecommendationInference", "FollowupRecommendationOptions", "GenericProcedureRecommendation", + "GuidanceInference", + "GuidanceOptions", "HealthInsightsErrorResponse", "Identifier", "ImagingProcedure", @@ -118,7 +143,10 @@ "PatientEncounter", "PatientRecord", "Period", + "PresentGuidanceInformation", "ProcedureRecommendation", + "QualityMeasureInference", + "QualityMeasureOptions", "Quantity", "RadiologyCodeWithTypes", "RadiologyInsightsData", @@ -135,6 +163,7 @@ "Reference", "Resource", "SampledData", + "ScoringAndAssessmentInference", "SexMismatchInference", "TimePeriod", "ClinicalDocumentType", @@ -143,15 +172,19 @@ "DocumentContentSourceType", "DocumentType", "EncounterClass", + "GuidanceRankingType", "JobStatus", "LateralityDiscrepancyType", "MedicalProfessionalType", "ObservationStatusCodeType", "PatientSex", + "QualityMeasureComplianceType", + "QualityMeasureType", "RadiologyInsightsInferenceType", "RecommendationFindingStatusType", "ResearchStudyStatusCodeType", + "ScoringAndAssessmentCategoryType", "SpecialtyType", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_enums.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_enums.py index b0d874d8dc4e..f7044f8ba181 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_enums.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_enums.py @@ -25,7 +25,8 @@ class ClinicalDocumentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ContactPointSystem(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Contact Point System - see https://www.hl7.org/fhir/R4/valueset-contact-point-system.html. + see `https://www.hl7.org/fhir/R4/valueset-contact-point-system.html + `_. """ PHONE = "phone" @@ -46,7 +47,8 @@ class ContactPointSystem(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ContactPointUse(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Contact Point Use - See: http://hl7.org/fhir/ValueSet/contact-point-use. + See: `http://hl7.org/fhir/ValueSet/contact-point-use + `_. """ HOME = "home" @@ -113,6 +115,15 @@ class EncounterClass(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Healthcare encounter that takes place in the residence of the patient or a designee""" +class GuidanceRankingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Refers to how important a clinical guidance is.""" + + HIGH = "high" + """high""" + LOW = "low" + """low""" + + class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The status of the processing job.""" @@ -185,6 +196,70 @@ class PatientSex(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNSPECIFIED = "unspecified" +class QualityMeasureComplianceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether the document is compliant.""" + + NOT_ELIGIBLE = "notEligible" + """not eligible""" + PERFORMANCE_NOT_MET = "performanceNotMet" + """performance not met""" + PERFORMANCE_MET = "performanceMet" + """performance met""" + DENOMINATOR_EXCEPTION = "denominatorException" + """denominator exception""" + + +class QualityMeasureType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Mips types that can be checked by the engine.""" + + MIPS76 = "mips76" + """Mips 76""" + MIPS147 = "mips147" + """Mips 147""" + MIPS195 = "mips195" + """Mips 195""" + MIPS360 = "mips360" + """Mips 360""" + MIPS364 = "mips364" + """Mips 364""" + MIPS405 = "mips405" + """Mips 405""" + MIPS406 = "mips406" + """Mips 406""" + MIPS436 = "mips436" + """Mips 436""" + MIPS145 = "mips145" + """Mips 145""" + ACRAD36 = "acrad36" + """Acrad 36""" + ACRAD37 = "acrad37" + """Acrad 37""" + ACRAD38 = "acrad38" + """Acrad 38""" + ACRAD39 = "acrad39" + """Acrad 39""" + ACRAD40 = "acrad40" + """Acrad 40""" + ACRAD41 = "acrad41" + """Acrad 41""" + ACRAD42 = "acrad42" + """Acrad 42""" + MEDNAX55 = "mednax55" + """Mednax55""" + MSN13 = "msn13" + """Msn13""" + MSN15 = "msn15" + """Msn15""" + QMM26 = "qmm26" + """Qmm26""" + QMM17 = "qmm17" + """Qmm17""" + QMM18 = "qmm18" + """Qmm18""" + QMM19 = "qmm19" + """Qmm19""" + + class RadiologyInsightsInferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A Radiology Insights inference types.""" @@ -208,6 +283,12 @@ class RadiologyInsightsInferenceType(str, Enum, metaclass=CaseInsensitiveEnumMet """Followup Communication inference type""" RADIOLOGY_PROCEDURE = "radiologyProcedure" """Radiology Procedure inference type""" + SCORING_AND_ASSESSMENT = "scoringAndAssessment" + """Scoring and assessment inference type""" + GUIDANCE = "guidance" + """Guidance inference type""" + QUALITY_MEASURE = "qualityMeasure" + """Guidance measure inference type""" class RecommendationFindingStatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -224,7 +305,9 @@ class RecommendationFindingStatusType(str, Enum, metaclass=CaseInsensitiveEnumMe class ResearchStudyStatusCodeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """https://www.hl7.org/fhir/R4/codesystem-research-study-status.html.""" + """`https://www.hl7.org/fhir/R4/codesystem-research-study-status.html + `_. + """ ACTIVE = "active" """The study is open for accrual.""" @@ -256,6 +339,79 @@ class ResearchStudyStatusCodeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Protocol was withdrawn by the lead organization.""" +class ScoringAndAssessmentCategoryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The category that gets a value, e.g. BIRADS, Z-SCORE or FRAX SCORE.""" + + BIRADS = "BIRADS" + """BIRADS""" + C_RADS_COLONIC_FINDINGS = "C-RADS COLONIC FINDINGS" + """C-RADS COLONIC FINDINGS""" + CAD_RADS = "CAD-RADS" + """CAD-RADS""" + LI_RADS = "LI-RADS" + """LI-RADS""" + LUNG_RADS = "LUNG-RADS" + """LUNG-RADS""" + NI_RADS = "NI-RADS" + """NI-RADS""" + O_RADS = "O-RADS" + """O-RADS""" + PI_RADS = "PI-RADS" + """PI-RADS""" + TI_RADS = "TI-RADS" + """TI-RADS""" + C_RADS_EXTRACOLONIC_FINDINGS = "C-RADS EXTRACOLONIC FINDINGS" + """C-RADS EXTRACOLONIC FINDINGS""" + LIFETIME_BREAST_CANCER_RISK = "LIFETIME BREAST CANCER RISK" + """LIFETIME BREAST CANCER RISK""" + ASCVD_RISK = "ASCVD RISK" + """ASCVD RISK""" + MODIFIED_GAIL_MODEL_RISK = "MODIFIED GAIL MODEL RISK" + """MODIFIED GAIL MODEL RISK""" + TYRER_CUSICK_MODEL_RISK = "TYRER CUSICK MODEL RISK" + """TYRER CUSICK MODEL RISK""" + AGATSTON_SCORE = "AGATSTON SCORE" + """AGATSTON SCORE""" + TEN_YEAR_CHD_RISK = "10 YEAR CHD RISK" + """10 YEAR CHD RISK""" + Z_SCORE = "Z-SCORE" + """Z-SCORE""" + T_SCORE = "T-SCORE" + """T-SCORE""" + CALCIUM_VOLUME_SCORE = "CALCIUM VOLUME SCORE" + """CALCIUM VOLUME SCORE""" + US_LI_RADS_VISUALIZATION_SCORE = "US LI-RADS VISUALIZATION SCORE" + """US LI-RADS VISUALIZATION SCORE""" + US_LI_RADS = "US LI-RADS" + """US LI-RADS""" + CEUS_LI_RADS = "CEUS LI-RADS" + """CEUS LI-RADS""" + TREATMENT_RESPONSE_LI_RADS = "TREATMENT RESPONSE LI-RADS" + """TREATMENT RESPONSE LI-RADS""" + O_RADS_MRI = "O-RADS MRI" + """O-RADS MRI""" + CALCIUM_MASS_SCORE = "CALCIUM MASS SCORE" + """CALCIUM MASS SCORE""" + RISK_OF_MALIGNANCY_INDEX = "RISK OF MALIGNANCY INDEX" + """RISK OF MALIGNANCY INDEX""" + HNPCC_MUTATION_RISK = "HNPCC MUTATION RISK" + """HNPCC MUTATION RISK""" + ALBERTA_STROKE_PROGRAM_EARLY_CT_SCORE = "ALBERTA STROKE PROGRAM EARLY CT SCORE" + """ALBERTA STROKE PROGRAM EARLY CT SCORE""" + KELLGREN_LAWRENCE_GRADING_SCALE = "KELLGREN-LAWRENCE GRADING SCALE" + """KELLGREN-LAWRENCE GRADING SCALE""" + TONNIS_CLASSIFICATION = "TONNIS CLASSIFICATION" + """TONNIS CLASSIFICATION""" + CALCIUM_SCORE_UNSPECIFIED = "CALCIUM SCORE (UNSPECIFIED)" + """CALCIUM SCORE (UNSPECIFIED)""" + TEN_YEAR_CHD_RISK_OBSERVED_AGE = "10 YEAR CHD RISK (OBSERVED AGE)" + """10 YEAR CHD RISK (OBSERVED AGE)""" + TEN_YEAR_CHD_RISK_ARTERIAL_AGE = "10 YEAR CHD RISK (ARTERIAL AGE)" + """10 YEAR CHD RISK (ARTERIAL AGE)""" + FRAX_SCORE = "FRAX SCORE" + """FRAX SCORE""" + + class SpecialtyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Known values codes that can be used to indicate the type of the Specialty.""" diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_models.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_models.py index 5394f78299e0..25215d360932 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_models.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_models.py @@ -1,30 +1,28 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 -# pylint: disable=too-many-lines, line-too-long # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation import datetime from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload -from azure.core.exceptions import HttpResponseError +from azure.core.exceptions import ODataV4Format -from .. import _model_base -from .._model_base import rest_discriminator, rest_field +from .._utils.model_base import Model as _Model, rest_discriminator, rest_field from ._enums import RadiologyInsightsInferenceType if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models -class RadiologyInsightsInference(_model_base.Model): +class RadiologyInsightsInference(_Model): """An inference made by the Radiology Insights model regarding a patient. - * AgeMismatch * SexMismatch * LateralityDiscrepancy @@ -39,27 +37,31 @@ class RadiologyInsightsInference(_model_base.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AgeMismatchInference, CompleteOrderDiscrepancyInference, CriticalResultInference, FindingInference, FollowupCommunicationInference, FollowupRecommendationInference, - LateralityDiscrepancyInference, LimitedOrderDiscrepancyInference, RadiologyProcedureInference, + GuidanceInference, LateralityDiscrepancyInference, LimitedOrderDiscrepancyInference, + QualityMeasureInference, RadiologyProcedureInference, ScoringAndAssessmentInference, SexMismatchInference - :ivar kind: Discriminator property for RadiologyInsightsInference. Required. Known values are: "ageMismatch", "lateralityDiscrepancy", "sexMismatch", "completeOrderDiscrepancy", "limitedOrderDiscrepancy", "finding", "criticalResult", "followupRecommendation", - "followupCommunication", and "radiologyProcedure". + "followupCommunication", "radiologyProcedure", "scoringAndAssessment", "guidance", and + "qualityMeasure". :vartype kind: str or ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceType :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] """ - __mapping__: Dict[str, _model_base.Model] = {} + __mapping__: Dict[str, _Model] = {} kind: str = rest_discriminator(name="kind") """Discriminator property for RadiologyInsightsInference. Required. Known values are: \"ageMismatch\", \"lateralityDiscrepancy\", \"sexMismatch\", \"completeOrderDiscrepancy\", \"limitedOrderDiscrepancy\", \"finding\", \"criticalResult\", \"followupRecommendation\", - \"followupCommunication\", and \"radiologyProcedure\".""" - extension: Optional[List["_models.Extension"]] = rest_field() + \"followupCommunication\", \"radiologyProcedure\", \"scoringAndAssessment\", \"guidance\", and + \"qualityMeasure\".""" + extension: Optional[List["_models.Extension"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Additional Content defined by implementations.""" @overload @@ -68,16 +70,16 @@ def __init__( *, kind: str, extension: Optional[List["_models.Extension"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -85,14 +87,13 @@ class AgeMismatchInference(RadiologyInsightsInference, discriminator="ageMismatc """A notification for age mismatch is displayed when the age mentioned in a document for a specific patient does not match the age specified in the patient information. - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Age mismatch inference type :vartype kind: str or ~azure.healthinsights.radiologyinsights.models.AGE_MISMATCH """ - kind: Literal[RadiologyInsightsInferenceType.AGE_MISMATCH] = rest_discriminator(name="kind") # type: ignore + kind: Literal[RadiologyInsightsInferenceType.AGE_MISMATCH] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Inference type. Required. Age mismatch inference type""" @overload @@ -100,22 +101,22 @@ def __init__( self, *, extension: Optional[List["_models.Extension"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=RadiologyInsightsInferenceType.AGE_MISMATCH, **kwargs) -class Element(_model_base.Model): +class Element(_Model): """The base definition for all elements contained inside a resource. - Based on `FHIR Element `__. + Based on `FHIR Element `_. :ivar id: Unique id for inter-element referencing. :vartype id: str @@ -123,9 +124,11 @@ class Element(_model_base.Model): :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] """ - id: Optional[str] = rest_field() + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Unique id for inter-element referencing.""" - extension: Optional[List["_models.Extension"]] = rest_field() + extension: Optional[List["_models.Extension"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Additional Content defined by implementations.""" @overload @@ -134,16 +137,16 @@ def __init__( *, id: Optional[str] = None, # pylint: disable=redefined-builtin extension: Optional[List["_models.Extension"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -151,7 +154,6 @@ class Annotation(Element): """A text note which also contains information about who made the statement and when Based on `FHIR Annotation `_. - :ivar id: Unique id for inter-element referencing. :vartype id: str :ivar extension: Additional Content defined by implementations. @@ -164,11 +166,13 @@ class Annotation(Element): :vartype text: str """ - author_string: Optional[str] = rest_field(name="authorString") + author_string: Optional[str] = rest_field( + name="authorString", visibility=["read", "create", "update", "delete", "query"] + ) """Individual responsible for the annotation.""" - time: Optional[str] = rest_field() + time: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """When the annotation was made.""" - text: str = rest_field() + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The annotation - text content (as markdown). Required.""" @overload @@ -180,16 +184,49 @@ def __init__( extension: Optional[List["_models.Extension"]] = None, author_string: Optional[str] = None, time: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AssessmentValueRange(_Model): + """A range of values. + + :ivar minimum: The minimum value. Required. + :vartype minimum: str + :ivar maximum: The maximum value. Required. + :vartype maximum: str + """ + + minimum: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The minimum value. Required.""" + maximum: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum value. Required.""" + + @overload + def __init__( + self, + *, + minimum: str, + maximum: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -203,9 +240,9 @@ class CodeableConcept(Element): :vartype text: str """ - coding: Optional[List["_models.Coding"]] = rest_field() + coding: Optional[List["_models.Coding"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Code defined by a terminology system.""" - text: Optional[str] = rest_field() + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Plain text representation of the concept.""" @overload @@ -214,16 +251,16 @@ def __init__( *, coding: Optional[List["_models.Coding"]] = None, text: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -245,13 +282,13 @@ class Coding(Element): :vartype display: str """ - system: Optional[str] = rest_field() + system: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Identity of the terminology system.""" - version: Optional[str] = rest_field() + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Version of the system - if relevant.""" - code: Optional[str] = rest_field() + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Symbol in syntax defined by the system.""" - display: Optional[str] = rest_field() + display: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Representation defined by the system.""" @overload @@ -264,16 +301,16 @@ def __init__( version: Optional[str] = None, code: Optional[str] = None, display: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -281,7 +318,6 @@ class CompleteOrderDiscrepancyInference(RadiologyInsightsInference, discriminato """A complete order discrepancy is shown when one or more body parts and/or measurements that should be in the document (because there is a complete order) are not present. - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Complete order discrepancy inference type @@ -299,15 +335,19 @@ class CompleteOrderDiscrepancyInference(RadiologyInsightsInference, discriminato list[~azure.healthinsights.radiologyinsights.models.CodeableConcept] """ - kind: Literal[RadiologyInsightsInferenceType.COMPLETE_ORDER_DISCREPANCY] = rest_discriminator(name="kind") # type: ignore # pylint: disable=line-too-long + kind: Literal[RadiologyInsightsInferenceType.COMPLETE_ORDER_DISCREPANCY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Inference type. Required. Complete order discrepancy inference type""" - order_type: "_models.CodeableConcept" = rest_field(name="orderType") + order_type: "_models.CodeableConcept" = rest_field( + name="orderType", visibility=["read", "create", "update", "delete", "query"] + ) """Order type : CPT ultrasound complete code for abdomen, retroperitoneal, pelvis or breast. Required.""" - missing_body_parts: Optional[List["_models.CodeableConcept"]] = rest_field(name="missingBodyParts") + missing_body_parts: Optional[List["_models.CodeableConcept"]] = rest_field( + name="missingBodyParts", visibility=["read", "create", "update", "delete", "query"] + ) """List of missing body parts required by a complete order : SNOMED CT codes.""" missing_body_part_measurements: Optional[List["_models.CodeableConcept"]] = rest_field( - name="missingBodyPartMeasurements" + name="missingBodyPartMeasurements", visibility=["read", "create", "update", "delete", "query"] ) """List of missing body parts that require measurement by a complete order : SNOMED CT codes.""" @@ -319,32 +359,31 @@ def __init__( extension: Optional[List["_models.Extension"]] = None, missing_body_parts: Optional[List["_models.CodeableConcept"]] = None, missing_body_part_measurements: Optional[List["_models.CodeableConcept"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=RadiologyInsightsInferenceType.COMPLETE_ORDER_DISCREPANCY, **kwargs) -class CriticalResult(_model_base.Model): +class CriticalResult(_Model): """Critical Result consists of two properties. - :ivar description: Description : medical problem. Required. :vartype description: str :ivar finding: Finding linked to the critical result. :vartype finding: ~azure.healthinsights.radiologyinsights.models.Observation """ - description: str = rest_field() + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Description : medical problem. Required.""" - finding: Optional["_models.Observation"] = rest_field() + finding: Optional["_models.Observation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Finding linked to the critical result.""" @overload @@ -353,16 +392,16 @@ def __init__( *, description: str, finding: Optional["_models.Observation"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -370,7 +409,6 @@ class CriticalResultInference(RadiologyInsightsInference, discriminator="critica """Critical results refer to findings of utmost importance that may require timely attention due to their potential impact on patient care. - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Critical finding inference type @@ -380,9 +418,9 @@ class CriticalResultInference(RadiologyInsightsInference, discriminator="critica :vartype result: ~azure.healthinsights.radiologyinsights.models.CriticalResult """ - kind: Literal[RadiologyInsightsInferenceType.CRITICAL_RESULT] = rest_discriminator(name="kind") # type: ignore + kind: Literal[RadiologyInsightsInferenceType.CRITICAL_RESULT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Inference type. Required. Critical finding inference type""" - result: "_models.CriticalResult" = rest_field() + result: "_models.CriticalResult" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The complete Critical Result, as outlined below, will be reused for the recommendation. Required.""" @@ -392,20 +430,20 @@ def __init__( *, result: "_models.CriticalResult", extension: Optional[List["_models.Extension"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=RadiologyInsightsInferenceType.CRITICAL_RESULT, **kwargs) -class DocumentAdministrativeMetadata(_model_base.Model): +class DocumentAdministrativeMetadata(_Model): """Document administrative metadata. :ivar ordered_procedures: List of procedure information associated with the document. @@ -415,9 +453,13 @@ class DocumentAdministrativeMetadata(_model_base.Model): :vartype encounter_id: str """ - ordered_procedures: Optional[List["_models.OrderedProcedure"]] = rest_field(name="orderedProcedures") + ordered_procedures: Optional[List["_models.OrderedProcedure"]] = rest_field( + name="orderedProcedures", visibility=["read", "create", "update", "delete", "query"] + ) """List of procedure information associated with the document.""" - encounter_id: Optional[str] = rest_field(name="encounterId") + encounter_id: Optional[str] = rest_field( + name="encounterId", visibility=["read", "create", "update", "delete", "query"] + ) """Reference to the encounter associated with the document.""" @overload @@ -426,20 +468,20 @@ def __init__( *, ordered_procedures: Optional[List["_models.OrderedProcedure"]] = None, encounter_id: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DocumentAuthor(_model_base.Model): +class DocumentAuthor(_Model): """Document author. :ivar id: author id. @@ -448,9 +490,9 @@ class DocumentAuthor(_model_base.Model): :vartype full_name: str """ - id: Optional[str] = rest_field() + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """author id.""" - full_name: Optional[str] = rest_field(name="fullName") + full_name: Optional[str] = rest_field(name="fullName", visibility=["read", "create", "update", "delete", "query"]) """Text representation of the full name.""" @overload @@ -459,23 +501,22 @@ def __init__( *, id: Optional[str] = None, # pylint: disable=redefined-builtin full_name: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DocumentContent(_model_base.Model): +class DocumentContent(_Model): """The content of the patient document. - :ivar source_type: The type of the content's source. In case the source type is 'inline', the content is given as a string (for instance, text). In case the source type is 'reference', the content is given as a URI. Required. Known values @@ -487,12 +528,14 @@ class DocumentContent(_model_base.Model): :vartype value: str """ - source_type: Union[str, "_models.DocumentContentSourceType"] = rest_field(name="sourceType") + source_type: Union[str, "_models.DocumentContentSourceType"] = rest_field( + name="sourceType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of the content's source. In case the source type is 'inline', the content is given as a string (for instance, text). In case the source type is 'reference', the content is given as a URI. Required. Known values are: \"inline\" and \"reference\".""" - value: str = rest_field() + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The content of the document, given either inline (as a string) or as a reference (URI). Required.""" @@ -502,24 +545,24 @@ def __init__( *, source_type: Union[str, "_models.DocumentContentSourceType"], value: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Resource(_model_base.Model): +class Resource(_Model): """Resource is the ancestor of DomainResource from which most resources are derived. Bundle, Parameters, and Binary extend Resource directly. - Based on [FHIR Resource](https://www.hl7.org/fhir/r4/resource.html. - + Based on [FHIR Resource](`https://www.hl7.org/fhir/r4/resource.html + `_. :ivar resource_type: The type of resource. Required. :vartype resource_type: str @@ -533,15 +576,17 @@ class Resource(_model_base.Model): :vartype language: str """ - resource_type: str = rest_field(name="resourceType") + resource_type: str = rest_field(name="resourceType", visibility=["read", "create", "update", "delete", "query"]) """The type of resource. Required.""" - id: Optional[str] = rest_field() + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource Id.""" - meta: Optional["_models.Meta"] = rest_field() + meta: Optional["_models.Meta"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Metadata about the resource.""" - implicit_rules: Optional[str] = rest_field(name="implicitRules") + implicit_rules: Optional[str] = rest_field( + name="implicitRules", visibility=["read", "create", "update", "delete", "query"] + ) """A set of rules under which this content was created.""" - language: Optional[str] = rest_field() + language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Language of the resource content.""" @overload @@ -553,16 +598,16 @@ def __init__( meta: Optional["_models.Meta"] = None, implicit_rules: Optional[str] = None, language: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -573,7 +618,6 @@ class DomainResource(Resource): You probably want to use the sub-classes and not this class directly. Known sub-classes are: Condition, Observation, ResearchStudy - :ivar id: Resource Id. :vartype id: str :ivar meta: Metadata about the resource. @@ -595,16 +639,22 @@ class DomainResource(Resource): :vartype modifier_extension: list[~azure.healthinsights.radiologyinsights.models.Extension] """ - __mapping__: Dict[str, _model_base.Model] = {} + __mapping__: Dict[str, _Model] = {} resource_type: str = rest_discriminator(name="resourceType") """Discriminator property for DomainResource. Required. Default value is None.""" - text: Optional["_models.Narrative"] = rest_field() + text: Optional["_models.Narrative"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Text summary of the resource, for human interpretation.""" - contained: Optional[List["_models.Resource"]] = rest_field() + contained: Optional[List["_models.Resource"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Contained, inline Resources.""" - extension: Optional[List["_models.Extension"]] = rest_field() + extension: Optional[List["_models.Extension"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Additional Content defined by implementations.""" - modifier_extension: Optional[List["_models.Extension"]] = rest_field(name="modifierExtension") + modifier_extension: Optional[List["_models.Extension"]] = rest_field( + name="modifierExtension", visibility=["read", "create", "update", "delete", "query"] + ) """Extensions that cannot be ignored.""" @overload @@ -620,23 +670,22 @@ def __init__( contained: Optional[List["_models.Resource"]] = None, extension: Optional[List["_models.Extension"]] = None, modifier_extension: Optional[List["_models.Extension"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Extension(Element): # pylint: disable=too-many-instance-attributes +class Extension(Element): """Base for all elements - Based on `FHIR Element `_. - + Based on `FHIR Element `_. :ivar url: Source of the definition for the extension code - a logical name or a URL. Required. :vartype url: str @@ -666,31 +715,55 @@ class Extension(Element): # pylint: disable=too-many-instance-attributes :vartype value_reference: ~azure.healthinsights.radiologyinsights.models.Reference """ - url: str = rest_field() + url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Source of the definition for the extension code - a logical name or a URL. Required.""" - value_quantity: Optional["_models.Quantity"] = rest_field(name="valueQuantity") + value_quantity: Optional["_models.Quantity"] = rest_field( + name="valueQuantity", visibility=["read", "create", "update", "delete", "query"] + ) """Value as Quantity.""" - value_codeable_concept: Optional["_models.CodeableConcept"] = rest_field(name="valueCodeableConcept") + value_codeable_concept: Optional["_models.CodeableConcept"] = rest_field( + name="valueCodeableConcept", visibility=["read", "create", "update", "delete", "query"] + ) """Value as CodeableConcept.""" - value_string: Optional[str] = rest_field(name="valueString") + value_string: Optional[str] = rest_field( + name="valueString", visibility=["read", "create", "update", "delete", "query"] + ) """Value as string.""" - value_boolean: Optional[bool] = rest_field(name="valueBoolean") + value_boolean: Optional[bool] = rest_field( + name="valueBoolean", visibility=["read", "create", "update", "delete", "query"] + ) """Value as boolean.""" - value_integer: Optional[int] = rest_field(name="valueInteger") + value_integer: Optional[int] = rest_field( + name="valueInteger", visibility=["read", "create", "update", "delete", "query"] + ) """Value as integer.""" - value_range: Optional["_models.Range"] = rest_field(name="valueRange") + value_range: Optional["_models.Range"] = rest_field( + name="valueRange", visibility=["read", "create", "update", "delete", "query"] + ) """Value as Range.""" - value_ratio: Optional["_models.Ratio"] = rest_field(name="valueRatio") + value_ratio: Optional["_models.Ratio"] = rest_field( + name="valueRatio", visibility=["read", "create", "update", "delete", "query"] + ) """Value as Ratio.""" - value_sampled_data: Optional["_models.SampledData"] = rest_field(name="valueSampledData") + value_sampled_data: Optional["_models.SampledData"] = rest_field( + name="valueSampledData", visibility=["read", "create", "update", "delete", "query"] + ) """Value as SampledData.""" - value_time: Optional[datetime.time] = rest_field(name="valueTime") + value_time: Optional[datetime.time] = rest_field( + name="valueTime", visibility=["read", "create", "update", "delete", "query"] + ) """Value as time (hh:mm:ss).""" - value_date_time: Optional[str] = rest_field(name="valueDateTime") + value_date_time: Optional[str] = rest_field( + name="valueDateTime", visibility=["read", "create", "update", "delete", "query"] + ) """Value as dateTime.""" - value_period: Optional["_models.Period"] = rest_field(name="valuePeriod") + value_period: Optional["_models.Period"] = rest_field( + name="valuePeriod", visibility=["read", "create", "update", "delete", "query"] + ) """Value as Period.""" - value_reference: Optional["_models.Reference"] = rest_field(name="valueReference") + value_reference: Optional["_models.Reference"] = rest_field( + name="valueReference", visibility=["read", "create", "update", "delete", "query"] + ) """Value as reference.""" @overload @@ -710,16 +783,16 @@ def __init__( value_date_time: Optional[str] = None, value_period: Optional["_models.Period"] = None, value_reference: Optional["_models.Reference"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -727,7 +800,6 @@ class FindingInference(RadiologyInsightsInference, discriminator="finding"): """Findings in a radiology report typically describe abnormalities, lesions, or other notable observations related to the anatomy or pathology of the imaged area. - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Finding inference type @@ -737,9 +809,9 @@ class FindingInference(RadiologyInsightsInference, discriminator="finding"): :vartype finding: ~azure.healthinsights.radiologyinsights.models.Observation """ - kind: Literal[RadiologyInsightsInferenceType.FINDING] = rest_discriminator(name="kind") # type: ignore + kind: Literal[RadiologyInsightsInferenceType.FINDING] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Inference type. Required. Finding inference type""" - finding: "_models.Observation" = rest_field() + finding: "_models.Observation" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Finding data : contains extensions, fields and components linked with the finding. Required.""" @overload @@ -748,20 +820,20 @@ def __init__( *, finding: "_models.Observation", extension: Optional[List["_models.Extension"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=RadiologyInsightsInferenceType.FINDING, **kwargs) -class FindingOptions(_model_base.Model): +class FindingOptions(_Model): """Finding options. :ivar provide_focused_sentence_evidence: If this is true, provide the sentence that contains @@ -771,7 +843,9 @@ class FindingOptions(_model_base.Model): :vartype provide_focused_sentence_evidence: bool """ - provide_focused_sentence_evidence: Optional[bool] = rest_field(name="provideFocusedSentenceEvidence") + provide_focused_sentence_evidence: Optional[bool] = rest_field( + name="provideFocusedSentenceEvidence", visibility=["read", "create", "update", "delete", "query"] + ) """If this is true, provide the sentence that contains the first token of the finding's clinical indicator (i.e. the medical problem), if there is one. This sentence is provided as an extension with url 'ci_sentence', next to the token evidence. Default is false.""" @@ -781,16 +855,16 @@ def __init__( self, *, provide_focused_sentence_evidence: Optional[bool] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -798,7 +872,6 @@ class FollowupCommunicationInference(RadiologyInsightsInference, discriminator=" """Follow-up communication involves the exchange of important information, recommendations, or updates between radiologists and other healthcare professionals involved in a patient's care. - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Followup Communication inference type @@ -812,13 +885,19 @@ class FollowupCommunicationInference(RadiologyInsightsInference, discriminator=" :vartype was_acknowledged: bool """ - kind: Literal[RadiologyInsightsInferenceType.FOLLOWUP_COMMUNICATION] = rest_discriminator(name="kind") # type: ignore + kind: Literal[RadiologyInsightsInferenceType.FOLLOWUP_COMMUNICATION] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Inference type. Required. Followup Communication inference type""" - communicated_at: Optional[List[datetime.datetime]] = rest_field(name="communicatedAt", format="rfc3339") + communicated_at: Optional[List[datetime.datetime]] = rest_field( + name="communicatedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """Communication date and time.""" - recipient: Optional[List[Union[str, "_models.MedicalProfessionalType"]]] = rest_field() + recipient: Optional[List[Union[str, "_models.MedicalProfessionalType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Recipient of the communication.""" - was_acknowledged: bool = rest_field(name="wasAcknowledged") + was_acknowledged: bool = rest_field( + name="wasAcknowledged", visibility=["read", "create", "update", "delete", "query"] + ) """Communication was acknowledged. Required.""" @overload @@ -829,16 +908,16 @@ def __init__( extension: Optional[List["_models.Extension"]] = None, communicated_at: Optional[List[datetime.datetime]] = None, recipient: Optional[List[Union[str, "_models.MedicalProfessionalType"]]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=RadiologyInsightsInferenceType.FOLLOWUP_COMMUNICATION, **kwargs) @@ -846,7 +925,6 @@ class FollowupRecommendationInference(RadiologyInsightsInference, discriminator= """Follow-up recommendations offer guidance to healthcare providers on managing and monitoring patients based on the findings of imaging studies. - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Recommendation inference type @@ -879,30 +957,38 @@ class FollowupRecommendationInference(RadiologyInsightsInference, discriminator= ~azure.healthinsights.radiologyinsights.models.ProcedureRecommendation """ - kind: Literal[RadiologyInsightsInferenceType.FOLLOWUP_RECOMMENDATION] = rest_discriminator(name="kind") # type: ignore + kind: Literal[RadiologyInsightsInferenceType.FOLLOWUP_RECOMMENDATION] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Inference type. Required. Recommendation inference type""" - effective_at: Optional[str] = rest_field(name="effectiveAt") + effective_at: Optional[str] = rest_field( + name="effectiveAt", visibility=["read", "create", "update", "delete", "query"] + ) """Date and time are displayed when the procedure is recommended to be done at a specific point in time.""" - effective_period: Optional["_models.Period"] = rest_field(name="effectivePeriod") + effective_period: Optional["_models.Period"] = rest_field( + name="effectivePeriod", visibility=["read", "create", "update", "delete", "query"] + ) """The period is shown if a specific period is mentioned, with a start and end date-time.""" - findings: Optional[List["_models.RecommendationFinding"]] = rest_field() + findings: Optional[List["_models.RecommendationFinding"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Findings related to the recommendation.""" - is_conditional: bool = rest_field(name="isConditional") + is_conditional: bool = rest_field(name="isConditional", visibility=["read", "create", "update", "delete", "query"]) """The conditional value indicates whether or not the sentence containing the recommendation includes a conditional statement. Keywords for conditional statements include 'if', 'when', 'unless', and so on. Required.""" - is_option: bool = rest_field(name="isOption") + is_option: bool = rest_field(name="isOption", visibility=["read", "create", "update", "delete", "query"]) """The option value indicates whether or not the sentence containing the recommendation includes an optional statement. Keywords for optional statements include 'recommend', 'consider', and so on. Required.""" - is_guideline: bool = rest_field(name="isGuideline") + is_guideline: bool = rest_field(name="isGuideline", visibility=["read", "create", "update", "delete", "query"]) """The guideline value indicates whether or not the recommendation is part of a guideline section that compiles all recommendations applicable to various findings. Required.""" - is_hedging: bool = rest_field(name="isHedging") + is_hedging: bool = rest_field(name="isHedging", visibility=["read", "create", "update", "delete", "query"]) """Hedging refers to ambiguous, vague or imprecise language within the sentence of the recommendation. Keywords for hedging are 'can be','may be',and so on. Required.""" - recommended_procedure: "_models.ProcedureRecommendation" = rest_field(name="recommendedProcedure") + recommended_procedure: "_models.ProcedureRecommendation" = rest_field( + name="recommendedProcedure", visibility=["read", "create", "update", "delete", "query"] + ) """The procedure recommendation can be a generic procedure or an imaging procedure. Required.""" @overload @@ -918,20 +1004,20 @@ def __init__( effective_at: Optional[str] = None, effective_period: Optional["_models.Period"] = None, findings: Optional[List["_models.RecommendationFinding"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=RadiologyInsightsInferenceType.FOLLOWUP_RECOMMENDATION, **kwargs) -class FollowupRecommendationOptions(_model_base.Model): +class FollowupRecommendationOptions(_Model): """Follow-up recommendation options. :ivar include_recommendations_with_no_specified_modality: Include/Exclude follow-up @@ -947,14 +1033,18 @@ class FollowupRecommendationOptions(_model_base.Model): """ include_recommendations_with_no_specified_modality: Optional[bool] = rest_field( - name="includeRecommendationsWithNoSpecifiedModality" + name="includeRecommendationsWithNoSpecifiedModality", visibility=["read", "create", "update", "delete", "query"] ) """Include/Exclude follow-up recommendations without a specific radiology procedure. Default is false.""" - include_recommendations_in_references: Optional[bool] = rest_field(name="includeRecommendationsInReferences") + include_recommendations_in_references: Optional[bool] = rest_field( + name="includeRecommendationsInReferences", visibility=["read", "create", "update", "delete", "query"] + ) """Include/Exclude follow-up recommendations in references to a guideline or article. Default is false.""" - provide_focused_sentence_evidence: Optional[bool] = rest_field(name="provideFocusedSentenceEvidence") + provide_focused_sentence_evidence: Optional[bool] = rest_field( + name="provideFocusedSentenceEvidence", visibility=["read", "create", "update", "delete", "query"] + ) """If this is true, provide one or more sentences as evidence for the recommendation, next to the token evidence. The start and end positions of these sentences will be put in an extension with url 'modality_sentences'. Default is false.""" @@ -966,26 +1056,25 @@ def __init__( include_recommendations_with_no_specified_modality: Optional[bool] = None, include_recommendations_in_references: Optional[bool] = None, provide_focused_sentence_evidence: Optional[bool] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProcedureRecommendation(_model_base.Model): +class ProcedureRecommendation(_Model): """The procedure recommendation can be a generic procedure or an imaging procedure. You probably want to use the sub-classes and not this class directly. Known sub-classes are: GenericProcedureRecommendation, ImagingProcedureRecommendation - :ivar kind: Discriminator property for ProcedureRecommendation. Required. Default value is None. :vartype kind: str @@ -993,10 +1082,12 @@ class ProcedureRecommendation(_model_base.Model): :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] """ - __mapping__: Dict[str, _model_base.Model] = {} + __mapping__: Dict[str, _Model] = {} kind: str = rest_discriminator(name="kind") """Discriminator property for ProcedureRecommendation. Required. Default value is None.""" - extension: Optional[List["_models.Extension"]] = rest_field() + extension: Optional[List["_models.Extension"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Additional Content defined by implementations.""" @overload @@ -1005,23 +1096,22 @@ def __init__( *, kind: str, extension: Optional[List["_models.Extension"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) class GenericProcedureRecommendation(ProcedureRecommendation, discriminator="genericProcedureRecommendation"): """Generic procedure information. - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Procedure type : generic. Required. Default value is @@ -1034,11 +1124,11 @@ class GenericProcedureRecommendation(ProcedureRecommendation, discriminator="gen :vartype description: str """ - kind: Literal["genericProcedureRecommendation"] = rest_discriminator(name="kind") # type: ignore + kind: Literal["genericProcedureRecommendation"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Procedure type : generic. Required. Default value is \"genericProcedureRecommendation\".""" - code: "_models.CodeableConcept" = rest_field() + code: "_models.CodeableConcept" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Procedure modality : SNOMED CT code. Required.""" - description: Optional[str] = rest_field() + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Procedure description : MANAGEMENT PROCEDURE (PROCEDURE) or CONSULTATION (PROCEDURE) based on SNOMED CT.""" @@ -1049,45 +1139,155 @@ def __init__( code: "_models.CodeableConcept", extension: Optional[List["_models.Extension"]] = None, description: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind="genericProcedureRecommendation", **kwargs) -class HealthInsightsErrorResponse(_model_base.Model): - """A response containing error details. +class GuidanceInference(RadiologyInsightsInference, discriminator="guidance"): + """A guidance inference collects structured information about a specific finding in the report and + can possibly propose appropriate follow-up recommendations, based upon established, + evidence-based best practices i.e. ACR guidelines. + + :ivar extension: Additional Content defined by implementations. + :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] + :ivar kind: Inference type. Required. Guidance inference type + :vartype kind: str or ~azure.healthinsights.radiologyinsights.models.GUIDANCE + :ivar finding: The finding associated with the guidance. Required. + :vartype finding: ~azure.healthinsights.radiologyinsights.models.FindingInference + :ivar identifier: The guidance identifier, as a concept. Required. + :vartype identifier: ~azure.healthinsights.radiologyinsights.models.CodeableConcept + :ivar present_guidance_information: presentGuidanceInformation lists each item of the + structured information (e.g. laterality) and corresponding details (left, right, bilateral) + that is present in the document. + :vartype present_guidance_information: + list[~azure.healthinsights.radiologyinsights.models.PresentGuidanceInformation] + :ivar ranking: See doc of GuidanceRankingType. Required. Known values are: "high" and "low". + :vartype ranking: str or ~azure.healthinsights.radiologyinsights.models.GuidanceRankingType + :ivar recommendation_proposals: The proposed follow-up recommendations, if any. If this is + filled, missingGuidanceInformation cannot be filled (and vice versa). + :vartype recommendation_proposals: + list[~azure.healthinsights.radiologyinsights.models.FollowupRecommendationInference] + :ivar missing_guidance_information: Contains all missing items that are needed to determine + follow-up. + :vartype missing_guidance_information: list[str] + """ + kind: Literal[RadiologyInsightsInferenceType.GUIDANCE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Inference type. Required. Guidance inference type""" + finding: "_models.FindingInference" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The finding associated with the guidance. Required.""" + identifier: "_models.CodeableConcept" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The guidance identifier, as a concept. Required.""" + present_guidance_information: Optional[List["_models.PresentGuidanceInformation"]] = rest_field( + name="presentGuidanceInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """presentGuidanceInformation lists each item of the structured information (e.g. laterality) and + corresponding details (left, right, bilateral) that is present in the document.""" + ranking: Union[str, "_models.GuidanceRankingType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """See doc of GuidanceRankingType. Required. Known values are: \"high\" and \"low\".""" + recommendation_proposals: Optional[List["_models.FollowupRecommendationInference"]] = rest_field( + name="recommendationProposals", visibility=["read", "create", "update", "delete", "query"] + ) + """The proposed follow-up recommendations, if any. If this is filled, missingGuidanceInformation + cannot be filled (and vice versa).""" + missing_guidance_information: Optional[List[str]] = rest_field( + name="missingGuidanceInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """Contains all missing items that are needed to determine follow-up.""" + + @overload + def __init__( + self, + *, + finding: "_models.FindingInference", + identifier: "_models.CodeableConcept", + ranking: Union[str, "_models.GuidanceRankingType"], + extension: Optional[List["_models.Extension"]] = None, + present_guidance_information: Optional[List["_models.PresentGuidanceInformation"]] = None, + recommendation_proposals: Optional[List["_models.FollowupRecommendationInference"]] = None, + missing_guidance_information: Optional[List[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, kind=RadiologyInsightsInferenceType.GUIDANCE, **kwargs) + + +class GuidanceOptions(_Model): + """Guidance options. + + :ivar show_guidance_in_history: If this is true, also show guidances from a clinical history + section i.e. if the first token of the associated finding's clinical indicator is in this + section. Default is false. Required. + :vartype show_guidance_in_history: bool + """ + + show_guidance_in_history: bool = rest_field( + name="showGuidanceInHistory", visibility=["read", "create", "update", "delete", "query"] + ) + """If this is true, also show guidances from a clinical history section i.e. if the first token of + the associated finding's clinical indicator is in this section. Default is false. Required.""" + + @overload + def __init__( + self, + *, + show_guidance_in_history: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HealthInsightsErrorResponse(_Model): + """A response containing error details. :ivar error: The error object. Required. - :vartype error: ~azure.core.HttpResponseError + :vartype error: ~azure.core.ODataV4Format """ - error: HttpResponseError = rest_field() + error: ODataV4Format = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The error object. Required.""" @overload def __init__( self, *, - error: HttpResponseError, - ): ... + error: ODataV4Format, + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1109,17 +1309,17 @@ class Identifier(Element): :vartype assigner: ~azure.healthinsights.radiologyinsights.models.Reference """ - use: Optional[str] = rest_field() + use: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """usual | official | temp | secondary | old (If known).""" - type: Optional["_models.CodeableConcept"] = rest_field() + type: Optional["_models.CodeableConcept"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Description of identifier.""" - system: Optional[str] = rest_field() + system: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The namespace for the identifier value.""" - value: Optional[str] = rest_field() + value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The value that is unique.""" - period: Optional["_models.Period"] = rest_field() + period: Optional["_models.Period"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Time period when id is/was valid for use.""" - assigner: Optional["_models.Reference"] = rest_field() + assigner: Optional["_models.Reference"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Organization that issued id (may be just text).""" @overload @@ -1132,23 +1332,22 @@ def __init__( value: Optional[str] = None, period: Optional["_models.Period"] = None, assigner: Optional["_models.Reference"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImagingProcedure(_model_base.Model): +class ImagingProcedure(_Model): """Imaging procedure. - :ivar modality: Modality : SNOMED CT code. Required. :vartype modality: ~azure.healthinsights.radiologyinsights.models.CodeableConcept :ivar anatomy: Anatomy : SNOMED CT code. Required. @@ -1161,15 +1360,21 @@ class ImagingProcedure(_model_base.Model): :vartype view: ~azure.healthinsights.radiologyinsights.models.RadiologyCodeWithTypes """ - modality: "_models.CodeableConcept" = rest_field() + modality: "_models.CodeableConcept" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Modality : SNOMED CT code. Required.""" - anatomy: "_models.CodeableConcept" = rest_field() + anatomy: "_models.CodeableConcept" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Anatomy : SNOMED CT code. Required.""" - laterality: Optional["_models.CodeableConcept"] = rest_field() + laterality: Optional["_models.CodeableConcept"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Laterality : SNOMED CT code.""" - contrast: Optional["_models.RadiologyCodeWithTypes"] = rest_field() + contrast: Optional["_models.RadiologyCodeWithTypes"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Contrast : see RadiologyCodeWithTypes (below).""" - view: Optional["_models.RadiologyCodeWithTypes"] = rest_field() + view: Optional["_models.RadiologyCodeWithTypes"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """View : see RadiologyCodeWithTypes (below).""" @overload @@ -1181,23 +1386,22 @@ def __init__( laterality: Optional["_models.CodeableConcept"] = None, contrast: Optional["_models.RadiologyCodeWithTypes"] = None, view: Optional["_models.RadiologyCodeWithTypes"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) class ImagingProcedureRecommendation(ProcedureRecommendation, discriminator="imagingProcedureRecommendation"): """Imaging procedures. - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Procedure type : imaging. Required. Default value is @@ -1210,11 +1414,15 @@ class ImagingProcedureRecommendation(ProcedureRecommendation, discriminator="ima list[~azure.healthinsights.radiologyinsights.models.ImagingProcedure] """ - kind: Literal["imagingProcedureRecommendation"] = rest_discriminator(name="kind") # type: ignore + kind: Literal["imagingProcedureRecommendation"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Procedure type : imaging. Required. Default value is \"imagingProcedureRecommendation\".""" - procedure_codes: Optional[List["_models.CodeableConcept"]] = rest_field(name="procedureCodes") + procedure_codes: Optional[List["_models.CodeableConcept"]] = rest_field( + name="procedureCodes", visibility=["read", "create", "update", "delete", "query"] + ) """LOINC codes for the procedure.""" - imaging_procedures: List["_models.ImagingProcedure"] = rest_field(name="imagingProcedures") + imaging_procedures: List["_models.ImagingProcedure"] = rest_field( + name="imagingProcedures", visibility=["read", "create", "update", "delete", "query"] + ) """Imaging procedures. Required.""" @overload @@ -1224,16 +1432,16 @@ def __init__( imaging_procedures: List["_models.ImagingProcedure"], extension: Optional[List["_models.Extension"]] = None, procedure_codes: Optional[List["_models.CodeableConcept"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind="imagingProcedureRecommendation", **kwargs) @@ -1242,7 +1450,6 @@ class LateralityDiscrepancyInference(RadiologyInsightsInference, discriminator=" the ordered procedure (orderLateralityMismatch), a contradiction within the clinical document (textLateralityContradiction), or when no laterality is mentioned (textLateralityMissing). - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Laterality discrepancy inference type @@ -1257,11 +1464,15 @@ class LateralityDiscrepancyInference(RadiologyInsightsInference, discriminator=" ~azure.healthinsights.radiologyinsights.models.LateralityDiscrepancyType """ - kind: Literal[RadiologyInsightsInferenceType.LATERALITY_DISCREPANCY] = rest_discriminator(name="kind") # type: ignore + kind: Literal[RadiologyInsightsInferenceType.LATERALITY_DISCREPANCY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Inference type. Required. Laterality discrepancy inference type""" - laterality_indication: Optional["_models.CodeableConcept"] = rest_field(name="lateralityIndication") + laterality_indication: Optional["_models.CodeableConcept"] = rest_field( + name="lateralityIndication", visibility=["read", "create", "update", "delete", "query"] + ) """Laterality indication : SNOMED CT code for laterality qualifier value.""" - discrepancy_type: Union[str, "_models.LateralityDiscrepancyType"] = rest_field(name="discrepancyType") + discrepancy_type: Union[str, "_models.LateralityDiscrepancyType"] = rest_field( + name="discrepancyType", visibility=["read", "create", "update", "delete", "query"] + ) """Mismatch type : orderLateralityMismatch, textLateralityContradiction, textLateralityMissing. Required. Known values are: \"orderLateralityMismatch\", \"textLateralityContradiction\", and \"textLateralityMissing\".""" @@ -1273,16 +1484,16 @@ def __init__( discrepancy_type: Union[str, "_models.LateralityDiscrepancyType"], extension: Optional[List["_models.Extension"]] = None, laterality_indication: Optional["_models.CodeableConcept"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=RadiologyInsightsInferenceType.LATERALITY_DISCREPANCY, **kwargs) @@ -1290,7 +1501,6 @@ class LimitedOrderDiscrepancyInference(RadiologyInsightsInference, discriminator """A limited order discrepancy occurs when there is a limited order, but all body parts and measurements that are needed for a complete order are present in the document. - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Limited order discrepancy inference type @@ -1307,15 +1517,19 @@ class LimitedOrderDiscrepancyInference(RadiologyInsightsInference, discriminator list[~azure.healthinsights.radiologyinsights.models.CodeableConcept] """ - kind: Literal[RadiologyInsightsInferenceType.LIMITED_ORDER_DISCREPANCY] = rest_discriminator(name="kind") # type: ignore # pylint: disable=line-too-long + kind: Literal[RadiologyInsightsInferenceType.LIMITED_ORDER_DISCREPANCY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Inference type. Required. Limited order discrepancy inference type""" - order_type: "_models.CodeableConcept" = rest_field(name="orderType") + order_type: "_models.CodeableConcept" = rest_field( + name="orderType", visibility=["read", "create", "update", "delete", "query"] + ) """Order type : CPT ultrasound complete code for abdomen, retroperitoneal, pelvis or breast. Required.""" - present_body_parts: Optional[List["_models.CodeableConcept"]] = rest_field(name="presentBodyParts") + present_body_parts: Optional[List["_models.CodeableConcept"]] = rest_field( + name="presentBodyParts", visibility=["read", "create", "update", "delete", "query"] + ) """List of body parts found in the document : SNOMED CT codes.""" present_body_part_measurements: Optional[List["_models.CodeableConcept"]] = rest_field( - name="presentBodyPartMeasurements" + name="presentBodyPartMeasurements", visibility=["read", "create", "update", "delete", "query"] ) """List of body parts that are measured according to the document : SNOMED CT codes.""" @@ -1327,20 +1541,20 @@ def __init__( extension: Optional[List["_models.Extension"]] = None, present_body_parts: Optional[List["_models.CodeableConcept"]] = None, present_body_part_measurements: Optional[List["_models.CodeableConcept"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=RadiologyInsightsInferenceType.LIMITED_ORDER_DISCREPANCY, **kwargs) -class Meta(_model_base.Model): +class Meta(_Model): """Metadata about a resource Based on `FHIR Meta `_. @@ -1368,24 +1582,26 @@ class Meta(_model_base.Model): :vartype tag: list[~azure.healthinsights.radiologyinsights.models.Coding] """ - version_id: Optional[str] = rest_field(name="versionId") + version_id: Optional[str] = rest_field(name="versionId", visibility=["read", "create", "update", "delete", "query"]) """The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.""" - last_updated: Optional[str] = rest_field(name="lastUpdated") + last_updated: Optional[str] = rest_field( + name="lastUpdated", visibility=["read", "create", "update", "delete", "query"] + ) """When the resource last changed - e.g. when the version changed.""" - source: Optional[str] = rest_field() + source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A uri that identifies the source system of the resource. This provides a minimal amount of Provenance information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.""" - profile: Optional[List[str]] = rest_field() + profile: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A list of profiles (references to `StructureDefinition `_ resources) that this resource claims to conform to. The URL is a reference to `StructureDefinition.url `_.""" - security: Optional[List["_models.Coding"]] = rest_field() + security: Optional[List["_models.Coding"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.""" - tag: Optional[List["_models.Coding"]] = rest_field() + tag: Optional[List["_models.Coding"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.""" @@ -1400,16 +1616,16 @@ def __init__( profile: Optional[List[str]] = None, security: Optional[List["_models.Coding"]] = None, tag: Optional[List["_models.Coding"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1419,7 +1635,6 @@ class Narrative(Element): represent the content of the resource to a human. Based on `FHIR Narrative `_. - :ivar id: Unique id for inter-element referencing. :vartype id: str :ivar extension: Additional Content defined by implementations. @@ -1430,9 +1645,9 @@ class Narrative(Element): :vartype div: str """ - status: str = rest_field() + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """generated, extensions, additional, empty. Required.""" - div: str = rest_field() + div: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """xhtml. Required.""" @overload @@ -1443,24 +1658,23 @@ def __init__( div: str, id: Optional[str] = None, # pylint: disable=redefined-builtin extension: Optional[List["_models.Extension"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Observation(DomainResource, discriminator="Observation"): # pylint: disable=too-many-instance-attributes +class Observation(DomainResource, discriminator="Observation"): """Detailed information about observations Based on `FHIR Observation `_. - :ivar id: Resource Id. :vartype id: str :ivar meta: Metadata about the resource. @@ -1545,69 +1759,117 @@ class Observation(DomainResource, discriminator="Observation"): # pylint: disab :vartype component: list[~azure.healthinsights.radiologyinsights.models.ObservationComponent] """ - resource_type: Literal["Observation"] = rest_discriminator(name="resourceType") # type: ignore + resource_type: Literal["Observation"] = rest_discriminator(name="resourceType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """resourceType. Required. Default value is \"Observation\".""" - identifier: Optional[List["_models.Identifier"]] = rest_field() + identifier: Optional[List["_models.Identifier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Business Identifier for observation.""" - status: Union[str, "_models.ObservationStatusCodeType"] = rest_field() + status: Union[str, "_models.ObservationStatusCodeType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """registered | preliminary | final | amended +. Required. Known values are: \"registered\", \"preliminary\", \"final\", \"amended\", \"corrected\", \"cancelled\", \"entered-in-error\", and \"unknown\".""" - category: Optional[List["_models.CodeableConcept"]] = rest_field() + category: Optional[List["_models.CodeableConcept"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Classification of type of observation.""" - code: "_models.CodeableConcept" = rest_field() + code: "_models.CodeableConcept" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Type of observation (code / type). Required.""" - subject: Optional["_models.Reference"] = rest_field() + subject: Optional["_models.Reference"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Who and/or what the observation is about.""" - encounter: Optional["_models.Reference"] = rest_field() + encounter: Optional["_models.Reference"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Healthcare event during which this observation is made.""" - effective_date_time: Optional[str] = rest_field(name="effectiveDateTime") + effective_date_time: Optional[str] = rest_field( + name="effectiveDateTime", visibility=["read", "create", "update", "delete", "query"] + ) """Clinically relevant time/time-period for observation.""" - effective_period: Optional["_models.Period"] = rest_field(name="effectivePeriod") + effective_period: Optional["_models.Period"] = rest_field( + name="effectivePeriod", visibility=["read", "create", "update", "delete", "query"] + ) """Clinically relevant time/time-period for observation.""" - effective_instant: Optional[str] = rest_field(name="effectiveInstant") + effective_instant: Optional[str] = rest_field( + name="effectiveInstant", visibility=["read", "create", "update", "delete", "query"] + ) """Clinically relevant time/time-period for observation.""" - issued: Optional[str] = rest_field() + issued: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Date/Time this version was made available.""" - value_quantity: Optional["_models.Quantity"] = rest_field(name="valueQuantity") + value_quantity: Optional["_models.Quantity"] = rest_field( + name="valueQuantity", visibility=["read", "create", "update", "delete", "query"] + ) """Actual result.""" - value_codeable_concept: Optional["_models.CodeableConcept"] = rest_field(name="valueCodeableConcept") + value_codeable_concept: Optional["_models.CodeableConcept"] = rest_field( + name="valueCodeableConcept", visibility=["read", "create", "update", "delete", "query"] + ) """Actual result.""" - value_string: Optional[str] = rest_field(name="valueString") + value_string: Optional[str] = rest_field( + name="valueString", visibility=["read", "create", "update", "delete", "query"] + ) """Actual result.""" - value_boolean: Optional[bool] = rest_field(name="valueBoolean") + value_boolean: Optional[bool] = rest_field( + name="valueBoolean", visibility=["read", "create", "update", "delete", "query"] + ) """Actual result.""" - value_integer: Optional[int] = rest_field(name="valueInteger") + value_integer: Optional[int] = rest_field( + name="valueInteger", visibility=["read", "create", "update", "delete", "query"] + ) """Actual result.""" - value_range: Optional["_models.Range"] = rest_field(name="valueRange") + value_range: Optional["_models.Range"] = rest_field( + name="valueRange", visibility=["read", "create", "update", "delete", "query"] + ) """Actual result.""" - value_ratio: Optional["_models.Ratio"] = rest_field(name="valueRatio") + value_ratio: Optional["_models.Ratio"] = rest_field( + name="valueRatio", visibility=["read", "create", "update", "delete", "query"] + ) """Actual result.""" - value_sampled_data: Optional["_models.SampledData"] = rest_field(name="valueSampledData") + value_sampled_data: Optional["_models.SampledData"] = rest_field( + name="valueSampledData", visibility=["read", "create", "update", "delete", "query"] + ) """Actual result.""" - value_time: Optional[datetime.time] = rest_field(name="valueTime") + value_time: Optional[datetime.time] = rest_field( + name="valueTime", visibility=["read", "create", "update", "delete", "query"] + ) """Actual result.""" - value_date_time: Optional[str] = rest_field(name="valueDateTime") + value_date_time: Optional[str] = rest_field( + name="valueDateTime", visibility=["read", "create", "update", "delete", "query"] + ) """Actual result.""" - value_period: Optional["_models.Period"] = rest_field(name="valuePeriod") + value_period: Optional["_models.Period"] = rest_field( + name="valuePeriod", visibility=["read", "create", "update", "delete", "query"] + ) """Actual result.""" - data_absent_reason: Optional["_models.CodeableConcept"] = rest_field(name="dataAbsentReason") + data_absent_reason: Optional["_models.CodeableConcept"] = rest_field( + name="dataAbsentReason", visibility=["read", "create", "update", "delete", "query"] + ) """Why the result is missing.""" - interpretation: Optional[List["_models.CodeableConcept"]] = rest_field() + interpretation: Optional[List["_models.CodeableConcept"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """High, low, normal, etc.""" - note: Optional[List["_models.Annotation"]] = rest_field() + note: Optional[List["_models.Annotation"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Comments about the observation.""" - body_site: Optional["_models.CodeableConcept"] = rest_field(name="bodySite") + body_site: Optional["_models.CodeableConcept"] = rest_field( + name="bodySite", visibility=["read", "create", "update", "delete", "query"] + ) """Observed body part.""" - method: Optional["_models.CodeableConcept"] = rest_field() + method: Optional["_models.CodeableConcept"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """How it was done.""" - reference_range: Optional[List["_models.ObservationReferenceRange"]] = rest_field(name="referenceRange") + reference_range: Optional[List["_models.ObservationReferenceRange"]] = rest_field( + name="referenceRange", visibility=["read", "create", "update", "delete", "query"] + ) """Provides guide for interpretation.""" - has_member: Optional[List["_models.Reference"]] = rest_field(name="hasMember") + has_member: Optional[List["_models.Reference"]] = rest_field( + name="hasMember", visibility=["read", "create", "update", "delete", "query"] + ) """Related resource that belongs to the Observation group.""" - derived_from: Optional[List["_models.Reference"]] = rest_field(name="derivedFrom") + derived_from: Optional[List["_models.Reference"]] = rest_field( + name="derivedFrom", visibility=["read", "create", "update", "delete", "query"] + ) """Related measurements the observation is made from.""" - component: Optional[List["_models.ObservationComponent"]] = rest_field() + component: Optional[List["_models.ObservationComponent"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Component results.""" @overload @@ -1652,24 +1914,23 @@ def __init__( # pylint: disable=too-many-locals has_member: Optional[List["_models.Reference"]] = None, derived_from: Optional[List["_models.Reference"]] = None, component: Optional[List["_models.ObservationComponent"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, resource_type="Observation", **kwargs) -class ObservationComponent(Element): # pylint: disable=too-many-instance-attributes +class ObservationComponent(Element): """Component results Based on `FHIR Observation.component `_. - :ivar id: Unique id for inter-element referencing. :vartype id: str :ivar extension: Additional Content defined by implementations. @@ -1709,37 +1970,67 @@ class ObservationComponent(Element): # pylint: disable=too-many-instance-attrib list[~azure.healthinsights.radiologyinsights.models.ObservationReferenceRange] """ - code: "_models.CodeableConcept" = rest_field() + code: "_models.CodeableConcept" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Type of component observation (code / type). Required.""" - value_quantity: Optional["_models.Quantity"] = rest_field(name="valueQuantity") + value_quantity: Optional["_models.Quantity"] = rest_field( + name="valueQuantity", visibility=["read", "create", "update", "delete", "query"] + ) """Value as Quantity.""" - value_codeable_concept: Optional["_models.CodeableConcept"] = rest_field(name="valueCodeableConcept") + value_codeable_concept: Optional["_models.CodeableConcept"] = rest_field( + name="valueCodeableConcept", visibility=["read", "create", "update", "delete", "query"] + ) """Value as CodeableConcept.""" - value_string: Optional[str] = rest_field(name="valueString") + value_string: Optional[str] = rest_field( + name="valueString", visibility=["read", "create", "update", "delete", "query"] + ) """Value as string.""" - value_boolean: Optional[bool] = rest_field(name="valueBoolean") + value_boolean: Optional[bool] = rest_field( + name="valueBoolean", visibility=["read", "create", "update", "delete", "query"] + ) """Value as boolean.""" - value_integer: Optional[int] = rest_field(name="valueInteger") + value_integer: Optional[int] = rest_field( + name="valueInteger", visibility=["read", "create", "update", "delete", "query"] + ) """Value as integer.""" - value_range: Optional["_models.Range"] = rest_field(name="valueRange") + value_range: Optional["_models.Range"] = rest_field( + name="valueRange", visibility=["read", "create", "update", "delete", "query"] + ) """Value as Range.""" - value_ratio: Optional["_models.Ratio"] = rest_field(name="valueRatio") + value_ratio: Optional["_models.Ratio"] = rest_field( + name="valueRatio", visibility=["read", "create", "update", "delete", "query"] + ) """Value as Ratio.""" - value_sampled_data: Optional["_models.SampledData"] = rest_field(name="valueSampledData") + value_sampled_data: Optional["_models.SampledData"] = rest_field( + name="valueSampledData", visibility=["read", "create", "update", "delete", "query"] + ) """Value as SampledData.""" - value_time: Optional[datetime.time] = rest_field(name="valueTime") + value_time: Optional[datetime.time] = rest_field( + name="valueTime", visibility=["read", "create", "update", "delete", "query"] + ) """Value as time (hh:mm:ss).""" - value_date_time: Optional[str] = rest_field(name="valueDateTime") + value_date_time: Optional[str] = rest_field( + name="valueDateTime", visibility=["read", "create", "update", "delete", "query"] + ) """Value as dateTime.""" - value_period: Optional["_models.Period"] = rest_field(name="valuePeriod") + value_period: Optional["_models.Period"] = rest_field( + name="valuePeriod", visibility=["read", "create", "update", "delete", "query"] + ) """Value as Period.""" - value_reference: Optional["_models.Reference"] = rest_field(name="valueReference") + value_reference: Optional["_models.Reference"] = rest_field( + name="valueReference", visibility=["read", "create", "update", "delete", "query"] + ) """Value as reference.""" - data_absent_reason: Optional["_models.CodeableConcept"] = rest_field(name="dataAbsentReason") + data_absent_reason: Optional["_models.CodeableConcept"] = rest_field( + name="dataAbsentReason", visibility=["read", "create", "update", "delete", "query"] + ) """Why the component result is missing.""" - interpretation: Optional[List["_models.CodeableConcept"]] = rest_field() + interpretation: Optional[List["_models.CodeableConcept"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """High, low, normal, etc.""" - reference_range: Optional[List["_models.ObservationReferenceRange"]] = rest_field(name="referenceRange") + reference_range: Optional[List["_models.ObservationReferenceRange"]] = rest_field( + name="referenceRange", visibility=["read", "create", "update", "delete", "query"] + ) """Provides guide for interpretation of component result.""" @overload @@ -1764,20 +2055,20 @@ def __init__( data_absent_reason: Optional["_models.CodeableConcept"] = None, interpretation: Optional[List["_models.CodeableConcept"]] = None, reference_range: Optional[List["_models.ObservationReferenceRange"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ObservationReferenceRange(_model_base.Model): +class ObservationReferenceRange(_Model): """Provides guide for interpretation of component result Based on `FHIR Observation.referenceRange `_. @@ -1795,17 +2086,19 @@ class ObservationReferenceRange(_model_base.Model): :vartype text: str """ - low: Optional["_models.Quantity"] = rest_field() + low: Optional["_models.Quantity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Low Range, if relevant.""" - high: Optional["_models.Quantity"] = rest_field() + high: Optional["_models.Quantity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """High Range, if relevant.""" - type: Optional["_models.CodeableConcept"] = rest_field() + type: Optional["_models.CodeableConcept"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Reference range qualifier.""" - applies_to: Optional[List["_models.CodeableConcept"]] = rest_field(name="appliesTo") + applies_to: Optional[List["_models.CodeableConcept"]] = rest_field( + name="appliesTo", visibility=["read", "create", "update", "delete", "query"] + ) """Reference range population.""" - age: Optional["_models.Range"] = rest_field() + age: Optional["_models.Range"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Applicable age range, if relevant.""" - text: Optional[str] = rest_field() + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Text based reference range in an observation.""" @overload @@ -1818,20 +2111,20 @@ def __init__( applies_to: Optional[List["_models.CodeableConcept"]] = None, age: Optional["_models.Range"] = None, text: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OrderedProcedure(_model_base.Model): +class OrderedProcedure(_Model): """Procedure information. :ivar code: Procedure code. @@ -1842,11 +2135,13 @@ class OrderedProcedure(_model_base.Model): :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] """ - code: Optional["_models.CodeableConcept"] = rest_field() + code: Optional["_models.CodeableConcept"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Procedure code.""" - description: Optional[str] = rest_field() + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Procedure description.""" - extension: Optional[List["_models.Extension"]] = rest_field() + extension: Optional[List["_models.Extension"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Additional Content defined by implementations.""" @overload @@ -1856,20 +2151,20 @@ def __init__( code: Optional["_models.CodeableConcept"] = None, description: Optional[str] = None, extension: Optional[List["_models.Extension"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PatientDetails(_model_base.Model): +class PatientDetails(_Model): """Patient structured information, including demographics and known structured clinical information. @@ -1881,11 +2176,17 @@ class PatientDetails(_model_base.Model): :vartype clinical_info: list[~azure.healthinsights.radiologyinsights.models.Resource] """ - sex: Optional[Union[str, "_models.PatientSex"]] = rest_field() + sex: Optional[Union[str, "_models.PatientSex"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The patient's sex. Known values are: \"female\", \"male\", and \"unspecified\".""" - birth_date: Optional[datetime.date] = rest_field(name="birthDate") + birth_date: Optional[datetime.date] = rest_field( + name="birthDate", visibility=["read", "create", "update", "delete", "query"] + ) """The patient's date of birth.""" - clinical_info: Optional[List["_models.Resource"]] = rest_field(name="clinicalInfo") + clinical_info: Optional[List["_models.Resource"]] = rest_field( + name="clinicalInfo", visibility=["read", "create", "update", "delete", "query"] + ) """Known clinical information for the patient, structured.""" @overload @@ -1895,24 +2196,23 @@ def __init__( sex: Optional[Union[str, "_models.PatientSex"]] = None, birth_date: Optional[datetime.date] = None, clinical_info: Optional[List["_models.Resource"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PatientDocument(_model_base.Model): +class PatientDocument(_Model): """A clinical document related to a patient. Document here is in the wide sense - not just a text document (note). - :ivar type: The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). Required. Known values are: "note", "fhirBundle", "dicom", and "genomicSequencing". @@ -1941,30 +2241,38 @@ class PatientDocument(_model_base.Model): :vartype content: ~azure.healthinsights.radiologyinsights.models.DocumentContent """ - type: Union[str, "_models.DocumentType"] = rest_field() + type: Union[str, "_models.DocumentType"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). Required. Known values are: \"note\", \"fhirBundle\", \"dicom\", and \"genomicSequencing\".""" - clinical_type: Optional[Union[str, "_models.ClinicalDocumentType"]] = rest_field(name="clinicalType") + clinical_type: Optional[Union[str, "_models.ClinicalDocumentType"]] = rest_field( + name="clinicalType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of the clinical document. Known values are: \"consultation\", \"dischargeSummary\", \"historyAndPhysical\", \"radiologyReport\", \"procedure\", \"progress\", \"laboratory\", and \"pathologyReport\".""" - id: str = rest_field() + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A given identifier for the document. Has to be unique across all documents for a single patient. Required.""" - language: Optional[str] = rest_field() + language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A 2 letter ISO 639-1 representation of the language of the document.""" - created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339") + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """The date and time when the document was created.""" - authors: Optional[List["_models.DocumentAuthor"]] = rest_field() + authors: Optional[List["_models.DocumentAuthor"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Document author(s).""" - specialty_type: Optional[Union[str, "_models.SpecialtyType"]] = rest_field(name="specialtyType") + specialty_type: Optional[Union[str, "_models.SpecialtyType"]] = rest_field( + name="specialtyType", visibility=["read", "create", "update", "delete", "query"] + ) """specialty type the document. Known values are: \"pathology\" and \"radiology\".""" administrative_metadata: Optional["_models.DocumentAdministrativeMetadata"] = rest_field( - name="administrativeMetadata" + name="administrativeMetadata", visibility=["read", "create", "update", "delete", "query"] ) """Administrative metadata for the document.""" - content: "_models.DocumentContent" = rest_field() + content: "_models.DocumentContent" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The content of the patient document. Required.""" @overload @@ -1980,41 +2288,42 @@ def __init__( authors: Optional[List["_models.DocumentAuthor"]] = None, specialty_type: Optional[Union[str, "_models.SpecialtyType"]] = None, administrative_metadata: Optional["_models.DocumentAdministrativeMetadata"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PatientEncounter(_model_base.Model): +class PatientEncounter(_Model): """visit/encounter information. - :ivar id: The id of the visit. Required. :vartype id: str :ivar period: Time period of the visit. - In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end - to indicate the discharge time. + In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to + indicate the discharge time. :vartype period: ~azure.healthinsights.radiologyinsights.models.TimePeriod :ivar class_property: The class of the encounter. Known values are: "inpatient", "ambulatory", "observation", "emergency", "virtual", and "healthHome". :vartype class_property: str or ~azure.healthinsights.radiologyinsights.models.EncounterClass """ - id: str = rest_field() + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The id of the visit. Required.""" - period: Optional["_models.TimePeriod"] = rest_field() + period: Optional["_models.TimePeriod"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Time period of the visit. In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time.""" - class_property: Optional[Union[str, "_models.EncounterClass"]] = rest_field(name="class") + class_property: Optional[Union[str, "_models.EncounterClass"]] = rest_field( + name="class", visibility=["read", "create", "update", "delete", "query"] + ) """The class of the encounter. Known values are: \"inpatient\", \"ambulatory\", \"observation\", \"emergency\", \"virtual\", and \"healthHome\".""" @@ -2025,23 +2334,22 @@ def __init__( id: str, # pylint: disable=redefined-builtin period: Optional["_models.TimePeriod"] = None, class_property: Optional[Union[str, "_models.EncounterClass"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PatientRecord(_model_base.Model): +class PatientRecord(_Model): """A patient record, including their clinical information and data. - :ivar id: A given identifier for the patient. Has to be unique across all patients in a single request. Required. :vartype id: str @@ -2055,15 +2363,19 @@ class PatientRecord(_model_base.Model): list[~azure.healthinsights.radiologyinsights.models.PatientDocument] """ - id: str = rest_field() + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A given identifier for the patient. Has to be unique across all patients in a single request. Required.""" - details: Optional["_models.PatientDetails"] = rest_field() + details: Optional["_models.PatientDetails"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Patient structured information, including demographics and known structured clinical information.""" - encounters: Optional[List["_models.PatientEncounter"]] = rest_field() + encounters: Optional[List["_models.PatientEncounter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Patient encounters/visits.""" - patient_documents: Optional[List["_models.PatientDocument"]] = rest_field(name="patientDocuments") + patient_documents: Optional[List["_models.PatientDocument"]] = rest_field( + name="patientDocuments", visibility=["read", "create", "update", "delete", "query"] + ) """Patient unstructured clinical data, given as documents.""" @overload @@ -2074,16 +2386,16 @@ def __init__( details: Optional["_models.PatientDetails"] = None, encounters: Optional[List["_models.PatientEncounter"]] = None, patient_documents: Optional[List["_models.PatientDocument"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2097,9 +2409,9 @@ class Period(Element): :vartype end: str """ - start: Optional[str] = rest_field() + start: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Starting time with inclusive boundary.""" - end: Optional[str] = rest_field() + end: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """End time with inclusive boundary, if not ongoing.""" @overload @@ -2108,16 +2420,166 @@ def __init__( *, start: Optional[str] = None, end: Optional[str] = None, - ): ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PresentGuidanceInformation(_Model): + """An item of the structured information (e.g. laterality or size) and one or more corresponding + details (e.g. left or size-value). + + :ivar present_guidance_item: The item of the structured information. Required. + :vartype present_guidance_item: str + :ivar sizes: A list of size values, if the item is about size. + :vartype sizes: list[~azure.healthinsights.radiologyinsights.models.Observation] + :ivar maximum_diameter_as_in_text: The maximum diameter value, if the item is about the maximum + diameter. + :vartype maximum_diameter_as_in_text: ~azure.healthinsights.radiologyinsights.models.Quantity + :ivar present_guidance_values: The list of item values that are mentioned in the report. + :vartype present_guidance_values: list[str] + :ivar extension: Additional Content defined by implementations. + :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] + """ + + present_guidance_item: str = rest_field( + name="presentGuidanceItem", visibility=["read", "create", "update", "delete", "query"] + ) + """The item of the structured information. Required.""" + sizes: Optional[List["_models.Observation"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A list of size values, if the item is about size.""" + maximum_diameter_as_in_text: Optional["_models.Quantity"] = rest_field( + name="maximumDiameterAsInText", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum diameter value, if the item is about the maximum diameter.""" + present_guidance_values: Optional[List[str]] = rest_field( + name="presentGuidanceValues", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of item values that are mentioned in the report.""" + extension: Optional[List["_models.Extension"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional Content defined by implementations.""" + + @overload + def __init__( + self, + *, + present_guidance_item: str, + sizes: Optional[List["_models.Observation"]] = None, + maximum_diameter_as_in_text: Optional["_models.Quantity"] = None, + present_guidance_values: Optional[List[str]] = None, + extension: Optional[List["_models.Extension"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class QualityMeasureInference(RadiologyInsightsInference, discriminator="qualityMeasure"): + """A QualityMeasure inference captures the MIPS ('measure based incentive payment system') + quality measure criteria in the document that are used to measure the data completeness. + + :ivar extension: Additional Content defined by implementations. + :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] + :ivar kind: Inference type. Required. Guidance measure inference type + :vartype kind: str or ~azure.healthinsights.radiologyinsights.models.QUALITY_MEASURE + :ivar quality_measure_denominator: The denominator, which identifies the QualityMeasure kind. + Required. + :vartype quality_measure_denominator: str + :ivar compliance_type: The ComplianceType indicates whether the document is compliant for the + specified QualityMeasure or not, or if exceptions apply. Required. Known values are: + "notEligible", "performanceNotMet", "performanceMet", and "denominatorException". + :vartype compliance_type: str or + ~azure.healthinsights.radiologyinsights.models.QualityMeasureComplianceType + :ivar quality_criteria: List of quality criteria identified in the document, if any. + :vartype quality_criteria: list[str] + """ + + kind: Literal[RadiologyInsightsInferenceType.QUALITY_MEASURE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Inference type. Required. Guidance measure inference type""" + quality_measure_denominator: str = rest_field( + name="qualityMeasureDenominator", visibility=["read", "create", "update", "delete", "query"] + ) + """The denominator, which identifies the QualityMeasure kind. Required.""" + compliance_type: Union[str, "_models.QualityMeasureComplianceType"] = rest_field( + name="complianceType", visibility=["read", "create", "update", "delete", "query"] + ) + """The ComplianceType indicates whether the document is compliant for the specified QualityMeasure + or not, or if exceptions apply. Required. Known values are: \"notEligible\", + \"performanceNotMet\", \"performanceMet\", and \"denominatorException\".""" + quality_criteria: Optional[List[str]] = rest_field( + name="qualityCriteria", visibility=["read", "create", "update", "delete", "query"] + ) + """List of quality criteria identified in the document, if any.""" + + @overload + def __init__( + self, + *, + quality_measure_denominator: str, + compliance_type: Union[str, "_models.QualityMeasureComplianceType"], + extension: Optional[List["_models.Extension"]] = None, + quality_criteria: Optional[List[str]] = None, + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, kind=RadiologyInsightsInferenceType.QUALITY_MEASURE, **kwargs) + + +class QualityMeasureOptions(_Model): + """Quality Measure Options. + + :ivar measure_types: Id(s) of the MIPS measures that need to be evaluated in the document. + Required. + :vartype measure_types: list[str or + ~azure.healthinsights.radiologyinsights.models.QualityMeasureType] + """ + + measure_types: List[Union[str, "_models.QualityMeasureType"]] = rest_field( + name="measureTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """Id(s) of the MIPS measures that need to be evaluated in the document. Required.""" + + @overload + def __init__( + self, + *, + measure_types: List[Union[str, "_models.QualityMeasureType"]], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2137,15 +2599,15 @@ class Quantity(Element): :vartype code: str """ - value: Optional[float] = rest_field() + value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Numerical value (with implicit precision).""" - comparator: Optional[str] = rest_field() + comparator: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """< | <= | >= | > - how to understand the value.""" - unit: Optional[str] = rest_field() + unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Unit representation.""" - system: Optional[str] = rest_field() + system: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """System that defines coded unit form.""" - code: Optional[str] = rest_field() + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Coded form of the unit.""" @overload @@ -2157,23 +2619,22 @@ def __init__( unit: Optional[str] = None, system: Optional[str] = None, code: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RadiologyCodeWithTypes(_model_base.Model): +class RadiologyCodeWithTypes(_Model): """Radiology code with types : used in imaging procedure recommendation for contrast and view. - :ivar code: The SNOMED CT code indicates whether imaging was conducted with or without contrast in the case of contrast, and in the case of views, it denotes the number of views. Required. :vartype code: ~azure.healthinsights.radiologyinsights.models.CodeableConcept @@ -2183,10 +2644,10 @@ class RadiologyCodeWithTypes(_model_base.Model): :vartype types: list[~azure.healthinsights.radiologyinsights.models.CodeableConcept] """ - code: "_models.CodeableConcept" = rest_field() + code: "_models.CodeableConcept" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The SNOMED CT code indicates whether imaging was conducted with or without contrast in the case of contrast, and in the case of views, it denotes the number of views. Required.""" - types: List["_models.CodeableConcept"] = rest_field() + types: List["_models.CodeableConcept"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The collection of types will indicate the contrast substance used in the case of contrast and, in the case of views, it will specify the types of views, such as lateral and frontal, etc. Required.""" @@ -2197,23 +2658,22 @@ def __init__( *, code: "_models.CodeableConcept", types: List["_models.CodeableConcept"], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RadiologyInsightsData(_model_base.Model): +class RadiologyInsightsData(_Model): """Contains the list of patients, and configuration data. - :ivar patients: The list of patients, including their clinical information and data. Required. :vartype patients: list[~azure.healthinsights.radiologyinsights.models.PatientRecord] :ivar configuration: Configuration affecting the Radiology Insights model's inference. @@ -2221,9 +2681,11 @@ class RadiologyInsightsData(_model_base.Model): ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsModelConfiguration """ - patients: List["_models.PatientRecord"] = rest_field() + patients: List["_models.PatientRecord"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The list of patients, including their clinical information and data. Required.""" - configuration: Optional["_models.RadiologyInsightsModelConfiguration"] = rest_field() + configuration: Optional["_models.RadiologyInsightsModelConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Configuration affecting the Radiology Insights model's inference.""" @overload @@ -2232,20 +2694,20 @@ def __init__( *, patients: List["_models.PatientRecord"], configuration: Optional["_models.RadiologyInsightsModelConfiguration"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RadiologyInsightsInferenceOptions(_model_base.Model): +class RadiologyInsightsInferenceOptions(_Model): """Options regarding follow up recommendation inferences and finding inferences. :ivar followup_recommendation_options: Follow-up recommendation options. @@ -2253,14 +2715,29 @@ class RadiologyInsightsInferenceOptions(_model_base.Model): ~azure.healthinsights.radiologyinsights.models.FollowupRecommendationOptions :ivar finding_options: Finding options. :vartype finding_options: ~azure.healthinsights.radiologyinsights.models.FindingOptions + :ivar guidance_options: Guidance options. + :vartype guidance_options: ~azure.healthinsights.radiologyinsights.models.GuidanceOptions + :ivar quality_measure_options: QualityMeasureOptions. + :vartype quality_measure_options: + ~azure.healthinsights.radiologyinsights.models.QualityMeasureOptions """ followup_recommendation_options: Optional["_models.FollowupRecommendationOptions"] = rest_field( - name="followupRecommendationOptions" + name="followupRecommendationOptions", visibility=["read", "create", "update", "delete", "query"] ) """Follow-up recommendation options.""" - finding_options: Optional["_models.FindingOptions"] = rest_field(name="findingOptions") + finding_options: Optional["_models.FindingOptions"] = rest_field( + name="findingOptions", visibility=["read", "create", "update", "delete", "query"] + ) """Finding options.""" + guidance_options: Optional["_models.GuidanceOptions"] = rest_field( + name="guidanceOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """Guidance options.""" + quality_measure_options: Optional["_models.QualityMeasureOptions"] = rest_field( + name="qualityMeasureOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """QualityMeasureOptions.""" @overload def __init__( @@ -2268,24 +2745,25 @@ def __init__( *, followup_recommendation_options: Optional["_models.FollowupRecommendationOptions"] = None, finding_options: Optional["_models.FindingOptions"] = None, - ): ... + guidance_options: Optional["_models.GuidanceOptions"] = None, + quality_measure_options: Optional["_models.QualityMeasureOptions"] = None, + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RadiologyInsightsInferenceResult(_model_base.Model): +class RadiologyInsightsInferenceResult(_Model): """The inference results for the Radiology Insights request. If field 'status' has value 'succeeded', then field 'result' will contain an instance of RadiologyInsightsInferenceResult. - :ivar patient_results: Results for the patients given in the request. Required. :vartype patient_results: list[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsPatientResult] @@ -2294,9 +2772,11 @@ class RadiologyInsightsInferenceResult(_model_base.Model): :vartype model_version: str """ - patient_results: List["_models.RadiologyInsightsPatientResult"] = rest_field(name="patientResults") + patient_results: List["_models.RadiologyInsightsPatientResult"] = rest_field( + name="patientResults", visibility=["read", "create", "update", "delete", "query"] + ) """Results for the patients given in the request. Required.""" - model_version: str = rest_field(name="modelVersion") + model_version: str = rest_field(name="modelVersion", visibility=["read", "create", "update", "delete", "query"]) """The version of the model used for inference, expressed as the model date. Required.""" @overload @@ -2305,25 +2785,22 @@ def __init__( *, patient_results: List["_models.RadiologyInsightsPatientResult"], model_version: str, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RadiologyInsightsJob(_model_base.Model): +class RadiologyInsightsJob(_Model): """Response for the Radiology Insights request. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_data: The request data for the operation. :vartype job_data: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsData :ivar result: The result of the operation. @@ -2341,7 +2818,7 @@ class RadiologyInsightsJob(_model_base.Model): :ivar updated_at: The date and time when the processing job was last updated. :vartype updated_at: ~datetime.datetime :ivar error: Error object that describes the error when status is "Failed". - :vartype error: ~azure.core.HttpResponseError + :vartype error: ~azure.core.ODataV4Format """ job_data: Optional["_models.RadiologyInsightsData"] = rest_field(name="jobData", visibility=["read", "create"]) @@ -2359,7 +2836,7 @@ class RadiologyInsightsJob(_model_base.Model): """The date and time when the processing job is set to expire.""" updated_at: Optional[datetime.datetime] = rest_field(name="updatedAt", visibility=["read"], format="rfc3339") """The date and time when the processing job was last updated.""" - error: Optional[HttpResponseError] = rest_field(visibility=["read"]) + error: Optional[ODataV4Format] = rest_field(visibility=["read"]) """Error object that describes the error when status is \"Failed\".""" @overload @@ -2367,20 +2844,20 @@ def __init__( self, *, job_data: Optional["_models.RadiologyInsightsData"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RadiologyInsightsModelConfiguration(_model_base.Model): +class RadiologyInsightsModelConfiguration(_Model): """Configuration affecting the Radiology Insights model's inference. :ivar verbose: An indication whether the model should produce verbose output. @@ -2402,19 +2879,23 @@ class RadiologyInsightsModelConfiguration(_model_base.Model): :vartype locale: str """ - verbose: Optional[bool] = rest_field() + verbose: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """An indication whether the model should produce verbose output.""" - include_evidence: Optional[bool] = rest_field(name="includeEvidence") + include_evidence: Optional[bool] = rest_field( + name="includeEvidence", visibility=["read", "create", "update", "delete", "query"] + ) """An indication whether the model's output should include evidence for the inferences.""" inference_types: Optional[List[Union[str, "_models.RadiologyInsightsInferenceType"]]] = rest_field( - name="inferenceTypes" + name="inferenceTypes", visibility=["read", "create", "update", "delete", "query"] ) """This is a list of inference types to be inferred for the current request. It could be used if only part of the Radiology Insights inferences are required. If this list is omitted or empty, the model will return all the inference types.""" - inference_options: Optional["_models.RadiologyInsightsInferenceOptions"] = rest_field(name="inferenceOptions") + inference_options: Optional["_models.RadiologyInsightsInferenceOptions"] = rest_field( + name="inferenceOptions", visibility=["read", "create", "update", "delete", "query"] + ) """Options regarding follow up recommendation inferences and finding inferences.""" - locale: Optional[str] = rest_field() + locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Local for the model to use. If not specified, the model will use the default locale.""" @overload @@ -2426,23 +2907,22 @@ def __init__( inference_types: Optional[List[Union[str, "_models.RadiologyInsightsInferenceType"]]] = None, inference_options: Optional["_models.RadiologyInsightsInferenceOptions"] = None, locale: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RadiologyInsightsPatientResult(_model_base.Model): +class RadiologyInsightsPatientResult(_Model): """Results of the model's work for a single patient. - :ivar patient_id: Identifier given for the patient in the request. Required. :vartype patient_id: str :ivar inferences: The model's inferences for the given patient. Required. @@ -2450,9 +2930,11 @@ class RadiologyInsightsPatientResult(_model_base.Model): list[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInference] """ - patient_id: str = rest_field(name="patientId") + patient_id: str = rest_field(name="patientId", visibility=["read", "create", "update", "delete", "query"]) """Identifier given for the patient in the request. Required.""" - inferences: List["_models.RadiologyInsightsInference"] = rest_field() + inferences: List["_models.RadiologyInsightsInference"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The model's inferences for the given patient. Required.""" @overload @@ -2461,16 +2943,16 @@ def __init__( *, patient_id: str, inferences: List["_models.RadiologyInsightsInference"], - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2478,7 +2960,6 @@ class RadiologyProcedureInference(RadiologyInsightsInference, discriminator="rad """Radiology procedures are the specific imaging studies or examinations ordered for the patient, extracted from the document information and text. - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Radiology Procedure inference type @@ -2493,13 +2974,19 @@ class RadiologyProcedureInference(RadiologyInsightsInference, discriminator="rad :vartype ordered_procedure: ~azure.healthinsights.radiologyinsights.models.OrderedProcedure """ - kind: Literal[RadiologyInsightsInferenceType.RADIOLOGY_PROCEDURE] = rest_discriminator(name="kind") # type: ignore + kind: Literal[RadiologyInsightsInferenceType.RADIOLOGY_PROCEDURE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Inference type. Required. Radiology Procedure inference type""" - procedure_codes: Optional[List["_models.CodeableConcept"]] = rest_field(name="procedureCodes") + procedure_codes: Optional[List["_models.CodeableConcept"]] = rest_field( + name="procedureCodes", visibility=["read", "create", "update", "delete", "query"] + ) """LOINC codes for the procedure.""" - imaging_procedures: List["_models.ImagingProcedure"] = rest_field(name="imagingProcedures") + imaging_procedures: List["_models.ImagingProcedure"] = rest_field( + name="imagingProcedures", visibility=["read", "create", "update", "delete", "query"] + ) """Imaging procedures. Required.""" - ordered_procedure: "_models.OrderedProcedure" = rest_field(name="orderedProcedure") + ordered_procedure: "_models.OrderedProcedure" = rest_field( + name="orderedProcedure", visibility=["read", "create", "update", "delete", "query"] + ) """Ordered procedure information from the document information or text. Required.""" @overload @@ -2510,16 +2997,16 @@ def __init__( ordered_procedure: "_models.OrderedProcedure", extension: Optional[List["_models.Extension"]] = None, procedure_codes: Optional[List["_models.CodeableConcept"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=RadiologyInsightsInferenceType.RADIOLOGY_PROCEDURE, **kwargs) @@ -2533,9 +3020,9 @@ class Range(Element): :vartype high: ~azure.healthinsights.radiologyinsights.models.Quantity """ - low: Optional["_models.Quantity"] = rest_field() + low: Optional["_models.Quantity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Low limit.""" - high: Optional["_models.Quantity"] = rest_field() + high: Optional["_models.Quantity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """High limit.""" @overload @@ -2544,16 +3031,16 @@ def __init__( *, low: Optional["_models.Quantity"] = None, high: Optional["_models.Quantity"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2567,9 +3054,9 @@ class Ratio(Element): :vartype denominator: ~azure.healthinsights.radiologyinsights.models.Quantity """ - numerator: Optional["_models.Quantity"] = rest_field() + numerator: Optional["_models.Quantity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Numerator value.""" - denominator: Optional["_models.Quantity"] = rest_field() + denominator: Optional["_models.Quantity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Denominator value.""" @overload @@ -2578,23 +3065,22 @@ def __init__( *, numerator: Optional["_models.Quantity"] = None, denominator: Optional["_models.Quantity"] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RecommendationFinding(_model_base.Model): +class RecommendationFinding(_Model): """Finding reference for recommendation. - :ivar finding: Finding linked to a recommendation. :vartype finding: ~azure.healthinsights.radiologyinsights.models.Observation :ivar critical_finding: Critical result linked to a recommendation. @@ -2607,16 +3093,20 @@ class RecommendationFinding(_model_base.Model): :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] """ - finding: Optional["_models.Observation"] = rest_field() + finding: Optional["_models.Observation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Finding linked to a recommendation.""" - critical_finding: Optional["_models.CriticalResult"] = rest_field(name="criticalFinding") + critical_finding: Optional["_models.CriticalResult"] = rest_field( + name="criticalFinding", visibility=["read", "create", "update", "delete", "query"] + ) """Critical result linked to a recommendation.""" recommendation_finding_status: Union[str, "_models.RecommendationFindingStatusType"] = rest_field( - name="recommendationFindingStatus" + name="recommendationFindingStatus", visibility=["read", "create", "update", "delete", "query"] ) """Recommendation finding status. Required. Known values are: \"present\", \"differential\", \"ruleOut\", and \"conditional\".""" - extension: Optional[List["_models.Extension"]] = rest_field() + extension: Optional[List["_models.Extension"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Additional Content defined by implementations.""" @overload @@ -2627,16 +3117,16 @@ def __init__( finding: Optional["_models.Observation"] = None, critical_finding: Optional["_models.CriticalResult"] = None, extension: Optional[List["_models.Extension"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2654,13 +3144,13 @@ class Reference(Element): :vartype display: str """ - reference: Optional[str] = rest_field() + reference: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Literal reference, Relative, internal or absolute URL.""" - type: Optional[str] = rest_field() + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Type the reference refers to (e.g. \"Patient\").""" - identifier: Optional["_models.Identifier"] = rest_field() + identifier: Optional["_models.Identifier"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Logical reference, when literal reference is not known.""" - display: Optional[str] = rest_field() + display: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Text alternative for the resource.""" @overload @@ -2671,16 +3161,16 @@ def __init__( type: Optional[str] = None, identifier: Optional["_models.Identifier"] = None, display: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -2688,7 +3178,6 @@ class SampledData(Element): """A series of measurements taken by a device Based on `FHIR SampledData `_. - :ivar origin: Zero value and units. Required. :vartype origin: ~azure.healthinsights.radiologyinsights.models.Quantity :ivar period: Number of milliseconds between samples. Required. @@ -2705,19 +3194,23 @@ class SampledData(Element): :vartype data: str """ - origin: "_models.Quantity" = rest_field() + origin: "_models.Quantity" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Zero value and units. Required.""" - period: float = rest_field() + period: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Number of milliseconds between samples. Required.""" - factor: Optional[float] = rest_field() + factor: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Multiply data by this before adding to origin.""" - lower_limit: Optional[float] = rest_field(name="lowerLimit") + lower_limit: Optional[float] = rest_field( + name="lowerLimit", visibility=["read", "create", "update", "delete", "query"] + ) """Lower limit of detection.""" - upper_limit: Optional[float] = rest_field(name="upperLimit") + upper_limit: Optional[float] = rest_field( + name="upperLimit", visibility=["read", "create", "update", "delete", "query"] + ) """Upper limit of detection.""" - dimensions: int = rest_field() + dimensions: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Number of sample points at each time point. Required.""" - data: Optional[str] = rest_field() + data: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Decimal values with spaces, or \"E\" | \"U\" | \"L\".""" @overload @@ -2731,26 +3224,103 @@ def __init__( lower_limit: Optional[float] = None, upper_limit: Optional[float] = None, data: Optional[str] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ScoringAndAssessmentInference(RadiologyInsightsInference, discriminator="scoringAndAssessment"): + """Identifies and highlights Risk, Scoring, Assessment and Classifications and correspondent + values dictated in a report, e.g. 'BIRADS 5'. + + :ivar extension: Additional Content defined by implementations. + :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] + :ivar kind: Inference type. Required. Scoring and assessment inference type + :vartype kind: str or ~azure.healthinsights.radiologyinsights.models.SCORING_AND_ASSESSMENT + :ivar category: Category, e.g. BIRADS. Required. Known values are: "BIRADS", "C-RADS COLONIC + FINDINGS", "CAD-RADS", "LI-RADS", "LUNG-RADS", "NI-RADS", "O-RADS", "PI-RADS", "TI-RADS", + "C-RADS EXTRACOLONIC FINDINGS", "LIFETIME BREAST CANCER RISK", "ASCVD RISK", "MODIFIED GAIL + MODEL RISK", "TYRER CUSICK MODEL RISK", "AGATSTON SCORE", "10 YEAR CHD RISK", "Z-SCORE", + "T-SCORE", "CALCIUM VOLUME SCORE", "US LI-RADS VISUALIZATION SCORE", "US LI-RADS", "CEUS + LI-RADS", "TREATMENT RESPONSE LI-RADS", "O-RADS MRI", "CALCIUM MASS SCORE", "RISK OF MALIGNANCY + INDEX", "HNPCC MUTATION RISK", "ALBERTA STROKE PROGRAM EARLY CT SCORE", "KELLGREN-LAWRENCE + GRADING SCALE", "TONNIS CLASSIFICATION", "CALCIUM SCORE (UNSPECIFIED)", "10 YEAR CHD RISK + (OBSERVED AGE)", "10 YEAR CHD RISK (ARTERIAL AGE)", and "FRAX SCORE". + :vartype category: str or + ~azure.healthinsights.radiologyinsights.models.ScoringAndAssessmentCategoryType + :ivar category_description: The expansion of the category (which is an abbreviation.). + Required. + :vartype category_description: str + :ivar single_value: The value. If the value is a range, use field valueRange. + :vartype single_value: str + :ivar range_value: The range. + :vartype range_value: ~azure.healthinsights.radiologyinsights.models.AssessmentValueRange + """ + + kind: Literal[RadiologyInsightsInferenceType.SCORING_AND_ASSESSMENT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Inference type. Required. Scoring and assessment inference type""" + category: Union[str, "_models.ScoringAndAssessmentCategoryType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Category, e.g. BIRADS. Required. Known values are: \"BIRADS\", \"C-RADS COLONIC FINDINGS\", + \"CAD-RADS\", \"LI-RADS\", \"LUNG-RADS\", \"NI-RADS\", \"O-RADS\", \"PI-RADS\", \"TI-RADS\", + \"C-RADS EXTRACOLONIC FINDINGS\", \"LIFETIME BREAST CANCER RISK\", \"ASCVD RISK\", \"MODIFIED + GAIL MODEL RISK\", \"TYRER CUSICK MODEL RISK\", \"AGATSTON SCORE\", \"10 YEAR CHD RISK\", + \"Z-SCORE\", \"T-SCORE\", \"CALCIUM VOLUME SCORE\", \"US LI-RADS VISUALIZATION SCORE\", \"US + LI-RADS\", \"CEUS LI-RADS\", \"TREATMENT RESPONSE LI-RADS\", \"O-RADS MRI\", \"CALCIUM MASS + SCORE\", \"RISK OF MALIGNANCY INDEX\", \"HNPCC MUTATION RISK\", \"ALBERTA STROKE PROGRAM EARLY + CT SCORE\", \"KELLGREN-LAWRENCE GRADING SCALE\", \"TONNIS CLASSIFICATION\", \"CALCIUM SCORE + (UNSPECIFIED)\", \"10 YEAR CHD RISK (OBSERVED AGE)\", \"10 YEAR CHD RISK (ARTERIAL AGE)\", and + \"FRAX SCORE\".""" + category_description: str = rest_field( + name="categoryDescription", visibility=["read", "create", "update", "delete", "query"] + ) + """The expansion of the category (which is an abbreviation.). Required.""" + single_value: Optional[str] = rest_field( + name="singleValue", visibility=["read", "create", "update", "delete", "query"] + ) + """The value. If the value is a range, use field valueRange.""" + range_value: Optional["_models.AssessmentValueRange"] = rest_field( + name="rangeValue", visibility=["read", "create", "update", "delete", "query"] + ) + """The range.""" + + @overload + def __init__( + self, + *, + category: Union[str, "_models.ScoringAndAssessmentCategoryType"], + category_description: str, + extension: Optional[List["_models.Extension"]] = None, + single_value: Optional[str] = None, + range_value: Optional["_models.AssessmentValueRange"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, kind=RadiologyInsightsInferenceType.SCORING_AND_ASSESSMENT, **kwargs) + + class SexMismatchInference(RadiologyInsightsInference, discriminator="sexMismatch"): """A notification for a sex mismatch is displayed when the gender, personal pronouns, gender-related body parts, or gender-related procedures mentioned in a patient's clinical document are either inconsistent or do not match the gender specified in the patient information. - :ivar extension: Additional Content defined by implementations. :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Sex mismatch inference type @@ -2759,9 +3329,11 @@ class SexMismatchInference(RadiologyInsightsInference, discriminator="sexMismatc :vartype sex_indication: ~azure.healthinsights.radiologyinsights.models.CodeableConcept """ - kind: Literal[RadiologyInsightsInferenceType.SEX_MISMATCH] = rest_discriminator(name="kind") # type: ignore + kind: Literal[RadiologyInsightsInferenceType.SEX_MISMATCH] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Inference type. Required. Sex mismatch inference type""" - sex_indication: "_models.CodeableConcept" = rest_field(name="sexIndication") + sex_indication: "_models.CodeableConcept" = rest_field( + name="sexIndication", visibility=["read", "create", "update", "delete", "query"] + ) """Sex indication : SNOMED CT code for gender finding. Required.""" @overload @@ -2770,20 +3342,20 @@ def __init__( *, sex_indication: "_models.CodeableConcept", extension: Optional[List["_models.Extension"]] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=RadiologyInsightsInferenceType.SEX_MISMATCH, **kwargs) -class TimePeriod(_model_base.Model): +class TimePeriod(_Model): """A duration of time during which an event is happening. :ivar start: Starting time with inclusive boundary. @@ -2792,9 +3364,13 @@ class TimePeriod(_model_base.Model): :vartype end: ~datetime.datetime """ - start: Optional[datetime.datetime] = rest_field(format="rfc3339") + start: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """Starting time with inclusive boundary.""" - end: Optional[datetime.datetime] = rest_field(format="rfc3339") + end: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """End time with inclusive boundary, if not ongoing.""" @overload @@ -2803,14 +3379,14 @@ def __init__( *, start: Optional[datetime.datetime] = None, end: Optional[datetime.datetime] = None, - ): ... + ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]): + def __init__(self, mapping: Mapping[str, Any]) -> None: """ :param mapping: raw JSON to initialize the model. :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_patch.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_patch.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/models/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/conftest.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/conftest.py new file mode 100644 index 000000000000..9e422a805079 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/conftest.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + radiologyinsights_subscription_id = os.environ.get( + "RADIOLOGYINSIGHTS_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + radiologyinsights_tenant_id = os.environ.get("RADIOLOGYINSIGHTS_TENANT_ID", "00000000-0000-0000-0000-000000000000") + radiologyinsights_client_id = os.environ.get("RADIOLOGYINSIGHTS_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + radiologyinsights_client_secret = os.environ.get( + "RADIOLOGYINSIGHTS_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer(regex=radiologyinsights_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=radiologyinsights_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=radiologyinsights_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=radiologyinsights_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/test_radiology_insights.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/test_radiology_insights.py new file mode 100644 index 000000000000..c3eb1e692af3 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/test_radiology_insights.py @@ -0,0 +1,474 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import RadiologyInsightsClientTestBase, RadiologyInsightsPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRadiologyInsights(RadiologyInsightsClientTestBase): + @RadiologyInsightsPreparer() + @recorded_by_proxy + def test_begin_infer_radiology_insights(self, radiologyinsights_endpoint): + client = self.create_client(endpoint=radiologyinsights_endpoint) + response = client.begin_infer_radiology_insights( + id="str", + resource={ + "id": "str", + "status": "str", + "createdAt": "2020-02-20 00:00:00", + "error": ~azure.core.ODataV4Format, + "expiresAt": "2020-02-20 00:00:00", + "jobData": { + "patients": [ + { + "id": "str", + "details": { + "birthDate": "2020-02-20", + "clinicalInfo": [ + { + "resourceType": "str", + "id": "str", + "implicitRules": "str", + "language": "str", + "meta": { + "lastUpdated": "str", + "profile": ["str"], + "security": [ + { + "code": "str", + "display": "str", + "extension": [ + { + "url": "str", + "valueBoolean": bool, + "valueCodeableConcept": {"coding": [...], "text": "str"}, + "valueDateTime": "str", + "valueInteger": 0, + "valuePeriod": {"end": "str", "start": "str"}, + "valueQuantity": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "valueRange": { + "high": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "low": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueRatio": { + "denominator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "numerator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueReference": { + "display": "str", + "identifier": { + "assigner": ..., + "period": {"end": "str", "start": "str"}, + "system": "str", + "type": {"coding": [...], "text": "str"}, + "use": "str", + "value": "str", + }, + "reference": "str", + "type": "str", + }, + "valueSampledData": { + "dimensions": 0, + "origin": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "period": 0.0, + "data": "str", + "factor": 0.0, + "lowerLimit": 0.0, + "upperLimit": 0.0, + }, + "valueString": "str", + "valueTime": "12:30:00", + } + ], + "id": "str", + "system": "str", + "version": "str", + } + ], + "source": "str", + "tag": [ + { + "code": "str", + "display": "str", + "extension": [ + { + "url": "str", + "valueBoolean": bool, + "valueCodeableConcept": {"coding": [...], "text": "str"}, + "valueDateTime": "str", + "valueInteger": 0, + "valuePeriod": {"end": "str", "start": "str"}, + "valueQuantity": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "valueRange": { + "high": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "low": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueRatio": { + "denominator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "numerator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueReference": { + "display": "str", + "identifier": { + "assigner": ..., + "period": {"end": "str", "start": "str"}, + "system": "str", + "type": {"coding": [...], "text": "str"}, + "use": "str", + "value": "str", + }, + "reference": "str", + "type": "str", + }, + "valueSampledData": { + "dimensions": 0, + "origin": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "period": 0.0, + "data": "str", + "factor": 0.0, + "lowerLimit": 0.0, + "upperLimit": 0.0, + }, + "valueString": "str", + "valueTime": "12:30:00", + } + ], + "id": "str", + "system": "str", + "version": "str", + } + ], + "versionId": "str", + }, + } + ], + "sex": "str", + }, + "encounters": [ + { + "id": "str", + "class": "str", + "period": {"end": "2020-02-20 00:00:00", "start": "2020-02-20 00:00:00"}, + } + ], + "patientDocuments": [ + { + "content": {"sourceType": "str", "value": "str"}, + "id": "str", + "type": "str", + "administrativeMetadata": { + "encounterId": "str", + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", + "display": "str", + "extension": [ + { + "url": "str", + "valueBoolean": bool, + "valueCodeableConcept": ..., + "valueDateTime": "str", + "valueInteger": 0, + "valuePeriod": {"end": "str", "start": "str"}, + "valueQuantity": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "valueRange": { + "high": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "low": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueRatio": { + "denominator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "numerator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueReference": { + "display": "str", + "identifier": { + "assigner": ..., + "period": {"end": "str", "start": "str"}, + "system": "str", + "type": ..., + "use": "str", + "value": "str", + }, + "reference": "str", + "type": "str", + }, + "valueSampledData": { + "dimensions": 0, + "origin": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "period": 0.0, + "data": "str", + "factor": 0.0, + "lowerLimit": 0.0, + "upperLimit": 0.0, + }, + "valueString": "str", + "valueTime": "12:30:00", + } + ], + "id": "str", + "system": "str", + "version": "str", + } + ], + "text": "str", + }, + "description": "str", + "extension": [ + { + "url": "str", + "valueBoolean": bool, + "valueCodeableConcept": { + "coding": [ + { + "code": "str", + "display": "str", + "extension": [...], + "id": "str", + "system": "str", + "version": "str", + } + ], + "text": "str", + }, + "valueDateTime": "str", + "valueInteger": 0, + "valuePeriod": {"end": "str", "start": "str"}, + "valueQuantity": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "valueRange": { + "high": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "low": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueRatio": { + "denominator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "numerator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueReference": { + "display": "str", + "identifier": { + "assigner": ..., + "period": {"end": "str", "start": "str"}, + "system": "str", + "type": { + "coding": [ + { + "code": "str", + "display": "str", + "extension": [...], + "id": "str", + "system": "str", + "version": "str", + } + ], + "text": "str", + }, + "use": "str", + "value": "str", + }, + "reference": "str", + "type": "str", + }, + "valueSampledData": { + "dimensions": 0, + "origin": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "period": 0.0, + "data": "str", + "factor": 0.0, + "lowerLimit": 0.0, + "upperLimit": 0.0, + }, + "valueString": "str", + "valueTime": "12:30:00", + } + ], + } + ], + }, + "authors": [{"fullName": "str", "id": "str"}], + "clinicalType": "str", + "createdAt": "2020-02-20 00:00:00", + "language": "str", + "specialtyType": "str", + } + ], + } + ], + "configuration": { + "includeEvidence": bool, + "inferenceOptions": { + "findingOptions": {"provideFocusedSentenceEvidence": bool}, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + "includeRecommendationsWithNoSpecifiedModality": bool, + "provideFocusedSentenceEvidence": bool, + }, + "guidanceOptions": {"showGuidanceInHistory": bool}, + "qualityMeasureOptions": {"measureTypes": ["str"]}, + }, + "inferenceTypes": ["str"], + "locale": "str", + "verbose": bool, + }, + }, + "result": { + "modelVersion": "str", + "patientResults": [{"inferences": ["radiology_insights_inference"], "patientId": "str"}], + }, + "updatedAt": "2020-02-20 00:00:00", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/test_radiology_insights_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/test_radiology_insights_async.py new file mode 100644 index 000000000000..432850edbc14 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/test_radiology_insights_async.py @@ -0,0 +1,486 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import RadiologyInsightsPreparer +from testpreparer_async import RadiologyInsightsClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRadiologyInsightsAsync(RadiologyInsightsClientTestBaseAsync): + @RadiologyInsightsPreparer() + @recorded_by_proxy_async + async def test_begin_infer_radiology_insights(self, radiologyinsights_endpoint): + client = self.create_async_client(endpoint=radiologyinsights_endpoint) + response = await ( + await client.begin_infer_radiology_insights( + id="str", + resource={ + "id": "str", + "status": "str", + "createdAt": "2020-02-20 00:00:00", + "error": ~azure.core.ODataV4Format, + "expiresAt": "2020-02-20 00:00:00", + "jobData": { + "patients": [ + { + "id": "str", + "details": { + "birthDate": "2020-02-20", + "clinicalInfo": [ + { + "resourceType": "str", + "id": "str", + "implicitRules": "str", + "language": "str", + "meta": { + "lastUpdated": "str", + "profile": ["str"], + "security": [ + { + "code": "str", + "display": "str", + "extension": [ + { + "url": "str", + "valueBoolean": bool, + "valueCodeableConcept": { + "coding": [...], + "text": "str", + }, + "valueDateTime": "str", + "valueInteger": 0, + "valuePeriod": {"end": "str", "start": "str"}, + "valueQuantity": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "valueRange": { + "high": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "low": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueRatio": { + "denominator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "numerator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueReference": { + "display": "str", + "identifier": { + "assigner": ..., + "period": {"end": "str", "start": "str"}, + "system": "str", + "type": {"coding": [...], "text": "str"}, + "use": "str", + "value": "str", + }, + "reference": "str", + "type": "str", + }, + "valueSampledData": { + "dimensions": 0, + "origin": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "period": 0.0, + "data": "str", + "factor": 0.0, + "lowerLimit": 0.0, + "upperLimit": 0.0, + }, + "valueString": "str", + "valueTime": "12:30:00", + } + ], + "id": "str", + "system": "str", + "version": "str", + } + ], + "source": "str", + "tag": [ + { + "code": "str", + "display": "str", + "extension": [ + { + "url": "str", + "valueBoolean": bool, + "valueCodeableConcept": { + "coding": [...], + "text": "str", + }, + "valueDateTime": "str", + "valueInteger": 0, + "valuePeriod": {"end": "str", "start": "str"}, + "valueQuantity": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "valueRange": { + "high": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "low": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueRatio": { + "denominator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "numerator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueReference": { + "display": "str", + "identifier": { + "assigner": ..., + "period": {"end": "str", "start": "str"}, + "system": "str", + "type": {"coding": [...], "text": "str"}, + "use": "str", + "value": "str", + }, + "reference": "str", + "type": "str", + }, + "valueSampledData": { + "dimensions": 0, + "origin": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "period": 0.0, + "data": "str", + "factor": 0.0, + "lowerLimit": 0.0, + "upperLimit": 0.0, + }, + "valueString": "str", + "valueTime": "12:30:00", + } + ], + "id": "str", + "system": "str", + "version": "str", + } + ], + "versionId": "str", + }, + } + ], + "sex": "str", + }, + "encounters": [ + { + "id": "str", + "class": "str", + "period": {"end": "2020-02-20 00:00:00", "start": "2020-02-20 00:00:00"}, + } + ], + "patientDocuments": [ + { + "content": {"sourceType": "str", "value": "str"}, + "id": "str", + "type": "str", + "administrativeMetadata": { + "encounterId": "str", + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", + "display": "str", + "extension": [ + { + "url": "str", + "valueBoolean": bool, + "valueCodeableConcept": ..., + "valueDateTime": "str", + "valueInteger": 0, + "valuePeriod": {"end": "str", "start": "str"}, + "valueQuantity": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "valueRange": { + "high": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "low": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueRatio": { + "denominator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "numerator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueReference": { + "display": "str", + "identifier": { + "assigner": ..., + "period": { + "end": "str", + "start": "str", + }, + "system": "str", + "type": ..., + "use": "str", + "value": "str", + }, + "reference": "str", + "type": "str", + }, + "valueSampledData": { + "dimensions": 0, + "origin": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "period": 0.0, + "data": "str", + "factor": 0.0, + "lowerLimit": 0.0, + "upperLimit": 0.0, + }, + "valueString": "str", + "valueTime": "12:30:00", + } + ], + "id": "str", + "system": "str", + "version": "str", + } + ], + "text": "str", + }, + "description": "str", + "extension": [ + { + "url": "str", + "valueBoolean": bool, + "valueCodeableConcept": { + "coding": [ + { + "code": "str", + "display": "str", + "extension": [...], + "id": "str", + "system": "str", + "version": "str", + } + ], + "text": "str", + }, + "valueDateTime": "str", + "valueInteger": 0, + "valuePeriod": {"end": "str", "start": "str"}, + "valueQuantity": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "valueRange": { + "high": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "low": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueRatio": { + "denominator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "numerator": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + }, + "valueReference": { + "display": "str", + "identifier": { + "assigner": ..., + "period": {"end": "str", "start": "str"}, + "system": "str", + "type": { + "coding": [ + { + "code": "str", + "display": "str", + "extension": [...], + "id": "str", + "system": "str", + "version": "str", + } + ], + "text": "str", + }, + "use": "str", + "value": "str", + }, + "reference": "str", + "type": "str", + }, + "valueSampledData": { + "dimensions": 0, + "origin": { + "code": "str", + "comparator": "str", + "system": "str", + "unit": "str", + "value": 0.0, + }, + "period": 0.0, + "data": "str", + "factor": 0.0, + "lowerLimit": 0.0, + "upperLimit": 0.0, + }, + "valueString": "str", + "valueTime": "12:30:00", + } + ], + } + ], + }, + "authors": [{"fullName": "str", "id": "str"}], + "clinicalType": "str", + "createdAt": "2020-02-20 00:00:00", + "language": "str", + "specialtyType": "str", + } + ], + } + ], + "configuration": { + "includeEvidence": bool, + "inferenceOptions": { + "findingOptions": {"provideFocusedSentenceEvidence": bool}, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + "includeRecommendationsWithNoSpecifiedModality": bool, + "provideFocusedSentenceEvidence": bool, + }, + "guidanceOptions": {"showGuidanceInHistory": bool}, + "qualityMeasureOptions": {"measureTypes": ["str"]}, + }, + "inferenceTypes": ["str"], + "locale": "str", + "verbose": bool, + }, + }, + "result": { + "modelVersion": "str", + "patientResults": [{"inferences": ["radiology_insights_inference"], "patientId": "str"}], + }, + "updatedAt": "2020-02-20 00:00:00", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/testpreparer.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/testpreparer.py new file mode 100644 index 000000000000..ec55a05d610b --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/testpreparer.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.healthinsights.radiologyinsights import RadiologyInsightsClient +from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer +import functools + + +class RadiologyInsightsClientTestBase(AzureRecordedTestCase): + + def create_client(self, endpoint): + credential = self.get_credential(RadiologyInsightsClient) + return self.create_client_from_credential( + RadiologyInsightsClient, + credential=credential, + endpoint=endpoint, + ) + + +RadiologyInsightsPreparer = functools.partial( + PowerShellPreparer, "radiologyinsights", radiologyinsights_endpoint="https://fake_radiologyinsights_endpoint.com" +) diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/testpreparer_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/testpreparer_async.py new file mode 100644 index 000000000000..d95a566f99fa --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/generated_tests/testpreparer_async.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.healthinsights.radiologyinsights.aio import RadiologyInsightsClient +from devtools_testutils import AzureRecordedTestCase + + +class RadiologyInsightsClientTestBaseAsync(AzureRecordedTestCase): + + def create_async_client(self, endpoint): + credential = self.get_credential(RadiologyInsightsClient, is_async=True) + return self.create_client_from_credential( + RadiologyInsightsClient, + credential=credential, + endpoint=endpoint, + ) diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_age_mismatch_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_age_mismatch_inference.py index 6a11f1392a03..d80a78afdb5e 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_age_mismatch_inference.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_age_mismatch_inference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_age_mismatch_inference_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_age_mismatch_inference_async.py index 606fd029a94b..5d5405655dd6 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_age_mismatch_inference_async.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_age_mismatch_inference_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrepancy_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrepancy_inference.py index 95ec224d9168..1d97f0db13d6 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrepancy_inference.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrepancy_inference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrepancy_inference_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrepancy_inference_async.py index e207a8d365a1..97c8f0d89880 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrepancy_inference_async.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrepancy_inference_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_critical_result_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_critical_result_inference.py index 707c6b895501..460bf09456e8 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_critical_result_inference.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_critical_result_inference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_critical_result_inference_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_critical_result_inference_async.py index ec721c715fc4..e0b9eaa9bbb3 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_critical_result_inference_async.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_critical_result_inference_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference.py index 0c1ea1a5c79e..be729f47e247 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference_async.py index f761b1f4352b..717e4df130a2 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference_async.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_communication_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_communication_inference.py index a31becfe5e0e..ff03c7257245 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_communication_inference.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_communication_inference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_communication_inference_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_communication_inference_async.py index bc0c84482422..2928d2248d3b 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_communication_inference_async.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_communication_inference_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_recommendation_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_recommendation_inference.py index 58b942a7222c..4ed5dc6afa50 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_recommendation_inference.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_recommendation_inference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_recommendation_inference_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_recommendation_inference_async.py index 84f8ed24fe2e..fa4c13bba300 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_recommendation_inference_async.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_recommendation_inference_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_laterality_discrepancy_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_laterality_discrepancy_inference.py index 3f418c776a31..a78adb6aefe6 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_laterality_discrepancy_inference.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_laterality_discrepancy_inference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_laterality_discrepancy_inference_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_laterality_discrepancy_inference_async.py index abde63b98d59..e23db9011819 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_laterality_discrepancy_inference_async.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_laterality_discrepancy_inference_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_limited_order_discrepancy_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_limited_order_discrepancy_inference.py index ab5735a655a0..b790909d23ae 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_limited_order_discrepancy_inference.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_limited_order_discrepancy_inference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_limited_order_discrepancy_inference_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_limited_order_discrepancy_inference_async.py index 2af1706d5df8..013228eaf396 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_limited_order_discrepancy_inference_async.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_limited_order_discrepancy_inference_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_radiology_procedure_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_radiology_procedure_inference.py index cb652e969b8b..82757072f9db 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_radiology_procedure_inference.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_radiology_procedure_inference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_radiology_procedure_inference_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_radiology_procedure_inference_async.py index 126788a8a68b..8b79ec5e477d 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_radiology_procedure_inference_async.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_radiology_procedure_inference_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_sex_mismatch_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_sex_mismatch_inference.py index 3c60c83a068f..f1c3232ecfee 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_sex_mismatch_inference.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_sex_mismatch_inference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_sex_mismatch_inference_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_sex_mismatch_inference_async.py index 7cbf130b9d86..5518e721d8c7 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_sex_mismatch_inference_async.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_sex_mismatch_inference_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/setup.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/setup.py index 6cfa272e6186..7776e6ff7ab2 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/setup.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/setup.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -# coding: utf-8 + import os import re @@ -29,7 +29,7 @@ setup( name=PACKAGE_NAME, version=version, - description="Microsoft {} Client Library for Python".format(PACKAGE_PPRINT_NAME), + description="Microsoft Corporation {} Client Library for Python".format(PACKAGE_PPRINT_NAME), long_description=open("README.md", "r").read(), long_description_content_type="text/markdown", license="MIT License", @@ -42,7 +42,6 @@ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -67,5 +66,5 @@ "azure-core>=1.30.0", "typing-extensions>=4.6.0", ], - python_requires=">=3.8", + python_requires=">=3.9", ) diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/tests/test_radiology_insights_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/tests/test_radiology_insights_async.py index c43e1b6c7665..b4e64f065950 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/tests/test_radiology_insights_async.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/tests/test_radiology_insights_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression import functools import datetime import asyncio diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/tests/test_radiology_insights_sync.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/tests/test_radiology_insights_sync.py index 86c23d755a14..82c5ea514892 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/tests/test_radiology_insights_sync.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/tests/test_radiology_insights_sync.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression import functools import datetime diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/tsp-location.yaml b/sdk/healthinsights/azure-healthinsights-radiologyinsights/tsp-location.yaml index 93646ace46f4..d8c65885920b 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/tsp-location.yaml +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/tsp-location.yaml @@ -1,7 +1,6 @@ directory: specification/ai/HealthInsights/HealthInsights.RadiologyInsights -additionalDirectories: -- specification/ai/HealthInsights/HealthInsights.Common/ -- specification/ai/HealthInsights/HealthInsights.OpenAPI/ +commit: b21d3a9d67eaa53f6aa9a2781f4e7fd32df7ed87 repo: Azure/azure-rest-api-specs -commit: db63bea839f5648462c94e685d5cc96f8e8b38ba - +additionalDirectories: +- specification/ai/HealthInsights/HealthInsights.Common +- specification/ai/HealthInsights/HealthInsights.OpenAPI