Introduction
Shaip presents its innovative "RxNorm API", designed to convert unstructured medication text into standardized RxNorm codes, a unified language for prescription details, ensuring smooth data exchange in healthcare. Utilizing cutting-edge NLP, the API provides precise RxNorm code recommendations matching the medication content. Key features include accurate code suggestions for consistent medication coding and easy REST API integration for broad compatibility with healthcare systems. With Shaip's RxNorm API, healthcare professionals gain a tool for efficient medication data management, fostering standardization and enhanced insights in the dynamic healthcare sector.
Authentication
The RxNorm API employs a secure authentication mechanism using API keys to ensure authorized access and protect sensitive prescription medication data. To make requests to the API, you must include your unique API key in the request headers. Upon registration and subscription to the API service, you will receive an API key that grants access to your account and provides the necessary privileges to interact with the RxNorm API.
To maintain the security of your API key, it is vital to keep it confidential and avoid sharing it in publicly accessible areas, such as client-side code, version control repositories, or public forums. Safeguarding your API key ensures that only authorized users can utilize the API and helps prevent unauthorized usage.
To authenticate your API requests, include the x-api-key header in each POST request, as demonstrated in the example curl request. By doing so, our server can verify your credentials and grant access to the powerful functionality of the RxNorm service.
API Endpoint:
- URL: https://haiapi.shaip.com/rxnorm
- Method: POST
- Headers:Content-Type: "application/json"
x-api-key:"wVxnqO9v773XDTxAnTadUa94v6eN1L4MWJDygVs1"
For uninterrupted access to the RxNorm API's capabilities, ensure that you include the appropriate authentication details and headers with each API call. Our secure authentication process is designed to protect sensitive medication data and ensure that only authorized users can leverage this valuable service effectively.
Remember to replace YOUR_API_KEY with your actual API key provided to you upon registration and subscription to the RxNorm API service. With this curl request and the correct authentication header, you can access the powerful functionality of the RxNorm API to convert unstructured medical text into accurate RxNorm codes and extract valuable clinical evidence from the medical documents.
"data": "PRESCRIPTION:
1. Medication: Aspirin 81mg
2. Sig: Take 1 tablet daily
3. Dispense: 30 tablets
PRESCRIPTION:
1. Medication: Atorvastatin 20mg
2. Sig: Take 1 tablet at bedtime
3. Dispense: 90 tablets"
CURL
1curl -X POST "https://haiapi.shaip.com/rxnorm"
2
3 -H "Content-Type: application/json"
4
5 -H "x-api-key: YOUR_API_KEY"
6
7 -d '{
8 "data": "{YOUR_UNSTRUCTURED_TEXT}"
9 }'
10
API Request
Request Parameter
To utilize Shaip's RxNorm API effectively, you need to create a properly structured HTTP request with the essential parameter:
content (String, Required): This critical field should contain the unstructured medical document's content in the form of a string. The content must accurately represent the patient's prescription or medication-related information. Ensure that the content is well-formatted and adheres to the API's guidelines to receive accurate RxNorm code recommendations.
To make an API request to the RxNorm service, you can use the following CURL command as a reference to craft your HTTP request with the necessary parameter.
In the code (mentioned in the code section), make sure to replace YOUR_API_KEY with your actual API key provided to you upon registration and subscription to the RxNorm API service. Additionally, replace the placeholder data in the "content" field with the actual unstructured medical document's content, accurately representing the patient's prescription or medication-related information. Format the content according to the API's guidelines to receive precise RxNorm code recommendations.
By submitting a well-structured HTTP request with the necessary parameters, you can leverage Shaip's RxNorm API to convert unstructured prescription data into accurate RxNorm codes, facilitating better medication management and enhancing the understanding of prescribed medications.
CURL
JAVA
Python
NodeJS
Ruby
PHP
GO
.NET(C#)
1curl -X POST "https://haiapi.shaip.com/rxnorm"
2
3 -H "Content-Type: application/json"
4
5 -H "x-api-key: wVxnqO9v773XDTxAnTadUa94v6eN1L4MWJDygVs1"
6
7 -d '{
8 "content": "DIAGNOSIS:
91. Possible NSTEMI
102. Possible CHF
11
12DISCHARGE DIAGNOSIS:
131. Congestive heart failure
142. Hypertension, malignant
153. History of seizures
164. Diabetic neuropathy
175. Anxiety
186. Obstructive sleep apnea
19
20DISCHARGE MEDS:
21SAME AS NURSING HOME MEDS:
22Humulin 100 units q.d .
23Xanax 500 mg two q.h.s.
24Coreg 6.25 mg oral tablet q.d .
25Dilantin 100 mg capsule q.d . "
26 }'
27
API Response
Response Parameter
The RxNorm Code Recommendation API provides a structured and comprehensive response to aid in the efficient integration of RxNorm codes into healthcare systems. The response consists of three main parameters - Code, Evidence, and TextSpan, each containing essential details as follows:
- Code
- codingSystem (Enum, Required): This field indicates the coding system from which the RxNorm code is derived. For this API, the value will always be "RxNorm."
- value (String, Required): This field contains the actual value of the RxNorm code, such as "24590-2" representing a specific drug.
- evidence (List<Evidence>, Optional): This field contains a list of evidence (if available) that supports the recommended RxNorm code. Each element in the list corresponds to a piece of evidence contributing to the code recommendation
- textSpan (TextSpan, Required): This field represents the content of the entity that serves as evidence for the recommended RxNorm code. It refers to the specific portion of the medical document where the evidence is extracted.
- beginOffset (Integer, Required): This field contains the calculated beginning offset of the textSpan content within the original medical document. The offset refers to the character position where the textSpan starts.
- ext (String, Required): This field contains the actual content of the textSpan. It represents the extracted text that serves as evidence for the RxNorm code recommendation
- certainty (Enum, Required): This field contains the certainty value of the detected entity from the following list: [List of Certainty Values]. The certainty value indicates the level of confidence in the entity's presence or accuracy.
- section (TextSpan, Required): This field contains the text span describing the section from where the evidence has been detected. It helps identify the context of the evidence within the medical document.
Response Parameter Values
Coding System Values
- RxNorm : RxNorm is a standardized terminology system developed by the National Library of Medicine (NLM) that assigns unique codes to medications and drug-related concepts, facilitating the exchange of drug information and enabling accurate medication-related data sharing and interoperability in healthcare systems.
Certainty Values
- POSITIVE - A positive certainty indicates the entities are confirmed and present positively in the patient’s record. e.g. The patient has hypertension and is on diuretics. In this example "hypertension" is positive and the patient is taking "diuretics" which also indicates that it is positive.
- POSSIBLE_POSITIVE - A possible positive certainty indicates the entities are present but are not accurate and valid. e.g. The wound of the patient appears to be granulating. In this example the word "appears to be" is possibly positive as it is not confirmed evidence.
- NEGATIVE - A negative certainty indicates the entities are not present. e.g. The patient does not have vomiting and nausea. In this example evidence "vomiting" and "nausea" are not present in the patient.
- POSSIBLE_NEGATIVE - A possible negative certainty indicates the entities are not totally absent but are present insignificantly. e.g. The patient’s wound abscess was resolving. In this example "resolving" is a possible negative word which means wound abscess is not treated completely and hence cannot be marked as negative.
- UNCERTAIN - Uncertainty indicates the state of doubt to determine. It is the situation in which something is not known or not certain. e.g. The doctor was unable to determine the cause of the swelling. In this example "unable to determine" indicates uncertainty.
- CONDITIONAL - Conditional indicates hypothetical situations and their consequences. e.g. The doctor said that the patient should also come back if he develops pain, fever, nausea, vomiting, or any other concerning symptoms. In this example "if he develops" is conditional.
- FAMILY_HISTORY - Family history provides the information of all the diseases and illnesses within the family of the patient. e.g. The patient has a family history of hypertension. This example shows that "hypertension" was present in his family.
- FUTURISTIC - It indicates the events that will happen after the present time. E.g. The doctor said that he will check the wound after 5 days. In this example "will check" indicates the future status.
JSON
1{
2 "codes": [
3 {
4 "codingSystem": "RXNORM",
5 "evidence": [
6 {
7 "section": 3,
8 "textSpan": {
9 "beginOffset": 249,
10 "end": 256,
11 "text": "Humulin"
12 }
13 }
14 ],
15 "value": "5459"
16 },
17 {
18 "codingSystem": "RXNORM",
19 "evidence": [
20 {
21 "section": 3,
22 "textSpan": {
23 "beginOffset": 273,
24 "end": 278,
25 "text": "Xanax"
26 }
27 }
28 ],
29 "value": "202363"
30 },
31 {
32 "codingSystem": "RXNORM",
33 "evidence": [
34 {
35 "section": 3,
36 "textSpan": {
37 "beginOffset": 329,
38 "end": 337,
39 "text": "Dilantin"
40 }
41 },
42 {
43 "section": 3,
44 "textSpan": {
45 "beginOffset": 345,
46 "end": 352,
47 "text": "capsule"
48 }
49 }
50 ],
51 "value": "855859"
52 },
53 {
54 "codingSystem": "RXNORM",
55 "evidence": [
56 {
57 "section": 3,
58 "textSpan": {
59 "beginOffset": 329,
60 "end": 337,
61 "text": "Dilantin"
62 }
63 },
64 {
65 "section": 3,
66 "textSpan": {
67 "beginOffset": 345,
68 "end": 352,
69 "text": "capsule"
70 }
71 }
72 ],
73 "value": "855859"
74 },
75 {
76 "codingSystem": "RXNORM",
77 "evidence": [
78 {
79 "section": 3,
80 "textSpan": {
81 "beginOffset": 297,
82 "end": 302,
83 "text": "Coreg"
84 }
85 },
86 {
87 "section": 3,
88 "textSpan": {
89 "beginOffset": 316,
90 "end": 322,
91 "text": "tablet"
92 }
93 }
94 ],
95 "value": "212390"
96 },
97 {
98 "codingSystem": "RXNORM",
99 "evidence": [
100 {
101 "section": 3,
102 "textSpan": {
103 "beginOffset": 297,
104 "end": 302,
105 "text": "Coreg"
106 }
107 },
108 {
109 "section": 3,
110 "textSpan": {
111 "beginOffset": 316,
112 "end": 322,
113 "text": "tablet"
114 }
115 }
116 ],
117 "value": "212390"
118 }
119 ],
120 "requestId": 265,
121 "TimeTaken": "0.026597023010253906",
122 "status": "SUCCESS"
123}
Error
When interacting with the Shaip API, you may encounter specific error codes, along with standard HTTP response statuses and corresponding error messages in the response body. Below is a table summarizing the possible error codes, along with their respective HTTP status and updated response body:
Response Code | HTTP Status | Response Body |
400 | Bad Request | { "error": "The request was unacceptable, often due to missing a required parameter." } |
401 | Unauthorized | { "error": "No valid API key provided." } |
402 | Token Expired | { "error": "Token expired. Please contact administrator" } |
403 | Forbidden | { "error": "The API key doesn't have permissions to perform the request." } |
429 | Trial Quota Excceded | { "error": "Trial quota for API calls exceeded. Please upgrade your plan or try again later." } |
500 | Internal Server Error | { "error": "Something went wrong on the server's end. Please try again later." } |
400
401
402
403
429
500
1{
2 "error": "The request was unacceptable, often due to missing a required parameter."
3}