Git Product home page Git Product logo

health-care-blockchain's Introduction

EMR(Dev)

EMR full version

Start

git clone https://github.com/pokpack/ERD.git
cd ERD
npm install

Ubuntu & MacOS


HTTP_PORT=3001 P2P_PORT=6001 PEERS=ws://localhost:6002,ws://localhost:6003,ws://localhost:6004 SECRET_KEY=x]vf4yp0yf npm start
HTTP_PORT=3002 P2P_PORT=6002 PEERS=ws://localhost:6001,ws://localhost:6003,ws://localhost:6004 SECRET_KEY=x]vf4yp0yf npm start
HTTP_PORT=3003 P2P_PORT=6003 PEERS=ws://localhost:6001,ws://localhost:6002,ws://localhost:6004 SECRET_KEY=x]vf4yp0yf npm start
HTTP_PORT=3004 P2P_PORT=6004 PEERS=ws://localhost:6001,ws://localhost:6002,ws://localhost:6003 SECRET_KEY=x]vf4yp0yf npm start

curl -H "Content-type:application/json" -H "Authorization: Bearer x]vf4yp0yf" --data '{"data" : {"first_name": "firstname", "last_name" : "last_name"}}' http://localhost:3001/mineEMR

curl -H "Authorization: Bearer x]vf4yp0yf" http://localhost:3001/EMRs
curl -H "Authorization: Bearer x]vf4yp0yf" http://localhost:3001/EMRs/1

curl -H "Content-type:application/json" -H "Authorization: Bearer x]vf4yp0yf" --data '{"token" : "xxx"}' http://localhost:3001/newToken


Window


set HTTP_PORT=3001 && set P2P_PORT=6001 && set PEERS=ws://localhost:6002,ws://localhost:6003,ws://localhost:6004 && set SECRET_KEY=x]vf4yp0yf && npm start
set HTTP_PORT=3002 && set P2P_PORT=6002 && set PEERS=ws://localhost:6001,ws://localhost:6003,ws://localhost:6004 && set SECRET_KEY=x]vf4yp0yf && npm start
set HTTP_PORT=3003 && set P2P_PORT=6003 && set PEERS=ws://localhost:6001,ws://localhost:6002,ws://localhost:6004 && set SECRET_KEY=x]vf4yp0yf && npm start
set HTTP_PORT=3004 && set P2P_PORT=6004 && set PEERS=ws://localhost:6001,ws://localhost:6003,ws://localhost:6002 && set SECRET_KEY=x]vf4yp0yf && npm start


curl -H "Content-Type: application/json" -H "Authorization: Bearer x]vf4yp0yf" -X POST  http://localhost:3001/mineEMR -d "{\"data\":{\"user_id\": \"1\", \"fist_name\": \"fistname\", \"last_name\": \"lastname\"}}"

curl -H "Authorization: Bearer x]vf4yp0yf" GET http://localhost:3001/EMRs
curl -H "Authorization: Bearer x]vf4yp0yf" GET http://localhost:3001/EMRs/1

curl -H "Content-Type: application/json" -H "Authorization: Bearer x]vf4yp0yf" -X POST  http://localhost:3001/newToken -d "{\"data\": \"xxx\"}"


Docker

docker-compose up --build

Routes


  POST /api/:hn/admit/:emrId # พยาบาลสร้างรายการ admit
  POST /api/:hn/examination/:emrId # หมอตรวจ
  POST /api/:hn/dispense/:emrId # เภสัชจ่ายยา
  POST /api/:hn/treat/:emrId # หมอ/พยาบาล รักษา

  GET /api/admits # รายการ admit
  GET /api/examinations # รายการ หมอตรวจ
  GET /api/dispenses # รายการ เภสัชจ่ายยา

  GET /api/:hn/emr/:emrId # ข้อมูล เข้ารักษา
  GET /api/:hn/history # ข้อมูลประวัติ

 # :hn id ผู้ป่วย
 # :emrId id เข้ารักษา

Diagram

alt tag


Test

Server down

docker-compose -f docker-compose.test.yml up --build

#call api
curl -H "Authorization: Bearer x]vf4yp0yf" GET http://localhost:8888/EMRs

docker-compose -f docker-compose.test.yml stop first_node

#call api again

docker-compose -f docker-compose.test.yml stop second_node
docker-compose -f docker-compose.test.yml start first_node

health-care-blockchain's People

Contributors

aef-nattanon avatar nattanon-os avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.