Giter Site home page Giter Site logo

hospitalrun / hospitalrun-server Goto Github PK

View Code? Open in Web Editor NEW
864.0 63.0 631.0 1.6 MB

Backend for HospitalRun

Home Page: https://hospitalrun.io

License: MIT License

JavaScript 66.88% TypeScript 33.12%
nodejs fastify hospitalrun backend hospitalrun-server

hospitalrun-server's Introduction

HospitalRun Server

Status Release Version GitHub CI Coverage Status Language grade: JavaScript Code scanning Documentation Status FOSSA Status Commitizen friendly dependabot Slack

Node.js backend for HospitalRun: free software for developing world hospitals. To contribute, follow the guidelines in this readme or alternatively ask for details on the community Slack channel: #contributors.


This repository is for the HospitalRun v2 and it is currently under heavy development. If you are searching for the no longer supported version 1.0.0-beta, you can find it here.

Contributing

Contributions are always welcome. Before contributing please read our contributor guide. Then follow these steps:

  1. Fork this repository to your own GitHub account
  2. Clone it to your local machine
  3. Navigate to the cloned folder: cd hospitalrun-server
  4. Install the dependencies: npm install
  5. Check that env variables are set correctly
  6. Run npm run dev to build and watch for code changes:

Working on Issues

In order to optimize the workflow and to prevent multiple contributors working on the same issue without interactions, a contributor must ask to be assigned to an issue by one of the core team members: it's enough to ask it inside the specific issue.

Environment

In order to run hospitalrun-server you need to set the correct environment variables. Since dotenv is already included, it is just matter of renaming .env.example file to .env: this file include all of the mandatory defaults.

Development Database

This project uses pouchdb-server for development and you, as contributor, don't need to provide your own CouchDB instance. Upon first run of the dev script (npm run dev), a new data folder will be created inside the ./db folder. The database credentials are: username: dev and password: dev. The file ./db/config.json contains the DB's configuration: you can change it if you want, but please don't commit any changes to it.

Note: PouchDB-server is meant to be use only during development. Please don't deploy any production/testing HospitalRun instances on it. For production deployments please follow the deployment guide.

Tests

Every code additions or fixs on the existing code, has to be tested. This project uses node-tap as test runner. To run all tests use npm run test.

How to commit

This repo uses Conventional Commits. Commitizen is mandatory for making proper commits. Once you have staged your changes, can run npm run commit from the root directory in order to commit following our standards.

Documentation

DataBase

Read more at HospitalRun DataBase.

Plugins

Read more at HospitalRun Plugins.

Services

Read more at HospitalRun Services.

License

Released under the MIT license.

hospitalrun-server's People

Contributors

ariscris avatar dependabot-preview[bot] avatar dependabot[bot] avatar donaldwasserman avatar drakemedic avatar fgiorlando avatar fossabot avatar fox1t avatar greenkeeper[bot] avatar hpierce1102 avatar jackcmeyer avatar jkleinsc avatar kenyangeek avatar matteovivona avatar matthewdorner avatar mofesola avatar nclbaz avatar pgte avatar phearzero avatar professorhaseeb avatar rwanyoike avatar schneems avatar semantic-release-bot avatar serg123e avatar snyk-bot avatar stukalin avatar tangollama avatar thorsteinsson avatar toshihidetagami avatar turbomack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hospitalrun-server's Issues

estimatedDaysOfStock: a server-calculated field processed for inventory item adjustments

One of the objectives of the inventory system is to help hospital admins know what items are and are not in danger of stocking out. To support this, we added a rank field (A,B,C) through the following issues for frontend:

HospitalRun/hospitalrun-frontend#207
HospitalRun/hospitalrun-frontend#209

