diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/README.md b/sdk/healthinsights/azure-healthinsights-radiologyinsights/README.md index e941e5d6224f..c52f5b816efe 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/README.md +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/README.md @@ -7,7 +7,7 @@ ### Prequisites -- Python 3.8 or later is required to use this package. +- [Python 3.8+][python] is required to use this package. - You need an [Azure subscription][azure_sub] to use this package. - An existing Cognitive Services Health Insights instance. @@ -51,7 +51,7 @@ az cognitiveservices account keys list --resource-group -```python +```Python import os from azure.core.credentials import AzureKeyCredential from azure.healthinsights.radiologyinsights import RadiologyInsightsClient @@ -76,31 +76,154 @@ Sample code snippets are provided to illustrate using long-running operations [b ## Key concepts +Once you've initialized a 'RadiologyInsightsClient', you can use it to analyse document text by displaying inferences found within the text. +* Age Mismatch +* Laterality Discrepancy +* Sex Mismatch +* Complete Order Discrepancy +* Limited Order Discrepancy +* Finding +* Critical Result +* Follow-up Recommendation +* Communication +* Radiology Procedure Radiology Insights currently supports one document from one patient. Please take a look [here][inferences] for more detailed information about the inferences this service produces. ## Examples -### Create a RadiologyInsights request and get the result using an asynchronous client - +For each inference samples are available that show how to retrieve the information either in a synchronous (block until operation is complete, slower) or in an asynchronous way (non-blocking, faster). For an example how to create a client, a request and get the result see the example in the [sample folder][sample_folder]. +* [Age Mismatch](#get-age-mismatch-inference-information) +* [Complete Order Discrepancy](#get-complete-order-discrepancy-inference-information) +* [Critical Result](#get-critical-result-inference-information) +* [Finding](#get-finding-information) +* [Follow-up Communication](#get-follow-up-communication-information) +* [Follow-up Recommendation](#get-follow-up-recommendation-information) +* [Laterality Descripancy](#get-laterality-discrepancy-information) +* [Limited Order Descripancy](#get-limited-order-discrepancy-information) +* [Radiology Procedure](#get-radiology-procedure-information) +* [Sex Mismatch](#get-sex-mismatch-information) + +### Running the samples + +1. Open a terminal window and `cd` to the directory that the samples are saved in. +2. Set the environment variables specified in the sample file you wish to run. + +### Get Age Mismatch Inference information + + +```Python +for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.AGE_MISMATCH: + print(f"Age Mismatch Inference found") +``` + + +### Get Complete Order Discrepancy Inference information + + +```Python +for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.COMPLETE_ORDER_DISCREPANCY: + print(f"Complete Order Discrepancy Inference found") +``` + + ### Get Critical Result Inference information -```python +```Python for patient_result in radiology_insights_result.patient_results: for ri_inference in patient_result.inferences: - if ( - ri_inference.kind - == models.RadiologyInsightsInferenceType.CRITICAL_RESULT - ): + if ri_inference.kind == models.RadiologyInsightsInferenceType.CRITICAL_RESULT: critical_result = ri_inference.result - print( - f"Critical Result Inference found: {critical_result.description}" - ) + print( + f"Critical Result Inference found: {critical_result.description}") ``` +### Get Finding Inference information + + +```Python +for patient_result in radiology_insights_result.patient_results: + counter = 0 + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.FINDING: + counter += 1 + print(f"Finding Inference found") +``` + + +### Get Follow-up Communication information + + +```Python +for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.FOLLOWUP_COMMUNICATION: + print(f"Follow-up Communication Inference found") +``` + + +### Get Follow-up Recommendation information + + +```Python +for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.FOLLOWUP_RECOMMENDATION: + print(f"Follow-up Recommendation Inference found") +``` + + +### Get Laterality Discrepancy information + + +```Python +for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.LATERALITY_DISCREPANCY: + print(f"Laterality Discrepancy Inference found") +``` + + +### Get Limited Order Discrepancy information + + +```Python +for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.LIMITED_ORDER_DISCREPANCY: + print(f"Limited Order Discrepancy Inference found") +``` + + +### Get Radiology Procedure information + + +```Python +for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.RADIOLOGY_PROCEDURE: + print(f"Radiology Procedure Inference found") +``` + + +### Get Sex Mismatch information + + +```Python +for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.SEX_MISMATCH: + print(f"Sex Mismatch Inference found") +``` + + For detailed conceptual information of this and other inferences please read more [here][inferences]. ## Troubleshooting @@ -140,6 +263,8 @@ see the Code of Conduct FAQ or contact with any additional questions or comments. +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_portal]: https://portal.azure.com [health_insights]: https://learn.microsoft.com/azure/azure-health-insights/overview [radiology_insights_docs]: https://learn.microsoft.com/azure/azure-health-insights/radiology-insights/ [azure_sub]: https://azure.microsoft.com/free/ @@ -148,4 +273,5 @@ additional questions or comments. [azure_cli]: https://learn.microsoft.com/cli/azure/ [inferences]: https://learn.microsoft.com/azure/azure-health-insights/radiology-insights/inferences [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[python]: https://www.python.org/downloads/ [sample_folder]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples \ No newline at end of file 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 bc35db4ec225..ca058cab3c6b 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_client.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_client.py @@ -27,11 +27,10 @@ class 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 needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :keyword api_version: The API version to use for this operation. Default value is - "2023-09-01-preview". Note that overriding this default value may result in unsupported - behavior. + :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. 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 25010ae54065..59281c021b77 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_configuration.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_configuration.py @@ -23,16 +23,15 @@ class RadiologyInsightsClientConfiguration: # pylint: disable=too-many-instance :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). Required. :type endpoint: str - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :keyword api_version: The API version to use for this operation. Default value is - "2023-09-01-preview". Note that overriding this default value may result in unsupported - behavior. + :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 """ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2023-09-01-preview") + api_version: str = kwargs.pop("api_version", "2024-04-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/_operations.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/_operations.py index 36592c0f12cd..2b58db58a2ed 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 @@ -6,12 +6,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import datetime from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import uuid +from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -46,40 +44,46 @@ def build_radiology_insights_infer_radiology_insights_request( # pylint: disable=name-too-long - **kwargs: Any, + id: str, *, expand: Optional[List[str]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _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", "2023-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/radiology-insights/jobs" + _url = "/radiology-insights/jobs/{id}" + path_format_arguments = { + "id": _SERIALIZER.url("id", id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["expand"] = [_SERIALIZER.query("expand", q, "str") if q is not None else "" for q in expand] # Construct headers - if "Repeatability-Request-ID" not in _headers: - _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) - if "Repeatability-First-Sent" not in _headers: - _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( - datetime.datetime.now(datetime.timezone.utc), "rfc-1123" - ) - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) class RadiologyInsightsClientOperationsMixin(RadiologyInsightsClientMixinABC): def _infer_radiology_insights_initial( - self, body: Union[_models.RadiologyInsightsData, JSON, IO[bytes]], **kwargs: Any + self, + id: str, + resource: Union[_models.RadiologyInsightsJob, JSON, IO[bytes]], + *, + expand: Optional[List[str]] = None, + **kwargs: Any ) -> JSON: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -95,12 +99,14 @@ def _infer_radiology_insights_initial( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(resource, (IOBase, bytes)): + _content = resource else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_radiology_insights_infer_radiology_insights_request( + id=id, + expand=expand, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -119,20 +125,29 @@ def _infer_radiology_insights_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 201]: if _stream: response.read() # Load the body in memory and close the socket map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + error = _deserialize(_models.HealthInsightsErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Repeatability-Result"] = self._deserialize( - "str", response.headers.get("Repeatability-Result") - ) + if response.status_code == 200: + response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) - deserialized = _deserialize(JSON, response.json()) + deserialized = _deserialize(JSON, response.json()) + + if response.status_code == 201: + response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + + deserialized = _deserialize(JSON, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -141,122 +156,128 @@ def _infer_radiology_insights_initial( @overload def begin_infer_radiology_insights( - self, body: _models.RadiologyInsightsData, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.RadiologyInsightsInferenceResult]: + self, + id: str, + resource: _models.RadiologyInsightsJob, + *, + expand: Optional[List[str]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RadiologyInsightsJob]: # pylint: disable=line-too-long """Create Radiology Insights job. Creates a Radiology Insights job with the given request body. - :param body: Required. - :type body: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsData + :param id: The unique ID of the job. 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 + :return: An instance of LROPoller that returns RadiologyInsightsJob. The RadiologyInsightsJob + is compatible with MutableMapping :rtype: - ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult] + ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob] :raises ~azure.core.exceptions.HttpResponseError: Example: .. code-block:: python # JSON input template you can fill out and use as your body input. - body = { - "patients": [ - { - "id": "str", # A given identifier for the patient. Has to be - unique across all patients in a single request. Required. - "encounters": [ - { - "id": "str", # The id of the visit. - Required. - "class": "str", # Optional. The class of the - encounter. Known values are: "inpatient", "ambulatory", - "observation", "emergency", "virtual", and "healthHome". - "period": { - "end": "2020-02-20 00:00:00", # - Optional. End time with inclusive boundary, if not ongoing. - "start": "2020-02-20 00:00:00" # - Optional. Starting time with inclusive boundary. - } - } - ], - "info": { - "birthDate": "2020-02-20", # Optional. The patient's - date of birth. - "clinicalInfo": [ - { - "resourceType": "str", # The type of - resource. Required. - "id": "str", # Optional. Resource - Id. - "implicitRules": "str", # Optional. - A set of rules under which this content was created. - "language": "str", # Optional. - Language of the resource content. - "meta": { - "lastUpdated": "str", # - Optional. When the resource last changed - e.g. when the - version changed. - "profile": [ - "str" # Optional. A - list of profiles (references to `StructureDefinition - `_ - resources) that this resource claims to conform to. - The URL is a reference to `StructureDefinition.url - `_. - ], - "security": [ - { - "code": - "str", # Optional. Symbol in syntax defined by - the system. - "display": - "str", # Optional. Representation defined by the - system. - "extension": - [ - { - "url": "str", # Source of the definition - for the extension code - a logical name - or a URL. Required. - "valueBoolean": bool, # Optional. Value - as boolean. + resource = { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. "valueCodeableConcept": { "coding": [ ... ], - "text": "str" # Optional. Plain text - representation of the concept. + "text": "str" # Optional. Plain + text representation of the + concept. }, "valueDateTime": "str", # Optional. - Value as dateTime. - "valueInteger": 0, # Optional. Value as - integer. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. "valuePeriod": { - "end": "str", # Optional. End time - with inclusive boundary, if not - ongoing. - "start": "str" # Optional. Starting - time with inclusive boundary. + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. }, "valueQuantity": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - }, - "valueRange": { - "high": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # Optional. @@ -271,193 +292,199 @@ def begin_infer_radiology_insights( Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, "low": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueRatio": { "denominator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). }, "numerator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueReference": { - "display": "str", # Optional. Text - alternative for the resource. + "display": "str", # Optional. + Text alternative for the + resource. "identifier": { "assigner": ..., "period": { - "end": "str", # Optional. - End time with inclusive - boundary, if not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. }, - "system": "str", # Optional. The - namespace for the identifier - value. + "system": "str", # Optional. + The namespace for the + identifier value. "type": { "coding": [ ... ], - "text": "str" # Optional. - Plain text representation of - the concept. + "text": "str" # + Optional. Plain text + representation of the + concept. }, - "use": "str", # Optional. usual - | official | temp | secondary | - old (If known). - "value": "str" # Optional. The - value that is unique. + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. }, "reference": "str", # Optional. - Literal reference, Relative, internal - or absolute URL. - "type": "str" # Optional. Type the - reference refers to (e.g. "Patient"). + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). }, "valueSampledData": { - "dimensions": 0, # Number of sample - points at each time point. Required. + "dimensions": 0, # Number of + sample points at each time point. + Required. "origin": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). }, "period": 0.0, # Number of - milliseconds between samples. - Required. - "data": "str", # Optional. Decimal - values with spaces, or "E" | "U" | - "L". - "factor": 0.0, # Optional. Multiply - data by this before adding to origin. - "lowerLimit": 0.0, # Optional. Lower - limit of detection. - "upperLimit": 0.0 # Optional. Upper - limit of detection. + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. }, - "valueString": "str", # Optional. Value - as string. + "valueString": "str", # Optional. + Value as string. "valueTime": "12:30:00" # Optional. - Value as time (hh:mm:ss). - } - ], - "id": "str", - # Optional. Unique id for inter-element - referencing. - "system": - "str", # Optional. Identity of the terminology - system. - "version": - "str" # Optional. Version of the system - if - relevant. - } - ], - "source": "str", # Optional. - 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. - "tag": [ - { - "code": - "str", # Optional. Symbol in syntax defined by - the system. - "display": - "str", # Optional. Representation defined by the - system. - "extension": - [ - { - "url": "str", # Source of the definition - for the extension code - a logical name - or a URL. Required. - "valueBoolean": bool, # Optional. Value - as boolean. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. "valueCodeableConcept": { "coding": [ ... ], - "text": "str" # Optional. Plain text - representation of the concept. + "text": "str" # Optional. Plain + text representation of the + concept. }, "valueDateTime": "str", # Optional. - Value as dateTime. - "valueInteger": 0, # Optional. Value as - integer. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. "valuePeriod": { - "end": "str", # Optional. End time - with inclusive boundary, if not - ongoing. - "start": "str" # Optional. Starting - time with inclusive boundary. + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. }, "valueQuantity": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - }, - "valueRange": { - "high": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # Optional. @@ -472,217 +499,243 @@ def begin_infer_radiology_insights( Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, "low": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueRatio": { "denominator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). }, "numerator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueReference": { - "display": "str", # Optional. Text - alternative for the resource. + "display": "str", # Optional. + Text alternative for the + resource. "identifier": { "assigner": ..., "period": { - "end": "str", # Optional. - End time with inclusive - boundary, if not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. }, - "system": "str", # Optional. The - namespace for the identifier - value. + "system": "str", # Optional. + The namespace for the + identifier value. "type": { "coding": [ ... ], - "text": "str" # Optional. - Plain text representation of - the concept. + "text": "str" # + Optional. Plain text + representation of the + concept. }, - "use": "str", # Optional. usual - | official | temp | secondary | - old (If known). - "value": "str" # Optional. The - value that is unique. + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. }, "reference": "str", # Optional. - Literal reference, Relative, internal - or absolute URL. - "type": "str" # Optional. Type the - reference refers to (e.g. "Patient"). + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). }, "valueSampledData": { - "dimensions": 0, # Number of sample - points at each time point. Required. + "dimensions": 0, # Number of + sample points at each time point. + Required. "origin": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). }, "period": 0.0, # Number of - milliseconds between samples. - Required. - "data": "str", # Optional. Decimal - values with spaces, or "E" | "U" | - "L". - "factor": 0.0, # Optional. Multiply - data by this before adding to origin. - "lowerLimit": 0.0, # Optional. Lower - limit of detection. - "upperLimit": 0.0 # Optional. Upper - limit of detection. + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. }, - "valueString": "str", # Optional. Value - as string. + "valueString": "str", # Optional. + Value as string. "valueTime": "12:30:00" # Optional. - Value as time (hh:mm:ss). - } - ], - "id": "str", - # Optional. Unique id for inter-element - referencing. - "system": - "str", # Optional. Identity of the terminology - system. - "version": - "str" # Optional. Version of the system - if - relevant. - } - ], - "versionId": "str" # - Optional. 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. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. } } ], - "sex": "str" # Optional. The patient's sex. Known - values are: "female", "male", and "unspecified". - }, - "patientDocuments": [ - { - "content": { - "sourceType": "str", # 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" # The content of the - document, given either inline (as a string) or as a reference - (URI). Required. - }, - "id": "str", # A given identifier for the - document. Has to be unique across all documents for a single - patient. Required. - "type": "str", # 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". - "administrativeMetadata": { - "encounterId": "str", # Optional. - Reference to the encounter associated with the document. - "orderedProcedures": [ - { - "code": { - "coding": [ - { + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { "code": "str", # Optional. Symbol in - syntax defined by the system. + syntax defined by the system. "display": "str", # Optional. - Representation defined by the system. + Representation defined by the system. "extension": [ { - "url": "str", # Source of the - definition for the extension code - - a logical name or a URL. - Required. + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. "valueBoolean": bool, # - Optional. Value as boolean. + Optional. Value as boolean. "valueCodeableConcept": ..., "valueDateTime": "str", # - Optional. Value as dateTime. - "valueInteger": 0, # Optional. - Value as integer. + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. "valuePeriod": { - "end": "str", # Optional. - End time with inclusive - boundary, if not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. }, "valueQuantity": { - "code": "str", # Optional. - Coded form of the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the value. - "system": "str", # Optional. - System that defines coded - unit form. - "unit": "str", # Optional. - Unit representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). - }, - "valueRange": { - "high": { "code": "str", # Optional. Coded form of the unit. @@ -700,589 +753,196 @@ def begin_infer_radiology_insights( Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, "low": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). } }, "valueRatio": { "denominator": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). }, "numerator": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). } }, "valueReference": { "display": "str", # - Optional. Text alternative - for the resource. + Optional. Text + alternative for the + resource. "identifier": { "assigner": ..., "period": { "end": "str", # - Optional. End time - with inclusive - boundary, if not - ongoing. + Optional. End + time with + inclusive + boundary, if not + ongoing. "start": "str" # - Optional. Starting - time with inclusive - boundary. + Optional. + Starting time + with inclusive + boundary. }, "system": "str", # - Optional. The namespace - for the identifier value. + Optional. The + namespace for the + identifier value. "type": ..., "use": "str", # - Optional. usual | - official | temp | - secondary | old (If - known). + Optional. usual | + official | temp | + secondary | old (If + known). "value": "str" # - Optional. The value that - is unique. + Optional. The value + that is unique. }, "reference": "str", # - Optional. Literal reference, - Relative, internal or - absolute URL. - "type": "str" # Optional. - Type the reference refers to - (e.g. "Patient"). + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). }, "valueSampledData": { - "dimensions": 0, # Number of - sample points at each time - point. Required. + "dimensions": 0, # + Number of sample points + at each time point. + Required. "origin": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). }, - "period": 0.0, # Number of - milliseconds between samples. - Required. - "data": "str", # Optional. - Decimal values with spaces, - or "E" | "U" | "L". - "factor": 0.0, # Optional. - Multiply data by this before - adding to origin. + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. "lowerLimit": 0.0, # - Optional. Lower limit of - detection. + Optional. Lower limit of + detection. "upperLimit": 0.0 # - Optional. Upper limit of - detection. + Optional. Upper limit of + detection. }, "valueString": "str", # - Optional. Value as string. + Optional. Value as string. "valueTime": "12:30:00" # - Optional. Value as time - (hh:mm:ss). + Optional. Value as time + (hh:mm:ss). } ], - "id": "str", # Optional. Unique id for - inter-element referencing. - "system": "str", # Optional. Identity of - the terminology system. - "version": "str" # Optional. Version of - the system - if relevant. - } - ], - "text": "str" - # Optional. Plain text representation of the - concept. - }, - "description": "str", - # Optional. Procedure description. - "extension": [ - { - "url": "str", # Source of the definition for - the extension code - a logical name or a URL. - Required. - "valueBoolean": bool, # Optional. Value as - boolean. - "valueCodeableConcept": { - "coding": [ - { - "code": "str", # Optional. - Symbol in syntax defined by the - system. - "display": "str", # Optional. - Representation defined by the - system. - "extension": [ - ... - ], - "id": "str", # Optional. Unique - id for inter-element referencing. + "id": "str", # Optional. Unique id + for inter-element referencing. "system": "str", # Optional. - Identity of the terminology - system. - "version": "str" # Optional. - Version of the system - if - relevant. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. } - ], + ], "text": "str" # Optional. Plain text - representation of the concept. - }, - "valueDateTime": "str", # Optional. Value as - dateTime. - "valueInteger": 0, # Optional. Value as - integer. - "valuePeriod": { - "end": "str", # Optional. End time with - inclusive boundary, if not ongoing. - "start": "str" # Optional. Starting time - with inclusive boundary. - }, - "valueQuantity": { - "code": "str", # Optional. Coded form of - the unit. - "comparator": "str", # Optional. < | <= - | >= | > - how to understand the value. - "system": "str", # Optional. System that - defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical value - (with implicit precision). - }, - "valueRange": { - "high": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - }, - "low": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - } - }, - "valueRatio": { - "denominator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - }, - "numerator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - } - }, - "valueReference": { - "display": "str", # Optional. Text - alternative for the resource. - "identifier": { - "assigner": ..., - "period": { - "end": "str", # Optional. End - time with inclusive boundary, if - not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. - }, - "system": "str", # Optional. The - namespace for the identifier value. - "type": { - "coding": [ - { - "code": "str", # - Optional. Symbol in - syntax defined by the - system. - "display": "str", # - Optional. Representation - defined by the system. - "extension": [ - ... - ], - "id": "str", # Optional. - Unique id for - inter-element - referencing. - "system": "str", # - Optional. Identity of the - terminology system. - "version": "str" # - Optional. Version of the - system - if relevant. - } - ], - "text": "str" # Optional. Plain - text representation of the - concept. - }, - "use": "str", # Optional. usual | - official | temp | secondary | old (If - known). - "value": "str" # Optional. The value - that is unique. - }, - "reference": "str", # Optional. Literal - reference, Relative, internal or absolute - URL. - "type": "str" # Optional. Type the - reference refers to (e.g. "Patient"). - }, - "valueSampledData": { - "dimensions": 0, # Number of sample - points at each time point. Required. - "origin": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - }, - "period": 0.0, # Number of milliseconds - between samples. Required. - "data": "str", # Optional. Decimal - values with spaces, or "E" | "U" | "L". - "factor": 0.0, # Optional. Multiply data - by this before adding to origin. - "lowerLimit": 0.0, # Optional. Lower - limit of detection. - "upperLimit": 0.0 # Optional. Upper - limit of detection. - }, - "valueString": "str", # Optional. Value as - string. - "valueTime": "12:30:00" # Optional. Value as - time (hh:mm:ss). - } - ] - } - ] - }, - "authors": [ - { - "fullName": "str", # - Optional. Text representation of the full name. - "id": "str" # Optional. - author id. - } - ], - "clinicalType": "str", # Optional. The type - of the clinical document. Known values are: "consultation", - "dischargeSummary", "historyAndPhysical", "radiologyReport", - "procedure", "progress", "laboratory", and "pathologyReport". - "createdDateTime": "2020-02-20 00:00:00", # - Optional. The date and time when the document was created. - "language": "str", # Optional. A 2 letter - ISO 639-1 representation of the language of the document. - "specialtyType": "str" # Optional. specialty - type the document. Known values are: "pathology" and "radiology". - } - ] - } - ], - "configuration": { - "includeEvidence": bool, # Optional. An indication whether the - model's output should include evidence for the inferences. - "inferenceOptions": { - "findingOptions": { - "provideFocusedSentenceEvidence": bool # Optional. - 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. - }, - "followupRecommendationOptions": { - "includeRecommendationsInReferences": bool, # - Optional. Include/Exclude follow-up recommendations in references to - a guideline or article. Default is false. - "includeRecommendationsWithNoSpecifiedModality": - bool, # Optional. Include/Exclude follow-up recommendations without - a specific radiology procedure. Default is false. - "provideFocusedSentenceEvidence": bool # Optional. - 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. - } - }, - "inferenceTypes": [ - "str" # Optional. 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. - ], - "locale": "str", # Optional. Local for the model to use. If not - specified, the model will use the default locale. - "verbose": bool # Optional. An indication whether the model should - produce verbose output. - } - } - - # response body for status code(s): 202 - response == { - "modelVersion": "str", # The version of the model used for inference, - expressed as the model date. Required. - "patientResults": [ - { - "inferences": [ - radiology_insights_inference - ], - "patientId": "str" # Identifier given for the patient in the - request. Required. - } - ] - } - """ - - @overload - def begin_infer_radiology_insights( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.RadiologyInsightsInferenceResult]: - """Create Radiology Insights job. - - Creates a Radiology Insights job with the given request body. - - :param body: Required. - :type body: JSON - :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: - - Example: - .. code-block:: python - - # response body for status code(s): 202 - response == { - "modelVersion": "str", # The version of the model used for inference, - expressed as the model date. Required. - "patientResults": [ - { - "inferences": [ - radiology_insights_inference - ], - "patientId": "str" # Identifier given for the patient in the - request. Required. - } - ] - } - """ - - @overload - def begin_infer_radiology_insights( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.RadiologyInsightsInferenceResult]: - """Create Radiology Insights job. - - Creates a Radiology Insights job with the given request body. - - :param body: Required. - :type body: IO[bytes] - :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: - - Example: - .. code-block:: python - - # response body for status code(s): 202 - response == { - "modelVersion": "str", # The version of the model used for inference, - expressed as the model date. Required. - "patientResults": [ - { - "inferences": [ - radiology_insights_inference - ], - "patientId": "str" # Identifier given for the patient in the - request. Required. - } - ] - } - """ - - @distributed_trace - def begin_infer_radiology_insights( - self, body: Union[_models.RadiologyInsightsData, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.RadiologyInsightsInferenceResult]: - # pylint: disable=line-too-long - """Create Radiology Insights job. - - Creates a Radiology Insights job with the given request body. - - :param body: Is one of the following types: RadiologyInsightsData, JSON, IO[bytes] Required. - :type body: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsData or JSON or - IO[bytes] - :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: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "patients": [ - { - "id": "str", # A given identifier for the patient. Has to be - unique across all patients in a single request. Required. - "encounters": [ - { - "id": "str", # The id of the visit. - Required. - "class": "str", # Optional. The class of the - encounter. Known values are: "inpatient", "ambulatory", - "observation", "emergency", "virtual", and "healthHome". - "period": { - "end": "2020-02-20 00:00:00", # - Optional. End time with inclusive boundary, if not ongoing. - "start": "2020-02-20 00:00:00" # - Optional. Starting time with inclusive boundary. - } - } - ], - "info": { - "birthDate": "2020-02-20", # Optional. The patient's - date of birth. - "clinicalInfo": [ - { - "resourceType": "str", # The type of - resource. Required. - "id": "str", # Optional. Resource - Id. - "implicitRules": "str", # Optional. - A set of rules under which this content was created. - "language": "str", # Optional. - Language of the resource content. - "meta": { - "lastUpdated": "str", # - Optional. When the resource last changed - e.g. when the - version changed. - "profile": [ - "str" # Optional. A - list of profiles (references to `StructureDefinition - `_ - resources) that this resource claims to conform to. - The URL is a reference to `StructureDefinition.url - `_. - ], - "security": [ - { - "code": - "str", # Optional. Symbol in syntax defined by - the system. - "display": - "str", # Optional. Representation defined by the - system. + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. "extension": [ { @@ -1293,8 +953,27 @@ def begin_infer_radiology_insights( as boolean. "valueCodeableConcept": { "coding": [ + { + "code": "str", # Optional. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. + "extension": [ ... ], + "id": "str", # Optional. + Unique id for inter-element + referencing. + "system": "str", # Optional. + Identity of the terminology + system. + "version": "str" # Optional. + Version of the system - if + relevant. + } + ], "text": "str" # Optional. Plain text representation of the concept. }, @@ -1404,8 +1083,33 @@ def begin_infer_radiology_insights( value. "type": { "coding": [ + { + "code": "str", # + Optional. Symbol in + syntax defined by the + system. + "display": "str", # + Optional. + Representation + defined by the + system. + "extension": [ ... ], + "id": "str", # + Optional. Unique id + for inter-element + referencing. + "system": "str", # + Optional. Identity of + the terminology + system. + "version": "str" # + Optional. Version of + the system - if + relevant. + } + ], "text": "str" # Optional. Plain text representation of the concept. @@ -1458,73 +1162,181 @@ def begin_infer_radiology_insights( "valueTime": "12:30:00" # Optional. Value as time (hh:mm:ss). } - ], - "id": "str", - # Optional. Unique id for inter-element - referencing. - "system": - "str", # Optional. Identity of the terminology - system. - "version": - "str" # Optional. Version of the system - if - relevant. + ] } - ], - "source": "str", # Optional. - 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. - "tag": [ - { - "code": - "str", # Optional. Symbol in syntax defined by - the system. - "display": - "str", # Optional. Representation defined by the - system. - "extension": - [ - { - "url": "str", # Source of the definition - for the extension code - a logical name - or a URL. Required. - "valueBoolean": bool, # Optional. Value - as boolean. - "valueCodeableConcept": { - "coding": [ - ... - ], - "text": "str" # Optional. Plain text - representation of the concept. - }, - "valueDateTime": "str", # Optional. - Value as dateTime. - "valueInteger": 0, # Optional. Value as - integer. - "valuePeriod": { - "end": "str", # Optional. End time - with inclusive boundary, if not - ongoing. - "start": "str" # Optional. Starting - time with inclusive boundary. - }, - "valueQuantity": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. + } + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] + } + ], + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. + ], + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. + } + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. + } + + # response body for status code(s): 201, 200 + response == { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. }, - "valueRange": { - "high": { + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # Optional. @@ -1539,94 +1351,199 @@ def begin_infer_radiology_insights( Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, "low": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueRatio": { "denominator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). }, "numerator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueReference": { - "display": "str", # Optional. Text - alternative for the resource. + "display": "str", # Optional. + Text alternative for the + resource. "identifier": { "assigner": ..., "period": { - "end": "str", # Optional. - End time with inclusive - boundary, if not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. }, - "system": "str", # Optional. The - namespace for the identifier - value. + "system": "str", # Optional. + The namespace for the + identifier value. "type": { "coding": [ ... ], - "text": "str" # Optional. - Plain text representation of - the concept. + "text": "str" # + Optional. Plain text + representation of the + concept. }, - "use": "str", # Optional. usual - | official | temp | secondary | - old (If known). - "value": "str" # Optional. The - value that is unique. + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. }, "reference": "str", # Optional. - Literal reference, Relative, internal - or absolute URL. - "type": "str" # Optional. Type the - reference refers to (e.g. "Patient"). + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). }, "valueSampledData": { - "dimensions": 0, # Number of sample - points at each time point. Required. + "dimensions": 0, # Number of + sample points at each time point. + Required. "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # Optional. @@ -1641,99 +1558,8 @@ def begin_infer_radiology_insights( Numerical value (with implicit precision). }, - "period": 0.0, # Number of - milliseconds between samples. - Required. - "data": "str", # Optional. Decimal - values with spaces, or "E" | "U" | - "L". - "factor": 0.0, # Optional. Multiply - data by this before adding to origin. - "lowerLimit": 0.0, # Optional. Lower - limit of detection. - "upperLimit": 0.0 # Optional. Upper - limit of detection. - }, - "valueString": "str", # Optional. Value - as string. - "valueTime": "12:30:00" # Optional. - Value as time (hh:mm:ss). - } - ], - "id": "str", - # Optional. Unique id for inter-element - referencing. - "system": - "str", # Optional. Identity of the terminology - system. - "version": - "str" # Optional. Version of the system - if - relevant. - } - ], - "versionId": "str" # - Optional. 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. - } - } - ], - "sex": "str" # Optional. The patient's sex. Known - values are: "female", "male", and "unspecified". - }, - "patientDocuments": [ - { - "content": { - "sourceType": "str", # 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" # The content of the - document, given either inline (as a string) or as a reference - (URI). Required. - }, - "id": "str", # A given identifier for the - document. Has to be unique across all documents for a single - patient. Required. - "type": "str", # 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". - "administrativeMetadata": { - "encounterId": "str", # Optional. - Reference to the encounter associated with the document. - "orderedProcedures": [ - { - "code": { - "coding": [ - { - "code": "str", # Optional. Symbol in - syntax defined by the system. - "display": "str", # Optional. - Representation defined by the system. - "extension": [ - { - "url": "str", # Source of the - definition for the extension code - - a logical name or a URL. - Required. - "valueBoolean": bool, # - Optional. Value as boolean. - "valueCodeableConcept": ..., - "valueDateTime": "str", # - Optional. Value as dateTime. - "valueInteger": 0, # Optional. - Value as integer. - "valuePeriod": { - "end": "str", # Optional. - End time with inclusive - boundary, if not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. - }, - "valueQuantity": { + "valueRange": { + "high": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # @@ -1748,8 +1574,4563 @@ def begin_infer_radiology_insights( Numerical value (with implicit precision). }, - "valueRange": { - "high": { + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. + } + } + ], + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", # Optional. Symbol in + syntax defined by the system. + "display": "str", # Optional. + Representation defined by the system. + "extension": [ + { + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. + "valueBoolean": bool, # + Optional. Value as boolean. + "valueCodeableConcept": ..., + "valueDateTime": "str", # + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. + "valuePeriod": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # + Optional. Coded form of + the unit. + "comparator": "str", # + Optional. < | <= | >= | > + - how to understand the + value. + "system": "str", # + Optional. System that + defines coded unit form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "low": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "numerator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # + Optional. Text + alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End + time with + inclusive + boundary, if not + ongoing. + "start": "str" # + Optional. + Starting time + with inclusive + boundary. + }, + "system": "str", # + Optional. The + namespace for the + identifier value. + "type": ..., + "use": "str", # + Optional. usual | + official | temp | + secondary | old (If + known). + "value": "str" # + Optional. The value + that is unique. + }, + "reference": "str", # + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # + Number of sample points + at each time point. + Required. + "origin": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. + "lowerLimit": 0.0, # + Optional. Lower limit of + detection. + "upperLimit": 0.0 # + Optional. Upper limit of + detection. + }, + "valueString": "str", # + Optional. Value as string. + "valueTime": "12:30:00" # + Optional. Value as time + (hh:mm:ss). + } + ], + "id": "str", # Optional. Unique id + for inter-element referencing. + "system": "str", # Optional. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. + "extension": + [ + { + "url": "str", # Source of the definition + for the extension code - a logical name + or a URL. Required. + "valueBoolean": bool, # Optional. Value + as boolean. + "valueCodeableConcept": { + "coding": [ + { + "code": "str", # Optional. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. + "extension": [ + ... + ], + "id": "str", # Optional. + Unique id for inter-element + referencing. + "system": "str", # Optional. + Identity of the terminology + system. + "version": "str" # Optional. + Version of the system - if + relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value as + integer. + "valuePeriod": { + "end": "str", # Optional. End time + with inclusive boundary, if not + ongoing. + "start": "str" # Optional. Starting + time with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. < | + <= | >= | > - how to understand the + value. + "system": "str", # Optional. System + that defines coded unit form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. Numerical + value (with implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "low": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "numerator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # Optional. Text + alternative for the resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # Optional. + End time with inclusive + boundary, if not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "system": "str", # Optional. The + namespace for the identifier + value. + "type": { + "coding": [ + { + "code": "str", # + Optional. Symbol in + syntax defined by the + system. + "display": "str", # + Optional. + Representation + defined by the + system. + "extension": [ + ... + ], + "id": "str", # + Optional. Unique id + for inter-element + referencing. + "system": "str", # + Optional. Identity of + the terminology + system. + "version": "str" # + Optional. Version of + the system - if + relevant. + } + ], + "text": "str" # Optional. + Plain text representation of + the concept. + }, + "use": "str", # Optional. usual + | official | temp | secondary | + old (If known). + "value": "str" # Optional. The + value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, internal + or absolute URL. + "type": "str" # Optional. Type the + reference refers to (e.g. "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of sample + points at each time point. Required. + "origin": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. Decimal + values with spaces, or "E" | "U" | + "L". + "factor": 0.0, # Optional. Multiply + data by this before adding to origin. + "lowerLimit": 0.0, # Optional. Lower + limit of detection. + "upperLimit": 0.0 # Optional. Upper + limit of detection. + }, + "valueString": "str", # Optional. Value + as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ] + } + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. + } + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] + } + ], + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. + ], + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. + } + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. + } + """ + + @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.RadiologyInsightsJob]: + # pylint: disable=line-too-long + """Create Radiology Insights job. + + Creates a Radiology Insights job with the given request body. + + :param id: The unique ID of the job. 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 RadiologyInsightsJob. The RadiologyInsightsJob + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 201, 200 + response == { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. + } + } + ], + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", # Optional. Symbol in + syntax defined by the system. + "display": "str", # Optional. + Representation defined by the system. + "extension": [ + { + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. + "valueBoolean": bool, # + Optional. Value as boolean. + "valueCodeableConcept": ..., + "valueDateTime": "str", # + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. + "valuePeriod": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # + Optional. Coded form of + the unit. + "comparator": "str", # + Optional. < | <= | >= | > + - how to understand the + value. + "system": "str", # + Optional. System that + defines coded unit form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "low": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "numerator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # + Optional. Text + alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End + time with + inclusive + boundary, if not + ongoing. + "start": "str" # + Optional. + Starting time + with inclusive + boundary. + }, + "system": "str", # + Optional. The + namespace for the + identifier value. + "type": ..., + "use": "str", # + Optional. usual | + official | temp | + secondary | old (If + known). + "value": "str" # + Optional. The value + that is unique. + }, + "reference": "str", # + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # + Number of sample points + at each time point. + Required. + "origin": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. + "lowerLimit": 0.0, # + Optional. Lower limit of + detection. + "upperLimit": 0.0 # + Optional. Upper limit of + detection. + }, + "valueString": "str", # + Optional. Value as string. + "valueTime": "12:30:00" # + Optional. Value as time + (hh:mm:ss). + } + ], + "id": "str", # Optional. Unique id + for inter-element referencing. + "system": "str", # Optional. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. + "extension": + [ + { + "url": "str", # Source of the definition + for the extension code - a logical name + or a URL. Required. + "valueBoolean": bool, # Optional. Value + as boolean. + "valueCodeableConcept": { + "coding": [ + { + "code": "str", # Optional. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. + "extension": [ + ... + ], + "id": "str", # Optional. + Unique id for inter-element + referencing. + "system": "str", # Optional. + Identity of the terminology + system. + "version": "str" # Optional. + Version of the system - if + relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value as + integer. + "valuePeriod": { + "end": "str", # Optional. End time + with inclusive boundary, if not + ongoing. + "start": "str" # Optional. Starting + time with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. < | + <= | >= | > - how to understand the + value. + "system": "str", # Optional. System + that defines coded unit form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. Numerical + value (with implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "low": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "numerator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # Optional. Text + alternative for the resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # Optional. + End time with inclusive + boundary, if not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "system": "str", # Optional. The + namespace for the identifier + value. + "type": { + "coding": [ + { + "code": "str", # + Optional. Symbol in + syntax defined by the + system. + "display": "str", # + Optional. + Representation + defined by the + system. + "extension": [ + ... + ], + "id": "str", # + Optional. Unique id + for inter-element + referencing. + "system": "str", # + Optional. Identity of + the terminology + system. + "version": "str" # + Optional. Version of + the system - if + relevant. + } + ], + "text": "str" # Optional. + Plain text representation of + the concept. + }, + "use": "str", # Optional. usual + | official | temp | secondary | + old (If known). + "value": "str" # Optional. The + value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, internal + or absolute URL. + "type": "str" # Optional. Type the + reference refers to (e.g. "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of sample + points at each time point. Required. + "origin": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. Decimal + values with spaces, or "E" | "U" | + "L". + "factor": 0.0, # Optional. Multiply + data by this before adding to origin. + "lowerLimit": 0.0, # Optional. Lower + limit of detection. + "upperLimit": 0.0 # Optional. Upper + limit of detection. + }, + "valueString": "str", # Optional. Value + as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ] + } + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. + } + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] + } + ], + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. + ], + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. + } + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. + } + """ + + @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.RadiologyInsightsJob]: + # pylint: disable=line-too-long + """Create Radiology Insights job. + + Creates a Radiology Insights job with the given request body. + + :param id: The unique ID of the job. 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 RadiologyInsightsJob. The RadiologyInsightsJob + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 201, 200 + response == { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. + } + } + ], + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", # Optional. Symbol in + syntax defined by the system. + "display": "str", # Optional. + Representation defined by the system. + "extension": [ + { + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. + "valueBoolean": bool, # + Optional. Value as boolean. + "valueCodeableConcept": ..., + "valueDateTime": "str", # + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. + "valuePeriod": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # + Optional. Coded form of + the unit. + "comparator": "str", # + Optional. < | <= | >= | > + - how to understand the + value. + "system": "str", # + Optional. System that + defines coded unit form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "low": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "numerator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # + Optional. Text + alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End + time with + inclusive + boundary, if not + ongoing. + "start": "str" # + Optional. + Starting time + with inclusive + boundary. + }, + "system": "str", # + Optional. The + namespace for the + identifier value. + "type": ..., + "use": "str", # + Optional. usual | + official | temp | + secondary | old (If + known). + "value": "str" # + Optional. The value + that is unique. + }, + "reference": "str", # + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # + Number of sample points + at each time point. + Required. + "origin": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. + "lowerLimit": 0.0, # + Optional. Lower limit of + detection. + "upperLimit": 0.0 # + Optional. Upper limit of + detection. + }, + "valueString": "str", # + Optional. Value as string. + "valueTime": "12:30:00" # + Optional. Value as time + (hh:mm:ss). + } + ], + "id": "str", # Optional. Unique id + for inter-element referencing. + "system": "str", # Optional. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. + "extension": + [ + { + "url": "str", # Source of the definition + for the extension code - a logical name + or a URL. Required. + "valueBoolean": bool, # Optional. Value + as boolean. + "valueCodeableConcept": { + "coding": [ + { + "code": "str", # Optional. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. + "extension": [ + ... + ], + "id": "str", # Optional. + Unique id for inter-element + referencing. + "system": "str", # Optional. + Identity of the terminology + system. + "version": "str" # Optional. + Version of the system - if + relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value as + integer. + "valuePeriod": { + "end": "str", # Optional. End time + with inclusive boundary, if not + ongoing. + "start": "str" # Optional. Starting + time with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. < | + <= | >= | > - how to understand the + value. + "system": "str", # Optional. System + that defines coded unit form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. Numerical + value (with implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "low": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "numerator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # Optional. Text + alternative for the resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # Optional. + End time with inclusive + boundary, if not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "system": "str", # Optional. The + namespace for the identifier + value. + "type": { + "coding": [ + { + "code": "str", # + Optional. Symbol in + syntax defined by the + system. + "display": "str", # + Optional. + Representation + defined by the + system. + "extension": [ + ... + ], + "id": "str", # + Optional. Unique id + for inter-element + referencing. + "system": "str", # + Optional. Identity of + the terminology + system. + "version": "str" # + Optional. Version of + the system - if + relevant. + } + ], + "text": "str" # Optional. + Plain text representation of + the concept. + }, + "use": "str", # Optional. usual + | official | temp | secondary | + old (If known). + "value": "str" # Optional. The + value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, internal + or absolute URL. + "type": "str" # Optional. Type the + reference refers to (e.g. "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of sample + points at each time point. Required. + "origin": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. Decimal + values with spaces, or "E" | "U" | + "L". + "factor": 0.0, # Optional. Multiply + data by this before adding to origin. + "lowerLimit": 0.0, # Optional. Lower + limit of detection. + "upperLimit": 0.0 # Optional. Upper + limit of detection. + }, + "valueString": "str", # Optional. Value + as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ] + } + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. + } + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] + } + ], + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. + ], + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. + } + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. + } + """ + + @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.RadiologyInsightsJob]: + # pylint: disable=line-too-long + """Create Radiology Insights job. + + Creates a Radiology Insights job with the given request body. + + :param id: The unique ID of the job. 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 RadiologyInsightsJob. The RadiologyInsightsJob + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + resource = { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. + } + } + ], + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", # Optional. Symbol in + syntax defined by the system. + "display": "str", # Optional. + Representation defined by the system. + "extension": [ + { + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. + "valueBoolean": bool, # + Optional. Value as boolean. + "valueCodeableConcept": ..., + "valueDateTime": "str", # + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. + "valuePeriod": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # + Optional. Coded form of + the unit. + "comparator": "str", # + Optional. < | <= | >= | > + - how to understand the + value. + "system": "str", # + Optional. System that + defines coded unit form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "low": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "numerator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # + Optional. Text + alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End + time with + inclusive + boundary, if not + ongoing. + "start": "str" # + Optional. + Starting time + with inclusive + boundary. + }, + "system": "str", # + Optional. The + namespace for the + identifier value. + "type": ..., + "use": "str", # + Optional. usual | + official | temp | + secondary | old (If + known). + "value": "str" # + Optional. The value + that is unique. + }, + "reference": "str", # + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # + Number of sample points + at each time point. + Required. + "origin": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. + "lowerLimit": 0.0, # + Optional. Lower limit of + detection. + "upperLimit": 0.0 # + Optional. Upper limit of + detection. + }, + "valueString": "str", # + Optional. Value as string. + "valueTime": "12:30:00" # + Optional. Value as time + (hh:mm:ss). + } + ], + "id": "str", # Optional. Unique id + for inter-element referencing. + "system": "str", # Optional. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. + "extension": + [ + { + "url": "str", # Source of the definition + for the extension code - a logical name + or a URL. Required. + "valueBoolean": bool, # Optional. Value + as boolean. + "valueCodeableConcept": { + "coding": [ + { + "code": "str", # Optional. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. + "extension": [ + ... + ], + "id": "str", # Optional. + Unique id for inter-element + referencing. + "system": "str", # Optional. + Identity of the terminology + system. + "version": "str" # Optional. + Version of the system - if + relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value as + integer. + "valuePeriod": { + "end": "str", # Optional. End time + with inclusive boundary, if not + ongoing. + "start": "str" # Optional. Starting + time with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. < | + <= | >= | > - how to understand the + value. + "system": "str", # Optional. System + that defines coded unit form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. Numerical + value (with implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "low": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "numerator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # Optional. Text + alternative for the resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # Optional. + End time with inclusive + boundary, if not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "system": "str", # Optional. The + namespace for the identifier + value. + "type": { + "coding": [ + { + "code": "str", # + Optional. Symbol in + syntax defined by the + system. + "display": "str", # + Optional. + Representation + defined by the + system. + "extension": [ + ... + ], + "id": "str", # + Optional. Unique id + for inter-element + referencing. + "system": "str", # + Optional. Identity of + the terminology + system. + "version": "str" # + Optional. Version of + the system - if + relevant. + } + ], + "text": "str" # Optional. + Plain text representation of + the concept. + }, + "use": "str", # Optional. usual + | official | temp | secondary | + old (If known). + "value": "str" # Optional. The + value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, internal + or absolute URL. + "type": "str" # Optional. Type the + reference refers to (e.g. "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of sample + points at each time point. Required. + "origin": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. Decimal + values with spaces, or "E" | "U" | + "L". + "factor": 0.0, # Optional. Multiply + data by this before adding to origin. + "lowerLimit": 0.0, # Optional. Lower + limit of detection. + "upperLimit": 0.0 # Optional. Upper + limit of detection. + }, + "valueString": "str", # Optional. Value + as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ] + } + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. + } + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] + } + ], + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. + ], + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. + } + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. + } + + # response body for status code(s): 201, 200 + response == { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. + } + } + ], + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", # Optional. Symbol in + syntax defined by the system. + "display": "str", # Optional. + Representation defined by the system. + "extension": [ + { + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. + "valueBoolean": bool, # + Optional. Value as boolean. + "valueCodeableConcept": ..., + "valueDateTime": "str", # + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. + "valuePeriod": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "valueQuantity": { "code": "str", # Optional. Coded form of the unit. @@ -1767,216 +6148,242 @@ def begin_infer_radiology_insights( Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, "low": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). } }, "valueRatio": { "denominator": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). }, "numerator": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). } }, "valueReference": { "display": "str", # - Optional. Text alternative - for the resource. + Optional. Text + alternative for the + resource. "identifier": { "assigner": ..., "period": { "end": "str", # - Optional. End time - with inclusive - boundary, if not - ongoing. + Optional. End + time with + inclusive + boundary, if not + ongoing. "start": "str" # - Optional. Starting - time with inclusive - boundary. + Optional. + Starting time + with inclusive + boundary. }, "system": "str", # - Optional. The namespace - for the identifier value. + Optional. The + namespace for the + identifier value. "type": ..., "use": "str", # - Optional. usual | - official | temp | - secondary | old (If - known). + Optional. usual | + official | temp | + secondary | old (If + known). "value": "str" # - Optional. The value that - is unique. + Optional. The value + that is unique. }, "reference": "str", # - Optional. Literal reference, - Relative, internal or - absolute URL. - "type": "str" # Optional. - Type the reference refers to - (e.g. "Patient"). + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). }, "valueSampledData": { - "dimensions": 0, # Number of - sample points at each time - point. Required. + "dimensions": 0, # + Number of sample points + at each time point. + Required. "origin": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). }, - "period": 0.0, # Number of - milliseconds between samples. - Required. - "data": "str", # Optional. - Decimal values with spaces, - or "E" | "U" | "L". - "factor": 0.0, # Optional. - Multiply data by this before - adding to origin. + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. "lowerLimit": 0.0, # - Optional. Lower limit of - detection. + Optional. Lower limit of + detection. "upperLimit": 0.0 # - Optional. Upper limit of - detection. + Optional. Upper limit of + detection. }, "valueString": "str", # - Optional. Value as string. + Optional. Value as string. "valueTime": "12:30:00" # - Optional. Value as time - (hh:mm:ss). + Optional. Value as time + (hh:mm:ss). } ], - "id": "str", # Optional. Unique id for - inter-element referencing. - "system": "str", # Optional. Identity of - the terminology system. - "version": "str" # Optional. Version of - the system - if relevant. - } - ], - "text": "str" - # Optional. Plain text representation of the - concept. - }, - "description": "str", - # Optional. Procedure description. - "extension": [ - { - "url": "str", # Source of the definition for - the extension code - a logical name or a URL. - Required. - "valueBoolean": bool, # Optional. Value as - boolean. + "id": "str", # Optional. Unique id + for inter-element referencing. + "system": "str", # Optional. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. + "extension": + [ + { + "url": "str", # Source of the definition + for the extension code - a logical name + or a URL. Required. + "valueBoolean": bool, # Optional. Value + as boolean. "valueCodeableConcept": { "coding": [ { "code": "str", # Optional. - Symbol in syntax defined by the - system. - "display": "str", # Optional. - Representation defined by the - system. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. "extension": [ ... ], - "id": "str", # Optional. Unique - id for inter-element referencing. + "id": "str", # Optional. + Unique id for inter-element + referencing. "system": "str", # Optional. - Identity of the terminology - system. + Identity of the terminology + system. "version": "str" # Optional. - Version of the system - if - relevant. + Version of the system - if + relevant. } ], "text": "str" # Optional. Plain text - representation of the concept. - }, - "valueDateTime": "str", # Optional. Value as - dateTime. + representation of the concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. "valueInteger": 0, # Optional. Value as - integer. + integer. "valuePeriod": { - "end": "str", # Optional. End time with - inclusive boundary, if not ongoing. - "start": "str" # Optional. Starting time - with inclusive boundary. - }, + "end": "str", # Optional. End time + with inclusive boundary, if not + ongoing. + "start": "str" # Optional. Starting + time with inclusive boundary. + }, "valueQuantity": { - "code": "str", # Optional. Coded form of - the unit. - "comparator": "str", # Optional. < | <= - | >= | > - how to understand the value. - "system": "str", # Optional. System that - defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical value - (with implicit precision). - }, - "valueRange": { - "high": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # Optional. < | @@ -1989,241 +6396,281 @@ def begin_infer_radiology_insights( "value": 0.0 # Optional. Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, "low": { "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). } - }, + }, "valueRatio": { "denominator": { "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). }, "numerator": { "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). } - }, + }, "valueReference": { "display": "str", # Optional. Text - alternative for the resource. + alternative for the resource. "identifier": { "assigner": ..., "period": { - "end": "str", # Optional. End - time with inclusive boundary, if - not ongoing. + "end": "str", # Optional. + End time with inclusive + boundary, if not ongoing. "start": "str" # Optional. - Starting time with inclusive - boundary. + Starting time with inclusive + boundary. }, "system": "str", # Optional. The - namespace for the identifier value. + namespace for the identifier + value. "type": { "coding": [ { "code": "str", # - Optional. Symbol in - syntax defined by the - system. + Optional. Symbol in + syntax defined by the + system. "display": "str", # - Optional. Representation - defined by the system. + Optional. + Representation + defined by the + system. "extension": [ ... ], - "id": "str", # Optional. - Unique id for - inter-element - referencing. + "id": "str", # + Optional. Unique id + for inter-element + referencing. "system": "str", # - Optional. Identity of the - terminology system. + Optional. Identity of + the terminology + system. "version": "str" # - Optional. Version of the - system - if relevant. + Optional. Version of + the system - if + relevant. } ], - "text": "str" # Optional. Plain - text representation of the - concept. + "text": "str" # Optional. + Plain text representation of + the concept. }, - "use": "str", # Optional. usual | - official | temp | secondary | old (If - known). - "value": "str" # Optional. The value - that is unique. + "use": "str", # Optional. usual + | official | temp | secondary | + old (If known). + "value": "str" # Optional. The + value that is unique. }, - "reference": "str", # Optional. Literal - reference, Relative, internal or absolute - URL. + "reference": "str", # Optional. + Literal reference, Relative, internal + or absolute URL. "type": "str" # Optional. Type the - reference refers to (e.g. "Patient"). - }, + reference refers to (e.g. "Patient"). + }, "valueSampledData": { "dimensions": 0, # Number of sample - points at each time point. Required. + points at each time point. Required. "origin": { "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). }, - "period": 0.0, # Number of milliseconds - between samples. Required. + "period": 0.0, # Number of + milliseconds between samples. + Required. "data": "str", # Optional. Decimal - values with spaces, or "E" | "U" | "L". - "factor": 0.0, # Optional. Multiply data - by this before adding to origin. + values with spaces, or "E" | "U" | + "L". + "factor": 0.0, # Optional. Multiply + data by this before adding to origin. "lowerLimit": 0.0, # Optional. Lower - limit of detection. + limit of detection. "upperLimit": 0.0 # Optional. Upper - limit of detection. - }, - "valueString": "str", # Optional. Value as - string. - "valueTime": "12:30:00" # Optional. Value as - time (hh:mm:ss). - } - ] + limit of detection. + }, + "valueString": "str", # Optional. Value + as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ] + } + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. } - ] - }, - "authors": [ - { - "fullName": "str", # - Optional. Text representation of the full name. - "id": "str" # Optional. - author id. - } - ], - "clinicalType": "str", # Optional. The type - of the clinical document. Known values are: "consultation", - "dischargeSummary", "historyAndPhysical", "radiologyReport", - "procedure", "progress", "laboratory", and "pathologyReport". - "createdDateTime": "2020-02-20 00:00:00", # - Optional. The date and time when the document was created. - "language": "str", # Optional. A 2 letter - ISO 639-1 representation of the language of the document. - "specialtyType": "str" # Optional. specialty - type the document. Known values are: "pathology" and "radiology". - } - ] - } - ], - "configuration": { - "includeEvidence": bool, # Optional. An indication whether the - model's output should include evidence for the inferences. - "inferenceOptions": { - "findingOptions": { - "provideFocusedSentenceEvidence": bool # Optional. - 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. - }, - "followupRecommendationOptions": { - "includeRecommendationsInReferences": bool, # - Optional. Include/Exclude follow-up recommendations in references to - a guideline or article. Default is false. - "includeRecommendationsWithNoSpecifiedModality": - bool, # Optional. Include/Exclude follow-up recommendations without - a specific radiology procedure. Default is false. - "provideFocusedSentenceEvidence": bool # Optional. - 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. + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] } - }, - "inferenceTypes": [ - "str" # Optional. 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. ], - "locale": "str", # Optional. Local for the model to use. If not - specified, the model will use the default locale. - "verbose": bool # Optional. An indication whether the model should - produce verbose output. - } - } - - # response body for status code(s): 202 - response == { - "modelVersion": "str", # The version of the model used for inference, - expressed as the model date. Required. - "patientResults": [ - { - "inferences": [ - radiology_insights_inference + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. ], - "patientId": "str" # Identifier given for the patient in the - request. Required. + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. } - ] + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. } """ _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.RadiologyInsightsInferenceResult] = kwargs.pop("cls", None) + cls: ClsType[_models.RadiologyInsightsJob] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._infer_radiology_insights_initial( - body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs + 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._deserialize("str", response.headers.get("x-ms-request-id")) response_headers["Operation-Location"] = self._deserialize( "str", response.headers.get("Operation-Location") ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Repeatability-Result"] = self._deserialize( - "str", response.headers.get("Repeatability-Result") - ) - deserialized = _deserialize(_models.RadiologyInsightsInferenceResult, 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 @@ -2241,12 +6688,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.RadiologyInsightsInferenceResult].from_continuation_token( + return LROPoller[_models.RadiologyInsightsJob].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.RadiologyInsightsInferenceResult]( + return LROPoller[_models.RadiologyInsightsJob]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) 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 bbcd28b4aa67..0ec13ea52bbf 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.0b2" +VERSION = "1.0.0" 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 20e5e0ec1799..d96fab1a1c5a 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 @@ -27,11 +27,10 @@ class 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 needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :keyword api_version: The API version to use for this operation. Default value is - "2023-09-01-preview". Note that overriding this default value may result in unsupported - behavior. + :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. 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 928142f56c33..953e53a3e57d 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 @@ -23,16 +23,15 @@ class RadiologyInsightsClientConfiguration: # pylint: disable=too-many-instance :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). Required. :type endpoint: str - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.AzureKeyCredential - :keyword api_version: The API version to use for this operation. Default value is - "2023-09-01-preview". Note that overriding this default value may result in unsupported - behavior. + :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 """ def __init__(self, endpoint: str, credential: AzureKeyCredential, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2023-09-01-preview") + api_version: str = kwargs.pop("api_version", "2024-04-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/_operations.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/aio/_operations/_operations.py index 530866e1f8a9..f94587a810e2 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, line-too-long +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,7 +9,7 @@ from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -42,9 +42,14 @@ class RadiologyInsightsClientOperationsMixin(RadiologyInsightsClientMixinABC): async def _infer_radiology_insights_initial( - self, body: Union[_models.RadiologyInsightsData, JSON, IO[bytes]], **kwargs: Any + self, + id: str, + resource: Union[_models.RadiologyInsightsJob, JSON, IO[bytes]], + *, + expand: Optional[List[str]] = None, + **kwargs: Any ) -> JSON: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -60,12 +65,14 @@ async def _infer_radiology_insights_initial( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(resource, (IOBase, bytes)): + _content = resource else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_radiology_insights_infer_radiology_insights_request( + id=id, + expand=expand, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -84,20 +91,29 @@ async def _infer_radiology_insights_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 201]: if _stream: await response.read() # Load the body in memory and close the socket map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + error = _deserialize(_models.HealthInsightsErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Repeatability-Result"] = self._deserialize( - "str", response.headers.get("Repeatability-Result") - ) + if response.status_code == 200: + response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + + deserialized = _deserialize(JSON, response.json()) + + if response.status_code == 201: + response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) - deserialized = _deserialize(JSON, response.json()) + deserialized = _deserialize(JSON, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -106,122 +122,128 @@ async def _infer_radiology_insights_initial( @overload async def begin_infer_radiology_insights( - self, body: _models.RadiologyInsightsData, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RadiologyInsightsInferenceResult]: + self, + id: str, + resource: _models.RadiologyInsightsJob, + *, + expand: Optional[List[str]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RadiologyInsightsJob]: # pylint: disable=line-too-long """Create Radiology Insights job. Creates a Radiology Insights job with the given request body. - :param body: Required. - :type body: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsData + :param id: The unique ID of the job. 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 + :return: An instance of AsyncLROPoller that returns RadiologyInsightsJob. The + RadiologyInsightsJob is compatible with MutableMapping :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult] + ~azure.core.polling.AsyncLROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob] :raises ~azure.core.exceptions.HttpResponseError: Example: .. code-block:: python # JSON input template you can fill out and use as your body input. - body = { - "patients": [ - { - "id": "str", # A given identifier for the patient. Has to be - unique across all patients in a single request. Required. - "encounters": [ - { - "id": "str", # The id of the visit. - Required. - "class": "str", # Optional. The class of the - encounter. Known values are: "inpatient", "ambulatory", - "observation", "emergency", "virtual", and "healthHome". - "period": { - "end": "2020-02-20 00:00:00", # - Optional. End time with inclusive boundary, if not ongoing. - "start": "2020-02-20 00:00:00" # - Optional. Starting time with inclusive boundary. - } - } - ], - "info": { - "birthDate": "2020-02-20", # Optional. The patient's - date of birth. - "clinicalInfo": [ - { - "resourceType": "str", # The type of - resource. Required. - "id": "str", # Optional. Resource - Id. - "implicitRules": "str", # Optional. - A set of rules under which this content was created. - "language": "str", # Optional. - Language of the resource content. - "meta": { - "lastUpdated": "str", # - Optional. When the resource last changed - e.g. when the - version changed. - "profile": [ - "str" # Optional. A - list of profiles (references to `StructureDefinition - `_ - resources) that this resource claims to conform to. - The URL is a reference to `StructureDefinition.url - `_. - ], - "security": [ - { - "code": - "str", # Optional. Symbol in syntax defined by - the system. - "display": - "str", # Optional. Representation defined by the - system. - "extension": - [ - { - "url": "str", # Source of the definition - for the extension code - a logical name - or a URL. Required. - "valueBoolean": bool, # Optional. Value - as boolean. + resource = { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. "valueCodeableConcept": { "coding": [ ... ], - "text": "str" # Optional. Plain text - representation of the concept. + "text": "str" # Optional. Plain + text representation of the + concept. }, "valueDateTime": "str", # Optional. - Value as dateTime. - "valueInteger": 0, # Optional. Value as - integer. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. "valuePeriod": { - "end": "str", # Optional. End time - with inclusive boundary, if not - ongoing. - "start": "str" # Optional. Starting - time with inclusive boundary. + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. }, "valueQuantity": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - }, - "valueRange": { - "high": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # Optional. @@ -236,193 +258,199 @@ async def begin_infer_radiology_insights( Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, "low": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueRatio": { "denominator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). }, "numerator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueReference": { - "display": "str", # Optional. Text - alternative for the resource. + "display": "str", # Optional. + Text alternative for the + resource. "identifier": { "assigner": ..., "period": { - "end": "str", # Optional. - End time with inclusive - boundary, if not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. }, - "system": "str", # Optional. The - namespace for the identifier - value. + "system": "str", # Optional. + The namespace for the + identifier value. "type": { "coding": [ ... ], - "text": "str" # Optional. - Plain text representation of - the concept. + "text": "str" # + Optional. Plain text + representation of the + concept. }, - "use": "str", # Optional. usual - | official | temp | secondary | - old (If known). - "value": "str" # Optional. The - value that is unique. + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. }, "reference": "str", # Optional. - Literal reference, Relative, internal - or absolute URL. - "type": "str" # Optional. Type the - reference refers to (e.g. "Patient"). + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). }, "valueSampledData": { - "dimensions": 0, # Number of sample - points at each time point. Required. + "dimensions": 0, # Number of + sample points at each time point. + Required. "origin": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). }, "period": 0.0, # Number of - milliseconds between samples. - Required. - "data": "str", # Optional. Decimal - values with spaces, or "E" | "U" | - "L". - "factor": 0.0, # Optional. Multiply - data by this before adding to origin. - "lowerLimit": 0.0, # Optional. Lower - limit of detection. - "upperLimit": 0.0 # Optional. Upper - limit of detection. + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. }, - "valueString": "str", # Optional. Value - as string. + "valueString": "str", # Optional. + Value as string. "valueTime": "12:30:00" # Optional. - Value as time (hh:mm:ss). - } - ], - "id": "str", - # Optional. Unique id for inter-element - referencing. - "system": - "str", # Optional. Identity of the terminology - system. - "version": - "str" # Optional. Version of the system - if - relevant. - } - ], - "source": "str", # Optional. - 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. - "tag": [ - { - "code": - "str", # Optional. Symbol in syntax defined by - the system. - "display": - "str", # Optional. Representation defined by the - system. - "extension": - [ - { - "url": "str", # Source of the definition - for the extension code - a logical name - or a URL. Required. - "valueBoolean": bool, # Optional. Value - as boolean. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. "valueCodeableConcept": { "coding": [ ... ], - "text": "str" # Optional. Plain text - representation of the concept. + "text": "str" # Optional. Plain + text representation of the + concept. }, "valueDateTime": "str", # Optional. - Value as dateTime. - "valueInteger": 0, # Optional. Value as - integer. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. "valuePeriod": { - "end": "str", # Optional. End time - with inclusive boundary, if not - ongoing. - "start": "str" # Optional. Starting - time with inclusive boundary. + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. }, "valueQuantity": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - }, - "valueRange": { - "high": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # Optional. @@ -437,217 +465,243 @@ async def begin_infer_radiology_insights( Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, "low": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueRatio": { "denominator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). }, "numerator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueReference": { - "display": "str", # Optional. Text - alternative for the resource. + "display": "str", # Optional. + Text alternative for the + resource. "identifier": { "assigner": ..., "period": { - "end": "str", # Optional. - End time with inclusive - boundary, if not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. }, - "system": "str", # Optional. The - namespace for the identifier - value. + "system": "str", # Optional. + The namespace for the + identifier value. "type": { "coding": [ ... ], - "text": "str" # Optional. - Plain text representation of - the concept. + "text": "str" # + Optional. Plain text + representation of the + concept. }, - "use": "str", # Optional. usual - | official | temp | secondary | - old (If known). - "value": "str" # Optional. The - value that is unique. + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. }, "reference": "str", # Optional. - Literal reference, Relative, internal - or absolute URL. - "type": "str" # Optional. Type the - reference refers to (e.g. "Patient"). + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). }, "valueSampledData": { - "dimensions": 0, # Number of sample - points at each time point. Required. + "dimensions": 0, # Number of + sample points at each time point. + Required. "origin": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). }, "period": 0.0, # Number of - milliseconds between samples. - Required. - "data": "str", # Optional. Decimal - values with spaces, or "E" | "U" | - "L". - "factor": 0.0, # Optional. Multiply - data by this before adding to origin. - "lowerLimit": 0.0, # Optional. Lower - limit of detection. - "upperLimit": 0.0 # Optional. Upper - limit of detection. + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. }, - "valueString": "str", # Optional. Value - as string. + "valueString": "str", # Optional. + Value as string. "valueTime": "12:30:00" # Optional. - Value as time (hh:mm:ss). - } - ], - "id": "str", - # Optional. Unique id for inter-element - referencing. - "system": - "str", # Optional. Identity of the terminology - system. - "version": - "str" # Optional. Version of the system - if - relevant. - } - ], - "versionId": "str" # - Optional. 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. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. } } ], - "sex": "str" # Optional. The patient's sex. Known - values are: "female", "male", and "unspecified". - }, - "patientDocuments": [ - { - "content": { - "sourceType": "str", # 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" # The content of the - document, given either inline (as a string) or as a reference - (URI). Required. - }, - "id": "str", # A given identifier for the - document. Has to be unique across all documents for a single - patient. Required. - "type": "str", # 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". - "administrativeMetadata": { - "encounterId": "str", # Optional. - Reference to the encounter associated with the document. - "orderedProcedures": [ - { - "code": { - "coding": [ - { + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { "code": "str", # Optional. Symbol in - syntax defined by the system. + syntax defined by the system. "display": "str", # Optional. - Representation defined by the system. + Representation defined by the system. "extension": [ { - "url": "str", # Source of the - definition for the extension code - - a logical name or a URL. - Required. + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. "valueBoolean": bool, # - Optional. Value as boolean. + Optional. Value as boolean. "valueCodeableConcept": ..., "valueDateTime": "str", # - Optional. Value as dateTime. - "valueInteger": 0, # Optional. - Value as integer. + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. "valuePeriod": { - "end": "str", # Optional. - End time with inclusive - boundary, if not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. }, "valueQuantity": { - "code": "str", # Optional. - Coded form of the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the value. - "system": "str", # Optional. - System that defines coded - unit form. - "unit": "str", # Optional. - Unit representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). - }, - "valueRange": { - "high": { "code": "str", # Optional. Coded form of the unit. @@ -665,589 +719,196 @@ async def begin_infer_radiology_insights( Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, "low": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). } }, "valueRatio": { "denominator": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). }, "numerator": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). } }, "valueReference": { "display": "str", # - Optional. Text alternative - for the resource. + Optional. Text + alternative for the + resource. "identifier": { "assigner": ..., "period": { "end": "str", # - Optional. End time - with inclusive - boundary, if not - ongoing. + Optional. End + time with + inclusive + boundary, if not + ongoing. "start": "str" # - Optional. Starting - time with inclusive - boundary. + Optional. + Starting time + with inclusive + boundary. }, "system": "str", # - Optional. The namespace - for the identifier value. + Optional. The + namespace for the + identifier value. "type": ..., "use": "str", # - Optional. usual | - official | temp | - secondary | old (If - known). + Optional. usual | + official | temp | + secondary | old (If + known). "value": "str" # - Optional. The value that - is unique. + Optional. The value + that is unique. }, "reference": "str", # - Optional. Literal reference, - Relative, internal or - absolute URL. - "type": "str" # Optional. - Type the reference refers to - (e.g. "Patient"). + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). }, "valueSampledData": { - "dimensions": 0, # Number of - sample points at each time - point. Required. + "dimensions": 0, # + Number of sample points + at each time point. + Required. "origin": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). }, - "period": 0.0, # Number of - milliseconds between samples. - Required. - "data": "str", # Optional. - Decimal values with spaces, - or "E" | "U" | "L". - "factor": 0.0, # Optional. - Multiply data by this before - adding to origin. + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. "lowerLimit": 0.0, # - Optional. Lower limit of - detection. + Optional. Lower limit of + detection. "upperLimit": 0.0 # - Optional. Upper limit of - detection. + Optional. Upper limit of + detection. }, "valueString": "str", # - Optional. Value as string. + Optional. Value as string. "valueTime": "12:30:00" # - Optional. Value as time - (hh:mm:ss). + Optional. Value as time + (hh:mm:ss). } ], - "id": "str", # Optional. Unique id for - inter-element referencing. - "system": "str", # Optional. Identity of - the terminology system. - "version": "str" # Optional. Version of - the system - if relevant. - } - ], - "text": "str" - # Optional. Plain text representation of the - concept. - }, - "description": "str", - # Optional. Procedure description. - "extension": [ - { - "url": "str", # Source of the definition for - the extension code - a logical name or a URL. - Required. - "valueBoolean": bool, # Optional. Value as - boolean. - "valueCodeableConcept": { - "coding": [ - { - "code": "str", # Optional. - Symbol in syntax defined by the - system. - "display": "str", # Optional. - Representation defined by the - system. - "extension": [ - ... - ], - "id": "str", # Optional. Unique - id for inter-element referencing. + "id": "str", # Optional. Unique id + for inter-element referencing. "system": "str", # Optional. - Identity of the terminology - system. - "version": "str" # Optional. - Version of the system - if - relevant. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. } - ], + ], "text": "str" # Optional. Plain text - representation of the concept. - }, - "valueDateTime": "str", # Optional. Value as - dateTime. - "valueInteger": 0, # Optional. Value as - integer. - "valuePeriod": { - "end": "str", # Optional. End time with - inclusive boundary, if not ongoing. - "start": "str" # Optional. Starting time - with inclusive boundary. - }, - "valueQuantity": { - "code": "str", # Optional. Coded form of - the unit. - "comparator": "str", # Optional. < | <= - | >= | > - how to understand the value. - "system": "str", # Optional. System that - defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical value - (with implicit precision). - }, - "valueRange": { - "high": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - }, - "low": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - } - }, - "valueRatio": { - "denominator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - }, - "numerator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - } - }, - "valueReference": { - "display": "str", # Optional. Text - alternative for the resource. - "identifier": { - "assigner": ..., - "period": { - "end": "str", # Optional. End - time with inclusive boundary, if - not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. - }, - "system": "str", # Optional. The - namespace for the identifier value. - "type": { - "coding": [ - { - "code": "str", # - Optional. Symbol in - syntax defined by the - system. - "display": "str", # - Optional. Representation - defined by the system. - "extension": [ - ... - ], - "id": "str", # Optional. - Unique id for - inter-element - referencing. - "system": "str", # - Optional. Identity of the - terminology system. - "version": "str" # - Optional. Version of the - system - if relevant. - } - ], - "text": "str" # Optional. Plain - text representation of the - concept. - }, - "use": "str", # Optional. usual | - official | temp | secondary | old (If - known). - "value": "str" # Optional. The value - that is unique. - }, - "reference": "str", # Optional. Literal - reference, Relative, internal or absolute - URL. - "type": "str" # Optional. Type the - reference refers to (e.g. "Patient"). - }, - "valueSampledData": { - "dimensions": 0, # Number of sample - points at each time point. Required. - "origin": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - }, - "period": 0.0, # Number of milliseconds - between samples. Required. - "data": "str", # Optional. Decimal - values with spaces, or "E" | "U" | "L". - "factor": 0.0, # Optional. Multiply data - by this before adding to origin. - "lowerLimit": 0.0, # Optional. Lower - limit of detection. - "upperLimit": 0.0 # Optional. Upper - limit of detection. - }, - "valueString": "str", # Optional. Value as - string. - "valueTime": "12:30:00" # Optional. Value as - time (hh:mm:ss). - } - ] - } - ] - }, - "authors": [ - { - "fullName": "str", # - Optional. Text representation of the full name. - "id": "str" # Optional. - author id. - } - ], - "clinicalType": "str", # Optional. The type - of the clinical document. Known values are: "consultation", - "dischargeSummary", "historyAndPhysical", "radiologyReport", - "procedure", "progress", "laboratory", and "pathologyReport". - "createdDateTime": "2020-02-20 00:00:00", # - Optional. The date and time when the document was created. - "language": "str", # Optional. A 2 letter - ISO 639-1 representation of the language of the document. - "specialtyType": "str" # Optional. specialty - type the document. Known values are: "pathology" and "radiology". - } - ] - } - ], - "configuration": { - "includeEvidence": bool, # Optional. An indication whether the - model's output should include evidence for the inferences. - "inferenceOptions": { - "findingOptions": { - "provideFocusedSentenceEvidence": bool # Optional. - 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. - }, - "followupRecommendationOptions": { - "includeRecommendationsInReferences": bool, # - Optional. Include/Exclude follow-up recommendations in references to - a guideline or article. Default is false. - "includeRecommendationsWithNoSpecifiedModality": - bool, # Optional. Include/Exclude follow-up recommendations without - a specific radiology procedure. Default is false. - "provideFocusedSentenceEvidence": bool # Optional. - 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. - } - }, - "inferenceTypes": [ - "str" # Optional. 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. - ], - "locale": "str", # Optional. Local for the model to use. If not - specified, the model will use the default locale. - "verbose": bool # Optional. An indication whether the model should - produce verbose output. - } - } - - # response body for status code(s): 202 - response == { - "modelVersion": "str", # The version of the model used for inference, - expressed as the model date. Required. - "patientResults": [ - { - "inferences": [ - radiology_insights_inference - ], - "patientId": "str" # Identifier given for the patient in the - request. Required. - } - ] - } - """ - - @overload - async def begin_infer_radiology_insights( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RadiologyInsightsInferenceResult]: - """Create Radiology Insights job. - - Creates a Radiology Insights job with the given request body. - - :param body: Required. - :type body: JSON - :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: - - Example: - .. code-block:: python - - # response body for status code(s): 202 - response == { - "modelVersion": "str", # The version of the model used for inference, - expressed as the model date. Required. - "patientResults": [ - { - "inferences": [ - radiology_insights_inference - ], - "patientId": "str" # Identifier given for the patient in the - request. Required. - } - ] - } - """ - - @overload - async def begin_infer_radiology_insights( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RadiologyInsightsInferenceResult]: - """Create Radiology Insights job. - - Creates a Radiology Insights job with the given request body. - - :param body: Required. - :type body: IO[bytes] - :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: - - Example: - .. code-block:: python - - # response body for status code(s): 202 - response == { - "modelVersion": "str", # The version of the model used for inference, - expressed as the model date. Required. - "patientResults": [ - { - "inferences": [ - radiology_insights_inference - ], - "patientId": "str" # Identifier given for the patient in the - request. Required. - } - ] - } - """ - - @distributed_trace_async - async def begin_infer_radiology_insights( - self, body: Union[_models.RadiologyInsightsData, JSON, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.RadiologyInsightsInferenceResult]: - # pylint: disable=line-too-long - """Create Radiology Insights job. - - Creates a Radiology Insights job with the given request body. - - :param body: Is one of the following types: RadiologyInsightsData, JSON, IO[bytes] Required. - :type body: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsData or JSON or - IO[bytes] - :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: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "patients": [ - { - "id": "str", # A given identifier for the patient. Has to be - unique across all patients in a single request. Required. - "encounters": [ - { - "id": "str", # The id of the visit. - Required. - "class": "str", # Optional. The class of the - encounter. Known values are: "inpatient", "ambulatory", - "observation", "emergency", "virtual", and "healthHome". - "period": { - "end": "2020-02-20 00:00:00", # - Optional. End time with inclusive boundary, if not ongoing. - "start": "2020-02-20 00:00:00" # - Optional. Starting time with inclusive boundary. - } - } - ], - "info": { - "birthDate": "2020-02-20", # Optional. The patient's - date of birth. - "clinicalInfo": [ - { - "resourceType": "str", # The type of - resource. Required. - "id": "str", # Optional. Resource - Id. - "implicitRules": "str", # Optional. - A set of rules under which this content was created. - "language": "str", # Optional. - Language of the resource content. - "meta": { - "lastUpdated": "str", # - Optional. When the resource last changed - e.g. when the - version changed. - "profile": [ - "str" # Optional. A - list of profiles (references to `StructureDefinition - `_ - resources) that this resource claims to conform to. - The URL is a reference to `StructureDefinition.url - `_. - ], - "security": [ - { - "code": - "str", # Optional. Symbol in syntax defined by - the system. - "display": - "str", # Optional. Representation defined by the - system. + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. "extension": [ { @@ -1258,8 +919,27 @@ async def begin_infer_radiology_insights( as boolean. "valueCodeableConcept": { "coding": [ + { + "code": "str", # Optional. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. + "extension": [ ... ], + "id": "str", # Optional. + Unique id for inter-element + referencing. + "system": "str", # Optional. + Identity of the terminology + system. + "version": "str" # Optional. + Version of the system - if + relevant. + } + ], "text": "str" # Optional. Plain text representation of the concept. }, @@ -1369,8 +1049,33 @@ async def begin_infer_radiology_insights( value. "type": { "coding": [ + { + "code": "str", # + Optional. Symbol in + syntax defined by the + system. + "display": "str", # + Optional. + Representation + defined by the + system. + "extension": [ ... ], + "id": "str", # + Optional. Unique id + for inter-element + referencing. + "system": "str", # + Optional. Identity of + the terminology + system. + "version": "str" # + Optional. Version of + the system - if + relevant. + } + ], "text": "str" # Optional. Plain text representation of the concept. @@ -1423,73 +1128,181 @@ async def begin_infer_radiology_insights( "valueTime": "12:30:00" # Optional. Value as time (hh:mm:ss). } - ], - "id": "str", - # Optional. Unique id for inter-element - referencing. - "system": - "str", # Optional. Identity of the terminology - system. - "version": - "str" # Optional. Version of the system - if - relevant. + ] } - ], - "source": "str", # Optional. - 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. - "tag": [ - { - "code": - "str", # Optional. Symbol in syntax defined by - the system. - "display": - "str", # Optional. Representation defined by the - system. - "extension": - [ - { - "url": "str", # Source of the definition - for the extension code - a logical name - or a URL. Required. - "valueBoolean": bool, # Optional. Value - as boolean. + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. + } + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] + } + ], + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. + ], + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. + } + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. + } + + # response body for status code(s): 201, 200 + response == { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. "valueCodeableConcept": { "coding": [ ... ], - "text": "str" # Optional. Plain text - representation of the concept. + "text": "str" # Optional. Plain + text representation of the + concept. }, "valueDateTime": "str", # Optional. - Value as dateTime. - "valueInteger": 0, # Optional. Value as - integer. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. "valuePeriod": { - "end": "str", # Optional. End time - with inclusive boundary, if not - ongoing. - "start": "str" # Optional. Starting - time with inclusive boundary. + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. }, "valueQuantity": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). - }, - "valueRange": { - "high": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # Optional. @@ -1504,94 +1317,199 @@ async def begin_infer_radiology_insights( Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, "low": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueRatio": { "denominator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). }, "numerator": { - "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. - < | <= | >= | > - how to - understand the value. + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. "system": "str", # Optional. - System that defines coded unit - form. - "unit": "str", # Optional. Unit - representation. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. "value": 0.0 # Optional. - Numerical value (with implicit - precision). + Numerical value (with + implicit precision). } }, "valueReference": { - "display": "str", # Optional. Text - alternative for the resource. + "display": "str", # Optional. + Text alternative for the + resource. "identifier": { "assigner": ..., "period": { - "end": "str", # Optional. - End time with inclusive - boundary, if not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. }, - "system": "str", # Optional. The - namespace for the identifier - value. + "system": "str", # Optional. + The namespace for the + identifier value. "type": { "coding": [ ... ], - "text": "str" # Optional. - Plain text representation of - the concept. + "text": "str" # + Optional. Plain text + representation of the + concept. }, - "use": "str", # Optional. usual - | official | temp | secondary | - old (If known). - "value": "str" # Optional. The - value that is unique. + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. }, "reference": "str", # Optional. - Literal reference, Relative, internal - or absolute URL. - "type": "str" # Optional. Type the - reference refers to (e.g. "Patient"). + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). }, "valueSampledData": { - "dimensions": 0, # Number of sample - points at each time point. Required. + "dimensions": 0, # Number of + sample points at each time point. + Required. "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # Optional. @@ -1606,99 +1524,23 @@ async def begin_infer_radiology_insights( Numerical value (with implicit precision). }, - "period": 0.0, # Number of - milliseconds between samples. - Required. - "data": "str", # Optional. Decimal - values with spaces, or "E" | "U" | - "L". - "factor": 0.0, # Optional. Multiply - data by this before adding to origin. - "lowerLimit": 0.0, # Optional. Lower - limit of detection. - "upperLimit": 0.0 # Optional. Upper - limit of detection. - }, - "valueString": "str", # Optional. Value - as string. - "valueTime": "12:30:00" # Optional. - Value as time (hh:mm:ss). - } - ], - "id": "str", - # Optional. Unique id for inter-element - referencing. - "system": - "str", # Optional. Identity of the terminology - system. - "version": - "str" # Optional. Version of the system - if - relevant. - } - ], - "versionId": "str" # - Optional. 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. - } - } - ], - "sex": "str" # Optional. The patient's sex. Known - values are: "female", "male", and "unspecified". - }, - "patientDocuments": [ - { - "content": { - "sourceType": "str", # 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" # The content of the - document, given either inline (as a string) or as a reference - (URI). Required. - }, - "id": "str", # A given identifier for the - document. Has to be unique across all documents for a single - patient. Required. - "type": "str", # 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". - "administrativeMetadata": { - "encounterId": "str", # Optional. - Reference to the encounter associated with the document. - "orderedProcedures": [ - { - "code": { - "coding": [ - { - "code": "str", # Optional. Symbol in - syntax defined by the system. - "display": "str", # Optional. - Representation defined by the system. - "extension": [ - { - "url": "str", # Source of the - definition for the extension code - - a logical name or a URL. - Required. - "valueBoolean": bool, # - Optional. Value as boolean. - "valueCodeableConcept": ..., - "valueDateTime": "str", # - Optional. Value as dateTime. - "valueInteger": 0, # Optional. - Value as integer. - "valuePeriod": { - "end": "str", # Optional. - End time with inclusive - boundary, if not ongoing. - "start": "str" # Optional. - Starting time with inclusive - boundary. + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). }, - "valueQuantity": { + "low": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # @@ -1712,9 +1554,4549 @@ async def begin_infer_radiology_insights( "value": 0.0 # Optional. Numerical value (with implicit precision). + } }, - "valueRange": { - "high": { + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. + } + } + ], + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", # Optional. Symbol in + syntax defined by the system. + "display": "str", # Optional. + Representation defined by the system. + "extension": [ + { + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. + "valueBoolean": bool, # + Optional. Value as boolean. + "valueCodeableConcept": ..., + "valueDateTime": "str", # + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. + "valuePeriod": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # + Optional. Coded form of + the unit. + "comparator": "str", # + Optional. < | <= | >= | > + - how to understand the + value. + "system": "str", # + Optional. System that + defines coded unit form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "low": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "numerator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # + Optional. Text + alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End + time with + inclusive + boundary, if not + ongoing. + "start": "str" # + Optional. + Starting time + with inclusive + boundary. + }, + "system": "str", # + Optional. The + namespace for the + identifier value. + "type": ..., + "use": "str", # + Optional. usual | + official | temp | + secondary | old (If + known). + "value": "str" # + Optional. The value + that is unique. + }, + "reference": "str", # + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # + Number of sample points + at each time point. + Required. + "origin": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. + "lowerLimit": 0.0, # + Optional. Lower limit of + detection. + "upperLimit": 0.0 # + Optional. Upper limit of + detection. + }, + "valueString": "str", # + Optional. Value as string. + "valueTime": "12:30:00" # + Optional. Value as time + (hh:mm:ss). + } + ], + "id": "str", # Optional. Unique id + for inter-element referencing. + "system": "str", # Optional. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. + "extension": + [ + { + "url": "str", # Source of the definition + for the extension code - a logical name + or a URL. Required. + "valueBoolean": bool, # Optional. Value + as boolean. + "valueCodeableConcept": { + "coding": [ + { + "code": "str", # Optional. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. + "extension": [ + ... + ], + "id": "str", # Optional. + Unique id for inter-element + referencing. + "system": "str", # Optional. + Identity of the terminology + system. + "version": "str" # Optional. + Version of the system - if + relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value as + integer. + "valuePeriod": { + "end": "str", # Optional. End time + with inclusive boundary, if not + ongoing. + "start": "str" # Optional. Starting + time with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. < | + <= | >= | > - how to understand the + value. + "system": "str", # Optional. System + that defines coded unit form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. Numerical + value (with implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "low": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "numerator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # Optional. Text + alternative for the resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # Optional. + End time with inclusive + boundary, if not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "system": "str", # Optional. The + namespace for the identifier + value. + "type": { + "coding": [ + { + "code": "str", # + Optional. Symbol in + syntax defined by the + system. + "display": "str", # + Optional. + Representation + defined by the + system. + "extension": [ + ... + ], + "id": "str", # + Optional. Unique id + for inter-element + referencing. + "system": "str", # + Optional. Identity of + the terminology + system. + "version": "str" # + Optional. Version of + the system - if + relevant. + } + ], + "text": "str" # Optional. + Plain text representation of + the concept. + }, + "use": "str", # Optional. usual + | official | temp | secondary | + old (If known). + "value": "str" # Optional. The + value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, internal + or absolute URL. + "type": "str" # Optional. Type the + reference refers to (e.g. "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of sample + points at each time point. Required. + "origin": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. Decimal + values with spaces, or "E" | "U" | + "L". + "factor": 0.0, # Optional. Multiply + data by this before adding to origin. + "lowerLimit": 0.0, # Optional. Lower + limit of detection. + "upperLimit": 0.0 # Optional. Upper + limit of detection. + }, + "valueString": "str", # Optional. Value + as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ] + } + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. + } + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] + } + ], + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. + ], + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. + } + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. + } + """ + + @overload + 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.RadiologyInsightsJob]: + # pylint: disable=line-too-long + """Create Radiology Insights job. + + Creates a Radiology Insights job with the given request body. + + :param id: The unique ID of the job. 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 RadiologyInsightsJob. The + RadiologyInsightsJob is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 201, 200 + response == { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. + } + } + ], + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", # Optional. Symbol in + syntax defined by the system. + "display": "str", # Optional. + Representation defined by the system. + "extension": [ + { + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. + "valueBoolean": bool, # + Optional. Value as boolean. + "valueCodeableConcept": ..., + "valueDateTime": "str", # + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. + "valuePeriod": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # + Optional. Coded form of + the unit. + "comparator": "str", # + Optional. < | <= | >= | > + - how to understand the + value. + "system": "str", # + Optional. System that + defines coded unit form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "low": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "numerator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # + Optional. Text + alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End + time with + inclusive + boundary, if not + ongoing. + "start": "str" # + Optional. + Starting time + with inclusive + boundary. + }, + "system": "str", # + Optional. The + namespace for the + identifier value. + "type": ..., + "use": "str", # + Optional. usual | + official | temp | + secondary | old (If + known). + "value": "str" # + Optional. The value + that is unique. + }, + "reference": "str", # + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # + Number of sample points + at each time point. + Required. + "origin": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. + "lowerLimit": 0.0, # + Optional. Lower limit of + detection. + "upperLimit": 0.0 # + Optional. Upper limit of + detection. + }, + "valueString": "str", # + Optional. Value as string. + "valueTime": "12:30:00" # + Optional. Value as time + (hh:mm:ss). + } + ], + "id": "str", # Optional. Unique id + for inter-element referencing. + "system": "str", # Optional. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. + "extension": + [ + { + "url": "str", # Source of the definition + for the extension code - a logical name + or a URL. Required. + "valueBoolean": bool, # Optional. Value + as boolean. + "valueCodeableConcept": { + "coding": [ + { + "code": "str", # Optional. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. + "extension": [ + ... + ], + "id": "str", # Optional. + Unique id for inter-element + referencing. + "system": "str", # Optional. + Identity of the terminology + system. + "version": "str" # Optional. + Version of the system - if + relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value as + integer. + "valuePeriod": { + "end": "str", # Optional. End time + with inclusive boundary, if not + ongoing. + "start": "str" # Optional. Starting + time with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. < | + <= | >= | > - how to understand the + value. + "system": "str", # Optional. System + that defines coded unit form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. Numerical + value (with implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "low": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "numerator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # Optional. Text + alternative for the resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # Optional. + End time with inclusive + boundary, if not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "system": "str", # Optional. The + namespace for the identifier + value. + "type": { + "coding": [ + { + "code": "str", # + Optional. Symbol in + syntax defined by the + system. + "display": "str", # + Optional. + Representation + defined by the + system. + "extension": [ + ... + ], + "id": "str", # + Optional. Unique id + for inter-element + referencing. + "system": "str", # + Optional. Identity of + the terminology + system. + "version": "str" # + Optional. Version of + the system - if + relevant. + } + ], + "text": "str" # Optional. + Plain text representation of + the concept. + }, + "use": "str", # Optional. usual + | official | temp | secondary | + old (If known). + "value": "str" # Optional. The + value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, internal + or absolute URL. + "type": "str" # Optional. Type the + reference refers to (e.g. "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of sample + points at each time point. Required. + "origin": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. Decimal + values with spaces, or "E" | "U" | + "L". + "factor": 0.0, # Optional. Multiply + data by this before adding to origin. + "lowerLimit": 0.0, # Optional. Lower + limit of detection. + "upperLimit": 0.0 # Optional. Upper + limit of detection. + }, + "valueString": "str", # Optional. Value + as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ] + } + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. + } + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] + } + ], + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. + ], + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. + } + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. + } + """ + + @overload + 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.RadiologyInsightsJob]: + # pylint: disable=line-too-long + """Create Radiology Insights job. + + Creates a Radiology Insights job with the given request body. + + :param id: The unique ID of the job. 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 RadiologyInsightsJob. The + RadiologyInsightsJob is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 201, 200 + response == { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. + } + } + ], + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", # Optional. Symbol in + syntax defined by the system. + "display": "str", # Optional. + Representation defined by the system. + "extension": [ + { + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. + "valueBoolean": bool, # + Optional. Value as boolean. + "valueCodeableConcept": ..., + "valueDateTime": "str", # + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. + "valuePeriod": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # + Optional. Coded form of + the unit. + "comparator": "str", # + Optional. < | <= | >= | > + - how to understand the + value. + "system": "str", # + Optional. System that + defines coded unit form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "low": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "numerator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # + Optional. Text + alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End + time with + inclusive + boundary, if not + ongoing. + "start": "str" # + Optional. + Starting time + with inclusive + boundary. + }, + "system": "str", # + Optional. The + namespace for the + identifier value. + "type": ..., + "use": "str", # + Optional. usual | + official | temp | + secondary | old (If + known). + "value": "str" # + Optional. The value + that is unique. + }, + "reference": "str", # + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # + Number of sample points + at each time point. + Required. + "origin": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. + "lowerLimit": 0.0, # + Optional. Lower limit of + detection. + "upperLimit": 0.0 # + Optional. Upper limit of + detection. + }, + "valueString": "str", # + Optional. Value as string. + "valueTime": "12:30:00" # + Optional. Value as time + (hh:mm:ss). + } + ], + "id": "str", # Optional. Unique id + for inter-element referencing. + "system": "str", # Optional. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. + "extension": + [ + { + "url": "str", # Source of the definition + for the extension code - a logical name + or a URL. Required. + "valueBoolean": bool, # Optional. Value + as boolean. + "valueCodeableConcept": { + "coding": [ + { + "code": "str", # Optional. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. + "extension": [ + ... + ], + "id": "str", # Optional. + Unique id for inter-element + referencing. + "system": "str", # Optional. + Identity of the terminology + system. + "version": "str" # Optional. + Version of the system - if + relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value as + integer. + "valuePeriod": { + "end": "str", # Optional. End time + with inclusive boundary, if not + ongoing. + "start": "str" # Optional. Starting + time with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. < | + <= | >= | > - how to understand the + value. + "system": "str", # Optional. System + that defines coded unit form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. Numerical + value (with implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "low": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "numerator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # Optional. Text + alternative for the resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # Optional. + End time with inclusive + boundary, if not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "system": "str", # Optional. The + namespace for the identifier + value. + "type": { + "coding": [ + { + "code": "str", # + Optional. Symbol in + syntax defined by the + system. + "display": "str", # + Optional. + Representation + defined by the + system. + "extension": [ + ... + ], + "id": "str", # + Optional. Unique id + for inter-element + referencing. + "system": "str", # + Optional. Identity of + the terminology + system. + "version": "str" # + Optional. Version of + the system - if + relevant. + } + ], + "text": "str" # Optional. + Plain text representation of + the concept. + }, + "use": "str", # Optional. usual + | official | temp | secondary | + old (If known). + "value": "str" # Optional. The + value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, internal + or absolute URL. + "type": "str" # Optional. Type the + reference refers to (e.g. "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of sample + points at each time point. Required. + "origin": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. Decimal + values with spaces, or "E" | "U" | + "L". + "factor": 0.0, # Optional. Multiply + data by this before adding to origin. + "lowerLimit": 0.0, # Optional. Lower + limit of detection. + "upperLimit": 0.0 # Optional. Upper + limit of detection. + }, + "valueString": "str", # Optional. Value + as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ] + } + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. + } + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] + } + ], + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. + ], + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. + } + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. + } + """ + + @distributed_trace_async + 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.RadiologyInsightsJob]: + # pylint: disable=line-too-long + """Create Radiology Insights job. + + Creates a Radiology Insights job with the given request body. + + :param id: The unique ID of the job. 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 RadiologyInsightsJob. The + RadiologyInsightsJob is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + resource = { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. + } + } + ], + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", # Optional. Symbol in + syntax defined by the system. + "display": "str", # Optional. + Representation defined by the system. + "extension": [ + { + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. + "valueBoolean": bool, # + Optional. Value as boolean. + "valueCodeableConcept": ..., + "valueDateTime": "str", # + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. + "valuePeriod": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # + Optional. Coded form of + the unit. + "comparator": "str", # + Optional. < | <= | >= | > + - how to understand the + value. + "system": "str", # + Optional. System that + defines coded unit form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "low": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "numerator": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # + Optional. Text + alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End + time with + inclusive + boundary, if not + ongoing. + "start": "str" # + Optional. + Starting time + with inclusive + boundary. + }, + "system": "str", # + Optional. The + namespace for the + identifier value. + "type": ..., + "use": "str", # + Optional. usual | + official | temp | + secondary | old (If + known). + "value": "str" # + Optional. The value + that is unique. + }, + "reference": "str", # + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # + Number of sample points + at each time point. + Required. + "origin": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. + "lowerLimit": 0.0, # + Optional. Lower limit of + detection. + "upperLimit": 0.0 # + Optional. Upper limit of + detection. + }, + "valueString": "str", # + Optional. Value as string. + "valueTime": "12:30:00" # + Optional. Value as time + (hh:mm:ss). + } + ], + "id": "str", # Optional. Unique id + for inter-element referencing. + "system": "str", # Optional. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. + "extension": + [ + { + "url": "str", # Source of the definition + for the extension code - a logical name + or a URL. Required. + "valueBoolean": bool, # Optional. Value + as boolean. + "valueCodeableConcept": { + "coding": [ + { + "code": "str", # Optional. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. + "extension": [ + ... + ], + "id": "str", # Optional. + Unique id for inter-element + referencing. + "system": "str", # Optional. + Identity of the terminology + system. + "version": "str" # Optional. + Version of the system - if + relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value as + integer. + "valuePeriod": { + "end": "str", # Optional. End time + with inclusive boundary, if not + ongoing. + "start": "str" # Optional. Starting + time with inclusive boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. < | + <= | >= | > - how to understand the + value. + "system": "str", # Optional. System + that defines coded unit form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. Numerical + value (with implicit precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "low": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "numerator": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + } + }, + "valueReference": { + "display": "str", # Optional. Text + alternative for the resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # Optional. + End time with inclusive + boundary, if not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "system": "str", # Optional. The + namespace for the identifier + value. + "type": { + "coding": [ + { + "code": "str", # + Optional. Symbol in + syntax defined by the + system. + "display": "str", # + Optional. + Representation + defined by the + system. + "extension": [ + ... + ], + "id": "str", # + Optional. Unique id + for inter-element + referencing. + "system": "str", # + Optional. Identity of + the terminology + system. + "version": "str" # + Optional. Version of + the system - if + relevant. + } + ], + "text": "str" # Optional. + Plain text representation of + the concept. + }, + "use": "str", # Optional. usual + | official | temp | secondary | + old (If known). + "value": "str" # Optional. The + value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, internal + or absolute URL. + "type": "str" # Optional. Type the + reference refers to (e.g. "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of sample + points at each time point. Required. + "origin": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. Decimal + values with spaces, or "E" | "U" | + "L". + "factor": 0.0, # Optional. Multiply + data by this before adding to origin. + "lowerLimit": 0.0, # Optional. Lower + limit of detection. + "upperLimit": 0.0 # Optional. Upper + limit of detection. + }, + "valueString": "str", # Optional. Value + as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ] + } + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. + } + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] + } + ], + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. + ], + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. + } + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. + } + + # response body for status code(s): 201, 200 + response == { + "id": "str", # The unique ID of the job. Required. + "status": "str", # The status of the job. Required. Known values are: + "notStarted", "running", "succeeded", "failed", and "canceled". + "createdAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job was created. + "error": { + "code": "str", # One of a server-defined set of error codes. + Required. + "message": "str", # A human-readable representation of the error. + Required. + "details": [ + ... + ], + "innererror": { + "code": "str", # Optional. One of a server-defined set of + error codes. + "innererror": ... + }, + "target": "str" # Optional. The target of the error. + }, + "expiresAt": "2020-02-20 00:00:00", # Optional. The date and time when the + processing job is set to expire. + "jobData": { + "patients": [ + { + "id": "str", # A given identifier for the patient. + Has to be unique across all patients in a single request. Required. + "details": { + "birthDate": "2020-02-20", # Optional. The + patient's date of birth. + "clinicalInfo": [ + { + "resourceType": "str", # The + type of resource. Required. + "id": "str", # Optional. + Resource Id. + "implicitRules": "str", # + Optional. A set of rules under which this content was + created. + "language": "str", # + Optional. Language of the resource content. + "meta": { + "lastUpdated": "str", + # Optional. When the resource last changed - e.g. + when the version changed. + "profile": [ + "str" # + Optional. A list of profiles (references to + `StructureDefinition + `_ + resources) that this resource claims to conform + to. The URL is a reference to + `StructureDefinition.url + `_. + ], + "security": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "source": "str", # + Optional. 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. + "tag": [ + { + "code": "str", # Optional. Symbol in syntax + defined by the system. + "display": "str", # Optional. Representation + defined by the system. + "extension": [ + { + "url": "str", # Source of the + definition for the extension code - a + logical name or a URL. Required. + "valueBoolean": bool, # Optional. + Value as boolean. + "valueCodeableConcept": { + "coding": [ + ... + ], + "text": "str" # Optional. Plain + text representation of the + concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. + "valueInteger": 0, # Optional. Value + as integer. + "valuePeriod": { + "end": "str", # Optional. End + time with inclusive boundary, if + not ongoing. + "start": "str" # Optional. + Starting time with inclusive + boundary. + }, + "valueQuantity": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, + "valueRange": { + "high": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "low": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueRatio": { + "denominator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "numerator": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + } + }, + "valueReference": { + "display": "str", # Optional. + Text alternative for the + resource. + "identifier": { + "assigner": ..., + "period": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "system": "str", # Optional. + The namespace for the + identifier value. + "type": { + "coding": [ + ... + ], + "text": "str" # + Optional. Plain text + representation of the + concept. + }, + "use": "str", # Optional. + usual | official | temp | + secondary | old (If known). + "value": "str" # Optional. + The value that is unique. + }, + "reference": "str", # Optional. + Literal reference, Relative, + internal or absolute URL. + "type": "str" # Optional. Type + the reference refers to (e.g. + "Patient"). + }, + "valueSampledData": { + "dimensions": 0, # Number of + sample points at each time point. + Required. + "origin": { + "code": "str", # Optional. + Coded form of the unit. + "comparator": "str", # + Optional. < | <= | >= | > - + how to understand the value. + "system": "str", # Optional. + System that defines coded + unit form. + "unit": "str", # Optional. + Unit representation. + "value": 0.0 # Optional. + Numerical value (with + implicit precision). + }, + "period": 0.0, # Number of + milliseconds between samples. + Required. + "data": "str", # Optional. + Decimal values with spaces, or + "E" | "U" | "L". + "factor": 0.0, # Optional. + Multiply data by this before + adding to origin. + "lowerLimit": 0.0, # Optional. + Lower limit of detection. + "upperLimit": 0.0 # Optional. + Upper limit of detection. + }, + "valueString": "str", # Optional. + Value as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ], + "id": + "str", # Optional. Unique id for + inter-element referencing. + "system": "str", # Optional. Identity of the + terminology system. + "version": "str" # Optional. Version of the + system - if relevant. + } + ], + "versionId": "str" # + Optional. 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. + } + } + ], + "sex": "str" # Optional. The patient's sex. + Known values are: "female", "male", and "unspecified". + }, + "encounters": [ + { + "id": "str", # The id of the visit. + Required. + "class": "str", # Optional. The + class of the encounter. Known values are: "inpatient", + "ambulatory", "observation", "emergency", "virtual", and + "healthHome". + "period": { + "end": "2020-02-20 00:00:00", + # Optional. End time with inclusive boundary, if not + ongoing. + "start": "2020-02-20 + 00:00:00" # Optional. Starting time with inclusive + boundary. + } + } + ], + "patientDocuments": [ + { + "content": { + "sourceType": "str", # 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" # The content + of the document, given either inline (as a string) or as + a reference (URI). Required. + }, + "id": "str", # A given identifier + for the document. Has to be unique across all documents for a + single patient. Required. + "type": "str", # 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". + "administrativeMetadata": { + "encounterId": "str", # + Optional. Reference to the encounter associated with the + document. + "orderedProcedures": [ + { + "code": { + "coding": [ + { + "code": "str", # Optional. Symbol in + syntax defined by the system. + "display": "str", # Optional. + Representation defined by the system. + "extension": [ + { + "url": "str", # Source of + the definition for the + extension code - a logical + name or a URL. Required. + "valueBoolean": bool, # + Optional. Value as boolean. + "valueCodeableConcept": ..., + "valueDateTime": "str", # + Optional. Value as dateTime. + "valueInteger": 0, # + Optional. Value as integer. + "valuePeriod": { + "end": "str", # + Optional. End time with + inclusive boundary, if + not ongoing. + "start": "str" # + Optional. Starting time + with inclusive boundary. + }, + "valueQuantity": { "code": "str", # Optional. Coded form of the unit. @@ -1732,216 +6114,242 @@ async def begin_infer_radiology_insights( Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. + "system": "str", # + Optional. System that + defines coded unit + form. + "unit": "str", # + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). + }, "low": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). } }, "valueRatio": { "denominator": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). }, "numerator": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). } }, "valueReference": { "display": "str", # - Optional. Text alternative - for the resource. + Optional. Text + alternative for the + resource. "identifier": { "assigner": ..., "period": { "end": "str", # - Optional. End time - with inclusive - boundary, if not - ongoing. + Optional. End + time with + inclusive + boundary, if not + ongoing. "start": "str" # - Optional. Starting - time with inclusive - boundary. + Optional. + Starting time + with inclusive + boundary. }, "system": "str", # - Optional. The namespace - for the identifier value. + Optional. The + namespace for the + identifier value. "type": ..., "use": "str", # - Optional. usual | - official | temp | - secondary | old (If - known). + Optional. usual | + official | temp | + secondary | old (If + known). "value": "str" # - Optional. The value that - is unique. + Optional. The value + that is unique. }, "reference": "str", # - Optional. Literal reference, - Relative, internal or - absolute URL. - "type": "str" # Optional. - Type the reference refers to - (e.g. "Patient"). + Optional. Literal + reference, Relative, + internal or absolute URL. + "type": "str" # + Optional. Type the + reference refers to (e.g. + "Patient"). }, "valueSampledData": { - "dimensions": 0, # Number of - sample points at each time - point. Required. + "dimensions": 0, # + Number of sample points + at each time point. + Required. "origin": { "code": "str", # - Optional. Coded form of - the unit. - "comparator": "str", # - Optional. < | <= | >= | > - - how to understand the - value. + Optional. Coded form + of the unit. + "comparator": "str", + # Optional. < | <= | + >= | > - how to + understand the value. "system": "str", # - Optional. System that - defines coded unit form. + Optional. System that + defines coded unit + form. "unit": "str", # - Optional. Unit - representation. - "value": 0.0 # Optional. - Numerical value (with - implicit precision). + Optional. Unit + representation. + "value": 0.0 # + Optional. Numerical + value (with implicit + precision). }, - "period": 0.0, # Number of - milliseconds between samples. - Required. - "data": "str", # Optional. - Decimal values with spaces, - or "E" | "U" | "L". - "factor": 0.0, # Optional. - Multiply data by this before - adding to origin. + "period": 0.0, # Number + of milliseconds between + samples. Required. + "data": "str", # + Optional. Decimal values + with spaces, or "E" | "U" + | "L". + "factor": 0.0, # + Optional. Multiply data + by this before adding to + origin. "lowerLimit": 0.0, # - Optional. Lower limit of - detection. + Optional. Lower limit of + detection. "upperLimit": 0.0 # - Optional. Upper limit of - detection. + Optional. Upper limit of + detection. }, "valueString": "str", # - Optional. Value as string. + Optional. Value as string. "valueTime": "12:30:00" # - Optional. Value as time - (hh:mm:ss). + Optional. Value as time + (hh:mm:ss). } ], - "id": "str", # Optional. Unique id for - inter-element referencing. - "system": "str", # Optional. Identity of - the terminology system. - "version": "str" # Optional. Version of - the system - if relevant. - } - ], - "text": "str" - # Optional. Plain text representation of the - concept. - }, - "description": "str", - # Optional. Procedure description. - "extension": [ - { - "url": "str", # Source of the definition for - the extension code - a logical name or a URL. - Required. - "valueBoolean": bool, # Optional. Value as - boolean. + "id": "str", # Optional. Unique id + for inter-element referencing. + "system": "str", # Optional. + Identity of the terminology system. + "version": "str" # Optional. Version + of the system - if relevant. + } + ], + "text": "str" # Optional. Plain text + representation of the concept. + }, + "description": "str", # Optional. Procedure + description. + "extension": + [ + { + "url": "str", # Source of the definition + for the extension code - a logical name + or a URL. Required. + "valueBoolean": bool, # Optional. Value + as boolean. "valueCodeableConcept": { "coding": [ { "code": "str", # Optional. - Symbol in syntax defined by the - system. - "display": "str", # Optional. - Representation defined by the - system. + Symbol in syntax defined by + the system. + "display": "str", # + Optional. Representation + defined by the system. "extension": [ ... ], - "id": "str", # Optional. Unique - id for inter-element referencing. + "id": "str", # Optional. + Unique id for inter-element + referencing. "system": "str", # Optional. - Identity of the terminology - system. + Identity of the terminology + system. "version": "str" # Optional. - Version of the system - if - relevant. + Version of the system - if + relevant. } ], "text": "str" # Optional. Plain text - representation of the concept. - }, - "valueDateTime": "str", # Optional. Value as - dateTime. + representation of the concept. + }, + "valueDateTime": "str", # Optional. + Value as dateTime. "valueInteger": 0, # Optional. Value as - integer. + integer. "valuePeriod": { - "end": "str", # Optional. End time with - inclusive boundary, if not ongoing. - "start": "str" # Optional. Starting time - with inclusive boundary. - }, + "end": "str", # Optional. End time + with inclusive boundary, if not + ongoing. + "start": "str" # Optional. Starting + time with inclusive boundary. + }, "valueQuantity": { - "code": "str", # Optional. Coded form of - the unit. - "comparator": "str", # Optional. < | <= - | >= | > - how to understand the value. - "system": "str", # Optional. System that - defines coded unit form. - "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical value - (with implicit precision). - }, - "valueRange": { - "high": { "code": "str", # Optional. Coded form of the unit. "comparator": "str", # Optional. < | @@ -1954,241 +6362,281 @@ async def begin_infer_radiology_insights( "value": 0.0 # Optional. Numerical value (with implicit precision). }, + "valueRange": { + "high": { + "code": "str", # Optional. Coded + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. + "unit": "str", # Optional. Unit + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). + }, "low": { "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). } - }, + }, "valueRatio": { "denominator": { "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). }, "numerator": { "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). } - }, + }, "valueReference": { "display": "str", # Optional. Text - alternative for the resource. + alternative for the resource. "identifier": { "assigner": ..., "period": { - "end": "str", # Optional. End - time with inclusive boundary, if - not ongoing. + "end": "str", # Optional. + End time with inclusive + boundary, if not ongoing. "start": "str" # Optional. - Starting time with inclusive - boundary. + Starting time with inclusive + boundary. }, "system": "str", # Optional. The - namespace for the identifier value. + namespace for the identifier + value. "type": { "coding": [ { "code": "str", # - Optional. Symbol in - syntax defined by the - system. + Optional. Symbol in + syntax defined by the + system. "display": "str", # - Optional. Representation - defined by the system. + Optional. + Representation + defined by the + system. "extension": [ ... ], - "id": "str", # Optional. - Unique id for - inter-element - referencing. + "id": "str", # + Optional. Unique id + for inter-element + referencing. "system": "str", # - Optional. Identity of the - terminology system. + Optional. Identity of + the terminology + system. "version": "str" # - Optional. Version of the - system - if relevant. + Optional. Version of + the system - if + relevant. } ], - "text": "str" # Optional. Plain - text representation of the - concept. + "text": "str" # Optional. + Plain text representation of + the concept. }, - "use": "str", # Optional. usual | - official | temp | secondary | old (If - known). - "value": "str" # Optional. The value - that is unique. + "use": "str", # Optional. usual + | official | temp | secondary | + old (If known). + "value": "str" # Optional. The + value that is unique. }, - "reference": "str", # Optional. Literal - reference, Relative, internal or absolute - URL. + "reference": "str", # Optional. + Literal reference, Relative, internal + or absolute URL. "type": "str" # Optional. Type the - reference refers to (e.g. "Patient"). - }, + reference refers to (e.g. "Patient"). + }, "valueSampledData": { "dimensions": 0, # Number of sample - points at each time point. Required. + points at each time point. Required. "origin": { "code": "str", # Optional. Coded - form of the unit. - "comparator": "str", # Optional. < | - <= | >= | > - how to understand the - value. - "system": "str", # Optional. System - that defines coded unit form. + form of the unit. + "comparator": "str", # Optional. + < | <= | >= | > - how to + understand the value. + "system": "str", # Optional. + System that defines coded unit + form. "unit": "str", # Optional. Unit - representation. - "value": 0.0 # Optional. Numerical - value (with implicit precision). + representation. + "value": 0.0 # Optional. + Numerical value (with implicit + precision). }, - "period": 0.0, # Number of milliseconds - between samples. Required. + "period": 0.0, # Number of + milliseconds between samples. + Required. "data": "str", # Optional. Decimal - values with spaces, or "E" | "U" | "L". - "factor": 0.0, # Optional. Multiply data - by this before adding to origin. + values with spaces, or "E" | "U" | + "L". + "factor": 0.0, # Optional. Multiply + data by this before adding to origin. "lowerLimit": 0.0, # Optional. Lower - limit of detection. + limit of detection. "upperLimit": 0.0 # Optional. Upper - limit of detection. - }, - "valueString": "str", # Optional. Value as - string. - "valueTime": "12:30:00" # Optional. Value as - time (hh:mm:ss). - } - ] + limit of detection. + }, + "valueString": "str", # Optional. Value + as string. + "valueTime": "12:30:00" # Optional. + Value as time (hh:mm:ss). + } + ] + } + ] + }, + "authors": [ + { + "fullName": "str", # + Optional. Text representation of the full name. + "id": "str" # + Optional. author id. } - ] - }, - "authors": [ - { - "fullName": "str", # - Optional. Text representation of the full name. - "id": "str" # Optional. - author id. - } - ], - "clinicalType": "str", # Optional. The type - of the clinical document. Known values are: "consultation", - "dischargeSummary", "historyAndPhysical", "radiologyReport", - "procedure", "progress", "laboratory", and "pathologyReport". - "createdDateTime": "2020-02-20 00:00:00", # - Optional. The date and time when the document was created. - "language": "str", # Optional. A 2 letter - ISO 639-1 representation of the language of the document. - "specialtyType": "str" # Optional. specialty - type the document. Known values are: "pathology" and "radiology". - } - ] - } - ], - "configuration": { - "includeEvidence": bool, # Optional. An indication whether the - model's output should include evidence for the inferences. - "inferenceOptions": { - "findingOptions": { - "provideFocusedSentenceEvidence": bool # Optional. - 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. - }, - "followupRecommendationOptions": { - "includeRecommendationsInReferences": bool, # - Optional. Include/Exclude follow-up recommendations in references to - a guideline or article. Default is false. - "includeRecommendationsWithNoSpecifiedModality": - bool, # Optional. Include/Exclude follow-up recommendations without - a specific radiology procedure. Default is false. - "provideFocusedSentenceEvidence": bool # Optional. - 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. + ], + "clinicalType": "str", # Optional. + The type of the clinical document. Known values are: + "consultation", "dischargeSummary", "historyAndPhysical", + "radiologyReport", "procedure", "progress", "laboratory", and + "pathologyReport". + "createdAt": "2020-02-20 00:00:00", + # Optional. The date and time when the document was created. + "language": "str", # Optional. A 2 + letter ISO 639-1 representation of the language of the + document. + "specialtyType": "str" # Optional. + specialty type the document. Known values are: "pathology" + and "radiology". + } + ] } - }, - "inferenceTypes": [ - "str" # Optional. 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. ], - "locale": "str", # Optional. Local for the model to use. If not - specified, the model will use the default locale. - "verbose": bool # Optional. An indication whether the model should - produce verbose output. - } - } - - # response body for status code(s): 202 - response == { - "modelVersion": "str", # The version of the model used for inference, - expressed as the model date. Required. - "patientResults": [ - { - "inferences": [ - radiology_insights_inference + "configuration": { + "includeEvidence": bool, # Optional. An indication whether + the model's output should include evidence for the inferences. + "inferenceOptions": { + "findingOptions": { + "provideFocusedSentenceEvidence": bool # + Optional. 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. + }, + "followupRecommendationOptions": { + "includeRecommendationsInReferences": bool, + # Optional. Include/Exclude follow-up recommendations in + references to a guideline or article. Default is false. + "includeRecommendationsWithNoSpecifiedModality": bool, # + Optional. Include/Exclude follow-up recommendations without a + specific radiology procedure. Default is false. + "provideFocusedSentenceEvidence": bool # + Optional. 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. + } + }, + "inferenceTypes": [ + "str" # Optional. 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. ], - "patientId": "str" # Identifier given for the patient in the - request. Required. + "locale": "str", # Optional. Local for the model to use. If + not specified, the model will use the default locale. + "verbose": bool # Optional. An indication whether the model + should produce verbose output. } - ] + }, + "result": { + "modelVersion": "str", # The version of the model used for + inference, expressed as the model date. Required. + "patientResults": [ + { + "inferences": [ + radiology_insights_inference + ], + "patientId": "str" # Identifier given for the + patient in the request. Required. + } + ] + }, + "updatedAt": "2020-02-20 00:00:00" # Optional. The date and time when the + processing job was last updated. } """ _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.RadiologyInsightsInferenceResult] = kwargs.pop("cls", None) + cls: ClsType[_models.RadiologyInsightsJob] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._infer_radiology_insights_initial( - body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs + 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._deserialize("str", response.headers.get("x-ms-request-id")) response_headers["Operation-Location"] = self._deserialize( "str", response.headers.get("Operation-Location") ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Repeatability-Result"] = self._deserialize( - "str", response.headers.get("Repeatability-Result") - ) - deserialized = _deserialize(_models.RadiologyInsightsInferenceResult, 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 @@ -2207,12 +6655,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.RadiologyInsightsInferenceResult].from_continuation_token( + return AsyncLROPoller[_models.RadiologyInsightsJob].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.RadiologyInsightsInferenceResult]( + return AsyncLROPoller[_models.RadiologyInsightsJob]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) 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 92be83c71ea1..160541b134c2 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 @@ -22,7 +22,6 @@ from ._models import DocumentContent from ._models import DomainResource from ._models import Element -from ._models import Encounter from ._models import Error from ._models import Extension from ._models import FindingInference @@ -31,7 +30,8 @@ from ._models import FollowupRecommendationInference from ._models import FollowupRecommendationOptions from ._models import GenericProcedureRecommendation -from ._models import HealthInsightsOperationStatus +from ._models import HealthInsightsErrorResponse +from ._models import HealthInsightsErrorResponseRequestId from ._models import Identifier from ._models import ImagingProcedure from ._models import ImagingProcedureRecommendation @@ -46,6 +46,7 @@ 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 @@ -55,14 +56,15 @@ 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 RadiologyInsightsResult from ._models import RadiologyProcedureInference from ._models import Range from ._models import Ratio from ._models import RecommendationFinding from ._models import Reference +from ._models import RequestIdResponseHeader from ._models import ResearchStudy from ._models import ResearchStudyArm from ._models import ResearchStudyObjective @@ -84,7 +86,6 @@ from ._enums import PatientSex from ._enums import RadiologyInsightsInferenceType from ._enums import RecommendationFindingStatusType -from ._enums import RepeatabilityResult from ._enums import ResearchStudyStatusCodeType from ._enums import SpecialtyType from ._patch import __all__ as _patch_all @@ -108,7 +109,6 @@ "DocumentContent", "DomainResource", "Element", - "Encounter", "Error", "Extension", "FindingInference", @@ -117,7 +117,8 @@ "FollowupRecommendationInference", "FollowupRecommendationOptions", "GenericProcedureRecommendation", - "HealthInsightsOperationStatus", + "HealthInsightsErrorResponse", + "HealthInsightsErrorResponseRequestId", "Identifier", "ImagingProcedure", "ImagingProcedureRecommendation", @@ -132,6 +133,7 @@ "OrderedProcedure", "PatientDetails", "PatientDocument", + "PatientEncounter", "PatientRecord", "Period", "ProcedureRecommendation", @@ -141,14 +143,15 @@ "RadiologyInsightsInference", "RadiologyInsightsInferenceOptions", "RadiologyInsightsInferenceResult", + "RadiologyInsightsJob", "RadiologyInsightsModelConfiguration", "RadiologyInsightsPatientResult", - "RadiologyInsightsResult", "RadiologyProcedureInference", "Range", "Ratio", "RecommendationFinding", "Reference", + "RequestIdResponseHeader", "ResearchStudy", "ResearchStudyArm", "ResearchStudyObjective", @@ -169,7 +172,6 @@ "PatientSex", "RadiologyInsightsInferenceType", "RecommendationFindingStatusType", - "RepeatabilityResult", "ResearchStudyStatusCodeType", "SpecialtyType", ] 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 b8c0850bdbd6..b0d874d8dc4e 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 @@ -223,19 +223,6 @@ class RecommendationFindingStatusType(str, Enum, metaclass=CaseInsensitiveEnumMe """Conditional finding status""" -class RepeatabilityResult(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Repeatability Result header options.""" - - ACCEPTED = "accepted" - """If the request was accepted and the server guarantees that the server state reflects a single - execution of the operation.""" - REJECTED = "rejected" - """If the request was rejected because the combination of Repeatability-First-Sent and - Repeatability-Request-ID were invalid - or because the Repeatability-First-Sent value was outside the range of values held by the - server.""" - - class ResearchStudyStatusCodeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """https://www.hl7.org/fhir/R4/codesystem-research-study-status.html.""" 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 3f0ab07911ad..41fac270eba0 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,5 +1,5 @@ # coding=utf-8 -# pylint: disable=too-many-lines, line-too-long, too-many-locals +# 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. @@ -42,22 +42,22 @@ class RadiologyInsightsInference(_model_base.Model): All required parameters must be populated in order to send to server. - :ivar extension: Additional Content defined by implementations. - :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Required. Known values are: "ageMismatch", "lateralityDiscrepancy", "sexMismatch", "completeOrderDiscrepancy", "limitedOrderDiscrepancy", "finding", "criticalResult", "followupRecommendation", "followupCommunication", and "radiologyProcedure". :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] = {} - extension: Optional[List["_models.Extension"]] = rest_field() - """Additional Content defined by implementations.""" kind: str = rest_discriminator(name="kind") """Required. Known values are: \"ageMismatch\", \"lateralityDiscrepancy\", \"sexMismatch\", \"completeOrderDiscrepancy\", \"limitedOrderDiscrepancy\", \"finding\", \"criticalResult\", \"followupRecommendation\", \"followupCommunication\", and \"radiologyProcedure\".""" + extension: Optional[List["_models.Extension"]] = rest_field() + """Additional Content defined by implementations.""" @overload def __init__( @@ -283,6 +283,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class CompleteOrderDiscrepancyInference(RadiologyInsightsInference, discriminator="completeOrderDiscrepancy"): + # pylint: disable=line-too-long """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. @@ -409,6 +410,8 @@ class DomainResource(Resource): :vartype implicit_rules: str :ivar language: Language of the resource content. :vartype language: str + :ivar resource_type: Required. Default value is None. + :vartype resource_type: str :ivar text: Text summary of the resource, for human interpretation. :vartype text: ~azure.healthinsights.radiologyinsights.models.Narrative :ivar contained: Contained, inline Resources. @@ -417,11 +420,11 @@ class DomainResource(Resource): :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar modifier_extension: Extensions that cannot be ignored. :vartype modifier_extension: list[~azure.healthinsights.radiologyinsights.models.Extension] - :ivar resource_type: Required. Default value is None. - :vartype resource_type: str """ __mapping__: Dict[str, _model_base.Model] = {} + resource_type: str = rest_discriminator(name="resourceType") + """Required. Default value is None.""" text: Optional["_models.Narrative"] = rest_field() """Text summary of the resource, for human interpretation.""" contained: Optional[List["_models.Resource"]] = rest_field() @@ -430,8 +433,6 @@ class DomainResource(Resource): """Additional Content defined by implementations.""" modifier_extension: Optional[List["_models.Extension"]] = rest_field(name="modifierExtension") """Extensions that cannot be ignored.""" - resource_type: str = rest_discriminator(name="resourceType") - """Required. Default value is None.""" @overload def __init__( @@ -575,7 +576,7 @@ class Condition(DomainResource, discriminator="Condition"): # pylint: disable=t """Additional information about the Condition.""" @overload - def __init__( + def __init__(# pylint: disable=too-many-locals self, *, id: Optional[str] = None, # pylint: disable=redefined-builtin @@ -942,53 +943,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) -class Encounter(_model_base.Model): - """visit/encounter information. - - All required parameters must be populated in order to send to server. - - :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. - :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() - """The id of the visit. Required.""" - period: Optional["_models.TimePeriod"] = rest_field() - """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") - """The class of the encounter. Known values are: \"inpatient\", \"ambulatory\", \"observation\", - \"emergency\", \"virtual\", and \"healthHome\".""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - period: Optional["_models.TimePeriod"] = None, - class_property: Optional[Union[str, "_models.EncounterClass"]] = None, - ): - ... - - @overload - def __init__(self, mapping: Mapping[str, Any]): - """ - :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 - super().__init__(*args, **kwargs) - - class Error(_model_base.Model): """The error object. @@ -1208,6 +1162,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class FollowupCommunicationInference(RadiologyInsightsInference, discriminator="followupCommunication"): + # pylint: disable=line-too-long """Follow-up communication involves the exchange of important information, recommendations, or updates between radiologists and other healthcare professionals involved in a patient's care. @@ -1217,8 +1172,8 @@ class FollowupCommunicationInference(RadiologyInsightsInference, discriminator=" :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Followup Communication inference type :vartype kind: str or ~azure.healthinsights.radiologyinsights.models.FOLLOWUP_COMMUNICATION - :ivar date_time: Communication date and time. - :vartype date_time: list[~datetime.datetime] + :ivar communicated_at: Communication date and time. + :vartype communicated_at: list[~datetime.datetime] :ivar recipient: Recipient of the communication. :vartype recipient: list[str or ~azure.healthinsights.radiologyinsights.models.MedicalProfessionalType] @@ -1228,7 +1183,7 @@ class FollowupCommunicationInference(RadiologyInsightsInference, discriminator=" kind: Literal[RadiologyInsightsInferenceType.FOLLOWUP_COMMUNICATION] = rest_discriminator(name="kind") # type: ignore """Inference type. Required. Followup Communication inference type""" - date_time: Optional[List[datetime.datetime]] = rest_field(name="dateTime", format="rfc3339") + communicated_at: Optional[List[datetime.datetime]] = rest_field(name="communicatedAt", format="rfc3339") """Communication date and time.""" recipient: Optional[List[Union[str, "_models.MedicalProfessionalType"]]] = rest_field() """Recipient of the communication.""" @@ -1241,7 +1196,7 @@ def __init__( *, was_acknowledged: bool, extension: Optional[List["_models.Extension"]] = None, - date_time: Optional[List[datetime.datetime]] = None, + communicated_at: Optional[List[datetime.datetime]] = None, recipient: Optional[List[Union[str, "_models.MedicalProfessionalType"]]] = None, ): ... @@ -1258,6 +1213,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class FollowupRecommendationInference(RadiologyInsightsInference, discriminator="followupRecommendation"): + # pylint: disable=line-too-long """Follow-up recommendations offer guidance to healthcare providers on managing and monitoring patients based on the findings of imaging studies. @@ -1267,9 +1223,9 @@ class FollowupRecommendationInference(RadiologyInsightsInference, discriminator= :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Inference type. Required. Recommendation inference type :vartype kind: str or ~azure.healthinsights.radiologyinsights.models.FOLLOWUP_RECOMMENDATION - :ivar effective_date_time: Date and time are displayed when the procedure is recommended to be - done at a specific point in time. - :vartype effective_date_time: str + :ivar effective_at: Date and time are displayed when the procedure is recommended to be done at + a specific point in time. + :vartype effective_at: str :ivar effective_period: The period is shown if a specific period is mentioned, with a start and end date-time. :vartype effective_period: ~azure.healthinsights.radiologyinsights.models.Period @@ -1297,7 +1253,7 @@ class FollowupRecommendationInference(RadiologyInsightsInference, discriminator= kind: Literal[RadiologyInsightsInferenceType.FOLLOWUP_RECOMMENDATION] = rest_discriminator(name="kind") # type: ignore """Inference type. Required. Recommendation inference type""" - effective_date_time: Optional[str] = rest_field(name="effectiveDateTime") + effective_at: Optional[str] = rest_field(name="effectiveAt") """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") @@ -1331,7 +1287,7 @@ def __init__( is_hedging: bool, recommended_procedure: "_models.ProcedureRecommendation", extension: Optional[List["_models.Extension"]] = None, - effective_date_time: Optional[str] = None, + effective_at: Optional[str] = None, effective_period: Optional["_models.Period"] = None, findings: Optional[List["_models.RecommendationFinding"]] = None, ): @@ -1407,17 +1363,22 @@ class ProcedureRecommendation(_model_base.Model): :ivar kind: Required. Default value is None. :vartype kind: str + :ivar extension: Additional Content defined by implementations. + :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] """ __mapping__: Dict[str, _model_base.Model] = {} kind: str = rest_discriminator(name="kind") """Required. Default value is None.""" + extension: Optional[List["_models.Extension"]] = rest_field() + """Additional Content defined by implementations.""" @overload def __init__( self, *, kind: str, + extension: Optional[List["_models.Extension"]] = None, ): ... @@ -1437,6 +1398,8 @@ class GenericProcedureRecommendation(ProcedureRecommendation, discriminator="gen All required parameters must be populated in order to send to server. + :ivar extension: Additional Content defined by implementations. + :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Procedure type : generic. Required. Default value is "genericProcedureRecommendation". :vartype kind: str @@ -1460,6 +1423,7 @@ def __init__( self, *, code: "_models.CodeableConcept", + extension: Optional[List["_models.Extension"]] = None, description: Optional[str] = None, ): ... @@ -1475,59 +1439,61 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, kind="genericProcedureRecommendation", **kwargs) -class HealthInsightsOperationStatus(_model_base.Model): - """Provides status details for long running operations. - - Readonly variables are only populated by the server, and will be ignored when sending a request. +class HealthInsightsErrorResponse(_model_base.Model): + """A response containing error details. All required parameters must be populated in order to send to server. - :ivar id: The unique ID of the operation. Required. - :vartype id: str - :ivar status: The status of the operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", and "canceled". - :vartype status: str or ~azure.healthinsights.radiologyinsights.models.JobStatus - :ivar created_date_time: The date and time when the processing job was created. - :vartype created_date_time: ~datetime.datetime - :ivar expiration_date_time: The date and time when the processing job is set to expire. - :vartype expiration_date_time: ~datetime.datetime - :ivar last_update_date_time: The date and time when the processing job was last updated. - :vartype last_update_date_time: ~datetime.datetime - :ivar error: Error object that describes the error when status is "Failed". + :ivar error: The error object. Required. :vartype error: ~azure.healthinsights.radiologyinsights.models.Error - :ivar result: The result of the operation. - :vartype result: - ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult + :ivar request_id: An opaque, globally-unique, server-generated string identifier for the + request. Required. + :vartype request_id: + ~azure.healthinsights.radiologyinsights.models.HealthInsightsErrorResponseRequestId """ - id: str = rest_field(visibility=["read"]) - """The unique ID of the operation. Required.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """The status of the operation. Required. Known values are: \"notStarted\", \"running\", - \"succeeded\", \"failed\", and \"canceled\".""" - created_date_time: Optional[datetime.datetime] = rest_field( - name="createdDateTime", visibility=["read"], format="rfc3339" - ) - """The date and time when the processing job was created.""" - expiration_date_time: Optional[datetime.datetime] = rest_field( - name="expirationDateTime", visibility=["read"], format="rfc3339" - ) - """The date and time when the processing job is set to expire.""" - last_update_date_time: Optional[datetime.datetime] = rest_field( - name="lastUpdateDateTime", visibility=["read"], format="rfc3339" - ) - """The date and time when the processing job was last updated.""" - error: Optional["_models.Error"] = rest_field() - """Error object that describes the error when status is \"Failed\".""" - result: Optional["_models.RadiologyInsightsInferenceResult"] = rest_field() - """The result of the operation.""" + error: "_models.Error" = rest_field() + """The error object. Required.""" + request_id: "_models.HealthInsightsErrorResponseRequestId" = rest_field(name="requestId") + """An opaque, globally-unique, server-generated string identifier for the request. Required.""" @overload def __init__( self, *, - error: Optional["_models.Error"] = None, - result: Optional["_models.RadiologyInsightsInferenceResult"] = None, + error: "_models.Error", + request_id: "_models.HealthInsightsErrorResponseRequestId", + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :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 + super().__init__(*args, **kwargs) + + +class HealthInsightsErrorResponseRequestId(_model_base.Model): + """HealthInsightsErrorResponseRequestId. + + All required parameters must be populated in order to send to server. + + :ivar response: Required. + :vartype response: ~azure.healthinsights.radiologyinsights.models.RequestIdResponseHeader + """ + + response: "_models.RequestIdResponseHeader" = rest_field() + """Required.""" + + @overload + def __init__( + self, + *, + response: "_models.RequestIdResponseHeader", ): ... @@ -1653,6 +1619,8 @@ class ImagingProcedureRecommendation(ProcedureRecommendation, discriminator="ima All required parameters must be populated in order to send to server. + :ivar extension: Additional Content defined by implementations. + :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar kind: Procedure type : imaging. Required. Default value is "imagingProcedureRecommendation". :vartype kind: str @@ -1675,6 +1643,7 @@ def __init__( self, *, imaging_procedures: List["_models.ImagingProcedure"], + extension: Optional[List["_models.Extension"]] = None, procedure_codes: Optional[List["_models.CodeableConcept"]] = None, ): ... @@ -1727,6 +1696,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class LateralityDiscrepancyInference(RadiologyInsightsInference, discriminator="lateralityDiscrepancy"): + # pylint: disable=line-too-long """A laterality mismatch occurs when there is a discrepancy between the clinical documentation and the ordered procedure (orderLateralityMismatch), a contradiction within the clinical document (textLateralityContradiction), or when no laterality is mentioned (textLateralityMissing). @@ -1778,6 +1748,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class LimitedOrderDiscrepancyInference(RadiologyInsightsInference, discriminator="limitedOrderDiscrepancy"): + # pylint: disable=line-too-long """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. @@ -2110,7 +2081,7 @@ class Observation(DomainResource): # pylint: disable=too-many-instance-attribut """Component results.""" @overload - def __init__( + def __init__(# pylint: disable=too-many-locals self, *, status: Union[str, "_models.ObservationStatusCodeType"], @@ -2338,28 +2309,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles class OrderedProcedure(_model_base.Model): """Procedure information. - :ivar extension: Additional Content defined by implementations. - :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar code: Procedure code. :vartype code: ~azure.healthinsights.radiologyinsights.models.CodeableConcept :ivar description: Procedure description. :vartype description: str + :ivar extension: Additional Content defined by implementations. + :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] """ - extension: Optional[List["_models.Extension"]] = rest_field() - """Additional Content defined by implementations.""" code: Optional["_models.CodeableConcept"] = rest_field() """Procedure code.""" description: Optional[str] = rest_field() """Procedure description.""" + extension: Optional[List["_models.Extension"]] = rest_field() + """Additional Content defined by implementations.""" @overload def __init__( self, *, - extension: Optional[List["_models.Extension"]] = None, code: Optional["_models.CodeableConcept"] = None, description: Optional[str] = None, + extension: Optional[List["_models.Extension"]] = None, ): ... @@ -2434,8 +2405,8 @@ class PatientDocument(_model_base.Model): :vartype id: str :ivar language: A 2 letter ISO 639-1 representation of the language of the document. :vartype language: str - :ivar created_date_time: The date and time when the document was created. - :vartype created_date_time: ~datetime.datetime + :ivar created_at: The date and time when the document was created. + :vartype created_at: ~datetime.datetime :ivar authors: Document author(s). :vartype authors: list[~azure.healthinsights.radiologyinsights.models.DocumentAuthor] :ivar specialty_type: specialty type the document. Known values are: "pathology" and @@ -2461,7 +2432,7 @@ class PatientDocument(_model_base.Model): patient. Required.""" language: Optional[str] = rest_field() """A 2 letter ISO 639-1 representation of the language of the document.""" - created_date_time: Optional[datetime.datetime] = rest_field(name="createdDateTime", format="rfc3339") + created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339") """The date and time when the document was created.""" authors: Optional[List["_models.DocumentAuthor"]] = rest_field() """Document author(s).""" @@ -2483,7 +2454,7 @@ def __init__( content: "_models.DocumentContent", clinical_type: Optional[Union[str, "_models.ClinicalDocumentType"]] = None, language: Optional[str] = None, - created_date_time: Optional[datetime.datetime] = None, + created_at: Optional[datetime.datetime] = None, authors: Optional[List["_models.DocumentAuthor"]] = None, specialty_type: Optional[Union[str, "_models.SpecialtyType"]] = None, administrative_metadata: Optional["_models.DocumentAdministrativeMetadata"] = None, @@ -2501,6 +2472,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) +class PatientEncounter(_model_base.Model): + """visit/encounter information. + + All required parameters must be populated in order to send to server. + + :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. + :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() + """The id of the visit. Required.""" + period: Optional["_models.TimePeriod"] = rest_field() + """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") + """The class of the encounter. Known values are: \"inpatient\", \"ambulatory\", \"observation\", + \"emergency\", \"virtual\", and \"healthHome\".""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + period: Optional["_models.TimePeriod"] = None, + class_property: Optional[Union[str, "_models.EncounterClass"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :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 + super().__init__(*args, **kwargs) + + class PatientRecord(_model_base.Model): """A patient record, including their clinical information and data. @@ -2509,11 +2527,11 @@ class PatientRecord(_model_base.Model): :ivar id: A given identifier for the patient. Has to be unique across all patients in a single request. Required. :vartype id: str - :ivar info: Patient structured information, including demographics and known structured + :ivar details: Patient structured information, including demographics and known structured clinical information. - :vartype info: ~azure.healthinsights.radiologyinsights.models.PatientDetails + :vartype details: ~azure.healthinsights.radiologyinsights.models.PatientDetails :ivar encounters: Patient encounters/visits. - :vartype encounters: list[~azure.healthinsights.radiologyinsights.models.Encounter] + :vartype encounters: list[~azure.healthinsights.radiologyinsights.models.PatientEncounter] :ivar patient_documents: Patient unstructured clinical data, given as documents. :vartype patient_documents: list[~azure.healthinsights.radiologyinsights.models.PatientDocument] @@ -2522,10 +2540,10 @@ class PatientRecord(_model_base.Model): id: str = rest_field() """A given identifier for the patient. Has to be unique across all patients in a single request. Required.""" - info: Optional["_models.PatientDetails"] = rest_field() + details: Optional["_models.PatientDetails"] = rest_field() """Patient structured information, including demographics and known structured clinical information.""" - encounters: Optional[List["_models.Encounter"]] = rest_field() + encounters: Optional[List["_models.PatientEncounter"]] = rest_field() """Patient encounters/visits.""" patient_documents: Optional[List["_models.PatientDocument"]] = rest_field(name="patientDocuments") """Patient unstructured clinical data, given as documents.""" @@ -2535,8 +2553,8 @@ def __init__( self, *, id: str, # pylint: disable=redefined-builtin - info: Optional["_models.PatientDetails"] = None, - encounters: Optional[List["_models.Encounter"]] = None, + details: Optional["_models.PatientDetails"] = None, + encounters: Optional[List["_models.PatientEncounter"]] = None, patient_documents: Optional[List["_models.PatientDocument"]] = None, ): ... @@ -2792,6 +2810,70 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) +class RadiologyInsightsJob(_model_base.Model): + """Response for the Radiology Insights request. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar job_data: The request data for the operation. + :vartype job_data: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsData + :ivar result: The result of the operation. + :vartype result: + ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult + :ivar id: The unique ID of the job. Required. + :vartype id: str + :ivar status: The status of the job. Required. Known values are: "notStarted", "running", + "succeeded", "failed", and "canceled". + :vartype status: str or ~azure.healthinsights.radiologyinsights.models.JobStatus + :ivar created_at: The date and time when the processing job was created. + :vartype created_at: ~datetime.datetime + :ivar expires_at: The date and time when the processing job is set to expire. + :vartype expires_at: ~datetime.datetime + :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.healthinsights.radiologyinsights.models.Error + """ + + job_data: Optional["_models.RadiologyInsightsData"] = rest_field(name="jobData", visibility=["read", "create"]) + """The request data for the operation.""" + result: Optional["_models.RadiologyInsightsInferenceResult"] = rest_field(visibility=["read"]) + """The result of the operation.""" + id: str = rest_field(visibility=["read"]) + """The unique ID of the job. Required.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """The status of the job. Required. Known values are: \"notStarted\", \"running\", \"succeeded\", + \"failed\", and \"canceled\".""" + created_at: Optional[datetime.datetime] = rest_field(name="createdAt", visibility=["read"], format="rfc3339") + """The date and time when the processing job was created.""" + expires_at: Optional[datetime.datetime] = rest_field(name="expiresAt", visibility=["read"], format="rfc3339") + """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["_models.Error"] = rest_field(visibility=["read"]) + """Error object that describes the error when status is \"Failed\".""" + + @overload + def __init__( + self, + *, + job_data: Optional["_models.RadiologyInsightsData"] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :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 + super().__init__(*args, **kwargs) + + class RadiologyInsightsModelConfiguration(_model_base.Model): """Configuration affecting the Radiology Insights model's inference. @@ -2889,73 +2971,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) -class RadiologyInsightsResult(_model_base.Model): - """Response for the Radiology Insights request. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The unique ID of the operation. Required. - :vartype id: str - :ivar status: The status of the operation. Required. Known values are: "notStarted", "running", - "succeeded", "failed", and "canceled". - :vartype status: str or ~azure.healthinsights.radiologyinsights.models.JobStatus - :ivar created_date_time: The date and time when the processing job was created. - :vartype created_date_time: ~datetime.datetime - :ivar expiration_date_time: The date and time when the processing job is set to expire. - :vartype expiration_date_time: ~datetime.datetime - :ivar last_update_date_time: The date and time when the processing job was last updated. - :vartype last_update_date_time: ~datetime.datetime - :ivar error: Error object that describes the error when status is "Failed". - :vartype error: ~azure.healthinsights.radiologyinsights.models.Error - :ivar result: The result of the operation. - :vartype result: - ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult - """ - - id: str = rest_field(visibility=["read"]) - """The unique ID of the operation. Required.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """The status of the operation. Required. Known values are: \"notStarted\", \"running\", - \"succeeded\", \"failed\", and \"canceled\".""" - created_date_time: Optional[datetime.datetime] = rest_field( - name="createdDateTime", visibility=["read"], format="rfc3339" - ) - """The date and time when the processing job was created.""" - expiration_date_time: Optional[datetime.datetime] = rest_field( - name="expirationDateTime", visibility=["read"], format="rfc3339" - ) - """The date and time when the processing job is set to expire.""" - last_update_date_time: Optional[datetime.datetime] = rest_field( - name="lastUpdateDateTime", visibility=["read"], format="rfc3339" - ) - """The date and time when the processing job was last updated.""" - error: Optional["_models.Error"] = rest_field() - """Error object that describes the error when status is \"Failed\".""" - result: Optional["_models.RadiologyInsightsInferenceResult"] = rest_field() - """The result of the operation.""" - - @overload - def __init__( - self, - *, - error: Optional["_models.Error"] = None, - result: Optional["_models.RadiologyInsightsInferenceResult"] = None, - ): - ... - - @overload - def __init__(self, mapping: Mapping[str, Any]): - """ - :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 - super().__init__(*args, **kwargs) - - class RadiologyProcedureInference(RadiologyInsightsInference, discriminator="radiologyProcedure"): """Radiology procedures are the specific imaging studies or examinations ordered for the patient, extracted from the document information and text. @@ -3082,8 +3097,6 @@ class RecommendationFinding(_model_base.Model): All required parameters must be populated in order to send to server. - :ivar extension: Additional Content defined by implementations. - :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] :ivar finding: Finding linked to a recommendation. :vartype finding: ~azure.healthinsights.radiologyinsights.models.Observation :ivar critical_finding: Critical result linked to a recommendation. @@ -3092,10 +3105,10 @@ class RecommendationFinding(_model_base.Model): "present", "differential", "ruleOut", and "conditional". :vartype recommendation_finding_status: str or ~azure.healthinsights.radiologyinsights.models.RecommendationFindingStatusType + :ivar extension: Additional Content defined by implementations. + :vartype extension: list[~azure.healthinsights.radiologyinsights.models.Extension] """ - extension: Optional[List["_models.Extension"]] = rest_field() - """Additional Content defined by implementations.""" finding: Optional["_models.Observation"] = rest_field() """Finding linked to a recommendation.""" critical_finding: Optional["_models.CriticalResult"] = rest_field(name="criticalFinding") @@ -3105,15 +3118,17 @@ class RecommendationFinding(_model_base.Model): ) """Recommendation finding status. Required. Known values are: \"present\", \"differential\", \"ruleOut\", and \"conditional\".""" + extension: Optional[List["_models.Extension"]] = rest_field() + """Additional Content defined by implementations.""" @overload def __init__( self, *, recommendation_finding_status: Union[str, "_models.RecommendationFindingStatusType"], - extension: Optional[List["_models.Extension"]] = None, finding: Optional["_models.Observation"] = None, critical_finding: Optional["_models.CriticalResult"] = None, + extension: Optional[List["_models.Extension"]] = None, ): ... @@ -3173,6 +3188,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) +class RequestIdResponseHeader(_model_base.Model): + """Provides the 'x-ms-request-id' header to enable request correlation in responses.""" + + class ResearchStudy(DomainResource, discriminator="ResearchStudy"): # pylint: disable=too-many-instance-attributes """Detailed information about Research Study Based on `FHIR ResearchStudy `_. @@ -3314,7 +3333,7 @@ class ResearchStudy(DomainResource, discriminator="ResearchStudy"): # pylint: d """A goal for the study.""" @overload - def __init__( + def __init__(# pylint: disable=too-many-locals self, *, status: Union[str, "_models.ResearchStudyStatusCodeType"], 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 new file mode 100644 index 000000000000..02334b6ee559 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_age_mismatch_inference.py @@ -0,0 +1,154 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_age_mismatch_inference.py + +DESCRIPTION: +The sample_age_mismatch_inference.py module processes a sample radiology document with the Radiology Insights service. +It will initialize a RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +-the Age Mismatch patient ID, +-the Age Mismatch url extension, +-the Age Mismatch offset extension, +-the Age Mismatch length extension, and +-the Age Mismatch evidence +extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSyncSamples: + def radiology_insights_sync(self) -> None: + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + + doc_content1 = """CLINICAL HISTORY: + 20-year-old female presenting with abdominal pain. Surgical history significant for appendectomy. + COMPARISON: + Right upper quadrant sonographic performed 1 day prior. + TECHNIQUE: + Transabdominal grayscale pelvic sonography with duplex color Doppler and spectral waveform analysis of the ovaries. + FINDINGS: + The uterus is unremarkable given the transabdominal technique with endometrial echo complex within physiologic normal limits. The ovaries are symmetric in size, measuring 2.5 x 1.2 x 3.0 cm and the left measuring 2.8 x 1.5 x 1.9 cm.\n On duplex imaging, Doppler signal is symmetric. + IMPRESSION: + 1. Normal pelvic sonography. Findings of testicular torsion. + A new US pelvis within the next 6 months is recommended. + These results have been discussed with Dr. Jones at 3 PM on November 5 2020.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Http://hl7.org/fhir/ValueSet/cpt-all", + code="USPELVIS", + display="US PELVIS COMPLETE", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US PELVIS COMPLETE", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + # Health Insights Radiology Insights + try: + poller = radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_age_mismatch(radiology_insights_result,doc_content1) + except Exception as ex: + print(str(ex)) + return + + def display_age_mismatch(self,radiology_insights_result,doc_content1): + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.AGE_MISMATCH: + print(f"Age Mismatch Inference found") + print(f"Age Mismatch: Patient ID: {patient_result.patient_id}") + Tokens = "" + for extension in ri_inference.extension: + for attribute in dir(extension): + if attribute == "extension": + offset = -1 + length = -1 + for sub_extension in extension.extension: + for sub_attribute in dir(sub_extension): + if sub_attribute == "url": + if sub_extension.url.startswith("http"): + continue + elif sub_extension.url == "offset": + offset = sub_extension.value_integer + elif sub_extension.url == "length": + length = sub_extension.value_integer + if offset > 0 and length > 0: + evidence = doc_content1[offset:offset+length] + if not evidence in Tokens: + Tokens = Tokens + " " + evidence + print(f"Age Mismatch: Evidence: {Tokens}") + +def main(): + sample = HealthInsightsSyncSamples() + sample.radiology_insights_sync() + + +if __name__ == "__main__": + main() \ No newline at end of file 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 new file mode 100644 index 000000000000..bdb72f7d985a --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_age_mismatch_inference_async.py @@ -0,0 +1,159 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import asyncio +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights.aio import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_age_mismatch_inference_async.py + +DESCRIPTION: +The sample_age_mismatch_inference_async.py module processes a sample radiology document with the Radiology Insights service. +It will initialize an asynchronous RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +-the Age Mismatch patient ID, +-the Age Mismatch url extension, +-the Age Mismatch offset extension, +-the Age Mismatch length extension, and +-the Age Mismatch evidence +extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSamples: + async def radiology_insights_async(self) -> None: + # [START create_radiology_insights_client] + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + # [END create_radiology_insights_client] + doc_content1 = """CLINICAL HISTORY: + 20-year-old female presenting with abdominal pain. Surgical history significant for appendectomy. + COMPARISON: + Right upper quadrant sonographic performed 1 day prior. + TECHNIQUE: + Transabdominal grayscale pelvic sonography with duplex color Doppler and spectral waveform analysis of the ovaries. + FINDINGS: + The uterus is unremarkable given the transabdominal technique with endometrial echo complex within physiologic normal limits. The ovaries are symmetric in size, measuring 2.5 x 1.2 x 3.0 cm and the left measuring 2.8 x 1.5 x 1.9 cm.\n On duplex imaging, Doppler signal is symmetric. + IMPRESSION: + 1. Normal pelvic sonography. Findings of testicular torsion. + A new US pelvis within the next 6 months is recommended. + These results have been discussed with Dr. Jones at 3 PM on November 5 2020.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Http://hl7.org/fhir/ValueSet/cpt-all", + code="USPELVIS", + display="US PELVIS COMPLETE", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US PELVIS COMPLETE", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + try: + poller = await radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = await poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_age_mismatch(radiology_insights_result, doc_content1) + await radiology_insights_client.close() + except Exception as ex: + print(str(ex)) + return + + def display_age_mismatch(self, radiology_insights_result, doc_content1): + # [START display_age_mismatch] + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.AGE_MISMATCH: + print(f"Age Mismatch Inference found") + print(f"Age Mismatch: Patient ID: {patient_result.patient_id}") + Tokens = "" + for extension in ri_inference.extension: + for attribute in dir(extension): + if attribute == "extension": + offset = -1 + length = -1 + for sub_extension in extension.extension: + for sub_attribute in dir(sub_extension): + if sub_attribute == "url": + if sub_extension.url.startswith("http"): + continue + elif sub_extension.url == "offset": + offset = sub_extension.value_integer + elif sub_extension.url == "length": + length = sub_extension.value_integer + if offset > 0 and length > 0: + evidence = doc_content1[offset:offset+length] + if not evidence in Tokens: + Tokens = Tokens + " " + evidence + print(f"Age Mismatch: Evidence: {Tokens}") + + # [END display_age_mismatch] + +async def main(): + sample = HealthInsightsSamples() + await sample.radiology_insights_async() + + +if __name__ == "__main__": + asyncio.run(main()) \ No newline at end of file diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrespancy_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrespancy_inference.py new file mode 100644 index 000000000000..b24b0f6f9703 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrespancy_inference.py @@ -0,0 +1,146 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_complete_order_discrepancy_inference.py + +DESCRIPTION: +The sample_complete_order_discrepancy_inference.py module processes a sample radiology document with the Radiology Insights service. +It will initialize a RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +-the Complete Order Discrepancy order type, +-the missing body parts, and +-the missing body part measurements +extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSyncSamples: + def radiology_insights_sync(self) -> None: + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + + doc_content1 = """CLINICAL HISTORY: + 20-year-old female presenting with abdominal pain. Surgical history significant for appendectomy. + COMPARISON: + Right upper quadrant sonographic performed 1 day prior. + TECHNIQUE: + Transabdominal grayscale pelvic sonography with duplex color Doppler and spectral waveform analysis of the ovaries. + FINDINGS: + The uterus is unremarkable given the transabdominal technique with endometrial echo complex within physiologic normal limits. The ovaries are symmetric in size, measuring 2.5 x 1.2 x 3.0 cm and the left measuring 2.8 x 1.5 x 1.9 cm.\n On duplex imaging, Doppler signal is symmetric. + IMPRESSION: + 1. Normal pelvic sonography. Findings of testicular torsion. + A new US pelvis within the next 6 months is recommended. + These results have been discussed with Dr. Jones at 3 PM on November 5 2020.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Http://hl7.org/fhir/ValueSet/cpt-all", + code="USPELVIS", + display="US PELVIS COMPLETE", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US PELVIS COMPLETE", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + # Health Insights Radiology Insights + try: + poller = radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_complete_order_discrepancy(radiology_insights_result) + except Exception as ex: + print(str(ex)) + return + + def display_complete_order_discrepancy(self, radiology_insights_result): + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.COMPLETE_ORDER_DISCREPANCY: + print(f"Complete Order Discrepancy Inference found") + ordertype = ri_inference.order_type + for coding in ordertype.coding: + print(f"Complete Order Discrepancy: Order Type: {coding.system} {coding.code} {coding.display}") + if not ri_inference.missing_body_parts: + print(f"Complete Order Discrepancy: Missing Body Parts: empty list") + else: + for missingbodypart in ri_inference.missing_body_parts: + for coding in missingbodypart.coding: + print(f"Complete Order Discrepancy: Missing Body Part: {coding.system} {coding.code} {coding.display}") + if not ri_inference.missing_body_part_measurements: + print(f"Complete Order Discrepancy: Missing Body Part Measurements: empty list") + else: + for missingbodypartmeasurement in ri_inference.missing_body_part_measurements: + for coding in missingbodypartmeasurement.coding: + print(f"Complete Order Discrepancy: Missing Body Part Measurement: {coding.system} {coding.code} {coding.display}") + +def main(): + sample = HealthInsightsSyncSamples() + sample.radiology_insights_sync() + + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrespancy_inference_async.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrespancy_inference_async.py new file mode 100644 index 000000000000..2e99cf882d5c --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_complete_order_discrespancy_inference_async.py @@ -0,0 +1,152 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import asyncio +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights.aio import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_complete_order_discrepancy_inference_async.py + +DESCRIPTION: +The sample_complete_order_discrepancy_inference_async.py module processes a sample radiology document with the Radiology Insights service. +It will initialize an asynchronous RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +-the Complete Order Discrepancy order type, +-the missing body parts, and +-the missing body part measurements +extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSamples: + async def radiology_insights_async(self) -> None: + # [START create_radiology_insights_client] + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + # [END create_radiology_insights_client] + doc_content1 = """CLINICAL HISTORY: + 20-year-old female presenting with abdominal pain. Surgical history significant for appendectomy. + COMPARISON: + Right upper quadrant sonographic performed 1 day prior. + TECHNIQUE: + Transabdominal grayscale pelvic sonography with duplex color Doppler and spectral waveform analysis of the ovaries. + FINDINGS: + The uterus is unremarkable given the transabdominal technique with endometrial echo complex within physiologic normal limits. The ovaries are symmetric in size, measuring 2.5 x 1.2 x 3.0 cm and the left measuring 2.8 x 1.5 x 1.9 cm.\n On duplex imaging, Doppler signal is symmetric. + IMPRESSION: + 1. Normal pelvic sonography. Findings of testicular torsion. + A new US pelvis within the next 6 months is recommended. + These results have been discussed with Dr. Jones at 3 PM on November 5 2020.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Http://hl7.org/fhir/ValueSet/cpt-all", + code="USPELVIS", + display="US PELVIS COMPLETE", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US PELVIS COMPLETE", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + try: + poller = await radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = await poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_complete_order_discrepancy(radiology_insights_result) + await radiology_insights_client.close() + except Exception as ex: + print(str(ex)) + return + + def display_complete_order_discrepancy(self, radiology_insights_result): + # [START display_complete_order_discrepancy] + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.COMPLETE_ORDER_DISCREPANCY: + print(f"Complete Order Discrepancy Inference found") + ordertype = ri_inference.order_type + for coding in ordertype.coding: + print(f"Complete Order Discrepancy: Order Type: {coding.system} {coding.code} {coding.display}") + if not ri_inference.missing_body_parts: + print(f"Complete Order Discrepancy: Missing Body Parts: empty list") + else: + for missingbodypart in ri_inference.missing_body_parts: + for coding in missingbodypart.coding: + print(f"Complete Order Discrepancy: Missing Body Part: {coding.system} {coding.code} {coding.display}") + if not ri_inference.missing_body_part_measurements: + print(f"Complete Order Discrepancy: Missing Body Part Measurements: empty list") + else: + for missingbodypartmeasurement in ri_inference.missing_body_part_measurements: + for coding in missingbodypartmeasurement.coding: + print(f"Complete Order Discrepancy: Missing Body Part Measurement: {coding.system} {coding.code} {coding.display}") + + # [END display_complete_order_discrepancy] + + +async def main(): + sample = HealthInsightsSamples() + await sample.radiology_insights_async() + + +if __name__ == "__main__": + asyncio.run(main()) \ No newline at end of file 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 0fc939d5d75b..f7e0227f2f60 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 @@ -3,6 +3,8 @@ import datetime import os +import uuid + from azure.core.credentials import AzureKeyCredential from azure.healthinsights.radiologyinsights import RadiologyInsightsClient @@ -28,6 +30,8 @@ def radiology_insights_sync(self) -> None: KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + job_id = str(uuid.uuid4()) + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) doc_content1 = """CLINICAL HISTORY: @@ -54,7 +58,7 @@ def radiology_insights_sync(self) -> None: # Create encounter start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) - encounter = models.Encounter( + encounter = models.PatientEncounter( id="encounter2", class_property=models.EncounterClass.IN_PATIENT, period=models.TimePeriod(start=start, end=end), @@ -71,7 +75,7 @@ def radiology_insights_sync(self) -> None: clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, id="doc2", content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), - created_date_time=create_date_time, + created_at=create_date_time, specialty_type=models.SpecialtyType.RADIOLOGY, administrative_metadata=models.DocumentAdministrativeMetadata( ordered_procedures=[ordered_procedure], encounter_id="encounter2" @@ -83,7 +87,7 @@ def radiology_insights_sync(self) -> None: # Construct patient patient1 = models.PatientRecord( id="patient_id2", - info=patient_info, + details=patient_info, encounters=[encounter], patient_documents=[patient_document1], ) @@ -93,13 +97,16 @@ def radiology_insights_sync(self) -> None: # Construct the request with the patient and configuration radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) # Health Insights Radiology Insights try: poller = radiology_insights_client.begin_infer_radiology_insights( - radiology_insights_data, + id=job_id, + resource=job_data, ) - radiology_insights_result = poller.result() + job_response = poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) self.display_critical_results(radiology_insights_result) except Exception as ex: print(str(ex)) 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 18d66cf70a53..4ff9eda0e402 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 @@ -4,6 +4,7 @@ import asyncio import datetime import os +import uuid from azure.core.credentials import AzureKeyCredential @@ -31,6 +32,8 @@ async def radiology_insights_async(self) -> None: KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + job_id = str(uuid.uuid4()) + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) # [END create_radiology_insights_client] doc_content1 = """CLINICAL HISTORY: @@ -57,7 +60,7 @@ async def radiology_insights_async(self) -> None: # Create encounter start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) - encounter = models.Encounter( + encounter = models.PatientEncounter( id="encounter2", class_property=models.EncounterClass.IN_PATIENT, period=models.TimePeriod(start=start, end=end), @@ -74,7 +77,7 @@ async def radiology_insights_async(self) -> None: clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, id="doc2", content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), - created_date_time=create_date_time, + created_at=create_date_time, specialty_type=models.SpecialtyType.RADIOLOGY, administrative_metadata=models.DocumentAdministrativeMetadata( ordered_procedures=[ordered_procedure], encounter_id="encounter2" @@ -86,7 +89,7 @@ async def radiology_insights_async(self) -> None: # Construct patient patient1 = models.PatientRecord( id="patient_id2", - info=patient_info, + details=patient_info, encounters=[encounter], patient_documents=[patient_document1], ) @@ -96,13 +99,17 @@ async def radiology_insights_async(self) -> None: # Construct the request with the patient and configuration radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) try: poller = await radiology_insights_client.begin_infer_radiology_insights( - radiology_insights_data, + id=job_id, + resource=job_data, ) - radiology_insights_result = await poller.result() + job_response = await poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) self.display_critical_results(radiology_insights_result) + await radiology_insights_client.close() except Exception as ex: print(str(ex)) return diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference.py new file mode 100644 index 000000000000..6ea183169016 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference.py @@ -0,0 +1,209 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_finding_inference.py + +DESCRIPTION: +The sample_finding_inference.py module processes a sample radiology document with the Radiology Insights service. +It will initialize a RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +-the Finding resource type, +-the Finding ID, +-the Finding status, +-the Finding category code, +-the Finding code, +-the Finding interpretation, +-the Finding components, +-the Finding component code, +-the Finding component value codeable concept, +-the Finding component value coding, +-the Finding component value boolean, +-the Finding component value quantity, +-the Inference extensions, +-the Inference extension URL, +-the Inference extension value string, +-the Inference extension section +extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSyncSamples: + def radiology_insights_sync(self) -> None: + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + + doc_content1 = """FINDINGS: + In the right upper lobe, there is a new mass measuring 5.6 x 4.5 x 3.4 cm. + A lobulated soft tissue mass is identified in the superior right lower lobe abutting the major fissure measuring 5.4 x 4.3 x 3.7 cm (series 3 image 94, coronal image 110). + A 4 mm nodule in the right lower lobe (series 3, image 72) is increased dating back to 6/29/2012. This may represent lower lobe metastasis. + IMPRESSION: 4 cm pulmonary nodule posterior aspect of the right upper lobe necessitating additional imaging as described.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Https://loinc.org", + code="24627-2", + display="CT CHEST", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="CT CHEST", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + # Health Insights Radiology Insights + try: + poller = radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_finding(radiology_insights_result) + except Exception as ex: + print(str(ex)) + return + + def display_finding(self, radiology_insights_result): + for patient_result in radiology_insights_result.patient_results: + counter = 0 + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.FINDING: + counter += 1 + print(f"Finding {counter} Inference found") + fin = ri_inference.finding + for attribute in dir(fin): + if attribute.startswith('_') or callable(getattr(fin, attribute)): + continue + elif attribute == "resource_type" and fin.resource_type is not None: + print(f"Finding {counter}: Resource Type: {fin.resource_type}") + elif attribute == "id" and fin.id is not None: + print(f"Finding {counter}: ID: {fin.id}") + elif attribute == "status" and fin.status is not None: + print(f"Finding {counter}: Status: {fin.status}") + elif attribute == "category" and fin.category is not None: + for cat in fin.category: + if cat.coding is not None: + for code in cat.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: Category Code: {code.system} {code.code} {code.display}") + elif attribute == "code" and fin.code is not None: + for code in fin.code.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: Code: {code.system} {code.code} {code.display}") + elif attribute == "interpretation" and fin.interpretation is not None: + for intpt in fin.interpretation: + for code in intpt.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: Interpretation: {code.system} {code.code} {code.display}") + elif attribute == "component" and fin.component is not None: + print(f"Finding {counter}: COMPONENTS:") + for component in fin.component: + for attr in dir(component): + if attr.startswith('_') or callable(getattr(component, attr)): + continue + if attr == "code" and component.code is not None: + for code in component.code.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: COMPONENTS: Code: {code.system} {code.code} {code.display}") + elif attr == "value_codeable_concept" and component.value_codeable_concept is not None: + for code in component.value_codeable_concept.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: COMPONENTS: Value Codeable Concept: {code.system} {code.code} {code.display}") + elif attr == "value_coding" and component.value_coding is not None: + for code in component.value_coding.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: COMPONENTS: Value Coding: {code.system} {code.code} {code.display}") + elif attr == "value_boolean" and component.value_boolean is not None: + print(f"Finding {counter}: COMPONENTS: Value Boolean: {component.value_boolean}") + elif attr == "value_quantity" and component.value_quantity is not None: + for attrb in dir(component.value_quantity): + if not attrb.startswith('_') and not callable(getattr(component.value_quantity, attrb)) and getattr(component.value_quantity, attrb) is not None: + print(f"Finding {counter}: COMPONENTS: Value Quantity: {attrb.capitalize()}: {getattr(component.value_quantity, attrb)}") + inference_extension = ri_inference.extension + if inference_extension is not None: + print(f"Finding {counter}: INFERENCE EXTENSIONS:") + for extension in inference_extension: + for attr in dir(extension): + if attr.startswith('_') or callable(getattr(extension, attr)): + continue + elif attr == "extension" and extension.extension is not None: + for sub_extension in extension.extension: + for sub_attr in dir(sub_extension): + if sub_attr.startswith('_') or callable(getattr(sub_extension, sub_attr)): + continue + elif sub_attr == "url": + if sub_extension.url == "code" or sub_extension.url == "codingSystem" or sub_extension.url == "codeSystemName" or sub_extension.url == "displayName": + print(f"Finding {counter}: INFERENCE EXTENSIONS: EXTENSION: {sub_attr.capitalize()}: {sub_extension.url}") + elif sub_attr == "value_string" and sub_extension.value_string is not None: + print(f"Finding {counter}: INFERENCE EXTENSIONS: EXTENSION: {sub_attr.capitalize()}: {sub_extension.value_string}") + elif attr == "url" and extension.url is not None: + if extension.url == "section": + print(f"Finding {counter}: INFERENCE EXTENSIONS: {attr.capitalize()}: {extension.url}") + + +def main(): + sample = HealthInsightsSyncSamples() + sample.radiology_insights_sync() + + +if __name__ == "__main__": + main() \ No newline at end of file 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 new file mode 100644 index 000000000000..91ba4a51e3e7 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_finding_inference_async.py @@ -0,0 +1,212 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import asyncio +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights.aio import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_finding_inference_async.py + +DESCRIPTION: +The sample_finding_inference_async.py module processes a sample radiology document with the Radiology Insights service. +It will initialize an asynchronous RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +-the Finding resource type, +-the Finding ID, +-the Finding status, +-the Finding category code, +-the Finding code, +-the Finding interpretation, +-the Finding components, +-the Finding component code, +-the Finding component value codeable concept, +-the Finding component value coding, +-the Finding component value boolean, +-the Finding component value quantity, +-the Inference extensions, +-the Inference extension URL, +-the Inference extension value string, +-the Inference extension section +extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSamples: + async def radiology_insights_async(self) -> None: + # [START create_radiology_insights_client] + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + # [END create_radiology_insights_client] + doc_content1 = """FINDINGS: + In the right upper lobe, there is a new mass measuring 5.6 x 4.5 x 3.4 cm. + A lobulated soft tissue mass is identified in the superior right lower lobe abutting the major fissure measuring 5.4 x 4.3 x 3.7 cm (series 3 image 94, coronal image 110). + A 4 mm nodule in the right lower lobe (series 3, image 72) is increased dating back to 6/29/2012. This may represent lower lobe metastasis. + IMPRESSION: 4 cm pulmonary nodule posterior aspect of the right upper lobe necessitating additional imaging as described.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Https://loinc.org", + code="24627-2", + display="CT CHEST", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="CT CHEST", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + try: + poller = await radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = await poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_finding(radiology_insights_result) + await radiology_insights_client.close() + except Exception as ex: + print(str(ex)) + return + + def display_finding(self, radiology_insights_result): + # [START display_finding] + for patient_result in radiology_insights_result.patient_results: + counter = 0 + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.FINDING: + counter += 1 + print(f"Finding {counter} Inference found") + fin = ri_inference.finding + for attribute in dir(fin): + if attribute.startswith('_') or callable(getattr(fin, attribute)): + continue + elif attribute == "resource_type" and fin.resource_type is not None: + print(f"Finding {counter}: Resource Type: {fin.resource_type}") + elif attribute == "id" and fin.id is not None: + print(f"Finding {counter}: ID: {fin.id}") + elif attribute == "status" and fin.status is not None: + print(f"Finding {counter}: Status: {fin.status}") + elif attribute == "category" and fin.category is not None: + for cat in fin.category: + if cat.coding is not None: + for code in cat.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: Category Code: {code.system} {code.code} {code.display}") + elif attribute == "code" and fin.code is not None: + for code in fin.code.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: Code: {code.system} {code.code} {code.display}") + elif attribute == "interpretation" and fin.interpretation is not None: + for intpt in fin.interpretation: + for code in intpt.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: Interpretation: {code.system} {code.code} {code.display}") + elif attribute == "component" and fin.component is not None: + print(f"Finding {counter}: COMPONENTS:") + for component in fin.component: + for attr in dir(component): + if attr.startswith('_') or callable(getattr(component, attr)): + continue + if attr == "code" and component.code is not None: + for code in component.code.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: COMPONENTS: Code: {code.system} {code.code} {code.display}") + elif attr == "value_codeable_concept" and component.value_codeable_concept is not None: + for code in component.value_codeable_concept.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: COMPONENTS: Value Codeable Concept: {code.system} {code.code} {code.display}") + elif attr == "value_coding" and component.value_coding is not None: + for code in component.value_coding.coding: + if code.code is not None and code.display is not None: + print(f"Finding {counter}: COMPONENTS: Value Coding: {code.system} {code.code} {code.display}") + elif attr == "value_boolean" and component.value_boolean is not None: + print(f"Finding {counter}: COMPONENTS: Value Boolean: {component.value_boolean}") + elif attr == "value_quantity" and component.value_quantity is not None: + for attrb in dir(component.value_quantity): + if not attrb.startswith('_') and not callable(getattr(component.value_quantity, attrb)) and getattr(component.value_quantity, attrb) is not None: + print(f"Finding {counter}: COMPONENTS: Value Quantity: {attrb.capitalize()}: {getattr(component.value_quantity, attrb)}") + inference_extension = ri_inference.extension + if inference_extension is not None: + print(f"Finding {counter}: INFERENCE EXTENSIONS:") + for extension in inference_extension: + for attr in dir(extension): + if attr.startswith('_') or callable(getattr(extension, attr)): + continue + elif attr == "extension" and extension.extension is not None: + for sub_extension in extension.extension: + for sub_attr in dir(sub_extension): + if sub_attr.startswith('_') or callable(getattr(sub_extension, sub_attr)): + continue + elif sub_attr == "url": + if sub_extension.url == "code" or sub_extension.url == "codingSystem" or sub_extension.url == "codeSystemName" or sub_extension.url == "displayName": + print(f"Finding {counter}: INFERENCE EXTENSIONS: EXTENSION: {sub_attr.capitalize()}: {sub_extension.url}") + elif sub_attr == "value_string" and sub_extension.value_string is not None: + print(f"Finding {counter}: INFERENCE EXTENSIONS: EXTENSION: {sub_attr.capitalize()}: {sub_extension.value_string}") + elif attr == "url" and extension.url is not None: + if extension.url == "section": + print(f"Finding {counter}: INFERENCE EXTENSIONS: {attr.capitalize()}: {extension.url}") + + # [END display_finding] +async def main(): + sample = HealthInsightsSamples() + await sample.radiology_insights_async() + + +if __name__ == "__main__": + asyncio.run(main()) \ No newline at end of file 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 new file mode 100644 index 000000000000..ffd9bf36ba3e --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_communication_inference.py @@ -0,0 +1,143 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_followup_communication_inference.py + +DESCRIPTION: +The sample_followup_communication_inference.py module processes a sample radiology document with the Radiology Insights service. +It will initialize a RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +-the date and time of the follow-up communication, +-the recipient of the follow-up communication, and +-whether the follow-up communication was acknowledged +extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSyncSamples: + def radiology_insights_sync(self) -> None: + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + + doc_content1 = """CLINICAL HISTORY: + 20-year-old female presenting with abdominal pain. Surgical history significant for appendectomy. + COMPARISON: + Right upper quadrant sonographic performed 1 day prior. + TECHNIQUE: + Transabdominal grayscale pelvic sonography with duplex color Doppler and spectral waveform analysis of the ovaries. + FINDINGS: + The uterus is unremarkable given the transabdominal technique with endometrial echo complex within physiologic normal limits. The ovaries are symmetric in size, measuring 2.5 x 1.2 x 3.0 cm and the left measuring 2.8 x 1.5 x 1.9 cm.\n On duplex imaging, Doppler signal is symmetric. + IMPRESSION: + 1. Normal pelvic sonography. Findings of testicular torsion. + A new US pelvis within the next 6 months is recommended. + These results have been discussed with Dr. Jones at 3 PM on November 5 2020.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Http://hl7.org/fhir/ValueSet/cpt-all", + code="USPELVIS", + display="US PELVIS COMPLETE", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US PELVIS COMPLETE", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + # Health Insights Radiology Insights + try: + poller = radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_followup_communication(radiology_insights_result) + except Exception as ex: + print(str(ex)) + return + + def display_followup_communication(self,radiology_insights_result): + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.FOLLOWUP_COMMUNICATION: + print(f"Follow-up Communication Inference found") + if ri_inference.communicated_at is not None: + for communicatedat in ri_inference.communicated_at: + print(f"Follow-up Communication: Date Time: {communicatedat}") + else: + print(f"Follow-up Communication: Date Time: Unknown") + if ri_inference.recipient is not None: + for recepient in ri_inference.recipient: + print(f"Follow-up Communication: Recipient: {recepient}") + else: + print(f"Follow-up Communication: Recipient: Unknown") + print(f"Follow-up Communication: Was Acknowledged: {ri_inference.was_acknowledged}") + + +def main(): + sample = HealthInsightsSyncSamples() + sample.radiology_insights_sync() + + +if __name__ == "__main__": + main() \ No newline at end of file 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 new file mode 100644 index 000000000000..2a5df97077a6 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_communication_inference_async.py @@ -0,0 +1,147 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import asyncio +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights.aio import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_followup_communication_inference_async.py + +DESCRIPTION: +The sample_followup_communication_inference_async.py module processes a sample radiology document with the Radiology Insights service. +It will initialize an asynchronous RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +-the date and time of the follow-up communication, +-the recipient of the follow-up communication, and +-whether the follow-up communication was acknowledged +extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSamples: + async def radiology_insights_async(self) -> None: + # [START create_radiology_insights_client] + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + # [END create_radiology_insights_client] + doc_content1 = """CLINICAL HISTORY: + 20-year-old female presenting with abdominal pain. Surgical history significant for appendectomy. + COMPARISON: + Right upper quadrant sonographic performed 1 day prior. + TECHNIQUE: + Transabdominal grayscale pelvic sonography with duplex color Doppler and spectral waveform analysis of the ovaries. + FINDINGS: + The uterus is unremarkable given the transabdominal technique with endometrial echo complex within physiologic normal limits. The ovaries are symmetric in size, measuring 2.5 x 1.2 x 3.0 cm and the left measuring 2.8 x 1.5 x 1.9 cm.\n On duplex imaging, Doppler signal is symmetric. + IMPRESSION: + 1. Normal pelvic sonography. Findings of testicular torsion. + A new US pelvis within the next 6 months is recommended. + These results have been discussed with Dr. Jones at 3 PM on November 5 2020.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Http://hl7.org/fhir/ValueSet/cpt-all", + code="USPELVIS", + display="US PELVIS COMPLETE", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US PELVIS COMPLETE", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + try: + poller = await radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = await poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_followup_communication(radiology_insights_result) + await radiology_insights_client.close() + except Exception as ex: + print(str(ex)) + return + + def display_followup_communication(self, radiology_insights_result): + # [START display_followup_communication] + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.FOLLOWUP_COMMUNICATION: + print(f"Follow-up Communication Inference found") + if ri_inference.communicated_at is not None: + for communicatedat in ri_inference.communicated_at: + print(f"Follow-up Communication: Date Time: {communicatedat}") + else: + print(f"Follow-up Communication: Date Time: Unknown") + if ri_inference.recipient is not None: + for recepient in ri_inference.recipient: + print(f"Follow-up Communication: Recipient: {recepient}") + else: + print(f"Follow-up Communication: Recipient: Unknown") + print(f"Follow-up Communication: Was Acknowledged: {ri_inference.was_acknowledged}") + + # [END display_followup_communication] + +async def main(): + sample = HealthInsightsSamples() + await sample.radiology_insights_async() + + +if __name__ == "__main__": + asyncio.run(main()) \ No newline at end of file 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 new file mode 100644 index 000000000000..36d3e9fa68ca --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_recommendation_inference.py @@ -0,0 +1,214 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_followup_recommendation_inference.py + +DESCRIPTION: +The sample_followup_recommendation_inference.py module processes a sample radiology document with the Radiology Insights service. +It will initialize a RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +- the Finding category code +- the Finding code +- the Finding ID +- the Finding resource type +- the Finding boolean is_conditional +- the Finding boolean is_guideline +- the Finding boolean is_hedging +- the Finding boolean is_option +- the Recommended Procedure code +- the Imaging procedure anatomy code +- the Imaging procedure anatomy extension url +- the Imaging procedure anatomy extension reference +- the Imaging procedure anatomy extension offset +- the Imaging procedure anatomy extension length +- the Imaging procedure modality code +- the Imaging procedure modality extension url +- the Imaging procedure modality extension reference +- the Imaging procedure modality extension offset +- the Imaging procedure modality extension length + extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSyncSamples: + def radiology_insights_sync(self) -> None: + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + + doc_content1 = """CLINICAL HISTORY: + 20-year-old female presenting with abdominal pain. Surgical history significant for appendectomy. + COMPARISON: + Right upper quadrant sonographic performed 1 day prior. + TECHNIQUE: + Transabdominal grayscale pelvic sonography with duplex color Doppler and spectral waveform analysis of the ovaries. + FINDINGS: + The uterus is unremarkable given the transabdominal technique with endometrial echo complex within physiologic normal limits. The ovaries are symmetric in size, measuring 2.5 x 1.2 x 3.0 cm and the left measuring 2.8 x 1.5 x 1.9 cm.\n On duplex imaging, Doppler signal is symmetric. + IMPRESSION: + 1. Normal pelvic sonography. Findings of testicular torsion. + A new US pelvis within the next 6 months is recommended. + These results have been discussed with Dr. Jones at 3 PM on November 5 2020.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Http://hl7.org/fhir/ValueSet/cpt-all", + code="USPELVIS", + display="US PELVIS COMPLETE", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US PELVIS COMPLETE", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + # Health Insights Radiology Insights + try: + poller = radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data + ) + job_response = poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_followup_recommendation(radiology_insights_result) + except Exception as ex: + print(str(ex)) + return + + def display_followup_recommendation(self, radiology_insights_result): + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.FOLLOWUP_RECOMMENDATION: + print(f"Follow-up Recommendation Inference found") + for finding in ri_inference.findings: + for attribute in dir(finding): + if hasattr(finding, attribute) and not attribute.startswith("_") and not callable(getattr(finding, attribute)): + if attribute == "finding": + print (f"\nFollow-up Recommendation: FINDING :" ) + find = finding.finding + for attr in dir(find): + if hasattr(find, attr) and not attr.startswith("_") and not callable(getattr(find, attr)): + if getattr(find, attr) is not None: + if attr == "category": + for category in find.category: + for code in category.coding: + print(f"Follow-up Recommendation: FINDING: Category: {code.system} {code.code} {code.display}") + elif attr == "code": + for code in find.code.coding: + print(f"Follow-up Recommendation: FINDING: Code: {code.system} {code.code} {code.display}") + elif attr == "id": + print(f"Follow-up Recommendation: FINDING: ID: {find.id}") + elif attr == "resource_type": + print(f"Follow-up Recommendation: FINDING: Resource Type: {find.resource_type}") + print(f"\nFollow-up Recommendation: BOOLEANS:") + condition = ri_inference.is_conditional + print(f"Follow-up Recommendation: BOOLEANS: is_conditional: {condition}") + guideline = ri_inference.is_guideline + print(f"Follow-up Recommendation: BOOLEANS: is_guideline: {guideline}") + hedging = ri_inference.is_hedging + print(f"Follow-up Recommendation: BOOLEANS: is_hedging: {hedging}") + option = ri_inference.is_option + print(f"Follow-up Recommendation: BOOLEANS: is_option: {option}") + recproc = ri_inference.recommended_procedure + for proccod in recproc.procedure_codes: + print(f"\nFollow-up Recommendation: PROCEDURE CODES:") + for coding in proccod.coding: + print(f"Follow-up Recommendation: PROCEDURE CODES: {coding.system} {coding.code} {coding.display}") + for improc in recproc.imaging_procedures: + print(f"\nFollow-up Recommendation: IMAGING PROCEDURE:") + for attribute in improc: + if hasattr(improc, attribute) and not attribute.startswith("_") and not callable(getattr(improc, attribute)): + if attribute == "anatomy": + if improc.anatomy is not None: + for coding in improc.anatomy.coding: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy Code: {coding.system} {coding.code} {coding.display}") + for extension in improc.anatomy.extension: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy Url: {extension.url}") + for subext in extension.extension: + if subext.url == "reference": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy Url: {subext.url} {subext.value_reference}") + elif subext.url == "offset": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy Url: {subext.url} {subext.value_integer}") + elif subext.url == "length": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy Url: {subext.url} {subext.value_integer}") + else: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy: none") + elif attribute == "modality": + if improc.modality is not None: + for coding in improc.modality.coding: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality Code: {coding.system} {coding.code} {coding.display}") + for extension in improc.modality.extension: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality Url: {extension.url}") + for subext in extension.extension: + if subext.url == "reference": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality Url: {subext.url} {subext.value_reference}") + elif subext.url == "offset": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality Url: {subext.url} {subext.value_integer}") + elif subext.url == "length": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality Url: {subext.url} {subext.value_integer}") + else: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality: none") + +def main(): + sample = HealthInsightsSyncSamples() + sample.radiology_insights_sync() + + +if __name__ == "__main__": + main() \ No newline at end of file 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 new file mode 100644 index 000000000000..135ba647292d --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_followup_recommendation_inference_async.py @@ -0,0 +1,220 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import asyncio +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights.aio import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_followup_recommendation_inference_async.py + +DESCRIPTION: +The sample_followup_recommendation_inference_async.py module processes a sample radiology document with the Radiology Insights service. +It will initialize an asynchronous RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +- the Finding category code +- the Finding code +- the Finding ID +- the Finding resource type +- the Finding boolean is_conditional +- the Finding boolean is_guideline +- the Finding boolean is_hedging +- the Finding boolean is_option +- the Recommended Procedure code +- the Imaging procedure anatomy code +- the Imaging procedure anatomy extension url +- the Imaging procedure anatomy extension reference +- the Imaging procedure anatomy extension offset +- the Imaging procedure anatomy extension length +- the Imaging procedure modality code +- the Imaging procedure modality extension url +- the Imaging procedure modality extension reference +- the Imaging procedure modality extension offset +- the Imaging procedure modality extension length + extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSamples: + async def radiology_insights_async(self) -> None: + # [START create_radiology_insights_client] + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + # [END create_radiology_insights_client] + doc_content1 = """CLINICAL HISTORY: + 20-year-old female presenting with abdominal pain. Surgical history significant for appendectomy. + COMPARISON: + Right upper quadrant sonographic performed 1 day prior. + TECHNIQUE: + Transabdominal grayscale pelvic sonography with duplex color Doppler and spectral waveform analysis of the ovaries. + FINDINGS: + The uterus is unremarkable given the transabdominal technique with endometrial echo complex within physiologic normal limits. The ovaries are symmetric in size, measuring 2.5 x 1.2 x 3.0 cm and the left measuring 2.8 x 1.5 x 1.9 cm.\n On duplex imaging, Doppler signal is symmetric. + IMPRESSION: + 1. Normal pelvic sonography. Findings of testicular torsion. + A new US pelvis within the next 6 months is recommended. + These results have been discussed with Dr. Jones at 3 PM on November 5 2020.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Http://hl7.org/fhir/ValueSet/cpt-all", + code="USPELVIS", + display="US PELVIS COMPLETE", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US PELVIS COMPLETE", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + try: + poller = await radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = await poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_followup_recommendation(radiology_insights_result) + await radiology_insights_client.close() + except Exception as ex: + print(str(ex)) + return + + def display_followup_recommendation(self, radiology_insights_result): + # [START display_followup_recommendation] + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.FOLLOWUP_RECOMMENDATION: + print(f"Follow-up Recommendation Inference found") + for finding in ri_inference.findings: + for attribute in dir(finding): + if hasattr(finding, attribute) and not attribute.startswith("_") and not callable(getattr(finding, attribute)): + if attribute == "finding": + print (f"\nFollow-up Recommendation: FINDING :" ) + find = finding.finding + for attr in dir(find): + if hasattr(find, attr) and not attr.startswith("_") and not callable(getattr(find, attr)): + if getattr(find, attr) is not None: + if attr == "category": + for category in find.category: + for code in category.coding: + print(f"Follow-up Recommendation: FINDING: Category: {code.system} {code.code} {code.display}") + elif attr == "code": + for code in find.code.coding: + print(f"Follow-up Recommendation: FINDING: Code: {code.system} {code.code} {code.display}") + elif attr == "id": + print(f"Follow-up Recommendation: FINDING: ID: {find.id}") + elif attr == "resource_type": + print(f"Follow-up Recommendation: FINDING: Resource Type: {find.resource_type}") + print(f"\nFollow-up Recommendation: BOOLEANS:") + condition = ri_inference.is_conditional + print(f"Follow-up Recommendation: BOOLEANS: is_conditional: {condition}") + guideline = ri_inference.is_guideline + print(f"Follow-up Recommendation: BOOLEANS: is_guideline: {guideline}") + hedging = ri_inference.is_hedging + print(f"Follow-up Recommendation: BOOLEANS: is_hedging: {hedging}") + option = ri_inference.is_option + print(f"Follow-up Recommendation: BOOLEANS: is_option: {option}") + recproc = ri_inference.recommended_procedure + for proccod in recproc.procedure_codes: + print(f"\nFollow-up Recommendation: PROCEDURE CODES:") + for coding in proccod.coding: + print(f"Follow-up Recommendation: PROCEDURE CODES: {coding.system} {coding.code} {coding.display}") + for improc in recproc.imaging_procedures: + print(f"\nFollow-up Recommendation: IMAGING PROCEDURE:") + for attribute in improc: + if hasattr(improc, attribute) and not attribute.startswith("_") and not callable(getattr(improc, attribute)): + if attribute == "anatomy": + if improc.anatomy is not None: + for coding in improc.anatomy.coding: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy Code: {coding.system} {coding.code} {coding.display}") + for extension in improc.anatomy.extension: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy Url: {extension.url}") + for subext in extension.extension: + if subext.url == "reference": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy Url: {subext.url} {subext.value_reference}") + elif subext.url == "offset": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy Url: {subext.url} {subext.value_integer}") + elif subext.url == "length": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy Url: {subext.url} {subext.value_integer}") + else: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Anatomy: none") + elif attribute == "modality": + if improc.modality is not None: + for coding in improc.modality.coding: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality Code: {coding.system} {coding.code} {coding.display}") + for extension in improc.modality.extension: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality Url: {extension.url}") + for subext in extension.extension: + if subext.url == "reference": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality Url: {subext.url} {subext.value_reference}") + elif subext.url == "offset": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality Url: {subext.url} {subext.value_integer}") + elif subext.url == "length": + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality Url: {subext.url} {subext.value_integer}") + else: + print(f"Follow-up Recommendation: IMAGING PROCEDURE: Modality: none") + + # [END display_followup_recommendation] + +async def main(): + sample = HealthInsightsSamples() + await sample.radiology_insights_async() + + +if __name__ == "__main__": + asyncio.run(main()) \ No newline at end of file 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 new file mode 100644 index 000000000000..f49ed60d1695 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_laterality_discrepancy_inference.py @@ -0,0 +1,125 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_laterality_discrepancy_inference.py + +DESCRIPTION: +The sample_laterality_discrepancy_inference.py module processes a sample radiology document with the Radiology Insights service. +It will initialize a RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display the Laterality Mismatch indication and descripancy type extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSyncSamples: + def radiology_insights_sync(self) -> None: + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + + doc_content1 = """Exam: US LT BREAST TARGETED + Technique: Targeted imaging of the right breast is performed. + Findings: + Targeted imaging of the left breast is performed from the 6:00 to the 9:00 position. + At the 6:00 position, 5 cm from the nipple, there is a 3 x 2 x 4 mm minimally hypoechoic mass with a peripheral calcification. + This may correspond to the mammographic finding. No other cystic or solid masses visualized.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Https://loinc.org", + code="26688-1", + display="US BREAST - LEFT LIMITED", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US BREAST - LEFT LIMITED", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + # Health Insights Radiology Insights + try: + poller = radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_laterality_discrepancy(radiology_insights_result) + except Exception as ex: + print(str(ex)) + return + + def display_laterality_discrepancy(self, radiology_insights_result): + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.LATERALITY_DISCREPANCY: + print(f"Laterality Discrepancy Inference found") + indication = ri_inference.laterality_indication + for code in indication.coding: + print(f"Laterality Discrepancy: Laterality Indication: {code.system} {code.code} {code.display}") + print(f"Laterality Discrepancy: Discrepancy Type: {ri_inference.discrepancy_type}") + +def main(): + sample = HealthInsightsSyncSamples() + sample.radiology_insights_sync() + + +if __name__ == "__main__": + main() \ No newline at end of file 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 new file mode 100644 index 000000000000..75d8a312aef4 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_laterality_discrepancy_inference_async.py @@ -0,0 +1,131 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import asyncio +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights.aio import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_laterality_discrepancy_inference_async.py + +DESCRIPTION: +The sample_laterality_discrepancy_inference_async.py module processes a sample radiology document with the Radiology Insights service. +It will initialize an asynchronous RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display the Laterality Mismatch indication and descripancy type extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSamples: + async def radiology_insights_async(self) -> None: + # [START create_radiology_insights_client] + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + # [END create_radiology_insights_client] + doc_content1 = """Exam: US LT BREAST TARGETED + Technique: Targeted imaging of the right breast is performed. + Findings: + Targeted imaging of the left breast is performed from the 6:00 to the 9:00 position. + At the 6:00 position, 5 cm from the nipple, there is a 3 x 2 x 4 mm minimally hypoechoic mass with a peripheral calcification. + This may correspond to the mammographic finding. No other cystic or solid masses visualized.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Https://loinc.org", + code="26688-1", + display="US BREAST - LEFT LIMITED", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US BREAST - LEFT LIMITED", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + try: + poller = await radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = await poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_laterality_discrepancy(radiology_insights_result) + await radiology_insights_client.close() + except Exception as ex: + print(str(ex)) + return + + def display_laterality_discrepancy(self, radiology_insights_result): + # [START display_laterality_discrepancy] + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.LATERALITY_DISCREPANCY: + print(f"Laterality Discrepancy Inference found") + indication = ri_inference.laterality_indication + for code in indication.coding: + print(f"Laterality Discrepancy: Laterality Indication: {code.system} {code.code} {code.display}") + print(f"Laterality Discrepancy: Discrepancy Type: {ri_inference.discrepancy_type}") + + # [END display_laterality_discrepancy] + + +async def main(): + sample = HealthInsightsSamples() + await sample.radiology_insights_async() + + +if __name__ == "__main__": + asyncio.run(main()) \ No newline at end of file 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 new file mode 100644 index 000000000000..8ef86023fc66 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_limited_order_discrepancy_inference.py @@ -0,0 +1,144 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_limited_order_discrepancy_inference.py + +DESCRIPTION: +The sample_limited_order_discrepancy_inference.py module processes a sample radiology document with the Radiology Insights service. +It will initialize a RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display the Order Type code, Present Body Part code and measurement extracted by the Radiology Insights service. + + + +USAGE: + +""" + + +class HealthInsightsSyncSamples: + def radiology_insights_sync(self) -> None: + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + + doc_content1 = """HISTORY: 49-year-old male with a history of tuberous sclerosis presenting with epigastric pain and diffuse tenderness. The patient was found to have pericholecystic haziness on CT; evaluation for acute cholecystitis. + TECHNIQUE: Ultrasound evaluation of the abdomen was performed. Comparison is made to the prior abdominal ultrasound (2004) and to the enhanced CT of the abdomen and pelvis (2014). + FINDINGS: + The liver is elongated, measuring 19.3 cm craniocaudally, and is homogeneous in echotexture without evidence of focal mass lesion. The liver contour is smooth on high resolution images. There is no appreciable intra- or extrahepatic biliary ductal dilatation, with the visualized extrahepatic bile duct measuring up to 6 mm. There are multiple shadowing gallstones, including within the gallbladder neck, which do not appear particularly mobile. In addition, there is thickening of the gallbladder wall up to approximately 7 mm with probable mild mural edema. There is no pericholecystic fluid. No sonographic Murphy's sign was elicited; however the patient reportedly received pain medications in the emergency department. + The pancreatic head, body and visualized portions of the tail are unremarkable. The spleen is normal in size, measuring 9.9 cm in length. + The kidneys are normal in size. The right kidney measures 11.5 x 5.2 x 4.3 cm and the left kidney measuring 11.8 x 5.3 x 5.1 cm. There are again multiple bilateral echogenic renal masses consistent with angiomyolipomas, in keeping with the patient's history of tuberous sclerosis. The largest echogenic mass on the right is located in the upper pole and measures 1.2 x 1.3 x 1.3 cm. The largest echogenic mass on the left is located within the renal sinus and measures approximately 2.6 x 2.7 x 4.6 cm. Additional indeterminate renal lesions are present bilaterally and are better characterized on CT. There is no hydronephrosis. + No ascites is identified within the upper abdomen. + The visualized portions of the upper abdominal aorta and IVC are normal in caliber. + IMPRESSION: + 1. Numerous gallstones associated with gallbladder wall thickening and probable gallbladder mural edema, highly suspicious for acute cholecystitis in this patient presenting with epigastric pain and pericholecystic hazy density identified on CT. Although no sonographic Murphy sign was elicited, evaluation is limited secondary to reported prior administration of pain medication. Thus, clinical correlation is required. No evidence of biliary ductal dilation. + 2. There are again multiple bilateral echogenic renal masses consistent with angiomyolipomas, in keeping with the patient's history of tuberous sclerosis. Additional indeterminate renal lesions are present bilaterally and are better characterized on CT and MR. + These findings were discussed with Dr. Doe at 5:05 p.m. on 1/1/15.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Https://loinc.org", + code="30704-1", + display="US ABDOMEN LIMITED", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US ABDOMEN LIMITED", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + # Health Insights Radiology Insights + try: + poller = radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_limited_order_discrepancy(radiology_insights_result) + except Exception as ex: + print(str(ex)) + return + + def display_limited_order_discrepancy(self, radiology_insights_result): + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.LIMITED_ORDER_DISCREPANCY: + print(f"Limited Order Discrepancy Inference found") + ordertype = ri_inference.order_type + for coding in ordertype.coding: + print(f"Limited Order Discrepancy: Order Type: {coding.system} {coding.code} {coding.display}") + if not ri_inference.present_body_parts: + print(f"Limited Order Discrepancy: Present Body Parts: empty list") + else: + for presentbodypart in ri_inference.present_body_parts: + for coding in presentbodypart.coding: + print(f"Limited Order Discrepancy: Present Body Part: {coding.system} {coding.code} {coding.display}") + if not ri_inference.present_body_part_measurements: + print(f"Limited Order Discrepancy: Present Body Part Measurements: empty list") + else: + for presentbodypartmeasurement in ri_inference.present_body_part_measurements: + for coding in presentbodypartmeasurement.coding: + print(f"Limited Order Discrepancy: Present Body Part Measurement: {coding.system} {coding.code} {coding.display}") + + +def main(): + sample = HealthInsightsSyncSamples() + sample.radiology_insights_sync() + + +if __name__ == "__main__": + main() \ No newline at end of file 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 new file mode 100644 index 000000000000..c04bd64ca247 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_limited_order_discrepancy_inference_async.py @@ -0,0 +1,148 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import asyncio +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights.aio import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_limited_order_discrepancy_inference_async.py + +DESCRIPTION: +The sample_limited_order_discrepancy_inference_async.py module processes a sample radiology document with the Radiology Insights service. +It will initialize an asynchronous RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display the Order Type code, Present Body Part code and measurement extracted by the Radiology Insights service. + + + +USAGE: + +""" + + +class HealthInsightsSamples: + async def radiology_insights_async(self) -> None: + # [START create_radiology_insights_client] + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + # [END create_radiology_insights_client] + doc_content1 = """HISTORY: 49-year-old male with a history of tuberous sclerosis presenting with epigastric pain and diffuse tenderness. The patient was found to have pericholecystic haziness on CT; evaluation for acute cholecystitis. + TECHNIQUE: Ultrasound evaluation of the abdomen was performed. Comparison is made to the prior abdominal ultrasound (2004) and to the enhanced CT of the abdomen and pelvis (2014). + FINDINGS: + The liver is elongated, measuring 19.3 cm craniocaudally, and is homogeneous in echotexture without evidence of focal mass lesion. The liver contour is smooth on high resolution images. There is no appreciable intra- or extrahepatic biliary ductal dilatation, with the visualized extrahepatic bile duct measuring up to 6 mm. There are multiple shadowing gallstones, including within the gallbladder neck, which do not appear particularly mobile. In addition, there is thickening of the gallbladder wall up to approximately 7 mm with probable mild mural edema. There is no pericholecystic fluid. No sonographic Murphy's sign was elicited; however the patient reportedly received pain medications in the emergency department. + The pancreatic head, body and visualized portions of the tail are unremarkable. The spleen is normal in size, measuring 9.9 cm in length. + The kidneys are normal in size. The right kidney measures 11.5 x 5.2 x 4.3 cm and the left kidney measuring 11.8 x 5.3 x 5.1 cm. There are again multiple bilateral echogenic renal masses consistent with angiomyolipomas, in keeping with the patient's history of tuberous sclerosis. The largest echogenic mass on the right is located in the upper pole and measures 1.2 x 1.3 x 1.3 cm. The largest echogenic mass on the left is located within the renal sinus and measures approximately 2.6 x 2.7 x 4.6 cm. Additional indeterminate renal lesions are present bilaterally and are better characterized on CT. There is no hydronephrosis. + No ascites is identified within the upper abdomen. + The visualized portions of the upper abdominal aorta and IVC are normal in caliber. + IMPRESSION: + 1. Numerous gallstones associated with gallbladder wall thickening and probable gallbladder mural edema, highly suspicious for acute cholecystitis in this patient presenting with epigastric pain and pericholecystic hazy density identified on CT. Although no sonographic Murphy sign was elicited, evaluation is limited secondary to reported prior administration of pain medication. Thus, clinical correlation is required. No evidence of biliary ductal dilation. + 2. There are again multiple bilateral echogenic renal masses consistent with angiomyolipomas, in keeping with the patient's history of tuberous sclerosis. Additional indeterminate renal lesions are present bilaterally and are better characterized on CT and MR. + These findings were discussed with Dr. Doe at 5:05 p.m. on 1/1/15.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Https://loinc.org", + code="30704-1", + display="US ABDOMEN LIMITED", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US ABDOMEN LIMITED", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + try: + poller = await radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = await poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_limited_order_discrepancy(radiology_insights_result) + await radiology_insights_client.close() + except Exception as ex: + print(str(ex)) + return + + def display_limited_order_discrepancy(self, radiology_insights_result): + # [START display_limited_order_discrepancy] + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.LIMITED_ORDER_DISCREPANCY: + print(f"Limited Order Discrepancy Inference found") + ordertype = ri_inference.order_type + for coding in ordertype.coding: + print(f"Limited Order Discrepancy: Order Type: {coding.system} {coding.code} {coding.display}") + if not ri_inference.present_body_parts: + print(f"Limited Order Discrepancy: Present Body Parts: empty list") + else: + for presentbodypart in ri_inference.present_body_parts: + for coding in presentbodypart.coding: + print(f"Limited Order Discrepancy: Present Body Part: {coding.system} {coding.code} {coding.display}") + if not ri_inference.present_body_part_measurements: + print(f"Limited Order Discrepancy: Present Body Part Measurements: empty list") + else: + for presentbodypartmeasurement in ri_inference.present_body_part_measurements: + for coding in presentbodypartmeasurement.coding: + print(f"Limited Order Discrepancy: Present Body Part Measurement: {coding.system} {coding.code} {coding.display}") + + # [END display_limited_order_discrepancy] + +async def main(): + sample = HealthInsightsSamples() + await sample.radiology_insights_async() + + +if __name__ == "__main__": + asyncio.run(main()) \ No newline at end of file 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 new file mode 100644 index 000000000000..409d839cc773 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_radiology_procedure_inference.py @@ -0,0 +1,156 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_radiology_procedure_inference.py + +DESCRIPTION: +The sample_radiology_procedure_inference.py module processes a sample radiology document with the Radiology Insights service. +It will initialize a RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +- the Procedure code, +- the Imaging Procedure anatomy and modality, +- Ordered Procedure code and description +extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSyncSamples: + def radiology_insights_sync(self) -> None: + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + + doc_content1 = """ + Exam: Head CT with Contrast + History: Headaches for 2 months + Technique: Axial, sagittal, and coronal images were reconstructed from helical CT through the head without IV contrast. + IV contrast: 100 mL IV Omnipaque 300. + Findings: There is no mass effect. There is no abnormal enhancement of the brain or within injuries with IV contrast.\ + However, there is no evidence of enhancing lesion in either internal auditory canal. + Impression: Negative CT of the brain without IV contrast. + I recommend a new brain CT within nine months.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Https://loinc.org", + code="24727-0", + display="CT HEAD W CONTRAST IV", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="CT HEAD W CONTRAST IV", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + # Health Insights Radiology Insights + try: + poller = radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_radiology_procedure(radiology_insights_result) + except Exception as ex: + print(str(ex)) + return + + def display_radiology_procedure(self, radiology_insights_result): + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.RADIOLOGY_PROCEDURE: + print(f"Radiology Procedure Inference found") + for proccod in ri_inference.procedure_codes: + print(f"\nRadiology Procedure: PROCEDURE CODES:") + for coding in proccod.coding: + print(f"Radiology Procedure: PROCEDURE CODES: Code: {coding.system} {coding.code} {coding.display}") + for improc in ri_inference.imaging_procedures: + print(f"\nRadiology Procedure: IMAGING PROCEDURE:") + for attribute in improc: + if hasattr(improc, attribute) and not attribute.startswith("_") and not callable(getattr(improc, attribute)): + if attribute == "anatomy": + if improc.anatomy is not None: + for coding in improc.anatomy.coding: + print(f"Radiology Procedure: IMAGING PROCEDURE: Anatomy Code: {coding.system} {coding.code} {coding.display}") + else: + print(f"Radiology Procedure: IMAGING PROCEDURE: Anatomy: none") + elif attribute == "modality": + if improc.modality is not None: + for coding in improc.modality.coding: + print(f"Radiology Procedure: IMAGING PROCEDURE: Modality Code: {coding.system} {coding.code} {coding.display}") + else: + print(f"Radiology Procedure: IMAGING PROCEDURE: Modality: none") + orproc = ri_inference.ordered_procedure + print(f"\nRadiology Procedure: ORDERED PROCEDURE:") + if orproc.description is not None: + print(f"Radiology Procedure: ORDERED PROCEDURE: Description: {orproc.description}") + if orproc.code is not None: + for coding in orproc.code.coding: + print(f"Radiology Procedure: ORDERED PROCEDURE: Code: {coding.system} {coding.code} {coding.display}") + + +def main(): + sample = HealthInsightsSyncSamples() + sample.radiology_insights_sync() + + +if __name__ == "__main__": + main() \ No newline at end of file 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 new file mode 100644 index 000000000000..7ef3f5db4dba --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_radiology_procedure_inference_async.py @@ -0,0 +1,162 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import asyncio +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights.aio import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_radiology_procedure_inference_async.py + +DESCRIPTION: +The sample_radiology_procedure_inference_async.py module processes a sample radiology document with the Radiology Insights service. +It will initialize an asynchronous RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display +- the Procedure code, +- the Imaging Procedure anatomy and modality, +- Ordered Procedure code and description +extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSamples: + async def radiology_insights_async(self) -> None: + # [START create_radiology_insights_client] + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + # [END create_radiology_insights_client] + doc_content1 = """ + Exam: Head CT with Contrast + History: Headaches for 2 months + Technique: Axial, sagittal, and coronal images were reconstructed from helical CT through the head without IV contrast. + IV contrast: 100 mL IV Omnipaque 300. + Findings: There is no mass effect. There is no abnormal enhancement of the brain or within injuries with IV contrast.\ + However, there is no evidence of enhancing lesion in either internal auditory canal. + Impression: Negative CT of the brain without IV contrast. + I recommend a new brain CT within nine months.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Https://loinc.org", + code="24727-0", + display="CT HEAD W CONTRAST IV", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="CT HEAD W CONTRAST IV", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + try: + poller = await radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = await poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_radiology_procedure(radiology_insights_result) + await radiology_insights_client.close() + except Exception as ex: + print(str(ex)) + return + + def display_radiology_procedure(self, radiology_insights_result): + # [START display_radiology_procedure] + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.RADIOLOGY_PROCEDURE: + print(f"Radiology Procedure Inference found") + for proccod in ri_inference.procedure_codes: + print(f"\nRadiology Procedure: PROCEDURE CODES:") + for coding in proccod.coding: + print(f"Radiology Procedure: PROCEDURE CODES: Code: {coding.system} {coding.code} {coding.display}") + for improc in ri_inference.imaging_procedures: + print(f"\nRadiology Procedure: IMAGING PROCEDURE:") + for attribute in improc: + if hasattr(improc, attribute) and not attribute.startswith("_") and not callable(getattr(improc, attribute)): + if attribute == "anatomy": + if improc.anatomy is not None: + for coding in improc.anatomy.coding: + print(f"Radiology Procedure: IMAGING PROCEDURE: Anatomy Code: {coding.system} {coding.code} {coding.display}") + else: + print(f"Radiology Procedure: IMAGING PROCEDURE: Anatomy: none") + elif attribute == "modality": + if improc.modality is not None: + for coding in improc.modality.coding: + print(f"Radiology Procedure: IMAGING PROCEDURE: Modality Code: {coding.system} {coding.code} {coding.display}") + else: + print(f"Radiology Procedure: IMAGING PROCEDURE: Modality: none") + orproc = ri_inference.ordered_procedure + print(f"\nRadiology Procedure: ORDERED PROCEDURE:") + if orproc.description is not None: + print(f"Radiology Procedure: ORDERED PROCEDURE: Description: {orproc.description}") + if orproc.code is not None: + for coding in orproc.code.coding: + print(f"Radiology Procedure: ORDERED PROCEDURE: Code: {coding.system} {coding.code} {coding.display}") + + # [END display_radiology_procedure] + + +async def main(): + sample = HealthInsightsSamples() + await sample.radiology_insights_async() + + +if __name__ == "__main__": + asyncio.run(main()) \ No newline at end of file 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 new file mode 100644 index 000000000000..e9736c779808 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_sex_mismatch_inference.py @@ -0,0 +1,129 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_sex_mismatch_inference.py + +DESCRIPTION: +The sample_sex_mismatch_inference.py module processes a sample radiology document with the Radiology Insights service. +It will initialize a RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display the Sex Mismatch indication extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSyncSamples: + def radiology_insights_sync(self) -> None: + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + + doc_content1 = """CLINICAL HISTORY: + 20-year-old female presenting with abdominal pain. Surgical history significant for appendectomy. + COMPARISON: + Right upper quadrant sonographic performed 1 day prior. + TECHNIQUE: + Transabdominal grayscale pelvic sonography with duplex color Doppler and spectral waveform analysis of the ovaries. + FINDINGS: + The uterus is unremarkable given the transabdominal technique with endometrial echo complex within physiologic normal limits. The ovaries are symmetric in size, measuring 2.5 x 1.2 x 3.0 cm and the left measuring 2.8 x 1.5 x 1.9 cm.\n On duplex imaging, Doppler signal is symmetric. + IMPRESSION: + 1. Normal pelvic sonography. Findings of testicular torsion. + A new US pelvis within the next 6 months is recommended. + These results have been discussed with Dr. Jones at 3 PM on November 5 2020.""" + # Create ordered procedure + procedure_coding = models.Coding( + system="Http://hl7.org/fhir/ValueSet/cpt-all", + code="USPELVIS", + display="US PELVIS COMPLETE", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US PELVIS COMPLETE", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + # Health Insights Radiology Insights + try: + poller = radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_sex_mismatch(radiology_insights_result) + except Exception as ex: + print(str(ex)) + return + + def display_sex_mismatch(self,radiology_insights_result): + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.SEX_MISMATCH: + print(f"Sex Mismatch Inference found") + indication = ri_inference.sex_indication + for code in indication.coding: + print(f"Sex Mismatch: Sex Indication: {code.system} {code.code} {code.display}") + +def main(): + sample = HealthInsightsSyncSamples() + sample.radiology_insights_sync() + + +if __name__ == "__main__": + main() \ No newline at end of file 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 new file mode 100644 index 000000000000..5ec0c7b5e215 --- /dev/null +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/samples/sample_sex_mismatch_inference_async.py @@ -0,0 +1,136 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import asyncio +import datetime +import os +import uuid + + +from azure.core.credentials import AzureKeyCredential +from azure.healthinsights.radiologyinsights.aio import RadiologyInsightsClient +from azure.healthinsights.radiologyinsights import models + +""" +FILE: sample_sex_mismatch_inference_async.py + +DESCRIPTION: +The sample_sex_mismatch_inference_async.py module processes a sample radiology document with the Radiology Insights service. +It will initialize an asynchronous RadiologyInsightsClient, build a Radiology Insights request with the sample document, +submit it to the client, RadiologyInsightsClient, build a Radiology Insights job request with the sample document, +submit it to the client and display the Sex Mismatch indication extracted by the Radiology Insights service. + + +USAGE: + +""" + + +class HealthInsightsSamples: + async def radiology_insights_async(self) -> None: + # [START create_radiology_insights_client] + KEY = os.environ["AZURE_HEALTH_INSIGHTS_API_KEY"] + ENDPOINT = os.environ["AZURE_HEALTH_INSIGHTS_ENDPOINT"] + + job_id = str(uuid.uuid4()) + + radiology_insights_client = RadiologyInsightsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY)) + # [END create_radiology_insights_client] + doc_content1 = """CLINICAL HISTORY: + 20-year-old female presenting with abdominal pain. Surgical history significant for appendectomy. + COMPARISON: + Right upper quadrant sonographic performed 1 day prior. + TECHNIQUE: + Transabdominal grayscale pelvic sonography with duplex color Doppler and spectral waveform analysis of the ovaries. + FINDINGS: + The uterus is unremarkable given the transabdominal technique with endometrial echo complex within physiologic normal limits. The ovaries are symmetric in size, measuring 2.5 x 1.2 x 3.0 cm and the left measuring 2.8 x 1.5 x 1.9 cm.\n On duplex imaging, Doppler signal is symmetric. + IMPRESSION: + 1. Normal pelvic sonography. Findings of testicular torsion. + A new US pelvis within the next 6 months is recommended. + These results have been discussed with Dr. Jones at 3 PM on November 5 2020.""" + + # Create ordered procedure + procedure_coding = models.Coding( + system="Http://hl7.org/fhir/ValueSet/cpt-all", + code="USPELVIS", + display="US PELVIS COMPLETE", + ) + procedure_code = models.CodeableConcept(coding=[procedure_coding]) + ordered_procedure = models.OrderedProcedure(description="US PELVIS COMPLETE", code=procedure_code) + # Create encounter + start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) + encounter = models.PatientEncounter( + id="encounter2", + class_property=models.EncounterClass.IN_PATIENT, + period=models.TimePeriod(start=start, end=end), + ) + # Create patient info + birth_date = datetime.date(1959, 11, 11) + patient_info = models.PatientDetails(sex=models.PatientSex.FEMALE, birth_date=birth_date) + # Create author + author = models.DocumentAuthor(id="author2", full_name="authorName2") + + create_date_time = datetime.datetime(2024, 2, 19, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) + patient_document1 = models.PatientDocument( + type=models.DocumentType.NOTE, + clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, + id="doc2", + content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), + created_at=create_date_time, + specialty_type=models.SpecialtyType.RADIOLOGY, + administrative_metadata=models.DocumentAdministrativeMetadata( + ordered_procedures=[ordered_procedure], encounter_id="encounter2" + ), + authors=[author], + language="en", + ) + + # Construct patient + patient1 = models.PatientRecord( + id="patient_id2", + details=patient_info, + encounters=[encounter], + patient_documents=[patient_document1], + ) + + # Create a configuration + configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") + + # Construct the request with the patient and configuration + radiology_insights_data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) + job_data = models.RadiologyInsightsJob(job_data=radiology_insights_data) + + try: + poller = await radiology_insights_client.begin_infer_radiology_insights( + id=job_id, + resource=job_data, + ) + job_response = await poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(job_response) + self.display_sex_mismatch(radiology_insights_result) + await radiology_insights_client.close() + except Exception as ex: + print(str(ex)) + return + + def display_sex_mismatch(self, radiology_insights_result): + # [START display_sex_mismatch] + for patient_result in radiology_insights_result.patient_results: + for ri_inference in patient_result.inferences: + if ri_inference.kind == models.RadiologyInsightsInferenceType.SEX_MISMATCH: + print(f"Sex Mismatch Inference found") + indication = ri_inference.sex_indication + for code in indication.coding: + print(f"Sex Mismatch: Sex Indication: {code.system} {code.code} {code.display}") + + # [END display_sex_mismatch] + + +async def main(): + sample = HealthInsightsSamples() + await sample.radiology_insights_async() + + +if __name__ == "__main__": + asyncio.run(main()) \ No newline at end of file diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/setup.py b/sdk/healthinsights/azure-healthinsights-radiologyinsights/setup.py index 57be0108e385..6cfa272e6186 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/setup.py +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/setup.py @@ -38,7 +38,7 @@ url="https://github.com/Azure/azure-sdk-for-python/tree/main/sdk", keywords="azure, azure sdk", classifiers=[ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", @@ -63,8 +63,8 @@ "azure.healthinsights.radiologyinsights": ["py.typed"], }, install_requires=[ - "isodate<1.0.0,>=0.6.1", - "azure-core<2.0.0,>=1.30.0", + "isodate>=0.6.1", + "azure-core>=1.30.0", "typing-extensions>=4.6.0", ], python_requires=">=3.8", 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 b6039f7054ba..c654ed96bb2a 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 @@ -46,7 +46,7 @@ def create_request(self): start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) - encounter = models.Encounter( + encounter = models.PatientEncounter( id="encounter2", class_property=models.EncounterClass.IN_PATIENT, period=models.TimePeriod(start=start, end=end), @@ -63,7 +63,7 @@ def create_request(self): clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, id="doc2", content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), - created_date_time=create_date_time, + created_at=create_date_time, specialty_type=models.SpecialtyType.RADIOLOGY, administrative_metadata=models.DocumentAdministrativeMetadata( ordered_procedures=[ordered_procedure], encounter_id="encounter2" @@ -74,7 +74,7 @@ def create_request(self): patient1 = models.PatientRecord( id="patient_id2", - info=patient_info, + details=patient_info, encounters=[encounter], patient_documents=[patient_document1], ) @@ -82,7 +82,8 @@ def create_request(self): configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) - return data + jobdata = models.RadiologyInsightsJob(job_data=data) + return jobdata @HealthInsightsEnvPreparer() @recorded_by_proxy_async @@ -90,17 +91,14 @@ async def test_critical_result(self, healthinsights_endpoint, healthinsights_key radiology_insights_client = RadiologyInsightsClient( healthinsights_endpoint, AzureKeyCredential(healthinsights_key) ) - data = TestRadiologyInsightsClient.create_request(self) + jobdata = TestRadiologyInsightsClient.create_request(self) request_time = datetime.datetime(2024, 2, 26, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) poller = await radiology_insights_client.begin_infer_radiology_insights( - data, - headers={ - "Repeatability-First-Sent": request_time.strftime("%a, %d %b %Y %H:%M:%S GMT"), - "Repeatability-Request-ID": "5189b7f2-a13a-4cac-bebf-407c4ffc3a7c", - }, + id="test12", + resource=jobdata, ) - radiology_insights_result = await poller.result() - + response = await poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(response) for patient_result in radiology_insights_result.patient_results: assert patient_result.inferences is not None for inference in patient_result.inferences: 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 a6fe9c5d10d0..80e177db8079 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 @@ -45,7 +45,7 @@ def create_request(self): start = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) end = datetime.datetime(2021, 8, 28, 0, 0, 0, 0) - encounter = models.Encounter( + encounter = models.PatientEncounter( id="encounter2", class_property=models.EncounterClass.IN_PATIENT, period=models.TimePeriod(start=start, end=end), @@ -62,7 +62,7 @@ def create_request(self): clinical_type=models.ClinicalDocumentType.RADIOLOGY_REPORT, id="doc2", content=models.DocumentContent(source_type=models.DocumentContentSourceType.INLINE, value=doc_content1), - created_date_time=create_date_time, + created_at=create_date_time, specialty_type=models.SpecialtyType.RADIOLOGY, administrative_metadata=models.DocumentAdministrativeMetadata( ordered_procedures=[ordered_procedure], encounter_id="encounter2" @@ -73,7 +73,7 @@ def create_request(self): patient1 = models.PatientRecord( id="patient_id2", - info=patient_info, + details=patient_info, encounters=[encounter], patient_documents=[patient_document1], ) @@ -81,7 +81,8 @@ def create_request(self): configuration = models.RadiologyInsightsModelConfiguration(verbose=False, include_evidence=True, locale="en-US") data = models.RadiologyInsightsData(patients=[patient1], configuration=configuration) - return data + jobdata = models.RadiologyInsightsJob(job_data=data) + return jobdata @HealthInsightsEnvPreparer() @recorded_by_proxy @@ -89,16 +90,14 @@ def test_critical_result(self, healthinsights_endpoint, healthinsights_key): radiology_insights_client = RadiologyInsightsClient( healthinsights_endpoint, AzureKeyCredential(healthinsights_key) ) - data = TestRadiologyInsightsClient.create_request(self) + jobdata = TestRadiologyInsightsClient.create_request(self) request_time = datetime.datetime(2024, 2, 26, 0, 0, 0, 0, tzinfo=datetime.timezone.utc) poller = radiology_insights_client.begin_infer_radiology_insights( - data, - headers={ - "Repeatability-First-Sent": request_time.strftime("%a, %d %b %Y %H:%M:%S GMT"), - "Repeatability-Request-ID": "5ac5fbb2-0185-4c17-82dd-e0fcf36a2184", - }, + id="test34", + resource=jobdata, ) - radiology_insights_result = poller.result() + response = poller.result() + radiology_insights_result = models.RadiologyInsightsInferenceResult(response) for patient_result in radiology_insights_result.patient_results: assert patient_result.inferences is not None diff --git a/sdk/healthinsights/azure-healthinsights-radiologyinsights/tsp-location.yaml b/sdk/healthinsights/azure-healthinsights-radiologyinsights/tsp-location.yaml index 62b271fc8b89..c9333e13d9a4 100644 --- a/sdk/healthinsights/azure-healthinsights-radiologyinsights/tsp-location.yaml +++ b/sdk/healthinsights/azure-healthinsights-radiologyinsights/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai/HealthInsights/HealthInsights.RadiologyInsights -commit: 3efb341e0472b4b1d85f9c015666a715d9f5fa5a +commit: 09db900b1d9155361899e5f8fb1331a30055df41 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai/HealthInsights/HealthInsights.Common/