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

SCRPBK0.m

Go to the documentation of this file.
  1. SCRPBK0 ;MJK/ALB - RPC Broker Utilities ; 27 FEB 96
  1. ;;5.3;Scheduling;**41,1015**;AUG 13, 1993;Build 21
  1. ;
  1. GETREC(SCDATA,SCQRY) ; -- get QUERY record
  1. ; input : SCQRY := ien of query definition
  1. ; output : SCDATA is the return array
  1. ; SCDATA(0) := 0th node of qry def
  1. ; (1) := externals for 0th
  1. ; (2..n) := sections for
  1. ; [Description], [Fields], [Selections]
  1. ;
  1. ; -- SEE BOTTOM OF SCRPBK FOR MORE VARIABLE DEFINITIONS
  1. ;
  1. ; Related RPC: SCRP QUERY GETRECORD
  1. ;
  1. N SC,X,SCINC
  1. S SCINC=-1,SCQRY=+SCQRY
  1. ; -- get 0th node of team
  1. D QRYDEF(.X,SCQRY)
  1. ; -- add 0TH to return array
  1. D SET(X(0),.SCINC,.SCDATA)
  1. ; -- add external values for 0th to ret array
  1. D SET(X(1),.SCINC,.SCDATA)
  1. ; -- get description
  1. D DESC(.SCINC,SCQRY,.SCDATA)
  1. ; -- get fields
  1. D FIELDS(.SCINC,SCQRY,.SCDATA)
  1. ; -- get files
  1. D SELECT(.SCINC,SCQRY,.SCDATA)
  1. Q
  1. ;
  1. SET(X,INC,SCDATA) ; -- set value in return array
  1. S INC=$G(INC)+1,SCDATA(INC)=X
  1. Q
  1. ;
  1. QRYDEF(X,SCQRY) ; -- retrieve rpt def demographics
  1. N Y,Z
  1. S Y=$G(^SD(404.95,SCQRY,0))
  1. S X(0)=Y ; 0th node
  1. S X(1)=SCQRY ; query name
  1. S $P(X(1),U,2)=$P($G(^VA(200,+$P(Y,U,2),0)),U) ; creator
  1. S $P(X(1),U,3)=$S($P(Y,U,3)=1:"PRIVATE",1:"PUBLIC") ; access level
  1. S $P(X(1),U,4)=$P($G(^SD(404.92,+$P(Y,U,4),0)),U) ; report name
  1. S $P(X(1),U,5)=$$FMTE^XLFDT($P(Y,U,5),"2FP")
  1. Q
  1. ;
  1. DESC(SCINC,SCQRY,SCDATA) ; -- get query description
  1. N I,X
  1. D SET("[Description]",.SCINC,.SCDATA)
  1. S I=0 F S I=$O(^SD(404.95,SCQRY,1,I)) Q:'I S X=$G(^(I,0)) D
  1. . D SET(X,.SCINC,.SCDATA)
  1. D SET("$$END",.SCINC,.SCDATA)
  1. Q
  1. ;
  1. FIELDS(SCINC,SCQRY,SCDATA) ; -- get fields to ask
  1. N I,X,Y
  1. D SET("[Fields]",.SCINC,.SCDATA)
  1. S I=0 F S I=$O(^SD(404.95,SCQRY,"FIELDS",I)) Q:'I S X=$G(^(I,0)) D
  1. . S Y=""
  1. . S Y=Y_$P($G(^SD(404.93,+X,0)),U,2)_U ; component name
  1. . S Y=Y_$P(X,U,2)_U ; value
  1. . D SET(Y,.SCINC,.SCDATA)
  1. D SET("$$END",.SCINC,.SCDATA)
  1. Q
  1. ;
  1. SELECT(SCINC,SCQRY,SCDATA) ; -- get files to select
  1. N I,X,Y
  1. D SET("[Selections]",.SCINC,.SCDATA)
  1. S I=0 F S I=$O(^SD(404.95,SCQRY,"FILES",I)) Q:'I S X=$G(^(I,0)) D
  1. . IF X["DIC(4" S SCGLB="^DIC(4)",SCTYPE="DIVISION"
  1. . IF X["SCTM(404.51" S SCGLB="^SCTM(404.51)",SCTYPE="TEAM"
  1. . IF X["VA(200" S SCGLB="^VA(200)",SCTYPE="PRACTITIONER"
  1. . IF X["SD(403.46" S SCGLB="^SD(403.46)",SCTYPE="ROLE"
  1. . IF X["USR(8930" S SCGLB="^USR(8930)",SCTYPE="USERCLASS"
  1. . IF X["SC(" S SCGLB="^SC",SCTYPE="CLINIC"
  1. . IF $D(@SCGLB@(+X,0)) D SET($P(^(0),U)_U_SCTYPE_U_+X,.SCINC,.SCDATA)
  1. D SET("$$END",.SCINC,.SCDATA)
  1. Q
  1. ;