Related to this PR (HospitalRun/hospitalrun-frontend#232), we now need a new calculated field on an item that is recalculated each time stock is adjusted that estimates the number of days left of stock.

screen shot 2015-12-11 at 1 31 39 pm

Essentially, we need to run the Days Supply Left In Stock report for a given item for the last year of activity and then stores that value in a field called estimatedDaysOfStock. That will allow the stock "condition" calculated field to accurately represent both the relative importance and quantity of a stock item.

VPS docker deployment does not work

already git clone the hospitalrun-server, change the DOMAIN-NAME in the docker-compose.yml but when i run docker-compose up --build -d crash with the following error.

ERROR: Service 'hospitalrun' failed to build: The command '/bin/sh -c npm install --loglevel silent' returned a non-zero code: 1

Do not use POST requests for everything

Most routes are use HTTP POST even to fetch a resource, which does not conform to REST philosophy. They should be rewritten to use the appropriate HTTP verbs based on their function.

From a very cursory examination, /chkuser, /getuser and /allusers should be GET, /deleteusers should be DELETE and /updateuser should be a PUT/PATCH request.

The changes are minimal, I can submit a PR if you are interested.

Hospitalrun-server's npm start fails to start (root path required).

Hospitalrun-server's npm start fails to start (root path required).

NodeJS: 7.4.0
npm: 3.5.2
OS: Ubuntu 16.04

~/hospitalrun-server$ npm start

> [email protected] start /home/ubuntu/hospitalrun-server
> node app.js

/home/ubuntu/hospitalrun-server/node_modules/serve-static/index.js:40
    throw new TypeError('root path required')
    ^

TypeError: root path required
    at Function.serveStatic [as static] (/home/ubuntu/hospitalrun-server/node_modules/serve-static/index.js:40:11)
    at module.exports (/home/ubuntu/hospitalrun-server/node_modules/hospitalrun-server-routes/routes/05-static-routes.js:5:41)
    at /home/ubuntu/hospitalrun-server/node_modules/hospitalrun-server-routes/index.js:5:5
    at Array.forEach (native)
    at module.exports (/home/ubuntu/hospitalrun-server/node_modules/hospitalrun-server-routes/index.js:4:10)
    at Object.<anonymous> (/home/ubuntu/hospitalrun-server/app.js:18:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)

npm ERR! Linux 4.4.0-59-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node app.js`
npm ERR! Exit status 1
npm ERR! 

Any ideas what might be causing this?

Thanks.

Docker Server - No access to CouchDB

With the Docker server install on Ubuntu Server, there is no port 5984 couchdb service running. Thus no way to manage the database. However, HR is allowing me to enter patients and change lists.

Server Not running on Reboot

Using Docker installed on DigitalOcean Ubuntu Server. Install ran smoothly. Prior to Reboot, was able to log into HR just fine. After server Reboot, none of the Docker images are running.

"docker ps -a" gives me a listing of images, but None are running. I tried "docker start hospitalrun" but that errors out complaining of missing image services. I do not know proper order of re-starting things.

I have gone thru this process with multiple in DigitalOcean images. It always works fine until reboot.

?? Documentation does not say anything about a boot/startup script.

BTW: I posted on Slack about this problem weeks ago. No response. I am trying to get a server up and running for One World Health.

elasticsearch_hr Not running

Hi,

I'm trying to install hopitalrun, but after configuring and running docker, one of the instance is not starting.

[root@hospital-test ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c27fee3d3ca6 hospitalrun_nginx "/bin/sh -c /etc/n..." 18 hours ago Up 18 hours 0.0.0.0:443->443/tcp, 0.0.0.0:8055->80/tcp hospitalrunserver_nginx_1
92cf1f499ff8 hospitalrun "/bin/sh -c ./entr..." 18 hours ago Up 18 hours 3000/tcp hospitalrun
3199800d558f hospitalrun_logstash "/usr/local/bin/do..." 18 hours ago Up 18 hours 5044/tcp, 9600/tcp logstash_hr
8737b5b121ee docker.elastic.co/elasticsearch/elasticsearch:5.3.1 "/bin/bash bin/es-..." 18 hours ago Exited (1) 17 seconds ago elasticsearch_hr
a476796c346a couchdb:1.6 "tini -- /docker-e..." 18 hours ago Up 18 hours 0.0.0.0:5985->5984/tcp couchdb_hr

All the other except elastricsearch is running fine. While checking logs, it was showing below messages.

[2017-10-20T10:19:19,933][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Failed to created node environment
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:58) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.3.1.jar:5.3.1]
Caused by: java.lang.IllegalStateException: Failed to created node environment
at org.elasticsearch.node.Node.(Node.java:265) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.node.Node.(Node.java:242) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.bootstrap.Bootstrap$6.(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1]
... 6 more
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:?]
at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_121]
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_121]
at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_121]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:221) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.node.Node.(Node.java:262) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.node.Node.(Node.java:242) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.bootstrap.Bootstrap$6.(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1]
... 6 more

Can any one help me on this

Error getting configurations to update & Error creating push database

i could install and run couchdb but when i try to run the server it throws me this error.

HospitalRun server listening on {"address":"::","family":"IPv6","port":3000}
Error getting configurations to update { Error: getaddrinfo ENOTFOUND couchdb couchdb:5984
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:73:26)
  name: 'Error',
  scope: 'socket',
  errid: 'request',
  code: 'ENOTFOUND',
  errno: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'couchdb',
  host: 'couchdb',
  port: '5984',
  description: 'getaddrinfo ENOTFOUND couchdb couchdb:5984',
  stacktrace: 
   [ 'Error: getaddrinfo ENOTFOUND couchdb couchdb:5984',
     '    at errnoException (dns.js:28:10)',
     '    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:73:26)' ] }
Error creating push database! { Error: getaddrinfo ENOTFOUND couchdb couchdb:5984
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:73:26)
  name: 'Error',
  scope: 'socket',
  errid: 'request',
  code: 'ENOTFOUND',
  errno: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'couchdb',
  host: 'couchdb',
  port: '5984',
  description: 'getaddrinfo ENOTFOUND couchdb couchdb:5984',
  stacktrace: 
   [ 'Error: getaddrinfo ENOTFOUND couchdb couchdb:5984',
     '    at errnoException (dns.js:28:10)',
     '    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:73:26)' ] }


i am not getting where is the issue.. tried all the posts available but no luck.. please help me what is going wrong..
ubuntu 14.04 32 bit
couchdb 1.6.1
node v7.8.0
npm 4.2.0

Security Concerns

Hi,

Great project! I've looked at the server side and I'm interested how you handle the security as I've looked at CouchDB and the way you simply proxy it. Are you using the CouchDB role system? How are the different roles setup, via _design documents? I've not found a setup script or sth.

BR toovy

Identify and document which versions of frontend are compatible with which versions of backend.

In case backwards incompatible changes are introduced, for instance to resolve #3, there must not be any ambiguity about which version of backend and which version of frontend can be used together.

One way is to version the API, and document the api versions provided by backend and required by client. Semantic versioning guidelines can be used to increment version numbers when changes are introduced, and by looking at the versions of backend and frontend, one can easily determine if they are compatible.

Missing tests.

For avoiding future regressions it will be good to add tests to this project as soon as possible.

Supporting anonymous research data

We need an automated strategy for supporting anonymized data sets for research. By anonymized, I'm specifically calling out dropping identifier information in patient records like:

  • First and Last Name
  • Street Address
  • Phone number
  • Email
  • Names and addresses of related contacts

It feels to me like this feature ought to be focused around filtered replication in couch to handle specific records as a research copy of the data. That said, I don't have the technical details worked out... which is why someone needs to own this as a feature.

deployment on VPS with docker

I followed the steps building hr-server on VPS using docker-compose but it fails all the time.

here are the logs for each container:

# hospitalrun:

hospitalrun | > [email protected] start /usr/src/app hospitalrun | > node app.js hospitalrun | hospitalrun | Loading raml proxy - this may take a while... hospitalrun | Error getting configurations to update { Error: Name or password is incorrect. hospitalrun | at Request._callback (/usr/src/app/node_modules/nano/lib/nano.js:248:15) hospitalrun | at Request.self.callback (/usr/src/app/node_modules/nano/node_modules/request/request.js:186:22) hospitalrun | at emitTwo (events.js:106:13) hospitalrun | at Request.emit (events.js:191:7) hospitalrun | at Request.<anonymous> (/usr/src/app/node_modules/nano/node_modules/request/request.js:1163:10) hospitalrun | at emitOne (events.js:96:13) hospitalrun | at Request.emit (events.js:188:7) hospitalrun | at IncomingMessage.<anonymous> (/usr/src/app/node_modules/nano/node_modules/request/request.js:1085:12) hospitalrun | at IncomingMessage.g (events.js:292:16) hospitalrun | name: 'Error', hospitalrun | error: 'unauthorized', hospitalrun | reason: 'Name or password is incorrect.', hospitalrun | scope: 'couch', hospitalrun | statusCode: 401, hospitalrun | request: hospitalrun | { method: 'POST', hospitalrun | headers: hospitalrun | { 'content-type': 'application/json', hospitalrun | accept: 'application/json' }, hospitalrun | uri: 'http://XXXXXX:XXXXXX@couchdb:5984/config/_all_docs', hospitalrun | qs: { include_docs: true }, hospitalrun | body: '{"keys":["config_disable_offline_sync","config_use_google_auth","config_log_metrics","config_external_search","config_push_public_key"]}' }, hospitalrun | headers: hospitalrun | { date: 'Tue, 23 Jan 2018 15:14:23 GMT', hospitalrun | 'content-type': 'application/json', hospitalrun | 'cache-control': 'must-revalidate', hospitalrun | statusCode: 401, hospitalrun | uri: 'http://XXXXXX:XXXXXX@couchdb:5984/config/_all_docs' }, hospitalrun | errid: 'non_200', hospitalrun | description: 'couch returned 401' } hospitalrun | Error creating push database! { Error: Name or password is incorrect. hospitalrun | at Request._callback (/usr/src/app/node_modules/nano/lib/nano.js:248:15) hospitalrun | at Request.self.callback (/usr/src/app/node_modules/nano/node_modules/request/request.js:186:22) hospitalrun | at emitTwo (events.js:106:13) hospitalrun | at Request.emit (events.js:191:7) hospitalrun | at Request.<anonymous> (/usr/src/app/node_modules/nano/node_modules/request/request.js:1163:10) hospitalrun | at emitOne (events.js:96:13) hospitalrun | at Request.emit (events.js:188:7) hospitalrun | at IncomingMessage.<anonymous> (/usr/src/app/node_modules/nano/node_modules/request/request.js:1085:12) hospitalrun | at IncomingMessage.g (events.js:292:16) hospitalrun | name: 'Error', hospitalrun | error: 'unauthorized', hospitalrun | reason: 'Name or password is incorrect.', hospitalrun | scope: 'couch', hospitalrun | statusCode: 401, hospitalrun | request: hospitalrun | { method: 'PUT', hospitalrun | headers: hospitalrun | { 'content-type': 'application/json', hospitalrun | accept: 'application/json' }, hospitalrun | uri: 'http://XXXXXX:XXXXXX@couchdb:5984/pushinfo' }, hospitalrun | headers: hospitalrun | { date: 'Tue, 23 Jan 2018 15:14:23 GMT', hospitalrun | 'content-type': 'application/json', hospitalrun | 'cache-control': 'must-revalidate', hospitalrun | statusCode: 401, hospitalrun | uri: 'http://XXXXXX:XXXXXX@couchdb:5984/pushinfo' }, hospitalrun | errid: 'non_200', hospitalrun | description: 'couch returned 401' }

# couchdb

couchdb | Apache CouchDB 1.7.1 (LogLevel=info) is starting. couchdb | Apache CouchDB has started. Time to relax. couchdb | [info] [<0.32.0>] Apache CouchDB has started on http://0.0.0.0:5984/ couchdb | [info] [<0.109.0>] 172.18.0.5 - - GET /_users 401 couchdb | [info] [<0.108.0>] 172.18.0.5 - - GET /main 401 couchdb | [info] [<0.107.0>] 172.18.0.5 - - GET /pushinfo 401 couchdb | [info] [<0.106.0>] 172.18.0.5 - - POST /config/_all_docs?include_docs=true 401 couchdb | [info] [<0.110.0>] 172.18.0.5 - - PUT /pushinfo 401 couchdb | [info] [<0.121.0>] 172.18.0.5 - - PUT /_config/admins/couchadmin 200 couchdb | [info] [<0.120.0>] 172.18.0.5 - - PUT /_users/_security 200 couchdb | [error] [<0.192.0>] Could not open file /usr/local/var/lib/couchdb/config.couch: file already exists couchdb | [info] [<0.160.0>] 172.18.0.5 - - PUT /config 412 couchdb | [info] [<0.158.0>] 172.18.0.5 - - PUT /config/_security 200 couchdb | [info] [<0.157.0>] 172.18.0.5 - - PUT /config/_design/auth 409 couchdb | [error] [<0.206.0>] Could not open file /usr/local/var/lib/couchdb/main.couch: file already exists couchdb | [info] [<0.159.0>] 172.18.0.5 - - PUT /main 412 couchdb | [info] [<0.163.0>] 172.18.0.5 - - PUT /main/_security 200 couchdb | [info] [<0.186.0>] 172.18.0.5 - - PUT /main/_design/auth 409 couchdb | [info] [<0.190.0>] 172.18.0.5 - - PUT /_config/http/authentication_handlers 200 couchdb | [info] [<0.111.0>] 172.18.0.5 - - PUT /_config/couch_httpd_oauth/use_users_db 200 couchdb | [info] [<0.112.0>] 172.18.0.5 - - PUT /_users/org.couchdb.user:hradmin 409 couchdb | [info] [<0.113.0>] 172.18.0.5 - - PUT /main/fhir_audit 409 couchdb | [info] [<0.114.0>] 172.18.0.4 - - GET /main/_changes?feed=continuous&include_docs=true&since=3&heartbeat=1000 200

# elasticsearch

elasticsearch | [2018-01-23T15:10:20,004][INFO ][o.e.n.Node ] [] initializing ... elasticsearch | [2018-01-23T15:10:20,069][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main] elasticsearch | org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Failed to created node environment elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:58) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | Caused by: java.lang.IllegalStateException: Failed to created node environment elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:265) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | ... 6 more elasticsearch | Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes elasticsearch | at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?] elasticsearch | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?] elasticsearch | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?] elasticsearch | at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:?] elasticsearch | at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_121] elasticsearch | at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_121] elasticsearch | at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_121] elasticsearch | at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:221) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:262) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | ... 6 more elasticsearch | [2018-01-23T15:14:18,423][INFO ][o.e.n.Node ] [] initializing ... elasticsearch | [2018-01-23T15:14:18,581][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main] elasticsearch | org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Failed to created node environment elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:58) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | Caused by: java.lang.IllegalStateException: Failed to created node environment elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:265) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | ... 6 more elasticsearch | Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes elasticsearch | at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?] elasticsearch | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?] elasticsearch | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?] elasticsearch | at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:?] elasticsearch | at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_121] elasticsearch | at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_121] elasticsearch | at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_121] elasticsearch | at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:221) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:262) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | ... 6 more elasticsearch exited with code 1

# nginx

nginx_1 | Bootstrapping dependencies for Debian-based OSes... nginx_1 | Hit http://security.debian.org jessie/updates InRelease nginx_1 | Hit http://nginx.org jessie InRelease nginx_1 | Ign http://deb.debian.org jessie InRelease nginx_1 | Get:1 http://security.debian.org jessie/updates/main amd64 Packages [607 kB] nginx_1 | Hit http://deb.debian.org jessie-updates InRelease nginx_1 | Hit http://deb.debian.org jessie Release.gpg nginx_1 | Get:2 http://nginx.org jessie/nginx amd64 Packages [38.6 kB] nginx_1 | Hit http://deb.debian.org jessie Release nginx_1 | Get:3 http://deb.debian.org jessie-updates/main amd64 Packages [23.1 kB] nginx_1 | Get:4 http://deb.debian.org jessie/main amd64 Packages [9064 kB] nginx_1 | Fetched 9733 kB in 26s (372 kB/s) nginx_1 | Reading package lists... nginx_1 | Reading package lists... nginx_1 | Building dependency tree... nginx_1 | Reading state information... nginx_1 | augeas-lenses is already the newest version. nginx_1 | libaugeas0 is already the newest version. nginx_1 | ca-certificates is already the newest version. nginx_1 | gcc is already the newest version. nginx_1 | libffi-dev is already the newest version. nginx_1 | libssl-dev is already the newest version. nginx_1 | openssl is already the newest version. nginx_1 | openssl set to manually installed. nginx_1 | python is already the newest version. nginx_1 | python-dev is already the newest version. nginx_1 | python-virtualenv is already the newest version. nginx_1 | virtualenv is already the newest version. nginx_1 | 0 upgraded, 0 newly installed, 0 to remove and 44 not upgraded. nginx_1 | Upgrading certbot-auto 0.12.0 to 0.21.0... nginx_1 | Replacing certbot-auto... nginx_1 | Creating virtual environment... nginx_1 | Installing Python packages... nginx_1 | Installation succeeded. nginx_1 | Saving debug log to /var/log/letsencrypt/letsencrypt.log nginx_1 | Plugins selected: Authenticator standalone, Installer None nginx_1 | Obtaining a new certificate nginx_1 | Performing the following challenges: nginx_1 | http-01 challenge for rek.devagnos.cloud nginx_1 | Cleaning up challenges nginx_1 | Problem binding to port 80: Could not bind to IPv4 or IPv6. nginx_1 | Saving debug log to /var/log/letsencrypt/letsencrypt.log nginx_1 | Plugins selected: Authenticator standalone, Installer None nginx_1 | Obtaining a new certificate nginx_1 | Performing the following challenges: nginx_1 | http-01 challenge for rek.devagnos.cloud nginx_1 | Cleaning up challenges nginx_1 | Problem binding to port 80: Could not bind to IPv4 or IPv6.

# logstash

logstash | [2018-01-23T15:18:21,752][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x70a2aa4 URL:http://elastic:xxxxxx@elasticsearch:9200/>, :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elastic:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch"} logstash | [2018-01-23T15:18:21,752][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x3a19e6f5 URL:http://elastic:xxxxxx@elasticsearch:9200/>, :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elastic:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch"} logstash | [2018-01-23T15:18:24,644][WARN ][logstash.outputs.elasticsearch] UNEXPECTED POOL ERROR {:e=>#<LogStash::Outputs::ElasticSearch::HttpClient::Pool::NoConnectionAvailableError: No Available connections>} logstash | [2018-01-23T15:18:24,650][ERROR][logstash.outputs.elasticsearch] Attempted to send a bulk request to elasticsearch, but no there are no living connections in the connection pool. Perhaps Elasticsearch is unreachable or down? {:error_message=>"No Available connections", :class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::NoConnectionAvailableError", :will_retry_in_seconds=>64} logstash | [2018-01-23T15:18:26,746][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://elastic:xxxxxx@elasticsearch:9200/, :path=>"/"} logstash | [2018-01-23T15:18:26,757][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://elastic:xxxxxx@elasticsearch:9200/, :path=>"/"} logstash | [2018-01-23T15:18:26,758][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://elastic:xxxxxx@elasticsearch:9200/, :path=>"/"} logstash | [2018-01-23T15:18:26,825][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x46987b25 URL:http://elastic:xxxxxx@elasticsearch:9200/>, :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elastic:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch"} logstash | [2018-01-23T15:18:26,836][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x6ecfff3a URL:http://elastic:xxxxxx@elasticsearch:9200/_xpack/monitoring/?system_id=logstash&system_api_version=2&interval=1s>, :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elastic:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch"} logstash | [2018-01-23T15:18:26,832][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x1127968d URL:http://elastic:xxxxxx@elasticsearch:9200/>, :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elastic:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch: Name or service not known"}

docker-compose ps
Name                   Command               State                      Ports
-----------------------------------------------------------------------------------------------------
couchdb          tini -- /docker-entrypoint ...   Up       0.0.0.0:5985->5984/tcp
elasticsearch    /bin/bash bin/es-docker          Exit 1
hospitalrun      /bin/sh -c ./entrypoint.sh       Up       3000/tcp
logstash         /usr/local/bin/docker-entr ...   Up       5044/tcp, 9600/tcp
server_nginx_1   /bin/sh -c /etc/nginx/entr ...   Up       0.0.0.0:443->443/tcp, 0.0.0.0:8055->80/tcp```

Docker containers?

Did you think about adding docker containers (maybe with docker-compose) to make development and production setup easier? Maybe this can be way to go to made deployment and services management (elastic, couchdb, app server) easier.

Performance issues

Hi, I am experiencing serious performance lack in Hospital Run.
Specifically client side, the browser just hangs.
I think its due to PuchDb, any pointers or improvement suggestions will be greatly appreciated.

'Session Expired' error while trying to add users

I followed the docker deployment instructions and the application is running on http://localhost:8055 but when I try navigating to 'Administration/Users' I get a Session Expired pop up.

screen shot 2017-05-24 at 12 10 09 am

Here are the log entries

...
couchdb_hr       | [info] [<0.8837.0>] 172.18.0.5 - - GET /_users/_all_docs?include_docs=true&startkey=%22org.couchdb.user%22 403
nginx_1          | 172.18.0.1 - - [23/May/2017:18:39:47 +0000] "GET /db/_users/_all_docs?include_docs=true&startkey=%22org.couchdb.user%22 HTTP/1.1" 403 87 "http://localhost:8055/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.1 Safari/603.1.30"
...

❯ git describe --tags
1.0.0-beta

I have tried installing HospitalRun on my laptop (OSX) and Google Compute Engine (Ubuntu).

Where should I be looking?

Intercepting a medication request based on business rules

This issue is further / better explained in #21

Concept: Physicians need to just enter a medication request, lab request, imaging request. The system on the other hand needs to (potentially) process the workflow for those requests differently depending on whether a request is tied to an outpatient or inpatient visit.

Therefore, for the labs, medication, and imaging queues, the system should:

  1. Allow for a configuration of the each of those queues to use the following workflow / business rules management
  2. If configured to do so, an outpatient request for (for instance) medication should first examine the visit type. If outpatient, place the medication request in a "Pending Payment" status and create a Bill for the cashier to process.
  3. Once paid, the request should show up in the pharmacy queue.
  4. For in-patient, no workflow is needed

Eventually, we want even more flexibility in each of these queues, so the notion of creating (or implementing) a Node library for workflow management would be wise.

Optimizing Production Deployment

Hi team,

I was searching through the GitHub when I came across this project. As a developer working in Healthcare field, I would like to contribute to the project as well.

These are some suggestions/questions that came to my mind after a quick look through the repository.

  • The NodeJS part is scattered across the repository. It could be moved to a single folder along with the Dockerfile. This will result is separate folders for each of the components required for docker-compose.
  • The base image used for the NodeJS part is node:boron and the build is done inside the container. Although this simplifies the build process, it makes the image heavy. node:boron-slim image is less than half the size of the current image and provides the same functionality. curl also comes in-built.
  • Further optimizations are possible in Dockerfile code, and further more if we put all the NodeJS code in one folder. For example, separate mkdir command is not required.
  • The only parameter required to be edited before running the application is the DOMAIN_NAME parameter in docker-compose.yml. This also means that we can supply the built Docker images over Docker Hub, and refer them in the docker-compose.yml rather than building them everytime. This will ensure that the software can be deployed with consistent dependencies. This could be added as an option for people who wish to deploy it direclty into production.
  • The documentation seems to be lacking descriptions for some of the entries (such as the key files).

And out of curiosity, few more question.

  • Is there any plans of supporting deployment on Kubernetes or Docker Swarm?
  • Is there already a CI-CD pipeline setup for this repository? I could see a .travis.yml but no build status embedded in the README. Also couldn't find anything on Travis Portal.

Regards

Lallu

Data import Challenges

I have been trying to import data and have hit snags in the following areas:

Inventory: There was an issue out there on using utils script to import data. Anybody managed to import an inventory list?

Labs and Imaging: The "backend" meant to update the lab and imaging procedures is "broken."i.e. There is no upload button on the look up list on these as well as ways to adjust the type as is provided in procedures and wards. Anybody managed to do this without having to do it manually from the frontend?

LoadDB: How can we use this to import a extensive patient list and other lists in HR? Basically how is it meant to work? Importing a csv leads to errors.

Fix formatting/add style guide

Just like HospitalRun/hospitalrun-frontend there should be formatting/style guide used via jscs and existing code should be reformatted to follow that guide.

Session Expire Immediately

I've setup HospitalRun server in an LXC on top of Ubuntu server. Docker was installed and the install went fine. Since initial access requires GUI login from localhost, I've managed to enable xfce and connect via VNC.

Default initial login works, but a pop up would immediately comes up and say "Session expired..."

p/s: I'm saying "initial access requires GUI login from localhost", because access from the network would give me 302 when I connect to http://hostname:8055

Git Clone AUthentication Issues

I try to clone the repository and i keep getting this Below

git clone [email protected]:HospitalRun/hospitalrun-server.git
Cloning into 'hospitalrun-server'...
The authenticity of host 'github.com (192.30.253.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
sh-3.2#

Intercept Visit creation to determine payment workflow

  • If the Visit Type is Admission, check the workflow configuration that defines whether a deposit is needed. If yes, notify the user that saved the record that the patient must be directed to the Cashier's desk.
  • If the Visit Type is Clinic, check the workflow configuration that defines Clinic Visit prepayment is required. If yes, put the Visit in a Pending Payment payment_state and notify the user that saved the record that the patient must be directed to the Cashier's desk.
  • If the Visit Type is Followup, check the workflow configuration that defines Followup Visit prepayment is required. If yes, put the Visit in a Pending Payment payment_state and notify the user that saved the record that the patient must be directed to the Cashier's desk.
  • If the Visit Type is Lab, check the workflow configuration that defines if Outpatient Lab prepayment is required. If yes, put the Visit in a Pending Payment payment_state and notify the user that saved the record that the patient must be directed to the Cashier's desk.
  • If the Visit Type is Clinic or Followup and a Lab Request is created by the Examiner, check the workflow configuration that defines if Outpatient Lab prepayment is required. If yes, put the Visit in a Pending Payment payment_state and notify the user that saved the record that the patient must be directed to the Cashier's desk.
  • If the Visit Type is Imaging, check the workflow configuration that defines Outpatient Imaging prepayment is required. If yes, put the Visit in a Pending Payment payment_state and notify the user that saved the record that the patient must be directed to the Cashier's desk.
  • If the Visit Type is Clinic or Followup and a Imaging Request is created by the Examiner, check the workflow configuration that defines if Outpatient Imaging prepayment is required. If yes, put the Visit in a Pending Payment payment_state and notify the user that saved the record that the patient must be directed to the Cashier's desk.
  • If the Visit Type is Medication, check the workflow configuration that defines Outpatient Medication prepayment is required. If yes, put the Visit in a Pending Payment payment_state and notify the user that saved the record that the patient must be directed to the Cashier's desk.
  • If the Visit Type is Clinic or Followup and a Lab Request is created by the Examiner, check the workflow configuration that defines if Outpatient Medication prepayment is required. If yes, put the Visit in a Pending Payment payment_state and notify the user that saved the record that the patient must be directed to the Cashier's desk.

Note

hospitalrun patient flow

Moving the existing reporting to the Node server backend

The ticket was first logged here: HospitalRun/hospitalrun-frontend#204

The move could be fairly straightforward for a Node developer, because: Javascript.

The concept here is that the frontend would now become more of a proxy to the node backend request vs. the system processing the business logic. To do that, the framework for making the call to an endpoint / endpoints on the server needs to be created and the report-generating logic from the following files needs to be moved from the frontend code base an appropriate place in the server codebase. That list is.

Ideally the node endpoints would return the reports in the JSON API format since that is the default for Ember Data.

Hospitalrun not performing logins.

Hi,

I installed CouchDB 1.6, hospital-run-server, ran npm install then npm start and this time I am on defaults and also following the setup guide to the letter. After logging in I see basically nothing and the only working event is the settings button (logout/about).

Database setup (http://localhost:5984/_utils/index.html):

[~/vagrant_trusty/hospitalrun-server] $ initcouch.sh
""
{"ok":true}
{"ok":true}
{"ok":true}
{"ok":true}
{"ok":true}
"{couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, proxy_authentification_handler}, {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}"
"true"
{"ok":true,"id":"org.couchdb.user:hradmin","rev":"1-edefdea74a4de3c96f0764a90ed0b522"}

config.js:

var config = {
  couchDbServer: 'localhost',
  couchDbPort: '5984',
  couchDbUseSsl: false,
  couchDbChangesSince: 'now',
  couchAdminUser: 'COUCH ADMIN USER GOES HERE',
  couchAdminPassword: 'COUCH ADMIN PASSWORD GOES HERE',
  googleClientId: 'FOR GOOGLE SSO; GOOGLE CLIENT ID GOES HERE',
  googleClientSecret: 'FOR GOOGLE SSO; GOOGLE CLIENT SECRET GOES HERE',
  serverPort: '3000',
  server: 'localhost',
  sslCert: 'file location of ssl cert if needed',
  sslKey: 'file location of ssl key if needed',
  sslCA: [], // Array of file locations of trusted certificates in PEM format if needed
  useSSL: false,
  imagesdir: __dirname + '/patientimages',
  logRequests: false,
  logFormat: 'default', // See http://www.senchalabs.org/connect/logger.html for log formats
  useGoogleAuth: false,
  useCertBot: false
};

Screenshots of what happens when I click login:

https://www.dropbox.com/sh/vi4sea2fk87w8de/AAB9Ctw2lz7vVw8eo6bhq88Sa?dl=0

Thanks.

Production Environment Gives 502 Gateway Error

I created the Docker 17.06.0-ce on 16.04 Droplet and composed hospitalrun-server docker container. I done DNS config, installed nginx and configured ufw.

I follow the Step-by-Step Guide to deploy.

My dockers are healthy,

docker ps
CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS              PORTS                                                  NAMES
53704c8cba8d        hospitalrun_nginx      "/bin/sh -c /etc/n..."   2 hours ago         Up 2 hours          80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8055->8080/tcp   hospitalrunserver_nginx_1
ea3888970ac8        hospitalrun            "/bin/sh -c ./entr..."   2 hours ago         Up 2 hours          3000/tcp                                               hospitalrun
fd8ad7612a5c        hospitalrun_logstash   "/usr/local/bin/do..."   15 hours ago        Up 2 hours          5044/tcp, 9600/tcp                                     logstash_hr
e837f6ba143e        couchdb:1.6            "tini -- /docker-e..."   15 hours ago        Up 2 hours          0.0.0.0:5985->5984/tcp                                 couchdb_hr

netstat command's output is,

$ netstat -plutn 
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      17601/nginx -g daem
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1368/sshd       
tcp6       0      0 :::80                   :::*                    LISTEN      17601/nginx -g daem
tcp6       0      0 :::22                   :::*                    LISTEN      1368/sshd       
tcp6       0      0 :::8055                 :::*                    LISTEN      4012/docker-proxy
tcp6       0      0 :::443                  :::*                    LISTEN      4031/docker-proxy
tcp6       0      0 :::5985                 :::*                    LISTEN      3364/docker-proxy

My droplet' nginx configuration file is,

worker_processes 1;

events { worker_connections 1024; }

http {
    upstream website {
        server 172.18.0.6:8055;
    }

    server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;
        #server_name 185.14.187.134 app.bulut.dental;
        server_name app.bulut.dental;

        gzip_types text/plain text/css application/json application/x-javascript
                   text/xml application/xml application/xml+rss text/javascript;

        location / {
            proxy_pass http://website;
            #include /etc/nginx/proxy_params;
            #include /etc/nginx/mime.types;
        }
    }
}

Each http://185.14.187.134 and http://app.bulut.dental are produced the 502 gateway error. My nginx error' part is,

2017/08/16 13:06:32 [error] 17602#17602: *9 connect() failed
(111: Connection refused) while connecting to upstream, 
client: 162.158.111.xx, server: app.bulut.dental,
request: "GET / HTTP/1.1", upstream: "http://172.18.0.6:8055/",
host: "app.bulut.dental"

I'm not sure whether or not i install the hospitalrun-frontend. I tested successfully hospitalrun-server in local machine but i get error in my droplet.

Can you offer any guide or tutorial for production environment (specifically docker)? Thanks for your time and interest

Rel: https://www.digitalocean.com/community/questions/nginx-502-gateway-error-with-docker

Build the basis for the notification framework

There are numerous notification requirements / opportunities in the system; but the biggest need is to think through the framework for registering and delivering notifications.

Notification types should at least begin with:

  • Email
  • A notifications interface on the home screen of HospitalRun

In the future, tying into a text messaging service or even a mobile version of the system could be supported. The point is that the framework needs to allow developers to easily register to listen for notifications surrounding a given object (or document) and then to deliver a series of notifications based on an event.

Please consider Postgres as a DB alternative

Using a standard SQL database, backed by many enterprises, would help a little in convincing potential customers to consider switching to HospitalRun.
Also, standard existing tools would work too, no need to write custom scripts to export/import CSV.

Thanks

Inventory Import needs to be updated to new schema

Since the move to ember-pouch, https://github.com/HospitalRun/hospitalrun-server/blob/master/utils/inv-import.js does not properly load inventory data. The script needs to be updated to load the inventory data using the ember-pouch schema, eg:

{
  "_id": "inventory_2_iiqtc6w3_31",
  "_rev": "4-8b68967daca21a66f63837d3900439cb",
  "data": {
    "distributionUnit": "vial",
    "friendlyId": "m00001",
    "inventoryType": "Medication",
    "name": "Cefazolin 500mg vial (Hazolin)",
    "quantity": 999986,
    "lastModified": "2017-04-12T15:30:07.970Z",
    "modifiedBy": "Admin User",
    "purchases": [
      "E3B2184F-4ECA-3B76-92C8-437846C2E3DC"
    ],
    "locations": [
      "24BB235E-B271-AF61-9A3D-9ACD77CE25AF",
      "DBCF3E06-B812-B6C7-930E-74F9372D384A"
    ]
  }
}

Patient photos not uploading correctly

hospitalrun-server running on Ubuntu VPS via docker-compose.

When I attach a photo to the patient record in chrome, it displays in the browser. If I then load the record in another browser, or in chrome on a different machine, the photo is not visible. No image is present in the patientimages directory on the server either.

If I attach a photo using firefox, the image does not appear in the record, only a placeholder with the Edit and Delete buttons.

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.