TIULAPI ; SLC/JER - Extract selected documents from TIU ;6/7/06 11:14
;;1.0;TEXT INTEGRATION UTILITIES;**211**;Jun 20, 1997;Build 26
MAIN(DFN,TIUDOC,STATUS,TIME1,TIME2,OCCLIM,TEXT) ; Control branching
N TIUDA,TIUDT,TIUPRM0,TIUPRM1,TIUPRM3,COUNT,TIUSI,TIUS,TIUTI,TYPES
D SETPARM^TIULE
S:+$G(OCCLIM)'>0 OCCLIM=999
S:+$G(TIME1)'>0 TIME1=6666666
S:+$G(TIME2)'>0 TIME2=9999999
K ^TMP("TIU",$J)
I '$D(TIUPRM0) D SETPARM^TIULE
D DOCTYPE^TIUSRVL(.TYPES,TIUDOC)
I $D(STATUS)'>9 D STATUS^TIUSRVL(.STATUS,$S($G(STATUS)]"":STATUS,1:"ALL"))
S TIUTI=0 F S TIUTI=$O(TYPES(TIUTI)) Q:+TIUTI'>0 D
. S TIUDOC=+$G(TYPES(TIUTI))
. S TIUSI=0 F S TIUSI=$O(STATUS(TIUSI)) Q:+TIUSI'>0 D
. . S TIUS=+$G(STATUS(TIUSI)),TIUDT=TIME1
. . F S TIUDT=$O(^TIU(8925,"APT",DFN,TIUDOC,TIUS,TIUDT)) Q:+TIUDT'>0!(TIUDT>TIME2)!(+$G(COUNT)'<OCCLIM) D
. . . S TIUDA=0 F S TIUDA=$O(^TIU(8925,"APT",DFN,TIUDOC,TIUS,TIUDT,TIUDA)) Q:+TIUDA'>0 D
. . . . I +$$ISADDNDM^TIULC1(TIUDA),+TEXT Q
. . . . I +$$CANDO^TIULP(TIUDA,"VIEW")'>0 Q
. . . . S COUNT=+$G(COUNT)+1
. . . . D EXTRACT^TIULQ(TIUDA,"^TMP(""TIU"",$J,"_COUNT_")",.TIUERR,".01;.05;.07;.08;1202;1203;1205;1208;1209;1301;1307;1402;1501:1505;1507:1513;1701;89261","",1)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HTIULAPI 1233 printed Nov 22, 2024@17:52:03 Page 2
TIULAPI ; SLC/JER - Extract selected documents from TIU ;6/7/06 11:14
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**211**;Jun 20, 1997;Build 26
MAIN(DFN,TIUDOC,STATUS,TIME1,TIME2,OCCLIM,TEXT) ; Control branching
+1 NEW TIUDA,TIUDT,TIUPRM0,TIUPRM1,TIUPRM3,COUNT,TIUSI,TIUS,TIUTI,TYPES
+2 DO SETPARM^TIULE
+3 if +$GET(OCCLIM)'>0
SET OCCLIM=999
+4 if +$GET(TIME1)'>0
SET TIME1=6666666
+5 if +$GET(TIME2)'>0
SET TIME2=9999999
+6 KILL ^TMP("TIU",$JOB)
+7 IF '$DATA(TIUPRM0)
DO SETPARM^TIULE
+8 DO DOCTYPE^TIUSRVL(.TYPES,TIUDOC)
+9 IF $DATA(STATUS)'>9
DO STATUS^TIUSRVL(.STATUS,$SELECT($GET(STATUS)]"":STATUS,1:"ALL"))
+10 SET TIUTI=0
FOR
SET TIUTI=$ORDER(TYPES(TIUTI))
if +TIUTI'>0
QUIT
Begin DoDot:1
+11 SET TIUDOC=+$GET(TYPES(TIUTI))
+12 SET TIUSI=0
FOR
SET TIUSI=$ORDER(STATUS(TIUSI))
if +TIUSI'>0
QUIT
Begin DoDot:2
+13 SET TIUS=+$GET(STATUS(TIUSI))
SET TIUDT=TIME1
+14 FOR
SET TIUDT=$ORDER(^TIU(8925,"APT",DFN,TIUDOC,TIUS,TIUDT))
if +TIUDT'>0!(TIUDT>TIME2)!(+$GET(COUNT)'<OCCLIM)
QUIT
Begin DoDot:3
+15 SET TIUDA=0
FOR
SET TIUDA=$ORDER(^TIU(8925,"APT",DFN,TIUDOC,TIUS,TIUDT,TIUDA))
if +TIUDA'>0
QUIT
Begin DoDot:4
+16 IF +$$ISADDNDM^TIULC1(TIUDA)
IF +TEXT
QUIT
+17 IF +$$CANDO^TIULP(TIUDA,"VIEW")'>0
QUIT
+18 SET COUNT=+$GET(COUNT)+1
+19 DO EXTRACT^TIULQ(TIUDA,"^TMP(""TIU"",$J,"_COUNT_")",.TIUERR,".01;.05;.07;.08;1202;1203;1205;1208;1209;1301;1307;1402;1501:1505;1507:1513;1701;89261","",1)
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+20 QUIT