Skip to content

Commit c4f3cf6

Browse files
authoredMar 15, 2025
O3-4521 : Add program tab to the visit patient scenario (#77)
* Add program tab to the visit patient scenario * Add another endpoint * update the file * Update the changes * made a change * made a change
1 parent 643771a commit c4f3cf6

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed
 

‎src/test/java/org/openmrs/performance/http/DoctorHttpService.java

+5
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ public HttpRequestActionBuilder getImmunizations(String patientUuid) {
261261
.get("/openmrs/ws/fhir2/R4/Immunization?patient=" + patientUuid + "&_summary=data");
262262
}
263263

264+
public HttpRequestActionBuilder getPrograms() {
265+
return http("Get Programs")
266+
.get("/openmrs/ws/rest/v1/program?v=custom:(uuid,display,allWorkflows,concept:(uuid,display))");
267+
}
268+
264269
public HttpRequestActionBuilder searchForDrug(String searchQuery) {
265270
String customRepresentation = """
266271
custom:(uuid,display,name,strength,

‎src/test/java/org/openmrs/performance/registries/DoctorRegistry.java

+22-18
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
import static org.openmrs.performance.Constants.WEIGHT_KG;
2828
import static org.openmrs.performance.utils.CommonUtils.extractConceptIds;
2929

30-
31-
32-
public class DoctorRegistry extends Registry<DoctorHttpService>{
30+
public class DoctorRegistry extends Registry<DoctorHttpService> {
3331

3432
public DoctorRegistry() {
3533
super(new DoctorHttpService());
@@ -106,19 +104,19 @@ public ChainBuilder openLabResultsTab(String patientUuid) {
106104
public ChainBuilder openAllergiesTab(String patientUuid) {
107105
return exec(httpService.getAllergies(patientUuid));
108106
}
109-
110-
public ChainBuilder openAllergiesForm(){
107+
108+
public ChainBuilder openAllergiesForm() {
111109
return exec(
112-
httpService.getAllergens("Drug",DRUG_ALLERGEN_UUID),
113-
httpService.getAllergens("Environment",ENVIRONMENTAL_ALLERGEN_UUID),
114-
httpService.getAllergens("Food",FOOD_ALLERGEN_UUID),
115-
httpService.getAllergens("Allergic Reactions",ALLERGY_REACTION_UUID)
110+
httpService.getAllergens("Drug", DRUG_ALLERGEN_UUID),
111+
httpService.getAllergens("Environment", ENVIRONMENTAL_ALLERGEN_UUID),
112+
httpService.getAllergens("Food", FOOD_ALLERGEN_UUID),
113+
httpService.getAllergens("Allergic Reactions", ALLERGY_REACTION_UUID)
116114
);
117115
}
118-
119-
public ChainBuilder recordAllergy(String patientUuid) {
116+
117+
public ChainBuilder recordAllergy(String patientUuid) {
120118
return exec(
121-
httpService.saveAllergy(patientUuid)
119+
httpService.saveAllergy(patientUuid)
122120
);
123121
}
124122

@@ -135,6 +133,12 @@ public ChainBuilder openAttachmentsTab(String patientUuid) {
135133
.exec(httpService.getAllowedFileExtensions());
136134
}
137135

136+
137+
public ChainBuilder openProgramsTab(String patientUuid) {
138+
return exec(httpService.getPrograms())
139+
.exec(httpService.getProgramEnrollments(patientUuid));
140+
}
141+
138142
public ChainBuilder addAttachment(String patientUuid){
139143
return exec(httpService.uploadAttachment(patientUuid))
140144
.exec(httpService.getAttachments(patientUuid));
@@ -155,19 +159,19 @@ public ChainBuilder addDrugOrder(String patientUuid, String visitUuid, String cu
155159
httpService.getActiveVisitOfPatient(patientUuid),
156160
httpService.searchForDrug("asprin"),
157161
httpService.searchForDrug("Tylenol"),
158-
httpService.saveOrder(patientUuid, visitUuid, currentUserUuid, asprin_162_5mg, asprinConcept)
162+
httpService.saveOrder(patientUuid, visitUuid, currentUserUuid, asprin_162_5mg, asprinConcept)
159163
);
160-
164+
161165
}
162-
166+
163167
public ChainBuilder addVisitNote(String patientUuid, String currentUserUuid) {
164168
String visitNoteText = "Patient visit note";
165169
String certainty = "PROVISIONAL";
166170
String encounterUuid = "#{encounterUuid}";
167171

168172
return exec(
169-
httpService.saveVisitNote(patientUuid, currentUserUuid, visitNoteText),
170-
httpService.saveDiagnosis(patientUuid, encounterUuid, DIABETIC_KETOSIS_CONCEPT, certainty, 1),
171-
httpService.saveDiagnosis(patientUuid, encounterUuid, DIABETIC_FOOT_ULCER_CONCEPT, certainty, 2));
173+
httpService.saveVisitNote(patientUuid, currentUserUuid, visitNoteText),
174+
httpService.saveDiagnosis(patientUuid, encounterUuid, DIABETIC_KETOSIS_CONCEPT, certainty, 1),
175+
httpService.saveDiagnosis(patientUuid, encounterUuid, DIABETIC_FOOT_ULCER_CONCEPT, certainty, 2));
172176
}
173177
}

‎src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public ScenarioBuilder getScenarioBuilder() {
5050
.pause(5)
5151
.exec(registry.openAttachmentsTab("#{patient_uuid}"))
5252
.pause(5)
53+
.exec(registry.openProgramsTab("#{patient_uuid}"))
54+
.pause(5)
5355
.exec(registry.addAttachment("#{patient_uuid}"))
5456
.pause(5)
5557
.exec(registry.openAppointmentsTab("#{patient_uuid}"))

0 commit comments

Comments
 (0)
Failed to load comments.