-
Notifications
You must be signed in to change notification settings - Fork 12
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
Changes from 1 commit
6e932cc
dd5d198
f15c26a
ab1172c
6f98645
3149a6c
c7dbd34
82d0bd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,5 +34,13 @@ public class Constants { | |
public static final String ORDER = "39da3525-afe4-45ff-8977-c53b7b359158"; | ||
|
||
public static final String DEFAULT_DOSING_TYPE = "org.openmrs.SimpleDosingInstructions"; | ||
|
||
// Allergies | ||
public static final String DRUG_ALLERGEN_UUID = "162555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public static final String ENVIRONMENTAL_ALLERGEN_UUID = "162552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public static final String FOOD_ALLERGEN_UUID = "162554AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public static final String ALLERGY_REACTION_UUID = "162553AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public static final String CODED_ALLERGEN_UUID = "71617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public static final String SEVERITY_UUID = "1498AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's an extra space here. |
||
|
||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -15,14 +15,17 @@ | |||||
import static io.gatling.javaapi.core.CoreDsl.bodyString; | ||||||
import static io.gatling.javaapi.core.CoreDsl.jsonPath; | ||||||
import static io.gatling.javaapi.http.HttpDsl.http; | ||||||
import static org.openmrs.performance.Constants.ALLERGY_REACTION_UUID; | ||||||
import static org.openmrs.performance.Constants.CARE_SETTING_UUID; | ||||||
import static org.openmrs.performance.Constants.CODED_ALLERGEN_UUID; | ||||||
import static org.openmrs.performance.Constants.DAYS; | ||||||
import static org.openmrs.performance.Constants.DEFAULT_DOSING_TYPE; | ||||||
import static org.openmrs.performance.Constants.DRUG_ORDER; | ||||||
import static org.openmrs.performance.Constants.ONCE_DAILY; | ||||||
import static org.openmrs.performance.Constants.ORAL; | ||||||
import static org.openmrs.performance.Constants.ORDER; | ||||||
import static org.openmrs.performance.Constants.OUTPATIENT_CLINIC_LOCATION_UUID; | ||||||
import static org.openmrs.performance.Constants.SEVERITY_UUID; | ||||||
import static org.openmrs.performance.Constants.TABLET; | ||||||
|
||||||
public class DoctorHttpService extends HttpService { | ||||||
|
@@ -151,23 +154,9 @@ public HttpRequestActionBuilder getDrugOrders(String patientUuid) { | |||||
"&careSetting=" + CARE_SETTING_UUID + | ||||||
"&status=any&orderType=" + DRUG_ORDER + | ||||||
"&v=" + customRepresentation); | ||||||
} | ||||||
|
||||||
public HttpRequestActionBuilder searchPatient(String searchQuery) { | ||||||
String customRepresentation = """ | ||||||
custom:(patientId,uuid,identifiers,display,patientIdentifier:(uuid,identifier),person:(gender,age,birthdate,birthdateEstimated,personName,addresses,display,dead,deathDate),attributes:(value,attributeType:(uuid,display))) | ||||||
"""; | ||||||
return http("Get Orders") | ||||||
.get("/openmrs/ws/rest/v1/patient" + | ||||||
"?q=" + searchQuery + | ||||||
"&v=" + customRepresentation + | ||||||
"&includeDead=" + true + | ||||||
"&limit=" + 10); | ||||||
} | ||||||
|
||||||
|
||||||
} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
public HttpRequestActionBuilder getAllergies(String patientUuid) { | ||||||
public HttpRequestActionBuilder GetAllergies(String patientUuid) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Method names should be named in lower camel case (starts with a lowercase). |
||||||
return http("Get Allergies of Patient") | ||||||
.get("/openmrs/ws/fhir2/R4/AllergyIntolerance?patient=" + patientUuid + "&_summary=data"); | ||||||
} | ||||||
|
@@ -192,21 +181,21 @@ public HttpRequestActionBuilder GetAllergicReactions(String allergyReactionUuid) | |||||
.get("/openmrs/ws/rest/v1/concept/" + allergyReactionUuid + "?v=full"); | ||||||
} | ||||||
|
||||||
public HttpRequestActionBuilder saveAllergies(String patientUuid) { | ||||||
public HttpRequestActionBuilder saveAllergy(String patientUuid) { | ||||||
Map<String, Object> payload = new HashMap<>(); | ||||||
|
||||||
Map<String,String> codedAllergen = new HashMap<>(); | ||||||
codedAllergen.put("uuid", "71617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); | ||||||
codedAllergen.put("uuid", CODED_ALLERGEN_UUID); | ||||||
|
||||||
Map<String,Object>allergen = new HashMap<>(); | ||||||
allergen.put("allergenType", "DRUG"); | ||||||
allergen.put("codedAllergen", codedAllergen); | ||||||
|
||||||
Map<String,String>severity = new HashMap<>(); | ||||||
severity.put("uuid", "1498AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); | ||||||
severity.put("uuid", SEVERITY_UUID); | ||||||
|
||||||
Map<String, String> reactionUuid = new HashMap<>(); | ||||||
reactionUuid.put("uuid", "121677AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); | ||||||
reactionUuid.put("uuid", ALLERGY_REACTION_UUID); | ||||||
|
||||||
Map<String, Object> reaction = new HashMap<>(); | ||||||
reaction.put("reaction", reactionUuid); | ||||||
|
@@ -218,8 +207,8 @@ public HttpRequestActionBuilder saveAllergies(String patientUuid) { | |||||
payload.put("reactions", reactions); | ||||||
|
||||||
|
||||||
return http("Save Allergies of Patient") | ||||||
.get("/openmrs/ws/rest/v1/patient/"+ patientUuid +"/allergy") | ||||||
return http("Save an Allergies") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.post("/openmrs/ws/rest/v1/patient/"+ patientUuid +"/allergy") | ||||||
.body(StringBody(payload.toString())); | ||||||
|
||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -30,7 +30,7 @@ public ScenarioBuilder getScenarioBuilder() { | |||||
.exec(registry.openLabResultsTab("#{patient_uuid}")) | ||||||
.exec(registry.openAllergiesTab("#{patient_uuid}")) | ||||||
.exec(registry.OpenAllergiesForm()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.exec(registry.addAllergies("#{patient_uuid}")) | ||||||
.exec(registry.recordAllergy("#{patient_uuid}")) | ||||||
.exec(registry.openConditionsTab("#{patient_uuid}")) | ||||||
.exec(registry.openImmunizationsTab("#{patient_uuid}")) | ||||||
.exec(registry.openAttachmentsTab("#{patient_uuid}")) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.