Skip to content

Commit

Permalink
BAH-3994 | Sync only non-retired tests, panels and samples (#84)
Browse files Browse the repository at this point in the history
* BAH-3994 | Refactor. Sync test for only un-retired concepts

* BAH-3994 | Refactor. Sync panels for only un-retired concepts

* BAH-3994 | Refactor. Sync samples for only un-retired concepts
  • Loading branch information
mohan-13 authored Jun 26, 2024
1 parent eced69f commit d1401dd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d1401dd

Please sign in to comment.