---
title: "Create Onco Phenotype job"
method: POST
path: "/oncophenotype/jobs"
tags: ["OncoPhenotype"]
---

# Create Onco Phenotype job

`POST /oncophenotype/jobs`

## Request

- Base URL: `{endpoint}/healthinsights`
- URL: `{endpoint}/healthinsights/oncophenotype/jobs`
- Auth: API key in header `Ocp-Apim-Subscription-Key`

Creates an Onco Phenotype job with the given request body.

## Query parameters

- `api-version` string, required

## Headers

- `Repeatability-Request-ID` string
- `Repeatability-First-Sent` string, date-time

## Request body

- OncoPhenotypeData: The body of the Onco Phenotype request.
  - `patients` PatientRecord[], required: The list of patients, including their clinical information and data.
    - `id` string, required: A given identifier for the patient. Has to be unique across all patients in a single request.
    - `info` PatientInfo: Patient structured information, including demographics and known structured clinical information.
      - `sex` 'female' | 'male' | 'unspecified': The patient's sex.
      - `birthDate` string, date: The patient's date of birth.
      - `clinicalInfo` ClinicalCodedElement[]: Known clinical information for the patient, structured.
        - `system` string, required: The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS.
        - `code` string, required: The code within the given clinical coding system.
        - `name` string: The name of this coded concept in the coding system.
        - `value` string: A value associated with the code within the given clinical coding system.
    - `data` PatientDocument[]: Patient unstructured clinical data, given as documents.
      - `type` 'note' | 'fhirBundle' | 'dicom' | 'genomicSequencing', required: The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document).
      - `clinicalType` 'consultation' | 'dischargeSummary' | 'historyAndPhysical' | 'procedure' | 'progress' | 'imaging' | 'laboratory' | 'pathology': The type of the clinical document.
      - `id` string, required: A given identifier for the document. Has to be unique across all documents for a single patient.
      - `language` string: A 2 letter ISO 639-1 representation of the language of the document.
      - `createdDateTime` string, date-time: The date and time when the document was created.
      - `content` DocumentContent, required: The content of the patient document.
        - `sourceType` 'inline' | 'reference', required: 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.
        - `value` string, required: The content of the document, given either inline (as a string) or as a reference (URI).
  - `configuration` OncoPhenotypeModelConfiguration: Configuration affecting the Onco Phenotype model's inference.
    - `verbose` boolean: An indication whether the model should produce verbose output.
    - `includeEvidence` boolean: An indication whether the model's output should include evidence for the inferences.
    - `inferenceTypes` OncoPhenotypeInferenceType[]: 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: An indication whether to perform a preliminary step on the patient's documents to determine whether they relate to a Cancer case.

## Response `200`

The request has succeeded.

- OncoPhenotypeResult: The response for the Onco Phenotype request.
  - `jobId` string, uuid, required: Universally Unique 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` AzureCoreFoundationsError[]: An array of errors, if any errors occurred during the processing job.
    - `code` string, required: One of a server-defined set of error codes.
    - `message` string, required: A human-readable representation of the error.
    - `target` string: The target of the error.
    - `details` AzureCoreFoundationsError[]: An array of details about specific errors that led to this reported error.
    - `innererror` AzureCoreFoundationsInnerError: An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
      - `code` string: One of a server-defined set of error codes.
      - `innererror` AzureCoreFoundationsInnerError (recursive)
  - `results` OncoPhenotypeResults: The inference results for the Onco Phenotype request.
    - `patients` OncoPhenotypePatientResult[], required: Results for the patients given in the request.
      - `id` string, required: The identifier given for the patient in the request.
      - `inferences` OncoPhenotypeInference[], required: The model's inferences for the given patient.
        - `type` 'tumorSite' | 'histology' | 'clinicalStageT' | 'clinicalStageN' | 'clinicalStageM' | 'pathologicStageT' | 'pathologicStageN' | 'pathologicStageM', required: The type of the Onco Phenotype inference.
        - `value` string, required: The value of the inference, as relevant for the given inference type.
        - `description` string: The description corresponding to the inference value.
        - `confidenceScore` number, float: Confidence score for this inference.
        - `evidence` InferenceEvidence[]: The evidence corresponding to the inference value.
          - `patientDataEvidence` ClinicalNoteEvidence: A piece of evidence from a clinical note (text document).
            - `id` string, required: The identifier of the document containing the evidence.
            - `text` string: The actual text span which is evidence for the inference.
            - `offset` integer, required: The start index of the evidence text span in the document (0 based).
            - `length` integer, required: The length of the evidence text span.
          - `patientInfoEvidence` ClinicalCodedElement: A piece of clinical information, expressed as a code in a clinical coding system.
            - `system` string, required: The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS.
            - `code` string, required: The code within the given clinical coding system.
            - `name` string: The name of this coded concept in the coding system.
            - `value` string: A value associated with the code within the given clinical coding system.
          - `importance` number, float: A value indicating how important this piece of evidence is for the inference.
        - `caseId` string: An identifier for a clinical case, if there are multiple clinical cases regarding the same patient.
    - `modelVersion` string, required: The version of the model used for inference, expressed as the model date.

## Other responses

- `202`: The request has been accepted for processing, but processing has not yet completed.
- `default`: An unexpected error response.

---

[API](https://skmtc.dev/azure/apis/azure-health-insights.md) - [All operations](https://skmtc.dev/azure/apis/azure-health-insights/llms.txt) - [OpenAPI document](https://skmtc.dev/azure/apis/azure-health-insights/revisions/170d7819ac4c?raw)
