Skip to content

Commit

Permalink
Merge pull request #1373 from Rugute/master
Browse files Browse the repository at this point in the history
(feat) added amrs id for AMRS 3.X
  • Loading branch information
Alfred-Mutai authored Mar 20, 2024
2 parents 84e090b + dff8638 commit 7d11f1c
Show file tree
Hide file tree
Showing 3 changed files with 11,531 additions and 7,020 deletions.
13 changes: 13 additions & 0 deletions app/amrs-3.x/amrs_id.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const axios = require('axios');
try {
const formData = {
user: '1'
};
const formBody = querystring.stringify(formData);
request = await axios.post(
'https://ngx.ampath.or.ke/amrs-id-generator/generateidentifier',
formBody
);
} catch (error) {
reply.response('Internal Server Error').code(500);
}
29 changes: 29 additions & 0 deletions etl-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6331,6 +6331,35 @@ module.exports = (function () {
notes: 'Api endpoint that returns cohort viral load suppression rate',
tags: ['api']
}
},
{
method: 'GET',
path: '/etl/amrs_id',
config: {
auth: 'simple',
plugins: {},
handler: async function (request, reply) {
const axios = require('axios');
try {
const querystring = require('querystring');
const formData = {
user: '1'
};
const formBody = querystring.stringify(formData);
request = await axios.post(
'https://ngx.ampath.or.ke/amrs-id-generator/generateidentifier',
formBody
);
const identifier = request.data.identifier;
reply.response(identifier);
} catch (error) {
reply.response('Internal Server Error').code(500);
}
},
description: 'Get AMRS ID For AMRS 3.X Use Auto generation',
notes: 'Api endpoint that returns AMRS ID in string format',
tags: ['api']
}
}
];

Expand Down
Loading

0 comments on commit 7d11f1c

Please sign in to comment.