TIUSRVLP ;BAY PINES/ELR - Server fns - Cont of TIUSRVLO ;20-NOV-2001 08:51:07
;;1.0;TEXT INTEGRATION UTILITIES;**194**;Jun 20, 1997
;VMP OIFO BAY PINES;ELR;TIU*1.0*194 FORCED TO BREAK UP TIUSRVLO DUE TO SIZE
APTCL(TIUY,CLASS,TIUAUTH,DFN,TIME1,TIME2,SEQUENCE) ; Signed, by author
N DATTIM,DA,ROOT,TIUI,TIUS12,TIUS15
S ROOT=$NA(^TIU(8925,"APTCL",DFN,CLASS))
S DATTIM=TIME1-.0000001
F S DATTIM=$O(@ROOT@(DATTIM)) Q:DATTIM'>0!(DATTIM>TIME2) D
. S DA=0 F S DA=$O(@ROOT@(DATTIM,DA)) Q:DA'>0 D
. . I +$G(^TIU(8925,+DA,0))'>0 K @ROOT@(DA) Q
. . S TIUI=$S(SEQUENCE="D":+$G(TIUI)+1,1:+$G(TIUI)-1)
. . Q:+$D(@TIUY@("INDX",DA))
. . ; Selectively filter DELETED or RETRACTED records
. . I +$P($G(^TIU(8925,DA,0)),U,5)>13,'+$$CANDO^TIULP(DA,"VIEW",DUZ) Q
. . S TIUS12=$G(^TIU(8925,DA,12))
. . Q:+$P(TIUS12,U,2)'=TIUAUTH ;See if this is the authors note
. . S TIUS15=$G(^TIU(8925,DA,15))
. . Q:+$P(TIUS15,U,2)'>0 ;See if signed
. . S @TIUY@(TIUI)=DA_U_$$RESOLVE^TIUSRVLO(DA)
. . S @TIUY@("INDX",DA,TIUI)=""
. . Q:+$G(SHOWADD)=0
. . I +$$HASDAD^TIUSRVLI(DA) D SETDAD^TIUSRVLI(.TIUY,DA,.TIUI)
. . I +$$HASKIDS^TIUSRVLI(DA) D SETKIDS^TIUSRVLI(.TIUY,DA,.TIUI)
Q
TIUSRVLP ;BAY PINES/ELR - Server fns - Cont of TIUSRVLO ;20-NOV-2001 08:51:07
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**194**;Jun 20, 1997
+2 ;VMP OIFO BAY PINES;ELR;TIU*1.0*194 FORCED TO BREAK UP TIUSRVLO DUE TO SIZE
APTCL(TIUY,CLASS,TIUAUTH,DFN,TIME1,TIME2,SEQUENCE) ; Signed, by author
+1 NEW DATTIM,DA,ROOT,TIUI,TIUS12,TIUS15
+2 SET ROOT=$NAME(^TIU(8925,"APTCL",DFN,CLASS))
+3 SET DATTIM=TIME1-.0000001
+4 FOR
SET DATTIM=$ORDER(@ROOT@(DATTIM))
IF DATTIM'>0!(DATTIM>TIME2)
QUIT
Begin DoDot:1
+5 SET DA=0
FOR
SET DA=$ORDER(@ROOT@(DATTIM,DA))
IF DA'>0
QUIT
Begin DoDot:2
+6 IF +$GET(^TIU(8925,+DA,0))'>0
KILL @ROOT@(DA)
QUIT
+7 SET TIUI=$SELECT(SEQUENCE="D":+$GET(TIUI)+1,1:+$GET(TIUI)-1)
+8 IF +$DATA(@TIUY@("INDX",DA))
QUIT
+9 ; Selectively filter DELETED or RETRACTED records
+10 IF +$PIECE($GET(^TIU(8925,DA,0)),U,5)>13
IF '+$$CANDO^TIULP(DA,"VIEW",DUZ)
QUIT
+11 SET TIUS12=$GET(^TIU(8925,DA,12))
+12 ;See if this is the authors note
IF +$PIECE(TIUS12,U,2)'=TIUAUTH
QUIT
+13 SET TIUS15=$GET(^TIU(8925,DA,15))
+14 ;See if signed
IF +$PIECE(TIUS15,U,2)'>0
QUIT
+15 SET @TIUY@(TIUI)=DA_U_$$RESOLVE^TIUSRVLO(DA)
+16 SET @TIUY@("INDX",DA,TIUI)=""
+17 IF +$GET(SHOWADD)=0
QUIT
+18 IF +$$HASDAD^TIUSRVLI(DA)
DO SETDAD^TIUSRVLI(.TIUY,DA,.TIUI)
+19 IF +$$HASKIDS^TIUSRVLI(DA)
DO SETKIDS^TIUSRVLI(.TIUY,DA,.TIUI)
End DoDot:2
End DoDot:1
+20 QUIT