Patient Encounter notification Application
In this tutorial, we will create a simple application written on Clojure programming language using Aidbox Clojure SDK and Aidbox.cloud or Aidboxone as a backend.
We have a Encounter included Patient, date and location of visit.
We want to send an Email to a patient with a notification of the upcoming visit. In this email we want to show the Patient information, time and location of the visit. These notifications should be sent the day before the visit.
Aidbox as backend which will store all Encounters. .....
Clojure application with Aidbox Clojure SDK as a connector between our application and backend.
.png?alt=media&token=de713a08-4564-4b9c-a4ad-fb98c6700924)
Architecture of Aidbox based Application
Firstly, you need to install local Aidbox. See the full instruction on how to install Aidbox locally and how to use Rest API
In this sample application, we use Clojure CLI. See Getting Started for details on how to install the tools.
In this sample app we will use Clojure Cli - command line tools for running REPL and Clojure apps. In
deps.end
file need specify aidbox-sdk
as a reference to git.deps.edn
{:deps
{aidbox-sdk {:git/url "https://github.com/Aidbox/aidbox-clojure-sdk"
:sha "057ebd1a542bb17c7a910283ae942f56a89167f1"}}}
And then require
aidbox-sdk
in the main mailgun.core
filemailgun.core
(ns mailgun.core
(:require [aidbox.sdk.core :as aidbox]))
For connecting your application with Aidbox, you need call
aidbox/call
method send them information about the location of Aidbox and your application.src/mailgun/core.clj
(def manifest
{:id "mailgun-app"
:type "app"
:env {:box {;; host and port of Aidbox instance
:host "localhost"
:scheme "http"
:port 8888}
:app {;; host, port and client creds of your application
;;:host "docker.for.mac.localhost" ;; for Mac Os
:host "localhost"
:scheme "http"
:port 8989
:id "root"
:secret "secret"}}})
(defn -main [] (aidbox/start manifest))
When you call
aidbox/start
method, aidbox-sdk
try to connect to Aidbox
with given env.box.host
, env.app.id
and env.app.secret
credentials and then, if the connection is successful, register your app in Aidbox. After that, aidbox/sdk
create local web server running on env.app.port
port, in our case is 8989
.Last modified 6mo ago