source: FOIAVistA/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGPFRPI2.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 4.6 KB
Line 
1DGPFRPI2 ;ALB/RBS - PRF PRINCIPAL INVEST REPORT CONT. ; 6/14/04 10:39am
2 ;;5.3;Registration;**554**;Aug 13, 1993
3 ;
4 ;This routine will be used to display/print all patient assignments
5 ;for a Principal Investigator assigned to the Research record flag.
6 ;
7 ;- no direct entry
8 QUIT
9 ;
10PRINT(DGSORT,DGLIST) ;output report
11 ; Input:
12 ; DGSORT - array of user selected report parameters
13 ; DGLIST - temp global name used for report list
14 ; ^TMP("DGPFRPI1",$J)
15 ;
16 ; Output: Formatted report to user selected device
17 ;
18 N DGBEG ;sort beginning date
19 N DGDFN ;ien of patient
20 N DGDT ;date time report printed
21 N DGFG ;flag name
22 N DGEND ;sort ending date
23 N DGHSTR ;header string var
24 N DGHSTR1 ;header string var
25 N DGHSTR2 ;header string var
26 N DGLINE ;string of hyphens (80) for report header format
27 N DGLN ;loop var
28 N DGPNAM ;patient name
29 N DGODFN ;loop var flag
30 N DGOFG ;name switch flag
31 N DGOPISTR ;pi name switch flag
32 N DGPAGE ;page counter
33 N DGPISTR ;pi name string for sub-header display
34 N DGQ ;quit flag
35 N DGSTR ;string of detail line to display
36 N X,Y
37 ;
38 S DGHSTR="PATIENT RECORD FLAGS"
39 S DGHSTR1="ASSIGNMENTS BY PRINCIPAL INVESTIGATOR REPORT"
40 I DGSORT("DGPRINC")="A" S DGHSTR2="(A)ll Principal Investigators"
41 E S DGHSTR2="(S)ingle Principal Investigator: "_$P(DGSORT("DGPRINC"),U,2)
42 S DGDT=$P($$FMTE^XLFDT($$NOW^XLFDT,"T"),":",1,2)
43 S DGBEG=$$FDATE^VALM1(DGSORT("DGBEG"))
44 S DGEND=$$FDATE^VALM1(DGSORT("DGEND"))
45 S (DGQ,DGPAGE)=0,$P(DGLINE,"-",81)=""
46 ;
47 I $O(@DGLIST@(""))="" D Q
48 . D HEAD
49 . W !!," >>> No Record Flag Assignments were found using the report criteria.",!
50 ;
51 ; loop and print report
52 S (DGDFN,DGFG,DGLN,DGPISTR,DGPNAM,DGODFN,DGOFG,DGOPISTR,DGSTR)=""
53 ;
54 D HEAD
55 F S DGFG=$O(@DGLIST@(DGFG)) Q:DGFG="" D Q:DGQ
56 . S DGPISTR=$$PISTR(DGFG)
57 . I $Y>(IOSL-10) D PAUSE(.DGQ) Q:DGQ D HEAD,HEAD1,HEAD2,HEAD3 S DGOFG=DGFG,DGOPISTR=DGPISTR
58 . I DGOFG'=DGFG D
59 . . W:DGOPISTR]"" !! D HEAD1,HEAD2,HEAD3 S DGOFG=DGFG,DGOPISTR=DGPISTR
60 . S DGPNAM=0 ;starts looping after "0" princ invest node
61 . F S DGPNAM=$O(@DGLIST@(DGFG,DGPNAM)) Q:DGPNAM="" D Q:DGQ
62 . . ; print patient detail line
63 . . S DGODFN=""
64 . . F S DGDFN=$O(@DGLIST@(DGFG,DGPNAM,DGDFN)) Q:DGDFN="" D Q:DGQ
65 . . . S DGLN=""
66 . . . F S DGLN=$O(@DGLIST@(DGFG,DGPNAM,DGDFN,DGLN)) Q:DGLN="" D Q:DGQ
67 . . . . I $Y>(IOSL-3) D PAUSE(.DGQ) Q:DGQ D HEAD,HEAD1,HEAD2,HEAD3 S DGODFN=""
68 . . . . S DGSTR=$G(@DGLIST@(DGFG,DGPNAM,DGDFN,DGLN))
69 . . . . W !
70 . . . . I DGODFN'=DGDFN S DGODFN=DGDFN D ;only print name once
71 . . . . . W $E(DGPNAM,1,16),?18,$P(DGSTR,U)
72 . . . . W ?30,$P(DGSTR,U,2),?48,$P(DGSTR,U,3),?60,$P(DGSTR,U,4),?71,$P(DGSTR,U,5)
73 ;
74 ;Shutdown if stop task requested
75 I DGQ W:$D(ZTQUEUED) !!,"REPORT STOPPED AT USER REQUEST" Q
76 ;
77 W !!,"<End of Report>"
78 Q
79 ;
80PAUSE(DGQ) ; pause screen display
81 ; Input:
82 ; DGQ - var used to quit report processing to user CRT
83 ; Output:
84 ; DGQ - passed by reference - 0 = Continue, 1 = Quit
85 ;
86 I $G(DGPAGE)>0,$E(IOST,1,2)="C-" K DIR S DIR(0)="E" D ^DIR K DIR S:+Y=0 DGQ=1
87 Q
88 ;
89HEAD ;Print/Display page header
90 ;
91 I $D(ZTQUEUED),$$S^%ZTLOAD S (ZTSTOP,DGQ)=1 Q
92 W:'($E(IOST,1,2)'="C-"&'DGPAGE) @IOF
93 ;
94 S DGPAGE=$G(DGPAGE)+1
95 W !?(IOM/2)-($L(DGHSTR)/2),DGHSTR
96 W !?(IOM/2)-($L(DGHSTR1)/2),DGHSTR1
97 W ?68,"Page: ",$G(DGPAGE)
98 W !,"Date Range: ",DGBEG_" to "_DGEND
99 W ?50,"Printed: ",DGDT
100 W !,"Sorted By: ",DGHSTR2
101 W !,DGLINE,!
102 Q
103 ;
104HEAD1 W !,"Flag Name: ",$G(DGFG)," - Category II (Local)"
105 Q
106 ;
107HEAD2 W !,"Principal Investigator: "
108 ; <---- length = 24 ----->
109 ; check string length so we don't wrap on screen/printer (80) max
110 I $L(DGPISTR)'>55 W ?24,DGPISTR
111 E D
112 . N X,Y
113 . S X=""
114 . F Y=1:1:$L(DGPISTR,"; ") D
115 . . I $L(X_$P(DGPISTR,"; ",Y))>53 W ?24,X,";" S X="" W !
116 . . S:X]"" X=X_"; "
117 . . S X=X_$P(DGPISTR,"; ",Y)
118 . W ?24,X
119 Q
120 ;
121HEAD3 W !!,"PATIENT",?18,"SSN",?30,"ACTION",?48,"ACTION DT",?60,"REVIEW DT",?71,"STATUS"
122 W !,"================",?18,"==========",?30,"================",?48,"=========",?60,"=========",?71,"========="
123 Q
124 ;
125PISTR(DGFG) ;string Principal Investigators together for sub-header display
126 ;
127 ; Input:
128 ; DGFG - flag name subscript
129 ;
130 ; Output:
131 ; Function Value - string of Principal Investigator names
132 ; i.e. - "Johnny Cash; Bob Smith; Pete Best; ect..."
133 ;
134 N DGRSLT ;returned function value
135 N DGPI ;principal investigator person ien
136 S DGRSLT=""
137 ;
138 I $O(@DGLIST@(DGFG,0,""))="" D
139 . S DGRSLT="No Principal Investigator names on file"
140 ;
141 I $O(@DGLIST@(DGFG,0,"")) D
142 . S DGPI=""
143 . F S DGPI=$O(@DGLIST@(DGFG,0,DGPI)) Q:DGPI="" D Q:$L(DGRSLT)>450
144 . . S:DGRSLT]"" DGRSLT=DGRSLT_"; "
145 . . S DGRSLT=DGRSLT_$G(@DGLIST@(DGFG,0,DGPI))
146 Q DGRSLT
Note: See TracBrowser for help on using the repository browser.