I just created a new text component that is causing EMR to completely crash. The component itself works as designed and displays the text in the note. It isn't until you place the note on hold and try to re-open it that centricity crashes.I have tried it on both our production EMR 9.8 and Test environment with 9.10 on it with the same results. I have also tried rewriting the text component a couple of different ways.
Here is the error: Unhandled exception at 0x203D3EE8 (mlBase.dll) in ml.exe: Stack cookie instrumentation code detected a stack-based buffer overrun.
Like I said I have tried many versions of the code but here is the simplest version which still causes a crash:
{'{
CFMT(OBSANY("ACECONTRA"),"","ACE/ARB: ","", HRET) +
CFMT(OBSANY("BTABLCCONTRA"),"","BETA BLOCKERS: ", "", HRET) +
CFMT(OBSANY("OTHERCONTRA"),"","INHALED CORTICOSTEROID: ","",HRET) +
CFMT(OBSANY("ASACONTRA"),"","ASPIRIN: ","",HRET) +
CFMT(OBSANY("DMARDMEDREAS"),"","DMARD: ","",HRET) +
CFMT(OBSANY("STATINCONTRA"),"","STATIN: ","",HRET)
}'}
It seems to work sometimes if I remove 1-2 lines from the beginning or end, but I can not trace the issue to any specific line. I also tried setting them all to a variable and didn't even have them print and it still crashes. Once it crashes, every time I try to open the note for editing emr completely crashes. The only way I have been able to open those notes again to get rid of them is to run this:
UPDATE DOCUMENT SET NOTETEXT = '' WHERE SDID = #SDIDHERE#;
The note looks and works fine before it is placed on hold and it contains the text I expect in it. After it is on hold it looks fine in the document viewer. It is only when you open the note again that it crashes.
Turning on tracing does't provide crash data.
There are no special characters in the text. It was all written in notepad.
Try replacing HRET with following:
"
"
i.e. quote, CR-LF,quote
I finally came up with some code that works and does not crash but I still want to know why it was happening in the first place. The code that works is:
{'{
if (OBSANY("ACECONTRA") + OBSANY("BTABLCCONTRA") + OBSANY("OTHERCONTRA") + OBSANY("ASACONTRA") + OBSANY("DMARDMEDREAS") + OBSANY("STATINCONTRA") <> "") Then
FMT("Medication Contraindications:", "B")
else
""
endif
}'}{'{
CFMT(OBSANY("ACECONTRA"),"",HRET + "ACE/ARB: ","")
}'}{'{
CFMT(OBSANY("BTABLCCONTRA"),"",HRET + "BETA BLOCKERS: ", "")
}'}{'{
CFMT(OBSANY("OTHERCONTRA"),"",HRET + "INHALED CORTICOSTEROID: ","")
}'}{'{
CFMT(OBSANY("ASACONTRA"),"",HRET + "ASPIRIN: ","")
}'}{'{
CFMT(OBSANY("DMARDMEDREAS"),"",HRET + "DMARD: ","")
}'}{'{
CFMT(OBSANY("STATINCONTRA"),"",HRET + "STATIN: ","")
}'}
That did not fix anything. It does it even without the new lines. Strangely enough it did not do it if I remove all of the CFMT and just have OBSANY(...) + OBSANY(...).
I ended up getting it working with separate CFMT expressions. I just can't seem to get it to work when there is only one expression put together with +.
This is the correct method. Using a watcher status in text components is limited in capacity. By breaking each watcher up into individual statements, you minimized the footprint. If I recall correctly, the size limit for these types of watchers is 255 characters.