Skip to content

Commit

Permalink
fixed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ashaban committed Nov 19, 2021
1 parent adf8905 commit 8f41e7c
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 22 deletions.
Empty file modified compose.sh
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions docker/elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM elasticsearch:7.6.2
FROM elasticsearch:7.9.1

RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-phonetic

RUN curl -LO https://github.com/intrahealth/client-registry/blob/master/tools/string-similarity-scoring-0.0.5-es7.6.2.zip?raw=true
RUN mv string-similarity-scoring-0.0.5-es7.6.2.zip?raw=true string-similarity-scoring-0.0.5-es7.6.2.zip
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install file:./string-similarity-scoring-0.0.5-es7.6.2.zip
RUN curl -LO https://github.com/intrahealth/client-registry/blob/master/tools/string-similarity-scoring-0.0.6-es7.9.1.zip?raw=true
RUN mv string-similarity-scoring-0.0.6-es7.9.1.zip?raw=true string-similarity-scoring-0.0.6-es7.9.1.zip
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install file:./string-similarity-scoring-0.0.6-es7.9.1.zip
Empty file modified docker/elasticsearch/dockerhub.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion server/gui/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/crux/favicon.ico><title>crux</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css><link href=/crux/css/chunk-vendors.9eec1691.css rel=preload as=style><link href=/crux/js/app.091cb127.js rel=preload as=script><link href=/crux/js/chunk-vendors.f0edaab5.js rel=preload as=script><link href=/crux/css/chunk-vendors.9eec1691.css rel=stylesheet></head><body><noscript><strong>We're sorry but crux doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/crux/js/chunk-vendors.f0edaab5.js></script><script src=/crux/js/app.091cb127.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/crux/favicon.ico><title>crux</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css><link href=/crux/css/chunk-vendors.9eec1691.css rel=preload as=style><link href=/crux/js/app.17681b65.js rel=preload as=script><link href=/crux/js/chunk-vendors.f0edaab5.js rel=preload as=script><link href=/crux/css/chunk-vendors.9eec1691.css rel=stylesheet></head><body><noscript><strong>We're sorry but crux doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/crux/js/chunk-vendors.f0edaab5.js></script><script src=/crux/js/app.17681b65.js></script></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion server/lib/mixins/matchMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,6 @@ const addPatient = (clientID, patientsBundle, callback) => {
operationSummary.push(operSummary);
return nxtPatient();
}
console.log('here1');
fhirWrapper.saveResource({
resourceData: bundle,
}, (err, body) => {
Expand Down
32 changes: 29 additions & 3 deletions server/lib/routes/fhir.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ router.post('/', (req, res) => {
// }
matchMixin.addPatient(clientID, patientsBundle, (err, responseBundle, responseHeaders, operationSummary) => {
if (err) {
return callback(null, {code: 500, err, responseBundle, responseHeaders, body: operationSummary});
return callback(null, {code: 500, err, responseBundle, responseHeaders, operationSummary});
}
return callback(null, {code: 200, err, responseBundle, responseHeaders, body: operationSummary});
return callback(null, {code: 200, err, responseBundle, responseHeaders, operationSummary});
});
}
}, (err, results) => {
Expand Down Expand Up @@ -248,7 +248,33 @@ router.post('/', (req, res) => {
}
res.setHeader('Location', JSON.stringify(results.patients.responseHeaders.patientID));
res.setHeader('LocationCRUID', JSON.stringify(results.patients.responseHeaders.CRUID));
return res.status(code).json(filteredResponseBundle);
res.status(code).json(filteredResponseBundle);

const auditBundle = matchMixin.createAddPatientAudEvent(results.patients.operationSummary, req);
fhirWrapper.saveResource({
resourceData: auditBundle
}, () => {
logger.info('Audit saved successfully');
});

let csvUploadAuditBundle = {
resourceType: 'Bundle',
type: 'batch',
entry: []
};
async.eachSeries(results.patients.operationSummary, (operationSummary, nxtOper) => {
matchMixin.createCSVUploadAudEvent(operationSummary, csvUploadAuditBundle, req).then(() => {
return nxtOper();
}).catch(() => {
return nxtOper();
});
}, () => {
// matchMixin.saveCSVUploadAudiEvent(csvUploadAuditBundle).then(() => {
// csvUploadAuditBundle = {};
// }).catch(() => {
// csvUploadAuditBundle = {};
// });
});
});
});

Expand Down
6 changes: 3 additions & 3 deletions tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/sampleMultiplePatients.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"resource": {
"resourceType": "Patient",
"identifier": [{
"system": "http://openclientregistry.org/fhir/sourceid",
"system": "http://clientregistry.org/openmrs",
"value": "patient1"
},
{
Expand Down Expand Up @@ -42,7 +42,7 @@
"resource": {
"resourceType": "Patient",
"identifier": [{
"system": "http://openclientregistry.org/fhir/sourceid",
"system": "http://clientregistry.org/openmrs",
"value": "patient2"
},
{
Expand Down Expand Up @@ -79,7 +79,7 @@
"resource": {
"resourceType": "Patient",
"identifier": [{
"system": "http://openclientregistry.org/fhir/sourceid",
"system": "http://clientregistry.org/openmrs",
"value": "patient3"
}, {
"system": "http://health.go.ug/cr/nationalid",
Expand Down
2 changes: 1 addition & 1 deletion tests/sampleSinglePatient.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"system": "http://clientregistry.org/openmrs",
"value": "sourceid17"
}, {
"system": "http://health.go.ug/cr/nationalid",
"system": "http://clientregistry.org/nationalid",
"value": "228374844"
}, {
"system": "http://system1.org",
Expand Down
2 changes: 1 addition & 1 deletion tests/uploadCSV.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fs.createReadStream(path.resolve(__dirname, '', csvFile))
}
resource.identifier = [
{
system: 'http://openclientregistry.org/fhir/sourceid',
system: 'http://clientregistry.org/openmrs',
value: row['rec_id'].trim(),
},
];
Expand Down
4 changes: 2 additions & 2 deletions tests/uploadUgandaCSV.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ fs.createReadStream(path.resolve(__dirname, '', csvFile))
}
let auth = {
username: 'lims',
password: '4dpCe5MCve'
password: 'xxx'
}
const options = {
url: 'http://216.104.201.68/ocr/fhir/Patient',
url: 'http://uganda-ip/ocr/fhir/Patient',
auth,
json: entry.resource,
};
Expand Down

0 comments on commit 8f41e7c

Please sign in to comment.