source: FOIAVistA/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNPRT02.m@ 940

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1SPNPRT02 ;HIRMFO/WAA- PRINT Patient Listing ; 8/21/96
2 ;;2.0;Spinal Cord Dysfunction;**1,12,13**;01/02/1997
3 ;
4EN1 ; Main Entry Point
5 S SPNC=0 ;Line counter
6 N SPNLEXIT,SPNIO
7 S SPNLEXIT=0 D EN1^SPNPRTMT Q:SPNLEXIT ;Filters
8 F SPNG="SPNAEREC","SPNAENXT","SPNETIOL","SPNETPV","SPNHLOI","SPNPCP","SPNDATOC","SPNPAGE","SPNC","SPNNAME","SPNDFN" S:$D(@SPNG) ZTSAVE(SPNG)=""
9 W !!,"### This report is designed for 132 column viewing/printing ###"
10 W !,"### Set your terminal display to 132 columns ###"
11 W !,"### For screen viewing, answer DEVICE prompt with 0;132 ###"
12 W !,"### For file capture, answer DEVICE prompt with 0;132;9999 ###"
13 W !,"### For a hardcopy, answer with a 132 column printer or subtype ###",!
14 D DEVICE^SPNPRTMT("PRINT^SPNPRT02","SCD Patient Listing",.ZTSAVE) Q:SPNLEXIT
15 I SPNIO="Q" D EXIT Q ; Print was Queued
16 I IO'="" D PRINT D EXIT Q ; Print was not Queued
17 Q
18EXIT ; Exit routine
19 K ^TMP($J,"SPN"),^TMP($J,"SPNPRT","AUTO"),^TMP($J,"SPNPRT","POST")
20 K SPNAEREC,SPNAENXT,SPNHLOI,SPNANS,SPNDATOC,SPNNAME,SPNPCP,SPNC,SPNETIOL,SPNETPV,VA,VAEL,VADM,ZTSAVE
21 K SPNDFN,SPNG,SPNLPRT,SPNLEXIT
22 Q
23PRINT ; Print main Body
24 U IO
25 K ^TMP($J,"SPN")
26 S SPNLEXIT=$G(SPNLEXIT) ; Ensure that the exit is set
27 N SPNDFN,SPNX
28 W !,"Patient Listing",?55,"Date: ",$$FMTE^XLFDT($$NOW^XLFDT,"5DZP"),!
29 W !,$$REPEAT^XLFSTR("-",132)
30 W !,"Patient",?14,"SSN",?27,"DOB",?40,"Eligibility",?57,"Means",?67,"LOI",?72,"Prov.",?78,"Etiology",?97,"Date Occ",?110,"AE Receivd",?122,"AE Next"
31 W !,$$REPEAT^XLFSTR("-",132)
32 S (SPNDFN,SPNLPRT)=0
33 F S SPNDFN=$O(^SPNL(154,SPNDFN)) Q:SPNDFN<1 D Q:SPNLEXIT
34 . Q:SPNLEXIT
35 . Q:$G(^SPNL(154,SPNDFN,0))="" ; No Zero node
36 . I '$$EN2^SPNPRTMT(SPNDFN) Q ; Patient fail the filters
37 . S DFN=SPNDFN D DEM^VADPT
38 . S ^TMP($J,"SPN",VADM(1),SPNDFN)="" ; Sort the data
39 . D KVAR^VADPT
40 . Q
41 I $D(^TMP($J,"SPN")) D Q:SPNLEXIT ; Indicates the report had data
42 . S SPNNAME="" F S SPNNAME=$O(^TMP($J,"SPN",SPNNAME)) Q:SPNNAME="" Q:SPNLEXIT S SPNDFN=0 F S SPNDFN=$O(^TMP($J,"SPN",SPNNAME,SPNDFN)) Q:SPNDFN<1 D Q:SPNLEXIT
43 .. I $E(IOST,1)="C",(IOSL<26) S SPNC=SPNC+1 I SPNC=22 R !!,"Enter RETURN to continue or '^' to exit: ",SPNANS:DTIME
44 .. I $G(SPNANS)="^" S SPNLEXIT=1
45 .. I SPNC=22 S SPNC=0
46 .. D PATIENT(SPNDFN)
47 .. Q
48 . Q
49 E W !," ******* No Data for this report. *******"
50 I $E(IOST,1)="C" N DIR S DIR(0)="E" D ^DIR K Y
51 D CLOSE^SPNPRTMT
52 K ^TMP($J,"SPN")
53 Q
54PATIENT(SPNDFN) ;PRINT PATIENT DATA
55 ;INPUT:
56 ; SPNFDFN = patient DFN
57 ;
58 N SPNX
59 S DFN=SPNDFN D DEM^VADPT D ELIG^VADPT ; Get patient data
60 S SPNHLOI=$$GET^DDSVAL(154,SPNDFN,2.1,"","E")
61 S SPNPCP=$$GET^DDSVAL(154,SPNDFN,8.1,"","E")
62 ;--- get etiol data
63 S SPNETPV="" S SPNETPV=$S($D(^SPNL(154,SPNDFN,"E",1,0)):$P(^SPNL(154,SPNDFN,"E",1,0),U,1),1:10) ; Etiol pointer value - 'OTHER' if missing
64 S SPNETIOL="" S SPNETIOL=$P(^SPNL(154.03,SPNETPV,0),U,1)
65 S SPNDATOC=$S($D(^SPNL(154,SPNDFN,"E",1,0)):$P(^SPNL(154,SPNDFN,"E",1,0),U,2),1:"") ; etiol date of occurance
66 ;--- get annual eval data
67 S D0=SPNDFN
68 D REC^SPNEVAL S SPNAEREC=X
69 D NEXT^SPNEVAL S SPNAENXT=X
70 W !,$E(VADM(1),1,12),?14,VA("PID"),?27,$P(VADM(3),U,2),?40,$E($P(VAEL(1),U,2),1,15),?57,$E($P(VAEL(8),U,2),1,8),?67,SPNHLOI
71 W ?72,$E(SPNPCP,1,5),?78,$E(SPNETIOL,1,18),?97,$$FMTE^XLFDT(SPNDATOC,"5DZP"),?110,$$FMTE^XLFDT(SPNAEREC,"5DZP"),?122,$$FMTE^XLFDT(SPNAENXT,"5DZP")
72 D KVAR^VADPT ; Clean up VA Stuff
73 Q
Note: See TracBrowser for help on using the repository browser.