VAFCUTL ;BIR/LTL-utility for the ADT/HL7 PIVOT file 391.71, etc. ;22 Jul 97
 ;;5.3;Registration;**149**;Aug 13, 1993
FILERM(PIV,MSG) ;programmer entry point.
 ;INPUT   PIV - This is the IEN of the ADT/HL7 PIVOT file
 ;        MSG - This is either the message ID for a successfully
 ;sent message or an error message
 ;
 G:'$G(PIV) FILERMQ
 S MSG=$TRANSLATE(MSG,"^","")
 N DIE,DA,DR
 S DIE="^VAT(391.71,",DA=PIV,DR="1.1////"_$G(MSG)
 D ^DIE
 ;
FILERMQ Q
 ;
COMP(LOCAL,REMOTE) ;string translator
 ;INPUT  LOCAL - Local data element
 ;       REMOTE - Remote data element
 ;
 ;OUTPUT 1 - Match, 0 - No match
 ;
 ;strip some punctuation and spaces
 N STRIP S STRIP=".()- "
 S LOCAL=$TR(LOCAL,STRIP),REMOTE=$TR(REMOTE,STRIP)
 ;reduce all to lowercase
 S LOCAL=$$LOW^XLFSTR(LOCAL),REMOTE=$$LOW^XLFSTR(REMOTE)
 Q $S(LOCAL=REMOTE:1,1:0)
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVAFCUTL   855     printed  Sep 23, 2025@20:38:28                                                                                                                                                                                                      Page 2
VAFCUTL   ;BIR/LTL-utility for the ADT/HL7 PIVOT file 391.71, etc. ;22 Jul 97
 +1       ;;5.3;Registration;**149**;Aug 13, 1993
FILERM(PIV,MSG) ;programmer entry point.
 +1       ;INPUT   PIV - This is the IEN of the ADT/HL7 PIVOT file
 +2       ;        MSG - This is either the message ID for a successfully
 +3       ;sent message or an error message
 +4       ;
 +5        if '$GET(PIV)
               GOTO FILERMQ
 +6        SET MSG=$TRANSLATE(MSG,"^","")
 +7        NEW DIE,DA,DR
 +8        SET DIE="^VAT(391.71,"
           SET DA=PIV
           SET DR="1.1////"_$GET(MSG)
 +9        DO ^DIE
 +10      ;
FILERMQ    QUIT 
 +1       ;
COMP(LOCAL,REMOTE) ;string translator
 +1       ;INPUT  LOCAL - Local data element
 +2       ;       REMOTE - Remote data element
 +3       ;
 +4       ;OUTPUT 1 - Match, 0 - No match
 +5       ;
 +6       ;strip some punctuation and spaces
 +7        NEW STRIP
           SET STRIP=".()- "
 +8        SET LOCAL=$TRANSLATE(LOCAL,STRIP)
           SET REMOTE=$TRANSLATE(REMOTE,STRIP)
 +9       ;reduce all to lowercase
 +10       SET LOCAL=$$LOW^XLFSTR(LOCAL)
           SET REMOTE=$$LOW^XLFSTR(REMOTE)
 +11       QUIT $SELECT(LOCAL=REMOTE:1,1:0)