› Clovertech Forums › Cloverleaf › Retention Time of SMAT
Team – We have a ninety day retention, and are running out of space, which is approaching 300G. What is the industry norm for SMAT retention?
Working off an old ‘best practices’ document (V20.x) from infor, I don’t see a standard recommendation.
It does say that SMAT files should be on a separate files system (esp. if SMATDB is not being used), which is what we do — 180 days on an attached storage appliance.
I don’t know about “industry norm”, I imagine there would be many factors that might affect how long you keep messages resident on the engine machine. For us, we default to 7 days. Our train of thought is that if a customer/vendor/whomever can’t realize that there’s an issue within a week, there are likely other issues that need to be addressed first, especially in such a time-sensitive industry as healthcare. For our BMDI sites, we only keep 3 days-worth, as those values definitely become stale very quickly, not to mention the sheer volume of messages on that type of interface.
That being said, there are also instances where we go significantly longer, up to 90 days. These are mostly state agencies(immunization recording, HIE’s, etc…). They either have regulations on how long messages need to be saved, and/or they are significantly slower in identifying issues that might require resends.
That that being said, it can also depend somewhat on your main EHR system. We keep messages in our main system for 90 days. So, worst come to worst, we can always go there to find messages, if need be.
HTH,
TIM
Tim Pancost
Trinity Health
We also have a retention of 90 days, with some exceptions. QRY messages we save for 14 days, while we save DFT messages for 2 years. We have had several times that we were asked about DFT messages from the year before, so we extended that retention.
We keep all our SMATDB files in their usual place: under their process or under Smathistory. No offsite archive. Currently we have about 30oGB of data saved.
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands
We only keep 7 days’ worth of SMAT DBs on our engine (in a separate file system, with folders for each day Sun-Sat). Our stance is that it is an “interface engine” for receiving/queueing/sending data, not a data repository. While it seems a bit constraining, it is in a “good way”. It saves us from being the archival and reporting system.
Jim Cobane – Henry Ford Health
I’m going to piggyback off this conversation, how do you guys set your retention? Cloverleaf only wants to do file sized based cycling. If I have to, I will write a shell script to loop through sites, but this is one of my gripes with Cloverleaf is it’s difficult to do things from a global level. This requires ‘switching’ to each site, then running the command on each thread to cycle the logs. At that time the automatic removal can remove files older than whatever time frame.
So the short question: How are you cycling the databases so they will automatically be removed?
You are right when you say you can’t set retention on a global level: you will always have to do it per site. With the options provided in Network Configurator through Options/Site Preferences… tab SMAT, you can also delete SMAT history files when they are older than X days. This could work for most of our sites.
However, we have always worked with a ‘weekly_housekeeping’ crontab script to cyclesave all SMATs for all sites/processes and delete old SMAT files. And we save all inbound DFT SMAT for 2 years, so with this script we can differentiate the retention time between processes/threads.
Here is our current weekly_housekeeping script. Please don’t ask about the ‘sitecontrol’ command: this is software provided by our Dutch reseller and we can’t disclose it. Basically it allows us to cyclesave the SMATs of all processes and threads within a site with one command.
#!/bin/sh
umask 000
# redirect stdout/stderr to a file
exec &> /cldata/scripts/weekly_housekeeping_cloverleaf.log
#
# load function for execution in cron
FPATH=${CL_INSTALL_DIR}/integrator/kshlib; export FPATH
. $FPATH/setroot
. $FPATH/setsite
#
# Functie voor het verwijderen op leeftijd van alle *ecd en *smatdb bestanden uit een (list van) processen
# in de site die op dat moment actief is.
# Hierbij moeten een aantal argumenten worden opgegeven:
# 1 – de leeftijd in dagen waarop smats worden verwijderd. De *ecd en *smatdb bestanden worden verwijderd.
# 2 – komma-gescheiden lijst van processen waarin smats worden verwijderd. De processen moeten in de huidige site voorkomen!
#
function remove_smat_age ()
{
echo “Remove SMAT with age $1 in processes $2”
for process in ${2//,/ }
do
#echo “process: ${process}”
find ${HCISITEDIR}/exec/processes/${process} -name “*.smatdb” -mtime +$1 -exec rm -f {} \;
find ${HCISITEDIR}/exec/processes/${process} -name “*.ecd” -mtime +$1 -exec rm -f {} \;
done
}
#
# Functie voor het verwijderen op leeftijd van alle *ecd en *smatdb bestanden uit een (list van) threads
# binnen een proces in de site die op dat moment actief is.
# Hierbij moeten een aantal argumenten worden opgegeven:
# 1 – de leeftijd in dagen waarop smats worden verwijderd. De *ecd en *smatdb bestanden worden verwijderd.
# 2 – proces waar de threads in hangen
# 3 – komma-gescheiden lijst van threads (namen van de smats eigenlijk) waarvan smats worden verwijderd. De processen en threads moeten in de huidige site voorkomen!
#
function remove_smat_age_thread ()
{
echo “Remove SMAT with age $1 in proces $2 from threads $3”
for thread in ${3//,/ }
do
find ${HCISITEDIR}/exec/processes/$2 -name “${thread}*.smatdb” -mtime +$1 -exec rm -f {} \;
find ${HCISITEDIR}/exec/processes/$2 -name “${thread}*.ecd” -mtime +$1 -exec rm -f {} \;
done
}
#
# Functie voor het opschonen van de huidige site.
# Gaat om de huidige site; hier gaat de functie vanuit.
# Diverse zaken per site regelen:
# * Verouderde ECD bestanden verwijderen
# * Tellers op nul zetten
#
function clean_current_site ()
{
# Cycle SMAT van deze site
sitecontrol cycle –smat
# Verouderde .ecd-bestanden verwijderen uit de hele processes-tree
find ${HCISITEDIR}/exec/processes -name “*.ecd” -mtime +100 -exec rm -f {} \;
# Verouderde error bestanden verwijderen uit de /exec/errors map
find ${HCISITEDIR}/exec/errors -mtime +100 -exec rm -f {} \;
# Alle tellers op nul zetten
# Gebruik optie -X ipv -Z om alle tijden (laatst ontvangen/verstuurd bericht) ongemoeid te laten
hcimsiutil -X
}
################################################################################################
###
### Start van de weekly housekeeping
###
################################################################################################
# Housekeeping: dit script dient elke 7 dagen gedraaid te worden!
# Dient te draaien onder user ‘hci’; ivm rechten en paden!
tijdnu=date "+%d-%m-%Y %H:%M:%S"
echo “Start time script: $tijdnu”
date=date "+%Y%m%d_%H%M"
# Allereerst worden per proces alle smat-files gecycled: dit doen we met één
# sitecontrol commanda; dit commando doet per site een cycle smat van alle (!)
# threads van alle processes binnen die thread.
# Later gaan we dan kijken of we smats per site/proces na bepaalde tijd gaan verwijderen. Je kunt
# dit via de ‘Site Preferences/SMAT’ ook instellen, maar dat geldt dan voor de gehele site.
# Met name voor DFT willen we de smats langer bewaren, dus met name voor die site moeten we iets apart doen.
#
# 25-11-2024 Omdat het SMAT cycle commando afbreekt op lege sites (en die hebben we nu nog) verplaats
# ik dit commando naar de functie toe. Hierdoor breekt het commando af bij lege site, maar bij andere
# sites werkt het dan wel.
#sitecontrol cycle -a -s
################################################################################################
###
### hixin
###
################################################################################################
setsite hixin
# Opschonen van de huidige site
clean_current_site
remove_smat_age 90 adt_hix,adt1,adt2,adtdmz,mfn,siu
################################################################################################
###
### hixout
###
################################################################################################
setsite hixout
# Opschonen van de huidige site
clean_current_site
remove_smat_age 730 dft
remove_smat_age 90 oru,politheek_ezorg,politheek_h,politheek_s,siu,vecozo,zm2hix_lsdv,zm_lsdv,zorgdomein
remove_smat_age 14 qry
#remove_smat_age_thread 365 dft hix_dft
################################################################################################
###
### functie
###
################################################################################################
setsite functie
# Opschonen van de huidige site
clean_current_site
remove_smat_age 90 car,clinical,knf,kno,long,mbv,mitralis,oog,orm_functie,uro
#remove_smat_age 45 oru_gen,oru_gen2
#remove_smat_age_thread 5 oru_gen pi_qry_patnr
#remove_smat_age_thread 5 oru_gen2 pi_qry_patnr
#remove_smat_age_thread 5 uitslagen delay_pihcm_kch
################################################################################################
###
### lab
###
################################################################################################
setsite lab
# Opschonen van de huidige site
clean_current_site
remove_smat_age 90 bloed,glims,lab2lab_in,lab2lab_out,lms,order_lab,oul
#remove_smat_age_thread 5 transport leftclick_api
################################################################################################
###
### overig
###
################################################################################################
setsite overig
# Opschonen van de huidige site
clean_current_site
remove_smat_age 90 csa_miele,csa_mmm_ac,csa_mmm_wash,csa_pmt,csa_steris,csa_sterrad,ediin,ediout,fico_grootboek,hr,mm_dff,mm,transport,zm_peridos
#remove_smat_age_thread 5 transport leftclick_api
# Wekelijks bouncen van processen transport en hr
#/cldata/scripts/bounce_process transport
#/cldata/scripts/bounce_process transport2
#/cldata/scripts/bounce_process hr
################################################################################################
###
### Rest van de weekly housekeeping
###
################################################################################################
# Switch voor alle zekerheid weer terug naar de hixin site.
setsite hixin
# In /opt/cloverleaf/cis19.1/integrator/temp worden tijdelijke bestanden aangelegd;
# dit is voor het herzenden van berichten nodig. Deze worden verwijderd.
rm /opt/cloverleaf/cis19.1/integrator/temp/tmp*
# Cycle de log voor het verwijderen van Studytube bestanden
#mv /cldata/scripts/studytube_remove_files.log /cldata/scripts/studytube_remove_files.log.old
# Cycle de ‘check_errors’ log
mv /cldata/scripts/check_errors.log /cldata/scripts/check_errors.log.old
# Cycle de ‘check_certificate_ezorg’ log
mv /cldata/scripts/check_certificate_ezorg.log /cldata/scripts/check_certificate_ezorg.log.old
# Cycle de ‘mail_vs30_duplicate_messages’ log
mv /cldata/scripts/log/mail_vs30_duplicate_messages.log /cldata/scripts/log/mail_vs30_duplicate_messages.log.old
tijdnu=date "+%d-%m-%Y %H:%M:%S"
echo “End time script: $tijdnu”
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands
Ok, that pretty much lines up with what I was thinking. My only question is there is a ‘sitecontrol’ command you have, is that just a custom command that makes it easier to use things like cycling logs/etc (rather than hcismatcycle)?
Yes. It’s a custom piece of software from our Dutch reseller, so I can’t share it here. It is built for Cloverleaf to simplify some difficult tasks, such as cycle saving al SMATs in one go, clean up sites, restart daemons/processes/threads etc.
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands
Well, that definitely aligns with my thought process and what I need to do. I appreciate it. It looks like I’ll be writing a more comprehensive script likely very close to what that one does.