Skip to content

Commit

Permalink
chore: remove openmrs to cht scenario from e2e tests
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 Jan 28, 2025
1 parent 6b1b6d7 commit 8ba2d05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 45 deletions.
42 changes: 0 additions & 42 deletions mediator/test/workflows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,48 +187,6 @@ describe('Workflows', () => {
expect(searchOpenMrsPatientResponse.body.entry[0].resource.id).toBe(openMrsPatientId);
});

it('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);

const openMrsPatient = OpenMRSPatientFactory.build({}, {placeId: parentPlace.placeId});

const createOpenMrsPatientResponse = await request(OPENMRS.url)
.post('/Patient')
.auth(OPENMRS.username, OPENMRS.password)
.send(openMrsPatient);

expect(createOpenMrsPatientResponse.status).toBe(201);
expect(createOpenMrsPatientResponse.body).toHaveProperty('id');

const openMrsPatientId = createOpenMrsPatientResponse.body.id;

await new Promise((r) => setTimeout(r, 10000));

const triggerOpenMrsSyncPatientResponse = await request('https://localhost:5002')
.get('/mediator/openmrs/sync')
.auth(OPENMRS.username, OPENMRS.password)
.send();
expect(triggerOpenMrsSyncPatientResponse.status).toBe(200);

await new Promise((r) => setTimeout(r, 20000));

const retrieveFhirPatientIdResponse = await request(FHIR.url)
.get('/fhir/Patient/?identifier=' + openMrsPatientId)
.auth(FHIR.username, FHIR.password);
expect(retrieveFhirPatientIdResponse.status).toBe(200);
expect(retrieveFhirPatientIdResponse.body.total).toBe(1);

const chtPatientId = retrieveFhirPatientIdResponse.body.entry[0].resource.identifier[1].value;

const retrieveChtPatientResponse = await request(CHT.url)
.get('/api/v1/person/' + chtPatientId)
.auth(CHT.username, CHT.password);
expect(retrieveChtPatientResponse.status).toBe(200);
});

});

describe('Loss To Follow-Up (LTFU) workflow', () => {
Expand Down
6 changes: 3 additions & 3 deletions startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ elif [ "$1" == "down" ]; then
elif [ "$1" == "destroy" ]; then
docker compose -p chis-interop -f ./docker/docker-compose.yml -f ./docker/docker-compose.mediator.yml -f ./docker/docker-compose.cht-core.yml -f ./docker/docker-compose.openmrs.yml down -v
elif [ "$1" == "up-test" ]; then
docker compose -p chis-interop -f ./docker/docker-compose.yml -f ./docker/docker-compose.mediator.yml -f ./docker/docker-compose.cht-core.yml -d --build
docker compose -p chis-interop -f ./docker/docker-compose.yml -f ./docker/docker-compose.mediator.yml -f ./docker/docker-compose.cht-core.yml -f ./docker/docker-compose.openmrs.yml up -d --build
elif [ "$1" == "up-openmrs" ]; then
docker compose -p chis-interop -f ./docker/docker-compose.yml -f ./docker/docker-compose.mediator.yml -f ./docker/docker-compose.cht-core.yml -f ./docker/docker-compose.openmrs.yml up -d --build
else
else
echo "Invalid option $1
Help:
init starts the docker containers and configures OpenHIM
Expand Down

0 comments on commit 8ba2d05

Please sign in to comment.