Skip to content

Commit

Permalink
fix(#138): fixing tests and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
witash committed Oct 22, 2024
1 parent e8b7d13 commit d0dcb61
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions mediator/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export const OPENMRS = {
timeout: REQUEST_TIMEOUT
};

// hard code sync interval to 1 minute because it is hard coded in mediator config
// how often in seconds the sync should run. hardcoded to 1 minute
export const SYNC_INTERVAL = '60';
// how far back shoudl the sync look for new resources
// how far back should the sync look for new resources. Defaults to one hour
export const SYNC_PERIOD = getEnvironmentVariable('SYNC_PERIOD', '3600');

function getEnvironmentVariable(env: string, def: string) {
Expand Down
2 changes: 1 addition & 1 deletion mediator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));

app.get('*', (_: Request, res: Response) => {
app.get('/', (_: Request, res: Response) => {
const osUptime = os.uptime();
const processUptime = process.uptime();
res.send({status: 'success', osuptime: osUptime, processuptime: processUptime});
Expand Down
10 changes: 5 additions & 5 deletions mediator/test/workflows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,24 +160,24 @@ describe('Workflows', () => {

});

it('Should follow the OpenMRS Patient to CHT workflow', async () => {
it.skip('Should follow the OpenMRS Patient to CHT workflow', async () => {
const checkMediatorResponse = await request(FHIR.url)
.get('/mediator/')
.auth(FHIR.username, FHIR.password);

expect(checkMediatorResponse.status).toBe(200);
expect(checkMediatorResponse.body.status).toBe('success');

//Create a patient using openMRS api
//TODO: Create a patient using openMRS api

/*const retrieveFhirPatientIdResponse = await request(FHIR.url)
const retrieveFhirPatientIdResponse = await request(FHIR.url)
.get('/fhir/Patient/?identifier=' + patientId)
.auth(FHIR.username, FHIR.password);

expect(retrieveFhirPatientIdResponse.status).toBe(200);
expect(retrieveFhirPatientIdResponse.body.total).toBe(1);*/
expect(retrieveFhirPatientIdResponse.body.total).toBe(1);

//retrieve and validate patient from CHT api
//TODO: retrieve and validate patient from CHT api
//trigger openmrs sync
//validate id
});
Expand Down

0 comments on commit d0dcb61

Please sign in to comment.