Skip to content
APIsAPI ReferenceStructuring & autocompletionAutocompletion

Autocompletion

Introduction

This API allows you to retrieve a list of medical entities corresponding to a query. Medical entities can be of different types (active ingredients, specialties, indications, contraindications, etc.) For all entities, when a text_preprocessed attribute is returned for a given concept, it is that attribute or a subpart of that attribute that matches the query, not necessarily the name. This attribute then corresponds to the preprocessed value of one of the concept or a synonym of this concept (for example, liver tumor can return liver tumor because liver tumor is a synonym).

Entry point

get/autocomplete-api/autocomplete

HTTP headers

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Query parameters

NametypeDescription
querystringa character string containing the text to analyze
required
entity_typestringType of entity to complete. DRUG by default. Can be: ADVERSE_EFFECT BRANDED_DRUG CLINICAL_DRUG CLINICAL_INDICATION CONTRAINDICATION_TERRAIN DRUG INGREDIENT SPECIALTY.
knumberNumber of candidates to return by entity type. 10 by default
threshnumberCandidate similarity threshold. Removes candidates below the similarity threshold. 0.4 by default
must_containbooleanForces candidates to contain a given substring (usually from a previous API call)
typeList[string]When entity_type == “DRUG”, allows filtering the drug concept level among BRANDED_DRUG, CLINICAL_DRUG, PACKAGED_DRUG, EXCIPIENT and INGREDIENT, by default, all five levels are returned.

Request

GET
/autocomplete-api/autocomplete
curl --request GET\
   --url "https://api.preprod.posos.co/autocomplete-api/autocomplete?query=doliprane&entity_type=DRUG&k=10&thresh=0.4&drug_concept_levels=BRANDED_DRUG" \
   --header 'Authorization: Bearer <token>'

Response

{
  "query": "doliprane",
  "entity_type": "DRUG",
  "candidates": [
    {
      "id": "60950142",
      "name": "paracetamol 1 g tablet",
      "drug_concept_level": "CLINICAL_DRUG",
      "similarity": 0.88,
      "form": {
        "code": "PDF-10219000",
        "terminology": "edqm_forms",
        "label": "Compressed"
      },
      "text_preprocessed": "doliprane 1 g tablet",
      "ingredients": [
        {
          "designation": "paracetamol",
          "inn": null
        }
      ],
      "codings": {
        "medicabase": [
          {
            "terminology": "medicabase",
            "code": "MV00002414",
            "label": "Paracetamol 1 g tablet"
          }
        ],
        "posos": [
          {
            "terminology": "posos",
            "code": "MV00002414",
            "label": "PARACETAMOL ZENTIVA LAB 1 g, tablet"
          }
        ],
        "ATC4": [
          {
            "terminology": "ATC4",
            "code": "N02B",
            "label": "other analgesics and antipyretics"
          }
        ],
        "ATC5": [
          {
            "terminology": "ATC5",
            "code": "N02BE",
            "label": "anilides"
          }
        ],
        "ATC7": [
          {
            "terminology": "ATC7",
            "code": "N02BE01",
            "label": "paracetamol"
          }
        ],
        "branded_drug_source": [
          {
            "terminology": "branded_drug_source",
            "code": "60950142",
            "label": "PARACETAMOL ZENTIVA LAB 1 g, tablet"
          }
        ]
      }
    }
    // ...
  ]
}

Response format

The response is a JSON object containing the following attributes:

NameTypeDescription
querystringThe initial query
entity_typestringThe type of entity sought.
candidatesarrayAn array of medical entities matching the query. See the section Candidates

Candidates

A few attributes are common to all entity types:

NameTypeDescription
idstringUnique identifier of the entity
namestringEntity name
similaritynumberSimilarity score between query and entity

Codings

Some types return an array of codings, including the following attributes:

NameTypeDescription
codestringCoding code
labelstringCoding Name
terminologystringCoding terminology (snomed, meddra, cim10, …)

The set of possible terminologies is:

