{
IF DOCUMENT.Z1ST_LEVEL <> "" AND DOCUMENT.Z2ND_LEVEL == "" AND DOCUMENT.Z3RD_LEVEL == "" AND DOCUMENT.Z4TH_LEVEL == "" AND
DOCUMENT.Z1ST_LEVEL_LATERALITY <> "bilateral"
THEN DOCUMENT.CONTRAST_VOLUME_CALC = DOCUMENT.CONTRAST_VOLUME
+ DOCUMENT.STEROID_VOLUME_CALC = DOCUMENT.STEROID_VOLUME
+ DOCUMENT.SPINAL_AN_VOLUME_CALC = DOCUMENT.SPINAL_AN_VOLUME
ELSE IF DOCUMENT.Z1ST_LEVEL <> "" AND DOCUMENT.Z2ND_LEVEL == "" AND DOCUMENT.Z3RD_LEVEL == "" AND DOCUMENT.Z4TH_LEVEL == "" AND
DOCUMENT.Z1ST_LEVEL_LATERALITY == "bilateral"
THEN DOCUMENT.CONTRAST_VOLUME_CALC = STR(VAL(DOCUMENT.CONTRAST_VOLUME)/2)
+ DOCUMENT.STEROID_VOLUME_CALC = STR(VAL(DOCUMENT.STEROID_VOLUME)/2)
+ DOCUMENT.SPINAL_AN_VOLUME_CALC = STR(VAL(DOCUMENT.SPINAL_AN_VOLUME)/2)
ELSE ""
ENDIF ENDIF
}
I cannot get this code to work, it keeps coming up with 0 for the DOCUMENT.CONTRAST_VOLUME_CALC and everything else is blank. thoughts?
Good Morning,
Just a quick look over, my guess is the error is caused by having a statement where: x=y + x =y
If you want to set 2 documents to a value just add it to the next line.
document.doc1 = value
document.doc2 = value2
It's always variable to be set followed by an = then any calculations you want.
document.doc3 = (1+2+3)/4
Try the code below. Let me know if this works, if not I can take a deeper look.
-James
{
IF DOCUMENT.Z1ST_LEVEL "" AND DOCUMENT.Z2ND_LEVEL == "" AND DOCUMENT.Z3RD_LEVEL == "" AND DOCUMENT.Z4TH_LEVEL == "" AND
DOCUMENT.Z1ST_LEVEL_LATERALITY "bilateral"
THEN
DOCUMENT.CONTRAST_VOLUME_CALC = DOCUMENT.CONTRAST_VOLUME
DOCUMENT.STEROID_VOLUME_CALC = DOCUMENT.STEROID_VOLUME
DOCUMENT.SPINAL_AN_VOLUME_CALC = DOCUMENT.SPINAL_AN_VOLUME
ELSE
IF DOCUMENT.Z1ST_LEVEL "" AND DOCUMENT.Z2ND_LEVEL == "" AND DOCUMENT.Z3RD_LEVEL == "" AND DOCUMENT.Z4TH_LEVEL == "" AND
DOCUMENT.Z1ST_LEVEL_LATERALITY == "bilateral"
THEN
DOCUMENT.CONTRAST_VOLUME_CALC = STR(VAL(DOCUMENT.CONTRAST_VOLUME)/2)
DOCUMENT.STEROID_VOLUME_CALC = STR(VAL(DOCUMENT.STEROID_VOLUME)/2)
DOCUMENT.SPINAL_AN_VOLUME_CALC = STR(VAL(DOCUMENT.SPINAL_AN_VOLUME)/2)
ELSE ""
ENDIF
ENDIF
}
figured it would be something simple, thank you for the explanation as to why as well, however the the ELSE IF... part of the statement isn't taking, it keeps inputting the first half of the statement. Thoughts on that?
wait, nevermind, that was my fault. thank you again