Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
About Integration Points
When getting the data for appointments, if users would want to display additional information per appointment from other modules in Bahmni.
This can be made possible by extending the interface ''AppointmentResponseExtension'' and implementing the run method which takes appointment as input and returns a map of attributes. The returned map values are added to the appointments additional information
How to set up
This extension code should be added in the implementation specific omods.
1. Add appointments module as required module in the omod/src/main/resources/config.xml
Code Block | ||
---|---|---|
| ||
<require_module>org.openmrs.module.appointments</require_module> |
2. Add appointments module dependency in the pom.xml
Code Block | ||
---|---|---|
| ||
<dependency> <groupId>org.openmrs.module</groupId> <artifactId>appointments-omod</artifactId> <version>1.0-SNAPSHOT</version> <scope>provided</scope> </dependency> |
3. Implement extension point
Code Block | ||
---|---|---|
| ||
@Component public class PatientBedDetails implements AppointmentResponseExtension { @Override public Map<String, String> run(Appointment appointment) { Map<String, String> additionalInfo = new HashMap<>(); BedManagementService bedManagementService = Context.getService(BedManagementService.class); BedDetails bedDetails = bedManagementService.getBedAssignmentDetailsByPatient(appointment.getPatient()); if(bedDetails!= null) { additionalInfo.put("LOCATION_KEY", bedDetails.getPhysicalLocation().getName()); additionalInfo.put("BED_NUMBER_KEY", bedDetails.getBedNumber()); } return additionalInfo; } } |
Info | ||
---|---|---|
| ||
|
Panel | ||
---|---|---|
| ||
|