SCCVDBU ;ALB/RMO,TMP - Database Update Utilities; [ 03/23/95 11:08 AM ]
;;5.3;Scheduling;**211**;Aug 13, 1993
;
UPD(SCFILE,SCIENS,SCDATA,SCERR) ;File data into an existing entry
; Input -- SCFILE File or sub-file number
; SCIENS Internal entry number(s)
; SCDATA Data array to file
; Output -- SCERR DEFINED=error
N SCFDA,SCFIELD
S SCFIELD=0
F S SCFIELD=$O(SCDATA(SCFIELD)) Q:'SCFIELD D
. S SCFDA(SCFILE,SCIENS_",",SCFIELD)=$G(SCDATA(SCFIELD))
D FILE^DIE("K","SCFDA","")
I $G(DIERR) S SCERR=U_$G(^TMP("DIERR",$J,$P(DIERR,U,2),"TEXT",1))
D CLEAN^DILF
UPDQ Q
;
ADD(SCFILE,SCIENS,SCDATA,SCERR) ;File data into a new or existing entry
; Input -- SCFILE File or sub-file number
; SCIENS Internal entry number(s)
; SCDATA Data array to file
; Output -- SCERR DEFINED=error
N SCFDA,SCFIELD
S SCFIELD=0
F S SCFIELD=$O(SCDATA(SCFIELD)) Q:'SCFIELD D
. S SCFDA(SCFILE,SCIENS_",",SCFIELD)=$G(SCDATA(SCFIELD))
D UPDATE^DIE("","SCFDA","","")
I $G(DIERR) S SCERR=U_$G(^TMP("DIERR",$J,$P(DIERR,U,2),"TEXT",1))
D CLEAN^DILF
ADDQ Q
;
WP(SCFILE,SCIENS,SCFIELD,SCDATA) ;File data into a single word processing field
; Input -- SCFILE File or sub-file number
; SCIENS Internal entry number(s)
; SCFIELD Field number
; SCDATA Data array to file
; Output -- ;add- SCERR 0=error and 1=no error
D WP^DIE(SCFILE,SCIENS_",",SCFIELD,"AK","SCDATA(""WP"")","")
D CLEAN^DILF
WPQ Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSCCVDBU 1531 printed Oct 16, 2024@18:39:11 Page 2
SCCVDBU ;ALB/RMO,TMP - Database Update Utilities; [ 03/23/95 11:08 AM ]
+1 ;;5.3;Scheduling;**211**;Aug 13, 1993
+2 ;
UPD(SCFILE,SCIENS,SCDATA,SCERR) ;File data into an existing entry
+1 ; Input -- SCFILE File or sub-file number
+2 ; SCIENS Internal entry number(s)
+3 ; SCDATA Data array to file
+4 ; Output -- SCERR DEFINED=error
+5 NEW SCFDA,SCFIELD
+6 SET SCFIELD=0
+7 FOR
SET SCFIELD=$ORDER(SCDATA(SCFIELD))
if 'SCFIELD
QUIT
Begin DoDot:1
+8 SET SCFDA(SCFILE,SCIENS_",",SCFIELD)=$GET(SCDATA(SCFIELD))
End DoDot:1
+9 DO FILE^DIE("K","SCFDA","")
+10 IF $GET(DIERR)
SET SCERR=U_$GET(^TMP("DIERR",$JOB,$PIECE(DIERR,U,2),"TEXT",1))
+11 DO CLEAN^DILF
UPDQ QUIT
+1 ;
ADD(SCFILE,SCIENS,SCDATA,SCERR) ;File data into a new or existing entry
+1 ; Input -- SCFILE File or sub-file number
+2 ; SCIENS Internal entry number(s)
+3 ; SCDATA Data array to file
+4 ; Output -- SCERR DEFINED=error
+5 NEW SCFDA,SCFIELD
+6 SET SCFIELD=0
+7 FOR
SET SCFIELD=$ORDER(SCDATA(SCFIELD))
if 'SCFIELD
QUIT
Begin DoDot:1
+8 SET SCFDA(SCFILE,SCIENS_",",SCFIELD)=$GET(SCDATA(SCFIELD))
End DoDot:1
+9 DO UPDATE^DIE("","SCFDA","","")
+10 IF $GET(DIERR)
SET SCERR=U_$GET(^TMP("DIERR",$JOB,$PIECE(DIERR,U,2),"TEXT",1))
+11 DO CLEAN^DILF
ADDQ QUIT
+1 ;
WP(SCFILE,SCIENS,SCFIELD,SCDATA) ;File data into a single word processing field
+1 ; Input -- SCFILE File or sub-file number
+2 ; SCIENS Internal entry number(s)
+3 ; SCFIELD Field number
+4 ; SCDATA Data array to file
+5 ; Output -- ;add- SCERR 0=error and 1=no error
+6 DO WP^DIE(SCFILE,SCIENS_",",SCFIELD,"AK","SCDATA(""WP"")","")
+7 DO CLEAN^DILF
WPQ QUIT