{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"955b9476-b925-427d-ab32-dc2ae6d8a23d","name":"Lexigram Clinical NLP APIs","description":"<b>Welcome to the Lexigram documentation site</b>. Below you'll find our API documentation and a few interactive components that allow you to play directly with our data endpoints (no code required) before obtaining your very own API Key and unleashing the power of Lexigram on your data! Please direct any questions or requests to <a>support@lexigram.io</a>.\n\n# Quick Start\n\nBelow you'll find our API documentation and a few interactive components that allow you to interact directly with our data endpoints (no code required). To try it out, get an API key from the Get Access link in the menu. Please direct any questions or requests to [support@lexigram.io](mailto:support@lexigram.io).\n\n*   Get your [API Key](https://app.lexigram.io).\n*   Try out our [UI Demo Playground](http://demo.lexigram.io).\n*   Check out our [example code](https://github.com/lexigram/example-code).\n*   Are you a Postman user? We have a [Collection](#postman-collection) available.\n\n## Authentication\n\nYou can use your API Key (an encrypted JWT), available from https://app.lexigram.io, to obtain an expiring token that can be used to authenticate your user with the API.\n\nTo obtain the token, make an empty `GET` request to the `/auth/token` using the `Authorization` header with a value that is set to `Bearer {your_api_key}`. In the response, the expiring token will be in the `token` property. You can then use that in the `Authorization` header until it expires and you have to request another token.\n\n# Concept Classification\n\nThe matched concepts returned by the extraction endpoints are grouped according to the following main types:\n\n- Disease\n- Mental Health\n- Drug\n- Procedure\n- Anatomy\n- Other\n\nFor each of the main classification types, there are different sublevels. For instance, *Glaucoma* has main classification *Disease* and subclassification *Eye Diseases*.\n\nIt is possible to have multiple subclassifications depending on how many hierarchy branches connect into a concept. For instance, *Tachycardia* has main classification *Disease* and subclassifications *Cardiovascular Diseases* and *Symptom*. For the Disease main classification, one can expect to see as many subclassifications as medical specialties and/or medical systems.\n\nThe Drug main classification is similarly subclassificasified into active ingredients of drugs, according to the organ or system on which they act. For instance, the drug *Tegretol* is subclassified as *Nervous System*. Also, multiple subclassifications can be applied to drugs. For instance: *Diclofenac Potassium* is subclassified as *Sensory Organs*, *Musculoskeletal* and *Dermatological*.\n\nProcedure is subclassified as: *Diagnosis*, *Therapeutics*, *Anesthesia*, *Surgical*, *Investigative* and *Dentistry*. For instance, *Blood Transfusion* is *Therapeutics* and *Auscultation* is *Diagnosis*.\n\n*Anatomy* is subclassified with each anatomical system plus additional categories for things like *Fluids*, *Cells*, *Tissues* and *Viruses* and *Bacterias*. The Anatomy can have multiple subclassifications, for instance *Oropharynx* has *Stomatognathic System* and *Respiratory System*.\n\n*Mental Health* is subclassified with *Mental Disorders*, *Behaviors*, *Psychological* *Phenomena* and *Disciplines*. *Psychological Phenomena* are concepts like *Sleep*, *Hearing* or *Appetite*. *Behaviours* include concepts like *Anxiety*, *Affect*, *Depression* and *Feelings*. *Mental Disorders* encompasses the psychiatric illnesses manifested by breakdowns in the adaptational process. Examples of *Mental Disorders* are: *Depressive Disorder*, *Dementia* or *Alcoholism*.\n\nThe “*Other*” classification are other related medical concepts that cannot be classified in the the aforementioned main classification categories. For example: *Office Visit* is classified as *Other* with subclassifications *Organization* and *Administration*.\n\n# Sections\n\nNotes gathered from an EHR will frequently be divided into distinct sections. These sections can help to provide additional information about the concepts that they contain. For example, your application may want to increase or decrease the relevance of matches found in certain sections.\n\nSections are provided in a top-level attribute on the extraction response, titled `sections`. Using the information in each section object, you can align matched concepts to their corresponding section.\n\nFor the input text `Chief Complaint: worsening chest pain and shortness of breath`, we would see the following section extracted:\n```json\n  \"sections\": [\n    {\n      \"id\": \"chief-complaint\",\n      \"label\": \"chief complaint\",\n      \"type\": \"SECTION\",\n      \"sectionId\": 0,\n      \"explanation\": {\n        \"begin\": 0,\n        \"end\": 15,\n        \"matchedTokens\": [\n          {\n            \"token\": \"Chief\",\n            \"position\": 0\n          },\n          {\n            \"token\": \"Complaint\",\n            \"position\": 2\n          }\n        ],\n        \"fuzzyValues\": []\n      },\n      \"contexts\": []\n    }\n  ]\n  ```\n\n  Using the `section.explanation.end` position, we can see that any concept match that has `concept.explanation.begin` greater than 15 is contained within this section.\n\n  For documents with multiple sections, the begin and end boundary for each individual section can be determined by using the `explanation.end` information from the target section and the `explanation.begin` information from the next section.\n\n# Lists\n\nPatient charts frequently contain data presented as lists, including problem, medication, medical history, and complaint lists. Lexigram examines text provided to the API in order to expose these lists, and surfaces information about the list itself, its position, contents, and matched concepts.\n\nLists are a beta feature and are not enabled by default. They can be enabled by passing the parameter `with-lists` set to true for GET requests. For a POST, include `\"withLists\": true` in the JSON request body.\n\nInformation about lists is returned on a top-level `lists` attribute. For the example text `PATIENT CONDITIONS 1) Hypertension 2) ADHD 3) Diabetes`, the response would include:\n\n```json\n\"lists\": [\n  {\n    \"id\": 0,\n    \"explanation\": {\n      \"begin\": 22,\n      \"end\": 54,\n      \"itemCount\": 3\n    },\n    \"items\": [\n      {\n        \"number\": 1,\n        \"label\": \"1)\",\n        \"explanation\": {\n          \"begin\": 22,\n          \"end\": 34,\n          \"matchesIndex\": [\n            0\n          ]\n        }\n      },\n      {\n        \"number\": 2,\n        \"label\": \"2)\",\n        \"explanation\": {\n          \"begin\": 38,\n          \"end\": 42,\n          \"matchesIndex\": [\n            1\n          ]\n        }\n      },\n      {\n        \"number\": 3,\n        \"label\": \"3)\",\n        \"explanation\": {\n          \"begin\": 46,\n          \"end\": 54,\n          \"matchesIndex\": [\n            2\n          ]\n        }\n      }\n    ]\n  }\n]\n```\n\nAs with Sections, the overlapping position of the list item begin and end can be used to determine which concept matches fall within which list item. For example, this match is returned for the example text above:\n```json\n{\n  \"id\": \"lxg-3ac43c43af84\",\n  \"label\": \"Hypertension\",\n  \"type\": \"ENTITY\",\n  \"explanation\": {\n    \"begin\": 22,\n    \"end\": 34,\n    \"matchedTokens\": [\n      {\n        \"token\": \"Hypertension\",\n        \"position\": 6\n      }\n    ],\n    \"fuzzyValues\": []\n  },\n  \"contexts\": [],\n  \"classification\": {\n    \"main\": \"Disease\",\n    \"subs\": [\n      {\n        \"id\": \"lxg-7f69fbb334e4\",\n        \"label\": \"Vascular Diseases\"\n      },\n      {\n        \"id\": \"lxg-0eeec8ac29e4\",\n        \"label\": \"Cardiovascular Diseases\"\n      }\n    ]\n  }\n}\n```\n\nWe can use the match `begin` and `end` to determine that this match falls within the list item with `number` equal to one.\n\n# Demographics\n\nThe Lexigram API will extract and normalize patient demographics, which include gender, age, ethnicity, and race. These demographics are frequently included in reporting and are used in calculating risk stratification and other patient data calculation algorithms.\n\nThese demographics frequently appear clustered in charts, and to avoid ambiguity, the Lexigram API will look for these clusters when extracting demographic data. For example, the statement `The patient is a 55 year old Caucasian male`, would result in the following concept matches:\n\n```json\n{\n  \"matches\": [\n    {\n      \"id\": \"age\",\n      \"label\": \"age\",\n      \"type\": \"DEMOGRAPHIC\",\n      \"explanation\": {\n        \"begin\": 17,\n        \"end\": 28,\n        \"matchedTokens\": [\n          {\n            \"token\": \"55\",\n            \"position\": 8\n          },\n          {\n            \"token\": \"year\",\n            \"position\": 10\n          },\n          {\n            \"token\": \"old\",\n            \"position\": 12\n          }\n        ],\n        \"subtype\": \"age\",\n        \"value\": \"55\",\n        \"fuzzyValues\": []\n      },\n      \"contexts\": []\n    },\n    {\n      \"id\": \"white\",\n      \"label\": \"white\",\n      \"type\": \"DEMOGRAPHIC\",\n      \"explanation\": {\n        \"begin\": 29,\n        \"end\": 38,\n        \"matchedTokens\": [\n          {\n            \"token\": \"Caucasian\",\n            \"position\": 14\n          }\n        ],\n        \"subtype\": \"race\",\n        \"value\": \"white\",\n        \"fuzzyValues\": []\n      },\n      \"contexts\": []\n    },\n    {\n      \"id\": \"male\",\n      \"label\": \"male\",\n      \"type\": \"DEMOGRAPHIC\",\n      \"explanation\": {\n        \"begin\": 39,\n        \"end\": 43,\n        \"matchedTokens\": [\n          {\n            \"token\": \"male\",\n            \"position\": 16\n          }\n        ],\n        \"subtype\": \"gender\",\n        \"value\": \"male\",\n        \"fuzzyValues\": []\n      },\n      \"contexts\": []\n    }\n  ]\n}\n```\n\n# Dates\n\nDates in patient charts are used to track the onset of conditions, periods of medication usage, and other information about patient conditions. The API will extract dates in a variety of formats that are presented in the text.\n\nFor example, the following statements will all result in a date extraction that has been normalized to `2018-11-13`:\n- The patient first presented with diabetes Nov 13, 2018\n- The patient first presented with diabetes 11/13/18\n- The patient first presented with diabetes 2018-11-13\n\nThe date extraction appears as below in the concept matches:\n```json\n{\n  \"id\": \"date\",\n  \"label\": \"date\",\n  \"type\": \"DATE\",\n  \"explanation\": {\n    \"begin\": 42,\n    \"end\": 54,\n    \"matchedTokens\": [\n      {\n        \"token\": \"Nov\",\n        \"position\": 12\n      },\n      {\n        \"token\": \"13\",\n        \"position\": 14\n      },\n      {\n        \"token\": \",\",\n        \"position\": 15\n      },\n      {\n        \"token\": \"2018\",\n        \"position\": 17\n      }\n    ],\n    \"subtype\": \"date\",\n    \"value\": \"2018-11-13\",\n    \"fuzzyValues\": []\n  },\n  \"contexts\": []\n}\n```\n\nDated problem and medication lists are also good areas to surface information on a patient's medical history, and can provide insight into the progression of a condition of interest.\n\nUnfortunately, the appearance of dates in chart text, especially for charts that have been faxed, scanned, or otherwise processed via OCR, is incredibly ambiguous. Frequently, the date a chart was printed or faxed will appear alongside the date of a visit or the start of a prescription. Dates of physician attestations, physician and nurse's note sign-offs, and many other dates that are not relevant to patient conditions can appear in the data.\n\nBecause of this, we caution users to be mindful of how they are utilizing the date extractions we present via the API. We are happy to discuss issues related to date extraction and how to best situate these extractions in your application in more detail, please contact <a href=\"mailto:support@lexigram.io\">support@lexigram.io</a> to arrange a call.\n\n# Contexts Explained\n\nConcept matches are enriched with a context object that contain additional information of the \"surroundings\" for a particular extraction,  e.g. `no evidence of pneumonia` is considered a negated definite statement and the extraction match will contain the following context object:\n\n```json\n\"contexts\": [\n    {\n        \"type\": \"negative\",\n        \"subtype\": \"definite\",\n        \"explanation\": {\n            \"begin\": 0,\n            \"end\": 14,\n            \"matchedTokens\": [\n                {\n                    \"token\": \"no\",\n                    \"position\": 0\n                },\n                {\n                    \"token\": \"evidence\",\n                    \"position\": 2\n                },\n                {\n                    \"token\": \"of\",\n                    \"position\": 4\n                }\n            ],\n            \"fuzzyValues\": [],\n            \"triggerId\": \"N0000057\",\n            \"triggerLabel\": \"no evidence\"\n        }\n    }\n]\n```\n\nThe two main data attributes in that object are `type` and  `subtype` which contain the context classification. Use `type` and `subtype` if your applications only care about blacklisting or whitelisting certain types of context, or if you are using the context as a feature for a downstream machine learning process. The other attributes in that object represent the text provenance of where the context trigger was found.\n\nThe list of contexts with examples are described in the sections below.\n\n# Negation and Hypothetical\n\nPhysicians use specific language to discuss the conditions that a patient may or may not have. The following are categories of negation and hypothetical contexts that illustrate the variety of ways in which these conditions are documented.\n\n### Affirmed Definite\n\n```json\n{ \"type\" : \"affirmed\", \"subtype\": \"definite\"}\n```\n\n- positive examination for COPD\n- BMD shows definite osteoporosis\n- pneumothorax is seen\n\n### Negative Definite\n\n```json\n{ \"type\" : \"negative\", \"subtype\": \"definite\"}\n```\n\n- no evidence of pneumonia\n- BMD shows obvious signs of osteoporosis\n- never had COPD\n\n### Speculative Affirmed\n\n```json\n{ \"type\" : \"speculative\", \"subtype\": \"affirmed\"}\n```\n\n- I believe Pt has high blood pressure\n- It could be infection\n- Not improbable it was caused by hemorrhage\n\n\n### Speculative Negative\n\n```json\n{ \"type\" : \"speculative\", \"subtype\": \"negative\"}\n```\n\n- Evidence does not suggest COPD\n- not known to have depression\n\n### Speculative Uncertain\n```json\n{ \"type\" : \"speculative\", \"subtype\": \"uncertain\"}\n```\n\n- It could be either diverticulitis or appendicitis\n- Find it difficult to assess for the cause of abdominal pain given patient's description\n\n### Speculative Future\n```json\n{ \"type\" : \"speculative\", \"subtype\": \"future\"}\n```\n\n- Pt is at risk for developing diabetes\n- Look out for increased pain\n\n### Speculative Indication\n```json\n{ \"type\" : \"speculative\", \"subtype\": \"indication\"}\n```\n\n- Assessment for kidney cancer\n- Rule out for enterocolitis\n\n# Vitals and Lab Values\n\nThe API will extract vitals and lab values, making it simple to track weight, height, BMI, blood pressure readings, HbA1c, blood glucose, metabolic panels, lipid panels, and more.\n\nWhen doing these extractions, the API will align the measurement type (height), the value (180), and the unit (centimeters). For this example, using the text `Height 180 cm` will result in the following extraction:\n\n```json\n{\n  \"matches\": [\n    {\n      \"id\": \"height\",\n      \"label\": \"height\",\n      \"type\": \"MEASUREMENT\",\n      \"explanation\": {\n        \"begin\": 0,\n        \"end\": 10,\n        \"matchedTokens\": [\n          {\n            \"token\": \"Height\",\n            \"position\": 0\n          },\n          {\n            \"token\": \"180\",\n            \"position\": 2\n          }\n        ],\n        \"subtype\": \"height\",\n        \"value\": \"180.0\",\n        \"unit\": \"centimeter\",\n        \"fuzzyValues\": []\n      },\n      \"contexts\": []\n    }\n  ]\n}\n```\n\nWhen working with charts that have gone through an OCR process, it is common to find several numeric values clustered in a section describing vitals, without clear positioning to indicate which value corresponds with which measurement type. In these cases, the API will return a list of values in the `fuzzyValues` attribute, allowing the user to further refine these values as needed.\n\n# Medication\n\nWhere available, the API will extract detailed information about medication from patient charts. These are extracted as distinct contexts for a given drug and includes type (branded vs generic), formulation, ingredients, dosage strength, route, and form.\n\nMedications that contain multiple ingredients will include each ingredient, along with the ingredient strength for the given formulation, provided that a strength is present and can be extracted.\n\nFor a generic drug, this is the information that is extracted (input: `Lisinopril 20 mg oral tab`):\n```json\n{\n  \"matches\": [\n    {\n      \"id\": \"lxg-41490a0f260b\",\n      \"label\": \"Lisinopril\",\n      \"type\": \"DRUG\",\n      \"explanation\": {\n        \"begin\": 0,\n        \"end\": 10,\n        \"matchedTokens\": [\n          {\n            \"token\": \"Lisinopril\",\n            \"position\": 0\n          }\n        ],\n        \"fuzzyValues\": []\n      },\n      \"contexts\": [\n        {\n          \"type\": \"medication\",\n          \"subtype\": \"form\",\n          \"explanation\": {\n            \"begin\": 22,\n            \"end\": 25,\n            \"matchedTokens\": [\n              {\n                \"token\": \"tab\",\n                \"position\": 8\n              }\n            ],\n            \"fuzzyValues\": [],\n            \"triggerId\": \"385055001\",\n            \"triggerLabel\": \"tablet\"\n          }\n        },\n        {\n          \"type\": \"medication\",\n          \"subtype\": \"ingredients\",\n          \"ingredients\": [\n            {\n              \"name\": \"Lisinopril\",\n              \"id\": \"lxg-41490a0f260b\",\n              \"strength\": {\n                \"value\": 20,\n                \"unit\": \"milligram\"\n              }\n            }\n          ]\n        },\n        {\n          \"type\": \"medication\",\n          \"subtype\": \"route\",\n          \"explanation\": {\n            \"begin\": 17,\n            \"end\": 21,\n            \"matchedTokens\": [\n              {\n                \"token\": \"oral\",\n                \"position\": 6\n              }\n            ],\n            \"fuzzyValues\": [],\n            \"triggerId\": \"26643006\",\n            \"triggerLabel\": \"oral\"\n          }\n        },\n        {\n          \"type\": \"medication\",\n          \"subtype\": \"generic\",\n          \"explanation\": {\n            \"begin\": 0,\n            \"end\": 10,\n            \"matchedTokens\": [\n              {\n                \"token\": \"Lisinopril\",\n                \"position\": 0\n              }\n            ],\n            \"fuzzyValues\": [],\n            \"triggerId\": \"lxg-41490a0f260b\",\n            \"triggerLabel\": \"Lisinopril\"\n          }\n        }\n      ],\n      \"classification\": {\n        \"main\": \"Drug\",\n        \"subs\": [\n          {\n            \"id\": \"lxg-a4ede3447f55\",\n            \"label\": \"AGENTS ACTING ON THE RENIN-ANGIOTENSIN SYSTEM\"\n          },\n          {\n            \"id\": \"lxg-8b7dbf4bc1d9\",\n            \"label\": \"ACE INHIBITORS, PLAIN\"\n          },\n          {\n            \"id\": \"lxg-04b05fd06b05\",\n            \"label\": \"CARDIOVASCULAR SYSTEM\"\n          }\n        ]\n      }\n    }\n  ]\n}\n```\n\nFor a branded drug, this is the information that is extracted (input: `HYDROcodone/acetaminophen (NORCO 10) 10mg/325mg Tab 60 Tab 0`):\n```json\n{\n  \"matches\": [\n    {\n      \"id\": \"lxg-322820454fbc\",\n      \"label\": \"Norco\",\n      \"type\": \"DRUG\",\n      \"explanation\": {\n        \"begin\": 27,\n        \"end\": 32,\n        \"matchedTokens\": [\n          {\n            \"token\": \"NORCO\",\n            \"position\": 3\n          }\n        ],\n        \"fuzzyValues\": []\n      },\n      \"contexts\": [\n        {\n          \"type\": \"medication\",\n          \"subtype\": \"form\",\n          \"explanation\": {\n            \"begin\": 48,\n            \"end\": 51,\n            \"matchedTokens\": [\n              {\n                \"token\": \"Tab\",\n                \"position\": 9\n              }\n            ],\n            \"fuzzyValues\": [],\n            \"triggerId\": \"385055001\",\n            \"triggerLabel\": \"tablet\"\n          }\n        },\n        {\n          \"type\": \"medication\",\n          \"subtype\": \"ingredients\",\n          \"ingredients\": [\n            {\n              \"name\": \"Acetaminophen 325 MG\",\n              \"id\": \"lxg-a499f0cc3e75\",\n              \"strength\": {\n                \"value\": 325,\n                \"unit\": \"milligram\"\n              }\n            },\n            {\n              \"name\": \"Hydrocodone Bitartrate 10 MG\",\n              \"id\": \"lxg-a96f583b72f5\",\n              \"strength\": {\n                \"value\": 10,\n                \"unit\": \"milligram\"\n              }\n            }\n          ]\n        },\n        {\n          \"type\": \"medication\",\n          \"subtype\": \"brand\",\n          \"explanation\": {\n            \"begin\": 27,\n            \"end\": 32,\n            \"matchedTokens\": [\n              {\n                \"token\": \"NORCO\",\n                \"position\": 3\n              }\n            ],\n            \"fuzzyValues\": [],\n            \"triggerId\": \"lxg-322820454fbc\",\n            \"triggerLabel\": \"Norco\"\n          }\n        }\n      ],\n      \"classification\": {\n        \"main\": \"Drug\",\n        \"subs\": [\n          {\n            \"id\": \"lxg-261ecc3eb835\",\n            \"label\": \"ANALGESICS\"\n          },\n          {\n            \"id\": \"lxg-f9460f837191\",\n            \"label\": \"COUGH SUPPRESSANTS, EXCL. COMBINATIONS WITH EXPECTORANTS\"\n          },\n          {\n            \"id\": \"lxg-e0fa575f13a0\",\n            \"label\": \"NERVOUS SYSTEM\"\n          },\n          {\n            \"id\": \"lxg-493406c1bb02\",\n            \"label\": \"RESPIRATORY SYSTEM\"\n          },\n          {\n            \"id\": \"lxg-b165765b7c80\",\n            \"label\": \"COUGH AND COLD PREPARATIONS\"\n          },\n          {\n            \"id\": \"lxg-7240c6128ed3\",\n            \"label\": \"OTHER ANALGESICS AND ANTIPYRETICS\"\n          }\n        ]\n      }\n    }\n  ]\n}\n```\n\n# Anatomy\n\nMany diseases or procedures occur in the context of a particular body part or system. Where those occur in the text, the API will present the anatomy part as a context of the disease.\n\nFor example, the statement `The patient has a skin abscess` will result in the concept match `abscess` contextualized with the anatomy concept `skin`:\n\n```json\n{\n  \"id\": \"lxg-88b88605857f\",\n  \"label\": \"Abscess\",\n  \"type\": \"ENTITY\",\n  \"explanation\": {\n    \"begin\": 23,\n    \"end\": 30,\n    \"matchedTokens\": [\n      {\n        \"token\": \"abscess\",\n        \"position\": 10\n      }\n    ],\n    \"fuzzyValues\": []\n  },\n  \"contexts\": [\n    {\n      \"type\": \"anatomy\",\n      \"subtype\": \"anatomy\",\n      \"explanation\": {\n        \"begin\": 18,\n        \"end\": 22,\n        \"matchedTokens\": [\n          {\n            \"token\": \"skin\",\n            \"position\": 8\n          }\n        ],\n        \"fuzzyValues\": [],\n        \"triggerId\": \"anatomy-skin\",\n        \"triggerLabel\": \"skin\"\n      }\n    }\n  ],\n  \"classification\": {\n    \"main\": \"Disease\",\n    \"subs\": [\n      {\n        \"id\": \"lxg-ecb807e05bc2\",\n        \"label\": \"Infection\"\n      },\n      {\n        \"id\": \"lxg-4ebfcb6de390\",\n        \"label\": \"Pathological Conditions, Signs and Symptoms\"\n      },\n      {\n        \"id\": \"lxg-7a3777afaaa9\",\n        \"label\": \"Pathologic Processes\"\n      },\n      {\n        \"id\": \"lxg-ae7931d19353\",\n        \"label\": \"Suppuration\"\n      },\n      {\n        \"id\": \"lxg-8187cb28c903\",\n        \"label\": \"Inflammation\"\n      },\n      {\n        \"id\": \"lxg-16235b458c6e\",\n        \"label\": \"Bacterial Infections and Mycoses\"\n      }\n    ]\n  }\n}\n```\n\n# History\n\nWhen working with a patient, physicians will capture a patient and family history, which can help provide insight to the patient's current status. When extracting conditions from chart data, it is important to avoid attributing conditions that exist in a patient's family history to the patient themselves.\n\nThe following categories allow users to determine the distinct historical context being used in physical documentation.\n\n### Patient History\n\n```json\n{ \"type\" : \"history\", \"subtype\": \"patient\"}\n```\n\n- Pt has a history of depression\n- h/o pneumonia, COPD and hypertension\n\nIt also propagates section context to entities in close proximity to the header:\n\n```\nPATIENT HISTORY:\n\n- Alcoholism\n- Depression\n```\n\n### Family History\n\n```json\n{ \"type\" : \"history\", \"subtype\": \"family\"}\n```\n\n- Family history of breast cancer and coronary artery disease\n\nAnd it also propagates with section headers:\n\n```\nFAMILY HISTORY:\n\n- Depression\n- Breast Cancer\n- Coronary artery disease\n```\n\n# Allergies\n\nKnowing a patient's allergies can be an important part of ensuring patient safety. The API will surface allergies to known substances by providing an allergy context.\n\nExample for input `Patient has allergy to penicillin`:\n\n```json\n{\n  \"matches\": [\n    {\n      \"id\": \"lxg-f8833f946643\",\n      \"label\": \"Penicillin\",\n      \"type\": \"ENTITY\",\n      \"explanation\": {\n        \"begin\": 23,\n        \"end\": 33,\n        \"matchedTokens\": [\n          {\n            \"token\": \"penicillin\",\n            \"position\": 8\n          }\n        ],\n        \"fuzzyValues\": []\n      },\n      \"contexts\": [\n        {\n          \"type\": \"allergy\",\n          \"subtype\": \"allergy\",\n          \"explanation\": {\n            \"begin\": 12,\n            \"end\": 22,\n            \"matchedTokens\": [\n              {\n                \"token\": \"allergy\",\n                \"position\": 4\n              },\n              {\n                \"token\": \"to\",\n                \"position\": 6\n              }\n            ],\n            \"fuzzyValues\": [],\n            \"triggerId\": \"allergy-forward\",\n            \"triggerLabel\": \"allergy to\"\n          }\n        }\n      ]\n    }\n  ]\n}\n```\n\n# Clinic Names\n\nClinical concepts are frequently mentioned in the name of medical establishments, for example \"The Diabetes Center of Dallas\" or \"Heart Wellness Center\". The API will contextualize these with type `clinic-name` and `negative`. __Note__: this feature is experimental and needs to be enabled by passing `withClinicNames: true` in the JSON body.\n\n```\n{\n  \"matches\": [\n    {\n      \"id\": \"lxg-45528ef7190c\",\n      \"label\": \"Heart\",\n      \"type\": \"ENTITY\",\n      \"explanation\": {\n        \"fuzzyValues\": [],\n        \"begin\": 0,\n        \"end\": 5,\n        \"matchedTokens\": [\n          {\n            \"token\": \"Heart\",\n            \"position\": 0\n          }\n        ]\n      },\n      \"contexts\": [\n        {\n          \"type\": \"clinic-name\",\n          \"subtype\": \"possible-clinic-name\",\n          \"explanation\": {\n            \"fuzzyValues\": [],\n            \"begin\": -1,\n            \"end\": 30,\n            \"matchedTokens\": [\n              {\n                \"token\": \"internal-contextualizer-context\",\n                \"position\": -1\n              }\n            ],\n            \"triggerId\": \"cn-ctxt\",\n            \"triggerLabel\": \"cn-ctxt\"\n          }\n        },\n        {\n          \"type\": \"negative\",\n          \"subtype\": \"possible-clinic-name\",\n          \"explanation\": {\n            \"fuzzyValues\": [],\n            \"begin\": -1,\n            \"end\": 30,\n            \"matchedTokens\": [\n              {\n                \"token\": \"internal-contextualizer-context\",\n                \"position\": -1\n              }\n            ],\n            \"triggerId\": \"cn-ctxt\",\n            \"triggerLabel\": \"cn-ctxt\"\n          }\n        }\n      ],\n      \"classification\": {\n        \"main\": \"Anatomy\",\n        \"subs\": [\n          {\n            \"id\": \"lxg-032b4d0893da\",\n            \"label\": \"Anatomy\"\n          },\n          {\n            \"id\": \"lxg-180eae181bfe\",\n            \"label\": \"Cardiovascular System\"\n          }\n        ]\n      }\n    }\n  ],\n  \"codes\": []\n}\n```\n\n# Modifiers\n\nWhen described in narrative, conditions can have a variety of modifiers that provide additional information about the condition. Sometimes modifiers are substantial enough that they are considered a distinct condition. For example, the modifier `pre` when used with `diabetic` is a concept `prediabetic`, however `pre` used with `hypertension` is surfaced as the condition `hypertension` with a context `pre`.\n\nThe following modifiers are tracked:\n```\nchronic\nacute\nsub-acute\ntemporary\nbenign\nmalignant\nsomatic\nvisceral\nunknown\ninfantile\nadult\nchildhood\nfamilial\nessential\nprimary\nsecondary\nlocalised\nborderline\nchronic active\nchronic persistent\ndouble\nfloating\nsymmetric\nasymmetric\nsevere\npre\npost\n```\n\n# Endpoint Usage\n\nUsing the Authentication approach described below, you can access the following endpoints. To see specific requests and responses that illustrate the different features of the API, select an Example from the drop-down below.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"8682281","team":2327542,"collectionId":"955b9476-b925-427d-ab32-dc2ae6d8a23d","publishedId":"Tzz4QKEK","public":true,"publicUrl":"https://docs.lexigram.io","privateUrl":"https://go.postman.co/documentation/8682281-955b9476-b925-427d-ab32-dc2ae6d8a23d","customColor":{"top-bar":"5a55a5","right-sidebar":"303030","highlight":"5a55a5"},"documentationLayout":"classic-single-column","customisation":null,"version":"8.10.1","publishDate":"2022-01-10T20:00:13.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"Lexigram Clinical NLP APIs","id":"e496d998-d224-49f3-93f2-ece442d064b0","owner":"8682281","values":[{"key":"baseUrl","value":"https://api.lexigram.io/v4","enabled":true},{"key":"apiKey","value":"<API Key Token>","enabled":true}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/8e0d944da1d98e86cf323673fe42059f19e6cba352215b5cf46b00e0eb38b2c4","favicon":"https://lexigram.io/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Lexigram Clinical NLP APIs","value":"8682281-e496d998-d224-49f3-93f2-ece442d064b0"}],"canonicalUrl":"https://docs.lexigram.io/view/metadata/Tzz4QKEK"}