Section 2.5: Terminology Services and API Integrations
A look at the future of terminology management. We examine how modern systems use APIs to “call out” to centralized terminology services, ensuring they always have the most up-to-date codes and definitions.
Terminology Services and API Integrations
Connecting to the Cloud for Smarter, Safer Data.
2.5.1 The “Why”: The Problem of Stale Knowledge
Throughout this module, we have built a powerful case for standardized, structured data. We’ve seen how mapping a local formulary to RxNorm and building ontologies can create intelligent, safe systems. But we have, until now, ignored a fundamental and dangerous reality: clinical knowledge is not static. The world of medicine is in a constant state of flux. New drugs are approved by the FDA every month. New black box warnings are issued. New clinical guidelines are published. New strains of bacteria develop resistance, changing antibiograms. The “truth” of today can become the dangerous misinformation of tomorrow.
This presents a massive challenge for health systems. In the traditional model of health IT, a hospital’s terminologies and knowledge bases (like its drug database or allergy-checking logic) are maintained as local, static files. The hospital licenses a large data file from a vendor, loads it onto its own servers, and that file becomes the “source of truth” for the entire institution. But the moment that file is loaded, it begins to decay. It starts to go stale. The process of getting an updated file, testing it, and deploying it across a complex hospital network can take months. In that time, a new life-saving drug might be missing from the system, or a critical new drug interaction might not be flagged.
Terminology services and APIs solve the problem of stale knowledge. They represent a fundamental architectural shift from a model of “owning the data” to one of “accessing the data.” Instead of maintaining a massive, constantly aging encyclopedia in its own basement, the hospital’s EHR can now use the internet to “call out” to a centralized, constantly updated, expertly managed library for the specific piece of information it needs, right at the moment it needs it. This ensures that the information guiding clinical care is always the most current, complete, and accurate version available. This move from local files to live, on-demand data services is one of the most significant trends in modern health informatics, transforming the role of the informaticist from a data manager to a systems integrator.
Retail Pharmacist Analogy: Printed Drug Reference vs. Online Database
Think back to the reference materials you’ve used throughout your career. In the past, the gold standard might have been a massive, hardbound copy of a book like Drug Facts and Comparisons. Once a year, you’d get a new edition. This book is a local, static knowledge base.
What are its limitations?
- It’s Instantly Outdated: The day it’s printed, it’s already missing the latest FDA approvals and warnings. By the time it’s six months old, it’s a potential liability.
- Massive Maintenance Burden: You have to find space for it, manually insert update pages, and ensure the whole pharmacy team knows which edition is the current one.
- Limited Functionality: You can only look things up by index. You can’t search for “all drugs that cause QTc prolongation” or “all third-generation cephalosporins.”
Now, consider the modern online drug database you use every day (e.g., Lexicomp, Micromedex, Clinical Pharmacology). This is a terminology and knowledge service accessed via an API. You don’t have the data on your computer; your computer simply has a connection to it.
- Always Current: The vendor’s team of pharmacists and clinicians updates the database in near real-time. When a new black box warning is issued, it’s in the system within hours, not months. You are always accessing the single, most current source of truth.
- Zero Local Maintenance: You don’t have to install, update, or manage any data files. You just need an internet connection.
- Powerful Functionality: You can perform complex queries, use interaction checkers, and access sophisticated tools that are powered by the structured data in the cloud.
The shift from a local EHR drug file to a cloud-based terminology service is the exact same evolution. It’s about trading the liability of maintaining a stale, local copy for the power and safety of accessing a live, expertly curated, central source of knowledge.
2.5.2 What is an API? The Waiter in the Restaurant
The term “API” (Application Programming Interface) can sound intimidatingly technical, but the concept is remarkably simple. An API is just a set of rules and protocols that allows one piece of software to request services or information from another piece of software. It’s the “middleman” that handles the communication.
The most common analogy is that of a restaurant. Think of the different parts of the system:
- You (The Client Application): You are the program that needs information. For example, the EHR needs to know the drug class of atorvastatin.
- The Kitchen (The Server / Terminology Service): This is the powerful system that holds all the data and the logic. It’s the RxNorm database, with its ontology and relationships.
- The Waiter (The API): You, the customer, do not go into the kitchen. You have a well-defined way to communicate with it: you talk to the waiter. The waiter takes your order (your request), brings it to the kitchen, and returns with your food (the response). The waiter is the interface between you and the complex system in the back.
The Language of APIs: Requests and Responses
This “conversation” between the client and the server happens in a structured format. While there are many types of APIs, most modern web-based services use a style called REST (Representational State Transfer), which uses the same basic language as your web browser.
The Request
The client application sends a request to a specific URL, known as an endpoint. The request includes:
- The Method: The most common is
GET, which is used to retrieve data. - The Endpoint: The address of the resource you want.
- Parameters: The specific information you’re looking for, included in the URL.
GET https://rxnav.nlm.nih.gov/REST/rxcui?name=Lipitor
The Response
The server processes the request and sends back a response, usually in a format called JSON (JavaScript Object Notation). JSON is lightweight, human-readable, and easy for computers to parse.
{
"idGroup": {
"name": "Lipitor",
"rxnormId": [
"153165"
]
}
}
In this simple exchange, our EHR didn’t need to know anything about the NLM’s servers or databases. It just needed to know the correct “waiter” to talk to (the API endpoint) and how to phrase its order (the request parameters). It received a perfectly structured, predictable response that it can now use in its own logic.
2.5.3 The NLM’s RxNav API: A Pharmacist’s Best Friend
The single most important and powerful terminology service for pharmacy informatics is the one provided for free by the U.S. National Library of Medicine (NLM). The RxNav suite of APIs provides live, programmatic access to the entire RxNorm database. It is the gold standard and the foundation upon which countless commercial and hospital-built systems are based. As an aspiring informaticist, becoming familiar with its capabilities is not optional; it is a core competency.
Masterclass Table: Essential RxNav API Functions
Below are some of the most common tasks a pharmacy informatics system needs to perform and the RxNav API function that accomplishes it. This is your playbook for leveraging real-time drug data.
| Clinical Task | RxNav API Function | Example API Request | Why It’s Important |
|---|---|---|---|
| Find the RxCUI for a drug name | GET /rxcui |
/REST/rxcui?name=atorvastatin+20+mg |
This is the most basic function: converting a “string” into a standard “code.” It’s the first step in semantic normalization for any medication-related workflow. |
| Get properties of a concept | GET /rxcui/{rxcui}/properties |
/REST/rxcui/259255/properties |
Once you have an RxCUI, this function acts like a mini drug database, returning the name, TTY (e.g., SCD), and synonyms for that concept. |
| Find related concepts | GET /rxcui/{rxcui}/related |
/REST/rxcui/259256/related?tty=SCD |
Extremely powerful. This allows you to navigate the ontology. The example shows how to take the RxCUI for a branded drug (Lipitor 20mg) and find its corresponding generic clinical drug (the SCD). This is essential for building brand/generic interchange logic. |
| Get members of a drug class | GET /rxclass/class/byRxcui |
/REST/rxclass/class/byRxcui?rxcui=259255&relasource=ATC&rel=has_member |
This allows you to find the drug class for a given drug (e.g., find that atorvastatin is in the “STATINS” class). This is the foundation of class-based CDS rules. |
| Check for drug interactions | GET /interaction/list |
/REST/interaction/list?rxcuis=207106+152923(Warfarin + Amiodarone) |
Provides access to a high-quality drug-drug interaction knowledge base. An EHR can send a list of a patient’s active medication RxCUIs and get back a structured list of potential interactions. |
2.5.4 A Modern Architecture: The Hybrid Model
While the idea of calling an external API for every single medication task is appealing, in the real world of high-volume hospital operations, it can be impractical. What if the internet connection goes down? The entire hospital pharmacy system would grind to a halt. What about the speed (latency) of making millions of API calls a day over the public internet? For these reasons, most modern health systems don’t use a purely external model. Instead, they use a sophisticated hybrid model that combines the best of both worlds.
The Role of the Local Terminology Server
In a hybrid model, the hospital maintains a special server inside its own network called a Terminology Server (or sometimes a “HealthShare” server or “Knowledge Management” platform).
Here’s how it works:
- Nightly Synchronization: This local server has a scheduled, automated job that runs every night. Its task is to “call out” to the master terminology services (like the NLM’s FTP site) and download the very latest version of the entire RxNorm, SNOMED, and LOINC databases. It pulls down the daily or weekly updates and incorporates them into its own local copy.
- Local API Hub: The terminology server then exposes its own set of internal APIs to the rest of the hospital’s applications (the EHR, the billing system, the research data warehouse). These internal APIs are identical in function to the public RxNav APIs.
- Fast, Reliable, and Current: When the EHR needs to look up a drug class, it makes a super-fast, reliable call across the local hospital network to the terminology server. It gets its answer in milliseconds. Because that server updated itself last night, the data it provides is never more than 24 hours out of date—a massive improvement over the months-long update cycle of the old, manual file-based approach.
This hybrid model provides the speed and reliability of a local database with the currency and comprehensiveness of a centralized service. Managing this local terminology server—ensuring its update jobs run correctly, monitoring its performance, and helping other teams integrate with its APIs—is a key responsibility of the pharmacy informatics team.
2.5.5 The Informatics Angle: From Data Janitor to Systems Integrator
The rise of terminology services and APIs fundamentally changes the day-to-day work and the strategic value of the pharmacy informaticist. The job is no longer primarily about the painful, manual “care and feeding” of static data files. The focus shifts to higher-level, more impactful work.
The Evolving Role of the Pharmacy Informaticist
This table illustrates the profound shift in responsibilities enabled by this new architectural model. You are moving from reactive data maintenance to proactive systems design.
| Task | The “Old Way” (Local Static Files) | The “New Way” (Terminology Services & APIs) |
|---|---|---|
| Updating the Drug Database | Manually download massive vendor files. Run complex import scripts. Spend weeks in a test environment validating the file before deploying. A major, high-risk project done 2-4 times a year. | Monitor the automated nightly sync from the NLM to the local terminology server. The process is continuous, automated, and requires oversight, not manual labor. |
| Building a New CDS Alert | Manually create and maintain a value set (a list of drugs) for the alert. If a new drug in that class comes out, the rule is blind to it until someone remembers to update the list. | Build the rule to query the terminology server’s API in real-time: “Is this drug a member of the ‘Statin’ class?” The rule is now dynamic and “future-proofed” against new drugs. |
| Handling a Formulary Change | A P&T decision requires weeks of IT work to update local files, order sets, and alerts to reflect the change. | The P&T decision is implemented by updating the local formulary map and a few key value sets on the terminology server. The changes propagate automatically to all connected systems that use the APIs. |
| Core Skillset | Data validation, file manipulation, manual quality assurance, project management for large, infrequent updates. | API integration, data modeling, systems thinking, designing workflows, vendor management, and understanding the principles of real-time data exchange. |
In this new world, your value is not in your ability to manually manage a list. Your value is in your ability to understand both the clinical need and the technical capability of these powerful services. You are the architect who designs the bridges between the EHR and these central sources of knowledge, ensuring that every clinical decision is supported by the best, most current information science can provide. This is the future of pharmacy informatics, and it is a role of immense strategic importance in the modern health system.