The generous forum users helped me put this expression together to grab all the OBX 5 values starting with FINAL CYTOLOGIC DIAGNOSIS: and ending with The HPV Hybrid Capture, and what I am trying to do now is have the proc grab these values if The HPV Hybrid Capture is found, but if not grab all the OBX 5 values up to (Electronically Signed). I tried adding an AND statement after {set bool 1} and placing an ELSE after the HPV Hybrid Capture string, but I got an “extra characters after ELSE error. By toggling the {set boot 0} line on or off, I can get the proc to return the desired data, I just can’t figure out how to code it. Any ideas?
if {[string first “FINAL CYTOLOGIC DIAGNOSIS:” $field] >=0} {set bool 1}
if {$field == “The HPV Hybrid Capture II assay is a signal amplification nucleic acid method”} {set bool 0}
#if {$field == “(Electronically Signed)”} {set bool 0}
if $bool {
append obxlist “$field”
}