IBCNRHLU ;DAOU/DMK - e-Pharmacy HL7 Utilities ;24-MAY-2004 ;;2.0;INTEGRATED BILLING;**251**;21-MAR-94 ;;Per VHA Directive 10-93-142, this routine should not be modified. ; ; Description ; ; e-Pharmacy HL7 Utilities ; ; Entry points: ; TRAN1 - Convert HL7 special characters (specific) ; TRAN2 - Convert HL7 special characters (general) ; Q ; TRAN1(VALUE) ; Convert HL7 special characters ; ; Specific to the following standard VistA HL7 application definition ; HL7 FIELD SEPARATOR = | ; HL7 ENCODING CHARACTERS = ^~\& ; ; Input parameter: ; VALUE = HL7 message field, component, or subcomponent value ; Invoked if value contains escape character (\) ; ; Output parameter: ; NEWVALUE = Converted HL7 message field, component, or subcomponent value ; N CONVERT,I,LAST,NEWVALUE,S,S3 ; ; Initialize last string position involing converted special character S LAST=0 ; ; Initialize scratch string varaible S S="" ; ; Initialize conversion array ; ; | = field separator ; Transferred as \F\ and converted to | S CONVERT("\F\")="|" ; ; ^ = component separator ; Transferred as \S\ and NOT converted to ^ (FileMan delimiter) ;S CONVERT("\S\")="^" ; ; ~ = repetitive separator ; Transferred as \R\ and converted to ~ S CONVERT("\R\")="~" ; ; \ = escape character ; Transferred as \E\ and converted to \ S CONVERT("\E\")="\" ; ; & = subcomponent separator ; Transferred as \T\ and converted to & S CONVERT("\T\")="&" ; ; Check and covert F I=1:1:$L(VALUE) D . S S=S_$E(VALUE,I) . I (I-3)'