source: WorldVistAEHR/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNPRT11.m@ 824

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

initial load of WorldVistAEHR

File size: 4.5 KB
Line 
1SPNPRT11 ;SD/CM- PRINT EXPANDED INFORMATIONAL PT LIST ; 07/31/02
2 ;;2.0;Spinal Cord Dysfunction;**12,13,15,16,19**;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="SPNC","SPNDFN","SPNAEREC","SPNETIOL","SPNETPV","SPNHLOI","SPNPCP","SPNDATOC","SPNPVA","SPNNTWK","SPNREG" S:$D(@SPNG) ZTSAVE(SPNG)=""
9 W !!,"### This report is designed for importing into a spreadsheet ###"
10 W !,"### Turn OFF line wrap. Capture file as raw text ###"
11 W !,"### For file capture, answer DEVICE prompt with 0;255;9999 ###"
12 W !,"### File will import into spreadsheet, 1 patient per row ###",!
13 D DEVICE^SPNPRTMT("PRINT^SPNPRT11","SCD Expanded Patient Listing",.ZTSAVE) Q:SPNLEXIT
14 I SPNIO="Q" D EXIT Q ; Print was Queued
15 I IO'="" D PRINT D EXIT Q ; Print was not Queued
16 Q
17EXIT ; Exit routine
18 K ^TMP($J,"SPN"),^TMP($J,"SPNPRT","AUTO"),^TMP($J,"SPNPRT","POST")
19 K SPNAEREC,SPNAEOFF,SPNHLOI,SPNANS,SPNDATOC,SPNG,SPNNAME,SPNPCP,SPNPVA,SPNNTWK,SPNREG,SPNC,SPNPH,SPNLPRT,SPNPVAPV,SPNETIOL,SPNETPV,ZTSAVE
20 Q
21PRINT ; Print main Body
22 U IO
23 K ^TMP($J,"SPN")
24 S SPNLEXIT=$G(SPNLEXIT) ; Ensure that the exit is set
25 N SPNDFN,SPNX
26 W !,"Expanded Patient List",?55,"Date: ",$$FMTE^XLFDT($$NOW^XLFDT,"5DZP"),!
27 W !,$$REPEAT^XLFSTR("-",253)
28 W !,"Patient",?14,"SSN",?27,"Home Phone",?40,"NtWk",?46,"Reg Status",?58,"Street Address 1",?86,"Str Addr 2",?97,"City",?113,"St",?116,"Zip"
29 W ?123,"County",?143,"Eligibility",?160,"Last AE Offrd",?175,"Last AE Recvd",?190,"Primary VA",?202,"Provider",?211,"SCI Level",?221,"Etiology",?241,"Date of Onset"
30 W !,$$REPEAT^XLFSTR("-",253)
31 S (SPNDFN,SPNLPRT)=0
32 F S SPNDFN=$O(^SPNL(154,SPNDFN)) Q:SPNDFN<1 D Q:SPNLEXIT
33 . Q:SPNLEXIT
34 . Q:$G(^SPNL(154,SPNDFN,0))="" ; No Zero node
35 . I '$$EN2^SPNPRTMT(SPNDFN) Q ; Patient fail the filters
36 . S DFN=SPNDFN D DEM^VADPT,ADD^VADPT
37 . S ^TMP($J,"SPN",VADM(1),SPNDFN)="" ; Sort the data
38 . D KVAR^VADPT
39 . Q
40 I $D(^TMP($J,"SPN")) D Q:SPNLEXIT ; Indicates the report had data
41 . 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
42 .. I $E(IOST,1)="C",(IOSL<26) S SPNC=SPNC+1 I SPNC=22 R !!,"Enter RETURN to continue or '^' to exit: ",SPNANS:DTIME
43 .. I $G(SPNANS)="^" S SPNLEXIT=1
44 .. I SPNC=22 S SPNC=0
45 .. D PATIENT(SPNDFN)
46 .. Q
47 . Q
48 E W !," ******* No Data for this Report *******"
49 I $E(IOST,1)="C" N DIR S DIR(0)="E" D ^DIR K Y
50 D CLOSE^SPNPRTMT
51 K ^TMP($J,"SPN")
52 Q
53PATIENT(SPNDFN) ;PRINT PATIENT DATA
54 ;INPUT:
55 ; SPNFDFN = patient DFN
56 ;
57 N SPNX
58 S DFN=SPNDFN D DEM^VADPT,ADD^VADPT D ELIG^VADPT ; Get patient data
59 S SPNNTWK=$$GET^DDSVAL(154,SPNDFN,1.1,"","E")
60 S SPNREG=$$GET^DDSVAL(154,SPNDFN,.03,"","E")
61 S SPNHLOI=$$GET^DDSVAL(154,SPNDFN,2.1,"","E")
62 S SPNPCP=$$GET^DDSVAL(154,SPNDFN,8.1,"","E")
63 S SPNPVAPV=$S($D(^SPNL(154,SPNDFN,3)):$P(^SPNL(154,SPNDFN,3),U,2),1:"") ; Primary Care VA pointer value
64 S SPNPVA="" S SPNPVA=$S(SPNPVAPV'="":$P($G(^DIC(4,SPNPVAPV,0)),U,1),1:"")
65 ;--- get etiol data
66 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
67 S SPNETIOL="" S SPNETIOL=$P(^SPNL(154.03,SPNETPV,0),U,1)
68 S SPNDATOC=$S($D(^SPNL(154,SPNDFN,"E",1,0)):$P(^SPNL(154,SPNDFN,"E",1,0),U,2),1:"") ; etiol date of occurance
69 ;--- get annual eval data
70 S D0=SPNDFN
71 D OFFER^SPNEVAL S SPNAEOFF=X
72 D REC^SPNEVAL S SPNAEREC=X
73 S SPNPH=VAPA(8)
74 S SPNPH=$TR($G(SPNPH),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ()[];*?")
75 I $L(SPNPH)=7,SPNPH?7N S SPNPH=$E(SPNPH,1,3)_"-"_$E(SPNPH,4,7)
76 I $L(SPNPH)=10,SPNPH?10N S SPNPH=$E(SPNPH,1,3)_"-"_$E(SPNPH,4,6)_"-"_$E(SPNPH,7,10)
77 I $L(SPNPH)=11,$E(SPNPH,7)="-" S SPNPH=$E(SPNPH,1,3)_"-"_$E(SPNPH,4,11)
78 I $L(SPNPH)=11,$E(SPNPH,4)="-" S SPNPH=$E(SPNPH,1,7)_"-"_$E(SPNPH,8,11)
79 I $L(SPNPH)=14,$E(SPNPH,1,2)="1-" S SPNPH=$E(SPNPH,3,14)
80 W !,$E(VADM(1),1,12),?14,VA("PID"),?27,$S(SPNPH'="":$E(SPNPH,1,12),1:""),?40,SPNNTWK,?46,$E(SPNREG,1,10),?58,$S(VAPA(1)'="":$E(VAPA(1),1,28),1:"")
81 W ?86,$S(VAPA(2)'="":$E(VAPA(2),1,10),1:""),?97,$S(VAPA(4)'="":VAPA(4),1:""),?113,$S(VAPA(5)'="":$P($G(^DIC(5,$P(VAPA(5),U,1),0)),U,2),1:"")
82 W ?116,$S(VAPA(6)'="":VAPA(6),1:""),?123,$P(VAPA(7),U,2),?143,$E($P(VAEL(1),U,2),1,15),?160,$$FMTE^XLFDT(SPNAEOFF,"5DZP"),?175,$$FMTE^XLFDT(SPNAEREC,"5DZP"),?190,$E(SPNPVA,1,10),?202,$E(SPNPCP,1,6),?211,SPNHLOI
83 W ?221,$E(SPNETIOL,1,18),?241,$$FMTE^XLFDT(SPNDATOC,"5DZP")
84 D KVAR^VADPT ; Clean up VA Stuff
85 Q
Note: See TracBrowser for help on using the repository browser.