> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.medicomp.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.medicomp.com/_mcp/server.

# Prompt

GET https://quippe.medicomp.com/api/Quippe/ClinicalLens/Prompt

Generates a Clinical Lens "prompt" list - the set of related MEDCIN findings (differential diagnoses, associated symptoms, work-up, and treatment terms) suggested for a given source term, so an application can offer clinically relevant filtering of a patient's chart. Given a MEDCIN ID (or, with `SourceType=content`, a content library item ID), the Prompt API (GET /Quippe/ClinicalLens/Prompt) expands the source into a ranked list of MEDCIN terms using the MEDCIN knowledge base's built-in prompting/associativity data, optionally overridden or filtered by author-curated content from the content library. 

 Common uses include driving clinically-intelligent filtering and highlighting of items in a patient's chart related to a particular diagnosis 

 GET /Quippe/ClinicalLens/Prompt 

Use this endpoint when you already have a MEDCIN ID (or a content library item ID) and want the related terms the MEDCIN knowledge base or curated content suggests for it. To search the MEDCIN clinical terminology for a term in the first place, use [/Quippe/Search](/api-reference/rest/get-quippe-search). To map the resulting MEDCIN findings to other vocabularies, use [/Quippe/Coding/ChartMap](/api-reference/rest/post-quippe-coding-chart-map) or [/Quippe/Coding/TranslateItem](/api-reference/rest/get-quippe-coding-translate-item).

Reference: https://docs.medicomp.com/api-reference/rest/get-quippe-clinical-lens-prompt

## Authentication

- `Authorization` header (basic auth, required) — Login and password used to access quippe.medicomp.com. On-premise Quippe deployments can be configured to use whatever authentication and authorization your application is configured for, so basic authentication is used here to access the Quippe sandbox and is not a product requirement.
- `Authorization` header (bearer token, required) — JSON web token generated by a request to the [/Quippe/Security/Token](/api-reference/rest/get-quippe-security-token) web service endpoint in Quippe.

## Request

### Query parameters

- `SourceId` (string, required) — The ID of the source item to expand into a prompt list. When `SourceType=term` (default), this is a MEDCIN ID and must parse as a positive integer. When `SourceType=content`, this is a content library item ID instead.
- `SourceType` (string, optional) — Determines how `SourceId` is interpreted. `term` (default) treats `SourceId` as a MEDCIN ID and expands it via the MEDCIN knowledge base (or a nursing-intervention prompt if the ID falls under the nursing root node). `content` treats `SourceId` as a content library item ID and returns the MEDCIN list authored directly in that XML content item.
- `ListSize` (enum, optional) — Controls how many related terms are returned in the prompt list. `medListSmall` provides the hallmark findings for a given diagnosis, while other values will cast a progressively wider net when looking for related terms. `medListFull` is eligible for the `BroadPromptMethod`/`ExpandOnAllDx` broadening behaviors. Ignored when `SourceType=content`.
  - Allowed values: `medListSmall`, `medListLarge`, `medListFull`
