DGVTSFS ;7DELTA/KDC - VTS Stand alone Option routine ;07-MAR-2012
 ;;5.3;REGISTRATION;**853**;07-MAR-2012;Build 104
 Q
EN ;Entry point for stand-alone RideShare sign-up option
 ;This routine provides the option to SET the VTS Patient 
 ;Flag in File #2 (Patient File) which indicates that the
 ;patient is enrolled in RideShare
 ;
 ;
 ; SET (YES) - 1
 ; Not SET (NO) -0 or ""
 ;
 ;An HL7 ADT-A28 (ADD) message is built/sent
 ; Input  -- None
 ; Output -- None
 ;
 ;
 ;
 ;
 N DFN
 ;
 ;Get Patient file (#2) IEN - DFN
EN1 D GETPAT^DGRPTU(,,.DFN,) G ENQ:DFN<0
 L +^DPT(DFN):5 I '$T W !,"Patient record is currently locked, Try again later." G EN1
 ;
E1 ; Retrieve patient's VTS flag information
 N DIC,DR,DA,%,DIE,DGVTRSF
 S DGVTRSF=$$GET1^DIQ(2,DFN_",",3000)
 W !,"The VTS Patient Flag is currently: ",DGVTRSF
 I DGVTRSF="YES" W !,"Patient is already a RideShare participant" L -^DPT(DFN) K DFN G EN1
 W !!,"Are you sure you want to enroll patient in RideShare",!,"and set the VTS Patient Flag"
 D YN^DICN I %Y["?" W !!,"Enter YES or NO.",! G E1
 I %'=1 L -^DPT(DFN) G ENQ
 S DIE=2,DA=DFN,DR="3000///1" D ^DIE
 L -^DPT(DFN)
 ;
 ; Build and send HL7 ADT-A28 ADD Message 
 D A28^DGVTSA28(DFN)
 ;
 W !!,"Patient is now a RideShare participant and VTS Patient Flag is set"
 K DFN
 G EN1
 ;
ENQ ;
 K DIQ1
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGVTSFS   1347     printed  Sep 23, 2025@20:35:08                                                                                                                                                                                                     Page 2
DGVTSFS   ;7DELTA/KDC - VTS Stand alone Option routine ;07-MAR-2012
 +1       ;;5.3;REGISTRATION;**853**;07-MAR-2012;Build 104
 +2        QUIT 
EN        ;Entry point for stand-alone RideShare sign-up option
 +1       ;This routine provides the option to SET the VTS Patient 
 +2       ;Flag in File #2 (Patient File) which indicates that the
 +3       ;patient is enrolled in RideShare
 +4       ;
 +5       ;
 +6       ; SET (YES) - 1
 +7       ; Not SET (NO) -0 or ""
 +8       ;
 +9       ;An HL7 ADT-A28 (ADD) message is built/sent
 +10      ; Input  -- None
 +11      ; Output -- None
 +12      ;
 +13      ;
 +14      ;
 +15      ;
 +16       NEW DFN
 +17      ;
 +18      ;Get Patient file (#2) IEN - DFN
EN1        DO GETPAT^DGRPTU(,,.DFN,)
           if DFN<0
               GOTO ENQ
 +1        LOCK +^DPT(DFN):5
           IF '$TEST
               WRITE !,"Patient record is currently locked, Try again later."
               GOTO EN1
 +2       ;
E1        ; Retrieve patient's VTS flag information
 +1        NEW DIC,DR,DA,%,DIE,DGVTRSF
 +2        SET DGVTRSF=$$GET1^DIQ(2,DFN_",",3000)
 +3        WRITE !,"The VTS Patient Flag is currently: ",DGVTRSF
 +4        IF DGVTRSF="YES"
               WRITE !,"Patient is already a RideShare participant"
               LOCK -^DPT(DFN)
               KILL DFN
               GOTO EN1
 +5        WRITE !!,"Are you sure you want to enroll patient in RideShare",!,"and set the VTS Patient Flag"
 +6        DO YN^DICN
           IF %Y["?"
               WRITE !!,"Enter YES or NO.",!
               GOTO E1
 +7        IF %'=1
               LOCK -^DPT(DFN)
               GOTO ENQ
 +8        SET DIE=2
           SET DA=DFN
           SET DR="3000///1"
           DO ^DIE
 +9        LOCK -^DPT(DFN)
 +10      ;
 +11      ; Build and send HL7 ADT-A28 ADD Message 
 +12       DO A28^DGVTSA28(DFN)
 +13      ;
 +14       WRITE !!,"Patient is now a RideShare participant and VTS Patient Flag is set"
 +15       KILL DFN
 +16       GOTO EN1
 +17      ;
ENQ       ;
 +1        KILL DIQ1
 +2        QUIT