diff --git a/openelis/src/org/bahmni/feed/openelis/feed/service/impl/PanelService.java b/openelis/src/org/bahmni/feed/openelis/feed/service/impl/PanelService.java index 67f8cfc4..5616ce2f 100644 --- a/openelis/src/org/bahmni/feed/openelis/feed/service/impl/PanelService.java +++ b/openelis/src/org/bahmni/feed/openelis/feed/service/impl/PanelService.java @@ -68,11 +68,16 @@ public void createOrUpdate(ReferenceDataPanel referenceDataPanel) throws IOExcep String sysUserId = auditingService.getSysUserId(); ExternalReference data = externalReferenceDao.getData(referenceDataPanel.getId(), CATEGORY_PANEL); if (data == null) { - Panel panel = new Panel(); - panel = populatePanel(panel, referenceDataPanel, sysUserId); - panelDAO.insertData(panel); - saveTestsForPanel(panel, referenceDataPanel, sysUserId); - saveExternalReference(referenceDataPanel, panel); + if (referenceDataPanel.getIsActive()) { + Panel panel = new Panel(); + panel = populatePanel(panel, referenceDataPanel, sysUserId); + panelDAO.insertData(panel); + saveTestsForPanel(panel, referenceDataPanel, sysUserId); + saveExternalReference(referenceDataPanel, panel); + } else { + return; + } + } else { Panel panel = panelDAO.getPanelById(String.valueOf(data.getItemId())); populatePanel(panel, referenceDataPanel, sysUserId); diff --git a/openelis/src/org/bahmni/feed/openelis/feed/service/impl/TestService.java b/openelis/src/org/bahmni/feed/openelis/feed/service/impl/TestService.java index 44cc5875..ed2babb8 100644 --- a/openelis/src/org/bahmni/feed/openelis/feed/service/impl/TestService.java +++ b/openelis/src/org/bahmni/feed/openelis/feed/service/impl/TestService.java @@ -99,9 +99,14 @@ public void createOrUpdate(ReferenceDataTest referenceDataTest) throws IOExcepti Test test = new Test(); if (data == null) { - test = populateTest(test, referenceDataTest, sysUserId, null); - testDAO.insertData(test); - saveExternalReference(referenceDataTest, test); + if (referenceDataTest.getIsActive()) { + test = populateTest(test, referenceDataTest, sysUserId, null); + testDAO.insertData(test); + saveExternalReference(referenceDataTest, test); + } + else { + return; + } } else { test = testDAO.getTestById(String.valueOf(data.getItemId())); String uuid = test.getTestSection() != null ? test.getTestSection().getUUID() : null; diff --git a/openelis/src/org/bahmni/feed/openelis/feed/service/impl/TypeOfSampleService.java b/openelis/src/org/bahmni/feed/openelis/feed/service/impl/TypeOfSampleService.java index 11a92773..28055f6e 100644 --- a/openelis/src/org/bahmni/feed/openelis/feed/service/impl/TypeOfSampleService.java +++ b/openelis/src/org/bahmni/feed/openelis/feed/service/impl/TypeOfSampleService.java @@ -61,7 +61,12 @@ public void createOrUpdate(ReferenceDataSample sample) throws LIMSException { TypeOfSample typeOfSample = typeOfSampleDAO.getTypeOfSampleByUUID(sample.getId()); if (typeOfSample == null) { - create(sample, sysUserId); + if(sample.getIsActive()){ + create(sample, sysUserId); + } + else{ + return; + } } else { update(typeOfSample, sample, sysUserId); }