source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SCRPW20.m@ 861

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

initial load of WorldVistAEHR

File size: 7.2 KB
Line 
1SCRPW20 ;RENO/KEITH - ACRP Ad Hoc Report ; 15 Nov 98 4:31 PM
2 ;;5.3;Scheduling;**144,171**;AUG 13, 1993
3 I $E(IOST)'="C" D Q
4 .N SDX S SDX="Your current terminal type is "_IOST_"." W !?(IOM-$L(SDX)\2),SDX
5 .S SDX="This option requires a CRT terminal type!" W !!?(IOM-$L(SDX)\2),SDX,! Q
6 K ^TMP("SCRPW",$J),SDPAR D BLD^SCRPW21 N DIR,X,Y,SDOUT,T S (SDREV,SDOUT)=0,T="~"
7 F SDTAG="INTRO","FMT","PERS","LIM","ORD","XPF","REVIEW" D @SDTAG Q:SDOUT!SDREV
8 G:SDOUT EXIT^SCRPW27 D SAVT^SCRPW21(.SDPAR)
9QUE N ZTSAVE S ZTSAVE("SDPAR(")="" D MAR^SCRPW29,EN^XUTMDEVQ("RPT^SCRPW26","ACRP Ad Hoc Report",.ZTSAVE) G EXIT^SCRPW27
10 ;
11INTRO K SDBOT S (SDTOP,SDBOT(1))="A C R P A d H o c R e p o r t" D DISP^SCRPW23(SDTOP,.SDBOT),INTRO^SCRPW26
12 I $$REST^SCRPW22() H 1 S SDREV=1 G REVIEW
13 Q:SDOUT I '$O(^SDD(409.91,0)) W !! K DIR S DIR(0)="E" S X=$$DIR^SCRPW23(.DIR,0)
14 Q
15FMT ;Get format parameters
16 S SDS1="F",(SDOUT,SDNUL)=0,SDBOT(1)="Report format selection",SDBOT(2)="Report format parameters determine the appearance of the report."
17 D DISP^SCRPW23("R E P O R T F O R M A T",.SDBOT)
18 F SDTAG="F1","F2","F3","F4","F5","F6" D @SDTAG Q:SDOUT
19 G:$$VF^SCRPW29() FMT I SDREV G:$$VP^SCRPW29() PERS
20 Q
21PERS ;Prompt for perspective
22 K SDBOT S SDS1="P",(SDOUT,SDNUL)=0,SDBOT(1)="Report perspective selection",SDBOT(2)="The element selected for this parameter will determine how the statistics will",SDBOT(3)="be organized and sub-totaled."
23 D DISP^SCRPW23("R E P O R T P E R S P E C T I V E",.SDBOT)
24 D P1 G:$$VP^SCRPW29() PERS Q
25LIM ;Prompt for limitations
26 K SDBOT S SDS1="L",(SDOUT,SDNUL)=0
27 S SDBOT(1)="Report limitation selection",SDBOT(2)="Limiting factors determine which encounter records to count. Multiple limiting",SDBOT(3)="factors can be chosen and specified to only include (or exclude) specific data."
28 D DISP^SCRPW23("R E P O R T L I M I T A T I O N S",.SDBOT)
29 F SDTAG="L1","L2" D @SDTAG Q:SDOUT
30 G:$$VL^SCRPW29() LIM Q
31ORD ;Prompt for print order
32 K SDBOT S SDS1="O",(SDOUT,SDNUL)=0,SDBOT(1)="Report print order selection",SDBOT(2)="This parameter determines the order in which the report will be printed."
33 D DISP^SCRPW23("R E P O R T P R I N T O R D E R",.SDBOT)
34 K DIR D DIRB1^SCRPW23("O",1,"ALPHABETIC") S DIR("A")="Select report print order",DIR(0)="S^A:ALPHABETIC;E:ENCOUNTER TOTAL;V:VISIT TOTAL;U:UNIQUE TOTAL",DIR("?")="Specify the order to print elements of selected perspective."
35 S SDX=$$DIR^SCRPW23(.DIR,0) S:$L(SDX) SDPAR("O",1)=SDX Q:SDOUT
36 D DESC^SCRPW22 Q:SDOUT G:$$VO^SCRPW29() ORD Q
37 ;
38XY(X) ;Maintain $X, $Y
39 ;Required input: X=screen handling variable to write
40 N DX,DY S DX=$X,DY=$Y W X X SDXY Q ""
41 ;
42XPF ;Extra print fields
43 D PF^SCRPW29 Q
44 ;
45REVIEW ;Review selected parameters
46 D REVSCR,REV0 Q
47 ;
48REVSCR K SDBOT S SDTOP="S e l e c t e d R e p o r t P a r a m e t e r s",SDBOT(1)="Parameters selected for ACRP Ad Hoc Report",SDBOT(2)="These parameters will determine the appearance and data contained in the output."
49 D DISP^SCRPW23(SDTOP,.SDBOT) Q
50 ;
51VERS ;Verify segments
52 W ! F SDX="VF","VP","VL","VO" S SDX="$$"_SDX_"^SCRPW29(1)" I @(SDX)
53 Q
54 ;
55REV0 S SDREV=1,SDOUT=0 D PLIST^SCRPW22(0,15) S SDOUT=0
56REV1 D VERS W:SDOUT ! S SDOUT=0 W !?32,$$XY(IORVON)," Report action ",$$XY(IORVOFF)
57 K DIR S DIR("A")="Select report action",DIR(0)="S^C:CONTINUE;E:EDIT PARAMETERS;R:RE-DISPLAY PARAMETERS;P:PRINT PARAMETERS;Q:QUIT",DIR("B")="CONTINUE",SDACT=$P($$DIR^SCRPW23(.DIR,0),U)
58 I $D(DTOUT)!$D(DUOUT)!(SDACT="Q") S SDOUT=1 Q
59 I SDACT="P" N ZTSAVE S ZTSAVE("SDPAR(")="" W ! D EN^XUTMDEVQ("PPAR^SCRPW27","ACRP Ad Hoc Report Parameters",.ZTSAVE) G REV1
60 G:SDACT="R" REVIEW I SDACT="C" S SDOUT=0 D VERS D:SDOUT Q
61 .W !!,"Required information missing. Unable to continue with queueing!" H 3 Q
62 F S (SDOUT,SDNUL)=0 W !!?31,$$XY(IORVON)," Re-edit actions ",$$XY(IORVOFF) D RDIR S SDACT=$P($$DIR^SCRPW23(.DIR,0),U) Q:SDOUT!SDNUL D REV2,REVSCR Q:SDOUT!SDNUL
63 S (SDOUT,SDNUL)=0 G REV1
64 ;
65RDIR K DIR S DIR("A")="Select section to re-edit",DIR(0)="SO^F:FORMAT;P:PERSPECTIVE;L:LIMITATIONS;O:ORDER;"_$$PFC^SCRPW29()_"A:ALL SECTIONS;E:EXIT FROM RE-EDIT" Q
66 ;
67REV2 I SDACT="E" S SDNUL=1 Q
68 D @($S(SDACT="F":"FMT",SDACT="P":"PERS",SDACT="L":"LIM",SDACT="O":"ORD",SDACT="X":"XPF",1:"REV3")) Q
69 ;
70REV3 F SDACT="FMT","PERS","LIM","ORD","XPF" D @SDACT Q:SDOUT
71 Q
72 ;
73F1 K DIR D DIRB1^SCRPW23("F",1,"SUMMARY") S DIR("A")="Select report format",DIR(0)="S^D:DETAILED;S:SUMMARY",DIR("?",1)="DETAILED format allows the listing of encounters, visits or uniques and ranked"
74 S DIR("?",2)="lists of diagnoses and procedures for selected items in the selected",DIR("?",3)="perspective. SUMMARY format provides subtotals of encounters, visits and"
75 S DIR("?",4)="uniques for all items in a selected perspective and allows subtotals to be",DIR("?")="compared to the same date range in the previous year.",SDX=$$DIR^SCRPW23(.DIR,0) S:$L(SDX) SDPAR("F",1)=SDX D PFR^SCRPW29 Q
76 ;
77F2 I $P(SDPAR("F",1),U)="S" W ! K DIR D DIRB1^SCRPW23("F",2,"NO") S DIR("A")="Compare data to same date range for the previous year",DIR(0)="Y",SDX=$$DIR^SCRPW23(.DIR,0) S:$L(SDX) SDPAR("F",2)=SDX
78 Q
79 ;
80F3 Q:$P(SDPAR("F",1),U)="S" K DIR D DIRB1^SCRPW23("F",3)
81 S DIR("A")="Select type of detail",DIR(0)="S^E:ENCOUNTER/VISIT/UNIQUE LIST;D:DIAGNOSIS/PROCEDURE RANKING;B:BOTH ACTIVITY & DX/PROC. LISTS",SDX=$$DIR^SCRPW23(.DIR,0) S:$L(SDX) SDPAR("F",3)=SDX D PFR^SCRPW29 Q
82 ;
83F4 Q:$P(SDPAR("F",1),U)="S" Q:"BE"'[$P(SDPAR("F",3),U)
84 K DIR D DIRB1^SCRPW23("F",4) S DIR("A")="List activity by",DIR(0)="S^E:ENCOUNTER;V:VISIT;U:UNIQUE",SDX=$$DIR^SCRPW23(.DIR,0) S:$L(SDX) SDPAR("F",4)=SDX D PFR^SCRPW29 Q
85 ;
86F5 Q:$P(SDPAR("F",1),U)="S" Q:"BD"'[$P(SDPAR("F",3),U) K DIR
87 W ! D DIRB1^SCRPW23("F",5,50) S DIR("A")="Limit Dx/procedure list to most frequent",DIR(0)="N^1:999:0",DIR("?")="Specify how many of the most frequent items to list.",SDX=$$DIR^SCRPW23(.DIR,0) S:$L(SDX) SDPAR("F",5)=SDX Q
88 ;
89F6 K DIR W ! D DIRB1^SCRPW23("F",6,"FORMATTED TEXT") S DIR("A")="Produce output as",DIR(0)="S^F:FORMATTED TEXT;D:DELIMITED VALUES FOR EXPORT TO SPREADSHEET",SDX=$$DIR^SCRPW23(.DIR,0) S:$L(SDX) SDPAR("F",6)=SDX Q
90 ;
91P1 K DIR,SDPAR("X") D DIRB1^SCRPW23("P",1) S DIR("A")="Select report perspective",DIR("?")="Specify the element to be used for report subtotals." S SDNUL=0,SDS1="P",SDS2=1 D CAT^SCRPW22($S(SDREV:"E",1:"A")) Q:SDOUT
92 Q
93 ;
94L1 N %DT,SDS1 D SUBT^SCRPW50("*** Date Range Selection ***")
95FDT W ! S %DT="AEPX",%DT("A")="Beginning date: ",%DT(0)="-TODAY" D DIRB1^SCRPW23("L",1) S:$D(DIR("B")) %DT("B")=DIR("B") D ^%DT I X=U!($D(DTOUT)) S SDOUT=1 Q
96 G:Y<1 FDT K:Y>$G(SDPAR("L",2)) SDPAR("L",2) S SDS1=Y X ^DD("DD") S SDPAR("L",1)=SDS1_U_Y
97LDT W ! S %DT("A")=" Ending date: " D DIRB1^SCRPW23("L",2) S:$D(DIR("B")) %DT("B")=DIR("B") D ^%DT I X=U!($D(DTOUT)) S SDOUT=1 Q
98 I Y<$P(SDPAR("L",1),U) W !!,$C(7),"Ending date must be after beginning date!" G LDT
99 S SDS1=Y X ^DD("DD") S SDPAR("L",2)=SDS1_U_Y Q
100 ;
101L2 I SDREV D AED^SCRPW22("L") Q
102L2A S SDS1="L",SDS2=$O(SDPAR(SDS1,""),-1),SDNUL=0 F Q:SDOUT!SDNUL S SDS2=SDS2+1 D:'$D(SDPAR(SDS1,SDS2)) L3
103 Q
104L3 S SDX="Select "_$S(SDS2=3:"additional",1:"another")_" output limiting factor: (optional)" W !!?(80-$L(SDX)\2),$$XY(IORVON),SDX,$$XY(IORVOFF) D LDIR,CAT^SCRPW22("A") Q
105 ;
106LDIR K DIR S DIR("A")="Select limiting factor",DIR("?")="Specify elements to be used to restrict the scope of data returned." Q
Note: See TracBrowser for help on using the repository browser.