NameRelated entity typesDescriptionExternal terminology
ATC4CLINICAL_DRUG, BRANDED_DRUGChemical subgroup
ATC5CLINICAL_DRUG, BRANDED_DRUGChemical substance subgroup
ATC7CLINICAL_DRUG, BRANDED_DRUGChemical subgroup
branded_drug_sourceCLINICAL_DRUGInformation from a matching BRANDED_DRUG entity
cip7PACKAGED_DRUG7-digit Presentation Identifier Code
cip13PACKAGED_DRUG13-digit Presentation Identifier Code, containing and replacing the 7-digit code, the prefix 3400 for French medicines, 9 for medicines with MA and ending with the control key
cim10CLINICAL_INDICATION, CONTRAINDICATION_TERRAIN, ADVERSE_EFFECTInternational Classification of Diseases - Version 10
innINGREDIENTInternational Nonproprietary Names, uniquely identifies pharmaceutical substances or active pharmaceutical ingredients
medicabaseCLINICAL_DRUGVirtual drug repository, ID defined by MV followed by CIS
medraCLINICAL_INDICATION, CONTRAINDICATION_TERRAIN, ADVERSE_EFFECTMedical Dictionary for Regulatory Activities
nvdCLINICAL_DRUGVirtualizable drug identifier, defined by NV followed by CIS
PososCLINICAL_DRUGVirtual drug identifier in our database. Corresponds to the medicabase id in the case of a virtual drug, or NVD for non-virtualizable drugs
snomedCLINICAL_INDICATION, CONTRAINDICATION_TERRAIN, ADVERSE_EFFECT, INGREDIENT, EXCIPIENTSystematized Nomenclature of Medicine Clinical Terms
ANSM substancesINGREDIENTName of the ingredient as written in the ANSM
ucd7BRANDED_DRUG, PACKAGED_DRUG7-character Common Dispensing Unit
ucd13BRANDED_DRUG, PACKAGED_DRUG13-character Common Dispensing Unit

Codings example

{
  "snomed": [
    {
      "code": "363346000",
      "label": "malignant neoplasia",
      "terminology": "snomed"
    }
  ],
  "cim10": [
    {
      "code": "C80",
      "label": "Malignant tumor of unspecified location",
      "terminology": "cim10"
    }
  ],
  "meddra": [
    { "code": "10028997", "label": "Malignant tumor", "terminology": "meddra" }
  ]
}

By entity type

Here is the list of specific attributes returned for each entity type.

DRUG

Returns a list of drugs matching the query, regardless of whether the search is made in DCI or in originator (brand name).

By default contains both BRANDED_DRUG type entities, including the name of the brand under which it is marketed, of type CLINICAL_DRUG, corresponding to a virtual drug, of type PACKAGED_DRUG, corresponding to a drug presentation, of type INGREDIENT, corresponding to an INN, and of type EXCIPIENT.

To filter for one or more specific concept levels, add a combination of drug_concept_levels=CLINICAL_DRUG, drug_concept_levels=BRANDED_DRUG, drug_concept_levels=PACKAGED_DRUG, drug_concept_levels=EXCIPIENT and drug_concept_levels=INGREDIENT parameters, for example drug_concept_levels=CLINICAL_DRUG&drug_concept_levels=BRANDED_DRUG.

The resulting entities are sorted by entity type (10 entities per type by default) then in alphabetical order, to have the entities closest to the query, sort by similarity.

Example for a query with xeplion 150 (brand name of paliperidone):

Response

