- This topic has 1 reply, 2 voices, and was last updated 16 years, 3 months ago by .
-
Topic
-
I have been working on the TCL procedure that could be drastically reduced in code if I could do variable substitution in the expression. Is that possible? Also, I’m having trouble with, or don’t understand how the regexp -all option works. My expression: regexp -nocase -all -line — {OBR|(.*?|){3}(.*?)^(.*?)^} $msg match v1 msgCategory msgProcedure When I use the above regexp I get the second OBR, if I remove the “-all” option I get the first OBR when I run it again the message:
Quote:MSH|^~&||.|||200805221602||ORM^O01|ADTOE 2 4.2.1420|D|2.4|||AL|NE
PID|1||350000^^^^MR~514-12-5544^^^^SS~35^^^^PI||HULBERT^TEST562^^^^^L||19700203|F||C|801 GRAVES LANE^^FINDLAY^OH^45840^^^^HAN||419-422-7471^^^^PRN|419-422-3437^^^^WPN||S|LUT|000000414
PV1|1|I|5NU^P5100^01|U|||CONJL^CONNER^JENNIFER^LEA^^^MD|||5NU||||RP|||CONJL^CONNER^JENNIFER^LEA^^^MD|IN||L|||||||||||||||||||.||ADM|||200804021422
ORC|NW|||||N|||200805221602|DP.AFD||||||||FYMISWS32.2
OBR|1|EKG20080522-0001.||EKG1^EKG2^ELECTROCARDIOGRAM||200805221601||||||OEISO1^ISOLATION:||||CONJL^CONNER^JENNIFER^LEA^^^MD|||||||||||^^^^^R
OBR|2|EKG20080522-0002.||EKG3^EKG4^ELECTROCARDIOGRAM||200805221603||||||OEISO1^ISOLATION:||||JOHDD^JOHNSON^DONALD^DEAN^^^DO|||||||||||^^^^^R
OBX|1|TX|OEEKADM^SDS OR ADM?||ADM
OBX|2|TX|OEEKD^IS PATIENT ON DIGOXIN OR QUINIDINE?||NO
OBX|3|TX|OEEKFDR^FAMILY PHYSICIAN:||TEST
OBX|4|TX|OEEKPRE^PRE-OP, DATE OF SURGERY?||T
OBX|5|CE|OEPEROR^PHYSICIAN TO READ?||MILLS, SD^MILLS, SD
ZMN|
I thought by using the all option I would get a list of matches in the variable…?
Thanks,
- Jared Parish
- The forum ‘Tcl Library’ is closed to new topics and replies.