VistA-WorldVistAEHR/r/SCHEDULING-SD-SC/SCUTBK2.m

55 lines
1.4 KiB
Mathematica

SCUTBK2 ;ALB/MJK - Scheduling Broker Utilities ;[ 03/07/95 10:02 AM ]
;;5.3;Scheduling;**41**;AUG 13, 1993
;
Q
;
FINDC(SCDATA,SC) ; -- broker callback to actually use FIND^DIC
N SCFILE,SCIENS,SCFIELDS,SCFLAGS,SCFROM,SCPART,SCVAL,SCMAX,SCXREF,SCREEN,SCID,SCROOT,SCDILIST
D CHK^SCUTBK
;
; -- parse array to parameters
D PARSE^SCUTBK(.SC)
D TMP^SCUTBK
;
D FIND^DIC(SCFILE,SCIENS,SCFIELDS,SCFLAGS,SCVAL,SCMAX,SCXREF,SCREEN,SCID,"SCDATA")
;
Q
;
GETSC(SCDATA,SC) ; -- broker callback to actually use GETS^DIQ
;
N SCFILE,SCIENS,SCFIELDS,SCFLAGS,SCFROM,SCPART,SCVAL,SCMAX,SCXREF,SCREEN,SCID,SCROOT,SCERR
D CHK^SCUTBK
;
; -- parse array to parameters
D PARSE^SCUTBK(.SC)
D TMP^SCUTBK
;
D GETS^DIQ(SCFILE,SCIENS,SCFIELDS,SCFLAGS,"SCDATA","SCERR")
;
N Y,SCFLD,N,X,J,C
S N=0
D SET("[Data]")
S SCFLD=0 F S SCFLD=$O(SCDATA(SCFILE,SCIENS,SCFLD)) Q:'SCFLD D
. S X=SCFILE_"^"_$E(SCIENS,1,$L(SCIENS)-1)_"^"_SCFLD_"^"
. ; -- below call to $$GET1 is too slow...working w/FM team for speed
. ;IF $$GET1^DID(SCFILE,SCFLD,"","TYPE")="WORD-PROCESSING" D
. IF $P($G(^DD(SCFILE,SCFLD,0)),U,4)[";0" D
. . D SET(X_"[WORD PROCESSING]")
. . S J=0 F S J=$O(SCDATA(SCFILE,SCIENS,SCFLD,J)) Q:'J D
. . . D SET(SCDATA(SCFILE,SCIENS,SCFLD,J))
. . D SET("$$END$$")
. E D
. . D SET(X_$G(SCDATA(SCFILE,SCIENS,SCFLD,"I"))_"^"_$G(SCDATA(SCFILE,SCIENS,SCFLD,"E")))
;
IF $D(SCERR) D
. D SET("[ERROR]")
;
K SCDATA M SCDATA=Y
Q
;
SET(X) ;
S N=N+1
S Y(N)=X
Q
;