0.1.15 • Published 2 years ago

guide-side-effects-api v0.1.15

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

guide-side-effects-api

Install and start

Clone, npm install, fill a .env file using sample.env, then npm run dev.

Get side effects grouped by drugs

Get the side effects of multiple drugs for the side effects guide. => Filter "by drug"

query Query($drugs: [DrugInput]) {
  getSideEffectsGroupedByDrugs(drugs: $drugs) {
    drug
    atcParentLabel
    sideEffects {
      frequent {
        effect
        behaviours
      }
      rare {
        effect
        behaviours
      }
      unknown {
        effect
        behaviours
      }
    }
  }
}

Drugs input looks like:

{
  "drugs": [
    {
      "dci": "paracétamol",
      "specialty": {
        "shortname": "doliprane",
        "form": "Suppositoire"
      }
    },
    {
      "dci": "paliperidone",
      "specialty": {
        "shortname": "xéplion",
        "form": "Suspension injectable à libération prolongée",
        "dose": "50 mg"
      }
    },
    {
      "dci": "sulpiride"
    }
  ]
}

Exemple of output:

{
  "data": {
    "getSideEffectsGroupedByDrugs": [
      {
        "drug": "doliprane",
        "atcParentLabel": "ANILIDES",
        "sideEffects": {
          "frequent": [
            {
              "effect": "ACIDOSE METABOLIQUE",
              "behaviours": [
                "EFFECTUER UNE SURVEILLANCE BIOLOGIQUE",
                "EFFECTUER UNE SURVEILLANCE CLINIQUE"
              ]
            },
            ...
          ],
          "rare": [
            {
              "effect": "ACCOMMODATION TROUBLE",
              "behaviours": []
            },
            ...
          ],
          "unknown": [...]
        }
      },
      {
        "drug": "xéplion",
        "atcParentLabel": "AUTRES ANTIPSYCHOTIQUES",
        "sideEffects": {
          "frequent": [...],
          "rare": [...],
          "unknown": [...]
        }
      }
    ]
  }
}
getSideEffectsGroupedByDrugs(drugs: [DrugInput]): [SideEffectGroupedByDrug]

input SpecialtyInput {
  shortname: String!
  form: String
  dose: String
}

input DrugInput {
  dci: String!
  specialty: SpecialtyInput
}

Get side effects grouped by frequency

Get the side effects of multiple drugs for the side effects guide. => Filter "by frequency"

query Query($drugs: [DrugInput]) {
  getSideEffectsGroupedByFrequency(drugs: $drugs) {
    frequent {
      nbDrugs
      sideEffects {
        effect
        behavioursByDci {
          dci
          behaviours
        }
      }
    }
    rare {
      nbDrugs
      sideEffects {
        effect
        behavioursByDci {
          dci
          behaviours
        }
      }
    }
    unknown {
      nbDrugs
      sideEffects {
        effect
        behavioursByDci {
          dci
          behaviours
        }
      }
    }
  }
}

Drugs input looks like:

{
  "drugs": [
    {
      "dci": "paracétamol",
      "specialty": {
        "shortname": "doliprane"
      }
    },
    {
      "dci": "sulpiride"
    }
  ]
}

Exemple of output:

{
  "data": {
    "getSideEffectsGroupedByFrequency": {
      "frequent": [
        {
          "nbDrugs": 2,
          "sideEffects": [
            {
              "effect": "ACIDOSE METABOLIQUE",
              "behavioursByDci": [
                {
                  "dci": "paracétamol",
                  "behaviours": [
                    "EFFECTUER UNE SURVEILLANCE BIOLOGIQUE",
                    "EFFECTUER UNE SURVEILLANCE CLINIQUE"
                  ]
                },
                {
                  "dci": "sulpiride",
                  "behaviours": [
                    "EFFECTUER UNE SURVEILLANCE BIOLOGIQUE",
                    "EFFECTUER UNE SURVEILLANCE CLINIQUE",
                    "FAIRE UN TRAITEMENT SYMPTOMATIQUE"
                  ]
                }
              ]
            },
            ...
          ]
        },
        {
          "nbDrugs": 1,
          "sideEffects": [
            {
              "effect": "ACCOMMODATION TROUBLE",
              "behavioursByDci": [
                {
                  "dci": "sulpiride",
                  "behaviours": [
                    "EFFECTUER UNE SURVEILLANCE CLINIQUE",
                    "FAIRE UN TRAITEMENT SYMPTOMATIQUE"
                  ]
                }
              ]
            },
            ...
          ]
        }
      ],
      "rare": [...],
      "unknown": [...]
    }
  }
}
getSideEffectsGroupedByFrequency(
    drugs: [DrugInput]
  ): SideEffectGroupedByFrequency

input SpecialtyInput {
  shortname: String!
  form: String
  dose: String
}

input DrugInput {
  dci: String!
  specialty: SpecialtyInput
}

Get detected side effects

Get the given side effects (if they exist) of multiple drugs for the side effects guide.

query Query($drugs: [DrugInput], $sideEffects: [String]) {
  getDetectedSideEffects(drugs: $drugs, sideEffects: $sideEffects) {
    drug
    atcParentLabel
    sideEffects {
      frequent {
        effect
        behaviours
      }
      rare {
        effect
        behaviours
      }
      unknown {
        effect
        behaviours
      }
    }
  }
}

Drugs input looks like:

{
  "drugs": [
    {
      "dci": "paracétamol",
      "specialty": {
        "shortname": "doliprane"
      }
    },
    {
      "dci": "paliperidone"
    }
  ],
  "sideEffects": ["dyspnee", "acne"]
}
{
  "data": {
    "getDetectedSideEffects": [
      {
        "drug": "doliprane",
        "atcParentLabel": "ANILIDES",
        "sideEffects": {
          "frequent": [
            {
              "effect": "DYSPNEE",
              "behaviours": [
                "EFFECTUER UNE SURVEILLANCE BIOLOGIQUE",
                "EFFECTUER UNE SURVEILLANCE CLINIQUE"
              ]
            }
          ],
          "rare": [],
          "unknown": []
        }
      },
      {
        "drug": "paliperidone",
        "atcParentLabel": "AUTRES ANTIPSYCHOTIQUES",
        "sideEffects": {
          "frequent": [
            {
              "effect": "ACNE",
              "behaviours": [
                "ARRETER LE TRAITEMENT",
                "CHANGER DE TRAITEMENT",
                "HOSPITALISER EN MILIEU SPECIALISE"
              ]
            },
            {
              "effect": "DYSPNEE",
              "behaviours": [
                "EFFECTUER UNE SURVEILLANCE CLINIQUE",
                "FAIRE UN TRAITEMENT SYMPTOMATIQUE"
              ]
            }
          ],
          "rare": [],
          "unknown": []
        }
      }
    ]
  }
}
getDetectedSideEffects(
    drugs: [DrugInput]
    sideEffects: [String]
  ): [SideEffectGroupedByDrug]

input SpecialtyInput {
  shortname: String!
  form: String
  dose: String
}

input DrugInput {
  dci: String!
  specialty: SpecialtyInput
}