VPSWRIST ;DALOIFO/GT,SLOIFO/BT - PATIENT WRISTBAND LABEL RPC;07/15/14 15:08
;;1.0;VA POINT OF SERVICE (KIOSKS);**4**;MAR 13,2013;Build 27
;;Per VHA Directive 2004-038, this routine should not be modified.
;
; External Reference DBIA#
; ------------------------
; #10061 - VADPT call (Supported)
; #10035 - ^DPT( references (Supported)
; #2119 - OPEN^%ZISUTL, USE^%ZISUTL, CLOSE^%ZISUTL (Supported)
; #5905 - SET^DGPWB, $$DIVISION^DGPWB (Private)
;
QUIT
;
PRINT(VPSRSLT,VPSTYP,VPSNUM,VPSIO) ;RPC: VPS PATIENT WRISTBAND PRINT
;The Print Patient Wristband option is used to generate a patient wristband with barcoded social security number.
;The wristband will contain the patient name, primary long ID (usually the social security number), date of birth,
;religion, and an allergy flag (YES or a blank line for NO).
;
;INPUT
; VPSTYP Patients ID Type - SSN or DFN OR ICN OR VIC/CAC (REQUIRED)
; VPSNUM Parameter Value - patient SSN OR DFN OR ICN OR VIC/CAC (REQUIRED)
; VPSIO Output Device NAME
;OUTPUT
; VPSRSLT 0 (Successful)
; -1^Failure Message
;
; -- Get DFN based on Patient ID Type and Value pair
S VPSRSLT=$$GETDFN^VPSPRINT($G(VPSTYP),$G(VPSNUM))
QUIT:+VPSRSLT=-1
N VPSDFN S VPSDFN=VPSRSLT
;
; -- Check Input parameters
N WARD
S VPSRSLT=$$VALIDATE(VPSDFN,$G(VPSIO),.WARD)
QUIT:+VPSRSLT=-1
;
; -- Setup and open handle for output device.
D OPEN^%ZISUTL("WRISTBAND",VPSIO)
I POP S VPSRSLT=-1_U_"DEVICE IN USE - TRY AGAIN LATER" QUIT
;
; -- Print Wristband
D USE^%ZISUTL("WRISTBAND")
N $ETRAP,$ESTACK S $ETRAP="D ETRAP^VPSWRIST QUIT"
N DFN S DFN=VPSDFN
N VPSSSN S VPSSSN=$P(^DPT(DFN,0),U,9)
D SET^DGPWB ;Requires DFN and WARD and potentially VPSSSN for barcode
;
; -- close output device
D CLOSE^%ZISUTL("WRISTBAND")
;
S VPSRSLT=0
QUIT
;
VALIDATE(VPSDFN,VPSIO,WARD) ; Check input parameters
;INPUT
; VPSDFN : PATIENT DFN (Must be valid)
; VPSIO : Output Device NAME
;OUTPUT
; WARD : WARD (by reference)
;RETURN
; successful : ""
; failed : -1^exception message
;
;-- Check Device
N MSG S MSG=$$DEVEXIST^VPSPRINT($G(VPSIO))
QUIT:+MSG=-1 MSG
QUIT ""
;
ETRAP ; ERROR TRAP during printing wristband label
S VPSRSLT="-1^"_$$EC^%ZOSV
D CLOSE^%ZISUTL("WRISTBAND")
QUIT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVPSWRIST 2412 printed Dec 13, 2024@02:43:44 Page 2
VPSWRIST ;DALOIFO/GT,SLOIFO/BT - PATIENT WRISTBAND LABEL RPC;07/15/14 15:08
+1 ;;1.0;VA POINT OF SERVICE (KIOSKS);**4**;MAR 13,2013;Build 27
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 ; External Reference DBIA#
+5 ; ------------------------
+6 ; #10061 - VADPT call (Supported)
+7 ; #10035 - ^DPT( references (Supported)
+8 ; #2119 - OPEN^%ZISUTL, USE^%ZISUTL, CLOSE^%ZISUTL (Supported)
+9 ; #5905 - SET^DGPWB, $$DIVISION^DGPWB (Private)
+10 ;
+11 QUIT
+12 ;
PRINT(VPSRSLT,VPSTYP,VPSNUM,VPSIO) ;RPC: VPS PATIENT WRISTBAND PRINT
+1 ;The Print Patient Wristband option is used to generate a patient wristband with barcoded social security number.
+2 ;The wristband will contain the patient name, primary long ID (usually the social security number), date of birth,
+3 ;religion, and an allergy flag (YES or a blank line for NO).
+4 ;
+5 ;INPUT
+6 ; VPSTYP Patients ID Type - SSN or DFN OR ICN OR VIC/CAC (REQUIRED)
+7 ; VPSNUM Parameter Value - patient SSN OR DFN OR ICN OR VIC/CAC (REQUIRED)
+8 ; VPSIO Output Device NAME
+9 ;OUTPUT
+10 ; VPSRSLT 0 (Successful)
+11 ; -1^Failure Message
+12 ;
+13 ; -- Get DFN based on Patient ID Type and Value pair
+14 SET VPSRSLT=$$GETDFN^VPSPRINT($GET(VPSTYP),$GET(VPSNUM))
+15 if +VPSRSLT=-1
QUIT
+16 NEW VPSDFN
SET VPSDFN=VPSRSLT
+17 ;
+18 ; -- Check Input parameters
+19 NEW WARD
+20 SET VPSRSLT=$$VALIDATE(VPSDFN,$GET(VPSIO),.WARD)
+21 if +VPSRSLT=-1
QUIT
+22 ;
+23 ; -- Setup and open handle for output device.
+24 DO OPEN^%ZISUTL("WRISTBAND",VPSIO)
+25 IF POP
SET VPSRSLT=-1_U_"DEVICE IN USE - TRY AGAIN LATER"
QUIT
+26 ;
+27 ; -- Print Wristband
+28 DO USE^%ZISUTL("WRISTBAND")
+29 NEW $ETRAP,$ESTACK
SET $ETRAP="D ETRAP^VPSWRIST QUIT"
+30 NEW DFN
SET DFN=VPSDFN
+31 NEW VPSSSN
SET VPSSSN=$PIECE(^DPT(DFN,0),U,9)
+32 ;Requires DFN and WARD and potentially VPSSSN for barcode
DO SET^DGPWB
+33 ;
+34 ; -- close output device
+35 DO CLOSE^%ZISUTL("WRISTBAND")
+36 ;
+37 SET VPSRSLT=0
+38 QUIT
+39 ;
VALIDATE(VPSDFN,VPSIO,WARD) ; Check input parameters
+1 ;INPUT
+2 ; VPSDFN : PATIENT DFN (Must be valid)
+3 ; VPSIO : Output Device NAME
+4 ;OUTPUT
+5 ; WARD : WARD (by reference)
+6 ;RETURN
+7 ; successful : ""
+8 ; failed : -1^exception message
+9 ;
+10 ;-- Check Device
+11 NEW MSG
SET MSG=$$DEVEXIST^VPSPRINT($GET(VPSIO))
+12 if +MSG=-1
QUIT MSG
+13 QUIT ""
+14 ;
ETRAP ; ERROR TRAP during printing wristband label
+1 SET VPSRSLT="-1^"_$$EC^%ZOSV
+2 DO CLOSE^%ZISUTL("WRISTBAND")
+3 QUIT