INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

CASE syntax

CASE syntax

(OP)
I'm getting "Parm1 : Test must be a function call or variable name".  Isn't this how I refer to a variable from the source structure?

CODE

(case (~input%SDC_ADT.MSH.MSH-9-message_type.MSH-9-2_trigger_event)
   (("A01" "A04" "A05" "A08" "A13")
      (not-verify ~input%SDC_ADT.PV1.PV1-3-assigned_patient_location.PL.point_of_care/nu "MH")
   )
   (("A02")
      (not-verify ~input%SDC_ADT.PV1.PV1-3-assigned_patient_location.PL "OR\|L1\|NS")
   )
)

-Geates

"I hope I can feel and see the change - stop the bleed inside a feel again.  Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 

RE: CASE syntax

(OP)
Even though that seems like a variable to me, I decided to redundantly put it through a string function.  It works fine now.

CODE

(case (subseq ~input%SDC_ADT.MSH.MSH-9-message_type.MSH-9-2_trigger_event 0 3)

-Geates

"I hope I can feel and see the change - stop the bleed inside a feel again.  Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 

RE: CASE syntax

You could also have tried:

(string->symbol ~input%SDC_ADT.MSH.MSH-9-message_type.MSH-9-2_trigger_event)

and that would have done the trick.

rxp.
 

RE: CASE syntax

(OP)
string->symbol Syntax
    (string->symbol string)

Description
     Creates a symbol from the specified string.

Return Value
     symbol
        A symbol created from the specified string.

Examples
     (string->symbol "mISSISSIppi") => mISSISSIppi
     (symbol?(string->symbol "mISSISSIppi")) => #t

The Monk reference on this function isn't very helpful.  What is a "symbol"

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again.  Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 

RE: CASE syntax

Think of the 'Conversion Procedures' (Chapter 11) as a way to more accurately test/validate your logic, depending on what you are testing.

string->symbol
For CASE statements, it assigns the value of the specified string to the 'symbol'. The symbol is then tested. The symbol may contain alphanumeric characters.
-If you don't convert, and your string contains a number, you may get an error.

char->number
In this case you can test for less than, greater than, equal to. For example, in HL7, the date comes in as YYYYMMDD. You can test for a specific date, after a specific date, between a date. etc.
-If you don't convert, and your char is not a number, you may get an error.

There are other conversions listed. You need to be aware of all the possible types of data/characters you will be testing. This will determine which one of the conversion procedures better fits your needs.  

RE: CASE syntax

(OP)
Because ADT Types almost always contain numbers and errors may occur from CASEing alphanumberic expressions, I'll have to investigate my logic further.  Thanks for bring it to my attention.

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again.  Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close