- `PatientId` (string, optional) — Optional patient ID used to set patient demographics (age, sex, ethnicity, religion, race, last name) on the MEDCIN knowledge base before the prompt list is built, so age/sex-specific MEDCIN content is applied. Requires the patient's birth date to be resolvable; ignored otherwise.
- `EncounterTime` (string, optional) — The clinical time of the encounter, used with `PatientId` to compute the patient's age for knowledge-base demographics. Defaults to the current time when a `PatientId` is supplied but no `EncounterTime` is given.
- `UseContentOverride` (boolean, optional) — When true (default), checks the Content Library for a curated list that overrides the MEDCIN knowledge-base expansion for this `SourceId` and `ListSize` (matched by a `ContentPrefix`+size+id keyword) before falling back to the standard MEDCIN prompt. Ignored when `SourceType=content`, since the source is already a content item.
- `ContentPrefix` (string, optional) — The keyword prefix used to look up a Content Library override (combined with the numeric `ListSize` value and the MEDCIN id, e.g. "lens2_123456"). Only used when `UseContentOverride` is true.
- `ResponseType` (string, optional) — Shapes the response body. `terms` returns full term detail per item (MedcinId, NodeKey, TermType, Description, and optionally Source); `expression` returns a single compact node-key regular expression string covering the whole list, which can be used to match node keys for patient chart entries against the prompt list in a single operation; `keys` (default, used for any other value) returns a flat list of node keys only.
- `PruneTerms` (boolean, optional) — When true (default), sorts the result list by node key and removes any item whose node key is a descendant of another item already in the list, collapsing redundant child terms down to their nearest included ancestor.
- `UsePrimarySpecialty` (boolean, optional) — Accepted for compatibility with existing callers of the Prompt API, but not currently read by this handler's implementation. Use `BroadPromptMethod=2` to restrict expansion to the primary specialty instead.
- `ExpandOnAllDx` (boolean, optional) — When true (default) and the resulting list from the MEDCIN knowledge base consists entirely of diagnosis terms, re-expands each of those diagnoses individually and merges the results, retrying up to 3 times. This broadens an all-diagnosis result into a richer mix of associated terms. Ignored when `SourceType=content` or for nursing prompts.
- `IncludeRs` (boolean, optional) — When true (default), includes findings with R prompt-level records when building the MEDCIN activation list mode. Combines with `IncludeMs` to set the knowledge base's list-build mode for this request.
- `IncludeMs` (boolean, optional) — When true (default), includes findings with M prompt-level records when building the MEDCIN activation list mode. Combines with `IncludeRs` to set the knowledge base's list-build mode for this request.
- `BroadPromptMethod` (integer, optional) — Selects how the list is broadened when `ListSize=medListFull`: `1` (default) uses all specialties applicable to the source term; `2` restricts the specialty to the source term's primary (parent-node) specialty only; `3` instead extends the list with all terms from the source term's ICD-10-WHO diagnostic category. Ignored for any other `ListSize`.
- `ExpandLabPanels` (boolean, optional) — When true (default), scans the result list for lab test terms and appends any related lab findings (as items tagged `RelatedLab`) so ordering a panel-adjacent test surfaces its companion labs.
- `ShowSources` (boolean, optional) — When true (default) and `ResponseType=terms`, includes a `Source` attribute on each item describing where the term came from. Has no effect on `keys` or `expression` responses.
- `DataFormat` (enum, optional) — Specifies how objects are encoded in the output
  - Allowed values: `Default`, `XML`, `JSON`, `JSF`
- `RequestId` (string, optional) — Optional value that can be used by clients to track multiple requests.
- `Culture` (string, optional) — Culture to use when handling the request. If not specified the default value configured on the server will be used.

## Response

### 200

Successful response

- `list` (object, optional)
  - `item` (list of object, optional)
    - `medcinId` (integer, optional)
    - `nodeKey` (string, optional)
    - `termType` (integer, optional)
    - `description` (string, optional)
    - `source` (string, optional)
  - `expression` (string, optional)
  - `keys` (list of string or string, optional)
  - `sourceId` (string, optional)
  - `count` (integer, optional)
  - `specialty` (string, optional)
  - `contentId` (string, optional)
  - `contentName` (string, optional)

## Examples

**Response**

```json
{
  "list": {
    "item": [
      {
        "medcinId": 1,
        "nodeKey": "string",
        "termType": 1,
        "description": "string",
        "source": "string"
      }
    ],
    "expression": "string",
    "keys": [
      "string"
    ],
    "sourceId": "string",
    "count": 1,
    "specialty": "string",
    "contentId": "string",
    "contentName": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://quippe.medicomp.com/api/Quippe/ClinicalLens/Prompt"

querystring = {"SourceId":"SourceId"}

response = requests.get(url, params=querystring, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://quippe.medicomp.com/api/Quippe/ClinicalLens/Prompt?SourceId=SourceId';
const credentials = btoa("<username>:<password>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://quippe.medicomp.com/api/Quippe/ClinicalLens/Prompt?SourceId=SourceId"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://quippe.medicomp.com/api/Quippe/ClinicalLens/Prompt?SourceId=SourceId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://quippe.medicomp.com/api/Quippe/ClinicalLens/Prompt?SourceId=SourceId")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://quippe.medicomp.com/api/Quippe/ClinicalLens/Prompt?SourceId=SourceId', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://quippe.medicomp.com/api/Quippe/ClinicalLens/Prompt?SourceId=SourceId");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://quippe.medicomp.com/api/Quippe/ClinicalLens/Prompt?SourceId=SourceId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```