Skip to content

Commit

Permalink
chore(#123): add trigger openmrs sync step
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria Lorena Rodriguez Viruel authored and Maria Lorena Rodriguez Viruel committed May 28, 2024
1 parent 9500852 commit e19c7f7
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions mediator/test/workflows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ describe('Workflows', () => {
});

describe('OpenMRS workflow', () => {
/*beforeAll(async () => {
await configureOpenMRSClient();
});*/

it('Should follow the CHT Patient to OpenMRS workflow', async () => {
const checkMediatorResponse = await request(FHIR.url)
.get('/mediator/')
Expand Down Expand Up @@ -215,9 +211,15 @@ describe('Workflows', () => {
expect(retrieveFhirPatientIdResponse.status).toBe(200);
expect(retrieveFhirPatientIdResponse.body.total).toBe(1);

//retrieveOpenMrsPatient
//validate
const triggerOpenMrsSyncPatientResponse = await request(FHIR.url)
.post('/mediator/cht/sync')
.auth(FHIR.username, FHIR.password)
.send();

expect(triggerOpenMrsSyncPatientResponse.status).toBe(200);
//validate openmrs patient creation

//this should be pregnancyReport
const taskReport = TaskReportFactory.build({}, { placeId, contactId, patientId });

const submitChtTaskResponse = await request(CHT.url)
Expand All @@ -236,8 +238,13 @@ describe('Workflows', () => {
expect(retrieveFhirDbEncounter.status).toBe(200);
expect(retrieveFhirDbEncounter.body.total).toBe(1);

//retrieveOpenMrsObservators
//validate
const triggerOpenMrsSyncEncounterResponse = await request(FHIR.url)
.post('/mediator/cht/sync')
.auth(FHIR.username, FHIR.password)
.send();

expect(triggerOpenMrsSyncEncounterResponse.status).toBe(200);
//validate openmrs patient creation

const retrieveFhirDbObservator = await request(FHIR.url)
.get('/fhir/' + observationUrl)
Expand All @@ -246,9 +253,6 @@ describe('Workflows', () => {
expect(retrieveFhirDbObservator.status).toBe(200);
expect(retrieveFhirDbObservator.body.total).toBe(1);//number of observators configured in cht outbound push

//retrieveOpenMrsObservators
//validate

});

it('Should follow the OpenMRS Patient to CHT workflow', async () => {
Expand Down

0 comments on commit e19c7f7

Please sign in to comment.