source: FOIAVistA/tag/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPORIP.m@ 1700

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1RMPORIP ;(NG)/DG/CAP/HINES CIOFO/HNC -INACTIVE HOME OXYGEN PATIENTS ; 5/18/00 9:35am
2 ;;3.0;PROSTHETICS;**29,49**;Feb 09, 1996
3 ;
4SITE ; Initialize site variables
5 D HOSITE^RMPOUTL0 Q:'$D(RMPOXITE)
6 ;
7FROM ; Ask starting date/oldest inactive date
8 K DIR S DIR(0)="D^^^P"
9 S DIR("A")="Start at INACTIVATION DATE"
10 S DIR("B")="T-180"
11 S DIR("?")="Enter the earliest INACTIVATION DATE to report on."
12 D ^DIR G:$D(DTOUT)!$D(DUOUT) EXIT
13 W " ("_Y(0)_")"
14 S FRMDT=Y,FDT=Y(0)
15 ;
16TO ; Ask ending/newest inactivation date
17 K DIR S DIR(0)="D^^^P"
18 S DIR("A")="Ending INACTIVATION DATE"
19 S DIR("B")="T"
20 S DIR("?")="Enter the latest INACTIVATION DATE to report on."
21 D ^DIR G EXIT:$D(DTOUT),FROM:$D(DUOUT)
22 W " ("_Y(0)_")",!
23 ;
24 I Y<FRMDT D G TO
25 . W !,"Ending date must NOT be earlier than "_FDT_".",!
26 S TODT=Y,TDT=Y(0)
27 ;
28LI ; List the sought patients
29 K DA,DASH S (COUNT,PAGE,RMEND,RMPORPT,L)=0
30 S $P(DASH,"-",79)=""
31 D NOW^%DTC S Y=% X ^DD("DD")
32 S RPTDT=$P(Y,"@",1)_" "_$P($P(Y,"@",2),":",1,2)
33 ;
34 S DIC="^RMPR(665,",BY="[RMPO-RPT-HOINACTIVE]"
35 S FR=","_$$DATE(FRMDT),TO=","_$$DATE(TODT)
36 S DIS(0)="I $P($G(^RMPR(665,D0,""RMPOA"")),U,7)=RMPOXITE"
37 S DHD="W ?0 D RPTHDR^RMPORIP"
38 S DIOEND="I $G(Y)'[U W !!,?53,""TOTAL PATIENTS: "",$J(COUNT,6) S RMEND=1 S:IOST[""P-"" RMPORPT=1"
39 S FLDS=".01;C1;L20;""PATIENT"",D SSN^RMPORIP W X;C22;R4;""SSN"",D SDT^RMPORIP W X;C28;L10;""START"""
40 S FLDS(2)="D EDT^RMPORIP W X;C40;L10;""INACTIVE"",D IREA^RMPORIP W X;C52;L29;""REASON"""
41 D EN1^DIP
42 I RMPORPT=0,$G(RMEND) K DIR S DIR(0)="E" D ^DIR
43 ;
44EXIT K ^TMP($J) N RMPR,RMPRSITE D KILL^XUSCLEAN
45 Q
46 ;
47 ;*** CONVERT DATE FROM FILEMAN FORMAT TO MM/DD/YYYY
48DATE(FMD) ;
49 Q $E(FMD,4,5)_"/"_$E(FMD,6,7)_"/"_($E(FMD,1,3)+1700)
50 ;
51EDT ;*** INACTIVATION DATE
52 S X=$P($G(^RMPR(665,D0,"RMPOA")),U,3) S:X X=$$DATE(X)
53 Q
54 ;
55IREA ;*** INACTIVE REASON
56 I $D(^RMPR(665,D0,"RMPOA")) D
57 . N RMMSG S X=$P(^RMPR(665,D0,"RMPOA"),U,4)
58 . S X=$$EXTERNAL^DILFD(665,19.6,"",X,"RMMSG")
59 E S X=""
60 Q
61 ;
62RPTHDR ;*** REPORT HEADER
63 N RA S RA=RMPO("NAME"),PAGE=PAGE+1
64 W RPTDT,?(40-($L(RA)/2)),RA,?68,"Page: "_PAGE
65 W !?18,"Inactive Home Oxygen Patients",!
66 W !?13,"Date Range: ",FDT," to ",TDT,!
67 W !,"Patient",?21,"SSN",?28,"Active",?40,"Inactive",?51,"Inactive Reason"
68 W !,"===================",?21,"====",?27,"==========",?39,"========== ========================",!
69 Q
70 ;
71SDT ;*** GET START DATE (USE INITIAL OXYGEN RX DATE)
72 S X=$P($G(^RMPR(665,D0,"RMPOA")),U,2) S:X X=$$DATE(X)
73 Q
74 ;
75SSN ;*** GET SSN
76 K VA,VADM
77 S DFN=D0 D ^VADPT
78 S X=$P(VA("PID"),"-",3)
79 S:X'="" COUNT=COUNT+1
80 Q
Note: See TracBrowser for help on using the repository browser.