Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit visits to 1 #30

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/run-tests-on-gh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ jobs:
- name: Update the load configuration for PRS
if: github.event_name == 'pull_request'
run: |
echo "SIMULATION_PRESET=pull_request" >> $GITHUB_ENV
echo "SIMULATION_PRESET=dev" >> $GITHUB_ENV
echo "TIER_COUNT=1" >> $GITHUB_ENV
echo "TIER_DURATION_MINUTES=30" >> $GITHUB_ENV
echo "USER_INCREMENT_PER_TIER=200" >> $GITHUB_ENV

- name: Update the load configuration for commits
if: github.event_name == 'push'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ public HttpRequestActionBuilder getVisitTypes() {
}

public HttpRequestActionBuilder getVisitsOfPatient(String patientUuid) {
String customRepresentation = "custom:(uuid,voided,indication,startDatetime,stopDatetime)";

return http("Get Visits of Patient")
.get("/openmrs/ws/rest/v1/visit/?patient=" + patientUuid + "&v=" + customRepresentation+"&limit=5");
}

public HttpRequestActionBuilder getVisit(String visitUuid) {
String customRepresentation = "custom:(uuid,encounters:(uuid,diagnoses:(uuid,display,rank,diagnosis),"
+ "form:(uuid,display),encounterDatetime,orders:full,"
+ "obs:(uuid,concept:(uuid,display,conceptClass:(uuid,display)),display,"
Expand All @@ -40,8 +47,8 @@ public HttpRequestActionBuilder getVisitsOfPatient(String patientUuid) {
+ "startDatetime,stopDatetime,patient,"
+ "attributes:(attributeType:ref,display,uuid,value))";

return http("Get Visits of Patient")
.get("/openmrs/ws/rest/v1/visit?patient=" + patientUuid + "&v=" + customRepresentation);
return http("Get Visit")
.get("/openmrs/ws/rest/v1/visit/" + visitUuid + "&v=" + customRepresentation);
}

public HttpRequestActionBuilder getActiveVisitOfPatient(String patientUuid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public HttpRequestActionBuilder getPrimaryIdentifierTermMapping() {
}

public HttpRequestActionBuilder getVisitsOfLocation(String locationUuid) {
return http("Get Visits")
return http("Get Visits of a Location")
.get("/openmrs/ws/rest/v1/visit?v=custom:(uuid,patient:(uuid,identifiers:(identifier,uuid,identifierType:(name,uuid)),person:(age,display,gender,uuid,attributes:(value,attributeType:(uuid,display)))),visitType:(uuid,name,display),location:(uuid,name,display),startDatetime,stopDatetime)&includeInactive=false&totalCount=true&location=" + locationUuid);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ public ChainBuilder openAttachmentsTab(String patientUuid) {
.exec(httpService.getAllowedFileExtensions());
}

public ChainBuilder openVisitsTab(String patientUuid) {
return exec(httpService.getVisitsOfPatient(patientUuid));
public ChainBuilder openVisitsTab(String patientUuid, String visitUuid) {
return exec(
httpService.getVisitsOfPatient(patientUuid),
httpService.getVisit(visitUuid)
);
}

public ChainBuilder addDrugOrder(String patientUuid, String visitUuid, String currentUserUuid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ScenarioBuilder getScenarioBuilder() {
.exec(registry.openHomePage())
.exec(registry.openPatientChartPage("#{patient_uuid}"))
.exec(registry.startVisit("#{patient_uuid}"))
.exec(registry.openVisitsTab("#{patient_uuid}"))
.exec(registry.openVisitsTab("#{patient_uuid}", "#{visitUuid}"))
.exec(registry.openVitalsAndBiometricsTab("#{patient_uuid}"))
.exec(registry.openMedicationsTab("#{patient_uuid}"))
.exec(registry.openOrdersTab("#{patient_uuid}"))
Expand Down
Loading