source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOPTPST.m@ 660

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

revised back to 6/30/08 version

File size: 4.6 KB
Line 
1PSOPTPST ;BIR/DSD - Post Patient Selection Action ;07/25/96
2 ;;7.0;OUTPATIENT PHARMACY;**7,71,88,146,157,143**;DEC 1997
3 ;External reference to SDCO22 supported by DBIA 1579
4 ;External reference to IBE(350.1,"ANEW" supported by DBIA 592
5 ;External reference to PS(55 supported by DBIA 2228
6 ;External reference to IBARX supported by DBIA 125
7START S PSOQFLG=0
8 D GET ; Gets data from Patient file
9 D DEAD G:PSOQFLG END ; Checks to see if patient still alive
10 G:$G(PSOFROM("PTLKUP"))']"" END ; skips questions if not called by RX data entry
11 D INP G:PSOQFLG END ;Checks to see if inpatient and whether to continue
12 D CNH G:PSOQFLG END ; Checks to see if nursing home patient
13 D ELIG ; Checks eligibility
14 D:$G(DUZ("AG"))="V" COPAY ; Deals with copay
15 D ADDRESS ; Display address information
16 D:$G(^PS(55,PSODFN,1))]"" REMARKS ; Displays narrative about patient
17END D EOJ
18 Q
19 ;----------------------------------------------------------
20GET K DIC,DR,DIQ S DIC=2,DA=PSODFN,DR=".1;.172;.351;.361;148",DIQ="PSOPTPST"
21 D EN^DIQ1 K DIC,DA,DR,DIQ
22 Q
23 ;
24DEAD ;
25 I $G(PSOPTPST(2,PSODFN,.351))]"" S (PSODEATH,PSOQFLG)=1 S SSN=$P(^DPT(PSODFN,0),"^",9) W !?10,$C(7),PSORX("NAME")_" ("_$E(SSN,1,3)_"-"_$E(SSN,4,5)_"-"_$E(SSN,6,9)_") DIED "_PSOPTPST(2,PSODFN,.351),! S:$G(POERR) POERR("DEAD")=1 D
26 .;I '$O(^PS(55,PSODFN,"P","A",DT)) Q
27 .S ACOM="Date of Death "_PSOPTPST(2,PSODFN,.351)_".",ZTRTN="CAN^PSOCAN3",ZTDESC="Outpatient Pharmacy Autocancel Due to Death of Patient",ZTSAVE("ACOM")="",ZTSAVE("PSODFN")="",ZTSAVE("PSODEATH")=""
28 .S ZTIO="",PSOCLC=DUZ,ZTSAVE("PSOCLC")="",ZTDTH=$H D ^%ZTLOAD K ACOM,ZTSK,PSODEATH
29 Q
30 ;
31INP I '$G(PSOXFLG),'$G(PSOFIN),$G(PSOPTPST(2,PSODFN,.1))]"" S PSOXFLG=1,SSN=$P(^DPT(PSODFN,0),"^",9) W !!?10,$C(7),PSORX("NAME")_" ("_$E(SSN,1,3)_"-"_$E(SSN,4,5)_"-"_$E(SSN,6,9)_")" K SSN
32 I $G(PSOPTPST(2,PSODFN,.1))]"" W !?10,$C(7),"Patient is an Inpatient on Ward "_PSOPTPST(2,PSODFN,.1)_" !!" D DIR
33 Q
34TPB ;
35 N PSOTPSSN
36 I '$G(PSODFN) Q
37 I $D(^PS(52.91,PSODFN,0)) I '$P(^PS(52.91,PSODFN,0),"^",3)!($P(^(0),"^",3)>DT) D
38 .S PSOTPSSN=$P($G(^DPT(PSODFN,0)),"^",9)
39 .I $G(PSOFIN)!($G(MEDP)) D
40 ..I $G(MEDP) W !!?10,$C(7),$P($G(^DPT(PSODFN,0)),"^")_" ("_$E(PSOTPSSN,1,3)_"-"_$E(PSOTPSSN,4,5)_"-"_$E(PSOTPSSN,6,9)_")" Q
41 ..I $G(PSOFIN) I $G(PSOPTPST(2,PSODFN,148))="YES"!($G(PSOPTPST(2,PSODFN,.1))]"") W !!?10,$C(7),$P($G(^DPT(PSODFN,0)),"^")_" ("_$E(PSOTPSSN,1,3)_"-"_$E(PSOTPSSN,4,5)_"-"_$E(PSOTPSSN,6,9)_")"
42 .I '$G(PSOFIN),'$G(MEDP) W !
43 .W !?10,"Patient is eligible for the Transitional Pharmacy Benefit!!" D DIR
44 Q
45 ;
46CNH I $G(MEDP),$G(PSOPTPST(2,PSODFN,148))="YES",$G(PSOPTPST(2,PSODFN,.1))']"" D
47 .S SSN=$P(^DPT(PSODFN,0),"^",9) W !!?10,$C(7),PSORX("NAME")_" ("_$E(SSN,1,3)_"-"_$E(SSN,4,5)_"-"_$E(SSN,6,9)_")" K SSN
48 K PSORX("CNH") I $G(PSOPTPST(2,PSODFN,148))="YES" W !?10,$C(7),"Patient is in a Contract Nursing Home !!" D DIR S:'$G(PSOQFLG) PSORX("CNH")=1
49 Q
50 ;
51ELIG I $G(PSOPTPST(2,PSODFN,.361))]"",$G(PSOPTPST(2,PSODFN,.172))'="I" W !,"MAS Eligibility: "_PSOPTPST(2,PSODFN,.361)
52 S DFN=PSODFN D RE^PSODEM
53 Q
54 ;
55COPAY K PSOBILL,PSOCPAY S DFN=PSODFN,(X,PSOPTIB)=$P($G(^PS(59,+PSOSITE,"IB")),"^")_"^"_PSODFN D XTYPE^IBARX
56 I '$D(^IBE(350.1,"ANEW",+PSOPTIB,1,1)) S PSOQFLG=1 D K PSOPTIB Q
57 .W $C(7),!!,"There is a problem with the IB SERVICE/SECTION entry in your Pharmacy Site File."
58 .W !,"You will not be able to enter any new prescriptions until this is corrected!",!
59 S (ACTYP,BL)="",(PSOBILL,PSOCPAY)=0 I +Y=-1 W !,"ERROR IN COPAY ELIGIBILITY ENCOUNTERED." G COPAYX
60COPAY1 S ACTYP=$O(Y(ACTYP)) G:'ACTYP COPAYX F III=0:0 S BL=$O(Y(ACTYP,BL)) Q:BL="" I BL>0 S PSOBILL=BL,PSOCPAY=BL_"^"_Y(ACTYP,BL)
61 G COPAY1
62COPAYX K X,Y,ACTYP,BL,III,PSOPTIB
63 ;I $G(PSOBILL)
64 D QST
65 Q
66 ;
67ADDRESS N DFN S (DA,DFN)=PSODFN D ADD^VADPT K DFN,PSOI,DA,DR
68 Q
69 ;
70REMARKS S PSOX=$G(^PS(55,PSODFN,1)) W !!,?5
71 F PSOI=1:1 Q:$P(PSOX," ",PSOI,900)="" W:$X+$L($P(PSOX," ",PSOI))+$L(" ")>IOM !?5 W $P(PSOX," ",PSOI)_" "
72 K PSOX,PSOI
73 Q
74 ;
75DIR K DIR W !
76 S DIR(0)="Y",DIR("B")="NO",DIR("A")="Do You Want To Continue" D ^DIR K DIR
77 S:'Y PSOQFLG=1 K X,Y,DIRUT,DTOUT,DUOUT
78 Q
79 ;
80EOJ K:PSOQFLG PSORX("CNH") K PSOPTPST,VAPA
81 Q
82QST ;Ask new questions for Copay
83 I '$$DT^PSOMLLDT Q
84 K PSOIBQS
85 I $G(PSOBILL) S PSOIBQS(PSODFN,"SC")=""
86 S PSOIBQS(PSODFN,"SC>50")=""
87 I +$P($$CVEDT^DGCV(PSODFN),"^",3) S PSOIBQS(PSODFN,"CV")=""
88 I $$AO^SDCO22(PSODFN) S PSOIBQS(PSODFN,"VEH")=""
89 I $$IR^SDCO22(PSODFN) S PSOIBQS(PSODFN,"RAD")=""
90 I $$EC^SDCO22(PSODFN) S PSOIBQS(PSODFN,"PGW")=""
91 I $P($$GETSTAT^DGMSTAPI(PSODFN),"^",2)="Y" S PSOIBQS(PSODFN,"MST")=""
92 I $T(GETCUR^DGNTAPI)]"" N PSONCP,PSONCPX S PSONCPX=$$GETCUR^DGNTAPI(PSODFN,"PSONCP") I $P($G(PSONCP("IND")),"^")="Y" S PSOIBQS(PSODFN,"HNC")=""
93 Q
Note: See TracBrowser for help on using the repository browser.