{
  "query": "xeplion 150",
  "entity_type": "DRUG",
  "candidates": [
    {
      "id": "64760254",
      "name": "XEPLION 150 mg, prolonged release suspension for injection",
      "drug_concept_level": "BRANDED_DRUG",
      "similarity": 0.84,
      "form": {
        "code": "PDF-11208500",
        "terminology": "edqm_forms",
        "label": "Sustained-release injectable suspension"
      },
      "ingredients": [
        {
          "designation": "paliperidone (palmitate)",
          "inn": "paliperidone"
        }
      ],
      "codings": {
        "ATC4": [
          {
            "code": "N05A",
            "label": "antipsychotics",
            "terminology": "ATC4"
          }
        ],
        "ATC5": [
          {
            "code": "N05AX",
            "label": "other antipsychotics",
            "terminology": "ATC5"
          }
        ],
        "ATC7": [
          {
            "code": "N05AX13",
            "label": "paliperidone",
            "terminology": "ATC7"
          }
        ],
        "UCD13": [
          {
            "code": "3400893873830",
            "label": "XEPLION 150MG INJ LP SRG",
            "terminology": "UCD13"
          }
        ],
        "UCD7": [
          {
            "code": "9387383",
            "label": "XEPLION 150MG INJ LP SRG",
            "terminology": "UCD7"
          }
        ]
      }
    },
    {
      "id": "65907383",
      "name": "paliperidone (palmitate) 150 mg prolonged-release suspension for injection in pre-filled syringe",
      "type": "CLINICAL_DRUG",
      "similarity": 0.84,
      "form": {
        "code": "PDF-11208500",
        "terminology": "edqm_forms",
        "label": "Sustained-release injectable suspension"
      },
      "ingredients": [
        {
          "designation": "paliperidone (palmitate)",
          "inn": "paliperidone"
        }
      ],
      "codings": {
        "medicabase": [
          {
            "terminology": "medicabase",
            "code": "MV00003658",
            "label": "Paliperidone (palmitate) 150 mg prolonged-release suspension for injection in pre-filled syringe"
          }
        ],
        "posos": [
          {
            "terminology": "posos",
            "code": "MV00003658",
            "label": "PALIPERIDONE BIOGARAN 150 mg, prolonged release injectable suspension in pre-filled syringe"
          }
        ],
        "ATC4": [
          {
            "terminology": "ATC4",
            "code": "N05A",
            "label": "antipsychotics"
          }
        ],
        "ATC5": [
          {
            "terminology": "ATC5",
            "code": "N05AX",
            "label": "other antipsychotics"
          }
        ],
        "ATC7": [
          {
            "terminology": "ATC7",
            "code": "N05AX13",
            "label": "paliperidone"
          }
        ],
        "branded_drug_source": [
          {
            "terminology": "branded_drug_source",
            "code": "65907383",
            "label": "PALIPERIDONE BIOGARAN 150 mg, prolonged release injectable suspension in pre-filled syringe"
          }
        ]
      }
    }
  ]
}
NameTypeDescription
idstringUnique identifier of the entity.
namestringName of the drug.
typestringDrug type (BRANDED_DRUG, CLINICAL_DRUG or INGREDIENT).
similaritynumberSimilarity score between query and entity.
formobjectGalenic form information in EDQM terminology: ‘code’, terminology and label. Missing for type=INGREDIENT
ingredientsarrayList of drug ingredients, with designation and inn attributes (see Codings)
codingsCodingsDrug coding
text_preprocessedstringPreprocessed text to match the drug to the query
availability_alertstringOut of stock information, only for the type BRANDED_DRUG.
labelled_strengthstringDrug dosis.
strengthstringStructured drug dosis.

ADVERSE_EFFECT

Returns a list of adverse effects matching the query.

Response

{
  "query": "trembling",
  "entity_type": "ADVERSE_EFFECT",
  "candidates": [
    {
      "id": "6a8f4208fc762a36785c9fd5ad6e5903c5f7fb51ba3e4e2d71cf7b2758c9afbd",
      "name": "tremor",
      "type": "ADVERSE_EFFECT",
      "similarity": 1.0,
      "codings": {
        "snomed": [
          {
            "terminology": "snomed",
            "code": "26079004",
            "label": "tremor"
          }
        ],
        "cim10": [
          {
            "terminology": "cim10",
            "code": "R251",
            "label": "Trembling, unspecified"
          }
        ],
        "meddra": [
          {
            "terminology": "meddra",
            "code": "10044562",
            "label": "Trembling"
          }
        ]
      }
    },
    {
      "id": "d0b42330cbefe2498dcfaa082d84160be32cc040254c34efaeebe7e6098317a1",
      "name": "trembling hands",
      "type": "ADVERSE_EFFECT",
      "similarity": 0.951,
      "codings": {
        "meddra": [
          {
            "terminology": "meddra",
            "code": "10044577",
            "label": "Hands tremor"
          }
        ],
        "snomed": [
          {
            "terminology": "snomed",
            "code": "26079004",
            "label": "tremor"
          }
        ],
        "cim10": [
          {
            "terminology": "cim10",
            "code": "R251",
            "label": "Trembling, unspecified"
          }
        ]
      }
    }
  ]
}

