CancerProfilingClient.InferCancerProfileAsync Метод
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Перегрузки
InferCancerProfileAsync(WaitUntil, RequestContent, String, Nullable<DateTimeOffset>, RequestContext) |
Создание задания Onco Phenotype. |
InferCancerProfileAsync(WaitUntil, OncoPhenotypeData, String, Nullable<DateTimeOffset>, CancellationToken) |
Создание задания Onco Phenotype. |
InferCancerProfileAsync(WaitUntil, RequestContent, String, Nullable<DateTimeOffset>, RequestContext)
- Исходный код:
- CancerProfilingClient.cs
Создание задания Onco Phenotype.
public virtual System.Threading.Tasks.Task<Azure.Operation<BinaryData>> InferCancerProfileAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string repeatabilityRequestId = default, DateTimeOffset? repeatabilityFirstSent = default, Azure.RequestContext context = default);
abstract member InferCancerProfileAsync : Azure.WaitUntil * Azure.Core.RequestContent * string * Nullable<DateTimeOffset> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>
override this.InferCancerProfileAsync : Azure.WaitUntil * Azure.Core.RequestContent * string * Nullable<DateTimeOffset> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>
Public Overridable Function InferCancerProfileAsync (waitUntil As WaitUntil, content As RequestContent, Optional repeatabilityRequestId As String = Nothing, Optional repeatabilityFirstSent As Nullable(Of DateTimeOffset) = Nothing, Optional context As RequestContext = Nothing) As Task(Of Operation(Of BinaryData))
Параметры
- waitUntil
- WaitUntil
Completed Значение , если метод должен ждать возврата до завершения длительной операции в службе; Started Значение , если он должен возвращать значение после запуска операции. Дополнительные сведения о длительных операциях см. в статье Примеры операций Long-Running Azure.Core.
- content
- RequestContent
Содержимое, отправляемые в качестве текста запроса. Подробные сведения о схеме текста запроса приведены в разделе Примечания ниже.
- repeatabilityRequestId
- String
Непрозрачный, глобально уникальный, сгенерированный клиентом идентификатор строки для запроса.
- repeatabilityFirstSent
- Nullable<DateTimeOffset>
Указывает дату и время первого создания запроса.
- context
- RequestContext
Контекст запроса, который может переопределять поведение конвейера клиента по умолчанию для каждого вызова.
Возвращаемое значение
Объект Operation<T> из службы, который будет содержать BinaryData объект после завершения асинхронной операции в службе. Сведения о схеме основного текста для конечного значения операции приведены в разделе Примечания ниже.
Исключения
Параметр content
имеет значение null.
Служба вернула код состояния без успешного выполнения.
Примеры
В этом примере показано, как вызвать InferCancerProfileAsync с необходимыми параметрами и содержимым запроса, а также как проанализировать результат.
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new CancerProfilingClient(endpoint, credential);
var data = new {
patients = new[] {
new {
id = "<id>",
}
},
};
var operation = await client.InferCancerProfileAsync(WaitUntil.Completed, RequestContent.Create(data));
BinaryData data = operation.Value;
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("lastUpdateDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
В этом примере показано, как вызвать InferCancerProfileAsync со всеми параметрами и содержимым запроса, а также как проанализировать результат.
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new CancerProfilingClient(endpoint, credential);
var data = new {
patients = new[] {
new {
id = "<id>",
info = new {
sex = "female",
birthDate = "2022-05-10",
clinicalInfo = new[] {
new {
system = "<system>",
code = "<code>",
name = "<name>",
value = "<value>",
}
},
},
data = new[] {
new {
type = "note",
clinicalType = "consultation",
id = "<id>",
language = "<language>",
createdDateTime = "2022-05-10T14:57:31.2311892-04:00",
content = new {
sourceType = "inline",
value = "<value>",
},
}
},
}
},
configuration = new {
verbose = true,
includeEvidence = true,
inferenceTypes = new[] {
"tumorSite"
},
checkForCancerCase = true,
},
};
var operation = await client.InferCancerProfileAsync(WaitUntil.Completed, RequestContent.Create(data), "<repeatabilityRequestId>", DateTimeOffset.UtcNow);
BinaryData data = operation.Value;
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("lastUpdateDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("caseId").ToString());
Console.WriteLine(result.GetProperty("results").GetProperty("modelVersion").ToString());
Комментарии
Создает задание Onco Phenotype с заданным текстом запроса.
Ниже приведена схема JSON для полезных данных запроса и ответа.
Тело запроса:
Схема для OncoPhenotypeData
:
{
patients: [
{
id: string, # Required. A given identifier for the patient. Has to be unique across all patients in a single request.
info: {
sex: "female" | "male" | "unspecified", # Optional. The patient's sex.
birthDate: string (date), # Optional. The patient's date of birth.
clinicalInfo: [ClinicalCodedElement], # Optional. Known clinical information for the patient, structured.
}, # Optional. Patient structured information, including demographics and known structured clinical information.
data: [PatientDocument], # Optional. Patient unstructured clinical data, given as documents.
}
], # Required. The list of patients, including their clinical information and data.
configuration: {
verbose: boolean, # Optional. An indication whether the model should produce verbose output.
includeEvidence: boolean, # Optional. An indication whether the model's output should include evidence for the inferences.
inferenceTypes: ["tumorSite" | "histology" | "clinicalStageT" | "clinicalStageN" | "clinicalStageM" | "pathologicStageT" | "pathologicStageN" | "pathologicStageM"], # Optional. A list of inference types to be inferred for the current request.
This could be used if only part of the Onco Phenotype inferences are required.
If this list is omitted or empty, the model will return all the inference types.
checkForCancerCase: boolean, # Optional. An indication whether to perform a preliminary step on the patient's documents to determine whether they relate to a Cancer case.
}, # Optional. Configuration affecting the Onco Phenotype model's inference.
}
Текст ответа:
Схема для OncoPhenotypeResult
:
{
jobId: string, # Required. A processing job identifier.
createdDateTime: string (date & time), # Required. The date and time when the processing job was created.
expirationDateTime: string (date & time), # Required. The date and time when the processing job is set to expire.
lastUpdateDateTime: string (date & time), # Required. The date and time when the processing job was last updated.
status: "notStarted" | "running" | "succeeded" | "failed" | "partiallyCompleted", # Required. The status of the processing job.
errors: [
{
code: string, # Required. One of a server-defined set of error codes.
message: string, # Required. A human-readable representation of the error.
target: string, # Optional. The target of the error.
details: [Error], # Required. An array of details about specific errors that led to this reported error.
innererror: {
code: string, # Required. One of a server-defined set of error codes.
innererror: InnerError, # Optional. Inner error.
}, # Optional. An object containing more specific information than the current object about the error.
}
], # Optional. An array of errors, if any errors occurred during the processing job.
results: {
patients: [OncoPhenotypePatientResult], # Required. Results for the patients given in the request.
modelVersion: string, # Required. The version of the model used for inference, expressed as the model date.
}, # Optional. The inference results for the Onco Phenotype request.
}
Применяется к
InferCancerProfileAsync(WaitUntil, OncoPhenotypeData, String, Nullable<DateTimeOffset>, CancellationToken)
- Исходный код:
- CancerProfilingClient.cs
Создание задания Onco Phenotype.
public virtual System.Threading.Tasks.Task<Azure.Operation<Azure.Health.Insights.CancerProfiling.OncoPhenotypeResult>> InferCancerProfileAsync(Azure.WaitUntil waitUntil, Azure.Health.Insights.CancerProfiling.OncoPhenotypeData oncoPhenotypeData, string repeatabilityRequestId = default, DateTimeOffset? repeatabilityFirstSent = default, System.Threading.CancellationToken cancellationToken = default);
abstract member InferCancerProfileAsync : Azure.WaitUntil * Azure.Health.Insights.CancerProfiling.OncoPhenotypeData * string * Nullable<DateTimeOffset> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Operation<Azure.Health.Insights.CancerProfiling.OncoPhenotypeResult>>
override this.InferCancerProfileAsync : Azure.WaitUntil * Azure.Health.Insights.CancerProfiling.OncoPhenotypeData * string * Nullable<DateTimeOffset> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Operation<Azure.Health.Insights.CancerProfiling.OncoPhenotypeResult>>
Public Overridable Function InferCancerProfileAsync (waitUntil As WaitUntil, oncoPhenotypeData As OncoPhenotypeData, Optional repeatabilityRequestId As String = Nothing, Optional repeatabilityFirstSent As Nullable(Of DateTimeOffset) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Operation(Of OncoPhenotypeResult))
Параметры
- waitUntil
- WaitUntil
Completed Значение , если метод должен ждать возврата до завершения длительной операции в службе; Started Значение , если он должен возвращать значение после запуска операции. Дополнительные сведения о длительных операциях см. в статье Примеры операций Long-Running Azure.Core.
- oncoPhenotypeData
- OncoPhenotypeData
Текст запроса Onco Phenotype.
- repeatabilityRequestId
- String
Непрозрачный, глобально уникальный, сгенерированный клиентом идентификатор строки для запроса.
- repeatabilityFirstSent
- Nullable<DateTimeOffset>
Указывает дату и время первого создания запроса.
- cancellationToken
- CancellationToken
Токен отмены, который необходимо использовать.
Возвращаемое значение
Исключения
Параметр oncoPhenotypeData
имеет значение null.
Комментарии
Создает задание Onco Phenotype с заданным текстом запроса.
Применяется к
Azure SDK for .NET