Skip to content

Commit ab1172c

Browse files
committedJan 21, 2025
O3-4357:add getAllergen function
1 parent f15c26a commit ab1172c

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed
 

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

+3-17
Original file line numberDiff line numberDiff line change
@@ -161,25 +161,11 @@ public HttpRequestActionBuilder GetAllergies(String patientUuid) {
161161
.get("/openmrs/ws/fhir2/R4/AllergyIntolerance?patient=" + patientUuid + "&_summary=data");
162162
}
163163

164-
public HttpRequestActionBuilder GetDrugAllergens(String drugAllergenUuid) {
165-
return http("Get Drug Allergens")
166-
.get("/openmrs/ws/rest/v1/concept/" + drugAllergenUuid + "?v=full");
164+
public HttpRequestActionBuilder getAllergen(String allergenType, String allergenUuid) {
165+
return http("Get " + allergenType + " Allergens")
166+
.get("/openmrs/ws/rest/v1/concept/" + allergenUuid + "?v=full");
167167
}
168168

169-
public HttpRequestActionBuilder GetEnvironmentAllergens(String environmentalAllergenUuid) {
170-
return http("Get Environment Allergens")
171-
.get("/openmrs/ws/rest/v1/concept/" + environmentalAllergenUuid + "?v=full");
172-
}
173-
174-
public HttpRequestActionBuilder GetFoodAllergens(String foodAllergenUuid) {
175-
return http("Get Food Allergens")
176-
.get("/openmrs/ws/rest/v1/concept/" + foodAllergenUuid + "?v=full");
177-
}
178-
179-
public HttpRequestActionBuilder GetAllergicReactions(String allergyReactionUuid) {
180-
return http("Get Allergic Reactions")
181-
.get("/openmrs/ws/rest/v1/concept/" + allergyReactionUuid + "?v=full");
182-
}
183169

184170
public HttpRequestActionBuilder saveAllergy(String patientUuid) {
185171
Map<String, Object> payload = new HashMap<>();

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ public ChainBuilder openAllergiesTab(String patientUuid) {
103103

104104
public ChainBuilder OpenAllergiesForm(){
105105
return exec(
106-
httpService.GetDrugAllergens(DRUG_ALLERGEN_UUID),
107-
httpService.GetEnvironmentAllergens(ENVIRONMENTAL_ALLERGEN_UUID),
108-
httpService.GetFoodAllergens(FOOD_ALLERGEN_UUID),
109-
httpService.GetAllergicReactions(ALLERGY_REACTION_UUID)
106+
httpService.getAllergen("Drug",DRUG_ALLERGEN_UUID),
107+
httpService.getAllergen("Environment",ENVIRONMENTAL_ALLERGEN_UUID),
108+
httpService.getAllergen("Food",FOOD_ALLERGEN_UUID),
109+
httpService.getAllergen("Allergic Reactions",ALLERGY_REACTION_UUID)
110110
);
111111
}
112112

0 commit comments

Comments
 (0)
Failed to load comments.