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

BGP4GCMS.m

Go to the documentation of this file.
BGP4GCMS ; IHS/CMI/LAB - GUI CMS REPORT 27 Apr 2010 10:30 PM ;
 ;;14.1;IHS CLINICAL REPORTING;;MAY 29, 2014;Build 114
 ;
 ;
TESTNTL ;
 S ERR=""
 F X=1:1:3 S BGPND(X)=""
 D EP(.ERR,1,2522,"BGP 14 CMS PERF RPT",2522,.BGPND,1,3020000,$$NOW^XLFDT)
 W !,ERR
 Q
EP(BGPRET,BGPUSER,BGPDUZ2,BGPOPTN,BGPHOSP,BGPIND,BGPPLSTL,BGPQTR,BGPPER,BGPRTIME,BGPUDBD,BGPED,BGPBEN,BGPTEXD,BGPFILE) ;EP - called from GUI to produce COM REPORT CI05-RPT-LOC-CMS
 ; SEE ROUTINE BGP4DC if you have questions about any of these variables
 ;  BGPUSER - DUZ
 ;  BGPDUZ2 - DUZ(2)
 ;  BGPOPTN - OPTION NAME
 ;  BGPHOSP - IEN OF HOSPITAL FROM LOCATION FILE
 ;
 ;  BGPIND - array of iens from items selected from ^BGPCMSIB GLOBAL
 ;
 ;  BGPRET - return value is ien^error message. a zero (0) is
 ;  passed as ien if error occurred, display the filename back to the user
 ;  if they chose to export to area
 ;
 ;  BGPQTR - this is 1,2,3,4 for the quarter selectd
 ;  BGPPER - Internal fileman date for the year e.g. 3040000
 ;create entry in gui output file
 ;queue report to run with/GUIR
 D EP1
 S Y=BGPRET
 ;D EN^XBVK("BGP") S:$D(ZTQUEUED) ZTREQ="@"
 S BGPRET=Y
 Q
EP1 ;
 S U="^"
 I $G(BGPUSER)="" S BGPRET=0_"^USER NOT PASSED" Q
 I $G(BGPDUZ2)="" S BGPRET=0_"^DUZ(2) NOT PASSED" Q
 I $G(BGPOPTN)="" S BGPRET=0_"^OPTION NAME NOT PASSED" Q
 I $G(BGPHOSP)="" S BGPRET=0_"^HOSPITAL IEN NOT PASSED" Q
 I $G(BGPPER)="" S BGPRET=0_"^YEAR NOT PASSED" Q
 I $G(BGPQTR)="" S BGPRET=0_"^QUARTER NOT PASSED" Q
 I '$D(BGPIND) S BGPRET=0_"^INDICATOR ARRAY NOT PASSED" Q
 S BGPRTIME=$G(BGPRTIME)
 ;S DUZ=BGPUSER
 S DUZ(2)=BGPDUZ2
 S:'$D(DT) DT=$$DT^XLFDT
 D ^XBKVAR
 S BGPGUI=1
 S IOM=80,BGPIOSL=55
 I BGPQTR=1 S BGPBD=$E(BGPED,1,3)_"0101",BGPED=$E(BGPED,1,3)_"0331"
 I BGPQTR=2 S BGPBD=$E(BGPED,1,3)_"0401",BGPED=$E(BGPED,1,3)_"0630"
 I BGPQTR=3 S BGPBD=$E(BGPED,1,3)_"0701",BGPED=$E(BGPED,1,3)_"0930"
 I BGPQTR=4 S BGPBD=$E(BGPED,1,3)_"1001",BGPED=$E(BGPED,1,3)_"1231"
 ;I BGPQTR=5 S BGPBD=$$FMADD^XLFDT(BGPPER,-364),BGPED=BGPPER,BGPPER=$E(BGPED,1,3)_"0000"
 I BGPQTR=5 S BGPBD=BGPUDBD,BGPPER=$E(BGPED,1,3)_"0000"
 ;create entry in GUI file
 D ^XBFMK
 S X=BGPFILE
 ;S X=BGPUSER_$$NOW^XLFDT
 S BGPGFNM=X
 S DIC="^BGPGUIJ(",DIC(0)="L",DIADD=1,DLAYGO=90552.19,DIC("DR")=".02////"_BGPUSER_";.03////"_$S(BGPRTIME]"":BGPRTIME,1:$$NOW^XLFDT)_";.05///"_BGPOPTN_";.06///R;.07///P"
 K DD,D0,DO D FILE^DICN K DLAYGO,DIADD,DD,D0,DO
 I Y=-1 S BGPRET=0_"^UNABLE TO CREATE ENTRY IN GUI OUTPUT FILE" Q
 S BGPGIEN=+Y
 ;SEND THE REPORT PROCESS OFF TO THE BACKGROUND USING TASKMAN CALL
 D TSKMN
 S BGPRET=BGPGIEN
 Q
 ;
TSKMN ;
 S ZTIO=""
 K ZTSAVE S ZTSAVE("*")=""
 S ZTCPU=$G(IOCPU),ZTRTN="LOCCMS^BGP4GCMS",ZTDTH=$S(BGPRTIME]"":BGPRTIME,1:$$NOW^XLFDT),ZTDESC="GUI 09 CMS LIST" D ^%ZTLOAD Q
 Q
LOCCMS ;
 ;D ^BGP4C1
 K ^TMP($J,"BGPGUI")
 S IOM=80,BGPIOSL=55
 D GUIR^BGPXBLM("^BGP4CP","^TMP($J,""BGPGUI"",")
 ;cmi/anch/maw added 5/12/2009 for word output
 S X=0,C=0 F  S X=$O(^TMP($J,"BGPGUI",X)) Q:X'=+X  D
 . S C=C+1
 . N BGPDATA
 . S BGPDATA=$G(^TMP($J,"BGPGUI",X))
 . I BGPDATA="ZZZZZZZ" S BGPDATA=$C(12)
 . S ^BGPGUIJ(BGPGIEN,11,C,0)=BGPDATA
 S ^BGPGUIJ(BGPGIEN,11,0)="^90552.1911^"_C_"^"_C_"^"_DT
 K ^TMP($J,"BGPGUI")
 ;cmi/anch/maw end of mods
 D ENDLOG
 D XIT
 Q
 ;
XIT ;
 K ^TMP($J)
 D EN^XBVK("BGP") S:$D(ZTQUEUED) ZTREQ="@"
 K DIRUT,DUOUT,DIR,DOD
 K DIADD,DLAYGO
 D KILL^AUPNPAT
 K X,X1,X2,X3,X4,X5,X6
 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
 K N,N1,N2,N3,N4,N5,N6
 K BD,ED
 D KILL^AUPNPAT
 D ^XBFMK
 L -^BGPDATA
 Q
ENDLOG ;-- UPDATE LOG AT END
 S DIE="^BGPGUIJ(",DA=BGPGIEN,DR=".04////"_$$NOW^XLFDT_";.06///C"
 D ^DIE
 K DIE,DR,DA
 Q