> For the complete documentation index, see [llms.txt](https://docs.system.com/system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.system.com/system/api-docs/synthesize/concordance.md).

# Concordance

Using a patient's unique Assembled graph instance as input for Synthesize enables developers to preset queries to run automatically any time data in the record is updated.&#x20;

## **Concordance**

The first of these endpoints is `/concordance` which automatically surfaces and synthesizes the guidelines for each of the problems on a patient's problem list. Responses are contextualized to the data in a patient's record corresponding not just to their current care plans, but their medical history, including labs, pre-existing conditions, and risk factors.&#x20;

### Endpoint

```
POST /v1/concordance
```

### Authentication

All requests require an API key passed in the request header:

```
x-api-key: <your-api-key>
```

***

### Request Headers

| Header         | Value              | Required |
| -------------- | ------------------ | -------- |
| `x-api-key`    | Your API key       | Yes      |
| `Content-Type` | `application/json` | Yes      |

### Request Body

The request body consists of an `AssembledPatient` and a `ccsr_category`  to indicate which problem list item is being evaluated for guideline concordance.

| Field               | Type               | Required | Description                                                                                                                                      |
| ------------------- | ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `assembled_patient` | `AssembledPatient` | Yes      | [Assemble output](https://app.gitbook.com/o/-MFrU3GFDQCtxSiSV1o5/s/-M1zWgwfNb8Lu2WVCnfw/~/edit/~/changes/652/api-docs/assemble#assembledpatient) |
| `ccsr_category`     | `str`              | Yes      | The problem list item (CCSR category)                                                                                                            |

## Get concordance by ID

> Get concordance.

```json
{"openapi":"3.1.0","info":{"title":"Clinical Graph (CG) REST API","version":"0.1.0"},"servers":[{"url":"https://cg-api-prod.system.com","description":"Production API"},{"url":"https://cg-api-stage.system.com","description":"Staging API"},{"url":"https://cg-api-dev.system.com","description":"Development API"},{"url":"http://localhost:80","description":"Local API"}],"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"ConcordanceOut":{"properties":{"status":{"$ref":"#/components/schemas/SynthesisPollingStatus"},"concordance":{"anyOf":[{"$ref":"#/components/schemas/ConcordanceOutput"},{"type":"null"}]}},"type":"object","required":["status","concordance"],"title":"ConcordanceOut","description":"Concordance fetching output schema."},"SynthesisPollingStatus":{"type":"string","enum":["not_exists","submitted","running","success","failed"],"title":"SynthesisPollingStatus","description":"Polling status enum."},"ConcordanceOutput":{"properties":{"guideline_concordance":{"anyOf":[{"$ref":"#/components/schemas/GuidelineConcordanceOutput"},{"type":"null"}]}},"type":"object","title":"ConcordanceOutput","description":"Top-level output for the guideline concordance flow."},"GuidelineConcordanceOutput":{"properties":{"ccsr_category":{"type":"string","title":"Ccsr Category"},"concordance_status":{"$ref":"#/components/schemas/ConcordanceStatus"},"text":{"type":"string","title":"Text"},"actions":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConcordanceAction"},"type":"array"},{"type":"null"}],"title":"Actions"},"references":{"anyOf":[{"items":{"$ref":"#/components/schemas/SynthesisReference"},"type":"array"},{"type":"null"}],"title":"References"}},"type":"object","required":["ccsr_category","concordance_status","text"],"title":"GuidelineConcordanceOutput","description":"Guideline concordance output for a single CCSR category."},"ConcordanceStatus":{"type":"string","enum":["aligned","gap","unknown"],"title":"ConcordanceStatus","description":"Concordance verdict for a CCSR category."},"ConcordanceAction":{"properties":{"text":{"type":"string","title":"Text"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"type":"object","required":["text"],"title":"ConcordanceAction","description":"Suggested next step for the clinician.  ``code`` is a placeholder today (a short categorical label like ``\"increase_dose\"``); future iterations will replace it with a real LOINC, RxNorm, or SNOMED code."},"SynthesisReference":{"properties":{"index":{"type":"integer","title":"Index"},"reference_text":{"type":"string","title":"Reference Text"},"document_title":{"type":"string","title":"Document Title"},"authoring_societies_or_journal":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Authoring Societies Or Journal"},"publish_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publish Date"},"link_or_doi":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Link Or Doi"},"cited_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cited By"},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type"},"authors":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Authors"},"journal_quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Quality"}},"type":"object","required":["index","reference_text","document_title"],"title":"SynthesisReference","description":"Synthesis reference with authors populated."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/concordance/{job_id}":{"get":{"tags":["Concordance"],"summary":"Get concordance by ID","description":"Get concordance.","operationId":"get_concordance_by_id","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConcordanceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.system.com/system/api-docs/synthesize/concordance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
