From 2b7e8395a31e1777500d75b589b7e5a55c6a4fab Mon Sep 17 00:00:00 2001 From: Kavitha S Date: Fri, 29 Mar 2024 23:18:31 +0530 Subject: [PATCH 1/3] BAH-3723|Kavitha| add event handling model and create task for admit event --- api/pom.xml | 12 +++++ omod/pom.xml | 12 +++++ .../module/ipd/events/ConfigLoader.java | 41 +++++++++++++++ .../module/ipd/events/IPDEventManager.java | 36 +++++++++++++ .../module/ipd/events/IPDEventUtils.java | 22 ++++++++ .../ipd/events/factory/IPDEventFactory.java | 8 +++ .../factory/impl/IPDEventFactoryImpl.java | 38 ++++++++++++++ .../ipd/events/handler/IPDEventHandler.java | 7 +++ .../impl/PatientAdmitEventHandler.java | 52 +++++++++++++++++++ .../impl/RolloverTaskEventHandler.java | 29 +++++++++++ .../impl/ShiftStartTaskEventHandler.java | 28 ++++++++++ .../module/ipd/events/model/ConfigDetail.java | 19 +++++++ .../module/ipd/events/model/IPDEvent.java | 18 +++++++ .../module/ipd/events/model/IPDEventType.java | 7 +++ .../module/ipd/events/model/TaskDetail.java | 16 ++++++ .../postprocessor/IPDTransactionHandler.java | 9 ++++ .../src/main/resources/application.properties | 3 ++ omod/src/main/resources/config.xml | 1 + .../resources/webModuleApplicationContext.xml | 1 + pom.xml | 18 ++++++- 20 files changed, 376 insertions(+), 1 deletion(-) create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/ConfigLoader.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/IPDEventManager.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/IPDEventUtils.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/factory/IPDEventFactory.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/factory/impl/IPDEventFactoryImpl.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/handler/IPDEventHandler.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/PatientAdmitEventHandler.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/RolloverTaskEventHandler.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/ShiftStartTaskEventHandler.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/model/ConfigDetail.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/model/IPDEvent.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/model/IPDEventType.java create mode 100644 omod/src/main/java/org/openmrs/module/ipd/events/model/TaskDetail.java create mode 100644 omod/src/main/resources/application.properties diff --git a/api/pom.xml b/api/pom.xml index f119a5e..cc20907 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -145,6 +145,18 @@ provided + + org.bahmni.module + fhir2Extension-api + provided + + + + org.bahmni.module + fhir2Extension-omod + provided + + org.bahmni.module medication-administration-api diff --git a/omod/pom.xml b/omod/pom.xml index 8895021..11a3f26 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -123,6 +123,18 @@ provided + + org.bahmni.module + fhir2Extension-api + provided + + + + org.bahmni.module + fhir2Extension-omod + provided + + org.openmrs.module emrapi-api diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/ConfigLoader.java b/omod/src/main/java/org/openmrs/module/ipd/events/ConfigLoader.java new file mode 100644 index 0000000..3b390fa --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/ConfigLoader.java @@ -0,0 +1,41 @@ +package org.openmrs.module.ipd.events; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.openmrs.module.ipd.events.model.ConfigDetail; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.FileSystemResource; +import org.springframework.stereotype.Component; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +@Component +@Slf4j +public class ConfigLoader { + private List configs = new ArrayList<>(); + + private ObjectMapper objectMapper = new ObjectMapper(); + + @Value("${config-file.path}") + private String routeConfigurationFileLocation; + + public List getConfigs() { + if (configs.isEmpty()) { + loadConfiguration(); + } + return this.configs; + } + + private void loadConfiguration() { + try { + File routeConfigurationFile = new FileSystemResource(routeConfigurationFileLocation).getFile(); + this.configs = objectMapper.readValue(routeConfigurationFile, new TypeReference>() {}); + } catch (IOException exception) { + log.error("Failed to load configuration for file : " + routeConfigurationFileLocation, exception); + } + } +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/IPDEventManager.java b/omod/src/main/java/org/openmrs/module/ipd/events/IPDEventManager.java new file mode 100644 index 0000000..7614774 --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/IPDEventManager.java @@ -0,0 +1,36 @@ +package org.openmrs.module.ipd.events; + +import org.openmrs.module.ipd.events.factory.IPDEventFactory; +import org.openmrs.module.ipd.events.handler.IPDEventHandler; +import org.openmrs.module.ipd.events.model.IPDEvent; +import org.openmrs.module.ipd.events.model.IPDEventType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class IPDEventManager { + @Autowired + ConfigLoader configLoader; + + @Autowired + IPDEventFactory eventFactory; + + public IPDEventType getEventTypeForEncounter(String type) { + switch (type) { + case "ADMISSION": + return IPDEventType.PATIENT_ADMIT; + case "SHIFT_START_TASK": + return IPDEventType.SHIFT_START_TASK; + case "ROLLOVER_TASK": + return IPDEventType.ROLLOVER_TASK; + default: + return null; + } + } + + public void processEvent(IPDEvent event) { + IPDEventHandler handler = eventFactory.createEventHandler(event.getIpdEventType()); + handler.handleEvent(event); + } + +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/IPDEventUtils.java b/omod/src/main/java/org/openmrs/module/ipd/events/IPDEventUtils.java new file mode 100644 index 0000000..42abc30 --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/IPDEventUtils.java @@ -0,0 +1,22 @@ +package org.openmrs.module.ipd.events; + +import org.openmrs.module.fhir2.model.FhirTask; +import org.openmrs.module.fhirExtension.web.contract.TaskRequest; +import org.openmrs.module.ipd.events.model.IPDEvent; + +import java.util.Date; + +public class IPDEventUtils { + + public static TaskRequest createNonMedicationTaskRequest(IPDEvent ipdEvent, String name, String taskType) { + TaskRequest taskRequest = new TaskRequest(); + taskRequest.setName(name); + taskRequest.setTaskType(taskType); + taskRequest.setEncounterUuid(ipdEvent.getEncounterUuid()); + taskRequest.setPatientUuid(ipdEvent.getPatientUuid()); + taskRequest.setRequestedStartTime(new Date()); + taskRequest.setIntent(FhirTask.TaskIntent.ORDER); + taskRequest.setStatus(FhirTask.TaskStatus.REQUESTED); + return taskRequest; + } +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/factory/IPDEventFactory.java b/omod/src/main/java/org/openmrs/module/ipd/events/factory/IPDEventFactory.java new file mode 100644 index 0000000..690a467 --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/factory/IPDEventFactory.java @@ -0,0 +1,8 @@ +package org.openmrs.module.ipd.events.factory; + +import org.openmrs.module.ipd.events.model.IPDEventType; +import org.openmrs.module.ipd.events.handler.IPDEventHandler; + +public interface IPDEventFactory { + IPDEventHandler createEventHandler(IPDEventType eventType); +} \ No newline at end of file diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/factory/impl/IPDEventFactoryImpl.java b/omod/src/main/java/org/openmrs/module/ipd/events/factory/impl/IPDEventFactoryImpl.java new file mode 100644 index 0000000..faf7ddb --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/factory/impl/IPDEventFactoryImpl.java @@ -0,0 +1,38 @@ +package org.openmrs.module.ipd.events.factory.impl; + +import org.openmrs.module.ipd.events.model.IPDEventType; +import org.openmrs.module.ipd.events.factory.IPDEventFactory; +import org.openmrs.module.ipd.events.handler.IPDEventHandler; +import org.openmrs.module.ipd.events.handler.impl.PatientAdmitEventHandler; +import org.openmrs.module.ipd.events.handler.impl.RolloverTaskEventHandler; +import org.openmrs.module.ipd.events.handler.impl.ShiftStartTaskEventHandler; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class IPDEventFactoryImpl implements IPDEventFactory { + + @Autowired + PatientAdmitEventHandler patientAdmitEventHandler; + + @Autowired + ShiftStartTaskEventHandler shiftStartTaskEventHandler; + + @Autowired + RolloverTaskEventHandler rolloverTaskEventHandler; + + @Override + public IPDEventHandler createEventHandler(IPDEventType eventType) { + switch (eventType) { + case PATIENT_ADMIT: + return patientAdmitEventHandler; + case SHIFT_START_TASK: + return shiftStartTaskEventHandler; + case ROLLOVER_TASK: + return rolloverTaskEventHandler; + default: + throw new IllegalArgumentException("Unsupported event type: " + eventType); + } + } + +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/handler/IPDEventHandler.java b/omod/src/main/java/org/openmrs/module/ipd/events/handler/IPDEventHandler.java new file mode 100644 index 0000000..27b1cca --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/handler/IPDEventHandler.java @@ -0,0 +1,7 @@ +package org.openmrs.module.ipd.events.handler; + +import org.openmrs.module.ipd.events.model.IPDEvent; + +public interface IPDEventHandler { + void handleEvent(IPDEvent event); +} \ No newline at end of file diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/PatientAdmitEventHandler.java b/omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/PatientAdmitEventHandler.java new file mode 100644 index 0000000..e9717da --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/PatientAdmitEventHandler.java @@ -0,0 +1,52 @@ +package org.openmrs.module.ipd.events.handler.impl; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.openmrs.module.fhirExtension.model.Task; +import org.openmrs.module.fhirExtension.service.TaskService; +import org.openmrs.module.fhirExtension.web.contract.TaskRequest; +import org.openmrs.module.fhirExtension.web.mapper.TaskMapper; +import org.openmrs.module.ipd.events.ConfigLoader; +import org.openmrs.module.ipd.events.IPDEventUtils; +import org.openmrs.module.ipd.events.handler.IPDEventHandler; +import org.openmrs.module.ipd.events.model.ConfigDetail; +import org.openmrs.module.ipd.events.model.IPDEvent; +import org.openmrs.module.ipd.events.model.TaskDetail; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +public class PatientAdmitEventHandler implements IPDEventHandler { + + private final Log log = LogFactory.getLog(this.getClass()); + + @Autowired + ConfigLoader configLoader; + + @Autowired + private TaskMapper taskMapper; + + @Autowired + private TaskService taskService; + + @Override + public void handleEvent(IPDEvent event) { + List configList = configLoader.getConfigs(); + ConfigDetail eventConfig = configList.stream() + .filter(config -> config.getType().equals(event.getIpdEventType().name())) + .findFirst() + .orElse(null); + if (eventConfig != null) { + for(TaskDetail taskDetail : eventConfig.getTasks()) { + TaskRequest taskRequest = IPDEventUtils.createNonMedicationTaskRequest(event, taskDetail.getName(), "nursing_activity_system"); + Task task = taskMapper.fromRequest(taskRequest); + taskService.saveTask(task); + log.info("Task created " + taskDetail.getName()); + } + } + + + } +} \ No newline at end of file diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/RolloverTaskEventHandler.java b/omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/RolloverTaskEventHandler.java new file mode 100644 index 0000000..71f0def --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/RolloverTaskEventHandler.java @@ -0,0 +1,29 @@ +package org.openmrs.module.ipd.events.handler.impl; + +import org.openmrs.module.ipd.events.ConfigLoader; +import org.openmrs.module.ipd.events.model.ConfigDetail; +import org.openmrs.module.ipd.events.model.IPDEvent; +import org.openmrs.module.ipd.events.handler.IPDEventHandler; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +public class RolloverTaskEventHandler implements IPDEventHandler { + + @Autowired + ConfigLoader configLoader; + + @Override + public void handleEvent(IPDEvent event) { + List configList = configLoader.getConfigs(); + ConfigDetail eventConfig = configList.stream() + .filter(config -> config.getType().equals(event.getIpdEventType().name())) + .findFirst() + .orElse(null); + System.out.println("eventConfig type RolloverTaskEventHandler " + eventConfig.getType()); + System.out.println("eventConfig tasks RolloverTaskEventHandler " + eventConfig.getTasks() + " size --- " + eventConfig.getTasks().size()); + //create task based on configuration + } +} \ No newline at end of file diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/ShiftStartTaskEventHandler.java b/omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/ShiftStartTaskEventHandler.java new file mode 100644 index 0000000..603e59a --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/handler/impl/ShiftStartTaskEventHandler.java @@ -0,0 +1,28 @@ +package org.openmrs.module.ipd.events.handler.impl; + +import org.openmrs.module.ipd.events.ConfigLoader; +import org.openmrs.module.ipd.events.model.ConfigDetail; +import org.openmrs.module.ipd.events.model.IPDEvent; +import org.openmrs.module.ipd.events.handler.IPDEventHandler; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +public class ShiftStartTaskEventHandler implements IPDEventHandler { + + @Autowired + ConfigLoader configLoader; + + @Override + public void handleEvent(IPDEvent event) { + List configList = configLoader.getConfigs(); + ConfigDetail eventConfig = configList.stream() + .filter(config -> config.getType().equals(event.getIpdEventType().name())) + .findFirst() + .orElse(null); + + //create task based on configuration + } +} \ No newline at end of file diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/model/ConfigDetail.java b/omod/src/main/java/org/openmrs/module/ipd/events/model/ConfigDetail.java new file mode 100644 index 0000000..8eae262 --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/model/ConfigDetail.java @@ -0,0 +1,19 @@ +package org.openmrs.module.ipd.events.model; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.List; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +@JsonIgnoreProperties(ignoreUnknown = true) +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class ConfigDetail { + private String type; + private List tasks; +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/model/IPDEvent.java b/omod/src/main/java/org/openmrs/module/ipd/events/model/IPDEvent.java new file mode 100644 index 0000000..e812c49 --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/model/IPDEvent.java @@ -0,0 +1,18 @@ +package org.openmrs.module.ipd.events.model; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +@JsonIgnoreProperties(ignoreUnknown = true) +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class IPDEvent { + private String encounterUuid; + private String patientUuid; + private IPDEventType ipdEventType; +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/model/IPDEventType.java b/omod/src/main/java/org/openmrs/module/ipd/events/model/IPDEventType.java new file mode 100644 index 0000000..52196f0 --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/model/IPDEventType.java @@ -0,0 +1,7 @@ +package org.openmrs.module.ipd.events.model; + +public enum IPDEventType { + PATIENT_ADMIT, + SHIFT_START_TASK, + ROLLOVER_TASK; +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/events/model/TaskDetail.java b/omod/src/main/java/org/openmrs/module/ipd/events/model/TaskDetail.java new file mode 100644 index 0000000..e5de905 --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/events/model/TaskDetail.java @@ -0,0 +1,16 @@ +package org.openmrs.module.ipd.events.model; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +@JsonIgnoreProperties(ignoreUnknown = true) +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class TaskDetail { + private String name; +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/postprocessor/IPDTransactionHandler.java b/omod/src/main/java/org/openmrs/module/ipd/postprocessor/IPDTransactionHandler.java index 81c74aa..f1be770 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/postprocessor/IPDTransactionHandler.java +++ b/omod/src/main/java/org/openmrs/module/ipd/postprocessor/IPDTransactionHandler.java @@ -3,9 +3,12 @@ import org.openmrs.Encounter; import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; import org.openmrs.module.emrapi.encounter.postprocessor.EncounterTransactionHandler; +import org.openmrs.module.ipd.events.model.IPDEvent; import org.openmrs.module.ipd.service.IPDScheduleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.openmrs.module.ipd.events.model.IPDEventType; +import org.openmrs.module.ipd.events.IPDEventManager; @Component public class IPDTransactionHandler implements EncounterTransactionHandler { @@ -13,6 +16,9 @@ public class IPDTransactionHandler implements EncounterTransactionHandler { @Autowired IPDScheduleService ipdScheduleService; + @Autowired + IPDEventManager eventManager; + @Override public void forRead(Encounter encounter, EncounterTransaction encounterTransaction) { // No Implementation needed as of now @@ -20,6 +26,9 @@ public void forRead(Encounter encounter, EncounterTransaction encounterTransacti @Override public void forSave(Encounter encounter, EncounterTransaction encounterTransaction) { + IPDEventType eventType = eventManager.getEventTypeForEncounter(encounter.getEncounterType().getName()); + IPDEvent ipdEvent = new IPDEvent(encounter.getUuid(), encounter.getPatient().getUuid(), eventType); + eventManager.processEvent(ipdEvent); ipdScheduleService.handlePostProcessEncounterTransaction(encounter,encounterTransaction); } } diff --git a/omod/src/main/resources/application.properties b/omod/src/main/resources/application.properties new file mode 100644 index 0000000..ed16b69 --- /dev/null +++ b/omod/src/main/resources/application.properties @@ -0,0 +1,3 @@ + +# Route definitions +config-file.path=/etc/bahmni_config/openmrs/apps/ipdDashboard/eventsConfig.json \ No newline at end of file diff --git a/omod/src/main/resources/config.xml b/omod/src/main/resources/config.xml index 7c18b69..6a691b1 100644 --- a/omod/src/main/resources/config.xml +++ b/omod/src/main/resources/config.xml @@ -14,6 +14,7 @@ org.bahmni.module.bahmnicore org.openmrs.module.bedmanagement org.bahmni.module.medication-administration + org.bahmni.module.fhir2Extension org.openmrs.module.ipd.api.IPDActivator diff --git a/omod/src/main/resources/webModuleApplicationContext.xml b/omod/src/main/resources/webModuleApplicationContext.xml index 82e84de..a12d5d4 100644 --- a/omod/src/main/resources/webModuleApplicationContext.xml +++ b/omod/src/main/resources/webModuleApplicationContext.xml @@ -8,4 +8,5 @@ + diff --git a/pom.xml b/pom.xml index 1a8a3be..7c2fe3d 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,8 @@ -Xmx1024m 0.7.9 1.18.26 - 1.11.0 + 2.0.0-SNAPSHOT + 1.3.0-SNAPSHOT 0.94-SNAPSHOT 1.32.0 @@ -197,6 +198,21 @@ provided + + org.bahmni.module + fhir2Extension-api + ${openmrsFhir2ExtensionVersion} + provided + + + + + org.bahmni.module + fhir2Extension-omod + ${openmrsFhir2ExtensionVersion} + provided + + org.bahmni.module medication-administration-api From 72fb05a94728446c13834b67c2683c94ceada187 Mon Sep 17 00:00:00 2001 From: Kavitha S Date: Tue, 2 Apr 2024 12:57:32 +0530 Subject: [PATCH 2/3] Kavitha| add null check for event type --- .../module/ipd/postprocessor/IPDTransactionHandler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/omod/src/main/java/org/openmrs/module/ipd/postprocessor/IPDTransactionHandler.java b/omod/src/main/java/org/openmrs/module/ipd/postprocessor/IPDTransactionHandler.java index f1be770..82c9825 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/postprocessor/IPDTransactionHandler.java +++ b/omod/src/main/java/org/openmrs/module/ipd/postprocessor/IPDTransactionHandler.java @@ -27,8 +27,10 @@ public void forRead(Encounter encounter, EncounterTransaction encounterTransacti @Override public void forSave(Encounter encounter, EncounterTransaction encounterTransaction) { IPDEventType eventType = eventManager.getEventTypeForEncounter(encounter.getEncounterType().getName()); - IPDEvent ipdEvent = new IPDEvent(encounter.getUuid(), encounter.getPatient().getUuid(), eventType); - eventManager.processEvent(ipdEvent); + if (eventType != null) { + IPDEvent ipdEvent = new IPDEvent(encounter.getUuid(), encounter.getPatient().getUuid(), eventType); + eventManager.processEvent(ipdEvent); + } ipdScheduleService.handlePostProcessEncounterTransaction(encounter,encounterTransaction); } } From 5f1d9dd269c3d892218ada1ea344e44553d1f555 Mon Sep 17 00:00:00 2001 From: Kavitha S Date: Tue, 2 Apr 2024 19:05:54 +0530 Subject: [PATCH 3/3] Kavitha | update fhir2 extension module version --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 7c2fe3d..65aaef0 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ 0.7.9 1.18.26 2.0.0-SNAPSHOT - 1.3.0-SNAPSHOT + 1.3.0.ipd-SNAPSHOT 0.94-SNAPSHOT 1.32.0 @@ -201,7 +201,7 @@ org.bahmni.module fhir2Extension-api - ${openmrsFhir2ExtensionVersion} + ${fhir2ExtensionVersion} provided @@ -209,7 +209,7 @@ org.bahmni.module fhir2Extension-omod - ${openmrsFhir2ExtensionVersion} + ${fhir2ExtensionVersion} provided