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

O3-4357: Add Allergy Recording to Patient Visit Scenario #54

Merged
merged 8 commits into from
Jan 22, 2025
Merged
Prev Previous commit
Next Next commit
O3-4357:add getAllergen function
  • Loading branch information
Bawanthathilan committed Jan 21, 2025
commit ab1172ca7e53da4126092981ec5d75d665b8cbbd
20 changes: 3 additions & 17 deletions src/test/java/org/openmrs/performance/http/DoctorHttpService.java
Original file line number Diff line number Diff line change
@@ -161,25 +161,11 @@ public HttpRequestActionBuilder GetAllergies(String patientUuid) {
.get("/openmrs/ws/fhir2/R4/AllergyIntolerance?patient=" + patientUuid + "&_summary=data");
}

public HttpRequestActionBuilder GetDrugAllergens(String drugAllergenUuid) {
return http("Get Drug Allergens")
.get("/openmrs/ws/rest/v1/concept/" + drugAllergenUuid + "?v=full");
public HttpRequestActionBuilder getAllergen(String allergenType, String allergenUuid) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public HttpRequestActionBuilder getAllergen(String allergenType, String allergenUuid) {
public HttpRequestActionBuilder getAllergens(String allergenType, String allergenUuid) {

return http("Get " + allergenType + " Allergens")
.get("/openmrs/ws/rest/v1/concept/" + allergenUuid + "?v=full");
}

public HttpRequestActionBuilder GetEnvironmentAllergens(String environmentalAllergenUuid) {
return http("Get Environment Allergens")
.get("/openmrs/ws/rest/v1/concept/" + environmentalAllergenUuid + "?v=full");
}

public HttpRequestActionBuilder GetFoodAllergens(String foodAllergenUuid) {
return http("Get Food Allergens")
.get("/openmrs/ws/rest/v1/concept/" + foodAllergenUuid + "?v=full");
}

public HttpRequestActionBuilder GetAllergicReactions(String allergyReactionUuid) {
return http("Get Allergic Reactions")
.get("/openmrs/ws/rest/v1/concept/" + allergyReactionUuid + "?v=full");
}

public HttpRequestActionBuilder saveAllergy(String patientUuid) {
Map<String, Object> payload = new HashMap<>();
Original file line number Diff line number Diff line change
@@ -103,10 +103,10 @@ public ChainBuilder openAllergiesTab(String patientUuid) {

public ChainBuilder OpenAllergiesForm(){
return exec(
httpService.GetDrugAllergens(DRUG_ALLERGEN_UUID),
httpService.GetEnvironmentAllergens(ENVIRONMENTAL_ALLERGEN_UUID),
httpService.GetFoodAllergens(FOOD_ALLERGEN_UUID),
httpService.GetAllergicReactions(ALLERGY_REACTION_UUID)
httpService.getAllergen("Drug",DRUG_ALLERGEN_UUID),
httpService.getAllergen("Environment",ENVIRONMENTAL_ALLERGEN_UUID),
httpService.getAllergen("Food",FOOD_ALLERGEN_UUID),
httpService.getAllergen("Allergic Reactions",ALLERGY_REACTION_UUID)
);
}