An open API service indexing awesome lists of open source software.

https://github.com/authorhealth/go-elation

Elation EHR API client for Go
https://github.com/authorhealth/go-elation

elation elation-ehr go-api-client golang

Last synced: 3 months ago
JSON representation

Elation EHR API client for Go

Awesome Lists containing this project

README

          

# go-elation

## Getting Started

```go
package main

import (
"context"
"fmt"
"log"
"net/http"
"os"
"time"

"github.com/authorhealth/go-elation"
)

func main() {
httpClient := &http.Client{
Timeout: 10 * time.Second,
}

tokenURL := os.Getenv("TOKEN_URL")
clientID := os.Getenv("CLIENT_ID")
clientSecret := os.Getenv("CLIENT_SECRET")
baseURL := os.Getenv("BASE_URL")

client := elation.NewHTTPClient(httpClient, tokenURL, clientID, clientSecret, baseURL)

res := &elation.Response[[]*elation.Patient]{}
var err error

res, _, err = client.Patients().Find(context.Background(), &elation.FindPatientsOptions{
Pagination: res.PaginationNextWithLimit(1),
})
if err != nil {
log.Fatal(err)
}

fmt.Println(res.Results[0].FirstName)
}
```