SPECIALTY

This entity is deprecated and will be replaced by DRUG with drug_concept_levels=CLINICAL_DRUG

Returns a list of medicinal specialties corresponding to the query.

Response

{
  "query": "doliprane",
  "entity_type": "SPECIALTY",
  "candidates": [
    {
      "dci": ["paracetamol"],
      "id": "fd07dc89b0e39daad0affc90ed125567d5183a1c1f24299c15017280c773b187::drug",
      "name": "DOLIPRANE 150 mg, suppository",
      "similarity": 1,
      "text_preprocessed": "doliprane 150 mg, suppository",
      "dose": "150 mg",
      "form": "suppository",
      "atc": {
        "code": "N02BE01",
        "label": "paracetamol"
      },
      "atc_parent": {
        "code": "N02BE",
        "label": "anilides"
      },
      "clinical_drug_id": "MV00001654",
      "shortname": "doliprane"
    }
    // ...
  ]
}
NameTypeDescription
dciarrayList of drug INNs.
dosestringDose of the drug.
formstringForm of the medicine.
atcobjectATC code of the drug.
atc.codestringATC code of the drug.
atc.labelstringATC label of the medicine.
atc_parentobjectParent ATC code of the drug.
atc_parent.codestringParent ATC code of the drug.
atc_parent.labelstringParent ATC label of the drug.
clinical_drug_idstringVirtual drug identifier in the medicabase database.
shortnamestringName of the drug.

CLINICAL_INDICATION

NametypeDescription
namestringName of indication
codingsCodingsCoding of the indication

Response

{
  "query": "liver tumor",
  "entity_type": "CLINICAL_INDICATION",
  "candidates": [
    {
      "id": "a2bdf4507eaed9e9f4db734b18f0794ccbe08cb84993bac45372adbc73ac5efd",
      "type": "CLINICAL_INDICATION",
      "name": "hepatocellular cancer",
      "similarity": 0.944,
      "text_preprocessed": "hepatocellular cancer liver tumor",
      "codings": {
        "meddra": [
          {
            "terminology": "meddra",
            "code": "10073071",
            "label": "Hepatocellular carcinoma"
          }
        ],
        "snomed": [
          {
            "terminology": "snomed",
            "code": "126851005",
            "label": "liver tumor"
          }
        ],
        "cim10": [
          {
            "terminology": "cim10",
            "code": "C220",
            "label": "Hepatocellular carcinoma"
          }
        ]
      }
    }
    // ...
  ]
}

LAND_CONTRAINDICATION

Apart from the recurring attributes id, type, name, similarity and text_preprocessed, the results contain the attributes origin, codings and terminology.

NametypeDescription
originstringField Origin: contraindication.condition.normalised_designation, contraindication.patient_criterion.adjunct_treatment.procedures, contraindication.patient_criterion.age_group, contraindication.patient_criterion.gender
terminologystringField terminology: contra_indication, meddra_procedures, age_group, gender

So if you want to filter terrains by type, you must use the origin attribute.

Example of a query with the word woman:

Response

{
  "query": "woman",
  "entity_type": "CONTRAINDICATION_TERRAIN",
  "candidates": [
    {
      "id": "Woman",
      "type": "CONTRAINDICATION_TERRAIN",
      "name": "Woman",
      "origin": "contraindication.patient_criterion.gender",
      "similarity": 1,
      "text_preprocessed": "woman",
      "terminology": "gender",
      "codings": {}
    },
    {
      "id": "5cb1f1937e6b686d5374097364c09323ad44bac43248e8d93e33fc59bffb9ad1",
      "type": "CONTRAINDICATION_TERRAIN",
      "name": "Nulliparous woman",
      "origin": "contraindication.condition.normalised_designation",
      "similarity": 0.87,
      "text_preprocessed": "nulliparous woman",
      "terminology": "contra_indications",
      "codings": {
        "snomed": [
          {
            "code": "10029827",
            "label": "Nulliparous",
            "terminology": "meddra"
          },
          {
            "code": "102877006",
            "label": "pregnant wife",
            "terminology": "snomed"
          }
        ]
      }
    }
    // ...
  ]
}

Response codes

CodeDescription
200
400One of the parameters passed in the request is invalid