VSIT0 ;ISL/JVS,dee - Front End Check to Visit Tracking ;03/29/2018
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**76,211**;Aug 12, 1996;Build 454
 ; Patch PX*1*76 changes the 2nd line of all VSIT* routines to reflect
 ; the incorporation of the module into PCE.  For historical reference,
 ; the old (VISIT TRACKING) 2nd line is included below to reference VSIT
 ; patches.
 ;
 ;;2.0;VISIT TRACKING;;Aug 12, 1996
 Q
 ;
 ;
GETPKG(VSITPKG) ;Pass in package name space and returns a pointer
 ;to that package in the Visit Tracking Parameters file.
 N VSITIEN,VSITPIEN
 S VSITPIEN=$$PKG2IEN($G(VSITPKG))
 Q:VSITPIEN<1 -1
 S VSITIEN=""
 S VSITIEN=$O(^DIC(150.9,1,3,"B",VSITPIEN,VSITIEN)) ;Parameter file IEN
 Q $S(VSITIEN<1:-1,1:VSITIEN)
 ;
ACTIVE(VSITPKGP) ;Pass pointer to that package in the Visit Tracking
 ; Parameters file and returns active flag.
 Q $P($G(^DIC(150.9,1,3,+VSITPKGP,3)),U,1)
 ;
PKG2IEN(VSITPKG) ;VSITPKG can be the name, prefix, or pointer.
 I $G(VSITPKG)="" Q -1
 N IEN,MSG
 S IEN=$$FIND1^DIC(9.4,,"AMX",VSITPKG,"","","MSG")
 Q $S(IEN=0:-1,1:IEN)
 ;
PKG(PKG,VALUE) ; -- Install package into multiple and add active flag
 I PKG=""!(VALUE="") Q -1
 N X,Y,DA,DIC,DIE,DR
 S X=PKG
 S DA(1)=1,DIC="^DIC(150.9,1,3,",DIC(0)="MXL",DIC("P")="150.93P"
 S DLAYGO=150.9
 D ^DIC
 I Y=-1 Q -1
 S DIE=DIC
 K DA
 S DA=+Y
 S DR="4///^S X=VALUE"
 D ^DIE
 Q 1_"^"_$P($G(^DIC(150.9,1,3,DA,3)),"^",1)
 ;
PKGON(PKG) ; -- Check value of ACTIVE FLAG
 I PKG="" Q -1
 N X,Y,DA,DIC
 S X=PKG
 S DA(1)=1
 S DIC="^DIC(150.9,1,3,"
 S DIC(0)="MX"
 S DIC("P")="150.93P"
 D ^DIC
 I Y=-1 Q -1
 Q $P($G(^DIC(150.9,1,3,+Y,3)),"^",1)
 ;
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVSIT0   1662     printed  Sep 23, 2025@20:08:25                                                                                                                                                                                                       Page 2
VSIT0     ;ISL/JVS,dee - Front End Check to Visit Tracking ;03/29/2018
 +1       ;;1.0;PCE PATIENT CARE ENCOUNTER;**76,211**;Aug 12, 1996;Build 454
 +2       ; Patch PX*1*76 changes the 2nd line of all VSIT* routines to reflect
 +3       ; the incorporation of the module into PCE.  For historical reference,
 +4       ; the old (VISIT TRACKING) 2nd line is included below to reference VSIT
 +5       ; patches.
 +6       ;
 +7       ;;2.0;VISIT TRACKING;;Aug 12, 1996
 +8        QUIT 
 +9       ;
 +10      ;
GETPKG(VSITPKG) ;Pass in package name space and returns a pointer
 +1       ;to that package in the Visit Tracking Parameters file.
 +2        NEW VSITIEN,VSITPIEN
 +3        SET VSITPIEN=$$PKG2IEN($GET(VSITPKG))
 +4        if VSITPIEN<1
               QUIT -1
 +5        SET VSITIEN=""
 +6       ;Parameter file IEN
           SET VSITIEN=$ORDER(^DIC(150.9,1,3,"B",VSITPIEN,VSITIEN))
 +7        QUIT $SELECT(VSITIEN<1:-1,1:VSITIEN)
 +8       ;
ACTIVE(VSITPKGP) ;Pass pointer to that package in the Visit Tracking
 +1       ; Parameters file and returns active flag.
 +2        QUIT $PIECE($GET(^DIC(150.9,1,3,+VSITPKGP,3)),U,1)
 +3       ;
PKG2IEN(VSITPKG) ;VSITPKG can be the name, prefix, or pointer.
 +1        IF $GET(VSITPKG)=""
               QUIT -1
 +2        NEW IEN,MSG
 +3        SET IEN=$$FIND1^DIC(9.4,,"AMX",VSITPKG,"","","MSG")
 +4        QUIT $SELECT(IEN=0:-1,1:IEN)
 +5       ;
PKG(PKG,VALUE) ; -- Install package into multiple and add active flag
 +1        IF PKG=""!(VALUE="")
               QUIT -1
 +2        NEW X,Y,DA,DIC,DIE,DR
 +3        SET X=PKG
 +4        SET DA(1)=1
           SET DIC="^DIC(150.9,1,3,"
           SET DIC(0)="MXL"
           SET DIC("P")="150.93P"
 +5        SET DLAYGO=150.9
 +6        DO ^DIC
 +7        IF Y=-1
               QUIT -1
 +8        SET DIE=DIC
 +9        KILL DA
 +10       SET DA=+Y
 +11       SET DR="4///^S X=VALUE"
 +12       DO ^DIE
 +13       QUIT 1_"^"_$PIECE($GET(^DIC(150.9,1,3,DA,3)),"^",1)
 +14      ;
PKGON(PKG) ; -- Check value of ACTIVE FLAG
 +1        IF PKG=""
               QUIT -1
 +2        NEW X,Y,DA,DIC
 +3        SET X=PKG
 +4        SET DA(1)=1
 +5        SET DIC="^DIC(150.9,1,3,"
 +6        SET DIC(0)="MX"
 +7        SET DIC("P")="150.93P"
 +8        DO ^DIC
 +9        IF Y=-1
               QUIT -1
 +10       QUIT $PIECE($GET(^DIC(150.9,1,3,+Y,3)),"^",1)
 +11      ;