BAH-3847: Appointments: Add REST support for 'fulfilling encounters'#168
BAH-3847: Appointments: Add REST support for 'fulfilling encounters'#168jnsereko wants to merge 1 commit intoBahmni:masterfrom
Conversation
|
|
| private HashMap extensions; | ||
| private String teleconsultationLink; | ||
| private String priority; | ||
| private String[] fulfillingEncounters = new String[0]; |
There was a problem hiding this comment.
I think our general standard is to use a List instead of an Array (ie List), is there a reason you use an Array here?
| public String[] getFulfillingEncounters() { | ||
| return fulfillingEncounters; | ||
| } | ||
|
|
||
| public void setFulfillingEncounters(String[] fulfillingEncounters) { | ||
| this.fulfillingEncounters = fulfillingEncounters; | ||
| } |
|
Do you wanna add some tests for this? |
mogoodrich
left a comment
There was a problem hiding this comment.
A few comments but generally looks good to me.
| private HashMap extensions; | ||
| private String teleconsultationLink; | ||
| private String priority; | ||
| private String[] fulfillingEncounters = new String[0]; |
There was a problem hiding this comment.
I think our general standard is to use a List instead of an Array (ie List), is there a reason you use an Array here?
| if (appointmentRequest.getFulfillingEncounters().length > 0){ | ||
| Set<Encounter> fulfillingEncounters = Arrays.stream(appointmentRequest.getFulfillingEncounters()) | ||
| .map(encounterService::getEncounterByUuid) | ||
| .filter(Objects::nonNull) |
There was a problem hiding this comment.
Is there any way we can throw an error (or at least a warning) if an encounter is not found for uuid? This seems like something that shouldn't just fail silently.
|
Oh, also, I meant to add, can we add a test for this? (Hopefully there's an existing AppointmentMapper test we can just add this to) |
Description
This logic adds the ability to get and set fulfilling encounters for a specified appointment
cc @mogoodrich
Screenshot
Ticket
https://bahmni.atlassian.net/browse/BAH-3847
Other resources
See how the form engine uses this endpoint to add appointments to their associated encounters at openmrs/openmrs-esm-form-engine-lib#471