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

SCRPBK.m

Go to the documentation of this file.
  1. SCRPBK ;MJK/ALB - RPC Broker Utilities ; 27 FEB 96
  1. ;;5.3;Scheduling;**41,1015**;AUG 13, 1993;Build 21
  1. ;
  1. GETREC(SCDATA,SCRPT) ; -- get REPORT record
  1. ; input : SCRPT := ien of report definition
  1. ; output : SCDATA is the return array
  1. ; SCDATA(0) := 0th node of rpt def
  1. ; (1..n) := sections for
  1. ; [Description], [Sorts], [Fields], [Files]
  1. ;
  1. ; Related RPC: SCRP DEFINITION GETRECORD
  1. ;
  1. N SC,X,SCINC
  1. S SCINC=-1,SCRPT=+SCRPT
  1. ; -- get 0th node of team
  1. S X=$$RPTDEF(SCRPT)
  1. ; -- add to return array
  1. D SET(X,.SCINC,.SCDATA)
  1. ; -- get description
  1. D DESC(.SCINC,SCRPT,.SCDATA)
  1. ; -- get sorts
  1. D SORTS(.SCINC,SCRPT,.SCDATA)
  1. ; -- get fields
  1. D FIELDS(.SCINC,SCRPT,.SCDATA)
  1. ; -- get files
  1. D FILES(.SCINC,SCRPT,.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. RPTDEF(SCRPT) ; -- retrieve rpt def demographics
  1. N X,Y
  1. S X=$G(^SD(404.92,SCRPT,0))
  1. S Y=$P(X,U)_U_$P($G(^SD(404.94,+$P(X,U,2),0)),U)
  1. Q Y
  1. ;
  1. DESC(SCINC,SCRPT,SCDATA) ; -- get rpt description
  1. N I,X
  1. D SET("[Description]",.SCINC,.SCDATA)
  1. S I=0 F S I=$O(^SD(404.92,SCRPT,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. SORTS(SCINC,SCRPT,SCDATA) ; -- get possible sorts
  1. N I,X
  1. D SET("[Sorts]",.SCINC,.SCDATA)
  1. S I=0 F S I=$O(^SD(404.92,SCRPT,"SORTS",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,SCRPT,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.92,SCRPT,"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 ; required
  1. . S Y=Y_$P(X,U,3)_U ; always ask
  1. . S Y=Y_$P(X,U,4)_U ; default value
  1. . D SET(Y,.SCINC,.SCDATA)
  1. D SET("$$END",.SCINC,.SCDATA)
  1. Q
  1. ;
  1. FILES(SCINC,SCRPT,SCDATA) ; -- get files to select
  1. N I,X,Y,SCTYPE
  1. D SET("[Files]",.SCINC,.SCDATA)
  1. S I=0 F S I=$O(^SD(404.92,SCRPT,"FILES",I)) Q:'I S X=$G(^(I,0)) D
  1. . S SCTYPE=$$TYPE(+X)
  1. . S Y=""
  1. . S Y=Y_SCTYPE_U ; file type
  1. . S Y=Y_+X_U ; file #
  1. . S Y=Y_+$P(X,U,2)_U ; selections allowed
  1. . IF $$CHKTYPE^SCRPBK2(SCTYPE) D SET(Y,.SCINC,.SCDATA)
  1. D SET("$$END",.SCINC,.SCDATA)
  1. Q
  1. ;
  1. TYPE(FILENUM) ; -- determine file type for file
  1. N X
  1. S X=""
  1. IF FILENUM=4 S X="DIVISION" G TYPEQ
  1. IF FILENUM=404.51 S X="TEAM" G TYPEQ
  1. IF FILENUM=200 S X="PRACTITIONER" G TYPEQ
  1. IF FILENUM=403.46 S X="ROLE" G TYPEQ
  1. IF FILENUM=8930 S X="USERCLASS" G TYPEQ
  1. IF FILENUM=44 S X="CLINIC" G TYPEQ
  1. TYPEQ Q X
  1. ;
  1. ;
  1. ; -- variable descriptions for SCRPBK* routines
  1. ; SCDATA -> result return array
  1. ; SCINC -> incrmental variable used when build SCDATA
  1. ; SCQRY -> ien of 404.95
  1. ; SCQDEF -> raw query defintion received from client
  1. ; SCQREC -> query definition
  1. ; SCRPT -> ien of 404.92 - query definition
  1. ; SCRPTID -> ien of 404.92 - report definifion
  1. ; SCRPT -> report name
  1. ; SCTYPE -> selection file type (DIVISION, TEAM, etc.)
  1. ; SCGLB -> closed global root of a file [i.e. ^SC]
  1. ; SCAN -> array where the name of used/required report
  1. ; fields or file selections are stored
  1. ; SCPROC -> process being performed when error occured
  1. ; SCPARM()-> error parameters to be used by BLD^DIALOG call
  1. ; SCLOG -> contains the array name where application generated
  1. ; error messages are stored(usually SCDATA)
  1. ; SCERR() -> array where FM DBS generated errors are stored
  1. ; SCTEXT -> text used to search files
  1. ; SCSELS()-> array of file entry selections
  1. ; VAUTD() -> array of divisions subscripted by iens
  1. ; VAUTT() -> array of teams subscripted by iens
  1. ; VAUTP() -> array of practitioners subscripted by iens
  1. ; VAUTR() -> array of roles subscripted by iens
  1. ; VAUTC() -> array of clinics subscripted by iens
  1. ; VAUTUC()-> array of user classes subscripted by iens
  1. ;