source: FOIAVistA/tag/r/TOOLKIT-AWCM-XD-XIN-XPAR-XQAB-XT-XUC-XUR-ZIN-ZTED/XDRDPRE1.m@ 1424

Last change on this file since 1424 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1XDRDPRE1 ;SF-IRMFO.SEA/JLI - GENERATE LISTS OF PATIENTS IDENTIFIED BY THE PRELIMINARY SCAN ;02/23/2000 08:48
2 ;;7.3;TOOLKIT;**23,46**;Apr 25, 1995
3 ;;
4EN ;
5 S XDRFL=+$$FILE^XDRDPICK() G:XDRFL'>0 EXIT S XDRFNAM=$P(^DIC(XDRFL,0),U)
6 I '$D(^XTMP("XDRDPREL",XDRFL," DONE")) D Q:XDRFL=0
7 . I $D(^XTMP("XDRDPREL",XDRFL," TIME")) D Q:XDRFL=0
8 . . I $$HDIFF^XLFDT($H,^XTMP("XDRDPREL",XDRFL," TIME"),2)>300 Q
9 . . W !!,"There appears to be a job already running. You may either"
10 . . W !,"view those data or check back in about 5 minutes.",!!
11 . . S XDRFL=0
12 . W !!,$C(7),"There is no available data to generate a list from. You will need to accumulate",!,"the data.",!!
13 . D ^XDRDPREL
14 . S XDRFL=0
15 D SELECT I XDRSELEC="" Q
16 S %ZIS="Q" D ^%ZIS Q:POP
17 I $D(IO("Q")) S ZTSAVE("XDRFL")="",ZTSAVE("XDRSELEC")="",ZTIO=ION,ZTRTN="DQ^XDRDPRE1",ZTDESC="XDRDPRE1 LIST OF PROBLEMS" D ^%ZTLOAD W:$D(ZTSK) !,"Queued as task "_ZTSK,! Q
18 ;
19DQ ;
20 U IO W @IOF
21 S XDRTMP="^XTMP(""XDRDPREL"",XDRFL,XDRSELEC,XDRDA)"
22 S XDRGLB=^DIC(XDRFL,0,"GL")_"XDRDA)"
23 S XDRDR=".01;"
24 F XDRI=0:0 S XDRI=$O(^DD(XDRFL,0,"ID",XDRI)) Q:XDRI'>0 S XDRDR=XDRDR_XDRI_";"
25 I XDRSELEC'="NO ZERO NODE" D SIZE
26 D HEADER
27 F XDRDA=0:0 S XDRDA=$O(@XDRTMP) Q:XDRDA'>0 D Q:$D(DIRUT)
28 . I (IOSL-$Y)<6 D:IOST["C-" Q:$D(DIRUT) W @IOF,!!
29 . . W ! S DIR(0)="E" D ^DIR
30 . W !,$J(XDRDA,10)
31 . I XDRSELEC="NO ZERO NODE" Q
32 . S DR=XDRDR
33 . S DA=XDRDA,DIC=XDRFL,DIQ(0)="I",DIQ="XDRX" K XDRX
34 . D EN^DIQ1
35 . S X=XDRX(XDRFL,XDRDA,.01,"I")
36 . F Q:X'["MERGING INTO" S X=$P(X,"(",2,99),X=$E(X,1,$L(X)-1)
37 . W " ",$E(X,1,28),?40
38 . F I=0:0 S I=$O(XDRX(XDRFL,XDRDA,I)) Q:I'>0 I I'=.01 D
39 . . S Y=$P(^DD(XDRFL,I,0),U,2)
40 . . S X=XDRX(XDRFL,XDRDA,I,"I")
41 . . I Y["D" S N=10 I X'="" S X=$$FMTE^XLFDT(X,"2D") W $J(X,N)
42 . . I Y'["D",$D(NSIZE(I)) S N=NSIZE(I)+2 W $J(X,N)
43 D ^%ZISC
44 Q
45 ;
46SIZE ;
47 N XDRDA,NC,DR,DA,DIC,DIQ,I,L
48 S NC=0
49 F XDRDA=0:0 S XDRDA=$O(@XDRGLB) Q:XDRDA'>0 S NC=NC+1 Q:NC>50 D
50 . S DR=XDRDR
51 . S DA=XDRDA,DIC=XDRFL,DIQ(0)="I",DIQ="XDRX" K XDRX
52 . D EN^DIQ1
53 . F I=0:0 S I=$O(XDRX(XDRFL,XDRDA,I)) Q:I'>0 D
54 . . S L=$L(XDRX(XDRFL,XDRDA,I,"I")) I L>$G(NSIZE(I)) S NSIZE(I)=L
55 Q
56 ;
57HEADER ;
58 W "LISTING OF ENTRIES IN FILE ",XDRFL," WITH IDENTIFIER OR OTHER PROBLEMS"
59 W ?10,"SELECTED LISTING: ",XDRSELEC
60 W !!!,"DATA LISTED ACROSS THE PAGE IN THE FOLLOWING ORDER:",!!,"INTERNAL ENTRY NUMBER"
61 I XDRSELEC="NO ZERO NODE" W !! Q
62 F I=0:0 S I=$O(NSIZE(I)) Q:I'>0 W !,$P(^DD(XDRFL,I,0),U)
63 W !!,"XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX",?40
64 F I=.01:0 S I=$O(NSIZE(I)) Q:I'>0 D
65 . S X=$P(^DD(XDRFL,I,0),U,2) I X["D" S NSIZE(I)=8
66 . S X=$E("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",1,NSIZE(I))
67 . W $J(X,NSIZE(I)+2)
68 W !
69 Q
70 ;
71SELECT ;
72 N NC,N,XDRX,I,DIR,Y
73 S NC=0
74 S N="A" F S N=$O(^XTMP("XDRDPREL",XDRFL,N)) Q:N="" S NC=NC+1,XDRX(NC)=N
75 W !!,"Enter the number of the desired list to output:",!
76 F I=0:0 S I=$O(XDRX(I)) Q:I'>0 W !,$J(I,2)," ",XDRX(I)
77 W !! S DIR(0)="N^1:"_NC,DIR("A")="List number" D ^DIR
78 S XDRSELEC=""
79 I Y>0 S XDRSELEC=XDRX(+Y)
80 Q
81 ;
82EXIT ;
83 Q
Note: See TracBrowser for help on using the repository browser.