Skip to content

Commit

Permalink
Standardised code formatting using Prettier (AMPATH#1015)
Browse files Browse the repository at this point in the history
* Install and configure Prettier

* Add missing comma to referral-patient-list-peer template

* Format app/

* Format authorization/

* Format conf/

* Format dao/

* Format departments/

* Format eid-data-synchronization/

* Format elastic/

* Format encounter-type/

* Format expression-runner/

* Format location/

* Format oncology-reports/

* Format programs/

* Format report-post-processors/

* Format reports/

* Format resolve-program-visit-encounter-ids/

* Format service/

* Format test/

* Format visit-type/

* Format worker/

* Format root files

* Format #AMPATH#1016
  • Loading branch information
denniskigen authored Oct 30, 2020
1 parent a4320c9 commit fcf5a98
Show file tree
Hide file tree
Showing 442 changed files with 77,791 additions and 72,493 deletions.
6 changes: 2 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"presets": [
"es2015", "stage-0"
]
}
"presets": ["es2015", "stage-0"]
}
15 changes: 15 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules/
conf/config.json
conf/kibana-config.json
conf_copy/
.idea/**
.vscode/
*.log
.netbeans.xml
etl-daemon.js
.nyc_output
coverage
conf/config-bk.json
dist
build
.build
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "none",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sudo: required
language: node_js
node_js:
- '10'
services:
- '10'
services:
- docker
before_install:
- export TZ=Africa/Nairobi
Expand All @@ -13,16 +13,16 @@ before_install:
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- ubuntu-toolchain-r-test
packages:
- g++-5
- g++-5
script:
- npm test
- npm start
- npm test
- npm start
env:
- CXX=g++-5
deploy:
provider: script
script: bash docker/docker_push.sh
on:
all_branches: true
all_branches: true
42 changes: 20 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
[![Build Status](https://travis-ci.org/AMPATH/etl-rest-server.svg?branch=master)](https://travis-ci.org/AMPATH/etl-rest-server)

ETL REST Server
===============
# ETL REST Server

This is a node project that uses [hapi](https://github.com/hapijs/hapi) to expose REST endpoints which provide access to data hosted in [ETL](https://en.wikipedia.org/wiki/Extract,_transform,_load) flat tables. These flat tables are flattened derived database tables containing data from OpenMRS. Data generation is done via MySQL stored procedures (found [here](https://github.com/ampath/etl)). This project is currently being battle-tested in production by [AMPATH POC](https://github.com/AMPATH/ng2-amrs).

To setup the project, run:

```$ git clone https://github.com/AMPATH/etl-rest-server.git```
`$ git clone https://github.com/AMPATH/etl-rest-server.git`

```$ cd etl-rest-server ```
`$ cd etl-rest-server `

```$ npm install```
`$ npm install`

```$ mkdir conf && cd conf```
`$ mkdir conf && cd conf`

Create a config.json file

```$ cat config.json```
`$ cat config.json`

With the following content

Expand All @@ -43,28 +42,26 @@ With the following content
"multipleStatements": true
}
}

```
You can set ```tls:false``` if you don't care about https and don't provide the keys but if you set

You can set `tls:false` if you don't care about https and don't provide the keys but if you set
it to true you have to provide the keys.

```npm start```
`npm start`

Now visit ```https://<Your Host>:<Your Port>``` You should see the welcome message
Now visit `https://<Your Host>:<Your Port>` You should see the welcome message

``` Welcome to ETL reset server for OpenMRS ```
`Welcome to ETL reset server for OpenMRS`

Using Docker Compose 1.6+
-------------------------
## Using Docker Compose 1.6+

docker-compose up -d

Confirm by looking for the server at host port 8002 using TLS:

curl -k https://docker:8007

Without Docker Compose
----------------------
## Without Docker Compose

## Building

Expand All @@ -78,19 +75,20 @@ Without Docker Compose
-e MYSQL_USER=etl_user -e MYSQL_PASSWORD=etl_password mysql

#### Running with openmrs instance running at localhost on port 8080

docker run -d --name etl --link mysql4etl:db -p 8002:8002 etl

#### Running with openmrs running at 1.2.3.4 on port 8081 under app name "omrs"

docker run -d --name etl --link mysql4etl:db -p 8002:8002 \
-e OPENMRS_HOST_ADDR=1.2.3.4 -e OPENMRS_NAME=omrs -e OPENMRS_PORT=8081 etl
-e OPENMRS_HOST_ADDR=1.2.3.4 -e OPENMRS_NAME=omrs -e OPENMRS_PORT=8081 etl

### Using your own MySQL server

If you have MySQL running at 1.2.3.4 with username "myuser" and password "mypassword":
(This assumes openmrs at localhost port 8080, to use different settings pass
environmental variables as above)
(This assumes openmrs at localhost port 8080, to use different settings pass
environmental variables as above)

docker run -d --name etl \
-e DB_PORT_3306_TCP_ADDR=1.2.3.4 -e DB_PORT_3306_TCP_PORT=3306 \
-e MYSQL_USER=myuser -e MYSQL_PASSWORD=mypassword \
Expand All @@ -100,7 +98,7 @@ If you have MySQL running at 1.2.3.4 with username "myuser" and password "mypass

docker run -d -name etl -v /path/to/keys/:/keys -p 8002:8002 etl

The folder /path/to/keys/ should contain SSL certificate and private key in `server.crt`
The folder /path/to/keys/ should contain SSL certificate and private key in `server.crt`
and `server.key`.

### Setup CI Integration
Expand All @@ -111,4 +109,4 @@ and `server.key`.
4. Update your local `etl-rest-server` fork i.e. `git pull upstream master`. The CD setup should be in master.
5. Checkout a branch from master e.g. `git checkout -b test-etl`
6. Push that branch i.e. `git push origin <branchname>`
7. Access your test build via the following url: [https://ngx.ampath.or.ke/etl-backend/branchname/etl](https://ngx.ampath.or.ke/etl-backend/<branchname>/etl) where `branchname` is the name of your branch.
7. Access your test build via the following url: [https://ngx.ampath.or.ke/etl-backend/branchname/etl](https://ngx.ampath.or.ke/etl-backend/<branchname>/etl) where `branchname` is the name of your branch.
9 changes: 4 additions & 5 deletions app/case-management/case-management-indicator-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ var defs = {
getIndicatorDefinitions: getIndicatorDefinitions
};

function getIndicatorDefinitions(){

return new Promise((resolve , reject) => {
resolve (indicatorsDefs)
function getIndicatorDefinitions() {
return new Promise((resolve, reject) => {
resolve(indicatorsDefs);
});
}

module.exports = defs;
module.exports = defs;
Loading

0 comments on commit fcf5a98

Please sign in to comment.