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

BGP2GLST.m

Go to the documentation of this file.
  1. BGP2GLST ; IHS/CMI/LAB - GUI CMS REPORT ;
  1. ;;12.1;IHS CLINICAL REPORTING;;MAY 17, 2012;Build 66
  1. ;
  1. ;
  1. EP(BGPRET,BGPUSER,BGPDUZ2,BGPOPTN,BGPDIR,BGPRTIME) ;EP - called from GUI to produce LIST OF FILES
  1. ; SEE ROUTINE BGP2DL if you have questions about any of these variables
  1. ; BGPUSER - DUZ
  1. ; BGPDUZ2 - DUZ(2)
  1. ; BGPOPTN - OPTION NAME
  1. ; BGPDIR - directory to list
  1. ;
  1. ;
  1. ; BGPRET - return value is ien^error message. a zero (0) is
  1. ; passed as ien if error occurred, display the filename back to the user
  1. ; if they chose to export to area
  1. ;
  1. ; I put the list of files in the BGPGUIW global in field 1100 as an output
  1. ;create entry in gui output file
  1. ;queue report to run with/GUIR
  1. D EP1
  1. S Y=BGPRET
  1. ;D EN^XBVK("BGP") S:$D(ZTQUEUED) ZTREQ="@"
  1. S BGPRET=Y
  1. Q
  1. EP1 ;
  1. S U="^"
  1. I $G(BGPUSER)="" S BGPRET=0_"^USER NOT PASSED" Q
  1. I $G(BGPDUZ2)="" S BGPRET=0_"^DUZ(2) NOT PASSED" Q
  1. I $G(BGPOPTN)="" S BGPRET=0_"^OPTION NAME NOT PASSED" Q
  1. I $G(BGPDIR)="" S BGPRET=0_"^DIRECTORY NAME NOT PASSED" Q
  1. S BGPRTIME=$G(BGPRTIME)
  1. ;S DUZ=BGPUSER
  1. S DUZ(2)=BGPDUZ2
  1. S:'$D(DT) DT=$$DT^XLFDT
  1. D ^XBKVAR
  1. S BGPGUI=1
  1. S IOM=80,BGPIOSL=55
  1. ;create entry in GUI file
  1. D ^XBFMK
  1. S X=BGPUSER_$$NOW^XLFDT
  1. S DIC="^BGPGUIW(",DIC(0)="L",DIADD=1,DLAYGO=90546.19,DIC("DR")=".02////"_BGPUSER_";.03////"_$S(BGPRTIME]"":BGPRTIME,1:$$NOW^XLFDT)_";.05///"_BGPOPTN_";.06///R"
  1. K DD,D0,DO D FILE^DICN K DLAYGO,DIADD,DD,D0,DO
  1. I Y=-1 S BGPRET=0_"^UNABLE TO CREATE ENTRY IN GUI OUTPUT FILE" Q
  1. S BGPGIEN=+Y
  1. ;SEND THE REPORT PROCESS OFF TO THE BACKGROUND USING TASKMAN CALL
  1. D TSKMN
  1. S BGPRET=BGPGIEN
  1. Q
  1. ;
  1. TSKMN ;
  1. S ZTIO=""
  1. K ZTSAVE S ZTSAVE("*")=""
  1. S ZTCPU=$G(IOCPU),ZTRTN="AOLST^BGP2GLST",ZTDTH=$S(BGPRTIME]"":BGPRTIME,1:$$NOW^XLFDT),ZTDESC="GUI 06 UPLOAD FILE LIST" D ^%ZTLOAD Q
  1. Q
  1. AOLST ;
  1. K BGPLIST S BGPLIST="",X=$$LIST^%ZISH(BGPDIR,"BG121*",.BGPLIST)
  1. I $O(BGPLIST(""))="" S ^BGPGUIW(BGPGIEN,11,C,0)="There are no files in that directory." D ENDLOG,XIT Q
  1. S X=0,C=0 F S X=$O(BGPLIST(X)) Q:X'=+X S C=C+1,^BGPGUIW(BGPGIEN,11,C,0)=BGPLIST(X)
  1. S ^BGPGUIW(BGPGIEN,11,0)="^90546.1911^"_C_"^"_C_"^"_DT
  1. K ^TMP($J,"BGPGUI")
  1. D ENDLOG
  1. D XIT
  1. Q
  1. ;
  1. XIT ;
  1. K ^TMP($J)
  1. D EN^XBVK("BGP") S:$D(ZTQUEUED) ZTREQ="@"
  1. K DIRUT,DUOUT,DIR,DOD
  1. K DIADD,DLAYGO
  1. D KILL^AUPNPAT
  1. K X,X1,X2,X3,X4,X5,X6
  1. K A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,V,W,X,Y,Z
  1. K N,N1,N2,N3,N4,N5,N6
  1. K BD,ED
  1. D KILL^AUPNPAT
  1. D ^XBFMK
  1. L -^BGPDATA
  1. Q
  1. ENDLOG ;-- UPDATE LOG AT END
  1. S DIE="^BGPGUIW(",DA=BGPGIEN,DR=".04////"_$$NOW^XLFDT_";.06///C"
  1. D ^DIE
  1. K DIE,DR,DA
  1. Q