diff --git a/mediator/config/index.ts b/mediator/config/index.ts index 9a0d2439..a3c6d1ea 100644 --- a/mediator/config/index.ts +++ b/mediator/config/index.ts @@ -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) { diff --git a/mediator/index.ts b/mediator/index.ts index 6f630743..4f9eb578 100644 --- a/mediator/index.ts +++ b/mediator/index.ts @@ -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}); diff --git a/mediator/test/workflows.spec.ts b/mediator/test/workflows.spec.ts index c060ab33..a90b5871 100644 --- a/mediator/test/workflows.spec.ts +++ b/mediator/test/workflows.spec.ts @@ -160,7 +160,7 @@ 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); @@ -168,16 +168,16 @@ describe('Workflows', () => { 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 });