source: FOIAVistA/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNPRT08.m@ 1470

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

initial load of FOIAVistA 6/30/08 version

File size: 3.2 KB
Line 
1SPNPRT08 ;HIRMFO/WAA,SD/AB- PRINT OUTCOME SCORES ;5/12/98
2 ;;2.0;Spinal Cord Dysfunction;**6,19**;01/02/1997
3 ;;
4EN1(SPNTEMP,SPNTYPE) ; Main Entry Point
5 ; SPNTEMP = The name of the print template to use.
6 ; SPNTYPE = The type of report
7 ; SPNTEMP SPNTYPE
8 ;---------- -------
9 ;SPN PRINT SELF 1
10 ;SPN PRINT FIM 2
11 ;SPN PRINT OUT 4
12 ;SPN PRINT MS 8
13 S U="^"
14 S SPNPICK=0
15 I SPNTYPE=4 D PICK Q:'+SPNPICK
16 ; Select patient
17 N SPNLEXIT,SPNDFN,SPNIO,SPNPAGE,SPNDATE S SPNPAGE=1
18 S (SPNLEXIT,SPNDFN)=0
19 D PAT^SPNPATUL(.SPNDFN)
20 I $O(SPNDFN(""))="" S SPNLEXIT=1
21 Q:SPNLEXIT
22 I $D(SPNDFN("ALL")) K SPNDFN S SPNDFN=0
23 I SPNDFN=0 D EN1^SPNPRTMT Q:SPNLEXIT ; Do Filters selection if no pat
24 I IO'="" D PRINT,EXIT Q ; Print was not Queued
25 Q
26EXIT ; Exit routine
27 K ^TMP($J,"SPN"),^TMP($J,"SPNPRT","AUTO"),^TMP($J,"SPNPRT","POST")
28 K SPNDATE,SPNHOLD,SPNNODE,SPNPICK
29 Q
30PRINT ; Print main Body
31 W !,"One Moment Please..."
32 K ^TMP($J,"SPN")
33 S SPNLEXIT=$G(SPNLEXIT,0) ; Ensure that the exit is set
34 N SPNX,SPNPRT
35 S SPNPAGE=1
36 S (SPNLPRT,SPNPRT)=0
37 Q:SPNLEXIT
38 I 'SPNDFN D
39 .N SPNDFN1
40 .S SPNDFN1=0
41 .F S SPNDFN1=$O(^SPNL(154.1,"AA",SPNTYPE,SPNDFN1)) Q:SPNDFN1<1 D
42 .. I 'SPNDFN,'$$EN2^SPNPRTMT(SPNDFN1) Q ; Patient fail the filters
43 .. D PPAT Q:SPNLEXIT
44 .. Q
45 .Q
46 E D
47 .S SPNDFN1=0
48 .F S SPNDFN1=$O(SPNDFN(SPNDFN1)) Q:SPNDFN1<1 D PPAT Q:SPNLEXIT
49 .Q
50 I 'SPNPRT W !," ******* No Data for this report. *******"
51 ;I $E(IOST,1)="C" N DIR S DIR(0)="E" D ^DIR K Y
52 E D PATIENT
53 Q
54PPAT ; print patient data
55 N SPNDATE S SPNDATE=0
56 F S SPNDATE=$O(^SPNL(154.1,"AA",SPNTYPE,SPNDFN1,SPNDATE)) Q:SPNDATE<1 D Q:SPNLEXIT
57 .N SPNIEN S SPNIEN=0
58 .F S SPNIEN=$O(^SPNL(154.1,"AA",SPNTYPE,SPNDFN1,SPNDATE,SPNIEN)) Q:SPNIEN<1 D Q:SPNLEXIT
59 .. S ^TMP($J,"SPN",SPNIEN)=""
60 .. S SPNPRT=SPNPRT+1 W:'(SPNPRT#10) "."
61 .. Q
62 . Q
63 Q
64PATIENT ; Print Patient data
65 N DIC,FLDS,BY,FROM,TO
66 S DIC="^SPNL(154.1,",FLDS="["_SPNTEMP_"]"
67 S BY=.01,BY(0)="^TMP($J,""SPN"",",(FR,TO)=""
68 S L=0,L(0)=1
69 S DHD="@"
70 S SPNNODE=$S(SPNPICK=1:"CHART",SPNPICK=2:"FAM",SPNPICK=3:"SCORE",SPNPICK=4:"SCORE",1:0)
71 I SPNPICK=1 S DIS(0)="I $D(^SPNL(154.1,D0,SPNNODE))"
72 I SPNPICK=2 S DIS(0)="I $D(^SPNL(154.1,D0,SPNNODE))"
73 S DHIT="R SPNHOLD:DTIME S:SPNHOLD[U SPNLEXIT=1 Q:SPNLEXIT W:$D(IOF) @IOF"
74 D EN1^DIP
75 Q
76ROWCHK ;-- Called from SPN PRINT FIM print template, 5/12/98
77 N X,DX,DY
78 ;-- Check for existence of ^UTILITY($J,"H",1), quit it doesn't exist
79 ;-- (this should ensure that FM variable DN exists)
80 Q:'$D(^UTILITY($J,"H",1))
81 I $P($G(IOST),"-")["C" D
82 .W !!
83 .R "Press Enter key to continue...",X:$S(+$G(DTIME)>0:DTIME,1:60)
84 .W:$D(IOF) @IOF
85 .S (DX,DY)=0 X ^%ZOSF("XY")
86 .I X["^" S DX=0,DY=IOSL X ^%ZOSF("XY") S DN=0
87 .Q
88 Q
89PICK ; pick Record Type of CHART, FAM, DIENER, or DUSOI
90 W !!,?12,"1 CHART"
91 W !,?12,"2 FAM"
92 W !,?12,"3 DIENER"
93 W !,?12,"4 DUSOI",!
94 R !,"Pick an Outcome report from above list: ",SPNPICK:DTIME
95 I '$T!(SPNPICK[U)!(SPNPICK="") Q
96 I SPNPICK["?" W !!,"Enter a number from 1-4, indicating the Outcome report tp print." G PICK
97 I SPNPICK<1!(SPNPICK>4) W *7,!!,"Enter a number from 1-4." G PICK
98 S SPNTYPE=$S(SPNPICK=1:4,SPNPICK=2:5,SPNPICK=3:6,SPNPICK=4:7,1:4)
99 S SPNTEMP=$S(SPNPICK=1:"SPN PRINT OUT",SPNPICK=2:"SPN PRINT FAM",SPNPICK=3:"SPN PRINT DIE",SPNPICK=4:"SPN PRINT DUS",1:"SPN PRINT OUT")
100 Q
Note: See TracBrowser for help on using the repository browser.