source: FOIAVistA/tag/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPOLET1.m@ 1550

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

initial load of FOIAVistA 6/30/08 version

File size: 2.7 KB
Line 
1RMPOLET1 ;EDS/PAK - HOME OXYGEN LETTERS ;7/24/98
2 ;;3.0;PROSTHETICS;**29**;Feb 09, 1996
3 ;
4PRINT(ANS) ; print listing of patient letters to be generated.
5 S %ZIS="Q" D ^%ZIS Q:POP=1
6 I $D(IO("Q")) D Q:'$$QUEUE("RMPO : Patient Letter List","START^RMPOLET1",.ZTSAVE) D HOME^%ZIS Q
7 . K ZTSAVE S (ZTSAVE("^TMP($J,"),ZTSAVE("RMPOXITE"),ZTSAVE("ANS"),ZTSAVE("LTRX("))=""
8 ;
9START ;
10 N ANSW,NAME,LINE,SP
11 ;
12 S $P(LINE,"-",80)="",$P(SP," ",80)=" "
13 ; Get letter code description
14 S RMPOLCD="" F S RMPOLCD=$O(LTRX("A",RMPOLCD)) Q:RMPOLCD="" S HEAD(RMPOLCD)=$$EXTERNAL^DILFD(669.965,1,"",RMPOLCD)
15 ;
16 U IO(0) S ANSW=""
17 I "Aa"[ANS S RMPOLCD=0 F S RMPOLCD=$O(^TMP($J,"RMPOLST",RMPOLCD)) Q:RMPOLCD="" D
18 . D HEADER
19 . S RMPODFN="" F S RMPODFN=$O(^TMP($J,"RMPOLST",RMPOLCD,RMPODFN)) Q:RMPODFN=""!(ANSW="^") D LINE
20 E S RMPOLCD=ANS,RMPODFN="" F S RMPODFN=$O(^TMP($J,"RMPOLST",RMPOLCD,RMPODFN)) Q:RMPODFN=""!(ANSW="^") D LINE
21 Q:ANS="^"
22 I IOST["C-" R !?20,"Enter <RETURN> to continue",ANSW:DTIME Q:'$T
23 Q
24 ;
25LINE ;
26 N REC
27 ;
28 S RMPOLTR=^TMP($J,"RMPOLST",RMPOLCD,RMPODFN),LTR=$P(^RMPR(665.2,RMPOLTR,0),U)
29 S REC=^TMP($J,"RMPODEMO",RMPODFN)
30 S RMPOITEM=$P(REC,U,5) S:RMPOITEM="" RMPOITEM="No Primary!"
31 W !,$E($P(REC,U),1,27),?28,$P(REC,U,2),?41,$E(RMPOITEM,1,12)
32 S Y=$P(REC,U,3) D DD^%DT W ?54,Y
33 S Y=$P(REC,U,4)
34 I Y'="" D DD^%DT
35 I Y="" S Y="No Rx!"
36 W ?68,Y
37 ;
38 D UPDLTR^RMPOLET0(RMPODFN,LTR) ; update "letter to be sent"
39 ;
40 I IOST["C-",($Y+6)>IOSL W !!?20,"Enter <RETURN> to continue or '^' to quit" R ANSW:DTIME S:'$T!(ANSW="^") ANSW="^" D:ANSW'="^" HEADER
41 Q
42HEADER ;
43 N TITLE
44 ;
45 S TITLE="'"_HEAD(RMPOLCD)_"' letter Patient List"
46 W @IOF,!,$E(SP,1,(80-$L(TITLE)/2))_TITLE,!!,"Name",?28,"SSN",?41,"Primary Item",?54,"Activation",?68,"Expiry Date",!,?54,"Date",!,LINE
47 Q
48DELETE ;deletes patient from the batch printing list
49 Q:'$$SITE^RMPOLET0
50 ;
51 ; attempt to lock virtual letter print record
52 L +^TMP("RMPO",$J,"LETTERPRINT"):0
53 I '$T W !,"You may delete after listing and before printing." H 3 D EXIT Q
54 ;
55 ;
56GLTR ;ask for patients letter to be deleted from printing
57 N STA,Y,DA
58 ;
59 S RMPOLTR=""
60 F S RMPOLTR=$O(^RMPR(665,"ALTR",RMPOLTR)) Q:RMPOLTR="" D Q:'$G(RMPODFN)
61 . S DA=$$GPAT
62 . D:DA UPDLTR^RMPOLET0(DA,"@")
63 D EXIT
64 Q
65 ;
66GPAT() ; select only patinet with specified letters pending
67 S DIC("S")="I $D(^RMPR(665,""ALTR"","_RMPOLTR_",Y))"
68 S DIC="^RMPR(665,",DIC(0)="QEAM"
69 S DIC("A")="Enter the patient to delete from printing: "
70 D ^DIC K DIC I Y'>0 Q 0
71 S RMPODFN=$P(Y,U)
72 Q RMPODFN
73EXIT ;
74 L -^TMP("RMPO",$J,"LETTERPRINT")
75 D ^%ZISC
76 W !!,"DONE !!"
77 K DIC,RMPO,DEL
78 Q
79 ;
80QUEUE(ZTDESC,ZTRTN,ZTSAVE) ; Queue print
81 D ^%ZTLOAD
82 I '$D(ZTSK) W !!,?5,"Report Cancelled!",! Q 0
83 E W !!,?5,"Print queued!",! Q 1
84 Q
Note: See TracBrowser for help on using the repository browser.