Get recommendations
pgx_get_recommendationsBrowse CPIC recommendations in drug mode with one exact drugName or drugId. Match across drugs in results mode with geneResults or geneSymbol plus phenotype/activityScore, or genotype mode with 1–10 uniquely resolved gene/diplotype entries. Both matching modes accept an optional drug. Optional view=test_alerts selects complete example CDS alerts instead of recommendations, without joins; default view=recommendations. Alert records retain ordered alerttext, No CDS and n/a. Use pgx_list_reference topic phenotypes for source values. Every matched prerequisite must be explicit; omitted genes are never normal, negative or No Result. Preserve populations, scores, classifications and source text. Follow page.nextOffset and incompletePage.nextOffset independently for the selected collection and missing-gene diagnostics; consult source guidelines before clinical use.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | drug requires one drugName or drugId; genotype requires genotype; results requires geneResults or geneSymbol with phenotype/activityScore. Genotype/results optionally accept one drug selector. | |
| view | No | Select source recommendations (default) or example CDS test alerts with the same selectors and independent paging. | |
| limit | No | Positive safe-integer recommendation limit; values above 50 are clamped to 50 with a notice (default 10). | |
| drugId | No | Exact drugId returned by pgx_search_pairs; blank means unset. | |
| offset | No | Zero-based offset; use nextOffset to continue (default 0). | |
| drugName | No | Exact case-insensitive drug name; obtain names with pgx_search_pairs. Blank means unset. | |
| genotype | No | Required in genotype mode: 1–10 explicit gene/diplotype entries. Every entry must resolve uniquely before lookup. | |
| phenotype | No | Source phenotype for geneSymbol; inspect pgx_list_reference topic phenotypes. Excludes activityScore and geneResults. | |
| geneSymbol | No | Gene for a scalar result or exploratory gene filter. Required for a scalar result when the drug has multiple genes. | |
| population | No | Exact source population after outer whitespace trimming; all matching rows are retained. | |
| geneResults | No | Explicit results for 1–10 genes; excludes scalar geneSymbol, phenotype, activityScore and genotype. | |
| activityScore | No | Source activity score for geneSymbol; excludes phenotype and geneResults. | |
| incompleteLimit | No | Positive safe-integer incomplete diagnostic limit; values above 100 are clamped to 100 with a notice (default 25). | |
| incompleteOffset | No | Independent zero-based incomplete diagnostic offset; follow incompletePage.nextOffset. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | Effective public page limit. | |
| page | No | Source pagination metadata. | |
| error | No | Present when the call failed. Absent on success. | |
| items | No | Complete source records; matched rows have every required gene result explicitly supplied. | |
| shown | No | Number of returned rows, equal to page.returned. | |
| alerts | No | Complete source alerts in test_alerts view only; recommendation items remain empty. | |
| status | No | Exploratory browsing, complete genetic match, no match, missing prerequisites, or unresolved genotype. | |
| notices | No | Notices about this result; empty when none apply. | |
| truncated | No | Whether more matching rows remain after this page. | |
| provenance | No | Live source attribution and retrieval details. | |
| clinicalCaveat | No | Source limitations and required clinical qualification. | |
| effectiveQuery | No | Normalized selectors and effective page defaults. | |
| incompletePage | No | Independent page of incomplete prerequisite diagnostics; totals computed before either page. | |
| geneResolutions | No | Per-gene genotype diagnostics, including ambiguity and source records. | |
| incompleteAlerts | No | Independently paged incomplete alerts in test_alerts view only. | |
| incompleteMatches | No | Reference possibilities requiring additional results; never matched prescribing advice. |