BBahmni 한국어 매뉴얼검색
한국어 번역 완료
한국어English

Integration Points

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

<require_module>org.openmrs.module.appointments</require_module>

2. Add appointments module dependency in the pom.xml

<dependency>
   <groupId>org.openmrs.module</groupId>
   <artifactId>appointments-omod</artifactId>
   <version>1.0-SNAPSHOT</version>
   <scope>provided</scope>
</dependency>

3. Implement extension point

@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;
   }
}
원문 정보

Bahmni Wiki · CC BY-SA 4.0

원문 보기 ↗