source: FOIAVistA/tag/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPRFO1.m@ 1641

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

initial load of FOIAVistA 6/30/08 version

File size: 3.7 KB
Line 
1RMPRFO1 ;PHX/RFM,HPL-DRIVER FOR PROSTHETIC LETTERS ;3/17/03 12:19
2 ;;3.0;PROSTHETICS;**8,44,77,105**;Feb 09, 1996
3 ;RVD 3/17/03 patch #77 - remove link to suspense from letter module.
4NAME ;
5 S RMPRNAME=$P(RMPRNAME," ",1,2)
6 I $P(VADM(5),U)["M" S ^TMP($J,1,16,0)="|TAB|"_"Dear Mr. "_RMPRNAME_":"
7 E S ^TMP($J,1,16,0)="|TAB|"_"Dear Ms. "_RMPRNAME_":"
8 S RV=18 F RI=0:0 S RI=$O(^RMPR(665.2,RMPRFA,1,RI)) Q:RI'>0 Q:^(RI,0)'=" "
9 S RI=RI-1 F S RI=$O(^RMPR(665.2,RMPRFA,1,RI)) Q:RI'>0 S TAB=$S($P(^RMPR(665.2,RMPRFA,1,RI,0),U)["|TAB|":"",1:"|TAB|") S ^TMP($J,1,RV,0)=TAB_^(0),RV=RV+1
10EDIT S DIC="^TMP($J,1," D EN^DIWE S RMPRFLAG=1
11EDIT1 S %=1 W !,"Do you wish to view this letter" D YN^DICN
12 S RMPRAA68=% I RMPRAA68<0 G EXIT^RMPRFO1
13 I RMPRAA68=0 W !,"Answer `YES` to view the letter, `NO` to not" G EDIT1
14 I RMPRAA68=1 S RMPRFFL=1 G:$G(RMPRPRIN)'="" PRINT S RMPRPRIN=1 G SET^RMPRFO2
15ASK ;
16 S %=1 W !,"Do you wish to accept this letter" D YN^DICN
17 S RMPRAA68=% I RMPRAA68<0 G EXIT^RMPRFO1
18 I RMPRAA68=0 W !,"Answer `YES` or `NO`" G ASK
19 I RMPRAA68=2 G ASK2
20 K RMPRFFL G:$D(RMPRPRIN) PRINT G SET^RMPRFO2
21ASK2 ;DECIDES TO KEEP EDITING LETTER OR DELETE IT
22 ; ALREADY SAID NOT TO ACCEPT LETTER
23 S %=2 W !,"Do you wish to Delete this letter" D YN^DICN
24 S RMPRAA68=% I RMPRAA68=1!(RMPRAA68<0) D Q
25 .I $G(RMPRIN)'>0 W $C(7),!!,?35,"Letter Deleted..." D EXIT^RMPRFO1 Q
26 .I $D(^RMPR(665.4,RMPRIN,0)) D DEL^RMPRFO1
27 .W $C(7),!!,?35,"Deleted..." H 1 Q
28 I RMPRAA68=0 W !,"Enter `YES` to Delete this letter" G ASK2
29 G EDIT
30EN2 ;PRINT/DELETE A LETTER
31 K DIC D DIV4^RMPRSIT I $D(Y),(Y<0) G EXIT
32 D HOME^%ZIS S DIC=2,DIC(0)="AEQMZ",DIC("A")="Select PATIENT: "
33DICW ;CHOOSE THE LETTER TO PRINT
34 ;S DIC("W")="S (RMPRDFN,DFN)=+Y" D ^DIC K DIC G:Y<0 EXIT
35 D ^DIC K DIC G:Y<0 EXIT S (RMPRDFN,DFN)=+Y
36 D EN^RMPRUTL2 Q:RMPRIN=-1 S:$G(RMPRIN)>0 DA=RMPRIN
37 Q:$G(DA)<1 Q:$G(DA)="" S RMPRIN=DA
38 Q:$G(RMPRIN)'>0 S RMPRTY=$P(^RMPR(665.4,RMPRIN,0),U,2) L +^RMPR(665.4,RMPRIN,0):1 I $T=0 W !,?5,$C(7),"Someone else is Editing this entry!" G EXIT
39 G:$D(RMPRDELE) DEL
40 S DA=RMPRIN,ITMFLG=0 S:$D(^RMPR(665.4,DA,3,0)) ITMFLG=$P(^RMPR(665.4,DA,3,0),U,4) S:ITMFLG>4 ITMFLG=1
41 S ITM=RMPRIN
42 I $P(^RMPR(665.2,RMPRTY,0),U,3) D PRNT1^RMPRFO3 K RMPRTY,DA,ITM,ITMFLG D EXIT^RMPRFO3 G EXIT
43PRINT ;VIEW LETTER
44 I $G(RMPRIN)'>0 Q:$G(RMPRDA)'>0 S RMPRIN=RMPRDA
45 S DFN=$P(^RMPR(665.4,RMPRIN,0),U)
46 S RMPRTY=$P(^RMPR(665.4,RMPRIN,0),U,2)
47 S RMPR1=^RMPR(665.2,RMPRTY,0)
48 I $P(^RMPR(665.2,RMPRTY,0),U,3) S DA=RMPRIN K RMPR1 G PRNT1^RMPRFO3
49 S DIC="^RMPR(665.4,",RMPRPG=0,DHD="[RMPR BLANK]-[RMPR PAGE]"
50 S BY="@NUMBER",FR=RMPRIN,TO=RMPRIN,FLDS="3",L=0,PG=2
51 D EN1^DIP I '$D(POP) S POP=0
52 I POP,$D(RMPRFFL) S RMPRGO=$S($D(^RMPR(665.4,RMPRIN,0)):"DEL^RMPRFO1",1:"EXIT^RMPRFO1") D @RMPRGO W ?9," Deleted..." G EXIT
53 ;I '$D(RMPRFFL),'$D(RNSK) S RMPRDFN=DFN D LINK^RMPRS G EXIT
54 ;I 'POP,'$D(RMPRFFL),'$D(RNSK) S RMPRDFN=DFN K DIR S DIR(0)="E" W ! D ^DIR,LINK^RMPRS G EXIT
55VI I $D(RMPRFFL) R !!,"Enter `return` to continue: ",X:DTIME G:'$T EXIT I X'="" W $C(7),!,"You may only enter `return` here.." G VI
56 I $D(RMPRFFL) S DIE="^RMPR(665.4,",DA=RMPRIN,DR=3,DIE("NO^")="" D ^DIE G:$D(DTOUT)!($D(DUOUT)) EXIT G EDIT1
57EXIT ;common exit point
58 L:$D(RMPRIN) -^RMPR(665.4,RMPRIN,0)
59 K ^TMP($J,1),^TMP($J,"RMPR")
60 K %X,RMPRFFL,RMPRHED,RMPRPRIN,%Y,RMPRDEL,RMPRRVA,DIC,RMPRFA,KILL,DIE,DA,DR,DIK,RMPR1,RMPR2,RMPRDATE,RMPRIN,RMPRL,RMPRNAME,RMPRU,RMPRDELE,FR,RI,RV
61 I '$D(RMPRCOMB)!('$D(RMPRFF)) K RMPREND,VADM,VAPA,VA,NAME,RMPRGO,NAME1,RMPRDEN,RMPRFLAG,RMPRNAM1,RMPRNAM2,RMPRFF,J,RP,RO,RZ D KVAR^VADPT
62 D ^%ZISC Q
63DEL I $D(RMPRDELE) S %=2 W !,"Are you sure you want to delete this letter" D YN^DICN S RMPRAA68=% I RMPRAA68=0 W !,"Answer `YES` to Delete the letter, `NO` to exit" G DEL
64 I $D(RMPRDELE),(RMPRAA68<0!(RMPRAA68=2)) G EXIT
65 S DIK="^RMPR(665.4,",DA=RMPRIN D ^DIK G EXIT
Note: See TracBrowser for help on using the repository browser.