This project is a proof-of-concept electronic health record management system.
The gateway application is built using clojure and clojurescript with the following libraries, plugins and helpful tools:
leiningen | Build + run managment, package manager, etc. |
Ring | HTTP server |
Compojure | Lighweight routing / app framework on Ring |
Reagent | Client framework based on React.js |
Hiccup | Html templating / generation library |
Secretary | Client side routing |
Accountant | Convert links to secretary route invocations |
Figwheel | live js reloading |
speclj | TDD library for clj and cljs |
devcards | Interactive demo and testing tool for cljs |
cider | Clojure Interactive Development Environment that Rocks for Emacs |
The repository includes a Makefile with the following targets:
Builds the chaincode in registry/
Builds the cljs client in registry/client
, and copies the necessary .proto files from the chaincode
Builds the java interface files used by the gateway
Additionally, there are several helper targets that make it easier to run the chaincode during development:
Start a peer in dev-mode, without security
Launch the chaincode binary connected to the local dev peer. The default chaincode name is “registry”
Deploys the chaincode and returns to the shell
message Item {
string data = 1;
}
message List {
repeated Item items = 1;
}
message Record {
string hash = 1;
string patient = 2;
List messages = 3;
List trials = 4;
}
message Pair {
string key = 1;
string value = 2;
}
message EmptyParams {
}
Available RPC functions exported by this interface
void AddTrial(Item) -> registry/txn/1
void RemoveTrial(Item) -> registry/txn/2
void AddRecord(Record) -> registry/txn/3
void AuthorizeTrial(Pair) -> registry/txn/4
void RevokeAuthorization(Pair) -> registry/txn/5
void SendMessage(Pair) -> registry/txn/6
void DeleteMessage(Pair) -> registry/txn/7
List GetTrialList(EmptyParams) -> registry/query/2
Item GetPatientKey(Item) -> registry/query/1
List GetMessages(Item) -> registry/query/3
List GetAuthorizedTrials(Item) -> registry/query/4
There is an example REST client implemented in cljs included in the registry/client
directory.
Invoke from registry/client
with: $ nodejs out/registry.js -n registry -c <command> -a <args>
Examples:
nodejs out/registry.js -n registry -c add-trial -a '{"data": "TrialHash"}'
nodejs out/registry.js -n registry -c remove-trial -a '{"data": "TrialHash"}'
nodejs out/registry.js -n registry -c add-record -a '{"patient": "Pat", "hash": "RecordHash"}'
nodejs out/registry.js -n registry -c authorize-trial -a '{"key": "RecordHash", "value": "TrialHash"}'
nodejs out/registry.js -n registry -c revoke-authorization -a '{"key": "RecordHash", "value": "TrialHash"}'
nodejs out/registry.js -n registry -c send-message -a '{"key": "RecordHash", "value": "Hello!"}'
nodejs out/registry.js -n registry -c delete-message -a '{"key": "RecordHash", "value": "Hello!"}'
nodejs out/registry.js -n registry -c get-trial-list
nodejs out/registry.js -n registry -c get-patient-key -a '{"data": "RecordHash"}'
nodejs out/registry.js -n registry -c get-messages -a '{"data": "RecordHash"}'
nodejs out/registry.js -n registry -c get-authorized-trials -a '{"data": "RecordHash"}'
- [ ] Make devcards for components
- [ ] Split common elements into shared
- [ ] Reduce components to contain minimal markup
- [ ] Integrate registry
- [ ] IPFS
- [ ] UI for IPFS add
- [ ] Switch from modal view to sidebar
- [ ] Integrate registry