Logo
Introduction
Shaip introduces its advanced NLP API, adept at deciphering unstructured Electronic Health Record (EHR) text. With Named Entity Recognition and Relationship Extraction models trained on vast EHR data, it guarantees precise insights. The user-friendly RESTful APIs simplify data extraction from EHR, identifying medical entities and their relationships. The engine, equipped with over 40 entity types, goes beyond simple keyword recognition, offering deep semantic analysis. It prioritizes data security and allows easy integration. This transformative tool not only converts raw EHR data into actionable insights but also paves the way for the future of healthcare NLP. Dive into the API documentation to unlock the full potential of your EHR data.
Authentication
The Clinical NER and Relationship API requires authentication using an API key to ensure secure access and prevent unauthorized usage. When making requests to the API, you must include the API key in the request headers. The x-api-key header should contain your unique API key, which will be provided to you upon registration and subscription to the API service.
Please ensure that you keep your API key confidential and do not share it in publicly accessible areas, such as client-side code, version control repositories, or public forums. The API key grants access to your account and holds the necessary privileges to interact with the PHI Entity Recognition API.
To authenticate your API requests, include the x-api-key header in each POST request as shown in the example curl request. This way, our server can verify your credentials and provide access to the PHI Entity Recognition service.
API Endpoint:
  • URL: https://haiapi.shaip.com/entity-relationship
  • Method: POST
  • Headers:
    Content-Type: "application/json"
    x-api-key: "wVxnqO9v773XDTxAnTadUa94v6eN1L4MWJDygVs1"
