HL7 Help

  • Creator
    Topic
  • #47907
    garry r fisher
    Participant

    Hi,

    Can anybody help me with an HL7 issue?

    I’ve been asked to add multiple specialties for a consultant into an MFN message. This was fine as I just used a repeating field:

    |SPEC1~SPEC2~…..SPECn|

    Unfortunately the third party want it as companants in a single field:

    |SPEC1^SPEC2^…..SPECn|

    What type of field data type would I use for this? Its similar to an address but can I use that data type for this?

    Regards

    Garry

Viewing 9 reply threads
  • Author
    Replies
    • #57040
      Jim Kosloskey
      Participant

      Garry,

      I am assuming you are referring to field PRA-5 (00689) Specialty – 2.3.1 HL/7.

      This is a CM type field so you can simply place the specialties in each component as you described. There is no need to change the field.

      However, the standard length is 100 bytes so you might want to change that to assure you have sufficient room.

      Jim Kosloskey

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #57041
      garry r fisher
      Participant

      Hi Jim,

      Thanks for this. Unfortunately the third party don’t want me to map it to PRA.5 but to STF.9 for some reason.

      I’ve asked them whether it can be changed to what is the more obvious field.

      Garry

    • #57042
      Dorian DiNardo
      Participant

      Garry,

      You could use the regsub command to change the & to a ^ for that particular field.

      Dorian

    • #57043
      Charlie Bursell
      Participant

      My $0.02

      A change like this is best done with the string map command.

      The problem is that sometimes you don’t know or care what the character is but you want to make sure it is what you want.  All you will deal with is the character at index 3, 4, etc.

      If you use regsub, you never know if the character is a regsub special character.  For example, the ^ character is the character that anchors the expression to the beginning of a string.  To regsub it, you would have to escape it.  With the new regular expression engine, it is an error to escape a non-special character.

      So you are better off to use string map which requires no escaping.  For example, assume you want to change the subfield separator to : throughout the message.

      set msg [string map “[string index $msg 4] :” $msg]

      Charlie

    • #57044
      garry r fisher
      Participant

      Hi,

      Thanks for the various suggestions. I’m still waiting for the vendor to advise whether they can change to the ‘real’ specialty field or not. Once I know then you have kindly provided me with enough guidance for me do what ever they require.

      Thanks

      Garry

    • #57045
      Jim Kosloskey
      Participant

      Garry,

      Even if the vendor does not comply, you can still place as many components in a CE type field as you want (limited by the size) within an Xlate.

      You simply need to use the proper notation (such as: 0(0).PID(0).00118(0).[0] or .[1] or .[2] etc).

      If you are obtaining the source specialty through an iterate, then possibly use the iteration counter inside the square brackets.

      I have tested this (not the iteration part but it is worth trying) and the Xlate creates as many as I want (again considering the length).

      I hope this helps,

      Jim Kosloskey

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #57046
      garry r fisher
      Participant

      Jim,

      That’s great. I haven’t tried it but just looking at your example it should give me the solution I want without the use of addtional Tcl code.

      I’ll give it a try.

      Regards

      Garry

    • #57047
      garry r fisher
      Participant

      Jim,

      Works a treat – thanks.

      Garry

    • #57048
      Jim Kosloskey
      Participant

      Garry,

      That’s good.

      Were you using an ITERATE to collect the specialties?

      If so did you try using the iteration counter in the component portion of the field address path and did that work?

      Thanks,

      Jim Kosloskey

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #57049
      garry r fisher
      Participant

      Jim,

      No – the sending transaction had all the specialty’s in individual fields i.e.

      SPECIALTY_1

      SPECIALTY_2

      …..

      SPECIALTY_10

      So I just had to map across each field.

      Thanks again for your assistance with this.

      Garry

Viewing 9 reply threads
  • The forum ‘General’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,127
Forums
28
Topics
9,299
Replies
34,443
Topic Tags
288
Empty Topic Tags
10