Can someone help me identify what I have wrong with my case statement below? I get no Build Errors in VFE with it and I've tried tweaking it a few different ways, yet when I load it into Centricity, I get the error I show below the case statement.
---Begin case statement---
{procedure=(OBSANY("PROC COMPS"))
cond
case procedure == ""
"Please select a procedure from the dropdown"
case procedure == ESI Cervical
"Procedure: Cervical Transforaminal Epidural Steroid Injection"
case procedure == ESI Thoracic
"Procedure: Thoracic Transforaminal Epidural Steroid Injection"
case procedure == ESI Lumbar
"Procedure: Lumbar Transforaminal Epidural Steroid Injection"
case procedure == ESI Caudal
"Procedure: Caudal Epidural Steroid Injection"
case procedure == ESI (IL) Cervical
"Procedure: Cervical Interlaminar Epidural Steroid Injection"
case procedure == ESI (IL) Lumbar
"Procedure: Lumbar Interlaminar Epidural Steroid Injection"
case procedure == MBB Cervical
"Procedure: Medial Branch Nerve Injection of the Paravertebral Facet Joint"
case procedure == MBB Thoracic
"Procedure: Medial Branch Nerve Injection of the Paravertebral Facet Joint"
case procedure == MBB Lumbar
"Procedure: Medial Branch Nerve Injection of the Paravertebral Facet Joint"
case procedure == RF Cervical
"Procedure: Medial Branch Nerve Cervical Facet Radiofrequency (RF) Neuroablation"
case procedure == RF Thoracic
"Procedure: Medial Branch Nerve Thoracic Facet Radiofrequency (RF) Neuroablation"
case procedure == RF Lumbar
"Procedure: Medial Branch Nerve Lumbar Facet Radiofrequency (RF) Neuroablation"
case procedure == RF Sacral
"Procedure: Medial Branch Nerve Facet Radiofrequency (RF) Neuroablation"
case procedure == PNA Lumbar
"Procedure: Peripheral Nerve Lumbar Facet Radiofrequency (RF) Neuroablation"
endcond}
---End case statement---
---Begin Centricity error message---
{IF (STR(DOCUMENT.PROCEDURE_5990154100497958276) == "") THEN "" ELSE ("
" + procedure=(F5990154204676150775_0)
cond <-COMPILER ERROR NEARBY: Expect RIGHT PAREN. Instead had COND KEYWORD after RIGHT PAREN
---End Centricity error message---
Just glancing, it looks like you need to have your comparison statements enclosed in quotes because they are text strings.
e.g. case procedure == "ESI Cervical"
That was one of the first things I had tried. I just pasted the last iteration of things I have tried. My most current attempt (still failing) looks like this:
{proc=(OBSANY("PROC COMPS"))
cond
case proc == "ESI Cervical"
"Procedure: Cervical Transforaminal Epidural Steroid Injection"
case proc == "ESI Thoracic"
"Procedure: Thoracic Transforaminal Epidural Steroid Injection"
case proc == "ESI Lumbar"
"Procedure: Lumbar Transforaminal Epidural Steroid Injection"
case proc == "ESI Caudal"
"Procedure: Caudal Epidural Steroid Injection"
case proc == "ESI (IL) Cervical"
"Procedure: Cervical Interlaminar Epidural Steroid Injection"
case proc == "ESI (IL) Lumbar"
"Procedure: Lumbar Interlaminar Epidural Steroid Injection"
case proc == "MBB Cervical"
"Procedure: Medial Branch Nerve Injection of the Paravertebral Facet Joint"
case proc == "MBB Thoracic"
"Procedure: Medial Branch Nerve Injection of the Paravertebral Facet Joint"
case proc == "MBB Lumbar"
"Procedure: Medial Branch Nerve Injection of the Paravertebral Facet Joint"
case proc == "RF Cervical"
"Procedure: Medial Branch Nerve Cervical Facet Radiofrequency (RF) Neuroablation"
case proc == "RF Thoracic"
"Procedure: Medial Branch Nerve Thoracic Facet Radiofrequency (RF) Neuroablation"
case proc == "RF Lumbar"
"Procedure: Medial Branch Nerve Lumbar Facet Radiofrequency (RF) Neuroablation"
case proc == "RF Sacral"
"Procedure: Medial Branch Nerve Facet Radiofrequency (RF) Neuroablation"
case proc == "PNA Lumbar"
"Procedure: Peripheral Nerve Lumbar Facet Radiofrequency (RF) Neuroablation"
case proc == ""
"Please select a procedure from the dropdown"
endcond}
Thanks for looking. It seems to not like my variable, I think I need to figure that part out. If I don't included that, I don't get the error message, but the chart note only displays the value from the first case.
Try removing the outside parenthesis when you setup your variable at the top. Like this:
procedure= OBSANY(“PROC COMPS”)
Brad
I don't think there is an issue with "proc" being a reserved word in MEL, but you might consider changing the name of the variable.
Where exactly are you setting the value of this variable? Are you trying to set the value of the variable when a form loads, in a quick text, or when you interact with a control on a form? If this code is being used on a form, you may consider using a watcher expression to ensure the variable is getting set. You can also place a userok("Value of variable is:" + proc) expression in your code to see what the value is when the code is getting fired. If you want to connect online tomorrow, I can probably take a look at it with you.
Try declaring 'proc' as local - otherwise it is global. I would recommend renaming it as well to ensure uniqueness. Also, ensure that a space separates each case condition and command, I did not find any in your posted example.
{
local lProc = OBSANY("PROC COMPS")
cond
case lProc == "ESI Cervical" "Procedure: Cervical Transforaminal Epidural Steroid Injection"
case lProc == "ESI Thoracic" "Procedure: Thoracic Transforaminal Epidural Steroid Injection"
case lProc == "ESI Lumbar" "Procedure: Lumbar Transforaminal Epidural Steroid Injection"
case lProc == "ESI Caudal" "Procedure: Caudal Epidural Steroid Injection"
case lProc == "ESI (IL) Cervical" "Procedure: Cervical Interlaminar Epidural Steroid Injection"
case lProc == "ESI (IL) Lumbar" "Procedure: Lumbar Interlaminar Epidural Steroid Injection"
case lProc == "MBB Cervical" "Procedure: Medial Branch Nerve Injection of the Paravertebral Facet Joint"
case lProc == "MBB Thoracic" "Procedure: Medial Branch Nerve Injection of the Paravertebral Facet Joint"
case lProc == "MBB Lumbar" "Procedure: Medial Branch Nerve Injection of the Paravertebral Facet Joint"
case lProc == "RF Cervical" "Procedure: Medial Branch Nerve Cervical Facet Radiofrequency (RF) Neuroablation"
case lProc == "RF Thoracic" "Procedure: Medial Branch Nerve Thoracic Facet Radiofrequency (RF) Neuroablation"
case lProc == "RF Lumbar" "Procedure: Medial Branch Nerve Lumbar Facet Radiofrequency (RF) Neuroablation"
case lProc == "RF Sacral" "Procedure: Medial Branch Nerve Facet Radiofrequency (RF) Neuroablation"
case lProc == "PNA Lumbar" "Procedure: Peripheral Nerve Lumbar Facet Radiofrequency (RF) Neuroablation"
case lProc == "" "Please select a lProcedure from the dropdown"
else ""
endcond
}