diff --git a/src/test/java/org/openmrs/performance/http/DoctorHttpService.java b/src/test/java/org/openmrs/performance/http/DoctorHttpService.java index 381d17f..ebac22c 100644 --- a/src/test/java/org/openmrs/performance/http/DoctorHttpService.java +++ b/src/test/java/org/openmrs/performance/http/DoctorHttpService.java @@ -261,6 +261,11 @@ public HttpRequestActionBuilder getImmunizations(String patientUuid) { .get("/openmrs/ws/fhir2/R4/Immunization?patient=" + patientUuid + "&_summary=data"); } + public HttpRequestActionBuilder getPrograms() { + return http("Get Programs") + .get("/openmrs/ws/rest/v1/program?v=custom:(uuid,display,allWorkflows,concept:(uuid,display))"); + } + public HttpRequestActionBuilder searchForDrug(String searchQuery) { String customRepresentation = """ custom:(uuid,display,name,strength, diff --git a/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java b/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java index 027ef25..10202ee 100644 --- a/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java +++ b/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java @@ -27,9 +27,7 @@ import static org.openmrs.performance.Constants.WEIGHT_KG; import static org.openmrs.performance.utils.CommonUtils.extractConceptIds; - - -public class DoctorRegistry extends Registry<DoctorHttpService>{ +public class DoctorRegistry extends Registry<DoctorHttpService> { public DoctorRegistry() { super(new DoctorHttpService()); @@ -106,19 +104,19 @@ public ChainBuilder openLabResultsTab(String patientUuid) { public ChainBuilder openAllergiesTab(String patientUuid) { return exec(httpService.getAllergies(patientUuid)); } - - public ChainBuilder openAllergiesForm(){ + + public ChainBuilder openAllergiesForm() { return exec( - httpService.getAllergens("Drug",DRUG_ALLERGEN_UUID), - httpService.getAllergens("Environment",ENVIRONMENTAL_ALLERGEN_UUID), - httpService.getAllergens("Food",FOOD_ALLERGEN_UUID), - httpService.getAllergens("Allergic Reactions",ALLERGY_REACTION_UUID) + httpService.getAllergens("Drug", DRUG_ALLERGEN_UUID), + httpService.getAllergens("Environment", ENVIRONMENTAL_ALLERGEN_UUID), + httpService.getAllergens("Food", FOOD_ALLERGEN_UUID), + httpService.getAllergens("Allergic Reactions", ALLERGY_REACTION_UUID) ); } - - public ChainBuilder recordAllergy(String patientUuid) { + + public ChainBuilder recordAllergy(String patientUuid) { return exec( - httpService.saveAllergy(patientUuid) + httpService.saveAllergy(patientUuid) ); } @@ -135,6 +133,12 @@ public ChainBuilder openAttachmentsTab(String patientUuid) { .exec(httpService.getAllowedFileExtensions()); } + + public ChainBuilder openProgramsTab(String patientUuid) { + return exec(httpService.getPrograms()) + .exec(httpService.getProgramEnrollments(patientUuid)); + } + public ChainBuilder addAttachment(String patientUuid){ return exec(httpService.uploadAttachment(patientUuid)) .exec(httpService.getAttachments(patientUuid)); @@ -151,19 +155,19 @@ public ChainBuilder addDrugOrder(String patientUuid, String visitUuid, String cu httpService.getActiveVisitOfPatient(patientUuid), httpService.searchForDrug("asprin"), httpService.searchForDrug("Tylenol"), - httpService.saveOrder(patientUuid, visitUuid, currentUserUuid, asprin_162_5mg, asprinConcept) + httpService.saveOrder(patientUuid, visitUuid, currentUserUuid, asprin_162_5mg, asprinConcept) ); - + } - + public ChainBuilder addVisitNote(String patientUuid, String currentUserUuid) { String visitNoteText = "Patient visit note"; String certainty = "PROVISIONAL"; String encounterUuid = "#{encounterUuid}"; return exec( - httpService.saveVisitNote(patientUuid, currentUserUuid, visitNoteText), - httpService.saveDiagnosis(patientUuid, encounterUuid, DIABETIC_KETOSIS_CONCEPT, certainty, 1), - httpService.saveDiagnosis(patientUuid, encounterUuid, DIABETIC_FOOT_ULCER_CONCEPT, certainty, 2)); + httpService.saveVisitNote(patientUuid, currentUserUuid, visitNoteText), + httpService.saveDiagnosis(patientUuid, encounterUuid, DIABETIC_KETOSIS_CONCEPT, certainty, 1), + httpService.saveDiagnosis(patientUuid, encounterUuid, DIABETIC_FOOT_ULCER_CONCEPT, certainty, 2)); } } diff --git a/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java b/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java index 71f4ba5..9b6ff6b 100644 --- a/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java +++ b/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java @@ -50,6 +50,8 @@ public ScenarioBuilder getScenarioBuilder() { .pause(5) .exec(registry.openAttachmentsTab("#{patient_uuid}")) .pause(5) + .exec(registry.openProgramsTab("#{patient_uuid}")) + .pause(5) .exec(registry.addAttachment("#{patient_uuid}")) .pause(5) .exec(registry.addDrugOrder("#{patient_uuid}", "#{visitUuid}", "#{currentUserUuid}"))