- This topic has 4 replies, 3 voices, and was last updated 15 years, 10 months ago by .
-
Topic
-
Ultimately, I’m trying to use a split to break up a message to find each OBX segment. However, for this example I’m just trying to get some out put for each {} in the List. I’m having a problem with running the foreach on my seglist. Here’s an example of the top part of the code.
Code:
proc filter_FCHCMuse { args } {
keylget args MODE mode ;# Extract the operation mode from the run params
set dispList {} ;# Initialize the proc result listswitch -exact — $mode {
start {
}run {
# Extract the HL7 message “handle”
keylget args MSGID mh
# Derive the message type
set HL7Msg [msgget $mh]
set FldSep [cindex $HL7Msg 3]
set SubSep [cindex $HL7Msg 4]
set SegList [split $HL7Msg r]
foreach sl [$SegList]{
echo hello
}Here’s the message I’m trying to process
Code:
MSH|^~&|ADM||||200811191057||ADT^A04|133785|D|2.2|||AL|NE
EVN|A04|200811191057
PID|1|HSMTVD0000054|H000036|H41|MOUSE^MICKEY^^^^||19470101|M|^^^^^|CA|11011 MAIN ST^^ORLANDO^FL^12358||(555)555-1111|(717)263-9281||M||H00000023358|888-88-8888||
NK1|1|MOUSE^MINNIE^^^^|WI^01 WIFE|11011 MAIN ST^^ORLANDO^FL^12358|(555)555-1111||NOK
NK1|2|DUCK^DONALD^^^^|FR^21 FRIEND|11011 MAIN ST^^ORLANDO^FL^12358|(555)555-1111||NOT
NK1|3|CHBGAREA||435 STANLEY AVE^^CHAMBERSBURG^PA^17201||(717)263-9281|EMP|||FT|||CHAMBERSBURG AREA SCHOOL DIST|||||||||||||||||||||FT
PV1|1|O|KFCHC^^|EL|||HESSR^Hess^Reuben^D^^^M.D.|||||||PHY||||CLI||WC|||||||||||||||||||KPS||REG|||200811191053||||||||HESSR^Hess^Reuben^D^^^M.D.|
PV2|||WORK INJURY
OBX|1|CE|ZADCALLAH2^Is patient a Call-Ahead?^ADM||N^Not a Call Ahead||||||F
OBX|2|CE|ZADCOUNTY2^Enter county of patient:^ADM||FRANKLIN^Franklin County||||||F
OBX|3|TX|ZADECF^Is Patient a transfer from an Extended Care Facility?^ADM||||||||F
OBX|4|TX|ZADHISPAN2^Is Patient of Hispanic or Latino Origin?^ADM||N||||||F
OBX|5|TX|ZADINSCOMM^Verified Information^ADM||ADJUSTER IS HOMER SIMPSON 717-123-4562 CLAIM~#123456 DOI 10/05/08||||||F
OBX|6|TX|ZADINTRP^Interpreter Needed?^ADM||N||||||F
OBX|7|TX|ZKPSEKG^WILL PATIENT HAVE AN EKG?^ADM||Y||||||F
OBX|8|TX|ZADMCRNOT9^Comment^ADM||||||||F
OBX|9|TX|ZADMRSA^Have you ever had the infectious bacteria MRSA?^ADM||N||||||F
OBX|10|TX|ZADPRIV1^Date Privacy Notice Was Given:^ADM||20080320||||||F
OBX|11|TX|ZADPRIV2^Was Privacy Acknowledgement Form Refused?^ADM||N||||||F
OBX|12|TX|ZADPRIV3^Reason Patient or Representative Refused to Sign:^ADM||||||||F
OBX|13|TX|ZADTREATM2^Is patient part of a treatment plan?^ADM||||||||F
OBX|14|TX|ZADVRE^Have you ever had the infectious bacteria, VRE?^ADM||N||||||F
OBX|15|TX|ZADEFFDAT2^ ^INS^^^MAACCPLUS||20081119||||||F
OBX|16|TX|ZADHCB2^ ^INS^^^MAACCPLUS||02||||||F
OBX|17|TX|ZADMAELIG2^Verified eligibility on EVS (Y/N):^INS^^^MAACCPLUS||Y||||||F
OBX|18|TX|ZADMAELIG3^Date Verified:^INS^^^MAACCPLUS||20081119||||||F
OBX|19|TX|ZADMAPSC^ ^INS^^^MAACCPLUS||00||||||F
OBX|20|TX|ZADMMACA^Enter:^INS^^^MAACCPLUS||PH||||||F
AL1|1|DA^^^Allergy|F006000568^Peanut^CODED|SV|SWELLING|20080722
AL1|2|DA^^^Allergy|F006000593^Digoxin^CODED|SV|PATIENT UNSURE|20080722
AL1|3|DA^^^Allergy|F006001550^Codeine^CODED|SV|NAUSEA AND VOMITING|20080722
AL1|4|DA^^^Allergy|F006002084^Warfarin^CODED|SV|SHORTNESS OF BREATH|20080722
AL1|5|DA^^^Allergy|F006002307^Furosemide^CODED|SV|HIVES|20080722
AL1|6|DA^^^Allergy|F006002373^Indomethacin^CODED^From Indocin^^allergy.id|SV|PATIENT DENIES|20080722
AL1|7|DA^^^Allergy|F006003476^Omeprazole^CODED|SV|RASH & SWELLING & HIVES|20080722
AL1|8|DA^^^Allergy|F006003675^Amoxicillin^CODED|SV|HIVES|20080722
AL1|9|DA^^^Allergy|F006006006^Pantoprazole^CODED|SV|RASH|20080722
AL1|10|DA^^^Allergy|F006008393^Chocolate Flavor^CODED|SV|PATIENT UNRESPONSIVE|20080722
AL1|11|^^^Allergy|ACET^ACET^UNCODED|SV|NAUSEA AND VOMITING|20080722
GT1|1||MOUSE^MICKEY||11011 MAIN ST^^ORLANDO^FL^12358|(555)555-1111|||||SP|888-88-8888||||CHBGAREA|435 STANLEY AVE^^CHAMBERSBURG^PA^17201|(717)263-9281||FT|
IN1|1|WCPMA||PMA MEDICAL BILL PAYMENT|PO BOX 2854^^CLINTON^IA^52733-2854||(888)476-2669||||CHAMBERSBURG SCHOOL DSTRICT|||||DISTRICT^CHAMBERSBURG^SCHOOL^^^|EM||||||||||||20081119|WMUMMA||||||123456||||||FT^1 FULL-TIME EMPLOYED|||QUEUED
IN1|2|MAACCPLUS||MED ASSIST ACCESS PLUS|PO BOX 8013^^HARRISBURG^PA^17105||||||RE|||||MOUSE^MICKEY^^^^|SP||||||||||||20081119|WMUMMA||||||7894561230||||||RE^5 RETIRED|||QUEUED
UB2|||||||04^20081005
Here’s the error I’m getting
Code:
result = ‘invalid command name “{MSH|^~&|ADM||||200811191057||ADT^A04|133785|D|2.2|||AL|NE} EVN|A04|200811191057 {PID|1|HSMTVD0000054|H000036|H41|MOUSE^MICKEY^^^^||19470101|M|^^^^^|CA|11011 MAIN ST^^ORLANDO^FL^12358||(555)555-1111|(717)263-9281||M||H00000023358|888-88-8888||} {NK1|1|MOUSE^MINNIE^^^^|WI^01 WIFE|11011 MAIN ST^^ORLANDO^FL^12358|(555)555-1111||NOK} {NK1|2|DUCK^DONALD^^^^|FR^21 FRIEND|11011 MAIN ST^^ORLANDO^FL^12358|(555)555-1111||NOT} {NK1|3|CHBGAREA||435 STANLEY AVE^^CHAMBERSBURG^PA^17201||(717)263-9281|EMP|||FT|||CHAMBERSBURG AREA SCHOOL DIST|||||||||||||||||||||FT} PV1|1|O|KFCHC^^|EL|||HESSR^Hess^Reuben^D^^^M.D.|||||||PHY||||CLI||WC|||||||||||||||||||KPS||REG|||200811191053||||||||HESSR^Hess^Reuben^D^^^M.D.| {PV2|||WORK INJURY} {OBX|1|CE|ZADCALLAH2^Is patient a Call-Ahead?^ADM||N^Not a Call Ahead||||||F} {OBX|2|CE|ZADCOUNTY2^Enter county of patient:^ADM||FRANKLIN^Franklin County||||||F} {OBX|3|TX|ZADECF^Is Patient a transfer from an Extended Care Facility?^ADM||||||||F} {OBX|4|TX|ZADHISPAN2^Is Patient of Hispanic or Latino Origin?^ADM||N||||||F} {OBX|5|TX|ZADINSCOMM^Verified Information^ADM||ADJUSTER IS HOMER SIMPSON 717-123-4562 CLAIM~#123456 DOI 10/05/08||||||F} {OBX|6|TX|ZADINTRP^Interpreter Needed?^ADM||N||||||F} {OBX|7|TX|ZKPSEKG^WILL PATIENT HAVE AN EKG?^ADM||Y||||||F} OBX|8|TX|ZADMCRNOT9^Comment^ADM||||||||F {OBX|9|TX|ZADMRSA^Have you ever had the infectious bacteria MRSA?^ADM||N||||||F} {OBX|10|TX|ZADPRIV1^Date Privacy Notice Was Given:^ADM||20080320||||||F} {OBX|11|TX|ZADPRIV2^Was Privacy Acknowledgement Form Refused?^ADM||N||||||F} {OBX|12|TX|ZADPRIV3^Reason Patient or Representative Refused to Sign:^ADM||||||||F} {OBX|13|TX|ZADTREATM2^Is patient part of a treatment plan?^ADM||||||||F} {OBX|14|TX|ZADVRE^Have you ever had the infectious bacteria, VRE?^ADM||N||||||F} {OBX|15|TX|ZADEFFDAT2^ ^INS^^^MAACCPLUS||20081119||||||F} {OBX|16|TX|ZADHCB2^ ^INS^^^MAACCPLUS||02||||||F} {OBX|17|TX|ZADMAELIG2^Verified eligibility on EVS (Y/N):^INS^^^MAACCPLUS||Y||||||F} {OBX|18|TX|ZADMAELIG3^Date Verified:^INS^^^MAACCPLUS||20081119||||||F} {OBX|19|TX|ZADMAPSC^ ^INS^^^MAACCPLUS||00||||||F} OBX|20|TX|ZADMMACA^Enter:^INS^^^MAACCPLUS||PH||||||F AL1|1|DA^^^Allergy|F006000568^Peanut^CODED|SV|SWELLING|20080722 {AL1|2|DA^^^Allergy|F006000593^Digoxin^CODED|SV|PATIENT UNSURE|20080722} {AL1|3|DA^^^Allergy|F006001550^Codeine^CODED|SV|NAUSEA AND VOMITING|20080722} {AL1|4|DA^^^Allergy|F006002084^Warfarin^CODED|SV|SHORTNESS OF BREATH|20080722} AL1|5|DA^^^Allergy|F006002307^Furosemide^CODED|SV|HIVES|20080722 {AL1|6|DA^^^Allergy|F006002373^Indomethacin^CODED^From Indocin^^allergy.id|SV|PATIENT DENIES|20080722} {AL1|7|DA^^^Allergy|F006003476^Omeprazole^CODED|SV|RASH & SWELLING & HIVES|20080722} AL1|8|DA^^^Allergy|F006003675^Amoxicillin^CODED|SV|HIVES|20080722 AL1|9|DA^^^Allergy|F006006006^Pantoprazole^CODED|SV|RASH|20080722 {AL1|10|DA^^^Allergy|F006008393^Chocolate Flavor^CODED|SV|PATIENT UNRESPONSIVE|20080722} {AL1|11|^^^Allergy|ACET^ACET^UNCODED|SV|NAUSEA AND VOMITING|20080722} {GT1|1||MOUSE^MICKEY||11011 MAIN ST^^ORLANDO^FL^12358|(555)555-1111|||||SP|888-88-8888||||CHBGAREA|435 STANLEY AVE^^CHAMBERSBURG^PA^17201|(717)263-9281||FT|} {IN1|1|WCPMA||PMA MEDICAL BILL PAYMENT|PO BOX 2854^^CLINTON^IA^52733-2854||(888)476-2669||||CHAMBERSBURG SCHOOL DSTRICT|||||DISTRICT^CHAMBERSBURG^SCHOOL^^^|EM||||||||||||20081119|WMUMMA||||||123456||||||FT^1 FULL-TIME EMPLOYED|||QUEUED} {IN1|2|MAACCPLUS||MED ASSIST ACCESS PLUS|PO BOX 8013^^HARRISBURG^PA^17105||||||RE|||||MOUSE^MICKEY^^^^|SP||||||||||||20081119|WMUMMA||||||7894561230||||||RE^5 RETIRED|||QUEUED} UB2|||||||04^20081005″‘
errorInfo: ‘
invalid command name “{MSH|^~&|ADM||||200811191057||ADT^A04|133785|D|2.2|||AL|NE} EVN|A04|200811191057 {PID|1|HSMTVD0000054|H000036|H41|MOUSE^MICKEY^^^^||19470101|M|^^^^^|CA|11011 MAIN ST^^ORLANDO^FL^12358||(555)555-1111|(717)263-9281||M||H00000023358|888-88-8888||} {NK1|1|MOUSE^MINNIE^^^^|WI^01 WIFE|11011 MAIN ST^^ORLANDO^FL^12358|(555)555-1111||NOK} {NK1|2|DUCK^DONALD^^^^|FR^21 FRIEND|11011 MAIN ST^^ORLANDO^FL^12358|(555)555-1111||NOT} {NK1|3|CHBGAREA||435 STANLEY AVE^^CHAMBERSBURG^PA^17201||(717)263-9281|EMP|||FT|||CHAMBERSBURG AREA SCHOOL DIST|||||||||||||||||||||FT} PV1|1|O|KFCHC^^|EL|||HESSR^Hess^Reuben^D^^^M.D.|||||||PHY||||CLI||WC|||||||||||||||||||KPS||REG|||200811191053||||||||HESSR^Hess^Reuben^D^^^M.D.| {PV2|||WORK INJURY} {OBX|1|CE|ZADCALLAH2^Is patient a Call-Ahead?^ADM||N^Not a Call Ahead||||||F} {OBX|2|CE|ZADCOUNTY2^Enter county of patient:^ADM||FRANKLIN^Franklin County||||||F} {OBX|3|TX|ZADECF^Is Patient a transfer from an Extended Care Facility?^ADM||||||||F} {OBX|4|TX|ZADHISPAN2^Is Patient of Hispanic or Latino Origin?^ADM||N||||||F} {OBX|5|TX|ZADINSCOMM^Verified Information^ADM||ADJUSTER IS HOMER SIMPSON 717-123-4562 CLAIM~#123456 DOI 10/05/08||||||F} {OBX|6|TX|ZADINTRP^Interpreter Needed?^ADM||N||||||F} {OBX|7|TX|ZKPSEKG^WILL PATIENT HAVE AN EKG?^ADM||Y||||||F} OBX|8|TX|ZADMCRNOT9^Comment^ADM||||||||F {OBX|9|TX|ZADMRSA^Have you ever had the infectious bacteria MRSA?^ADM||N||||||F} {OBX|10|TX|ZADPRIV1^Date Privacy Notice Was Given:^ADM||20080320||||||F} {OBX|11|TX|ZADPRIV2^Was Privacy Acknowledgement Form Refused?^ADM||N||||||F} {OBX|12|TX|ZADPRIV3^Reason Patient or Representative Refused to Sign:^ADM||||||||F} {OBX|13|TX|ZADTREATM2^Is patient part of a treatment plan?^ADM||||||||F} {OBX|14|TX|ZADVRE^Have you ever had the infectious bacteria, VRE?^ADM||N||||||F} {OBX|15|TX|ZADEFFDAT2^ ^INS^^^MAACCPLUS||20081119||||||F} {OBX|16|TX|ZADHCB2^ ^INS^^^MAACCPLUS||02||||||F} {OBX|17|TX|ZADMAELIG2^Verified eligibility on EVS (Y/N):^INS^^^MAACCPLUS||Y||||||F} {OBX|18|TX|ZADMAELIG3^Date Verified:^INS^^^MAACCPLUS||20081119||||||F} {OBX|19|TX|ZADMAPSC^ ^INS^^^MAACCPLUS||00||||||F} OBX|20|TX|ZADMMACA^Enter:^INS^^^MAACCPLUS||PH||||||F AL1|1|DA^^^Allergy|F006000568^Peanut^CODED|SV|SWELLING|20080722 {AL1|2|DA^^^Allergy|F006000593^Digoxin^CODED|SV|PATIENT UNSURE|20080722} {AL1|3|DA^^^Allergy|F006001550^Codeine^CODED|SV|NAUSEA AND VOMITING|20080722} {AL1|4|DA^^^Allergy|F006002084^Warfarin^CODED|SV|SHORTNESS OF BREATH|20080722} AL1|5|DA^^^Allergy|F006002307^Furosemide^CODED|SV|HIVES|20080722 {AL1|6|DA^^^Allergy|F006002373^Indomethacin^CODED^From Indocin^^allergy.id|SV|PATIENT DENIES|20080722} {AL1|7|DA^^^Allergy|F006003476^Omeprazole^CODED|SV|RASH & SWELLING & HIVES|20080722} AL1|8|DA^^^Allergy|F006003675^Amoxicillin^CODED|SV|HIVES|20080722 AL1|9|DA^^^Allergy|F006006006^Pantoprazole^CODED|SV|RASH|20080722 {AL1|10|DA^^^Allergy|F006008393^Chocolate Flavor^CODED|SV|PATIENT UNRESPONSIVE|20080722} {AL1|11|^^^Allergy|ACET^ACET^UNCODED|SV|NAUSEA AND VOMITING|20080722} {GT1|1||MOUSE^MICKEY||11011 MAIN ST^^ORLANDO^FL^12358|(555)555-1111|||||SP|888-88-8888||||CHBGAREA|435 STANLEY AVE^^CHAMBERSBURG^PA^17201|(717)263-9281||FT|} {IN1|1|WCPMA||PMA MEDICAL BILL PAYMENT|PO BOX 2854^^CLINTON^IA^52733-2854||(888)476-2669||||CHAMBERSBURG SCHOOL DSTRICT|||||DISTRICT^CHAMBERSBURG^SCHOOL^^^|EM||||||||||||20081119|WMUMMA||||||123456||||||FT^1 FULL-TIME EMPLOYED|||QUEUED} {IN1|2|MAACCPLUS||MED ASSIST ACCESS PLUS|PO BOX 8013^^HARRISBURG^PA^17105||||||RE|||||MOUSE^MICKEY^^^^|SP||||||||||||20081119|WMUMMA||||||7894561230||||||RE^5 RETIRED|||QUEUED} UB2|||||||04^20081005”
while executing
“$SegList”
I think the problem is that the List is getting messed up because if you look at the error you’ll see that some elements are not in “{}”.
Any ideas?
Thank you,
Ian
- The forum ‘Tcl Library’ is closed to new topics and replies.