Ensure that you include the appropriate authentication details and headers with each API call to experience uninterrupted access to the Clinical NER API's powerful functionality. Our secure authentication process is designed to protect sensitive medical data and ensure that only authorized users can utilize this valuable service.
CURL
1curl -X POST "https://haiapi.shaip.com/entity-relationship" 
2
3     -H "Content-Type: application/json" 
4
5     -H "x-api-key: wVxnqO9v773XDTxAnTadUa94v6eN1L4MWJDygVs1" 
6
7     -d '{
8            "data": "{YOUR_UNSTRUCTURED_TEXT}"
9         }'
10
API Request
Request Parameter
To interact with the Clinical NER and Relationship API, you need to make a POST request to the designated endpoint. Please refer the structure of the API request along with the required fields:
data (String, Required): This field is mandatory and must contain the actual content string of the medical document that requires entity and relationship extraction from unstructured data.
For your convenience, you can employ the following CURL command to craft a well-structured HTTP request with the mandatory parameter:
Example Request Explanation:
In this example, we perform a POST request to the API endpoint https://haiapi.shaip.com/entity-relationship. The request is made with the necessary headers, including "Content-Type" as "application/json" and the "x-api-key" for authentication.
The request body contains a JSON object with the "data" field, which is essential for the API to extract entities and relationships from unstructured data. The value of the "data" field is the actual medical text that requires analysis and extraction. Please replace the sample data with the specific medical content you wish to process.
Ensure that you follow the proper API guidelines and provide valid JSON data within the "data" field to receive accurate unstructured data extraction results.
CURL
JAVA
Python
NodeJS
Ruby
PHP
GO
.NET(C#)
1curl -X POST "https://haiapi.shaip.com/entity-relationship" 
2
3     -H "Content-Type: application/json" 
4
5     -H "x-api-key: wVxnqO9v773XDTxAnTadUa94v6eN1L4MWJDygVs1" 
6
7     -d '{
8            "data": {
9                "content": "DIAGNOSIS:
101. Possible NSTEMI
112. Possible CHF
12
13DISCHARGE DIAGNOSIS:
141. Congestive heart failure
152. Hypertension, malignant
163. History of seizures
174. Diabetic neuropathy
185. Anxiety
196. Obstructive sleep apnea
20
21DISCHARGE MEDS:
22SAME AS NURSING HOME MEDS:
23Humulin 100 units q.d .
24Xanax 500 mg two q.h.s.
25Coreg 6.25 mg oral tablet q.d .
26Dilantin 100 mg capsule q.d . "
27            }
28         }'
29
API Response
Response Parameter
  • entities: A list of detected entities within the medical document.
      • entityType (Enum, Required): The type of the detected entity.
      • textSpans (List, Required): A list of text spans representing the content of the entity. Each text span has:
        • begin (Integer, Required): The calculated begin offset of the text span.
        • end (Integer, Required): The calculated end offset of the text span.
        • text (String, Required): The text of the text span.
      • certainty (Enum, Required): The certainty value of the detected entity. Possible values: POSITIVE, POSSIBLE_POSITIVE, NEGATIVE, POSSIBLE_NEGATIVE, UNCERTAIN, CONDITIONAL.
      • status (Enum, Required): The status value of the detected entity. Possible values: CURRENT, HISTORY, FAMILY_HISTORY, FUTURISTIC.
      • section_header (String, Required): The section header reference from the unstructured patient report. For example, 'DISCHARGE DIAGNOSIS', 'MEDICATIONS', 'PAST MEDICAL HISTORY'.
      • confidence (Double, Required): The confidence score indicating the level of certainty for detecting this entity with the given entity type. The score ranges from 0 to 1, where 1 represents the highest confidence.
  • relations: A list of detected relationships between entities within the medical document.
      • relationType (Enum, Required): The type of the detected relation.
      • head: Details of the head entity in the relation.
        • textSpans (List, Required): A list of text spans representing the content of the head entity. Each text span has:
          • begin (Integer, Required): The calculated begin offset of the text span.
          • end (Integer, Required): The calculated end offset of the text span.
          • text (String, Required): The text of the text span.
        • entityType (Enum, Required): The type of the head entity.
      • tail: Details of the tail entity in the relation.
        • textSpans (List, Required): A list of text spans representing the content of the tail entity. Each text span has:
          • begin (Integer, Required): The calculated begin offset of the text span.
          • end (Integer, Required): The calculated end offset of the text span.
          • text (String, Required): The text of the text span.
        • entityType (Enum, Required): The type of the tail entity.
    The well-organized response from the ICD10CM API ensures that healthcare applications can effortlessly access and utilize the recommended ICD-10-CM codes along with the corresponding evidence, enabling precise medical coding and enhanced patient data analysis.
    Response Parameter Values
    Entity Type Values
    We have a set of defined entities that are important for understanding the text. These are stand-alone entities like diseases, anatomies, procedures, medical devices, etc (described below). We have annotated a large number of clinical documents. We have used this annotated data to train our ML and DL models.
    Clinical Entities
  • Sign_Symptom Signs and symptoms are abnormalities that can indicate a potential Medical_Condition. Whereas a symptom is subjective, that is, apparent only to the patient (for example back pain or fatigue), a sign is any objective evidence of a disease that can be observed by others (for example a skin rash or lump).
    • Examples: Shortness of breath, pain, confusion, high blood pressure, high cholesterol, elevated liver function tests, etc.
  • Medical_Condition: A Medical_Condition is a broad term that includes all diseases, lesions, and disorders. While the term Medical_Condition generally includes mental illnesses, in some contexts the term is used specifically to denote any illness, injury, or disease except for mental illnesses.
    • Examples: Carcinoma, depression, anxiety, lesions, polyps, etc
  • Medical_State: A Medical_State is defined as a state in which the patient is present or generally it represents the patient's status. The below list provides gist of Medical_States this entity type includes:
    • Example: Pregnant / weeks of gestation, Gravida- Para Information, Menopause / Menstruation information, Artificial opening status
  • Diagnostic_Procedure: A Diagnostic_Procedure is an examination to identify an individual's specific areas of weakness and strength in order to determine a condition, disease or illness.
    • Example: It includes all types of radiology procedures like MRI scan, CAT scan, X- ray, EKG, ECG, etc
  • Therapeutic_Procedure: Therapeutic_Procedure is any medical or surgical procedure that is performed in order to repair, remove or otherwise heal any previously determined health concern.
    • Example: Common Therapeutic_Procedures include a broad spectrum of interventions from immunizations to chemotherapy/ radiation therapy, from surgeries to physical / occupational therapies.
  • Anatomical_Structure: A particular complex part of the living body is called Anatomical_Structure. The organs, cells, systems of the human body fall under this category.
    • Example: “Patient is suffering from lung cancer”
  • Drug: A drug or other preparation for the treatment or prevention of disease is called medicine. The generic and brand names of the medicinal drugs will come under this category.
    • Example: “The patient who had seen her primary care a couple of days ago, was taken off her lisinopril and digoxin.” She was transfused PRBCs as well due to low hemoglobin count.
  • Drug_Combo: This entity type has the purpose of capturing multiple anti-cancer drugs given as regimen/combination.
    • Example: “The patient was started on dose dense Adriamycin and Cytoxan (ddAC) as his first cycle of chemotherapy”.
  • Medical_device: Any instrument that is used for medical treatment, operation, and various medical purposes is called a Medical_device.
    • Example: “Reason for visit: Nasogastric tube removal.
  • Substance_Abuse: This entity type describes the abuse caused by a psychoactive substance that affects brain function and results in alterations in mood, consciousness, perception, cognition, or behavior.
    • Example: “The patient has a history of alcohol and cocaine use.
  • Laboratory_Data: A medical procedure that involves testing a sample of blood, urine, or other substance from the body. Laboratory tests can help determine a diagnosis, plan treatment, check to see if treatment is working, or monitor the disease over time.
    • Example: “White blood cell 3.0, hemoglobin 13.9, and lymphocytes 48.”
  • Body_Measurement: The normal measurement of the body that is obtained without performing a complex procedure or test falls in the category of Body_Measurements. Vital signs are considered under Body_Measurement. The values are obtained using some simple instruments such as thermometer for temperature, stethoscope for a pulse, etc.
    • Example: “Pulse: 80. BP: 110/70. Respirations: 16. Temp: 97.4”
  • Body_Function: All the general body functions carried out by the human body are identified as Body_Function.
    • Example: “Heart sounds, Bowel sounds, Reflex, Diastolic function, walking, urinating, peristalsis, hemostasis, etc”
  • Molecular_Subtype: Molecular subtyping refers to the use of -omics data to find clusters of tumors within a cancer type that have shared characteristics.
    • Example: HR+/HER2-, HER2+/HR-, BRAF+. ER+, PR+, ER-, PR-, etc
  • TNM (Tumors, Nodes, Metastasis): TNM is a system to describe the amount and spread of cancer in a patient’s body. T describes the size of the tumor and any spread of cancer into nearby tissue; N describes spread of cancer to nearby lymph nodes; and M describes metastasis (spread of cancer to other parts of the body). Sometimes it is not necessary that all 3 stages will be mentioned in the document as you can see in example 2 but we need to capture all or any mention of the TNM stage in the document.
    • Example: “The patient has T2 N1 M0 breast cancer”
    Modifiers
  • Laterality : This entity type denotes the location of a certain entity type. It can be in relationship with Anatomical_Structure, Sign_Symptom, Medical_State, Medical_Condition, procedure, Medical_device, Body_Function, Body_Measurement. Example of the words that denote laterality/location are left, right, bilateral, unilateral, anterior, posterior, upper, lower, etc
    • She has pain in her right hand. She also has left pneumothorax. She has a history of unilateral pneumonectomy.
  • Severity : This entity type denotes the severity of a problem. It can be in relationship with signs and symptoms, Medical_State, Medical_Condition. Example of the words that denote acute, chronic, acute on chronic, moderate, mild, moderate, severe, stage I,II,III, etc
    • She has chronic hypertension and has stage IB breast cancer.
  • Generic : This entity type denotes the modifiers which do not classify into the above two categories and it adds meaning to the entity type associated with it, which will fall under this category of modifiers.
    • The patient has a non-displaced fracture.
  • Compliance_Status : This category describes the Compliance_Status of the patient. There are times when the patient is not compliant to some medications, Medical_devices or any procedures. In this case, we need to tag the words which indicate non compliance.
    • The patient is non-compliant to his medications. The patient also does not adhere to the CPAP treatment.
    Drug Attributes
    here are many attributes linked to Medicine. It is important to identify all the attributes to capture the whole scenario. Below mentioned are the Attributes specific to Drug.
  • Strength_Med - The strength of the drug indicates the amount of active ingredient in each dosage. e.g. 50
  • Unit_Med - Strengths are usually quantified in units of measurements. e.g. mg
  • Dose_Med - A dose of a medicine or a drug is a measured amount of it which is intended to be taken at one time. It is the quantity of the medicine prescribed to be taken at one time. e.g. 2
  • Form_Med - Form of medicine indicates physical characteristics of a drug which contains the drug substance. e.g. tablets
  • Frequency_Med - The frequency of a drug refers to how often it is taken. e.g. "everyday"
  • Route_Med - A route of administration is the path by which the drug is taken on to the body. Route is generally classified by the location at which the drug is administered. e.g. orally
  • Duration_Med - The time till which the patient has to take the medication is known as duration of the drug. e.g. "The patient should take Aspirin 50 mg 2 tablets orally every day for 2 months".
  • Status_Med - The medication has different status like increased, decreased, start, stop, held, discontinue etc and such information should be captured under the label Status. It also includes the allergy status of a medication. e.g. “Aspirin was stopped.”
  • Release_Med - The drug has different drug release technology like extended release, enteric coated, delayed release, controlled delivery, controlled release etc. and such words should be marked under Drug release. e.g. “The patient is on aspirin extended release.”
  • TotalDose_Med - The total amount of tablets, capsules or vials etc ordered in a prescription which is a total dose recommended and prescribed for the patient is tagged as total dose. e.g. “The patient is on aspirin 20 mg 1 tablet everyday#60 tab.
  • Body Measurement Attributes
  • Value_BM (Body Measurement value) : The values of Body_Measurement fall under this category. This value cannot stand alone, it has to be related to Body_Measurement. Example: “Pulse: 80. BP: 110/70. Respirations: 16. Temp: 97.4”
  • Unit_BM ( Body Measurement unit) : The unit of the measurement value falls under this category. This value cannot stand alone, it has to be related to Body_Measurement. Example: “BP: 110/70 mmhg”
  • Result_BM (Body Measurement result) : The result of any Body_Measurement falls under this category. It may contain words like increased, decreased, positive, negative. Generally such words are modifiers which may depict the status of the Body_Measurement. Example: “BP is high.”
  • Body Function Attributes
  • Result_BF (Body Function result) : The status or result of any Body_Function falls under this category. It may contain words like increased, decreased, positive, negative. Example 1: “Diastolic function is normal.”
  • Value_BF (Body_Function value) : The values of Body_Function fall under this category. This value cannot stand alone, it has to be related to Body_Function. Example: “Reflex : 3+”
  • Lab Data Attributes
  • Value_Lab (Lab Value) : The values of Laboratory_Data fall under this category. This value cannot stand alone, it has to be related to Laboratory_Data. Example: “White blood cell 3.0, hemoglobin 13.9, and lymphocytes 48.”
  • Unit_Lab ( Lab Unit) : The unit of the laboratory value falls under this category. This value cannot stand alone, it has to be related to Laboratory_Data. Example: “White blood cell 3.0, hemoglobin 13.9 g/dl, and lymphocytes 48.”
  • Result_Lab (Lab Result) : The result of any Laboratory_Data falls under this category. It may contain words like increased, decreased, positive, negative. Any organism which is a result of culture or any other lab data performed should also be considered as a Lab result. Example 1: “Increased cholesterol level.”
  • Sample_Lab (Lab Sample) : A biological sample is the gathered matter of a patient's fluid, tissue, or any other material derived from the patient to carry out different laboratory analysis. Example: “Urine creatinine is 20 mg/dl.”
  • Method_Lab (Lab Method) : The method which is used to conduct a specific lab test is considered under method. Example: “WBC count by flow cytometry is 28,000.”
  • Time_Lab (Lab Time) : Some lab tests are ordered at different time intervals and hence if specific time is mentioned then, that time is considered in context to the lab component. Example: “12-hour glucose is 5.6 mmol/l.”
  • Diagnostic Procedure Attributes
  • Modality (views) : This entity type denotes the number of views associated with any radiological procedure. Words like 1 view, 2 views, 3 views, AP, lateral view, anterior posterior view, etc Example: “The patient underwent 1 V chest X-ray and AP abdominal X-ray.”
  • Contrast (with or without route) : This entity type denotes the type of contrast administered during the radiological procedure as well as captures the route of the contrast administration. It includes the actual construct names like “Omnipaque”, “Isovue”, “radioactive iodine”, etc. It also includes general mention of contrast information like with “contrast”, “without contrast”, “with and without contrast”, “W/CO”, “W/WO CO”, etc. Example 1: “CT chest with and without contrast. Abdomen/Pelvis CT W IV contrast.”
  • Maneuver : This entity type denotes the maneuver of the Diagnostic_Procedure. Words like supine, sitting, standing, resting, decubitus, stress, exercise, etc are examples of the same. Example: “Stress EKG was performed.”
  • Method_Procedure : If a method of a Diagnostic_Procedure is mentioned then it is marked as “Method_Procedure” and related with its respective procedure. Example: “The patient underwent antegrade pyelography.”
  • Result_Procedure : The result of the procedure can be abnormal, normal, inconclusive. Example: “CT scan of the abdomen of the patient is abnormal.”
  • Therapeutic Procedure Attributes
  • Result_Procedure : The result of the procedure can be abnormal, normal, inconclusive. Example: “ The patient underwent cholecystectomy and it was normal.”
  • Method_Procedure : If a method of a Therapeutic_Procedure is mentioned then it is marked as “Method_Procedure” and related with its respective procedure. Example: “The patient underwent laparoscopic hysterectomy.”
  • Relation Type Values
    There are multiple relationships possible between the primary NER entity types. Below is the list of possible relationships between different categories:
  • Entity to Entity Relationships
    • Sign & Symptom to Anatomical_Structure (has_Anatomy)
    • Medical_Condition to Anatomical_Structure (has_Anatomy)
    • Medical_State to Anatomical_Structure (has_Anatomy)
    • Therapeutic_Procedure to Anatomical_Structure (has_Anatomy)
    • Diagnostic_Procedure to Anatomical_Structure (has_Anatomy)
    • Medical_device to Anatomical_Structure (has_Anatomy)
    • Body_Measurement to Anatomical_Structure (has_Anatomy)
    • Body_Function to Anatomical_Structure (has_Anatomy)
    • Therapeutic_Procedure to Medical_device (has_Use)
    • Diagnostic_Procedure to Medical_device (has_Use)
    • Diagnostic_Procedure to Medical_Condition/Sign_Symptom/Medical_State (has_Result)
    • Drug to Medical_Condition/Sign_Symptom (has_Adverse_Effect)
    • Drug_Combo to Medical_Condition/Sign_Symptom (has_Adverse_Effect)
    • Therapeutic_Procedure to Sign_Symptom/Medical_Condition (has_Adverse_Effect)
    • Diagnostic_Procedure to Sign_Symptom/Medical_Condition (has_Adverse_Effect)
    • Medical_Condition/Sign_Symptom to Drug (has_Treatment)
    • Medical_Condition/Sign_Symptom to Drug_Combo (has_Treatment)
    • Medical_Condition/Sign_Symptom to Therapeutic_Procedure (has_Treatment)
    • Therapeutic_Procedure to Diagnostic_Procedure (Has Guidance)
  • Entity to Modifier Relationships
    • Anatomical_Structure to Laterality (has_Location)
    • Sign_Symptom to Laterality (has_Location)
    • Medical_Condition to Laterality (has_Location)
    • Medical_State to Laterality (has_Location)
    • Diagnostic_Procedure to Laterality (has_Location)
    • Therapeutic_Procedure to Laterality (has_Location)
    • Medical_Device to Laterality (has_Location)
    • Body_Measurement to Laterality (has_Location)
    • Body_Function to Laterality (has_Location)
    • Sign_Symptom to Severity (has_Severity)
    • Medical_Condition/Medical_State to Severity (has_Severity)
    • Substance_Abuse to Severity (has_Severity)
    • Medical_Device to Compliance_Status (has_Compliance)
    • Drug/Drug_Combo to Compliance_Status (has_Compliance)
    • Therapeutic_Procedure/Diagnostic_Procedure to Compliance_Status (has_Compliance)
    • Anatomical_Structure to Generic (has_Modifier)
    • Sign_Symptom to Generic (has_Modifier)
    • Medical_Condition/Medical_State to Generic (has_Modifier)
    • Substance_abuse to Generic (has_Modifier)
    • Medical_Device to Generic (has_Modifier)
    • Body_Function to Generic (has_Modifier)
    • Body_Measurement to Generic (has_Modifier)
    • Drug/Drug_Combo to Generic (has_Modifier)
    • Laboratory_Data to Generic (has_Modifier)
  • Entity to Attributes Relationships
    • Medicine to Medicine Attributes (has_Med_Attribute)
    • Body_Measurement to Body_Measurement Attributes (has_BM_Attribute)
    • Laboratory_Data to Laboratory_Data Attributes (has_Lab_Attribute)
    • Body_Function to Body_Function Attributes (has_BF_Attribute)
    • Diagnostic_Procedure to Diagnostic_Procedure (DP) Attributes (has_DP_Attribute)
    • Therapeutic_Procedure to Therapeutic_Procedure (TP) Attributes (has_TP_Attribute)
    Negation and Status Values
    In the medical domain a patient's medical history is provided in the medical document and it’s a current medical condition and also contains some information about what “patient doesn’t have” or what “patient denies”. To support it, we have a Status and Negation module that we have defined sentence with the scope of each negation type as well as maintained our own database and that works on keyword-based to identify status and certainty of entities (Problems, Procedures...etc)
    There are various Negation and Status are defined by us that are mentioned below:
    Negation DetectorStatus Detector
    NegativeCurrent
    Possible NegativeHistory
    Possible PositiveFamily history
    PositiveFuturistic
    Uncertain
    Conditional
    Negation Value
  • Possible Positive: A possible positive certainty indicates the entities are present but are not accurate and valid. For e.g.: The wound of the patient appears to be granulating. In this example, the word “appears to be” indicates that “granulating” is possibly positive as it is not confirmed in the evidence.
  • Negative: A negative certainty indicates the entities are not present. For e.g.: The patient does not have vomiting and nausea. In this example evidences “vomiting” and “nausea” are negative and not present in the patient.
  • Possible Negative: A possible negative certainty indicates the entities are not totally absent but are present insignificantly. For e.g.: The concern for Ludwig’s angina is unlikely. In this example “Ludwig’s angina” is a possible negative entity which means it is more probable that Ludwig’s angina is not present.
  • Uncertain: Uncertainty indicates the state of doubt to determine. It is the situation in which something is not known or not certain. For e.g.: The doctor was unable to determine the cause of the swelling. In this example “unable to determine” indicates uncertainty of “the cause of swelling”.
  • Conditional: Conditional indicates hypothetical situations and their consequences. For 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” indicates that pain etc. are conditional entities.
  • Positive: If an entity has not been classified for any above category then it will be tagged as Positive.
  • Status Value
  • Current: Current status defines the present time. It includes the things happening, being used or done now. For e.g.: The patient is suffering from hypertension and diabetes mellitus. This example indicates “hypertension” and “diabetes mellitus” are present in the patient currently.
  • History: History describes the personal history of the patient. It includes the diseases, procedures, etc. which he had in the past. For e.g.: The patient has a history of right arm fracture. This example indicates that the patient suffered from “right arm fracture” in the past.
  • Family History: Family history provides information about all the diseases and illness within the family of the patient. For 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. For 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  "requestId": 270,
    3  "entities": [
    4    {
    5      "id": 1,
    6      "entityType": "MEDICAL_CONDITION",
    7      "textSpans": [
    8        {
    9          "text": "NSTEMI",
    10          "begin": 23,
    11          "end": 29
    12        }
    13      ],
    14      "certainty": "POSSIBLE_POSITIVE",
    15      "confidence": 0.9897,
    16      "section": "DIAGNOSIS",
    17      "status": "CURRENT",
    18      "root": true
    19    },
    20    {
    21      "id": 2,
    22      "entityType": "MEDICAL_CONDITION",
    23      "textSpans": [
    24        {
    25          "text": "CHF",
    26          "begin": 42,
    27          "end": 45
    28        }
    29      ],
    30      "certainty": "POSSIBLE_POSITIVE",
    31      "confidence": 0.9955,
    32      "section": "DIAGNOSIS",
    33      "status": "CURRENT",
    34      "root": true
    35    },
    36    {
    37      "id": 3,
    38      "entityType": "MEDICAL_CONDITION",
    39      "textSpans": [
    40        {
    41          "text": "Congestive heart failure",
    42          "begin": 70,
    43          "end": 94
    44        }
    45      ],
    46      "certainty": "POSITIVE",
    47      "confidence": 0.9876,
    48      "section": "DISCHARGE DIAGNOSIS",
    49      "status": "CURRENT",
    50      "root": true
    51    },
    52    {
    53      "id": 4,
    54      "entityType": "MEDICAL_CONDITION",
    55      "textSpans": [
    56        {
    57          "text": "Hypertension",
    58          "begin": 98,
    59          "end": 110
    60        }
    61      ],
    62      "certainty": "POSITIVE",
    63      "confidence": 0.9525,
    64      "section": "DISCHARGE DIAGNOSIS",
    65      "status": "CURRENT",
    66      "root": true
    67    },
    68    {
    69      "id": 5,
    70      "entityType": "GENERIC",
    71      "textSpans": [
    72        {
    73          "text": "malignant",
    74          "begin": 112,
    75          "end": 121
    76        }
    77      ],
    78      "certainty": "POSITIVE",
    79      "confidence": 0.7233,
    80      "section": "DISCHARGE DIAGNOSIS",
    81      "status": "CURRENT",
    82      "root": false
    83    },
    84    {
    85      "id": 6,
    86      "entityType": "MEDICAL_CONDITION",
    87      "textSpans": [
    88        {
    89          "text": "seizures",
    90          "begin": 136,
    91          "end": 144
    92        }
    93      ],
    94      "certainty": "POSITIVE",
    95      "confidence": 0.9906,
    96      "section": "DISCHARGE DIAGNOSIS",
    97      "status": "HISTORY",
    98      "root": true
    99    },
    100    {
    101      "id": 7,
    102      "entityType": "MEDICAL_CONDITION",
    103      "textSpans": [
    104        {
    105          "text": "Diabetic neuropathy",
    106          "begin": 148,
    107          "end": 167
    108        }
    109      ],
    110      "certainty": "POSITIVE",
    111      "confidence": 0.9503,
    112      "section": "DISCHARGE DIAGNOSIS",
    113      "status": "CURRENT",
    114      "root": true
    115    },
    116    {
    117      "id": 8,
    118      "entityType": "MEDICAL_CONDITION",
    119      "textSpans": [
    120        {
    121          "text": "Anxiety",
    122          "begin": 171,
    123          "end": 178
    124        }
    125      ],
    126      "certainty": "POSITIVE",
    127      "confidence": 0.9851,
    128      "section": "DISCHARGE DIAGNOSIS",
    129      "status": "CURRENT",
    130      "root": true
    131    },
    132    {
    133      "id": 9,
    134      "entityType": "MEDICAL_CONDITION",
    135      "textSpans": [
    136        {
    137          "text": "Obstructive sleep apnea",
    138          "begin": 182,
    139          "end": 205
    140        }
    141      ],
    142      "certainty": "POSITIVE",
    143      "confidence": 0.9928,
    144      "section": "DISCHARGE DIAGNOSIS",
    145      "status": "CURRENT",
    146      "root": true
    147    },
    148    {
    149      "id": 10,
    150      "entityType": "DRUG",
    151      "textSpans": [
    152        {
    153          "text": "Humulin",
    154          "begin": 249,
    155          "end": 256
    156        }
    157      ],
    158      "certainty": "POSITIVE",
    159      "confidence": 0.9936,
    160      "section": "DISCHARGE MEDS",
    161      "status": "CURRENT",
    162      "root": true
    163    },
    164    {
    165      "id": 11,
    166      "entityType": "STRENGTH_MED",
    167      "textSpans": [
    168        {
    169          "text": "100",
    170          "begin": 257,
    171          "end": 260
    172        }
    173      ],
    174      "certainty": "POSITIVE",
    175      "confidence": 0.9962,
    176      "section": "DISCHARGE MEDS",
    177      "status": "CURRENT",
    178      "root": false
    179    },
    180    {
    181      "id": 12,
    182      "entityType": "UNIT_MED",
    183      "textSpans": [
    184        {
    185          "text": "units",
    186          "begin": 261,
    187          "end": 266
    188        }
    189      ],
    190      "certainty": "POSITIVE",
    191      "confidence": 0.9979,
    192      "section": "DISCHARGE MEDS",
    193      "status": "CURRENT",
    194      "root": false
    195    },
    196    {
    197      "id": 13,
    198      "entityType": "FREQUENCY_MED",
    199      "textSpans": [
    200        {
    201          "text": "q.d",
    202          "begin": 267,
    203          "end": 270
    204        }
    205      ],
    206      "certainty": "POSITIVE",
    207      "confidence": 0.8761,
    208      "section": "DISCHARGE MEDS",
    209      "status": "CURRENT",
    210      "root": false
    211    },
    212    {
    213      "id": 14,
    214      "entityType": "DRUG",
    215      "textSpans": [
    216        {
    217          "text": "Xanax",
    218          "begin": 273,
    219          "end": 278
    220        }
    221      ],
    222      "certainty": "POSITIVE",
    223      "confidence": 0.9934,
    224      "section": "DISCHARGE MEDS",
    225      "status": "CURRENT",
    226      "root": true
    227    },
    228    {
    229      "id": 15,
    230      "entityType": "STRENGTH_MED",
    231      "textSpans": [
    232        {
    233          "text": "500",
    234          "begin": 279,
    235          "end": 282
    236        }
    237      ],
    238      "certainty": "POSITIVE",
    239      "confidence": 0.9965,
    240      "section": "DISCHARGE MEDS",
    241      "status": "CURRENT",
    242      "root": false
    243    },
    244    {
    245      "id": 16,
    246      "entityType": "UNIT_MED",
    247      "textSpans": [
    248        {
    249          "text": "mg",
    250          "begin": 283,
    251          "end": 285
    252        }
    253      ],
    254      "certainty": "POSITIVE",
    255      "confidence": 0.9982,
    256      "section": "DISCHARGE MEDS",
    257      "status": "CURRENT",
    258      "root": false
    259    },
    260    {
    261      "id": 17,
    262      "entityType": "DOSE_MED",
    263      "textSpans": [
    264        {
    265          "text": "two",
    266          "begin": 286,
    267          "end": 289
    268        }
    269      ],
    270      "certainty": "POSITIVE",
    271      "confidence": 0.9821,
    272      "section": "DISCHARGE MEDS",
    273      "status": "CURRENT",
    274      "root": false
    275    },
    276    {
    277      "id": 18,
    278      "entityType": "FREQUENCY_MED",
    279      "textSpans": [
    280        {
    281          "text": "q.h.s.",
    282          "begin": 290,
    283          "end": 296
    284        }
    285      ],
    286      "certainty": "POSITIVE",
    287      "confidence": 0.8569,
    288      "section": "DISCHARGE MEDS",
    289      "status": "CURRENT",
    290      "root": false
    291    },
    292    {
    293      "id": 19,
    294      "entityType": "DRUG",
    295      "textSpans": [
    296        {
    297          "text": "Coreg",
    298          "begin": 297,
    299          "end": 302
    300        }
    301      ],
    302      "certainty": "POSITIVE",
    303      "confidence": 0.9912,
    304      "section": "DISCHARGE MEDS",
    305      "status": "CURRENT",
    306      "root": true
    307    },
    308    {
    309      "id": 20,
    310      "entityType": "STRENGTH_MED",
    311      "textSpans": [
    312        {
    313          "text": "6.25",
    314          "begin": 303,
    315          "end": 307
    316        }
    317      ],
    318      "certainty": "POSITIVE",
    319      "confidence": 0.9141,
    320      "section": "DISCHARGE MEDS",
    321      "status": "CURRENT",
    322      "root": false
    323    },
    324    {
    325      "id": 21,
    326      "entityType": "UNIT_MED",
    327      "textSpans": [
    328        {
    329          "text": "mg",
    330          "begin": 308,
    331          "end": 310
    332        }
    333      ],
    334      "certainty": "POSITIVE",
    335      "confidence": 0.9971,
    336      "section": "DISCHARGE MEDS",
    337      "status": "CURRENT",
    338      "root": false
    339    },
    340    {
    341      "id": 22,
    342      "entityType": "ROUTE_MED",
    343      "textSpans": [
    344        {
    345          "text": "oral",
    346          "begin": 311,
    347          "end": 315
    348        }
    349      ],
    350      "certainty": "POSITIVE",
    351      "confidence": 0.9925,
    352      "section": "DISCHARGE MEDS",
    353      "status": "CURRENT",
    354      "root": false
    355    },
    356    {
    357      "id": 23,
    358      "entityType": "FORM_MED",
    359      "textSpans": [
    360        {
    361          "text": "tablet",
    362          "begin": 316,
    363          "end": 322
    364        }
    365      ],
    366      "certainty": "POSITIVE",
    367      "confidence": 0.9925,
    368      "section": "DISCHARGE MEDS",
    369      "status": "CURRENT",
    370      "root": false
    371    },
    372    {
    373      "id": 24,
    374      "entityType": "FREQUENCY_MED",
    375      "textSpans": [
    376        {
    377          "text": "q.d",
    378          "begin": 323,
    379          "end": 326
    380        }
    381      ],
    382      "certainty": "POSITIVE",
    383      "confidence": 0.8976,
    384      "section": "DISCHARGE MEDS",
    385      "status": "CURRENT",
    386      "root": false
    387    },
    388    {
    389      "id": 25,
    390      "entityType": "DRUG",
    391      "textSpans": [
    392        {
    393          "text": "Dilantin",
    394          "begin": 329,
    395          "end": 337
    396        }
    397      ],
    398      "certainty": "POSITIVE",
    399      "confidence": 0.9933,
    400      "section": "DISCHARGE MEDS",
    401      "status": "CURRENT",
    402      "root": true
    403    },
    404    {
    405      "id": 26,
    406      "entityType": "STRENGTH_MED",
    407      "textSpans": [
    408        {
    409          "text": "100",
    410          "begin": 338,
    411          "end": 341
    412        }
    413      ],
    414      "certainty": "POSITIVE",
    415      "confidence": 0.9971,
    416      "section": "DISCHARGE MEDS",
    417      "status": "CURRENT",
    418      "root": false
    419    },
    420    {
    421      "id": 27,
    422      "entityType": "UNIT_MED",
    423      "textSpans": [
    424        {
    425          "text": "mg",
    426          "begin": 342,
    427          "end": 344
    428        }
    429      ],
    430      "certainty": "POSITIVE",
    431      "confidence": 0.9984,
    432      "section": "DISCHARGE MEDS",
    433      "status": "CURRENT",
    434      "root": false
    435    },
    436    {
    437      "id": 28,
    438      "entityType": "FORM_MED",
    439      "textSpans": [
    440        {
    441          "text": "capsule",
    442          "begin": 345,
    443          "end": 352
    444        }
    445      ],
    446      "certainty": "POSITIVE",
    447      "confidence": 0.9869,
    448      "section": "DISCHARGE MEDS",
    449      "status": "CURRENT",
    450      "root": false
    451    },
    452    {
    453      "id": 29,
    454      "entityType": "FREQUENCY_MED",
    455      "textSpans": [
    456        {
    457          "text": "q.d",
    458          "begin": 353,
    459          "end": 356
    460        }
    461      ],
    462      "certainty": "POSITIVE",
    463      "confidence": 0.8725,
    464      "section": "DISCHARGE MEDS",
    465      "status": "CURRENT",
    466      "root": false
    467    }
    468  ],
    469  "relationships": [
    470    {
    471      "id": 1,
    472      "entityIds": [],
    473      "section": "DIAGNOSIS"
    474    },
    475    {
    476      "id": 2,
    477      "entityIds": [],
    478      "section": "DIAGNOSIS"
    479    },
    480    {
    481      "id": 3,
    482      "entityIds": [],
    483      "section": "DISCHARGE DIAGNOSIS"
    484    },
    485    {
    486      "id": 4,
    487      "entityIds": [
    488        {
    489          "id": 5,
    490          "entityIds": []
    491        }
    492      ],
    493      "section": "DISCHARGE DIAGNOSIS"
    494    },
    495    {
    496      "id": 6,
    497      "entityIds": [],
    498      "section": "DISCHARGE DIAGNOSIS"
    499    },
    500    {
    501      "id": 7,
    502      "entityIds": [],
    503      "section": "DISCHARGE DIAGNOSIS"
    504    },
    505    {
    506      "id": 8,
    507      "entityIds": [],
    508      "section": "DISCHARGE DIAGNOSIS"
    509    },
    510    {
    511      "id": 9,
    512      "entityIds": [],
    513      "section": "DISCHARGE DIAGNOSIS"
    514    },
    515    {
    516      "id": 10,
    517      "entityIds": [
    518        {
    519          "id": 11,
    520          "entityIds": []
    521        },
    522        {
    523          "id": 12,
    524          "entityIds": []
    525        },
    526        {
    527          "id": 13,
    528          "entityIds": []
    529        }
    530      ],
    531      "section": "DISCHARGE MEDS"
    532    },
    533    {
    534      "id": 14,
    535      "entityIds": [
    536        {
    537          "id": 17,
    538          "entityIds": []
    539        },
    540        {
    541          "id": 18,
    542          "entityIds": []
    543        },
    544        {
    545          "id": 15,
    546          "entityIds": []
    547        },
    548        {
    549          "id": 16,
    550          "entityIds": []
    551        }
    552      ],
    553      "section": "DISCHARGE MEDS"
    554    },
    555    {
    556      "id": 19,
    557      "entityIds": [
    558        {
    559          "id": 20,
    560          "entityIds": []
    561        },
    562        {
    563          "id": 21,
    564          "entityIds": []
    565        },
    566        {
    567          "id": 22,
    568          "entityIds": []
    569        },
    570        {
    571          "id": 23,
    572          "entityIds": []
    573        },
    574        {
    575          "id": 24,
    576          "entityIds": []
    577        }
    578      ],
    579      "section": "DISCHARGE MEDS"
    580    },
    581    {
    582      "id": 25,
    583      "entityIds": [
    584        {
    585          "id": 26,
    586          "entityIds": []
    587        },
    588        {
    589          "id": 27,
    590          "entityIds": []
    591        },
    592        {
    593          "id": 28,
    594          "entityIds": []
    595        },
    596        {
    597          "id": 29,
    598          "entityIds": []
    599        }
    600      ],
    601      "section": "DISCHARGE MEDS"
    602    }
    603  ],
    604  "sections": [
    605    {
    606      "sectionId": 1,
    607      "name": "DIAGNOSIS",
    608      "begin": 0,
    609      "end": 10
    610    },
    611    {
    612      "sectionId": 2,
    613      "name": "DISCHARGE DIAGNOSIS",
    614      "begin": 46,
    615      "end": 66
    616    },
    617    {
    618      "sectionId": 3,
    619      "name": "DISCHARGE MEDS",
    620      "begin": 206,
    621      "end": 221
    622    }
    623  ]
    624}
    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 CodeHTTP StatusResponse Body
    400Bad Request{ "error": "The request was unacceptable, often due to missing a required parameter." }
    401Unauthorized{ "error": "No valid API key provided." }
    402Token Expired{ "error": "Token expired. Please contact administrator" }
    403Forbidden{ "error": "The API key doesn't have permissions to perform the request." }
    429Trial Quota Excceded{ "error": "Trial quota for API calls exceeded. Please upgrade your plan or try again later." }
    500Internal 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}