Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: VPSPRINT

VPSPRINT.m

Go to the documentation of this file.
  1. VPSPRINT ;SLOIFO/BT - Common APIs used for VPS Printing;07/18/14 15:08
  1. ;;1.0;VA POINT OF SERVICE (KIOSKS);**4**;Jul 18,2014;Build 27
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. ; External Reference DBIA#
  1. ; ------------------------
  1. ; #2171 - $$LKUP^XUAF4 - Supported
  1. ; #3771 - DEVICE^XUDHGUI - Supported
  1. ; #2701 - MPIF001 call - Supported
  1. ; #5888 - RPCVIC^DPTLK - Controlled Sub
  1. ; #10114 - DEVICE file ^%ZIS(1) (Supported)
  1. QUIT
  1. ;
  1. GETDFN(VPSTYP,VPSNUM) ;Return DFN given Patient ID Type and Value
  1. ;INPUT
  1. ; VPSTYP Patients ID Type - SSN or DFN OR ICN OR VIC/CAC (REQUIRED)
  1. ; VPSNUM Parameter Value - patient SSN OR DFN OR ICN OR VIC/CAC (REQUIRED)
  1. ;RETURN
  1. ; DFN (successful) OR
  1. ; "-1^ERROR" (error/not found)
  1. ;
  1. N CM S CM=","
  1. ;
  1. QUIT:$G(VPSTYP)="" "-1^TYPE IS REQUIRED (VALID TYPE: SSN, DFN, ICN OR VIC/CAC)"
  1. QUIT:'$F(",SSN,DFN,ICN,VIC/CAC,",CM_VPSTYP_CM) "-1^INVALID TYPE (VALID TYPE: SSN, DFN, ICN OR VIC/CAC)"
  1. QUIT:$G(VPSNUM)="" "-1^SSN, DFN, ICN OR VIC/CAC IS REQUIRED"
  1. ;
  1. N DFN
  1. ;
  1. I VPSTYP="SSN" D
  1. . S DFN=$O(^DPT("SSN",VPSNUM,0))
  1. . I +DFN'>0 S DFN="-1"_U_"NO PATIENT FOUND WITH SSN: "_VPSNUM
  1. I VPSTYP="DFN" D
  1. . S DFN=VPSNUM
  1. . I '$D(^DPT(DFN)) S DFN="-1"_U_"NO PATIENT FOUND WITH DFN: "_VPSNUM
  1. I VPSTYP="VIC/CAC" D
  1. . D RPCVIC^DPTLK(.DFN,VPSNUM) ; get DFN given VIC/CAC number - IA 5888
  1. . S:DFN=-1 DFN="-1^NO DFN FOR VIC/CAC NUMBER"
  1. I VPSTYP="ICN" D
  1. . S DFN=$$GETDFN^MPIF001(VPSNUM) ; get DFN given ICN in the Patient file - IA 2701
  1. ;
  1. QUIT DFN
  1. ;
  1. DEVICE(VPSDEV,FROM,DIR) ; RPC: VPS GET PRINTERS
  1. ; -- Return up to 20 entries from the Device file based on Input criteria
  1. ; INPUT
  1. ; FROM : List all printers start from (text to $O from)
  1. ; B (all device with name start *WITH* B)
  1. ; B* (all device with name start *FROM* B)
  1. ; DIR : Ascending order (1) or Descending order (-1) ($O direction)
  1. ; OUTPUT
  1. ; VPSDEV : By reference local array contains VistA printers based on input criteria
  1. ; SYNTAX
  1. ; Found : VPSDEV(0) = 1
  1. ; VPSDEV(1..n)=IEN^Name^DisplayName^Location^RMar^PLen
  1. ;
  1. ; Not Found : VPSDEV(0) = -1^No printers on file
  1. ;
  1. K VPSDEV
  1. S FROM=$G(FROM)
  1. S DIR=$G(DIR,1)
  1. D DEVICE^XUDHGUI(.VPSDEV,FROM,DIR)
  1. I $D(VPSDEV) S VPSDEV(0)=1 ; At least there is one device in the list
  1. I '$D(VPSDEV) S VPSDEV(0)="-1^No printers on file"
  1. QUIT
  1. ;
  1. DEVEXIST(DEVNAME) ;check if DEVNAME exists on file
  1. ; Returns 1 if found, otherwise returns -1^err message
  1. QUIT:$G(DEVNAME)="" "-1^NO DEVICE SENT"
  1. N DIC S DIC="^%ZIS(1,"
  1. N X S X=DEVNAME
  1. N Y D ^DIC
  1. QUIT:$P(Y,U,2)'=DEVNAME "-1"_U_"DEVICE "_DEVNAME_" NOT FOUND"
  1. QUIT 1