Skip to content

Commit

Permalink
chore: address sonarlint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
njuguna-n authored Nov 25, 2024
1 parent 1de75e4 commit c9354ff
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
12 changes: 6 additions & 6 deletions cht-config/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ FROM node:16-slim

RUN apt update \
&& apt install --no-install-recommends -y \
curl \
git \
python3-pip \
python3-setuptools \
python3-wheel \

Check notice

Code scanning / SonarCloud

Arguments in long RUN instructions should be sorted Low

Sort these package names alphanumerically. See more on SonarQube Cloud
curl

RUN python3 -m pip install git+https://github.com/medic/[email protected]#egg=pyxform-medic
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& python3 -m pip install git+https://github.com/medic/[email protected]#egg=pyxform-medic

WORKDIR /scripts/cht-config

COPY ./ ./

RUN npm install
RUN npm install -g cht-conf
RUN npm install --ignore-scripts && npm install -g --ignore-scripts cht-conf

CMD npm run deploy
CMD ["npm", "run", "deploy"]
2 changes: 1 addition & 1 deletion configurator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ RUN npm install

COPY ./ ./

CMD npm run configure
CMD ["npm", "run", "configure"]
10 changes: 9 additions & 1 deletion configurator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ async function handleConfiguration () {
ContactGroups: []
};

const openMRSConfig = {
host: OPENMRS_HOST,
port: OPENMRS_PORT,
username: OPENMRS_USERNAME,
password: OPENMRS_PASSWORD,
protocol: OPENMRS_PROTOCOL
}

metadata.Users.push(await generateUser(OPENHIM_USER_PASSWORD));
metadata.Clients.push(await generateClient(OPENHIM_CLIENT_PASSWORD));
metadata.Channels.push(await generateHapiFhirChannel());
if (OPENMRS_HOST) {
metadata.Channels.push(await generateOpenMRSChannel(OPENMRS_HOST, OPENMRS_PORT, OPENMRS_USERNAME, OPENMRS_PASSWORD, OPENMRS_PROTOCOL));
metadata.Channels.push(await generateOpenMRSChannel(openMRSConfig));
}

const data = JSON.stringify(metadata);
Expand Down
3 changes: 2 additions & 1 deletion configurator/libs/generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ async function generateHapiFhirChannel () {
};
}

async function generateOpenMRSChannel (host, port, username, password, type) {
async function generateOpenMRSChannel (config) {
const { host, port, username, password, type } = config;
return {
methods: [
'GET',
Expand Down
3 changes: 1 addition & 2 deletions mediator/src/mappers/cht.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { getIdType, copyIdToNamedIdentifier, addSourceMeta } from '../utils/fhir';
import { openMRSIdentifierType } from './openmrs';
import { getIdType, copyIdToNamedIdentifier } from '../utils/fhir';

export const chtDocumentIdentifierType: fhir4.CodeableConcept = {
text: 'CHT Document ID'
Expand Down

0 comments on commit c9354ff

Please sign in to comment.