quickumlsrest

package module
v0.0.0-...-2265f03 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2019 License: MIT Imports: 5 Imported by: 4

README

quickumlsrest

package quickumlsrest provides an API client to the quickUMLS-rest service. The server can be found as a docker image from https://hub.docker.com/r/aehrc/quickumls-rest/.

Documentation: https://godoc.org/github.com/hscells/quickumlsrest

Example:

client := quickumlsrest.NewClient("http://localhost:5000")
candidates, err := client.Match("cancer")
if err != nil {
    panic(err)
}

for _, candidate := range candidates {
    fmt.Println(candidate.CUI)
}

Documentation

Overview

package quickumlsrest provides an API client to the quickUMLS-rest service. The server can be found as a docker image from https://hub.docker.com/r/aehrc/quickumls-rest/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache map[string][]Candidate

Cache is a mapping from a string (term) to a Pair in QuickUMLS.

type Candidate

type Candidate struct {
	Start      int      `json:"start"`
	End        int      `json:"end"`
	Preferred  int      `json:"preferred"`
	Similarity float64  `json:"similarity"`
	CUI        string   `json:"cui"`
	NGram      string   `json:"ngram"`
	Term       string   `json:"term"`
	SemTypes   []string `json:"semtypes"`
	SnomedCT   []string `json:"snomed_ct"`
}

Candidate defines the response from the quickUMLS-rest service.

type Candidates

type Candidates []Candidate

Candidates is a collection of candidates.

type Client

type Client struct {
	URL string
	*http.Client
}

Client is a client to the quickUMLS-rest service.

func NewClient

func NewClient(URL string) Client

NewClient creates a new client for the service.

func (Client) Match

func (c Client) Match(text string) (Candidates, error)

Match performs a match request and returns a slice of candidates.

type MatchRequest

type MatchRequest struct {
	Text string `json:"text"`
}

MatchRequest is the request body sent to the match endpoint of the quickUMLS-rest service.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL