@clinicalhelper/clinicalhelper
v0.1.9
Published
practice management for mental health
Downloads
26
Maintainers
Readme
Clinical Helper is a cloud-ready mental health practice management application that runs a Nodejs backend accessing a MySQL database and a React web application user interface. These components are available on NPM and github
clinicalhelper: https://github.com/clinicalhelper/clinicalhelper https://www.npmjs.com/package/@clinicalhelper/clinicalhelper
clinicalhelperclient: https://github.com/clinicalhelper/clinicalhelperclient https://www.npmjs.com/package/@clinicalhelper/clinicalhelperclient
The Clinical Helper application has been tested and verified on the AWS HIPAA reference architecture.
For a quick tour of the Clinical Helper application click here. For detailed information on simplenodeorm see simplenodeorm.pdf
A typical Clinical Helper deployment architecture would consist of:
- Ubuntu 19 server
- Nodejs 13
- apache2 web server
- MySQL 8
To get started:
- Setup an Ubuntu 19 server with the applications listed above.
- Clone the clinicalhelper application to the desired location
- From the clinicalhelper directory run "npm update" to pull in the required dependencies
- Modify the appconfig.json file found in <clinicalhelper-install-location> and modify the various path entries as required:
{
"testMode" : false,
"dbConfiguration" : "/<install-location>/clinicalhelper/dbconfig/dbconfig.json",
"defaultMaxJoinDepth" : 4,
"defaultDesignTableDepth": 4,
"createTablesIfRequired" : false,
"apiPort" : 8888,
"logFile" : "/<install-location>/clinicalhelper/logs/clinicalhelper.log",
"logLevel" : "info",
"maxRowsForGetAll" : 1000,
"authorizer": "auth/ClinicalHelperAuthorizer",
"chartjsurl": "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js",
"ormModuleRootPath": "orm",
"context": "clinicalhelper",
"queryDocumentRoot" : "/<install-location>/clinicalhelper/reports/docs/queries",
"reportDocumentRoot" : "/<install-location>/clinicalhelper/reports/docs/reports",
"reportDocumentGroupsDefinition": "/<install-location>/clinicalhelper/reports/docs/report-document-groups.json",
"queryDocumentGroupsDefinition": "/<install-location>/clinicalhelper/reports/docs/query-document-groups.json",
"formCacheTimeout": 3660,
"reportCacheTimeout": 3660,
"lookupListCacheTimeout": 600,
"reportHierarchyCacheTimeout": 3660,
"defaultCacheTimeout": 60,
"sessionCacheTimeout": 3660,
"websiteUrl": "<clinical-helper-client-url>,
"redisCache": false,
"redisClusterPort": 0,
"redisClusterHost": "",
"aliases" : {}
}
For more information on the appconfig.json settings see the simplenodeorm documentation simplenodeorm.pdf
- Update the dbconfig.json found at /<install-location>/clinicalhelper/dbconfig/dbconfig.json to setup the connection pool:
{
"pools": [
{
"dbtype": "mysql",
"host": "localhost",
"user": "<my-user>",
"poolAlias": "<my-poolalias>",
"password": "<my-password>",
"database": "clinicalhelper",
"supportBigNumbers": true,
"waitForConnections": true,
"connectionLimit": 20
}
]
}
Utilities for generating the Clinical Helper database are found in /<install-location>/clinicalhelper/dbconfig clinicalhelper.sql practice-update.sh
Create an in input data initialization file with data as follows:
SCHEMA_NAME="my-db-schemaname"
DBUSER_NAME="my-db-username"
PRACTICE_NAME="my-practice-name"
SUPER_USER_ROOT_PASSWORD="application-super-user-password"
SUPER_USER_PASSWORD=`echo -n "$SUPER_USER_ROOT_PASSWORD" | md5sum | sed 's/ .*$//'`
DBUSER_PASSWORD="my-database-password"
PRACTICE_ADDRESS="my-practice-address"
PRACTICE_CITY="my-practice-city"
PRACTICE_STATE="my-practice-state-abbreviation"
PRACTICE_ZIP="my-practice-zipcode"
PRACTICE_PHONE="my-practice-phonenumber"
From a location that contains clinicalhelper.sql, practice-update.sh and the data file run the following from the the command line:
./practice-update.sh init.data
This will generate a file named init.sql that you can use to initialize the Clinical Helper schema.
- Test the clinicalhelper setup by running "node ClinicalHelper.js" from the clinicalhelper directory. You should see output similar to the following:
info: creating connection pools...
info: <my-poolalias> connection pool created
info: loading api ORM definitions...
info: loading orm definitions...
info: orm definitions loaded
info: ORM definitions loaded
info: starting api server...
info: ClinicalHelper server started
info: api server is live on port 8888
- Kill the currently running ClinicalHelper instance
- Install the pm2 process manager by running "npm install pm2 -g"
- From the clinicalhelper directory run "pm2 start ClinicalHelper.js"
- Run "pm2 startup" - this will output a command that you will need to copy and run from the command line.
- Run "pm2 save" - Clinical Helper should now run on startup. You can also run "pm2 status" and "pm2 stop ClinicalHelper"
- Configure apache2 to proxy requests to the clinicalhelper nodejs backend by adding something the following to the appropriate apache2 conf file:
<VirtualHost 10.0.0.3:443>
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /<clinicalhelper-install-location>/clinicalhelper/cert/server.crt
SSLCertificateKeyFile /<clinicalhelper-install-location>/clinicalhelper/cert/server.key
ProxyRequests off
ProxyPreserveHost on
ProxyVia Full
<Proxy *>
Require all granted
</Proxy>
<Location /node>
ProxyPass http://localhost:8888
ProxyPassReverse http://localhost:8888
</Location>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
- Clone the clinicalhelperclient repository and modify the appconfig.json file found at /<clinicalhelperclient-install-location>/src/appconfig.json
- Run "npm update" to pull in required dependencies
- Modify the following entry in appconfig.json: "apiServerUrl": "http://<your-host>/node",
- Run the npm run build command to build a production react build. Copy everything under the generated /<clinicalhelperclient-install-location>/build folder to /var/www/html on the ubuntu server.
- Restart the apache2 service ensure you can pull up the clinicalhelper app by pulling up url https://<your-host>?context=your-pool-alias
- You should be able to login with username=system and password=password-created-during-db-init