nats-server
cd registration-service
go run cmd/main.go -dbName opd_data -dbUser root -dbPassword Root@1985
2021/07/11 13:56:12 Starting NATS Microservices OPD Sample - Registration Service version 0.1.0 2021/07/11 13:56:12 Listening for HTTP requests on 0.0.0.0:9090
cd inspection-service
go run cmd/main.go -dbName opd_data -dbUser root -dbPassword Root@1985
2021/07/11 13:56:18 Starting NATS Microservices OPD Sample - Inspection Service version 0.1.0 2021/07/11 13:56:18 Listening for HTTP requests on 0.0.0.0:9091
cd treatment-service
go run cmd/main.go -dbName opd_data -dbUser root -dbPassword Root@1985
2021/07/11 13:56:26 Starting NATS Microservices OPD Sample - Treatment Service version 0.1.0 2021/07/11 13:56:26 Listening for HTTP requests on 0.0.0.0:9092
cd release-service
go run cmd/main.go -dbName opd_data -dbUser root -dbPassword Root@1985
2021/07/11 13:54:25 Starting NATS Microservices OPD Sample - Release Service version 0.1.0 2021/07/11 13:54:25 Listening for HTTP requests on 0.0.0.0:9093
- Request
curl "http://localhost:9090/opd/patient/register" -X POST -d '{"full_name":"chanaka fernando","address":"44, sw19, london","id":200, "sex":"male", "phone":222222222}'
- Response
{"id":200,"token":1}
- Request
curl "http://localhost:9090/opd/patient/view/200"
- Response
{"full_name":"chanaka fernando","address":"44, sw19, london","id":200, "sex":"male", "phone":222222222}
- Request
curl "http://localhost:9090/opd/patient/update" -X PUT -d '{"full_name":"chanaka fernando","address":"667/280/6, liyanagemulla, seeduwa","id":200, "sex":"male", "phone":222222222}'
- Response
"Record for Patient updated sucessfully"
- Request
curl "http://localhost:9090/opd/patient/token/300"
- Response
{"id":300,"token":2}
- Request
curl "http://localhost:9091/opd/inspection/pending"
- Response
{"id":200,"token":1}
- Request
curl "http://localhost:9091/opd/inspection/record" -X POST -d '{"id":200, "time":"2021/07/12 10:21 AM", "observations":"ABC Syncrome", "medication":"XYZ x 3", "tests":"FBT, UC", "notes":"possible Covid-19"}'
- Response
{"id":200,"medication":"XYZ x 3","tests":"FBT, UC","notes":"possible Covid-19"}
- Request
curl "http://localhost:9091/opd/inspection/history/200"
- Response
[{"id":200,"time":"2021/07/12 10:21 AM","observations":"ABC Syncrome","medication":"XYZ x 3","tests":"FBT, UC","notes":"possible Covid-19"}]
- Request
curl "http://localhost:9092/opd/treatment/pending"
- Response
[{"id":200,"medication":"XYZ x 3","tests":"FBT, UC","notes":"possible Covid-19"}]
- Request
curl "http://localhost:9092/opd/treatment/medication" -X POST -d '{"id":200,"time":"2021 07 12 4:35 PM","dose":"xyz x 1, abc x 2","notes":"low fever"}'
- Response
"Record updated successfully"
- Request
curl "http://localhost:9092/opd/treatment/tests" -X POST -d '{"id":200,"time":"2021 07 12 4:35 PM","test_name":"FBC","status":"sample collected", "notes":"possible covid-19"}'
- Response
"Test recorded successfully"
- Request
curl "http://localhost:9092/opd/treatment/history/200"
- Response
[{"id":200,"time":"2021 07 12 4:35 PM","notes":"low fever"},{"id":200,"time":"2021 07 12 4:35 PM","notes":"low fever"}]
- Request
curl "http://localhost:9092/opd/treatment/tests/200"
- Response
[{"id":200,"time":"2021 07 12 4:35 PM","test_name":"FBC","status":"sample collected","notes":"possible covid-19"}]
- Request
curl "http://localhost:9092/opd/treatment/release" -X POST -d '{"id":200,"time":"2021 07 12 8:35 PM","next_state":"discharge","post_medication":"NM x 10 days"}'
- Response
"Release event published"
- Request
curl "http://localhost:9093/opd/release/pending"
- Response
[{"id":200,"time":"2021 07 12 8:35 PM","next_state":"discharge","post_medication":"NM x 10 days"}]
- Request
curl "http://localhost:9093/opd/release/discharge" -X POST -d '{"id":200,"time":"2021 07 12 9:35 PM","state":"discharge","post_medication":"NM x 10 days","next_visit":"2021 08 12 09:00AM"}'
- Response
"Patient discharge recorded successfully"
- Registration Service - 9090
- Inspection Service - 9091
- Treatment Service - 9092
- Release Service - 9093