Changeset 636 for FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP
- Timestamp:
- Dec 4, 2009, 8:26:01 PM (15 years ago)
- Location:
- FOIAVistA/tag/r
- Files:
-
- 98 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOBINGO.m
r628 r636 1 PSOBINGO ;BHAM ISC/LC - BINGO BOARD OPTION DRIVER ; 8/1/07 1:45pm2 ;;7.0;OUTPATIENT PHARMACY;**12,28,56,125,152,232,268 ,275**;DEC 1997;Build 81 PSOBINGO ;BHAM ISC/LC - BINGO BOARD OPTION DRIVER ;1/18/06 9:09am 2 ;;7.0;OUTPATIENT PHARMACY;**12,28,56,125,152,232,268**;DEC 1997;Build 9 3 3 ;External Ref. to ^PS(55 is supp. by DBIA# 2228 4 4 ;External Ref. to ^PSDRUG(, is supp. by DBIA# 221 5 5 ; 6 ;*232 add ATIC xref set/kill code here 7 ;*275 BA xref sometimes gets corrupted, kill bad BA xref and quit 6 ;PSO*7*232 add ATIC xref set/kill code here 8 7 ; 9 8 S (FLAG,FLAG1)=0,(TRIPS,JOES,ADV,DGP)="" G:'$G(PSOAP) END D:'$D(PSOPAR) ^PSOLSET G:'$D(PSOPAR) END … … 85 84 FIRST ;Set 1st dup 86 85 S DR="11////A" D ^DIE K DR,CNT 87 BROW S DA=SDA,NOPE=0,CNT=0 88 F NIEN=0:0 S NIEN=$O(^PS(52.11,"BA",NAM,NIEN)) Q:'NIEN!(NIEN=$G(DA)) D Q:NOPE 89 . ;add check for bad xref and kill *275 90 . I '$D(^PS(52.11,NIEN,0)) K ^PS(52.11,"BA",NAM,NIEN) Q 91 . D:$D(^PS(52.11,"BI")) BICK Q:CNT>0 92 . D SETNEW 86 BROW S DA=SDA,NOPE=0,CNT=0 F NIEN=0:0 S NIEN=$O(^PS(52.11,"BA",NAM,NIEN)) Q:'NIEN!(NIEN=$G(DA)) D:$D(^PS(52.11,"BI")) BICK Q:CNT>0 D SETNEW Q:NOPE 93 87 Q 94 88 SETNEW S SSN1=$O(^PS(52.11,"BA",NAM,NIEN,0)),ADFN=$P(^PS(52.11,NIEN,0),"^"),CNT=1 I SSN1=SSN S NOPE=1 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOBPSU1.m
r628 r636 1 1 PSOBPSU1 ;BIRM/MFR - BPS (ECME) Utilities 1 ;10/15/04 2 ;;7.0;OUTPATIENT PHARMACY;**148,260 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**148,260**;DEC 1997;Build 84 3 3 ;Reference to $$EN^BPSNCPDP supported by IA 4415 4 4 ;References to $$NDCFMT^PSSNDCUT,$$GETNDC^PSSNDCUT supported by IA 4707 … … 45 45 I $$NDCFMT^PSSNDCUT($G(NDC))="" D 46 46 . S NDC=$$GETNDC^PSSNDCUT($$GET1^DIQ(52,RX,6,"I"),$$RXSITE^PSOBPSUT(RX,RFL),+$G(CMOP)) 47 . I $G(NDC)'="" D SAVNDC^PSONDCUT(RX,RFL,NDC,+$G(CMOP) ,1)47 . I $G(NDC)'="" D SAVNDC^PSONDCUT(RX,RFL,NDC,+$G(CMOP)) 48 48 ; 49 49 ; - Creating ECME Activity Log on the PRESCRIPTION file … … 63 63 I $G(RVTX)="",FROM="ED" S RVTX="RX EDITED" 64 64 S RESP=$$EN^BPSNCPDP(RX,RFL,$$DOS(RX,RFL,.DATE),FROM,NDC,$G(RVTX),$G(OVRC),,$G(CLA),$G(PA)) 65 I $$STATUS^PSOBPSUT(RX,RFL)="E PAYABLE" D SAVNDC^PSONDCUT(RX,RFL,NDC,+$G(CMOP),1)66 65 ; 67 66 ; - Reseting the Re-transmission flag … … 70 69 ; - Logging ECME Activity Log to the PRESCRIPTION file 71 70 I $G(ALTX)="" D 72 . N X,ROUTE S (ROUTE,X)="" 73 . S ROUTE=$S(FROM="RF":$$GET1^DIQ(52.1,RFL_","_RX_",",2),FROM="OF":$$GET1^DIQ(52,RX_",",11),1:"") 74 . S:FROM="OF" X=ROUTE_" FILL(NDC:"_$$GETNDC^PSONDCUT(RX,RFL)_")" 75 . S:FROM="RF" X=ROUTE_" REFILL(NDC:"_$$GETNDC^PSONDCUT(RX,RFL)_")" 71 . N X S X="" 72 . S:FROM="OF" X="WINDOW FILL(NDC:"_$$GETNDC^PSONDCUT(RX,RFL)_")" 73 . S:FROM="RF" X="WINDOW REFILL(NDC:"_$$GETNDC^PSONDCUT(RX,RFL)_")" 76 74 . S:FROM="RN" X="RX RENEWED(NDC:"_$$GETNDC^PSONDCUT(RX,RFL)_")" 77 . S:FROM="PL" X=" PRINTED FROM SUSPENSE(NDC:"_$$GETNDC^PSONDCUT(RX,RFL)_")"75 . S:FROM="PL" X="SUSP LABEL PRINTED(NDC:"_$$GETNDC^PSONDCUT(RX,RFL)_")" 78 76 . S:FROM="PE"!(FROM="PP") X="PULLED FROM SUSPENSE(NDC:"_$$GETNDC^PSONDCUT(RX,RFL)_")" 79 77 . S:FROM="PC" X="CMOP TRANSMISSION(NDC:"_$$GETNDC^PSONDCUT(RX,RFL)_")" -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOBPSUT.m
r628 r636 1 1 PSOBPSUT ;BIRM/MFR - BPS (ECME) Utilities ; 07 Jun 2005 8:39 PM 2 ;;7.0;OUTPATIENT PHARMACY;**148,247,260 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**148,247,260**;DEC 1997;Build 84 3 3 ;Reference to $$ECMEON^BPSUTIL supported by IA 4410 4 4 ;Reference to IBSEND^BPSECMP2 supported by IA 4411 … … 26 26 ; 27 27 ; - Get the REFILL # (multiple IEN) 28 N STATUS29 28 I '$D(RFL) S RFL=$$LSTRFL^PSOBPSU1(RX) 30 29 ; - Not the latest fill for the prescription 31 30 I RFL'=$$LSTRFL^PSOBPSU1(RX) Q 0 32 ; - Status not ACTIVE, DISCONTINUED, or EXPIRED 33 S STATUS=$$GET1^DIQ(52,RX,100,"I") 34 I STATUS'=0&(STATUS'=11)&(STATUS'=12) Q 0 31 ; - Status not ACTIVE 32 I $$GET1^DIQ(52,RX,100,"I")'=0 Q 0 35 33 ; Will suspend for CMOP 36 34 I '$G(IGCMP),$$CMOP(RX,RFL) Q 0 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOBUILD.m
r628 r636 1 PSOBUILD ;IHS/DSD/JCM - BUILD ARRAY OF PATIENTS CURRENT MEDS [ 07/15/96 5:25 PM ] ;6/21/07 8:20am2 ;;7.0;OUTPATIENT PHARMACY;**23,82,119,132,235 ,206**;DEC 1997;Build 391 PSOBUILD ;IHS/DSD/JCM - BUILD ARRAY OF PATIENTS CURRENT MEDS [ 07/15/96 5:25 PM ] 2 ;;7.0;OUTPATIENT PHARMACY;**23,82,119,132,235**;DEC 1997 3 3 ;External reference ^PS(50.606 supported by DBIA 2174 4 4 ;External reference ^PS(50.7 supported by DBIA 2223 … … 45 45 S PSODRG=+$P(PSORX0,"^",6) G:'$D(^PSDRUG(PSODRG,0)) GETX S PSODRUG0=^PSDRUG(PSODRG,0),PSOVACL=$P(PSODRUG0,"^",2),PSODYS=$P(PSORX0,"^",8) 46 46 ; 47 I PSOST0<12 !(PSOST0=16),PSOEXPDT<DT D:$P(PSORX0,"^",15)'=1147 I PSOST0<12,PSOEXPDT<DT D:$P(PSORX0,"^",15)'=11 48 48 .S PSOST0=11,$P(PSORX0,"^",15)=11 N DIE,DIC,DR,DA,PSOBEXDA S DIE=52,(DA,PSOBEXDA)=PSOBUILD("RX"),DR="100////11" D ^DIE K DIE,DIC,DR 49 49 .D ECAN^PSOUTL(DA) K DA … … 61 61 I $P($G(^PSDRUG(PSODRG,2)),"^",3)'["O" S PSOSTN=PSOSTN_"M" 62 62 S CLOZPT=$S($P($G(^PSDRUG(PSODRG,"CLOZ1")),"^")="PSOCLO1":1,1:0) 63 I 'CLOZPT, ($P(PSODRUG0,"^",3)["A")&($P(PSODRUG0,"^",3)'["B")S PSOSTN=PSOSTN_"B",PSOSTF=PSOSTF_"B"64 K CLOZPT I ($P(PSODRUG0,"^",3)["W")!($P(PSODRUG0,"^",3)[1)!($P(PSODRUG0,"^",3)[2)S PSOSTN=PSOSTN_"C"63 I 'CLOZPT,$P(PSODRUG0,"^",3)["A",$P(PSODRUG0,"^",3)'["B" S PSOSTN=PSOSTN_"B",PSOSTF=PSOSTF_"B" 64 K CLOZPT I $P(PSODRUG0,"^",3)["W" S PSOSTN=PSOSTN_"C" 65 65 I $D(^PS(53,+$P(PSORX0,"^",3),0)),'$P(^(0),"^",5) S PSOSTN=PSOSTN_"D" 66 66 I PSOST0=1 S PSOSTN=PSOSTN_"E" -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCAN2.m
r628 r636 1 1 PSOCAN2 ;BHAM ISC/JMB - modular rx cancel with speed ability drug check ; 10/23/06 11:30am 2 ;;7.0;OUTPATIENT PHARMACY;**8,18,62,46,88,164,235,148,259 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**8,18,62,46,88,164,235,148,259**;DEC 1997;Build 5 3 3 ;External reference to ^PSDRUG supported by dbia 221 4 4 REINS N DODR … … 30 30 . N ACTION 31 31 . D ECMESND^PSOBPSU1(RXIEN,,,$S($O(^PSRX(RXIEN,1,0)):"RF",1:"OF")) 32 . I $$FIND^PSOREJUT(RXIEN) S ACTION=$$HDLG^PSOREJU1(RXIEN,,"79,88","OF","IOQ"," Q")32 . I $$FIND^PSOREJUT(RXIEN) S ACTION=$$HDLG^PSOREJU1(RXIEN,,"79,88","OF","IOQ","I") 33 33 ; 34 34 W !?3,"Prescription #",RX," " -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCAN4.m
r628 r636 1 PSOCAN4 ;BIR/SAB-rx speed dc listman ; 10/23/06 11:50am 2 ;;7.0;OUTPATIENT PHARMACY;**20,24,27,63,88,117,131,259,268**;DEC 1997;Build 9 1 PSOCAN4 ;BIR/SAB-rx speed dc listman ; 11/3/06 9:50pm 2 ;;7.0;OUTPATIENT PHARMACY;**20,24,27,63,88,117,131,259,268,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External reference to File #200 supported by DBIA 224 4 20 ;External reference NA^ORX1 supported by DBIA 2186 … … 52 68 OK S ORD=SAVORD,ORN=SAVORN Q 53 69 NOOR ;ask nature of order 54 D FULL^VALM1 55 K DIR,DTOUT,DTOUT,DIRUT I $T(NA^ORX1)]"" D Q:$D(DIRUT) G NOORXP 56 .S PSONOOR=$$NA^ORX1("S",0,"B","Nature of Order",0,"WPSDIVR"_$S(+$G(^VA(200,DUZ,"PS")):"E",1:"")) 57 .I +PSONOOR S PSONOOR=$P(PSONOOR,"^",3) Q 58 .S DIRUT=1 K PSONOOR 59 S DIR("A")="Nature of Order: ",DIR("B")=$S($G(DODR):"SERVICE CORRECTED",1:"WRITTEN") 60 S DIR(0)="SA^W:WRITTEN;V:VERBAL;P:TELEPHONE;S:SERVICE CORRECTED;D:DUPLICATE;I:POLICY;R:SERVICE REJECTED"_$S(+$G(^VA(200,DUZ,"PS")):";E:PROVIDER ENTERED",1:"") 61 D ^DIR K DIR,DTOUT,DTOUT Q:$D(DIRUT) S PSONOOR=Y 70 ;vfah set nature of order automatically for autofinish,rx 71 I $G(PSOAFYN)'="Y" D FULL^VALM1 ;vfah 72 I $G(PSOAFYN)'="Y" K DIR,DTOUT,DTOUT,DIRUT I $T(NA^ORX1)]"" D Q:$D(DIRUT) G NOORXP ;vfah 73 .I $G(PSOAFYN)'="Y" S PSONOOR=$$NA^ORX1("S",0,"B","Nature of Order",0,"WPSDIVX"_$S(+$G(^VA(200,DUZ,"PS")):"E",1:"")) ;vfah 74 .I $G(PSOAFYN)'="Y" I +PSONOOR S PSONOOR=$P(PSONOOR,"^",3) Q ;vfah 75 .I $G(PSOAFYN)'="Y" S DIRUT=1 K PSONOOR ;vfah 76 I $G(PSOAFYN)'="Y" S DIR("A")="Nature of Order: ",DIR("B")=$S($G(DODR):"SERVICE CORRECTED",1:"WRITTEN") ;vfah 77 I $G(PSOAFYN)'="Y" S DIR(0)="SA^W:WRITTEN;V:VERBAL;P:TELEPHONE;S:SERVICE CORRECTED;D:DUPLICATE;I:POLICY;X:REJECTED"_$S(+$G(^VA(200,DUZ,"PS")):";E:PROVIDER ENTERED",1:"") 78 I $G(PSOAFYN)'="Y" D ^DIR K DIR,DTOUT,DTOUT Q:$D(DIRUT) S PSONOOR=Y ;vfah 79 I $G(PSOAFYN)="Y" S PSONOOR="S" ;vfah sets nature of order to service correction for autofinish,rx 80 ;vfah end of set nature of order 62 81 NOORXP I $G(PSOCANRA),'$G(PSOCANRZ) D REQ 63 82 NOORX S:$D(DIRUT)&($G(SPEED)) VALMBCK="Q" -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCMOP.m
r628 r636 1 PSOCMOP ;BIR/HTW-Rx Order Entry Screen for CMOP ; 6/28/07 7:35am2 ;;7.0;OUTPATIENT PHARMACY;**2,16,21,27,43,61,126,148 ,274**;DEC 1997;Build 81 PSOCMOP ;BIR/HTW-Rx Order Entry Screen for CMOP ;02/19/98 9:21 AM 2 ;;7.0;OUTPATIENT PHARMACY;**2,16,21,27,43,61,126,148**;DEC 1997 3 3 ;External reference to ^PS(55 supported by DBIA 2228 4 4 ;External reference to ^PSDRUG supported by DBIA 221 … … 79 79 D REVERSE^PSOBPSU1(RXN,,"DC",3) 80 80 Q 81 ACT S RXF=0 F I=0:0 S I=$O(^PSRX(DA,1,I)) Q:'I S RXF=I S:I>5 RXF=I+181 ACT I '$D(RXF) S RXF=0 F I=0:0 S I=$O(^PSRX(DA,1,I)) Q:'I S RXF=I S:I>5 RXF=I+1 82 82 S IR=0 F FDA=0:0 S FDA=$O(^PSRX(DA,"A",FDA)) Q:'FDA S IR=FDA 83 83 S IR=IR+1,^PSRX(DA,"A",0)="^52.3DA^"_IR_"^"_IR -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCPC.m
r628 r636 1 PSOCPC ;BHAM ISC/BAB - PHARMACY CO-PAY APPLICATION ; 7/13/07 10:21am2 ;;7.0;OUTPATIENT PHARMACY;**10,9,71,85,114,157,143,239,201 ,275**;DEC 1997;Build 81 PSOCPC ;BHAM ISC/BAB - PHARMACY CO-PAY APPLICATION ;06/09/92 2 ;;7.0;OUTPATIENT PHARMACY;**10,9,71,85,114,157,143,239,201**;DEC 1997 3 3 ; 4 4 ;REF/IA … … 79 79 . D ASKEXEM 80 80 I $D(PSOCHG) D 81 . ;PSO*7*275 IBQ node should not be present in some cases.82 . K ^PSRX(PSODA,"IBQ")83 81 . S:PSOSCP<50&($TR(PSOIBQ,"^")'="")&($P($G(^PS(53,+$G(PSOPATST),0)),"^",7)'=1) ^PSRX(PSODA,"IBQ")=PSOIBQ 84 82 . D RESET^PSORN52D ;set SC/EI on ICD node -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCSTM.m
r628 r636 1 PSOCSTM ;BHAM ISC/SAB - monthly rx cost compilation ; 7/10/06 4:36pm2 ;;7.0;OUTPATIENT PHARMACY;**4,17,19,28,89,212 ,246**;DEC 1997;Build 121 PSOCSTM ;BHAM ISC/SAB - monthly rx cost compilation ;9/14/05 1:13pm 2 ;;7.0;OUTPATIENT PHARMACY;**4,17,19,28,89,212**;DEC 1997 3 3 ;External Ref. to ^PS(55 DBIA# 2228 4 4 ;External Ref. to ^DPT DBIA# 10035 5 5 ;External Ref. to ^PSDRUG DBIA# 221 6 6 ; 7 ;*212 don't allow this request, if monthly compile is running 8 ;*246 alter SRCH1 For loop to not init to numeric values 7 ;PSO*212 don't allow this request, if monthly compile is running 9 8 ; 10 9 Q:$$MTHLCK(1) ;get lock, quit if already locked PSO*212 … … 33 32 Q 34 33 ; 35 SRCH1 D INI 36 ;refill 37 S PSDT1=PSDT ;*246 38 F S PSDT1=$O(^PSRX("AL",PSDT1)) Q:($E(PSDT1,1,7)<PSDT)!($E(PSDT1,1,7)>PSDTX) D 34 SRCH1 D INI F PSDT1=PSDT:0:PSDTX S PSDT1=$O(^PSRX("AL",PSDT1)) Q:'PSDT1!($E(PSDT1,1,7)>PSDTX) D 39 35 .S CDT=$P(PSDT1,".") F RXN=0:0 S RXN=$O(^PSRX("AL",PSDT1,RXN)) Q:'RXN S RXF="" F S RXF=$O(^PSRX("AL",PSDT1,RXN,RXF)) Q:RXF="" D CHK 40 36 .S NDT=$O(^PSRX("AL",PSDT1)) D:$P(NDT,".")'=CDT VST 41 ;partial fill 42 S PSDT1=PSDT ;*246 43 F S PSDT1=$O(^PSRX("AM",PSDT1)) Q:($E(PSDT1,1,7)<PSDT)!($E(PSDT1,1,7)>PSDTX) D 37 F PSDT1=PSDT:0:PSDTX S PSDT1=$O(^PSRX("AM",PSDT1)) Q:'PSDT1!($E(PSDT1,1,7)>PSDTX) D 44 38 .S CDT=$P(PSDT1,"."),RXN=0 F S RXN=$O(^PSRX("AM",PSDT1,RXN)) Q:'RXN S RXF=0 F S RXF=$O(^PSRX("AM",PSDT1,RXN,RXF)) Q:RXF="" S PAR=1 D CHK 45 39 .S NDT=$O(^PSRX("AM",PSDT1)) D:$P(NDT,".")'=CDT VST K PAR -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODEA.m
r628 r636 1 PSODEA ;BHAM ISC/ - HELP TEXT FOR DEA FIELD IN DRUG FILE ; 10/17/07 7:41am2 ;;7.0;OUTPATIENT PHARMACY; **206**;DEC 1997;Build 391 PSODEA ;BHAM ISC/ - HELP TEXT FOR DEA FIELD IN DRUG FILE ; 06/03/92 17:28 2 ;;7.0;OUTPATIENT PHARMACY;;DEC 1997 3 3 W !,"THE SPECIAL HANDLING CODE IS A 2 TO 6 POSTION FIELD. IF APPLICABLE,",!,"A SCHEDULE CODE MUST APPEAR IN THE FIRST POSITION. FOR EXAMPLE," 4 4 W !,"A SCHEDULE 3 NARCOTIC WILL BE CODED '3A' AND A SCHEDULE 2 DEPRESSANT",!,"WILL BE CODED '2L'. THE CODES ARE:",! … … 21 21 ;;R RESTRICTED ITEMS 22 22 ;;S SUPPLY ITEMS 23 ;;B ALLOW REFILL (SCH. 3, 4, 5 ONLY)23 ;;B ALLOW REFILL (SCH. 3, 4, 5 NARCOTICS ONLY) 24 24 ;;W NOT RENEWABLE 25 25 ;; 26 26 EDIT ;INPUT XFORM FOR DEA FIELD IN DRUG FILE 27 I X["B",(+X<3 ) W !,"The B designation is only valid for schedule 3, 4, 5!",$C(7) K X Q27 I X["B",(+X<3!(X'["A")) W !,"The B designation is only valid for schedule 3, 4, 5 narcotics !",$C(7) K X Q 28 28 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODGDGI.m
r628 r636 1 PSODGDGI ;BIR/SAB - drug drug interaction checker ; 6/28/07 7:36am2 ;;7.0;OUTPATIENT PHARMACY;**10,27,48,130,144,132,188,207,243 ,274**;DEC 1997;Build 81 PSODGDGI ;BIR/SAB - drug drug interaction checker ;4/14/93 2 ;;7.0;OUTPATIENT PHARMACY;**10,27,48,130,144,132,188,207,243**;DEC 1997;Build 22 3 3 ;External reference to ^PS(56 supported by DBIA 2229 4 4 ;External reference to ^PSDRUG supported by DBIA 221 … … 41 41 I +CRIT S PSODI=1,DIC="^PS(52.4,",DLAYGO=52.4,DIC(0)="L",(DINUM,X)=PSOX("IRXN"),DIC("DR")="1////"_PSODFN_";2////"_DUZ_";4///"_DT_";7///"_1_";7.1///"_SER_";7.2///"_DGI K DD,DO D FILE^DICN K DD,DO 42 42 S:$G(DGS)'="" $P(^PSRX(PSOX("IRXN"),"DRI"),"^")=SERS,$P(^PSRX(PSOX("IRXN"),"DRI"),"^",2)=DGS K PSODI,CRIT,DIC,DLAYGO,DINUM,DGI,DGS,SER,SERS Q 43 BLD I $D(^XUSEC("PSORPH",DUZ)) D PHARM Q43 BLD I $D(^XUSEC("PSORPH",DUZ)) S PSORX("PHARM")=DUZ D PHARM Q 44 44 S LSI=$P(^PSRX(+PSOSD(STA,DRG),0),"^")_"/"_$P(^PSDRUG($P(^(0),"^",6),0),"^")_","_LSI,DGI=$P(PSOSD(STA,DRG),"^")_","_DGI,SER=IT_","_SER I $P(PSOSD(STA,DRG),"^",9),$P(^PS(56,IT,0),"^",4)=1 S $P(^PSRX(+PSOSD(STA,DRG),"STA"),"^")=4 45 45 I $P(^PS(56,IT,0),"^",4)=2 S SERS=IT_","_SERS,DGS=$P(PSOSD(STA,DRG),"^")_","_DGS -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODIR.m
r628 r636 1 PSODIR ;BHAM ISC/SAB - asks data for rx order entry ; 9/17/07 5:03pm2 ;;7.0;OUTPATIENT PHARMACY;**37,46,111,117,146,164,211,264 ,275**;DEC 1997;Build 81 PSODIR ;BHAM ISC/SAB - asks data for rx order entry ;02/12/93 8:49 2 ;;7.0;OUTPATIENT PHARMACY;**37,46,111,117,146,164,211,264**;DEC 1997;Build 19 3 3 ;External reference PSDRUG( supported by DBIA 221 4 4 ;External reference PS(50.7 supported by DBIA 2223 … … 66 66 N DA K INS1,DD,DIR,DIRUT S D=0 F S D=$O(PSODIR("SIG",D)) Q:'D S DD=$G(DD)+1 67 67 I $G(DD)=1 S PSODIR("INS")=$G(PSODIR("SIG",1)) G INSD 68 ;PSO*7*275 remove check for PSOINSFL just check for multi line sig 69 I $G(DD)>1 D G EX 68 I ($G(PSOINSFL)=1&($G(DD)>1))!($G(PSOFDR)&($G(ORD))&($P($G(^PS(52.41,+$G(ORD),"EXT")),"^")'="")&($G(DD)>1)) D G EX 70 69 .K ^TMP($J) S D=0 F S D=$O(PSODIR("SIG",D)) Q:'D S ^TMP($J,"SIG",D,0)=PSODIR("SIG",D) 71 70 .S DWPK=2,DWLW=80,DIC="^TMP($J,""SIG""," D EN^DIWE K PSODIR("SIG") -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODIR1.m
r628 r636 1 PSODIR1 ;IHS/DSD - ASKS DATA FOR RX ORDER ENTRY CONT. ; 6/21/07 8:22am2 ;;7.0;OUTPATIENT PHARMACY;**23,46,78,102,121,131,146,166,184,222,268 ,206**;DEC 1997;Build 391 PSODIR1 ;IHS/DSD - ASKS DATA FOR RX ORDER ENTRY CONT. ;02/17/93 17:03 2 ;;7.0;OUTPATIENT PHARMACY;**23,46,78,102,121,131,146,166,184,222,268**;DEC 1997;Build 9 3 3 ;Ext ref ^PS(55-DBIA 2228, ^PSDRUG(-DBIA 221 4 4 PTSTAT(PSODIR) ; … … 109 109 .S PSOX=11,PSOX1=$S($P($G(PSODIR("PTST NODE")),"^",4)>PSOX:PSOX,1:$P($G(PSODIR("PTST NODE")),"^",4)),PSOX=$S(PSOX1=11:PSOX,1:PSOX1) 110 110 .S PSDY=PSODIR("DAYS SUPPLY"),PSDY1=$S(PSDY<60:11,PSDY'<60&(PSDY'>89):5,PSDY=90:3,1:0) S PSOX=$S(PSOX'>PSDY1:PSOX,1:PSDY1) 111 I '$D(CLOZPAT) I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F") !(PSODRUG("DEA")[1)!(PSODRUG("DEA")[2)D G REFILLX112 .I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")! (PSODRUG("DEA")[1)!(PSODRUG("DEA")[2)!'$O(^PSRX(+$G(PSODIR("IRXN")),1,0))!('$G(PSOLOKED)) D Q111 I '$D(CLOZPAT) I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F") D G REFILLX 112 .I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!'$O(^PSRX(+$G(PSODIR("IRXN")),1,0))!('$G(PSOLOKED)) D Q 113 113 ..S VALMSG="No refills allowed on "_$S(PSODRUG("DEA")["F":"this drug.",1:"Narcotics.") W !,VALMSG,! 114 114 ..S:$D(PSODIR("FIELD")) PSODIR("FIELD")=0 S PSODIR("# OF REFILLS")=0 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODIR3.m
r628 r636 1 PSODIR3 ;ISC-BIRM/SAB - rx order entry contd ; 4/25/07 8:28am2 ;;7.0;OUTPATIENT PHARMACY;**3,46,184,222 ,206**;DEC 1997;Build 391 PSODIR3 ;ISC-BIRM/SAB - rx order entry contd ;09/27/96 2 ;;7.0;OUTPATIENT PHARMACY;**3,46,184,222**;DEC 1997;Build 12 3 3 ; 4 4 EXP(PSODIR) ; … … 77 77 .S (PSOX,PSOMAX)=$S($G(CLOZPAT)=2&(PSODIR("DAYS SUPPLY")=14):1,$G(CLOZPAT)=2&(PSODIR("DAYS SUPPLY")=7):3,$G(CLOZPAT)=1&(PSODIR("DAYS SUPPLY")=7):1,$D(CLOZPAT):0,1:11) 78 78 .S PSDY=PSODIR("DAYS SUPPLY"),PSDY1=$S(PSDY<60:11,PSDY'<60&(PSDY'>89):5,PSDY=90:3,1:0) S PSOX=$S(PSOX'>PSDY1:PSOX,1:PSDY1) 79 K PSOELSE I '$D(CLOZPAT) I $G(PSODRUG("DEA"))["A"&($G(PSODRUG("DEA"))'["B")!($G(PSODRUG("DEA"))["F") !($G(PSODRUG("DEA"))[1)!($G(PSODRUG("DEA"))[2)D Q80 .S VALMSG="No refills allowed on "_$S($G(PSODRUG("DEA"))[" A":"this narcotic drug.",1:"this drug.")79 K PSOELSE I '$D(CLOZPAT) I $G(PSODRUG("DEA"))["A"&($G(PSODRUG("DEA"))'["B")!($G(PSODRUG("DEA"))["F") D Q 80 .S VALMSG="No refills allowed on "_$S($G(PSODRUG("DEA"))["F":"this drug.",1:"Narcotics ..") 81 81 .W !,VALMSG,! 82 82 .S:$D(PSODIR("FIELD")) PSODIR("FIELD")=0 S PSODIR("# OF REFILLS")=0 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODISP.m
r628 r636 1 1 PSODISP ;BIR/SAB,PWC-MANUAL BARCODE RELEASE FUNCTION ;03/02/93 2 ;;7.0;OUTPATIENT PHARMACY;**15,71,131,156,185,148,247,200**;DEC 1997;Build 7 2 ;;7.0;OUTPATIENT PHARMACY;**15,71,131,156,185,148,247,200,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;Reference to $$SERV^IBARX1 supported by DBIA 2245 4 20 ;Reference to ^PSD(58.8 supported by DBIA 1036 … … 14 30 S Y=$G(^PS(59,PSOSITE,"IB")),PSOIBSS=$$SERV^IBARX1(+Y) I 'PSOIBSS D IBSSR^PSOUTL I 'PSOIBFL D G EXIT 15 31 .W $C(7),!!,"The IB SERVICE/SECTION defined in your site parameter file is not valid.",!,"You will not be able to release any medication until this is corrected!",! 16 AC1 W !! S PSIN=+$P($G(^PS(59.7,1,49.99)),"^",2) 17 S DIC("S")="I $D(^XUSEC(""PSORPH"",+Y))",DIC("A")="Enter PHARMACIST: ",DIC="^VA(200,",DIC(0)="QEAM" D ^DIC G:"^"[X EXIT K DIC G:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!(Y=-1) EXIT S PSRH=+Y 32 AC1 I $G(PSOAFYN)'="Y" W !! S PSIN=+$P($G(^PS(59.7,1,49.99)),"^",2) ;vfah - VOE 33 I $G(PSOAFYN)="Y" S PSIN=+$P($G(^PS(59.7,1,49.99)),"^",2) ;vfah - VOE 34 I $G(PSOAFYN)'="Y" S DIC("S")="I $D(^XUSEC(""PSORPH"",+Y))",DIC("A")="Enter PHARMACIST: ",DIC="^VA(200,",DIC(0)="QEAM" D ^DIC G:"^"[X EXIT K DIC G:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!(Y=-1) EXIT S PSRH=+Y ;vfah - VOE 35 I $G(PSOAFYN)="Y" S PSRH=DUZ,PSZAR="0" ;vfah - VOE 18 36 ;check for Drug Acct background job K8 & K7.1 19 37 S X="PSA IV ALL LOCATIONS",DIC(0)="MZ",DIC=19.2 D ^DIC I Y=-1 K DIC,X,Y G BC … … 25 43 K PSA,DIC,DA,X,Y,DIQ 26 44 BC ; 45 I $G(PSOAFYN)="Y",$G(PSZAR)="1" Q ;vfah - VOE 27 46 K MAN I $G(RXP),$D(DISGROUP),$D(BINGNAM),($D(BINGDIV)!$D(BNGPDV)!$D(BNGRDV)),($D(BINGRO)!$D(BINGRPR)) D REL^PSOBING1 K BINGNAM,BINGDIV,BINGRO,BINGRPR,BNGPDV,BNGRDV 28 Q:$G(POERR) W !! K CMOP,ISUF,DIR,LBL,LBLP S DIR("A")="Enter/Wand PRESCRIPTION number",DIR("?")="^D HELP^PSODISP",DIR(0)="FO" D ^DIR 47 I $G(PSOAFYN)'="Y" Q:$G(POERR) W !! K CMOP,ISUF,DIR,LBL,LBLP S DIR("A")="Enter/Wand PRESCRIPTION number",DIR("?")="^D HELP^PSODISP",DIR(0)="FO" D ^DIR ;vfah - VOE 48 I $G(PSOAFYN)="Y" S X=RXN,PSZAR="1" ;vfah - VOE 29 49 I $D(DIRUT)!($D(DTOUT))!($D(DUOUT)) K DIRUT,DTOUT,DUOUT G AC1 30 50 I X'["-" D BCI W:'$G(RXP) !,"INVALID PRESCRIPTION NUMBER" G:'$G(RXP) BC S MAN=1 G BC1 … … 62 82 .I $$MANREL^PSOBPSUT(RXP,0,$G(PSOPID))="^" K LBLP Q 63 83 .; 64 .S:$D(^PSDRUG(QDRUG,660.1)) ^PSDRUG(QDRUG,660.1)=^PSDRUG(QDRUG,660.1)-QTY84 .S:$D(^PSDRUG(QDRUG,660.1))&($G(PSOAFYN)'="Y") ^PSDRUG(QDRUG,660.1)=^PSDRUG(QDRUG,660.1)-QTY ;vfah - VOE 65 85 .D NOW^%DTC S DIE="^PSRX(",DA=RXP,DR="31///"_%_";23////"_PSRH_";32.1///@;32.2///@",PSODT=% D ^DIE K DIE,DR,DA,LBL 66 86 .; … … 78 98 N BFILL S BFILL=0 79 99 S PSOCPRX=$P(^PSRX(RXP,0),"^") D CP^PSOCP 80 W !?7,"Prescription Number "_$P(^PSRX(RXP,0),"^")_" Released"100 I $G(PSOAFYN)'="Y" W !?7,"Prescription Number "_$P(^PSRX(RXP,0),"^")_" Released" ;vfah - VOE 81 101 ;initialize bingo board variables 82 102 I $G(LBLP),$P(^PSRX(RXP,0),"^",11)["W" S BINGRO="W",BINGNAM=$P(^PSRX(RXP,0),"^",2),BINGDIV=$P(^PSRX(RXP,2),"^",9) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODISPS.m
r628 r636 1 1 PSODISPS ;BIR/SAB-CONTINUATION OF RELEASE FUNCTION ;3/2/93 2 ;;7.0;OUTPATIENT PHARMACY;**15,13,9,27,67,71,156,118,148,247,200**;DEC 1997;Build 7 2 ;;7.0;OUTPATIENT PHARMACY;**15,13,9,27,67,71,156,118,148,247,200,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External reference ^PS(59.7 supported by DBIA 694 4 20 ;External reference to ^PSDRUG("AQ" supported by DBIA 3165 … … 39 55 .I $G(IFN),$P($G(^PSRX(RXP,XTYPE,IFN,0)),"^",2)["W" S BINGRPR="W",BNGPDV=$P(^PSRX(RXP,XTYPE,IFN,0),"^",9),BINGNAM=$P($G(^PSRX(RXP,0)),"^",2) 40 56 W:$G(IFN) !?7,"Prescription Number "_$P(^PSRX(RXP,0),"^")_$S('$G(XTYPE):" Partial Fill",1:" Refill(s)")_" Released" I $G(SPEED) G XMIT 41 W:'$G(IFN) !?7,"No "_$S($G(XTYPE):"Refill(s)",1:"Partial(s)")_" to be Released"57 I $G(PSOAFYN)'="Y" W:'$G(IFN) !?7,"No "_$S($G(XTYPE):"Refill(s)",1:"Partial(s)")_" to be Released" ;vfah - VOE 42 58 XMIT I $G(PSODISP)=2.4 D ;build an send HL7 v2.4 messages to dispense system 43 59 . F I=0:0 S SUB=$O(^PSRX(RXP,"A",I)) Q:'I I $P(^PSRX(RXP,"A",I,0),"^",2)="N" D -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODRDUP.m
r628 r636 1 1 PSODRDUP ;BIR/SAB - Dup drug class checker ;11/1/04 3:38pm 2 ;;7.0;OUTPATIENT PHARMACY;**11,23,27,32,39,56,130,132,192,207,222,243**;DEC 1997;Build 22 2 ;;7.0;OUTPATIENT PHARMACY;**11,23,27,32,39,56,130,132,192,207,222,243,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ; 4 20 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789 21 I $G(PSOAFYN)="Y" Q ;vfam No Dup Drug Check by AutoFinish,Rx - VOE 5 22 S $P(PSONULN,"-",79)="-",(STA,DNM)="" K CLS 6 23 F S STA=$O(PSOSD(STA)) Q:STA="" F S DNM=$O(PSOSD(STA,DNM)) Q:DNM=""!$G(PSORX("DFLG")) I $P(PSOSD(STA,DNM),"^")'=$G(PSORENW("OIRXN")) D Q:$G(PSORX("DFLG")) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODRG.m
r628 r636 1 1 PSODRG ;IHS/DSD/JCM-ORDER ENTRY DRUG SELECTION ;03/30/93 2 ;;7.0;OUTPATIENT PHARMACY;**20,23,36,53,54,46,112,139,207,148,243,268**;DEC 1997;Build 9 2 ;;7.0;OUTPATIENT PHARMACY;**20,23,36,53,54,46,112,139,207,148,243,268,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;Reference ^PSDRUG supported by DBIA 221 4 20 ;Reference ^PS(50.7 supported by DBIA 2223 … … 87 103 K NFI Q 88 104 POST ;order checks 105 I $G(PSOAFYN)="Y" G POSTX ;vfam - VOE 89 106 K PSORX("INTERVENE") N STAT,SIG,PTR,NDF,VAP S PSORX("DFLG")=0 90 107 D ^PSOBUILD -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOHELP.m
r628 r636 1 PSOHELP ;BHAM ISC/SAB-outpatient utility routine ; 10/17/07 7:41am2 ;;7.0;OUTPATIENT PHARMACY;**3,23,29,48,46,117,131,222,268 ,206**;DEC 1997;Build 391 PSOHELP ;BHAM ISC/SAB-outpatient utility routine ; 2/17/93 18:00:36 2 ;;7.0;OUTPATIENT PHARMACY;**3,23,29,48,46,117,131,222,268**;DEC 1997;Build 9 3 3 ;External reference ^PS(51 supported by DBIA 2224 4 4 ;External reference ^PSDRUG( supported by DBIA 221 … … 63 63 S PSODEA=$P(^PSDRUG(P(5),0),"^",3),CS=0 64 64 I $D(CLOZPAT) S MAX=$S(CLOZPAT=2&($P(^PSRX(DA,0),"^",8)=14):1,CLOZPAT=2&($P(^PSRX(DA,0),"^",8)=7):3,CLOZPAT=1&($P(^PSRX(DA,0),"^",8)=7):1,1:0),MIN=0 Q 65 I PSODEA["A"&(PSODEA'["B")!(PSODEA["F") !(PSODEA[1)!(PSODEA[2) D EN^DDIOL("No refills allowed on "_$S(PSODEA["A":"this narcotic drug.",1:"this drug."),"","!") D EN^DDIOL(" ","","!") S $P(^PSRX(DA,0),"^",9)=0 K X,Y,PSODEA,CS,PTST Q65 I PSODEA["A"&(PSODEA'["B")!(PSODEA["F") D EN^DDIOL("No refills allowed on "_$S(PSODEA["F":"this drug.",1:"Narcotics .."),"","!") D EN^DDIOL(" ","","!") S $P(^PSRX(DA,0),"^",9)=0 K X,Y,PSODEA,CS,PTST Q 66 66 F DEA=1:1 Q:$E(PSODEA,DEA)="" I $E(+PSODEA,DEA)>1,$E(+PSODEA,DEA)<6 S CS=1 67 67 S PSOELSE=CS I PSOELSE D -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOHELP3.m
r628 r636 1 1 PSOHELP3 ;BHAM ISC/SAB - outpatient utility routine #4 ;2/17/93 18:00:36 2 ;;7.0;OUTPATIENT PHARMACY;**20 ,291**;DEC 1997;Build 22 ;;7.0;OUTPATIENT PHARMACY;**20**;DEC 1997 3 3 XREF ;code to create 'APD' xref on Drug Interaction file (#56) 4 4 ;I '$D(ZTSK),'$D(PSMSG) D WAIT^DICD W "Building 'APD' X-Ref." … … 16 16 Q 17 17 DRUG ;selects drug and updates Rx file with cost (pso*7*20) 18 W !!,"This option will update the drug cost on all fills in the PRESCRIPTION"19 W !,"file (#52) based on the selected date range and the current cost in the"20 W !,"DRUG file (#50).",!21 18 K X,Y,DA,DIC S DIC(0)="AQEM",DIC=50 D ^DIC I $G(DUOUT) K DIC,Y,X,DA Q 22 19 I Y<0 G OUT 23 20 S (DRG,DA)=+Y K DIC,DR,DIQ S DIC=50,DR=16,DIQ="PSODRG",DIQ(0)="I" 24 21 D EN^DIQ1 S COST=PSODRG(50,DA,16,"I") K PSODRG,DIC,DA,DR,DIQ,DIR 25 W ! S DIR("A")="Do you want to exclude Refills and Partials",DIR(0)="Y",DIR("B")="No" D ^DIR K DIR I $G(DIRUT) K COST,X,DRG,Y Q 26 S REF=$S(Y:0,1:1) 27 S X1=DT,X2=-485 D C^%DTC S (DEF,Y)=X X ^DD("DD") 22 W ! S DIR("A")="Do you want to update cost on Refills and Partials too",DIR(0)="Y",DIR("B")="No" D ^DIR K DIR I $G(DIRUT) K COST,X,DRG,Y Q 23 S REF=$S(Y:Y,1:0),X1=DT,X2=-485 D C^%DTC S (DEF,Y)=X X ^DD("DD") 28 24 W !!,"You can only go back One Year plus 120 days." 29 S %DT(0)=DEF,%DT="AQEX",%DT("A")=" Enter starting fill date: ",%DT("B")=Y D ^%DT K %DT("B"),DEF I Y<0!($D(DTOUT)) K REF,COST,DRG,X,Y Q30 S (FBCK,%DT(0))=Y,%DT("A")=" Enter ending fill date: " D ^%DT25 S %DT(0)=DEF,%DT="AQEX",%DT("A")="How far BACK do you want to go: ",%DT("B")=Y D ^%DT K %DT("B"),DEF I Y<0!($D(DTOUT)) K REF,COST,DRG,X,Y Q 26 S (FBCK,%DT(0))=Y,%DT("A")="How far AHEAD do you want to go: " D ^%DT 31 27 K %DT I Y<0!($D(DTOUT)) K FBCK,REF,COST,DRG,X,Y Q 32 S FAHD=Y 33 S PSOFUTR=0 I FAHD>(DT-1) S PSOFUTR=1 D 34 .W !!,"Since you selected an end fill date of today or in the future, this option" 35 .W !,"will update the cost for all existing and suspended fills that have a" 36 .W !,"fill date in the future.",! 37 K DIR,X,Y S DIR(0)="Y",DIR("A")="Do you want to Queue to run at a specific Time",DIR("B")="Yes" D ^DIR K DIR I $D(DIRUT) G OUT 28 S FAHD=Y K DIR,X,Y S DIR(0)="Y",DIR("A")="Do you want to Queue to run at a specific Time",DIR("B")="Yes" D ^DIR K DIR I $D(DIRUT) G OUT 38 29 I Y S PSOQ=1 K ZTDTH D G OUT 39 30 .S ZTRTN="EN^PSOHELP3",ZTIO="",ZTDESC="Outpatient Pharmacy Rx Cost Update" 40 .F G="REF","COST","DRG","FBCK","FAHD","PSOQ","PSOFUTR" S:$D(@G) ZTSAVE(G)="" 41 .D ^%ZTLOAD I $D(ZTSK) W !!,"Rxs Cost Update Queued",! K ZTSK 42 EN W:'$G(PSOQ) !,"Updating cost. Please wait... " 43 S FDT=FBCK-1 F S FDT=$O(^PSRX("ADL",FDT)) Q:'FDT D Q:FDT>FAHD 44 .I '$G(PSOFUTR) I FDT>FAHD Q 45 .S RXN=0 F S RXN=$O(^PSRX("ADL",FDT,DRG,RXN)) Q:'RXN D W:'$G(PSOQ) "." 46 ..I $P($G(^PSRX(RXN,0)),"^",6)=DRG,$P($G(^(2)),"^",2)=FDT S $P(^PSRX(RXN,0),"^",17)=COST 47 I 'REF G OUT 48 D REFILL,PARTIAL 49 OUT K G,COST,I,X,Y,REF,RXN,FDT,FAHD,FBCK,DRG,PSOQ,DIRUT,PSOFUTR I $D(ZTQUEUED) S ZTREQ="@" 31 .F G="REF","COST","DRG","FBCK","FAHD","PSOQ" S:$D(@G) ZTSAVE(G)="" 32 .D ^%ZTLOAD I $D(ZTSK) W !,"Rxs Cost Update Queued" K ZTSK 33 EN W:'$G(PSOQ) ! S FDT=FBCK-1 F S FDT=$O(^PSRX("ADL",FDT)) Q:'FDT!(FDT>FAHD) F RXN=0:0 S RXN=$O(^PSRX("ADL",FDT,DRG,RXN)) Q:'RXN D W:'$G(PSOQ) "." 34 .I $P($G(^PSRX(RXN,0)),"^",6)=DRG,$P($G(^(2)),"^",2)=FDT S $P(^PSRX(RXN,0),"^",17)=COST 35 .Q:'REF 36 .F I=0:0 S I=$O(^PSRX(RXN,1,I)) Q:'I S $P(^PSRX(RXN,1,I,0),"^",11)=COST 37 .F I=0:0 S I=$O(^PSRX(RXN,"P",I)) Q:'I S $P(^PSRX(RXN,"P",I,0),"^",11)=COST 38 OUT K G,COST,I,X,Y,REF,RXN,FDT,FAHD,FBCK,DRG,PSOQ,DIRUT I $D(ZTQUEUED) S ZTREQ="@" 50 39 Q 51 40 POST ;post install entry point. builds new "ADL" xref for file 52 pso*7*20 … … 58 47 K X,Y,DEF,FTY,IFN S ZTREQ="@" 59 48 Q 60 REFILL ;61 N FILL,FDT,RXN62 S FDT=FBCK-1 F S FDT=$O(^PSRX("AD",FDT)) Q:'FDT D Q:FDT>FAHD63 .I '$G(PSOFUTR),FDT>FAHD Q64 .S RXN="" F S RXN=$O(^PSRX("AD",FDT,RXN)) Q:'RXN D65 ..I $P($G(^PSRX(RXN,0)),"^",6)'=DRG Q66 ..S FILL=0 F S FILL=$O(^PSRX("AD",FDT,RXN,FILL)) Q:'FILL I $D(^PSRX(RXN,1,FILL,0)) S $P(^(0),"^",11)=COST67 Q68 PARTIAL ;69 N FILL,FDT,RXN70 S FDT=FBCK-1 F S FDT=$O(^PSRX("ADP",FDT)) Q:'FDT D Q:FDT>FAHD71 .I '$G(PSOFUTR),FDT>FAHD Q72 .S RXN="" F S RXN=$O(^PSRX("ADP",FDT,RXN)) Q:'RXN D73 ..I $P($G(^PSRX(RXN,0)),"^",6)'=DRG Q74 ..S FILL=0 F S FILL=$O(^PSRX("ADP",FDT,RXN,FILL)) Q:'FILL I $D(^PSRX(RXN,"P",FILL,0)) S $P(^(0),"^",11)=COST75 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOHLD.m
r628 r636 1 1 PSOHLD ;BIR/SAB - hold unhold functionality ;07/15/96 2 ;;7.0;OUTPATIENT PHARMACY;**1,16,21,24,27,32,55,82,114,130,166,148,268 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**1,16,21,24,27,32,55,82,114,130,166,148,268**;DEC 1997;Build 9 3 3 ;External reference to ^DD(52-DBIA 999, VA(200-DBIA 224, NA^ORX1-DBIA 2186, 4 4 ; L, UL, PSOL, and PSOUL^PSSLOCK-DBIA 2789, ^%DTC-DBIA 10000, ^DIE-DBIA 10018, ^DIR-DBIA 10026, … … 50 50 . D ECMESND^PSOBPSU1(RX,RFL,,$S(RFL:"RF",1:"OF")) 51 51 . I $$FIND^PSOREJUT(RX,RFL) D 52 . . S ACTION=$$HDLG^PSOREJU1(RX,RFL,"79,88","ED","IOQ"," Q")52 . . S ACTION=$$HDLG^PSOREJU1(RX,RFL,"79,88","ED","IOQ","I") 53 53 ; 54 54 I $G(PSORX("PSOL",1))']"" S PSORX("PSOL",1)=DA_"," D ULP G EX -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOHLEXP.m
r628 r636 1 PSOHLEXP ;BIR/RTR-Auto expire prescriptions ; 10/10/07 11:16am 2 ;;7.0;OUTPATIENT PHARMACY;**10,22,36,73,148,257**;DEC 1997;Build 19 1 PSOHLEXP ;BIR/RTR-Auto expire prescriptions ;10/10/96 2 ;;7.0;OUTPATIENT PHARMACY;**10,22,36,73,148**;DEC 1997 3 ;External reference to STATUS^ORQOR2 is supported by DBIA 3458 3 4 ; 4 ;External reference to ^PS(59.7 supported by DBIA 694 5 ;External reference to STATUS^ORQOR2 is supported by DBIA 3458 6 ;External references to LOCK1^ORX2 and UNLK1^ORX2 are supported by DBIA 867 7 EN N PSOEXRX,PSOEXCOM,PSOEXSTS,SUSD,PSOEXSTA,ZZDT,ZZEDT,IFN,NODE,RF,PIFN,PSUSD,PRFDT,PDA,PSDTEST,ORN,CPRSDC 5 EN N PSOEXRX,PSOEXCOM,PSOEXSTS,SUSD,PSOEXSTA,ZZDT,IFN,NODE,RF,PIFN,PSUSD,PRFDT,PDA,PSDTEST,ORN 8 6 I '$G(DT) S DT=$$DT^XLFDT 9 S X1=DT,X2=-1 D C^%DTC S ZZEDT=X 10 S ZZDT=$P($G(^PS(59.7,1,49.99)),"^",8) I +ZZDT=0 S X1=DT,X2=-2 D C^%DTC S ZZDT=X 11 F S ZZDT=$O(^PSRX("AG",ZZDT)) Q:ZZDT>ZZEDT Q:ZZDT="" D EN1 12 Q 13 EN1 F PSOEXRX=0:0 S PSOEXRX=$O(^PSRX("AG",ZZDT,PSOEXRX)) Q:'PSOEXRX D:$D(^PSRX(PSOEXRX,0)) 14 .N CPRSDC,CPRSSTA 15 .S CPRSDC=",1,7,12,13," 16 .S ORN=$P($G(^PSRX(PSOEXRX,"OR1")),"^",2),CPRSSTA="" 17 .I ORN S CPRSSTA=+$$STATUS^ORQOR2(ORN) I CPRSSTA=0 S ORN="" 7 S X1=DT,X2=-1 D C^%DTC S ZZDT=X 8 F PSOEXRX=0:0 S PSOEXRX=$O(^PSRX("AG",ZZDT,PSOEXRX)) Q:'PSOEXRX D:$D(^PSRX(PSOEXRX,0)) 18 9 .Q:$P($G(^PSRX(PSOEXRX,2)),"^",6)'=ZZDT 19 .K CMOP S DA=PSOEXRX I DA D ^PSOCMOPA ;*257 ;SET UP CMOP() ARRAY20 10 .S DA=$O(^PS(52.5,"B",PSOEXRX,0)) 21 11 .I DA S SUSD=$P($G(^PS(52.5,DA,0)),"^",2) I SUSD,$P($G(^(0)),"^",3) S DIK="^PS(52.5," D ^DIK K DIK … … 23 13 .I $G(^PSRX(PSOEXRX,"H"))]"" K:$P(^PSRX(PSOEXRX,"H"),"^") ^PSRX("AH",$P(^PSRX(PSOEXRX,"H"),"^"),PSOEXRX) S ^PSRX(PSOEXRX,"H")="" 24 14 .S PSOEXSTA=$P($G(^PSRX(PSOEXRX,"STA")),"^") 25 .I PSOEXSTA=13 D Q 26 ..I 'ORN D EN^PSOHDR("PRES",PSOEXRX) 27 .I PSOEXSTA=12!(PSOEXSTA=14)!(PSOEXSTA=15) I ORN,CPRSDC'[(","_CPRSSTA_",") D 28 ..D EN^PSOHLSN1(PSOEXRX,"OD","","","A") 29 ..I ORN S CPRSSTA=+$$STATUS^ORQOR2(ORN) 30 .I PSOEXSTA=11 I ORN,CPRSDC'[(","_CPRSSTA_",") D 15 .Q:PSOEXSTA=13!(PSOEXSTA="") 16 .I '$P($G(^PSRX(PSOEXRX,"OR1")),"^",2) D EN^PSOHLSN1(PSOEXRX,"ZC","") I $P($G(^PSRX(PSOEXRX,"OR1")),"^",2) D 17 ..I PSOEXSTA=12!(PSOEXSTA=14)!(PSOEXSTA=15) D EN^PSOHLSN1(PSOEXRX,"OD","","","A") 18 .I PSOEXSTA=11 S ORN=$P($G(^PSRX(PSOEXRX,"OR1")),"^",2) I ORN,+$$STATUS^ORQOR2(ORN)=6 D 31 19 ..S $P(^PSRX(PSOEXRX,0),"^",19)=1 32 20 ..D EN^PSOHLSN1(PSOEXRX,"SC","ZE","Prescription is expired") 33 . I PSOEXSTA>9&(PSOEXSTA'=16) Q21 .Q:PSOEXSTA>9 34 22 .S $P(^PSRX(PSOEXRX,"STA"),"^")=11 35 . D REVERSE^PSOBPSU1(PSOEXRX,0,"DE",5,"RX EXPIRED")23 .I '$G(PSUSD) D REVERSE^PSOBPSU1(PSOEXRX,0,"DE",5,"RX EXPIRED") 36 24 .S (PIFN,PSUSD,PRFDT)=0 F S PIFN=$O(^PSRX(PSOEXRX,1,PIFN)) Q:'PIFN S PSUSD=PIFN,PRFDT=+$P($G(^PSRX(PSOEXRX,1,PIFN,0)),"^") 37 .S ORN=$P($G(^PSRX(PSOEXRX,"OR1")),"^",2)38 25 .I $G(PSUSD) I '$P($G(^PSRX(PSOEXRX,1,PSUSD,0)),"^",18) S PSDTEST=0 D I 'PSDTEST K ^PSRX(PSOEXRX,1,PSUSD),^PSRX("AD",PRFDT,PSOEXRX,PSUSD),^PSRX(PSOEXRX,1,"B",PRFDT,PSUSD) D NSET 39 26 ..D REVERSE^PSOBPSU1(PSOEXRX,PSUSD,"DE",5,"RX EXPIRED") 40 27 ..F PDA=0:0 S PDA=$O(^PSRX(PSOEXRX,"L",PDA)) Q:'PDA I $P($G(^PSRX(PSOEXRX,"L",PDA,0)),"^",2)=PSUSD S PSDTEST=1 41 ..I $G(CMOP(CMOP("L")))="",".L.X."[("."_$G(CMOP("S"))_".") S PSDTEST=1 42 ..N PSOORL 43 ..S PSOORL=$$LOCK1^ORX2(ORN) S:'PSOORL PSDTEST=1 I PSOORL D UNLK1^ORX2(ORN) 44 ..N PDA0 45 ..;S PDAQ=0 46 ..F PDA=0:0 S PDA=$O(^PSRX(PSOEXRX,4,PDA)) Q:'PDA D 47 ...S PDA0=$G(^PSRX(PSOEXRX,4,PDA,0)) 48 ...I $P(PDA0,"^",3)=PSUSD S PSDTEST=1 ;*257 49 ..;Q:'PDAQ 50 ..;S PSDTEST=1 51 .I 'ORN D EN^PSOHDR("PRES",PSOEXRX) Q 52 .I CPRSDC[(","_CPRSSTA_",") D EN^PSOHDR("PRES",PSOEXRX) Q 28 ..S DA=PSOEXRX K CMOP D ^PSOCMOPA I $G(CMOP(CMOP("L")))="",$G(CMOP("S"))'="L" Q 29 ..S PSDTEST=1 30 .Q:'$P($G(^PSRX(PSOEXRX,"OR1")),"^",2) 53 31 .S $P(^PSRX(PSOEXRX,0),"^",19)=1 54 32 .S PSOEXCOM="Prescription past expiration date" D EN^PSOHLSN1(PSOEXRX,"SC","ZE",PSOEXCOM) 55 S DIE=59.7,DA=1,DR="49.95///"_ZZDT D ^DIE K DIE,DA,DR56 33 Q 57 34 NSET ; -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOHLSN.m
r628 r636 1 1 PSOHLSN ;BIR/RTR-Send order information to OERR from file 52.41 ;10/10/94 2 ;;7.0;OUTPATIENT PHARMACY;**1,7,15,24,27,30,55,46,98,88,121 ,292**;DEC 1997;Build 12 ;;7.0;OUTPATIENT PHARMACY;**1,7,15,24,27,30,55,46,98,88,121**;DEC 1997 3 3 ;Externel reference EN^ORERR supported by DBIA 2187 4 4 ; … … 12 12 I '$G(PSIEN) Q 13 13 I $G(STAT)="OC"!($G(STAT)="OD")!($G(STAT)="CR")!($G(STAT)="DR") D 14 .D CHKOLDRX15 14 .I $D(^PS(52.41,PSIEN,0)) K ^PS(52.41,"AD",$P(^PS(52.41,PSIEN,0),"^",12),+$P($G(^("INI")),"^"),PSIEN),^PS(52.41,"ACL",+$P(^PS(52.41,PSIEN,0),"^",13),+$P(^(0),"^",12),PSIEN),^PS(52.41,"AQ",+$P($G(^PS(52.41,PSIEN,0)),"^",21),PSIEN) 16 15 S PSZERO=$G(^PS(52.41,PSIEN,0)),PSOHSTAT=$G(STAT) … … 161 160 .S PVAR=$S(PVAR="":PVAR1,1:PVAR_PVAR1) 162 161 Q 163 CHKOLDRX ; when dc a pending renewal - if prior Rx is expired, set piece 19 to 1 so will update CPRS from 'renewed' to 'expired' in PSOHLSN1164 N PSOOLD165 S PSOOLD=$P($G(^PS(52.41,PSIEN,0)),"^",21)166 I PSOOLD'="",$P($G(^PSRX(PSOOLD,"STA")),"^")=11 S $P(^PSRX(PSOOLD,0),"^",19)=1167 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOHLSN1.m
r628 r636 1 1 PSOHLSN1 ;BIR/RTR - Send order info to OERR from file 52 ;10/10/94 2 ;;7.0;OUTPATIENT PHARMACY;**1,10,24,27,55,46,71,101,99,121,139,157,181,143,235,239 ,292**;DEC 1997;Build 12 ;;7.0;OUTPATIENT PHARMACY;**1,10,24,27,55,46,71,101,99,121,139,157,181,143,235,239**;DEC 1997 3 3 ;Ref #50.606-DBIA 2174 4 4 ;#50.607-2221 … … 21 21 S COUNT=0,NULLFLDS="F JJ=0:1:LIMIT S FIELD(JJ)=""""" 22 22 I '$D(^PSRX(PSRXIEN,0)) Q 23 I ($G(STAT)="SC"&($G(PSSTAT)="ZE"))!($G(STAT)="OC")!($G(STAT)="OD") I $D(^PS(52.41,"AQ",PSRXIEN)) D EN^PSOHDR("PRES",PSRXIEN) Q24 23 I STAT'="SN",STAT'="ZC",'$P($G(^PSRX(PSRXIEN,"OR1")),"^",2) Q 25 24 I $G(STAT)="SC",$G(PSSTAT)="ZE" S $P(^PSRX(PSRXIEN,0),"^",19)=2 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOLBL.m
r628 r636 1 PSOLBL ;BIR/SAB/RTR-BOTTLE LABEL ; 5/9/07 8:57am2 ;;7.0;OUTPATIENT PHARMACY;**8,19,30,36,47,71,92,120,157,244 ,206**;DEC 1997;Build 391 PSOLBL ;BIR/SAB/RTR-BOTTLE LABEL ;6/29/06 11:39am 2 ;;7.0;OUTPATIENT PHARMACY;**8,19,30,36,47,71,92,120,157,244**;DEC 1997 3 3 ;DBIAs PSDRUG-221, PS(55-2228, IBARX-125, PSXSRP-2201, %ZIS-3435, DPT-3097 4 4 ; 5 ;*244 rem test for partfill when testing status > 115 ;*244 remove test for partial fill when testing status > 11 6 6 ; 7 7 DQ I $D(PSOIOS),PSOIOS]"" D DEVBAR^PSOBMST … … 68 68 .K PSMP(PSI) 69 69 S X=$S($D(^PS(55,DFN,0)):^(0),1:""),PSCAP=$P(X,"^",2),PS55=$P($G(X),"^",3),PS55X=$P($G(X),"^",5) 70 I (($G(PS55X)]"")&(PS55>1)&(PS55X<DT)) S PS55= 070 I (($G(PS55X)]"")&(PS55>1)&(PS55X<DT)) S PS55=1 71 71 S:MW="M" MW=$S((PS55=1!(PS55=4)):"R",1:MW) 72 72 S MW=$S(MW="M":"REGULAR",MW="R":"CERTIFIED",1:"WINDOW") … … 74 74 ;S X=$S($D(^PS(55,DFN,0)):^(0),1:""),PSCAP=$P(X,"^",2) S:MW="M" MW=$S(+$P(X,"^",3):"R",1:MW) S MW=$S(MW="M":"REGULAR",MW="R":"CERTIFIED",1:"WINDOW") 75 75 S DATE=$E(FDT,1,7),REF=$P(RXY,"^",9)-RXF S:'$G(RXP) $P(^PSRX(RX,3),"^")=FDT S:REF<1 REF=0 D ^PSOLBL2 S II=RX D ^PSORFL,RFLDT^PSORFL 76 S PATST=$G(^PS(53,+$P(RXY,"^",3),0)) S PRTFL=1 I REF=0 S:('$P(PATST,"^",5))!(DEA[" W")!(DEA[1)!(DEA[2) PRTFL=076 S PATST=$G(^PS(53,+$P(RXY,"^",3),0)) S PRTFL=1 I REF=0 S:('$P(PATST,"^",5))!(DEA["A"&(DEA'["B"))!(DEA["W") PRTFL=0 77 77 S VRPH=$P(^PSRX(RX,2),"^",10),PSCLN=+$P(RXY,"^",5),PSCLN=$S($D(^SC(PSCLN,0)):$P(^(0),"^",2),1:"UNKNOWN") 78 78 S PATST=$P(PATST,"^",2),X1=DT,X2=$P(RXY,"^",8)-10 D C^%DTC:REF I $D(^PSRX(RX,2)),$P(^(2),"^",6),REF,X'<$P(^(2),"^",6) S REF=0,VRPH=$P(^(2),"^",10) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOLBL4.m
r628 r636 1 PSOLBL4 ;BIR/RTR-Set up routine for HL7 interface ;1 2/19/06 10:45am2 ;;7.0;OUTPATIENT PHARMACY;**26,70,156,244,233 ,246**;DEC 1997;Build 121 PSOLBL4 ;BIR/RTR-Set up routine for HL7 interface ;10/20/96 2 ;;7.0;OUTPATIENT PHARMACY;**26,70,156,244,233**;DEC 1997;Build 8 3 3 ;External reference to ^PSDRUG supported by DBIA 221 4 4 ; 5 5 ;*244 - ignore RX's with a status > 11 6 ;*246 - send marked drugs & print label (option 4) now working7 6 ; 8 7 N DIC,AP,X,Y,DPRT,QPRT … … 13 12 .F AP=0:0 S AP=$O(^PS(59,PSOSITE,"P",AP)) Q:'AP I +$P(^PS(59,PSOSITE,"P",AP,0),"^")=DPRT S QPRT=1 14 13 .I '$G(QPRT) S $P(PSOPAR,"^",30)=0 15 Q:'$P($G(PSOPAR),"^",30) ;HL7 interface turned off14 Q:'$P($G(PSOPAR),"^",30) 16 15 Q:$G(PSOEXREP) 17 HL N PSODTM,HHHH, PSOQUE,HLFLAG,HLFOUR,HLINGF,HLINRX,HLINRX0,II,HLNEXT,HLRR,HLRX,HLRXY,LL,PPLHL,PSHALP,HDFN,HLDFN,HNEWDFN,HLDAI,HLOSITE,HLJUST,HLRXYZ,PSOLLN,PSOLLL,PSFLG,HDFN1,NOTMD16 HL N PSODTM,HHHH,HLCOT,HLFLAG,HLFOUR,HLINGF,HLINRX,HLINRX0,HLLOOP,HLNEXT,HLRR,HLRX,HLRXY,LL,PPLHL,PSHALP,HDFN,HLDFN,HNEWDFN,HLDAI,HLOSITE,HLJUST,HLRXYZ,PSOLLN,PSOLLL,PSFLG,HDFN1 18 17 S HLOSITE=$P($G(PSOPAR),"^",30) 19 18 K ^UTILITY($J,"PSOHL"),^UTILITY($J,"PSOHLL"),HLRXY 20 S PPLHL=PPL 21 S HLFLAG=0 F II=1:1 S HLRX=$P(PPLHL,",",II) D Q:$G(HLFLAG)22 .S HLNEXT=$P(PPLHL,",",( II+1)) I HLNEXT=""!(HLNEXT=",") S HLFLAG=119 S PPLHL=PPL G:HLOSITE=4 SOMD 20 S HLFLAG=0 F HLLOOP=1:1 S HLRX=$P(PPLHL,",",HLLOOP) D Q:$G(HLFLAG) 21 .S HLNEXT=$P(PPLHL,",",(HLLOOP+1)) I HLNEXT=""!(HLNEXT=",") S HLFLAG=1 23 22 .Q:'$G(HLRX) 24 23 .Q:'$D(^PSRX(HLRX,0)) … … 27 26 .I $P($G(^PSRX(HLRX,"STA")),"^")>11!('$P(^PSRX(HLRX,0),"^",2)) Q 28 27 .I $G(PSODBQ) S HLRR=$O(^PS(52.5,"B",HLRX,0)) Q:'HLRR I $G(^PS(52.5,+HLRR,"P"))=1 Q 29 .; marked drug options 3 & 4 30 .I (HLOSITE=3)!(HLOSITE=4) S NOTMD=0 D Q:NOTMD ;quit, not marked 31 ..S HLJUST=+$P($G(^PSRX(HLRX,0)),"^",6) 32 ..S:'$P($G(^PSDRUG(HLJUST,6)),"^") NOTMD=1 33 .S HLRXY(II,HLRX)="" ;Valid Rx for HL7 34 .S:HLOSITE=3 HLRXYZ(HLRX)="" 35 ; 36 I $G(HLOSITE)=3,$D(HLRXY) D ;rebuild PPL print string 37 .K PPL F II=1:1 S HLRX=$P(PPLHL,",",II) Q:'HLRX D 38 ..Q:$D(HLRXYZ(HLRX)) 39 ..S PPL=$G(PPL)_HLRX_"," 40 ; 41 SOMDQ S (II,PSOQUE)=0 F S II=$O(HLRXY(II)) Q:'II S ^UTILITY($J,"PSOHLL",II)=$O(HLRXY(II,0)),PSOQUE=II 42 I PSOQUE=0 G ENDHL ;Nothing set, bypass Call to Queue 43 F II=0:0 S II=$O(^UTILITY($J,"PSOHLL",II)) Q:'II S HLINRX=^(II),HLINRX0=$G(^PSRX(HLINRX,0)) D 44 .S ^UTILITY($J,"PSOHLL",II)=HLINRX_"^"_+$P(HLINRX0,"^",6)_"^"_$S($G(RXPR(HLINRX)):"P",1:"F") 28 .;Here, if Site Parameter is 3, check entry in Drug File for National Id 29 .I $G(HLOSITE)=3 S HLJUST=+$P($G(^PSRX(HLRX,0)),"^",6) I '$P($G(^PSDRUG(HLJUST,6)),"^") Q 30 .S HLRXY(HLLOOP,HLRX)="" ; VALID RXS 31 .S:$G(HLOSITE)=3 HLRXYZ(HLRX)="" 32 I $G(HLOSITE)=3,$D(HLRXY) D 33 .N HLZFLAG,HLZ,HLZRX,HLZNEXT 34 .S HLZFLAG=0 K PPL F HLZ=1:1 S HLZRX=$P(PPLHL,",",HLZ) D Q:$G(HLZFLAG) 35 ..S HLZNEXT=$P(PPLHL,",",(HLZ+1)) I HLZNEXT=""!(HLZNEXT=",") S HLZFLAG=1 36 ..Q:'$G(HLZRX) 37 ..Q:$D(HLRXYZ(HLZRX)) 38 ..I $G(RXRP(HLZRX,"RP")) D Q 39 ...I $G(PPL)="" S PPL=HLZRX_"," Q 40 ...S PPL=PPL_HLZRX_"," 41 ..I $G(PPL)="" S PPL=HLZRX_"," Q 42 ..S PPL=PPL_HLZRX_"," 43 SOMDQ S HLCOT=1,PSHALP="" F S PSHALP=$O(HLRXY(PSHALP)) Q:PSHALP="" S ^UTILITY($J,"PSOHLL",HLCOT)=$O(HLRXY(PSHALP,0)),HLCOT=HLCOT+1 44 I HLCOT=1 G ENDHL ; NOTHING SET, BYPASS CALL TO QUEUE 45 F HLCOT=0:0 S HLCOT=$O(^UTILITY($J,"PSOHLL",HLCOT)) Q:'HLCOT S HLINRX=^(HLCOT),HLINRX0=$G(^PSRX(HLINRX,0)) D 46 .S ^UTILITY($J,"PSOHLL",HLCOT)=HLINRX_"^"_+$P(HLINRX0,"^",6)_"^"_$S($G(RXPR(HLINRX)):"P",1:"F") 45 47 .I '$G(RXPR(HLINRX)) S HLFOUR=0 F HHHH=0:0 S HHHH=$O(^PSRX(HLINRX,1,HHHH)) Q:'HHHH I +^(HHHH,0) S HLFOUR=HHHH 46 48 .I '$G(RXPR(HLINRX)),$G(RXFL(HLINRX))'="" S HLFOUR=$S($G(RXFL(HLINRX))=0:0,$D(^PSRX(HLINRX,1,+$G(RXFL(HLINRX)),0)):+$G(RXFL(HLINRX)),1:$G(HLFOUR)) 47 .S ^UTILITY($J,"PSOHLL", II)=^UTILITY($J,"PSOHLL",II)_"^"_$S($G(RXPR(HLINRX)):RXPR(HLINRX),1:HLFOUR)_"^"_$S($P($G(^PSRX(HLINRX,3)),"^",6)&('$G(RXPR(HLINRX)))&('$G(RXFL(HLINRX))):1,1:0) D ACLOG48 .S HLINGF=0 I $P(^UTILITY($J,"PSOHLL", II),"^",5),$O(^PSRX(HLINRX,"DAI",0)) S HLINGF=1 D49 ..F LL=0:0 S LL=$O(^PSRX(HLINRX,"DAI",LL)) Q:'LL S ^UTILITY($J,"PSOHLL", II,HLINGF)=$G(^PSRX(HLINRX,"DAI",LL,0)),HLINGF=HLINGF+150 .S $P(^UTILITY($J,"PSOHLL", II),"^",6)=$S($G(HLINGF):1,1:0)51 .I $D(^PSRX(HLINRX,"DRI")),'$G(RXPR(HLINRX)),'$G(RXFL(HLINRX)) S ^UTILITY($J,"PSOHLL", II,"DRI")=^PSRX(HLINRX,"DRI"),$P(^UTILITY($J,"PSOHLL",II),"^",7)=152 .E S $P(^UTILITY($J,"PSOHLL", II),"^",7)=053 .S $P(^UTILITY($J,"PSOHLL", II),"^",8)=0 D RPT Q:'$G(^PSRX(HLINRX,"IB"))49 .S ^UTILITY($J,"PSOHLL",HLCOT)=^UTILITY($J,"PSOHLL",HLCOT)_"^"_$S($G(RXPR(HLINRX)):RXPR(HLINRX),1:HLFOUR)_"^"_$S($P($G(^PSRX(HLINRX,3)),"^",6)&('$G(RXPR(HLINRX)))&('$G(RXFL(HLINRX))):1,1:0) D ACLOG 50 .S HLINGF=0 I $P(^UTILITY($J,"PSOHLL",HLCOT),"^",5),$O(^PSRX(HLINRX,"DAI",0)) S HLINGF=1 D 51 ..F LL=0:0 S LL=$O(^PSRX(HLINRX,"DAI",LL)) Q:'LL S ^UTILITY($J,"PSOHLL",HLCOT,HLINGF)=$G(^PSRX(HLINRX,"DAI",LL,0)),HLINGF=HLINGF+1 52 .S $P(^UTILITY($J,"PSOHLL",HLCOT),"^",6)=$S($G(HLINGF):1,1:0) 53 .I $D(^PSRX(HLINRX,"DRI")),'$G(RXPR(HLINRX)),'$G(RXFL(HLINRX)) S ^UTILITY($J,"PSOHLL",HLCOT,"DRI")=^PSRX(HLINRX,"DRI"),$P(^UTILITY($J,"PSOHLL",HLCOT),"^",7)=1 54 .E S $P(^UTILITY($J,"PSOHLL",HLCOT),"^",7)=0 55 .S $P(^UTILITY($J,"PSOHLL",HLCOT),"^",8)=0 D RPT Q:'$G(^PSRX(HLINRX,"IB")) 54 56 .I $P(^PSRX(HLINRX,"STA"),"^")>0,$P(^("STA"),"^")'=2,'$G(PSODBQ) Q 55 .S $P(^UTILITY($J,"PSOHLL", II),"^",8)=157 .S $P(^UTILITY($J,"PSOHLL",HLCOT),"^",8)=1 56 58 ; 57 59 AAA D STRT^PSOHLSG5 … … 100 102 Q 101 103 RPT ; 102 S $P(^UTILITY($J,"PSOHLL", II),"^",9)=$S($G(PSOSUREP)!($G(RXRP(HLINRX))):1,1:0)103 S $P(^UTILITY($J,"PSOHLL", II),"^",10)=+$G(PDUZ)104 S $P(^UTILITY($J,"PSOHLL",HLCOT),"^",9)=$S($G(PSOSUREP)!($G(RXRP(HLINRX))):1,1:0) 105 S $P(^UTILITY($J,"PSOHLL",HLCOT),"^",10)=+$G(PDUZ) 104 106 Q 105 107 SETZ ; … … 111 113 D ^%ZTLOAD 112 114 Q 115 SOMD ;send only mark drugs to external interface and print in vista 116 S HLFLG=0 F HLLP=1:1 S HLRX=$P(PPLHL,",",HLLP) D Q:$G(HLFLG) 117 .S HLNEXT=$P(PPLHL,",",(HLLP+1)) I HLNEXT=""!(HLNEXT=",") S HLFLG=1 118 .Q:'$G(HLRX) 119 .Q:'$D(^PSRX(HLRX,0)) 120 .Q:$P($G(^PSRX(HLRX,"STA")),"^")=4 121 .I $P($G(^PSRX(HLRX,"STA")),"^")>11!('$P(^PSRX(HLRX,0),"^",2)) Q 122 .Q:$G(RXRP(HLRX,"RP")) 123 .S HLRR=$O(^PS(52.5,"B",HLRX,0)) Q:'HLRR I $G(^PS(52.5,+HLRR,"P"))=1 K HLRR Q 124 .S DRG=+$P($G(^PSRX(HLRX,0)),"^",6) I '$P($G(^PSDRUG(DRG,6)),"^") Q 125 .S HLRXY(HLRX)="" ; VALID RXS 126 I $D(HLRXY) G SOMDQ 127 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOLBLN.m
r628 r636 1 PSOLBLN ;BIR/RTR-NEW PRINTS LABEL ;11/18/92 2 ;;7.0;OUTPATIENT PHARMACY;**16,36,71,107,110,117,135,233**;DEC 1997;Build 8 1 PSOLBLN ;BIR/RTR-NEW PRINTS LABEL ; 3/11/07 1:56pm 2 ;;7.0;OUTPATIENT PHARMACY;**16,36,71,107,110,117,135,233,208**;DEC 1997;Build 39 3 ; Modified from FOIA VistA 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External reference to ^PSDRUG supported by DBIA 221 4 20 ;External reference to ^VA(200 supported by DBIA 224 … … 19 35 S TECH="("_$S($P($G(^PSRX(+$G(RX),"OR1")),"^",5):$P($G(^PSRX(+$G(RX),"OR1")),"^",5),1:$P(RXY,"^",16))_"/"_$S($G(VRPH)&($P(PSOPAR,"^",32)):VRPH,1:" ")_")" 20 36 S PSZIP=$P(PS,"^",5) S PSOHZIP=$S(PSZIP["-":PSZIP,1:$E(PSZIP,1,5)_$S($E(PSZIP,6,9)]"":"-"_$E(PSZIP,6,9),1:"")) 37 ; 38 I $G(PSOAFYN)="Y" G PSOAFPL1 ;vfah 39 ; 21 40 L1 W ?3,"VAMC ",$P(PS,"^",7),", ",STATE," ",$G(PSOHZIP),?54,"VAMC ",$P(PS,"^",7),", ",STATE," ",$G(PSOHZIP),?102 W $S($D(REPRINT)&($G(PSOBLALL)):"(GROUP REPRINT)",$D(REPRINT):"(REPRINT)",1:"") W:$G(RXP) "(PARTIAL)" 22 41 W !?3,$P(PS2,"^",2)," ",$P(PS,"^",3),"-",$P(PS,"^",4)," ",TECH,?54,$P(PS2,"^",2)," ",$P(PS,"^",3),"-",$P(PS,"^",4)," ",TECH,?102,$P(PS2,"^",2)," ",TECH," ",NOW … … 53 72 L13 I $G(WARN)'="",'$G(PSOBLALL) I '$G(PSDFNFLG),'$G(PSOLAPPL) D WARN^PSOLBL2 54 73 W @IOF 74 ; 75 PSOAFPL1 I $G(PSOAFYN)="Y" D PSOAFP ;vfah 76 ; 55 77 REP I COPIES>0 S SIDE=1 G ST 56 78 D NOW^%DTC S NOW=% K %,%H,%I I $G(RXF)="" S RXF=0 F I=0:0 S I=$O(^PSRX(RX,1,I)) Q:'I S RXF=I … … 65 87 .S ^PSRX(RX,"L",IR,0)=NOW_"^"_$S($G(RXP):99-RXPI,1:RXF)_"^"_"ROUTING="_$G(MW)_" (BAD ADDRESS)"_"^"_PDUZ 66 88 S ^PSRX(RX,"TYPE")=0 K RXF,IR,FDA,NOW,I,PCOMH(RX) 89 PSOAFPL2 I $G(PSOAFYN)="Y" G PSOAFPL3 ;vfah 67 90 I $G(WARN)'="" I $G(PSDFNFLG)!($G(PSOLAPPL)) D ALLWARN^PSOLBLN1 68 91 I $G(WARN)="" I $G(PSDFNFLG)!($G(PSOLAPPL)) D ALL^PSOLBLS 69 92 I $G(PSOBLALL) D:$G(WARN)="" ALL^PSOLBLS D:$G(WARN)'="" ALLWARN^PSOLBLN1 70 93 I '$D(PSSPND),$P(PSOPAR,"^",18) I $G(PSDFNFLG)!($G(PSOLAPPL))!($G(PSOBLALL)) D CHCK2^PSOTRLBL 94 PSOAFPL3 ;vfah 71 95 D:$G(PSOBLALL) TRAIL^PSOLBL2 72 96 END ; 73 97 I $D(RXFLX(RX)) S RXFL(RX)=$G(RXFLX(RX)) K RXFLX 98 ; 99 I '$D(REPRINT)&($G(PSOAFYN)="Y") D ^PSODISP ;vfah auto-release 100 ; 74 101 D KILL^PSOLBL2 Q 102 ; 103 Q ;vfah 104 ; 105 PSOAFP ;Patient prescription print starts here;vfah 106 S PSOAFPRV=$P($G(^PSRX(RX,0)),"^",4) 107 S PSDU=$P($G(^PSDRUG($P($G(^PSRX(RX,0)),"^",6),660)),"^",8) ;vfah sets dispense units 108 I $G(VFASDD)="Y" S $P(^PSRX(RX,"RXFIN"),"^",1)="Y" ;Sets complex order flag in File#52 109 K VFASDD 110 ; 111 AFFAX ; 112 I $G(REPRINT)'=1 D 113 .S LZ=0,STOP=0 F S LZ=$O(^PSRX(RX,"PRC",LZ)) Q:'LZ!(STOP=1) S LZZ=$P(^PSRX(RX,"PRC",LZ,0),"FAX: ",2) S LZZ=+LZZ I LZZ'=0 D 114 ..I $D(^DIZ(22900)) D 115 ...S DIC="^DIZ(22900,",DIC(0)="MOZ",X=LZZ 116 ...D ^DIC K DIC 117 ...I +Y'=-1 D 118 ....S PSOAFFXP=X 119 ....S PSOAFFXL=$P(Y,"^",2) 120 ....S ^PSRX(RX,"PRC",LZ,0)=$TR(^PSRX(RX,"PRC",LZ,0),":","+") 121 ....S STOP=1 122 ...I +Y=-1 D 123 ....S ^PSRX(RX,"PRC",LZ,0)=$TR(^PSRX(RX,"PRC",LZ,0),":","-") 124 K STOP,LZ,LZZ 125 I $G(REPRINT)=1 S PSOAFFXP=$G(PSOAFFXR) 126 I $G(PSOAFFXP)>1 G AFPTL 127 ; 128 AFPTS I PSOLAP["STAR" D PRNT^PSOAFPTS 129 I PSOLAP["STAR" G AFKILL 130 I PSOLAP["STRL" D PRNT^PSOAFPT1 131 I PSOLAP["STRL" G AFKILL 132 ; 133 AFPTL D BEGLP^PSOAFPTL 134 ; 135 AFKILL K PSOAFPRV 136 I $G(REPRINT)'=1 D ^%ZISC -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOLBLN2.m
r628 r636 1 PSOLBLN2 ;BHAM ISC/RTR - NEW LABEL TRAILER ;06/06/94 2 ;;7.0;OUTPATIENT PHARMACY;**92,107,110**;DEC 1997 1 PSOLBLN2 ;BHAM ISC/RTR - NEW LABEL TRAILER ; 11/12/06 8:02pm 2 ;;7.0;OUTPATIENT PHARMACY;**92,107,110,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 Q:'+$G(RXN)!('$G(PSOTRAIL))!('+$G(DFN)) 4 20 I $G(PSOBLALL),$P(PPL,",",PI+1)'="" Q … … 40 56 .S ^TMP($J,"PSOSUSP",PSSPCNT)=" "_$$ZZ^PSOSUTL(PSSSRX) S PSSPCNT=PSSPCNT+1 K SPNUM,SPDATE,Y 41 57 PRINT S PSOTRDFN=$P(VADM(2),"^"),PSOTRDFN=$S(PSOTRDFN]"":PSOTRDFN,1:"Unavailable") S Y=DT X ^DD("DD") S EDT=Y 42 W ?54,VADM(1)_" "_$E($P(VADM(2),"^",2),5,12)_" "_EDT58 ;W ?54,VADM(1)_" "_$E($P(VADM(2),"^",2),5,12)_" "_EDT ;vfah 43 59 W ! I PRCOPAY,$G(PSOBARS) S X="S",X2=PSOTRDFN,X1=$X W ?54,@PSOBAR1,PSOTRDFN,@PSOBAR0,$C(13) S $X=0 44 60 I PRCOPAY,'$G(PSOBARS) W !!! 45 61 I 'PRCOPAY W ! 46 62 I 'PSSUFLG D PRSUS G END 47 S (PSNONARR,PSNOADDR,PSNOBOTH)=0 F TTT=1:1 Q:$G(PSNOBOTH) D48 .W $G(^TMP($J,"PSOMAIL",TTT)) S:'$O(^(TTT)) PSNOADDR=149 .W ?54,$G(^TMP($J,"PSONARR",TTT)),! S:'$O(^(TTT)) PSNONARR=150 .I PSNOADDR,PSNONARR S PSNOBOTH=163 ;S (PSNONARR,PSNOADDR,PSNOBOTH)=0 F TTT=1:1 Q:$G(PSNOBOTH) D ;vfah 64 ;.W $G(^TMP($J,"PSOMAIL",TTT)) S:'$O(^(TTT)) PSNOADDR=1 ;vfah 65 ;.W ?54,$G(^TMP($J,"PSONARR",TTT)),! S:'$O(^(TTT)) PSNONARR=1 ;vfah 66 ;.I PSNOADDR,PSNONARR S PSNOBOTH=1 ;vfah 51 67 END K ^TMP($J,"PSONARR"),^TMP($J,"PSOMAIL"),^TMP($J,"PSOSUSP"),^UTILITY($J,"W") 52 68 K DIWF,DIWL,DIWR,EDT,LLL,PRCOPAY,PS,PSNACNT,PSNOADDR,PSNOBOTH,PSNONARR,PSNOSUSP,PSNTHREE,PSOLGTH,PSOSD,PSOTRAIL,PSOTRDFN,PSSEVFL,PSSIXFL,PSSPCNT,PSSSRX,PSSUFLG,RXX,SPDATE,SPNUM,SPPL,STATE,TTT,VAADDR1,VADM,VAEL,VAPA,VASTREET,ZZ,ZZZ W @IOF 53 I $P(PSOPAR,"^",31) D BLANK^PSOLBLD W @IOF 69 ;I $P(PSOPAR,"^",31) D BLANK^PSOLBLD W @IOF 70 I $P(PSOPAR,"^",31)="1" D BLANK^PSOLBLD W @IOF ;vfah 54 71 Q 55 72 PRSUS S (PSNONARR,PSNOADDR,PSNOSUSP,PSNTHREE)=0 F TTT=1:1 Q:$G(PSNTHREE) D -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOLLLI.m
r628 r636 1 PSOLLLI ;BIR/JLC - LASER LABELS INITIALIZATION ; 4/25/07 9:00am2 ;;7.0;OUTPATIENT PHARMACY;**120,157,189,161,244,200 ,206**;DEC 1997;Build 391 PSOLLLI ;BIR/JLC - LASER LABELS INITIALIZATION ;10 Oct 2006 4:56 PM 2 ;;7.0;OUTPATIENT PHARMACY;**120,157,189,161,244,200**;DEC 1997;Build 7 3 3 ; 4 4 ;DBIAs PSDRUG-221, PS(55-2228, SC-10040, IBARX-125, PSXSRP-2201, %ZIS-3435, DPT-3097, ^TMP($J,"PSNPPIO"-3794 … … 87 87 S MAILCOM="" 88 88 S X=$G(^PS(55,DFN,0)),PSCAP=$P(X,"^",2),PS55=$P(X,"^",3),PS55X=$P(X,"^",5) 89 I PS55X]"",PS55>1,PS55X<DT S PS55= 089 I PS55X]"",PS55>1,PS55X<DT S PS55=1 90 90 S:MW="M" MW=$S((PS55=1!(PS55=4)):"R",1:MW) 91 91 S MAILCOM=$P($G(^PS(59,PSOSITE,9)),"^") … … 94 94 S DATE=$E(FDT,1,7),REF=$P(RXY,"^",9)-RXF S:'$G(RXP) $P(^PSRX(RX,3),"^")=FDT S:REF<1 REF=0 D ^PSOLBL2 S II=RX D ^PSORFL,RFLDT^PSORFL 95 95 S (X,PSOFLAST)=$G(PSOLASTF) I X?1N.E D ^%DT X ^DD("DD") S PSOFLAST=Y 96 S PATST=$G(^PS(53,+$P(RXY,"^",3),0)) S PRTFL=1 I REF=0 S:('$P(PATST,"^",5))!(DEA[" W")!(DEA[1)!(DEA[2) PRTFL=096 S PATST=$G(^PS(53,+$P(RXY,"^",3),0)) S PRTFL=1 I REF=0 S:('$P(PATST,"^",5))!(DEA["A"&(DEA'["B"))!(DEA["W") PRTFL=0 97 97 S VRPH=$P(RX2,"^",10),PSCLN=+$P(RXY,"^",5),PSCLN=$G(^SC(PSCLN,0)),PSCLN=$S($P(PSCLN,"^",2)'="":$P(PSCLN,"^",2),1:$E($P(PSCLN,"^"),1,7)) I PSCLN="" S PSCLN="UNKNOWN" 98 98 S PATST=$P(PATST,"^",2),X1=DT,X2=$P(RXY,"^",8)-10 D C^%DTC:REF I $D(^PSRX(RX,2)),$P(^(2),"^",6),REF,X'<$P(^(2),"^",6) S REF=0,VRPH=$P(^(2),"^",10) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOLMPO.m
r628 r636 1 PSOLMPO ;ISC-BHAM/LC - pending orders ; 13-MAR-1995 2 ;;7.0;OUTPATIENT PHARMACY;**46**;DEC 1997 1 PSOLMPO ;ISC-BHAM/LC - pending orders ; 11/3/06 9:58pm 2 ;;7.0;OUTPATIENT PHARMACY;**46,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 EN ; -- main entry point for PSO LM PENDING ORDER 4 S PSOLMC=0 D EN^VALM("PSO LM PENDING ORDER") K PSOLMC 20 I $G(PSOAFYN)'="Y" S PSOLMC=0 D EN^VALM("PSO LM PENDING ORDER") K PSOLMCP ;vfam 21 I $G(PSOAFYN)="Y" D ACP^PSOORNEW ;vfam 5 22 Q 6 23 ; -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOLSET.m
r628 r636 1 PSOLSET ;BHAM ISC/SAB - site parameter set up ;12/03/92 2 VERS ;;7.0;OUTPATIENT PHARMACY;**10,22,32,40,120,247**;DEC 1997;Build 18 1 PSOLSET ;BHAM ISC/SAB - site parameter set up ;3/13/07 19:50 2 VERS ;;7.0;OUTPATIENT PHARMACY;**10,22,32,40,120,247,208**;DEC 1997;Build 39 3 ; Modified from FOIA VistA 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;Reference to ^PS(59.7 supported by DBIA 694 4 20 ;Reference to ^PSX(550 supported by DBIA 2230 … … 33 49 .S %ZIS="MNQ",%ZIS("A")="Select PROFILE PRINTER: " S:$G(PSOCLBL)&($D(PSOPROP)) %ZIS("B")=PSOPROP 34 50 .D ^%ZIS K %ZIS,IO("Q"),IOP Q:POP S PSOPROP=ION D ^%ZISC 35 LBL S %ZIS="MNQ",%ZIS("A")="Select LABEL PRINTER: " S:$G(PSOCLBL)&($D(PSOLAP))!($G(SUSPT)) %ZIS("B")=$S($G(SUSPT):PSLION,1:PSOLAP) 51 S PSOAFIN=$P($G(^PS(59,PSOSITE,"RXFIN")),"^",1) ;vfah 52 S PSOAFPFX=$S(PSOAFIN="Y":"Select LABEL PRINTER or FAX DEVICE: ",1:"Select LABEL PRINT: ") ;vfah 53 LBL S %ZIS="MNQ",%ZIS("A")=PSOAFPFX S:$G(PSOCLBL)&($D(PSOLAP))!($G(SUSPT)) %ZIS("B")=$S($G(SUSPT):PSLION,1:PSOLAP) ;vfah 36 54 D ^%ZIS K %ZIS,IO("Q"),IOP S:POP PSOQUIT=1 G:POP EXIT S @$S($G(SUSPT):"PSLION",1:"PSOLAP")=ION,PSOPIOST=$G(IOST(0)) 37 55 N PSOIOS S PSOIOS=IOS D DEVBAR^PSOBMST 38 56 S PSOBARS=PSOBAR1]""&(PSOBAR0]"")&$P(PSOPAR,"^",19),PSOIOS=IOS D ^%ZISC 39 57 LASK I $G(PSOPIOST),$D(^%ZIS(2,PSOPIOST,55,"B","LL")) G EXIT 58 ; 59 ;vfah AutoFinish fax additions begin here 60 K PSOAFFXP,PSOAFFXL 61 I PSOLAP["FAX" D 62 .S PSOAFFXP="",PSOAFFXL="",PSOAFFXR="" 63 .S PSOLAP="AFFAX" D 64 ..S PSOION="" S PSOION=$O(^%ZIS(1,"B",PSOLAP,PSOION)) 65 ..I $D(^DIZ(22900)) D 66 ...S DIC="^DIZ(22900,",DIC(0)="AEQMZ",DIC("A")="SEND FAX TO: " 67 ...D ^DIC K DIC 68 ...I Y=-1 W !,"Invalid selection" G LBL 69 ...S PSOAFFXL=$P(Y,"^",2) 70 ...S PSOAFFXP=$P($G(^DIZ(22900,+Y,3)),"^",3) 71 ...S PSOAFFXR=PSOAFFXP 72 ...I PSOAFFXL=""!(PSOAFFXP="") G LBL 73 I $G(PSOAFFXP)&(PSOLAP="AFFAX")'="" G EXIT 74 ;vfah Autofinish fax additions end here 75 ; 40 76 K DIR S DIR("A")="OK to assume label alignment is correct",DIR("B")="YES",DIR(0)="Y",DIR("?")="Enter Y if labels are aligned, N if they need to be aligned." D ^DIR S:$D(DIRUT) PSOQUIT=1 G:Y!($D(DIRUT)) EXIT 41 77 P2 S IOP=$G(PSOLAP) D ^%ZIS K IOP I POP W $C(7),!?5,"Printer is busy.",! G LASK -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOMAUEX.m
r628 r636 1 PSOMAUEX ;BIR/SAB-Auto expire of prescriptions ; 10/10/07 11:17am2 ;;7.0;OUTPATIENT PHARMACY;**40,73,139,148 ,257**;DEC 1997;Build 193 ; ;1 PSOMAUEX ;BIR/SAB-Auto expire of prescriptions ;10/10/96 2 ;;7.0;OUTPATIENT PHARMACY;**40,73,139,148**;DEC 1997 3 ;External reference to ^PS(59.7 is supported by DBIA 694 4 4 ;External reference to STATUS^ORQOR2 is supported by DBIA 3458 5 ;External reference to ^PS(59.7 is supported by DBIA 6946 ;External reference to LOCK1^ORX2 and UNLK1^ORX2 are supported by DBIA 8677 5 ; 8 6 I '$G(DT) S DT=$$DT^XLFDT … … 23 21 W !,"*******************************************************************************" 24 22 W !! 25 S ZZ DT=$S($P($G(^PS(59.7,1,49.99)),"^",7):$P(^PS(59.7,1,49.99),"^",7),1:$P($G(^PS(59.7,1,49.99)),"^",4))26 I 'ZZ DT D Q ; V7.0 inst. dt not found, quit this job23 S ZZIDT=$S($P($G(^PS(59.7,1,49.99)),"^",7):$P(^PS(59.7,1,49.99),"^",7),1:$P($G(^PS(59.7,1,49.99)),"^",4)) 24 I 'ZZIDT D Q ; V7.0 inst. dt not found, quit this job 27 25 .W !!!,"***** Outpatient installation date was not found, *****" 28 26 .W !,"***** therefore this job cannot be run!!!!! *****",!! … … 30 28 ; - Ask for START DATE 31 29 K %DT S %DT(0)=-DT,%DT="AEP",%DT("A")="Start Date: " 32 S %DT("B")=$$FMTE^XLFDT($$FMADD^XLFDT(ZZ DT\1,-121))30 S %DT("B")=$$FMTE^XLFDT($$FMADD^XLFDT(ZZIDT\1-121)) 33 31 W ! D ^%DT I Y<0!($D(DTOUT)) Q 34 S ZZ DT=Y32 S ZZIDT=Y 35 33 ; 36 34 K %DT D NOW^%DTC S %DT="RAEX",%DT(0)=%,%DT("A")="Select the Date/Time to queue this job: " 37 35 W ! D ^%DT K %DT I $D(DTOUT)!(Y<0) W !!!?10,"Job not queued!" Q 38 S ZTDTH=$G(Y),ZTSAVE("ZZ DT")="",ZTIO="",ZTRTN="EN^PSOMAUEX",ZTDESC="Auto expire of Rxs "36 S ZTDTH=$G(Y),ZTSAVE("ZZIDT")="",ZTIO="",ZTRTN="EN^PSOMAUEX",ZTDESC="Auto expire of Rxs " 39 37 D ^%ZTLOAD 40 38 W:$D(ZTSK) !!,"Task Queued !",! 41 39 Q 42 EN ; 43 N PSOSVDT 44 S PSOSVDT="" 45 S X1=DT,X2=-1 D C^%DTC S CDT=X ; setting the end date to to today-1 46 F S ZZDT=$O(^PSRX("AG",ZZDT)) Q:'ZZDT!(ZZDT>CDT) D EN1 S PSOSVDT=ZZDT 47 I PSOSVDT>($P(^PS(59.7,1,49.99),"^",8)) D 48 .S DIE=59.7,DA=1,DR="49.95///"_PSOSVDT D ^DIE K DIE,DA,DR 49 K PSOEXRX,PSOEXSTA,ZZDT,CDT,ORN,PIFN,PSUSD,PRFDT,PDA,PSDTEST S:$D(ZTQUEUED) ZTREQ="@" 40 EN S X1=ZZIDT,X2=-121 D C^%DTC S ZZDT=X ;setting the start date to 120 days before the install date 41 S X1=DT,X2=-1 D C^%DTC S CDT=X ; setting the end date to todate-1 42 F S ZZDT=$O(^PSRX("AG",ZZDT)) Q:'ZZDT!(ZZDT>CDT) D EN1 43 K PSOEXRX,PSOEXSTA,ZZIDT,ZZDT,CDT,ORN,PIFN,PSUSD,PRFDT,PDA,PSDTEST S:$D(ZTQUEUED) ZTREQ="@" 50 44 Q 51 45 EN1 ; … … 55 49 Q 56 50 EN2 ; 57 N CPRSDC,CPRSSTA58 S CPRSDC=",1,7,12,13,"59 S ORN=$P($G(^PSRX(PSOEXRX,"OR1")),"^",2),CPRSSTA=""60 I ORN S CPRSSTA=+$$STATUS^ORQOR2(ORN)61 S DA=PSOEXRX K CMOP D ^PSOCMOPA62 51 S DA=$O(^PS(52.5,"B",PSOEXRX,0)) 63 52 I DA,$P($G(^PS(52.5,DA,0)),"^",2),$P($G(^(0)),"^",3) S DIK="^PS(52.5," D ^DIK K DIK … … 65 54 I $G(^PSRX(PSOEXRX,"H"))]"" K:$P(^PSRX(PSOEXRX,"H"),"^") ^PSRX("AH",$P(^PSRX(PSOEXRX,"H"),"^"),PSOEXRX) S ^PSRX(PSOEXRX,"H")="" 66 55 S PSOEXSTA=$P($G(^PSRX(PSOEXRX,"STA")),"^") 56 I PSOEXSTA=11 D 57 .S $P(^PSRX(PSOEXRX,0),"^",19)=1 58 .S ORN=$P($G(^PSRX(PSOEXRX,"OR1")),"^",2) 59 .I ORN,+$$STATUS^ORQOR2(ORN)=6 D 60 ..D EN^PSOHLSN1(PSOEXRX,"SC","ZE","Prescription is expired") 61 I (PSOEXSTA="")!(PSOEXSTA>9) Q 67 62 ; 68 I PSOEXSTA=11 S ORN=$P($G(^PSRX(PSOEXRX,"OR1")),"^",2) I ORN I CPRSDC'[(","_CPRSSTA_",") D 69 .S $P(^PSRX(PSOEXRX,0),"^",19)=1 70 .D EN^PSOHLSN1(PSOEXRX,"SC","ZE","Prescription is expired") 71 ; 72 I PSOEXSTA=13 D Q 73 .I 'ORN D EN^PSOHDR("PRES",PSOEXRX) 74 ; 75 I PSOEXSTA>9&(PSOEXSTA'=16) Q 76 ; 77 I +$P($G(^PSRX(PSOEXRX,2)),"^",6),+$P($G(^(2)),"^",6)<DT D 63 ;get only those Rxs whoes status lies within 0 & 9 64 I PSOEXSTA?1N,+$P($G(^PSRX(PSOEXRX,2)),"^",6),+$P($G(^(2)),"^",6)<DT D 78 65 .S $P(^PSRX(PSOEXRX,"STA"),"^")=11 66 .I $P($G(^PSRX(PSOEXRX,"OR1")),"^",2) D 67 ..D EN^PSOHLSN1(PSOEXRX,"SC","ZE","Prescription past expiration date") 79 68 .S (PIFN,PSUSD,PRFDT)=0 80 69 .F S PIFN=$O(^PSRX(PSOEXRX,1,PIFN)) Q:'PIFN S PSUSD=PIFN,PRFDT=+$P($G(^PSRX(PSOEXRX,1,PIFN,0)),"^") 81 70 .D REVERSE^PSOBPSU1(PSOEXRX,+PSUSD,"DE",5,"RX EXPIRED") 82 71 .I $G(PSUSD),'$P($G(^PSRX(PSOEXRX,1,PSUSD,0)),"^",18) D EN3 83 .S ORN=$P($G(^PSRX(PSOEXRX,"OR1")),"^",2) I 'ORN D EN^PSOHDR("PRES",PSOEXRX) Q84 .;If CPRS side already DC'd or expired, just send the expiration to the HDR85 .I CPRSDC[(","_CPRSSTA_",") D EN^PSOHDR("PRES",PSOEXRX) Q86 .S $P(^PSRX(PSOEXRX,0),"^",19)=187 .D EN^PSOHLSN1(PSOEXRX,"SC","ZE","Prescription past expiration date")88 72 Q 89 73 EN3 ; 90 74 S (PSDTEST,PDA)=0 F S PDA=$O(^PSRX(PSOEXRX,"L",PDA)) Q:'PDA S:$P($G(^PSRX(PSOEXRX,"L",PDA,0)),"^",2)=PSUSD PSDTEST=1 91 75 Q:PSDTEST 92 I $G(CMOP(CMOP("L")))="",".L.X."[("."_$G(CMOP("S"))_".") S PSDTEST=1 93 N PSOORL 94 S PSOORL=$$LOCK1^ORX2(ORN) S:'PSOORL PSDTEST=1 I PSOORL D UNLK1^ORX2(ORN) 95 N PDAQ,PDA0 96 S PDAQ=0 97 F PDA=0:0 S PDA=$O(^PSRX(PSOEXRX,4,PDA)) Q:'PDA D 98 .S PDA0=$G(^PSRX(PSOEXRX,4,PDA,0)) Q:PDA0="" 99 .I $P(PDA0,"^",3)=PSUSD S PSDTEST=1 76 S DA=PSOEXRX K CMOP D ^PSOCMOPA 77 I $G(CMOP(CMOP("L")))="",$G(CMOP("S"))="L" S PSDTEST=1 100 78 ENX I 'PSDTEST K ^PSRX(PSOEXRX,1,PSUSD),^PSRX("AD",PRFDT,PSOEXRX,PSUSD),^PSRX(PSOEXRX,1,"B",PRFDT,PSUSD) D NSET 101 79 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSON52.m
r628 r636 1 1 PSON52 ;BIR/DSD - files new entries in prescription file ;08/09/93 2 ;;7.0;OUTPATIENT PHARMACY;**1,16,23,27,32,46,71,111,124,117,131,139,157,143,219,148,239,201,268,260**;DEC 1997;Build 84 2 ;;7.0;OUTPATIENT PHARMACY;**1,16,23,27,32,46,71,111,124,117,131,139,157,143,219,148,239,201,268,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External reference ^PS(55 supported by DBIA 2228 4 20 ;External reference to PSOUL^PSSLOCK supported by DBIA 2789 5 21 ;External reference to ^XUSEC supported by DBIA 10076 6 22 ;External reference SWSTAT^IBBAPI supported by DBIA 4663 7 ;External reference SAVNDC^PSSNDCUT supported by DBIA 47078 23 EN(PSOX) ;Entry Point 9 24 START ; … … 66 81 ;Next line, set SC question based on Copay status? 67 82 IBQ ;I $G(PSOBILL)=2 S ^PSRX(PSOX("IRXN"),"IBQ")=$S($G(PSOX("NEWCOPAY")):0,1:1) 83 I $G(PSOAFYN)="Y" S PSOSCP="" ;vfah 68 84 N PSOSCFLD S PSOSCFLD=$S(PSOSCP'="":$G(PSOANSQ("SC")),1:"")_"^"_$G(PSOANSQ("MST"))_"^"_$G(PSOANSQ("VEH"))_"^"_$G(PSOANSQ("RAD"))_"^"_$G(PSOANSQ("PGW"))_"^"_$G(PSOANSQ("HNC"))_"^"_$G(PSOANSQ("CV")) 69 85 I PSOSCP<50&($TR(PSOSCFLD,"^")'="")&($P($G(^PS(53,+$G(PSONEW("PATIENT STATUS")),0)),"^",7)'=1) D … … 103 119 ; 104 120 ; - Calling ECME for claims generation and transmission / REJECT handling 105 N ACTION,PSOERX 106 S PSOERX=PSOX("IRXN") 107 I $$SUBMIT^PSOBPSUT(PSOERX,0) D I ACTION="Q"!(ACTION="^") Q 108 . S ACTION="" D ECMESND^PSOBPSU1(PSOERX,0,PSOX("FILL DATE"),"OF") 109 . I $$FIND^PSOREJUT(PSOERX,0) D 110 . . S ACTION=$$HDLG^PSOREJU1(PSOERX,0,"79,88","OF","IOQ","I") 111 . I $$STATUS^PSOBPSUT(PSOERX,0)="E PAYABLE" D 112 . . D SAVNDC^PSSNDCUT(+$$GET1^DIQ(52,PSOERX,6,"I"),$G(PSOSITE),$$GETNDC^PSONDCUT(PSOERX,0)) 121 N ACTION 122 I $$SUBMIT^PSOBPSUT(PSOX("IRXN"),0) D I ACTION="Q"!(ACTION="^") Q 123 . S ACTION="" D ECMESND^PSOBPSU1(PSOX("IRXN"),0,PSOX("FILL DATE"),"OF") 124 . I $$FIND^PSOREJUT(PSOX("IRXN"),0) D 125 . . S ACTION=$$HDLG^PSOREJU1(PSOX("IRXN"),0,"79,88","OF","IOQ","I") 113 126 ; 114 127 FINISHP ; -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSONEW.m
r628 r636 1 PSONEW ;BIR/SAB-new rx order main driver ;07/26/96 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,32,46,94,130,268**;DEC 1997;Build 9 1 PSONEW ;BIR/SAB-new rx order main driver ; 11/5/06 6:35pm 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,32,46,94,130,268,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External references L and UL^PSSLOCK supported by DBIA 2789 4 20 ;External reference to ^VA(200 supported by DBIA 224 … … 65 81 COUN ;patient counseling 66 82 G:$G(PSORX("EDIT"))&('$G(PSOSIGFL)) NOORX K DIR,DUOUT,DTOUT,DIRUT 67 S DIR("B")="NO",DIR(0)="52,41" D ^DIR S PSOCOU=$S(Y:Y,1:0) 83 I $G(PSOAFYN)'="Y" S DIR("B")="NO",DIR(0)="52,41" D ^DIR S PSOCOU=$S(Y:Y,1:0) ;vfam 84 I $G(PSOAFYN)="Y" S PSOCOU=0 ;vfam No Patient Counseling by AutoFinihs 68 85 I $D(DIRUT)!('PSOCOU) S PSOCOUU=0 D:'$G(SPEED) PRONTE Q 69 86 K:'$G(PSOCOU) PSOCOUU K DIR,DUOUT,DTOUT,DIRUT I Y S DIR(0)="52,42",DIR("B")="NO" D ^DIR S PSOCOUU=$S(Y:Y,1:0) 70 87 PRONTE K PSONOTE,DIR,DIRUT,DUOUT 71 88 I $T(MAIN^TIUEDIT)]"",'$G(SPEED) D K DIR,DIRUT,DUOUT 72 .S DIR(0)="Y",DIR("B")="No",DIR("A")="Do you want to enter a Progress Note",DIR("A",1)="" D ^DIR K DIR 89 .I $G(PSOAFYN)'="Y" S DIR(0)="Y",DIR("B")="No",DIR("A")="Do you want to enter a Progress Note",DIR("A",1)="" D ^DIR K DIR ;vfam 90 .I $G(PSOAFYN)="Y" S Y="0" ;vfam No Progress Notes in AutoFinish 73 91 .S PSONOTE=+Y Q ;I 'Y!($D(DIRUT)) Q 74 92 NOORX K X,Y,DIR,DUOUT,DTOUT,DIRUT -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSONEWF.m
r628 r636 1 1 PSONEWF ;BIR/RTR - Copay finish questions ;07/26/96 2 ;;7.0;OUTPATIENT PHARMACY;**71,157,143,219,226,239**;DEC 1997 2 ;;7.0;OUTPATIENT PHARMACY;**71,157,143,219,226,239,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External reference VADPT supported by DBIA 10061 4 20 START ; 21 I $G(PSOAFYN)="Y" Q ; vfam 5 22 N PSOPENIB,PSOSCOTH,PSOSCOTX,PSOMESFI 6 23 S PSOPENIB=$S($G(ORD):$G(^PS(52.41,+$G(ORD),"IBQ")),1:"") -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORAL.m
r628 r636 1 1 PSOORAL ;BHAM-ISC/SAB - activity log list ; 28-APR-1995 2 ;;7.0;OUTPATIENT PHARMACY;**148 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**148**;DEC 1997 3 3 EN ; -- main entry point for PSO LM ACTIVITY LOGS 4 4 D EN^VALM("PSO LM ACTIVITY LOGS") … … 10 10 ; 11 11 INIT ; -- init variables and list array 12 I $G(PS)="VIEW"!($G(PS)="DELETE")!($G(PS)="REJECT") !($G(PS)="REJECTMP")D12 I $G(PS)="VIEW"!($G(PS)="DELETE")!($G(PS)="REJECT") D 13 13 .I ST<12,$P(RX2,"^",6)<DT S ST=11 14 14 .S VALM("TITLE")="Rx View "_"("_$P("Error^Active^Non-Verified^Refill^Hold^Non-Verified^Suspended^^^^^Done^Expired^Discontinued^Deleted^Discontinued^Discontinued (Edit)^Provider Hold^","^",ST+2)_")" -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORAL1.m
r628 r636 1 PSOORAL1 ;BHAM ISC/SAB - Build Listman activity logs ; 12/4/07 12:25pm2 ;;7.0;OUTPATIENT PHARMACY;**71,156,148,247 ,240**;DEC 1997;Build 51 PSOORAL1 ;BHAM ISC/SAB - Build Listman activity logs ;11/16/92 13:11 2 ;;7.0;OUTPATIENT PHARMACY;**71,156,148,247**;DEC 1997;Build 18 3 3 N RX0,VALMCNT K DIR,DTOUT,DUOUT,DIRUT,^TMP("PSOAL",$J) S DA=$P(PSOLST(ORN),"^",2),RX0=^PSRX(DA,0),J=DA,RX2=$G(^(2)),R3=$G(^(3)),CMOP=$O(^PSRX(DA,4,0)) 4 4 S IEN=0,DIR(0)="LO^1:"_$S(CMOP:8,1:7),DIR("A",1)=" ",DIR("A",2)="Select Activity Log by number",DIR("A",3)="1. Refill 2. Partial 3. Activity 4. Labels" … … 34 34 .I $P(P1,"^",5)]"" N PSOACBRK,PSOACBRV D 35 35 ..S PSOACBRV=$P(P1,"^",5) 36 ..;PSO*7*240 Use fileman for parsing 37 ..K ^UTILITY($J,"W") S X="Comments: "_PSOACBRV,(DIWR,DIWL)=1,DIWF="C80" D ^DIWP F I=1:1:^UTILITY($J,"W",1) S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=$G(^UTILITY($J,"W",1,I,0)) 36 ..I $L(PSOACBRV)<71 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Comments: "_PSOACBRV Q 37 ..I $E(PSOACBRV,1,70)'[" " S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Comments: "_$E(PSOACBRV,1,70),IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=$E(PSOACBRV,71,245) Q 38 ..F PSOACBRK=245:-1 Q:PSOACBRK=0 I $E(PSOACBRV,PSOACBRK)=" ",PSOACBRK<71 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Comments: "_$E(PSOACBRV,1,PSOACBRK),IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=$E(PSOACBRV,PSOACBRK,245) Q 38 39 .I $P($G(^PSRX(DA,"A",N,1)),"^")]"" S IEN=IEN+1,$P(^TMP("PSOAL",$J,IEN,0)," ",5)=$P($G(^PSRX(DA,"A",N,1)),"^") I $P($G(^PSRX(DA,"A",N,1)),"^",2)]"" S ^TMP("PSOAL",$J,IEN,0)=^TMP("PSOAL",$J,IEN,0)_":"_$P($G(^PSRX(DA,"A",N,1)),"^",2) 39 40 .I $O(^PSRX(DA,"A",N,2,0)) F I=0:0 S I=$O(^PSRX(DA,"A",N,2,I)) Q:'I S MIG=^PSRX(DA,"A",N,2,I,0) D 40 41 ..F SG=1:1:$L(MIG) S:$L(^TMP("PSOAL",$J,IEN,0)_" "_$P(MIG," ",SG))>80 IEN=IEN+1,$P(^TMP("PSOAL",$J,IEN,0)," ",9)=" " S:$P(MIG," ",SG)'="" ^TMP("PSOAL",$J,IEN,0)=$G(^TMP("PSOAL",$J,IEN,0))_" "_$P(MIG," ",SG) 41 K MIG,SG,I ,^UTILITY($J,"W"),DIWF,DIWL,DIWR42 K MIG,SG,I 42 43 Q 43 44 LBL ;label log … … 84 85 .I $P(P1,"^",5)]"" D 85 86 ..S PSOACBRV=$P(P1,"^",5) 86 ..;PSO*7*240 Use fileman for parsing 87 ..K ^UTILITY($J,"W") S X="Comments: "_PSOACBRV,(DIWR,DIWL)=1,DIWF="C80" D ^DIWP F I=1:1:^UTILITY($J,"W",1) S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=$G(^UTILITY($J,"W",1,I,0)) 87 ..I $L(PSOACBRV)<71 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Comments: "_PSOACBRV Q 88 ..I $E(PSOACBRV,1,70)'[" " S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Comments: "_$E(PSOACBRV,1,70),IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=$E(PSOACBRV,71,245) Q 89 ..F PSOACBRK=245:-1 Q:PSOACBRK=0 I $E(PSOACBRV,PSOACBRK)=" ",PSOACBRK<71 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Comments: "_$E(PSOACBRV,1,PSOACBRK),IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=$E(PSOACBRV,PSOACBRK,245) Q 88 90 .I $O(^PSRX(DA,"A",N,2,0)) F I=0:0 S I=$O(^PSRX(DA,"A",N,2,I)) Q:'I S MIG=^PSRX(DA,"A",N,2,I,0) D 89 91 ..F SG=1:1:$L(MIG) D … … 91 93 ...S:$P(MIG," ",SG)'="" ^TMP("PSOAL",$J,IEN,0)=$G(^TMP("PSOAL",$J,IEN,0))_" "_$P(MIG," ",SG) 92 94 D DISPREJ 93 K ^UTILITY($J,"W"),DIWR,DIWF,DIWL94 95 Q 95 96 ; -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORED1.m
r628 r636 1 PSOORED1 ;ISC-BHAM/SAB - edit orders from backdoor ; 5/10/07 8:25am2 ;;7.0;OUTPATIENT PHARMACY;**5,23,46,78,114,117,131,146,223,148,244,249,268 ,206**;DEC 1997;Build 391 PSOORED1 ;ISC-BHAM/SAB - edit orders from backdoor ;6/30/06 10:21am 2 ;;7.0;OUTPATIENT PHARMACY;**5,23,46,78,114,117,131,146,223,148,244,249,268**;DEC 1997;Build 9 3 3 ;External reference ^PS(55 supported by DBIA 2228 4 4 ;External reference ^PS(50.7 supported by DBIA 2223 … … 131 131 .S PSOX1=PTRF,PSOX=$S(PSOX1=11:11,1:PSOX1),PSOX=$S('PSOX:0,PSDAYS=90:3,1:PSOX) 132 132 .S PSDY1=$S(PSDAYS<60:11,PSDAYS'<60&(PSDAYS'>89):5,PSDAYS=90:3,1:0) S PSORENW("# OF REFILLS")=$S(PSOX'>PSDY1:PSOX,1:PSDY1) 133 I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F") !(PSODRUG("DEA")[1)!(PSODRUG("DEA")[2)S PSORENW("# OF REFILLS")=0133 I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F") S PSORENW("# OF REFILLS")=0 134 134 K PSDY,PSDY1,PTRF,PSOX,PSOX1,PSDAYS,CS 135 135 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORED2.m
r628 r636 1 1 PSOORED2 ;ISC-BHAM/SAB-edit orders from backdoor con't ;03/06/95 10:24 2 ;;7.0;OUTPATIENT PHARMACY;**2,51,46,78,102,114,117,133,159,148,247,260 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**2,51,46,78,102,114,117,133,159,148,247,260**;DEC 1997;Build 84 3 3 ;Reference to $$DIVNCPDP^BPSBUTL supported by IA 4719 4 4 ;Reference to $$ECMEON^BPSUTIL supported by IA 4410 … … 52 52 D GETS^DIQ(52.1,DA_","_DA(1)_",",".01;1;1.1;8;11;81","I","FLDS") 53 53 S:$D(^PSRX(DA(1),1,DA,0)) PSORXED("RX1")=^PSRX(DA(1),1,DA,0),(RFED,RFL)=DA 54 I $G(ST)=11!($G(ST)=12),$$STATUS^PSOBPSUT(PSORXED("IRXN"),RFL)'="" S QUIT=0 D RFE Q ;short circuit for DC'd/Expired ECME RXs55 54 D ^DIE S QUIT=$D(Y) K FEV,RFN,RFM,X,Y,DR 56 55 I '$G(DA) D REVERSE^PSOBPSU1(PSORXED("IRXN"),RFL,"DE",5) K CMRL,RFED D:$D(PSORX("PSOL"))&($G(DI)=.01) RFD Q 57 56 I 'CMRL,'QUIT S DR="1;1.2:5;8" D ^DIE S QUIT=$D(Y) 58 RFEI '$D(^PSRX(PSORXED("IRXN"),1,RFL)) Q57 I '$D(^PSRX(PSORXED("IRXN"),1,RFL)) Q 59 58 I 'QUIT,$$STATUS^PSOBPSUT(PSORXED("IRXN"),RFL)'="" D 60 59 . S NDC=$$GETNDC^PSONDCUT(PSORXED("IRXN"),RFL) … … 74 73 . . D ECMESND^PSOBPSU1(RX,RFL,,"ED",$$GETNDC^PSONDCUT(RX,RFL),,$S($P(CHANGED,"^",2):"REFILL DIVISION CHANGED",1:"REFILL EDITED"),,+$G(CHGNDC)) 75 74 . . ;- Checking/Handling DUR/79 Rejects 76 . . I $$FIND^PSOREJUT(RX,RFL) S X=$$HDLG^PSOREJU1(RX,RFL,"79,88","ED","IOQ"," Q")75 . . I $$FIND^PSOREJUT(RX,RFL) S X=$$HDLG^PSOREJU1(RX,RFL,"79,88","ED","IOQ","I") 77 76 K DIE,CMRL,DA,DR 78 77 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORED6.m
r628 r636 1 1 PSOORED6 ;BIR/SAB - edit orders from backdoor ;03/06/96 2 ;;7.0;OUTPATIENT PHARMACY;**78,104,117,133,143,219,148,247,268,260 ,269**;DEC 1997;Build42 ;;7.0;OUTPATIENT PHARMACY;**78,104,117,133,143,219,148,247,268,260**;DEC 1997;Build 84 3 3 ;External reference to ^PSDRUG supported by DBIA 221 4 4 ;External reference to ^PS(50.7 supported by DBIA 2223 … … 52 52 S DIC("B")=$P(^PS(50.7,PSOI,0),"^"),DIC="^PS(50.7,",DIC(0)="AEMQZ" 53 53 S DIC("S")="I '$P(^PS(50.7,+Y,0),""^"",4)!($P(^(0),""^"",4)'<DT) N PSOF,PSOL S (PSOF,PSOL)=0 F S PSOL=$O(^PSDRUG(""ASP"",+Y,PSOL)) Q:PSOF!'PSOL " 54 S DIC("S")=DIC("S")_"I $P($G(^PSDRUG(PSOL,2)),U,3)[""O"",'$G(^(""I""))!($G(^(""I""))'<DT) S PSOF=1" 55 ;BHW;PSO*7*269;Modify ^DIC call to call MIX^DIC to use only the B and C Cross-References. 56 S D="B^C" D MIX^DIC1 I "^"[X S PSORXED("DFLG")=1 Q 54 S DIC("S")=DIC("S")_"I $P($G(^PSDRUG(PSOL,2)),U,3)[""O"",'$G(^(""I""))!($G(^(""I""))'<DT) S PSOF=1" D ^DIC I "^"[X S PSORXED("DFLG")=1 Q 57 55 G:Y<1 PSOI Q:PSOI=+Y 58 56 S PSODRUG("OI")=+Y,PSODRUG("OIN")=Y(0,0) K DIC -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORED7.m
r628 r636 1 1 PSOORED7 ;ISC-BHAM/MFR-edit orders from backdoor con't ;03/06/95 10:24 2 ;;7.0;OUTPATIENT PHARMACY;**148,247 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**148,247**;DEC 1997;Build 18 3 3 ;called from psooredt. cmop edit checks. 4 4 ;Reference to file #50 supported by IA 221 … … 59 59 . . D ECMESND^PSOBPSU1(RX,0,,"ED",$$GETNDC^PSONDCUT(RX,0),,$S($P(CHANGED,"^",2):"RX DIVISION CHANGED",1:"RX EDITED"),,+$G(CHGNDC)) 60 60 . . ;- Checking/Handling DUR/79 Rejects 61 . . I $$FIND^PSOREJUT(RX,0) S X=$$HDLG^PSOREJU1(RX,0,"79,88","ED","IOQ"," Q")61 . . I $$FIND^PSOREJUT(RX,0) S X=$$HDLG^PSOREJU1(RX,0,"79,88","ED","IOQ","I") 62 62 Q 63 63 ; … … 72 72 I $$DIVNCPDP^BPSBUTL(+$G(PRIOR(52,RX_",",20,"I")))'=$$DIVNCPDP^BPSBUTL(+$G(SAVED(52,RX_",",20,"I"))) S CHANGED="1^1" 73 73 Q CHANGED 74 ;;75 NDCDAWDE(ST,FLN,RXN) ; allow edit of NDC & DAW for DC'd/expired ECME RXs76 ;; input: (r) ST - the Rx status code77 ;; (r) FLN - field number selected for editing78 ;; (r) RXN - prescription #79 ;; output: VALMSG for inappropriate field selection or use80 ;; PSODRUG & RSORXED arrays updated if edited81 Q:$G(ST)=""!($G(FLN)="")!($G(RXN)="")82 I '((ST=11)!(ST=12)) S VALMSG=("Invalid selection!") Q83 I '((FLN=2)!(FLN=20)!(FLN=21)) S VALMSG=("Invalid selection!") Q84 I $$STATUS^PSOBPSUT(RXN,$$LSTRFL^PSOBPSU1(RXN))="" S VALMSG=("Invalid selection!") Q85 ;86 ; edit NDCs87 I FLN=2 D Q88 .N NDC89 .S NDC=$$GETNDC^PSONDCUT(RXN,0)90 .D NDCEDT^PSONDCUT(RXN,"",$G(DRG),$G(PSOSITE),.NDC)91 .I $G(NDC)="^" Q92 .S (PSODRUG("NDC"),PSORXED("FLD",27))=NDC93 ;;94 ; edit refill NDCs/DAWs95 I FLN=20 D Q96 .I $$LSTRFL^PSOBPSU1(RXN)=0 S VALMSG="Invalid selection!" Q97 .D REF^PSOORED298 ;;99 ; edit DAW100 I FLN=21 D Q101 .N DAW102 .D EDTDAW^PSODAWUT(RXN,0,.DAW)103 .I $G(DAW)="^" Q104 .S (PSODRUG("DAW"),PSORXED("FLD",81))=DAW105 Q106 ;; -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOOREDT.m
r628 r636 1 PSOOREDT ;BIR/SAB - edit orders from backdoor ;03/06/96 2 ;;7.0;OUTPATIENT PHARMACY;**4,20,27,37,57,46,78,102,104,119,143,148,260,281**;DEC 1997;Build 41 1 PSOOREDT ;BIR/SAB - edit orders from backdoor ;1/27/07 13:22 2 ;;7.0;OUTPATIENT PHARMACY;**4,20,27,37,57,46,78,102,104,119,143,148,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 3 11 ;External reference to ^PSDRUG supported by DBIA 221 4 12 ;External reference to PSSLOCK supported by DBIA 2789 … … 38 46 Q 39 47 ; 40 EDT ; Rx Edit (Backdoor) 41 K NCPDPFLG 48 EDT S NCPDPFLG=0 42 49 S I=0 F S I=$O(^PSRX($P(PSOLST(ORN),"^",2),1,I)) Q:'I S PSORXED("RX1")=^PSRX($P(PSOLST(ORN),"^",2),1,I,0) 43 50 S (RX0,PSORXED("RX0"))=^PSRX($P(PSOLST(ORN),"^",2),0),PSORXED("RX2")=$G(^(2)),PSORXED("RX3")=$G(^(3)),PSOSIG=$P(^("SIG"),"^") … … 52 59 .D:'$G(CHK) POP^PSOSIGNO(DA),CHK Q:$G(PSORXED("DFLG")) 53 60 .S FDR="39.2^"_$S($P(PSOPAR,"^",3):"6",1:"")_";6.5^113^114^3^1^22R^24^8^7^9^4^11;"_$S($P(RX0,"^",11)="W"&($P(PSOPAR,"^",12)):"35;",1:"")_"^10.6^5^20^23^12^PSOCOU^RF^81" 54 .I $G(ST)=11!($G(ST)=12) D NDCDAWDE^PSOORED7(ST,FLN,$G(RXN)) Q55 61 .I FLN=20,'$G(REF) S VALMSG="There is no Refill Data to be edited." Q 56 62 .S DR=$P(FDR,"^",FLN) I DR="RF" D REF^PSOORED2 Q 57 63 .I DR="PSOCOU" D PSOCOU^PSOORED6 Q 58 .I FLN=2,'$P(PSOPAR,"^",3) ,$$RXRLDT^PSOBPSUT(RXN,0),$$STATUS^PSOBPSUT(RXN,0)'=""D Q64 .I FLN=2,'$P(PSOPAR,"^",3) D Q 59 65 ..N NDC D NDC^PSODRG(RXN,0,,.NDC) I $G(NDC)="^"!($G(NDC)="") Q 60 66 ..S (PSODRUG("NDC"),PSORXED("FLD",27))=NDC … … 100 106 ; 101 107 I $P(^PSRX(PSORXED("IRXN"),"STA"),"^")=14!($P(^("STA"),"^")=15) S PSORXED("DFLG")=1 S VALMSG="Discontinued prescriptions cannot be edited." Q 108 ; 109 S DIC="^VA(200,",DIC(0)="QEZ",X="AUTOFINISH,RX" ;vfah 110 D ^DIC K DIC ;vfah 111 S PSOZAF=+Y ;vfah 112 I $P($G(^PSRX(PSORXED("IRXN"),"OR1")),"^",5)=$G(PSOZAF) S PSORXED("DFLG")=1 S VALMSG="EDIT option is not available for Autofinshed Rxs" K PSOZAF Q ;vfah 113 ; 102 114 I $P(^PSRX(PSORXED("IRXN"),"STA"),"^")=16 S PSORXED("DFLG")=1 S VALMSG="Prescriptions on Provider Hold cannot be edited." Q 103 115 CHKX K PSPOP,DIR,DTOUT,DUOUT,Y,X Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORFI1.m
r628 r636 1 PSOORFI1 ;BIR/SAB - finish OP orders from OE/RR continued ;5/23/05 2:11pm 2 ;;7.0;OUTPATIENT PHARMACY;**7,15,23,27,32,44,51,46,71,90,108,131,152,186,210,222,258,260**;DEC 1997;Build 84 1 PSOORFI1 ;BIR/SAB - finish OP orders from OE/RR continued ;1/27/07 13:24 2 ;;7.0;OUTPATIENT PHARMACY;**7,15,23,27,32,44,51,46,71,90,108,131,152,186,210,222,258,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; GPL Copyright (C) 2007 WorldVistA 3 5 ;Ref. ^PS(50.7 supp. DBIA 2223 4 6 ;Ref. ^PSDRUG( supp. DBIA 221 … … 15 17 S (OI,PSODRUG("OI"))=$P(OR0,"^",8),PSODRUG("OIN")=$P(^PS(50.7,$P(OR0,"^",8),0),"^"),OID=$P(OR0,"^",9) 16 18 I $P($G(OR0),"^",9) S POERR=1,DREN=$P(OR0,"^",9) D DRG^PSOORDRG K POERR G DRG 19 I '$P(OR0,"^",9)&($G(PSOAFYN)="Y") D DISPD^PSOAFIN G DSPL ;vfah 060924 17 20 I '$P(OR0,"^",9) D DREN^PSOORNW2 18 21 DRG I $P($G(^PSDRUG(+$G(PSODRUG("IEN")),"CLOZ1")),"^")="PSOCLO1" D CLOZ^PSOORFI2 … … 72 75 . I $G(PSOMAX) S PSONEW("# OF REFILLS")=$S(+$P(OR0,"^",11)>PSOMAX:PSOMAX,1:+$P(OR0,"^",11)) Q 73 76 .S PSONEW("# OF REFILLS")=+$P(OR0,"^",11) 74 S ^TMP("PSOPO",$J,IEN,0)=^TMP("PSOPO",$J,IEN,0)_" (9) QTY"_$S($P($G(^PSDRUG(+$G(PSODRUG("IEN")),660)),"^",8)]"":" ("_$P($G(^PSDRUG(+$G(PSODRUG("IEN")),660)),"^",8)_")",1:" ( )")_": " 77 S ^TMP("PSOPO",$J,IEN,0)=^TMP("PSOPO",$J,IEN,0)_" (9) QTY"_$S($P($G(^PSDRUG(+$G(PSODRUG("IEN")),660)),"^",8)]"":" ("_$P($G(^PSDRUG(+$G(PSODRUG("IEN")),660)),"^",8)_")",1:" ( )")_": "_$P(OR0,"^",10) 75 78 S ^TMP("PSOPO",$J,IEN,0)=^TMP("PSOPO",$J,IEN,0)_$S($D(CLOZPAT):+$G(PSONEW("QTY")),1:$P(OR0,"^",10)) 76 79 I $P($G(^PSDRUG(+$G(PSODRUG("IEN")),5)),"^")]"" D … … 92 95 S Y=$P(OR0,"^",12) X ^DD("DD") S ^TMP("PSOPO",$J,IEN,0)=^TMP("PSOPO",$J,IEN,0)_"Entry Date: "_$E($P(OR0,"^",12),4,5)_"/"_$E($P(OR0,"^",12),6,7)_"/"_$E($P(OR0,"^",12),2,3)_" "_$P(Y,"@",2) K RN 93 96 S PSOACT=$S($D(^XUSEC("PSORPH",DUZ)):"DEF",'$D(^XUSEC("PSORPH",DUZ))&($P($G(PSOPAR),"^",2)):"F",1:"") 94 ; - PSOACTOV is used to force the Pending Order to be Read-Only (no updates) even if invoked by a Pharmacist95 I $G(PSOACTOV) S PSOACT=""96 97 D:'$G(ACP) EN^PSOLMPO S:$G(ACP) VALMBCK="Q" D:$G(PKI1)=2 DCP^PSOPKIV1 97 98 Q 98 99 POST ;post patient selection 99 D POST^PSOORFI2 Q 100 I $G(PSOAFYN)'="Y" D POST^PSOORFI2 Q ;vfah 101 I $G(PSOAFYN)="Y" Q ;vfah 100 102 SIG ;displays possible sig 101 103 D SIG^PSOORFI2 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORFI2.m
r628 r636 1 PSOORFI2 ;BIR/BHW-finish cprs orders cont. ;07/29/96 2 ;;7.0;OUTPATIENT PHARMACY;**7,15,23,27,46,130,146,177,222**;DEC 1997;Build 12 3 ;External reference ^YSCL(603.01 supported by DBIA 2697 4 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789 1 PSOORFI2 ;BIR/BHW-finish cprs orders cont. ;1/27/07 13:25 2 ;;7.0;OUTPATIENT PHARMACY;**7,15,23,27,46,130,146,177,222,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; GPL Copyright (C) 2007 WorldVistA 5 ;Ext ref ^YSCL(603.01 supported by DBIA 2697 6 ;Ext refs PSOL and PSOUL^PSSLOCK supported by DBIA 2789 5 7 HLP W !,"Enter 'S' to process orders with a priority of STAT",!," 'E' to process orders with an Emergency priority,",!," 'R' to process Routine orders.",! Q 6 8 HELP ; … … 20 22 .I $P($G(^PS(52.41,PSZFZZ,0)),"^",3)="NW"!($P($G(^(0)),"^",3)="RNW")!($P($G(^(0)),"^",3)="RF") I $P($G(^PS(52.41,PSZFZZ,"INI")),"^")=$G(PSOPINST) S PSZFIN=0 21 23 Q 22 PROFILE ;display med profile 23 S MEDA=3 ;3=question asked already 24 W !!! K MEDP,DIR,DUOUT,DIRUT,DTOUT S DIR(0)="Y",DIR("B")="Yes",DIR("A")="Do you want to see Medication Profile" D ^DIR K DIR Q:$D(DIRUT)!('Y) 25 I Y S MEDP=1 24 PROFILE ; 25 S MEDA=3 26 I $G(PSOAFYN)'="Y" W !!! K MEDP,DIR,DUOUT,DIRUT,DTOUT S DIR(0)="Y",DIR("B")="Yes",DIR("A")="Do you want to see Medication Profile" D ^DIR K DIR Q:$D(DIRUT)!('Y) 27 I $G(PSOAFYN)'="Y" I Y S MEDP=1 28 I $G(PSOAFYN)="Y" K MEDP 26 29 K DIR,DUOUT,DIRUT,DTOUT 27 30 Q 28 31 DC I '$G(PSOORRNW),$G(PSOOPT)=3 S PSORENW("DFLG")=1 S:'$D(PSOBBC1("FROM")) VALMBCK="Q",VALMSG="Renew Rx Request Canceled.",Y=-1 Q 29 N VALMCNT W ! K DIR,DUOUT,DIROUT,DTOUT,PSOELSE I '$G(PSOERR("DEAD")) S PSOELSE=1 D Q:$D(DIRUT)32 I $G(PSOAFYN)'="Y" N VALMCNT W ! K DIR,DUOUT,DIROUT,DTOUT,PSOELSE I '$G(PSOERR("DEAD")) S PSOELSE=1 D Q:$D(DIRUT) 30 33 .D NOOR^PSOCAN4 Q:$D(DIRUT) 31 34 .S DIR("A")="Comments",DIR(0)="F^10:75",DIR("B")="Per Pharmacy Request" D ^DIR K DIR 35 I $G(PSOAFYN)="Y" N VALMCNT K DIR,DUOUT,DIROUT,DTOUT,PSOELSE I '$G(PSOERR("DEAD")) S PSOELSE=1 D Q:$D(DIRUT) ;vfah 36 .D NOOR^PSOCAN4 Q:$D(DIRUT) ;vfah 37 .S Y="Rx AutoFinish" ;vfah 38 I $G(PSOAFYN)'="Y" S PSOELSE="1" 32 39 I '$G(PSOELSE) K PSOELSE S PSONOOR="A" G DE 33 40 K PSOELSE I $D(DIRUT) K DIRUT,DUOUT,DTOUT,Y Q 34 41 S ACOM=Y 35 DE Q:'$D(^PS(52.41,ORD,0)) 42 DE I $G(PSOAFYN)="Y" Q 43 I $G(PSOAFYN)'="Y" Q:'$D(^PS(52.41,ORD,0)) 36 44 K ^PS(52.41,"AOR",$P(^PS(52.41,ORD,0),"^",2),+$P($G(^PS(52.41,ORD,"INI")),"^"),ORD),^PS(52.41,"AD",$P(^PS(52.41,ORD,0),"^",12),+$P($G(^PS(52.41,ORD,"INI")),"^"),ORD) 37 45 S $P(^PS(52.41,ORD,0),"^",3)="DC",POERR("PLACER")=$P(^(0),"^"),POERR("STAT")="OC" … … 42 50 S Y=-1 Q 43 51 ; 44 RF ; process refill request from CPRS52 RF ; 45 53 S PSOREF("IRXN")=$P(OR0,"^",19) D PSOL^PSSLOCK($P(OR0,"^",19)) I '$G(PSOMSG) D D PAUSE^VALM1 K PSOREF,PSOMSG Q 46 54 .I $P($G(PSOMSG),"^",2)'="" W $C(7),!!,$P(PSOMSG,"^",2),! Q … … 52 60 S PSONEW("DAYS SUPPLY")=$P(^PSRX(PSOREF("IRXN"),0),"^",8),PSONEW("# OF REFILLS")=$P(^(0),"^",9) D FULL^VALM1 53 61 W !!,"Processing Refill Request for Rx "_$P(^PSRX(PSOREF("IRXN"),0),"^") 54 ;S:$G(PSOREQFD)]"" PSORX("FILL DATE")=PSOREQFD55 62 D FILLDT^PSODIR2(.PSOREF) I PSOREF("DFLG") S VALMBCK="R" G END 56 ;S:$G(PSORX("FILL DATE"))]"" PSOREQFD=PSORX("FILL DATE")57 63 ; 58 ;S:$G(PSOREQMP)]"" PSORX(" METHOD OF PICK-UP")=PSOREQMP59 64 S PSORX("MAIL/WINDOW")=$S($P(OR0,"^",17)="M":"MAIL",1:"WINDOW") D MW^PSODIR2(.PSOREF) I PSOREF("DFLG") S VALMBCK="R" G END 60 ;S:$G(PSORX("METHOD OF PICK-UP"))]"" PSOREQMP=PSORX("METHOD OF PICK-UP")61 65 S:'$G(PSOFROM)'="NEW" PSOFROM="REFILL" S PSOREF("DFLG")=0 62 66 D ^PSOREF0 … … 88 92 KPRIZ K PSOQUIT,POERR("QFLG") 89 93 Q 90 INST ; Select Institution94 INST ; 91 95 I '$G(PSOSITE) D ^PSOLSET I '$G(PSOSITE) S PSOIQUIT=1 Q 92 96 N PSIR,PSCT,PSINST K PSOPINST 93 S PSCT=0 F PSIR=0:0 S PSIR=$O(^PS(59,PSOSITE,"INI1",PSIR)) Q:'PSIR I $P($G(^PS(59,PSOSITE,"INI1",PSIR,0)),"^") S PSCT=PSCT+1 I PSCT=1 S PSOPINST=$P($G(^(0)),"^") 97 I $G(PSOAFYN)="Y" S PSCT=1,PSOPINST=+ORL ;vfah selects CPRS Ordering Institution if autofinishing and non-interactive 98 I $G(PSOAFYN)'="Y" S PSCT=0 F PSIR=0:0 S PSIR=$O(^PS(59,PSOSITE,"INI1",PSIR)) Q:'PSIR I $P($G(^PS(59,PSOSITE,"INI1",PSIR,0)),"^") S PSCT=PSCT+1 I PSCT=1 S PSOPINST=$P($G(^(0)),"^") ;vfah 94 99 I PSCT=0 W !!,"There are no CPRS Ordering Institutions associated with this Outpatient site!",!,"Use the Site Parameter enter/edit option to enter CPRS Ordering Institutions!",! S PSOIQUIT=1 Q 95 100 I PSCT=1 Q … … 104 109 F PSIR=0:0 S PSIR=$O(^PS(59,PSOSITE,"INI1",PSIR)) Q:'PSIR!($G(PSOPINST)) I $P($G(^PS(59,PSOSITE,"INI1",PSIR,0)),"^") S PSOPINST=$P($G(^(0)),"^") 105 110 Q 106 CLOZ ; checks clozapine status of patient111 CLOZ ; 107 112 S CLOZPAT=$O(^YSCL(603.01,"C",PSODFN,0)) 108 113 S CLOZPAT=$P($G(^YSCL(603.01,+CLOZPAT,0)),"^",3) … … 113 118 I $G(CLOZPAT)=2 S IEN=IEN+1,^TMP("PSOPO",$J,IEN,0)=" Patient Eligible for 28 Day Supply or 14 Day Supply with 1 refill or 7 Day Supply with 3 refill" 114 119 Q 115 USER(USER) ; returns .01 of 200120 USER(USER) ; 116 121 K DIC,X,Y S DIC="^VA(200,",DIC(0)="M",X="`"_USER D ^DIC S USER1=$S(+Y:$P(Y,"^",2),1:"Unknown") K DIC,X,Y 117 122 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORFI3.m
r628 r636 1 PSOORFI3 ;BIR/RTR-finish CPRS orders by Clinic ;11/09/98 2 ;;7.0;OUTPATIENT PHARMACY;**15,27,32,46,84,99,130,117,139,172**;DEC 1997 1 PSOORFI3 ;BIR/RTR-finish CPRS orders by Clinic ;5/14/07 10:07 2 ;;7.0;OUTPATIENT PHARMACY;**15,27,32,46,84,99,130,117,139,172,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; GPL Copyright (C) 2007 WorldVistA 3 5 ;PPPPDA1-1374,SC(-2675,40.8-728,51.2-2226,50.607-2221,55-2228,PSSLOCK-2789,DPT-10035,ORX2-867 4 6 ; … … 58 60 L1 ;Lock single order 59 61 I '$G(ORD) Q 60 K PSOMSG D PSOL^PSSLOCK(+ORD_"S") I '$G(PSOMSG) W !!,$S($P($G(PSOMSG),"^",2)'="":$P($G(PSOMSG),"^",2),1:"This Order is being edited by another person."),! K DIR S DIR(0)="E",DIR("A")="Press Return to Continue" D ^DIR K DIR62 K PSOMSG D PSOL^PSSLOCK(+ORD_"S") I '$G(PSOMSG),'$D(ZTSK) W !!,$S($P($G(PSOMSG),"^",2)'="":$P($G(PSOMSG),"^",2),1:"This Order is being edited by another person."),! K DIR S DIR(0)="E",DIR("A")="Press Return to Continue" D ^DIR K DIR 61 63 Q 62 64 UL1 ;Unlock single order -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORFI4.m
r628 r636 1 PSOORFI4 ;BIR/SAB-CPRS order checks and display con't ; 6/28/07 7:36am 2 ;;7.0;OUTPATIENT PHARMACY;**46,74,78,99,117,131,207,258,274**;DEC 1997;Build 8 1 PSOORFI4 ;BIR/SAB-CPRS order checks and display con't ;1/27/07 13:26 2 ;;7.0;OUTPATIENT PHARMACY;**46,74,78,99,117,131,207,258,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; GPL Copyright (C) 2007 WorldVistA 3 5 ;External reference to ^PS(51.2 supported by DBIA 2226 4 6 ;External reference to ^PS(50.607 supported by DBIA 2221 … … 30 32 .D EN^DDIOL("Provider Comments: ","","!") 31 33 .F I=0:0 S I=$O(PRC(I)) Q:'I D EN^DDIOL(PRC(I),"","!") 32 .D KV^PSOVER1 S DIR(0)="Y",DIR("A")="Copy Provider Comments into the Patient Instructions",DIR("B")="No" 33 .D ^DIR Q:'Y!($D(DIRUT)) 34 .I $G(PSOAFYN)="Y" D KV^PSOVER1 ;vfam 35 .I $G(PSOAFYN)'="Y" D KV^PSOVER1 S DIR(0)="Y",DIR("A")="Copy Provider Comments into the Patient Instructions",DIR("B")="No" ;vfam 36 .I $G(PSOAFYN)'="Y" D ^DIR Q:'Y!($D(DIRUT)) ;vfam 37 .I $G(PSOAFYN)="Y" Q ;vfam Provider Comments NOT Copied Into Patient Instructions 34 38 .S PSOPRC=1,NI=0 F I=0:0 S I=$O(PSONEW("SIG",I)) Q:'I S NI=I 35 39 .S NC=0 F I=0:0 S I=$O(PRC(I)) Q:'I S NC=NC+1 36 .I NI'>1,NC=1,($L($G(PSONEW("SIG",NI)))+$L(PRC(1)))'>250 D Q 37 ..S X=PRC(1) D SIGONE^PSOHELP 38 ..S PSONEW("SIG",1)=$G(PSONEW("SIG",NI))_INS1 K INS1,X 40 .I NI'>1,NC=1,($L($G(PSONEW("SIG",NI)))+$L(PRC(1)))'>250 D Q 41 ..S PSONEW("SIG",1)=$G(PSONEW("SIG",NI))_" "_PRC(1) 39 42 ..S:$E(PSONEW("SIG",1))=" " PSONEW("SIG",1)=$E(PSONEW("SIG",1),2,250) S PSONEW("INS")=PSONEW("SIG",1) D EN^PSOFSIG(.PSONEW,1) K NI,NC 40 .F I=0:0 S I=$O(PRC(I)) Q:'I S NI=NI+1,(PSONEW(" INS",NI),X)=PRC(I) D SIGONE^PSOHELP S PSONEW("SIG",NI)=INS1 K INS143 .F I=0:0 S I=$O(PRC(I)) Q:'I S NI=NI+1,(PSONEW("SIG",NI),PSONEW("INS",NI))=PRC(I) 41 44 .I $E(PSONEW("SIG",1))=" " S PSONEW("SIG",1)=$E(PSONEW("SIG",1),2,250) 42 .D EN^PSOFSIG(.PSONEW,1) K NI,NC ,X45 .D EN^PSOFSIG(.PSONEW,1) K NI,NC 43 46 Q 44 47 DOSE ;displays dosing info for pending orders. called from psoorfi1 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORFIN.m
r628 r636 1 PSOORFIN ;BIR/SAB-finish cprs orders ;12/21/04 3:24pm 2 ;;7.0;OUTPATIENT PHARMACY;**7,15,27,32,44,46,84,106,111,117,131,146,139,195**;DEC 1997 1 PSOORFIN ;BIR/SAB-finish cprs orders ;5/14/07 09:47 2 ;;7.0;OUTPATIENT PHARMACY;**7,15,27,32,44,46,84,106,111,117,131,146,139,195,208**;DEC 1997;Build 39 3 ; Modified from FOIA VistA 4 ; Copyright (C) GNU GPL 2007 WorldVistA 5 ; 3 6 ;PSSLOCK-2789,PSDRUG-221,50.7-2223,55-2228,50.606-2174 4 D:'$D(PSOPAR) ^PSOLSET I '$D(PSOPAR) D MSG^PSODPT G EX 7 I $G(PSOAFYN)'="Y" D:'$D(PSOPAR) ^PSOLSET I '$D(PSOPAR) D MSG^PSODPT G EX ;vfah 8 I $G(PSOAFYN)="Y" D:'$D(PSOPAR) ^PSOAFSET I '$D(PSOPAR) D MSG^PSODPT G EX ;vfah 5 9 D INST^PSOORFI2 I $G(PSOIQUIT) K PSOIQUIT G EX 6 10 I $P($G(PSOPAR),"^",2),'$D(^XUSEC("PSORPH",DUZ)) S PSORX("VERIFY")=1 7 S (PSOFIN,POERR)=1 K PSOBCK,MEDA,MEDP,SRT,DIR D KQ S DIR("?")="^D ST^PSOORFI1",DIR("A")="Select By",DIR("B")="PATIENT",DIR(0)="SMB^PA:PATIENT;RT:ROUTE;PR:PRIORITY;CL:CLINIC;E:EXIT" D ^DIR I $D(DIRUT)!(Y="E") G EX 11 I $G(PSOAFYN)'="Y" S (PSOFIN,POERR)=1 K PSOBCK,MEDA,MEDP,SRT,DIR D KQ S DIR("?")="^D ST^PSOORFI1",DIR("A")="Select By",DIR("B")="PATIENT",DIR(0)="SMB^PA:PATIENT;RT:ROUTE;PR:PRIORITY;CL:CLINIC;E:EXIT" D ^DIR I $D(DIRUT)!(Y="E") G EX ;vfah 12 I $G(PSOAFYN)'="Y" S (PSOFIN,POERR)=1 K PSOBCK,MEDA,MEDP,SRT,DIR D KQ ;vfah 13 I $G(PSOAFYN)="Y" S Y="PA" ;vfah 8 14 G:Y="PA" PAT G:Y="PR" PRI G:Y="CL" ^PSOORFI3 9 15 K DIR S PSOSORT="ROUTE" 10 16 S DIR("?")="^D RT^PSOORFI1",DIR("A")="Route",DIR(0)="SBM^W:WINDOW;M:MAIL;C:CLINIC;E:EXIT",DIR("B")="WINDOW" 11 17 D ^DIR G:$D(DIRUT)!(Y="E") EX S PSOSORT=PSOSORT_"^"_Y,PSRT=Y 18 I $G(PSOAFYN)="Y" S PSOSORT="ROUTE^WINDOW",PSRT="WINDOW" ;vfah 12 19 S LG=0,PATA=0 F S LG=$O(^PS(52.41,"AD",LG)) Q:'LG!($G(POERR("QFLG"))) F PSOD=0:0 S PSOD=$O(^PS(52.41,"AD",LG,PSOPINST,PSOD)) Q:'PSOD!($G(POERR("QFLG"))) D 13 20 .Q:$G(PAT($P(^PS(52.41,PSOD,0),"^",2)))=$P(^PS(52.41,PSOD,0),"^",2) S PAT=$P(^PS(52.41,PSOD,0),"^",2) … … 44 51 .D KQ F S ORD=$O(^PS(52.41,"AC",PAT,"W",ORD)) Q:'ORD!($G(POERR("QFLG"))) D:$P(^PS(52.41,ORD,0),"^",3)'="DC"&($P(^(0),"^",3)'="DE") LK1,ORD 45 52 Q 46 PAT W ! K MEDP,MEDA,POERR("DFLG"),DIR D KQ S PSOSORT="PATIENT" 47 S DIR("?")="^D PT^PSOORFI1",DIR("A")="All Patients or Single Patient",DIR(0)="SBM^A:ALL;S:SINGLE;E:EXIT",DIR("B")="SINGLE" 48 D ^DIR K DIR G:$D(DIRUT)!(Y="E") EX I Y="S" S PSOSORT=PSOSORT_"^"_"SINGLE" G SPAT 53 PAT I $G(PSOAFYN)'="Y" W ! K MEDP,MEDA,POERR("DFLG"),DIR D KQ S PSOSORT="PATIENT" ;vfah 54 I $G(PSOAFYN)="Y" K MEDP,MEDA,POERR("DFLG"),DIR D KQ S PSOSORT="PATIENT" ;vfah 55 I $G(PSOAFYN)'="Y" S DIR("?")="^D PT^PSOORFI1",DIR("A")="All Patients or Single Patient",DIR(0)="SBM^A:ALL;S:SINGLE;E:EXIT",DIR("B")="SINGLE" ;vfah 56 I $G(PSOAFYN)'="Y" D ^DIR K DIR G:$D(DIRUT)!(Y="E") EX I Y="S" S PSOSORT=PSOSORT_"^"_"SINGLE" G SPAT ;vfah 57 I $G(PSOAFYN)="Y" S PSOSORT=PSOSORT_"^"_"SINGLE" G SPAT ;vfah 49 58 S PSOSORT=PSOSORT_"^ALL" 50 59 S LG=0,PATA=0 F S LG=$O(^PS(52.41,"AD",LG)) Q:'LG!($G(POERR("QFLG"))) F PSOD=0:0 S PSOD=$O(^PS(52.41,"AD",LG,PSOPINST,PSOD)) Q:'PSOD!($G(POERR("QFLG"))) D:$D(^PS(52.41,PSOD,0)) … … 64 73 G EX 65 74 SPAT K MEDA,MEDP,PSOQFLG,PSORX("FN") D KQ,KV^PSOVER1 66 S DIR(0)="FO^2:30",DIR("A")="Select Patient",DIR("?")="^D HELP^PSOORFI2" D ^DIR I $E(X)="?" G SPAT 67 G:$D(DIRUT) EX D KV^PSOVER1 68 S DIC(0)="EQM",DIC=2,DIC("S")="I $D(^PS(52.41,""AOR"",+Y,PSOPINST))" 69 D ^DIC K DIC G:"^"[X EX G:Y=-1 SPAT S (PSODFN,PAT)=+Y,PSOFINY=Y 75 ;PSOAFIN begin SPAT 76 I $G(PSOAFDON)=1 G EX ;vfah 77 I $G(PSOAFYN)'="Y" S DIR(0)="FO^2:30",DIR("A")="Select Patient",DIR("?")="^D HELP^PSOORFI2" D ^DIR I $E(X)="?" G SPAT ;vfah 78 I $G(PSOAFYN)'="Y" G:$D(DIRUT) EX D KV^PSOVER1 ;vfah 79 I $G(PSOAFYN)'="Y" S DIC(0)="EQM",DIC=2,DIC("S")="I $D(^PS(52.41,""AOR"",+Y,PSOPINST))" ;vfah 80 I $G(PSOAFYN)'="Y" D ^DIC K DIC G:"^"[X EX G:Y=-1 SPAT S (PSODFN,PAT)=+Y,PSOFINY=Y ;vfah 81 ;PSOAFIN end SPAT 70 82 D LK I $G(POERR("QFLG")) G SPAT 71 83 N SNGLPAT S SNGLPAT=1 … … 73 85 D PP,SDFN,POST^PSOORFI1 D:$G(PSOQFLG) G:$G(PSOQFLG) EX I $G(PSOQUIT) S:$G(PSOQUIT) POERR("QFLG")=1 S X=PAT D ULP G SPAT 74 86 .S X=PAT D ULP 75 S ORD=0 F S ORD=$O(^PS(52.41,"P",PAT,ORD)) Q:'ORD!($G(POERR("QFLG"))) D87 I PSOAFYN'="Y" S ORD=0 F S ORD=$O(^PS(52.41,"P",PAT,ORD)) Q:'ORD!($G(POERR("QFLG"))) D ;vhah 76 88 .D:$P(^PS(52.41,ORD,0),"^",3)'="DC"&($P(^(0),"^",3)'="DE")&($P(^(0),"^",3)'="HD") LK1,ORD 89 I PSOAFYN="Y" S ORD=0,ORD=$O(^PS(52.41,"B",+ORDERID,ORD)) D:$P(^PS(52.41,ORD,0),"^",3)'="DC"&($P(^(0),"^",3)'="DE")&($P(^(0),"^",3)'="HD") LK1,ORD ;vfah 77 90 I $O(PSORX("PSOL",0))!($D(RXRS)) D LBL 91 I $G(PSOAFYN)="Y" S PSOAFDON=1 ;vfah 78 92 S PSOFIN=1,X=PAT D ULP G SPAT 79 93 ORD I $G(PSOBCK) N LST,ORN … … 91 105 .K PSOREEDT S (PSOORRNW,PSOFDR)=1,PSORENW("OIRXN")=$P(OR0,"^",21),PSOOPT=3,(PSORENW("DFLG"),PSORENW("QFLG"))=0 D ^PSOORRNW,SQR^PSOORFI3 92 106 I $P(OR0,"^",3)="RF",$D(^PSRX(+$P(OR0,"^",19),0)) D RF^PSOORFI2 G SUCC 93 N PSODRUG,PSONEW S PSOFROM="PENDING" D:'$G(PSOTPBFG) DSPL^PSOTPCAN(ORD) D DSPL^PSOORFI1 ,SQN^PSOORFI3107 N PSODRUG,PSONEW S PSOFROM="PENDING" D:'$G(PSOTPBFG) DSPL^PSOTPCAN(ORD) D DSPL^PSOORFI1:'$D(ZTSK),SQN^PSOORFI3 94 108 SUCC ; 95 D UL1^PSOORFI3,FULL^VALM1 96 D:$P($G(^PS(52.41,+$G(ORD),0)),"^",3)'="NW"&($P($G(^(0)),"^",3)'="RNW")&($P($G(^(0)),"^",3)'="HD")&($P($G(^(0)),"^",3)'="RF") 97 .K PSOSD("PENDING",$S('$G(OID):$P(^PS(50.7,$P(OR0,"^",8),0),"^")_" "_$P(^PS(50.606,$P(^PS(50.7,$P(OR0,"^",8),0),"^",2),0),"^"),1:$P(^PSDRUG($P(OR0,"^",9),0),"^"))) 98 S:$G(POERR("DFLG")) POERR("QFLG")=1 K POERR("DFLG"),PSONEW,ACP,OR0,DRET,SIG,OID,OI,PSORX("SC"),PSORX("CLINIC"),PSODRUG 109 D SUCC^PSOORFI5 99 110 Q 100 LBL S PSOFROM="NEW" D ^PSORXL K PSORX("PSOL"),PPL,RXRS 101 D:$D(BINGCRT)&($D(BINGRTE)&($D(DISGROUP))) ^PSOBING1 K BINGCRT,BINGRTE,PSONEW,BBFLG,BBRX 111 ; 112 LBL ; 113 D LBL^PSOORFI5 102 114 Q 115 ; 103 116 CHK ; 104 D:'$D(PSOPAR) ^PSOLSET I '$D(PSOPAR) W !,$C(7),"Outpatient Division MUST be selected!",! G EX 105 D INST1^PSOORFI2 106 S PSZCNT=0 F PSZZI=0:0 S PSZZI=$O(^PS(59,PSZZI)) Q:'PSZZI S PSZCNT=PSZCNT+1 107 S TC=0 F TO=0:0 S TO=$O(^PS(52.41,"AOR",TO)) Q:'TO F TZ=0:0 S TZ=$O(^PS(52.41,"AOR",TO,TZ)) Q:'TZ F PSTZ=0:0 S PSTZ=$O(^PS(52.41,"AOR",TO,TZ,PSTZ)) Q:'PSTZ S TC=TC+1 108 W !!?10,$C(7),"Orders to be completed"_$S(PSZCNT=1:": ",1:" for all divisions: ")_TC,! Q:'TC 109 D SUMM^PSOORNE1 K PSZZI,PSZCNT,PSTZ 117 D CHK^PSOORFI5 110 118 Q 119 ; 111 120 PRI K DIR S PSOSORT="PRIORITY" 112 121 S DIR("A")="Select Priority",DIR(0)="SBM^S:STAT;E:EMERGENCY;R:ROUTINE",DIR("B")="ROUTINE" -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORNE2.m
r628 r636 1 1 PSOORNE2 ;BIR/SAB-display finished orders from backdoor ; 9/11/06 10:24am 2 ;;7.0;OUTPATIENT PHARMACY;**11,21,23,27,32,37,46,84,103,117,131,146,156,210,148,222,238,264 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**11,21,23,27,32,37,46,84,103,117,131,146,156,210,148,222,238,264**;DEC 1997;Build 19 3 3 ;^PSDRUG( - 221 4 4 ;^YSCL(603.01 - 2697 … … 31 31 .S CLOZPAT=$S(CLOZPAT="M":2,CLOZPAT="B":1,1:0) 32 32 I $D(^XUSEC("PSORPH",DUZ)) S RPH=1 D 33 .S PSOACT=$S('ST&($G(INDT)]"")&(DT>$G(INDT)):"DHPLATC",ST=1:"DVE",ST=4:"DV",ST=3:"DU",ST=5:"ELTD",ST=11:" ETDPCL",ST=12&EXDT:"EDCL",ST=12&'EXDT:"ECL",ST>12&(ST'=16):"L",ST=16:"DL",1:"DHPEATCL")33 .S PSOACT=$S('ST&($G(INDT)]"")&(DT>$G(INDT)):"DHPLATC",ST=1:"DVE",ST=4:"DV",ST=3:"DU",ST=5:"ELTD",ST=11:"TDPCL",ST=12&EXDT:"DCL",ST=12&'EXDT:"CL",ST>12&(ST'=16):"L",ST=16:"DL",1:"DHPEATCL") 34 34 .D GET^PSOORNE5 S PSOACT=PSOACT_$S(ACTREN:"N",1:""),PSOACT=PSOACT_$S(ACTREF:"R",1:"") 35 35 .I ST=5 S SURX=$O(^PS(52.5,"B",RXN,0)) I SURX,$P($G(^PS(52.5,SURX,0)),"^",7)="L" S PSOACT="TL" K SURX Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORNE4.m
r628 r636 1 PSOORNE4 ;BIR/SAB-display renew RXs from backdoor ;07/29/96 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,32,36,46,75,96,103,99,117,131**;DEC 1997 1 PSOORNE4 ;BIR/SAB-display renew RXs from backdoor ;1/27/07 13:28 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,32,36,46,75,96,103,99,117,131,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; GPL Copyright (C) 2007 WorldVistA 3 5 ;^SC DBIA-10040;^PS(50.7-2223;^PS(50.606-2174;^PS(50.607-2221;^PS(51.2-2226;^PSDRUG-221;^PS(55-2228 4 6 EN(PSONEW) N FLD,LST,VALMCNT … … 7 9 .K PSONEW("DOSE"),PSONEW("UNITS"),PSONEW("DOSE ORDERED"),PSONEW("ROUTE") 8 10 .K PSONEW("SCHEDULE"),PSONEW("DURATION"),PSONEW("CONJUNCTION"),PSONEW("NOUN"),PSONEW("VERB"),PSOPRC,PSONEW("ODOSE") 9 RDD D DSPL,^PSOLMRN D:$G(PKI1)=2 DCP^PSOPKIV1 I $G(PSORX("FN")) S VALMBCK="Q" K PSOREEDT Q 10 G:'$G(PSOQUIT) RDD 11 RDD I $G(PSOAFYN)'="Y" D DSPL,^PSOLMRN D:$G(PKI1)=2 DCP^PSOPKIV1 I $G(PSORX("FN")) S VALMBCK="Q" K PSOREEDT Q ;vfah 12 I $G(PSOAFYN)="Y" D ACP D:$G(PKI1)=2 DCP^PSOPKIV1 I $G(PSORX("FN")) S VALMBCK="Q" K PSOREEDT Q ;vfah D ACP from D ACP^PSOLMRN above 13 I $G(PSOAFYN)'="Y" G:'$G(PSOQUIT) RDD ;vfah 11 14 Q 12 15 EDT D KV^PSOVER1 S DIR("A")="Select Field to Edit by number",DIR(0)="LO^1:"_$S($G(PSOREEDT):10,1:8) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORNE5.m
r628 r636 1 PSOORNE5 ;BIR/SAB - display orders from backdoor con't ;5/ 10/07 8:29am2 ;;7.0;OUTPATIENT PHARMACY;**11,27,32,46,78,99,117,131,146,171,180,210,222,268 ,206**;DEC 1997;Build 391 PSOORNE5 ;BIR/SAB - display orders from backdoor con't ;5/23/05 1:46pm 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,32,46,78,99,117,131,146,171,180,210,222,268**;DEC 1997;Build 9 3 3 ;External reference to ^PSDRUG supported by DBIA 221 4 4 ;External references L and UL^PSSLOCK supported by DBIA 2789 … … 51 51 F DEA=1:1 Q:$E(PSODRUG("DEA"),DEA)="" I $E(+PSODRUG("DEA"),DEA)>1,$E(+PSODRUG("DEA"),DEA)<6 S $P(PSODIR("CS"),"^")=1 S:$E(+PSODRUG("DEA"),DEA)=2 $P(PSODIR("CS"),"^",2)=1 52 52 I $P($G(PSODIR("CS")),"^",2)=1 S (PSONEW("# OF REFILLS"),PSONEW("N# REF"))=0 Q 53 I '$D(CLOZPAT) I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F") !(PSODRUG("DEA")[1)!(PSODRUG("DEA")[2)S (PSONEW("# OF REFILLS"),PSONEW("N# REF"))=0 Q53 I '$D(CLOZPAT) I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F") S (PSONEW("# OF REFILLS"),PSONEW("N# REF"))=0 Q 54 54 I $D(CLOZPAT) S (PSONEW("# OF REFILLS"),PSONEW("N# REF"))=$S($G(CLOZPAT)=2&(PSONEW("DAYS SUPPLY")=14):1,$G(CLOZPAT)=2&(PSONEW("DAYS SUPPLY")=7):3,$G(CLOZPAT)=1&(PSONEW("DAYS SUPPLY")=7):1,1:0) Q 55 55 I PSODIR("CS") D … … 72 72 S:PSORFRM<0 PSORFRM=0 S:PSORFRM=0 ACTREF=0 73 73 I $G(RXFL(RXN))]"",'$P(PSOPAR,"^",6) S ACTREF=0 74 I $P(PSODRUG0,"^",3)["A"&($P(PSODRUG0,"^",3)'["B")!($P(PSODRUG0,"^",3)["F") !($P(PSODRUG0,"^",3)[1)!($P(PSODRUG0,"^",3)[2)S ACTREF=074 I $P(PSODRUG0,"^",3)["A"&($P(PSODRUG0,"^",3)'["B")!($P(PSODRUG0,"^",3)["F") S ACTREF=0 75 75 ;renews 76 76 I $P(PSOPAR,"^",4)=0 S ACTREN=0 Q … … 78 78 I $G(^PSDRUG(PSODRG,"I"))]"",DT>$G(^("I")) S ACTREN=0,VALMSG="This Drug has been Inactivated." 79 79 I '$P($G(^PSDRUG(PSODRG,2)),"^"),'$P($G(^PSRX(RXN,"OR1")),"^") S ACTREN=0,VALMSG="Drug must be Matched to an Orderable Item!" 80 I ($P(PSODRUG0,"^",3)["W")!($P(PSODRUG0,"^",3)[1)!($P(PSODRUG0,"^",3)[2) S ACTREN=0 80 I $P(PSODRUG0,"^",3)["A",$P(PSODRUG0,"^",3)'["B" S ACTREN=0 81 I $P(PSODRUG0,"^",3)["W" S ACTREN=0 81 82 I $D(^PS(53,+$P(RX0,"^",3),0)),'$P(^(0),"^",5) S ACTREN=0 82 83 S PSOLC=$P(RX0,"^"),PSOLC=$E(PSOLC,$L(PSOLC)) I $A(PSOLC)'<90 S ACTREN=0 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORNEW.m
r628 r636 1 PSOORNEW ;BIR/SAB - display orders from oerr ;4/25/07 8:50am 2 ;;7.0;OUTPATIENT PHARMACY;**11,23,27,32,55,46,71,90,94,106,131,133,143,237,222,258,206**;DEC 1997;Build 39 1 PSOORNEW ;BIR/SAB - display orders from oerr ;1/27/07 13:29 2 ;;7.0;OUTPATIENT PHARMACY;**11,23,27,32,55,46,71,90,94,106,131,133,143,237,222,258,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 3 11 ;^PS(50.7 -2223 4 12 ;^PSDRUG -221 5 13 ;^PS(50.606 -2174 6 14 ;^PS(55 -2228 7 ;8 15 ;PSO*237 quit Finish if Today > Issue date + 365 9 ;10 16 DSPL I $G(PSODSPL) S VALMBCK="Q" K PSODSPL,PSOANSQD Q 11 17 Q:'$D(PSOLMC) K ^TMP("PSOPO",$J) S PSOLMC=PSOLMC+1 … … 15 21 .S (OI,PSODRUG("OI"))=$P(OR0,"^",8),PSODRUG("OIN")=$P(^PS(50.7,$P(OR0,"^",8),0),"^"),OID=$P(OR0,"^",9) 16 22 .I $P($G(OR0),"^",9) S POERR=1,DREN=$P(OR0,"^",9) D DRG^PSOORDRG K POERR 17 I '$D(CLOZPAT) I $G(PSODRUG("DEA"))["A",$G(PSODRUG("DEA"))'["B"!($G(PSODRUG("DEA"))["F") !($G(PSODRUG("DEA"))[1)!($G(PSODRUG("DEA"))[2)S PSONEW("# OF REFILLS")=023 I '$D(CLOZPAT) I $G(PSODRUG("DEA"))["A",$G(PSODRUG("DEA"))'["B"!($G(PSODRUG("DEA"))["F") S PSONEW("# OF REFILLS")=0 18 24 I $D(CLOZPAT) S PSONEW("# OF REFILLS")=$S($D(PSONEW("# OF REFILLS")):PSONEW("# OF REFILLS"),$G(CLOZPAT)=2&($P(OR0,"^",11)>2):3,$G(CLOZPAT)&($P(OR0,"^",11)>1):1,1:0) 19 25 S IEN=0 D OBX^PSOORFI1,DIN^PSONFI(PSODRUG("OI"),$S($G(PSODRUG("IEN")):PSODRUG("IEN"),1:"")) … … 66 72 S:PSOLMC>1 VALMBCK="R" 67 73 Q 68 ORCHK D PROVCOM^PSOORFI4,ORCHK^PSOORFI4 74 ORCHK D PROVCOM^PSOORFI4 75 I $G(PSOAFYN)'="Y" D ORCHK^PSOORFI4 69 76 Q 70 77 EDT D KV S DIR("A",1)="* Indicates which fields will create an new Order",DIR("A")="Select Field to Edit by number",DIR(0)="LO^1:15" D ^DIR Q:$D(DTOUT)!($D(DUOUT)) … … 85 92 D RXNCHK^PSOORNE1 I $G(PSONEW("QFLG")) S PSONEW("DFLG")=1 Q 86 93 I DT>$$FMADD^XLFDT($P(OR0,"^",6),365) D EXPR^PSONEW2 G DSPL 87 D STOP^PSONEW2,DISPLAY^PSONEW2,^PSONEWF 94 I $G(PSOAFYN)'="Y" D STOP^PSONEW2,DISPLAY^PSONEW2,^PSONEWF 95 I $G(PSOAFYN)="Y" D STOP^PSONEW2 88 96 I $G(PSOCPZ("DFLG")) W !!,"No action taken!",! K DIR S DIR(0)="E",DIR("A")="Press Return to continue" D ^DIR,KV K PSOCPZ("DFLG"),DRET,PSOANSQD S VALMBCK="Q" Q 89 K PSOCPZ("DFLG") D KV S DIR(0)="Y",DIR("A")="Are you sure you want to Accept this Order",DIR("B")="NO" D ^DIR I $D(DIRUT) D KV K DRET,PSOANSQ,PSOANSQD S VALMBCK="Q" Q 97 I $G(PSOAFYN)'="Y" K PSOCPZ("DFLG") D KV S DIR(0)="Y",DIR("A")="Are you sure you want to Accept this Order",DIR("B")="NO" D ^DIR I $D(DIRUT) D KV K DRET,PSOANSQ,PSOANSQD S VALMBCK="Q" Q 98 I $G(PSOAFYN)="Y" S Y="1" 90 99 D KV I 'Y K PSOANSQ G DSPL 91 100 I $G(PSONEW("MAIL/WINDOW"))["W" D:$P($G(PSOPAR),"^",12) S BINGCRT="Y",BINGRTE="W",PSORX("MAIL/WINDOW")="WINDOW" K RTN 92 .W ! K DIR,DIRUT S DIR(0)="52,35O" 93 .S:$G(PSORX("METHOD OF PICK-UP"))]"" DIR("B")=PSORX("METHOD OF PICK-UP") D ^DIR I $D(DIRUT) K DIR,DIRUT Q 94 .S (PSONEW("METHOD OF PICK-UP"),PSORX("METHOD OF PICK-UP"))=Y K X,Y 101 .I $G(PSOAFYN)'="Y" W ! K DIR,DIRUT S DIR(0)="52,35O" 102 .I $G(PSOAFYN)'="Y" S:$G(PSORX("METHOD OF PICK-UP"))]"" DIR("B")=PSORX("METHOD OF PICK-UP") D ^DIR I $D(DIRUT) K DIR,DIRUT Q 103 .I $G(PSOAFYN)'="Y" S (PSONEW("METHOD OF PICK-UP"),PSORX("METHOD OF PICK-UP"))=Y K X,Y 104 .I $G(PSOAFYN)="Y" S (PSONEW("METHOD OF PICK-UP"),PSORX("METHOD OF PICK-UP"))="AutoFinished for Rx Printing" 95 105 S PSONEW("POE")=1 D EN^PSON52(.PSONEW) G:$G(PSONEW("DFLG")) ABORT D DCORD^PSONEW2 96 106 D NPSOSD^PSOUTIL(.PSONEW),FULL^VALM1 K PSORX("MAIL/WINDOW") 97 107 D EOJ^PSONEW 98 ABORT S VALMBCK="Q",DIR(0)="E",DIR("A")="Press Return to Continue" D ^DIR,CLEAN^PSOVER1,KV 108 ABORT ; 109 I $G(PSOAFYN)'="Y" S VALMBCK="Q",DIR(0)="E",DIR("A")="Press Return to Continue" D ^DIR,CLEAN^PSOVER1,KV ;vfah 110 I $G(PSOAFYN)="Y" D CLEAN^PSOVER1,KV ;vfah 99 111 Q 100 112 KV K DIRUT,DUOUT,DTOUT,DIR … … 136 148 ; 137 149 DRGMSG ; 138 F SG=1:1:$L($P(^PSDRUG(PSODRUG("IEN"),0),"^",10)) S:$L(^TMP("PSOPO",$J,IEN,0)_" "_$P($P(^PSDRUG(PSODRUG("IEN"),0),"^",10)," ",SG))>80 IEN=IEN+1,$P(^TMP("PSOPO",$J,IEN,0)," ",20)=" " D 139 .S:$P($P(^PSDRUG(PSODRUG("IEN"),0),"^",10)," ",SG)'="" ^TMP("PSOPO",$J,IEN,0)=$G(^TMP("PSOPO",$J,IEN,0))_" "_$P($P(^PSDRUG(PSODRUG("IEN"),0),"^",10)," ",SG) 140 K SG Q 150 D DRGMSG^PSOORNW2 Q ;vfam 151 ; -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORNW1.m
r628 r636 1 PSOORNW1 ;ISC BHAM/SAB - continuation of finish of new order ; 5/10/07 8:30am2 ;;7.0;OUTPATIENT PHARMACY;**23,46,78,117,131,133,172,148,222,268 ,206**;DEC 1997;Build 391 PSOORNW1 ;ISC BHAM/SAB - continuation of finish of new order ;07/19/96 12:58 PM 2 ;;7.0;OUTPATIENT PHARMACY;**23,46,78,117,131,133,172,148,222,268**;DEC 1997;Build 9 3 3 ;Reference ^YSCL(603.01 supported by DBIA 2697 4 4 ;Reference ^PS(55 supported by DBIA 2228 … … 67 67 E D 68 68 .S PSOX=$S($P($G(OR0),"^",11)'>PTRF&($P($G(OR0),"^",11)'>11):11,1:PTRF) 69 I '$D(CLOZPAT) I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F") !(PSODRUG("DEA")[1)!(PSODRUG("DEA")[2)S PSOX=0,PSONEW("# OF REFILLS")=0 K PSDY,PSDY1,PTRF Q69 I '$D(CLOZPAT) I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F") S PSOX=0,PSONEW("# OF REFILLS")=0 K PSDY,PSDY1,PTRF Q 70 70 I $D(CLOZPAT) S (PSOX,PSONEW("N# REF"),PSONEW("# OF REFILLS"))=$S(CLOZPAT=2&($G(PSONEW("# OF REFILLS"))>2):3,CLOZPAT&($G(PSONEW("# OF REFILLS"))>1):1,1:0),PSONEW("DAYS SUPPLY")=7,ORCHK=1 K PSDY,PSDY1,PTRF Q 71 71 S PSONEW("# OF REFILLS")=$S($G(PSONEW("# OF REFILLS"))'="":$G(PSONEW("# OF REFILLS")),1:PSOX) K PSDY,PSDY1,PTRF -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORNW2.m
r628 r636 1 PSOORNW2 ;ISC-BHAM/SAB - edit orders from oerr ; 6/28/07 11:36am 2 ;;7.0;OUTPATIENT PHARMACY;**10,23,37,46,117,131,133,148,222,269,206**;DEC 1997;Build 39 1 PSOORNW2 ;ISC-BHAM/SAB - edit orders from oerr ; 12/10/06 9:55pm 2 ;;7.0;OUTPATIENT PHARMACY;**10,23,37,46,117,131,133,148,222,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;Reference to ^YSCL(603.01 supported by DBIA 2697 4 20 ;Reference to ^PS(55 supported by DBIA 2228 … … 11 27 S DIC("B")=$S($G(PSODRUG("OIN"))]"":PSODRUG("OIN"),1:""),DIC="^PS(50.7,",DIC(0)="AEMQZ" 12 28 S DIC("S")="I '$P(^PS(50.7,+Y,0),""^"",4)!($P(^(0),""^"",4)'<DT) N PSOF,PSOL S (PSOF,PSOL)=0 F S PSOL=$O(^PSDRUG(""ASP"",+Y,PSOL)) Q:PSOF!'PSOL " 13 S DIC("S")=DIC("S")_"I $P($G(^PSDRUG(PSOL,2)),U,3)[""O"",'$G(^(""I""))!($G(^(""I""))'<DT) S PSOF=1" 14 ;BHW;PSO*7*269;Modify ^DIC call to call MIX^DIC to use only the B and C Cross-References. 15 S D="B^C" D MIX^DIC1 K DIC,D I X["^"!($D(DTOUT)) S OUT=1 Q 29 S DIC("S")=DIC("S")_"I $P($G(^PSDRUG(PSOL,2)),U,3)[""O"",'$G(^(""I""))!($G(^(""I""))'<DT) S PSOF=1" D ^DIC K DIC I X["^"!($D(DTOUT)) S OUT=1 Q 16 30 S PSOY=Y 17 31 I +Y'=OI D I 'Y!($D(DIRUT)) D KV,MP1^PSOOREDX K DIC,Y,PSOY S OUT=1 Q … … 37 51 .S PSONEW("# OF REFILLS")=$S(PSONEW("# OF REFILLS")>PSOMAX:PSOMAX,1:PSONEW("# OF REFILLS")) 38 52 I $G(PSOMAX) S PSONEW("# OF REFILLS")=$S(+$P(OR0,"^",11)>PSOMAX:PSOMAX,1:+$P(OR0,"^",11)) 39 I $G(PSODRUG("DEA"))["A"&($G(PSODRUG("DEA"))'["B")!($G(PSODRUG("DEA"))["F") !($G(PSODRUG("DEA"))[1)!($G(PSODRUG("DEA"))[2)D40 .S PSONEW("# OF REFILLS")=0,VALMSG="No refills allowed on "_$S(PSODRUG("DEA")[" A":"this narcotic drug.",1:"this drug.")53 I $G(PSODRUG("DEA"))["A"&($G(PSODRUG("DEA"))'["B")!($G(PSODRUG("DEA"))["F") D 54 .S PSONEW("# OF REFILLS")=0,VALMSG="No refills allowed on "_$S(PSODRUG("DEA")["F":"this drug.",1:"Narcotics ...") 41 55 Q 42 56 ; … … 62 76 .S:'$G(PSONEW("# OF REFILLS")) PSONEW("# OF REFILLS")=$S(+$P(OR0,"^",11)>PSOMAX:PSOMAX,1:+$P(OR0,"^",11)) 63 77 .S (PSONEW("N# REF"),PSONEW("# OF REFILLS"))=$S(PSONEW("# OF REFILLS")>PSOMAX:PSOMAX,1:PSONEW("# OF REFILLS")) 64 .I '$D(CLOZPAT) I $G(PSODRUG("DEA"))["A"&($G(PSODRUG("DEA"))'["B")!($G(PSODRUG("DEA"))["F") !($G(PSODRUG("DEA"))[1)!($G(PSODRUG("DEA"))[2)D Q65 ..S (PSOMAX,PSONEW("N# REF"),PSONEW("# OF REFILLS"))=0,VALMSG="No refills allowed on "_$S(PSODRUG("DEA")[" A":"this narcotic drug.",1:"this drug.")78 .I '$D(CLOZPAT) I $G(PSODRUG("DEA"))["A"&($G(PSODRUG("DEA"))'["B")!($G(PSODRUG("DEA"))["F") D Q 79 ..S (PSOMAX,PSONEW("N# REF"),PSONEW("# OF REFILLS"))=0,VALMSG="No refills allowed on "_$S(PSODRUG("DEA")["F":"this drug.",1:"Narcotics ...") 66 80 .I $D(PSODRUG("DEA")) F DEA=1:1 Q:$E(PSODRUG("DEA"),DEA)="" I $E(+PSODRUG("DEA"),DEA)>1,$E(+PSODRUG("DEA"),DEA)<6 S PSOMAX=5 67 I '$D(CLOZPAT) I $G(PSODRUG("DEA"))["A"&($G(PSODRUG("DEA"))'["B")!($G(PSODRUG("DEA"))["F") !($G(PSODRUG("DEA"))[1)!($G(PSODRUG("DEA"))[2)D Q68 .S (PSONEW("N# REF"),PSONEW("# OF REFILLS"))=0,VALMSG="No refills allowed on "_$S(PSODRUG("DEA")[" A":"this narcotic drug.",1:"this drug.")81 I '$D(CLOZPAT) I $G(PSODRUG("DEA"))["A"&($G(PSODRUG("DEA"))'["B")!($G(PSODRUG("DEA"))["F") D Q 82 .S (PSONEW("N# REF"),PSONEW("# OF REFILLS"))=0,VALMSG="No refills allowed on "_$S(PSODRUG("DEA")["F":"this drug.",1:"Narcotics ...") 69 83 S (PSONEW("N# REF"),PSOMAX,PSONEW("# OF REFILLS"))=+$P(OR0,"^",11) 70 84 ASK S PSONEW("FLD")=9 D REFILL^PSODIR1(.PSONEW) ; Get # of refills … … 88 102 14 S PSONEW("FLD")=13 D RMK^PSODIR2(.PSONEW) ; Get Remarks 89 103 Q 104 ; 105 DRGMSG ;From PSOORNEW 106 F SG=1:1:$L($P(^PSDRUG(PSODRUG("IEN"),0),"^",10)) S:$L(^TMP("PSOPO",$J,IEN,0)_" "_$P($P(^PSDRUG(PSODRUG("IEN"),0),"^",10)," ",SG))>80 IEN=IEN+1,$P(^TMP("PSOPO",$J,IEN,0)," ",20)=" " D 107 .S:$P($P(^PSDRUG(PSODRUG("IEN"),0),"^",10)," ",SG)'="" ^TMP("PSOPO",$J,IEN,0)=$G(^TMP("PSOPO",$J,IEN,0))_" "_$P($P(^PSDRUG(PSODRUG("IEN"),0),"^",10)," ",SG) 108 K SG Q 109 ; 90 110 DREN ; 91 111 S (PSDC,PSI)=0 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORRNW.m
r628 r636 1 PSOORRNW ;BIR/SAB-finish OP renew orders from OE/RR ;4/25/07 8:46am 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,51,46,71,94,130,131,146,206**;DEC 1997;Build 39 1 PSOORRNW ;BIR/SAB-finish OP renew orders from OE/RR ; 11/3/06 10:02pm 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,51,46,71,94,130,131,146,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External reference to ^PSDRUG supported by DBIA 221 4 20 ;External reference to ^PS(50.607 supported by DBIA 2221 … … 6 22 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789 7 23 S PSORENXX=$P($G(OR0),"^",21),PSOFROM="NEW" K PRC,PHI 8 I $G(PSO RENXX) D PSOL^PSSLOCK(PSORENXX) I '$G(PSOMSG) D K DIR,PSOMSG W ! S DIR("A")="Press Return to continue",DIR(0)="E" D ^DIR K DIR W ! Q24 I $G(PSOAFYN)'="Y" I $G(PSORENXX) D PSOL^PSSLOCK(PSORENXX) I '$G(PSOMSG) D K DIR,PSOMSG W ! S DIR("A")="Press Return to continue",DIR(0)="E" D ^DIR K DIR W ! Q ;vfah 9 25 .I $P($G(PSOMSG),"^",2)'="" W $C(7),!!,$P(PSOMSG,"^",2) Q 10 26 .W $C(7),!!,"Another person is editing Rx "_$P($G(^PSRX(PSORENXX,0)),"^") 11 K PSOMSG N OI,VALMCNT K POERR("DFLG") D FULL^VALM1 S (PSORX("DFLG"),PSORENW("DFLG"))=0,(PSORNW("FILL DATE"),PSORENW("FILL DATE"))=DT 27 I $G(PSOAFYN)="Y" I $G(PSORENXX) D PSOL^PSSLOCK(PSORENXX) ;vfah 28 I $G(PSOAFYN)'="Y" K PSOMSG N OI,VALMCNT K POERR("DFLG") D FULL^VALM1 S (PSORX("DFLG"),PSORENW("DFLG"))=0,(PSORNW("FILL DATE"),PSORENW("FILL DATE"))=DT ;vfah 29 I $G(PSOAFYN)="Y" K PSOMSG N OI,VALMCNT K POERR("DFLG") S (PSORX("DFLG"),PSORENW("DFLG"))=0,(PSORNW("FILL DATE"),PSORENW("FILL DATE"))=DT ;vfah 12 30 S Y=DT X ^DD("DD") S PSORX("FILL DATE")=Y K Y 13 W !!,"Now Renewing Rx # "_$P(^PSRX($P(OR0,"^",21),0),"^")_" Drug: "_$P($G(^PSDRUG($P(^PSRX($P(OR0,"^",21),0),"^",6),0)),"^"),! H 231 I $G(PSOAFYN)'="Y" W !!,"Now Renewing Rx # "_$P(^PSRX($P(OR0,"^",21),0),"^")_" Drug: "_$P($G(^PSDRUG($P(^PSRX($P(OR0,"^",21),0),"^",6),0)),"^"),! H 2 ;vfah 14 32 I $P($G(^PSRX($P(OR0,"^",21),"OR1")),"^",4) D D PROCESSX^PSORENW0 D UL Q 15 33 .W !!,"Cannot Renew Rx # "_$P(^PSRX($P(OR0,"^",21),0),"^"),!," Drug: "_$P($G(^PSDRUG($P(^PSRX($P(OR0,"^",21),0),"^",6),0)),"^")_"." … … 52 70 .S PSOCS=0 K DIR,DIC,PSOX 53 71 .F DEA=1:1 Q:$E(PSODRUG("DEA"),DEA)="" I $E(+PSODRUG("DEA"),DEA)>1,$E(+PSODRUG("DEA"),DEA)<6 S $P(PSOCS,"^")=1 S:$E(+PSODRUG("DEA"),DEA)=2 $P(PSOCS,"^",2)=1 54 .;PSO*7*206 55 .S PSOMAX=$S(PSOCS:5,1:11) I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F")!(PSODRUG("DEA")[1)!(PSODRUG("DEA")[2) S PSOMAX=0 72 .S PSOMAX=$S(PSOCS:5,1:11) I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F") S PSOMAX=0 56 73 E S PSOMAX=$P(OR0,"^",11) 57 74 S RXPT=+$P(PSORENW("RX0"),"^",3) I $G(^PS(53,RXPT,0))]"" D -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORUT1.m
r628 r636 1 PSOORUT1 ;BIR/SAB - Utility routine for oerr interface ; 6/28/07 7:36am2 ;;7.0;OUTPATIENT PHARMACY;**1,14,30,46,132,148,233 ,274**;DEC 1997;Build 81 PSOORUT1 ;BIR/SAB - Utility routine for oerr interface ;02/22/95 2 ;;7.0;OUTPATIENT PHARMACY;**1,14,30,46,132,148,233**;DEC 1997;Build 8 3 3 ;External reference to ^PSDRUG supported by DBIA 221 4 4 ;External reference to ^PSXOPUTL supported by DBIA 2203 … … 29 29 .I $$SUBMIT^PSOBPSUT(DA) D ECMESND^PSOBPSU1(DA,,$$RXFLDT^PSOBPSUT(DA),$S('$O(^PSRX(DA,1,0)):"OF",1:"RF")) 30 30 G EXIT^PSOORUTL 31 ACT1 S RXF=0 F I=0:0 S I=$O(^PSRX(DA,1,I)) Q:'I S RXF=I S:I>5 RXF=I+131 ACT1 I '$D(RXF) S RXF=0 F I=0:0 S I=$O(^PSRX(DA,1,I)) Q:'I S RXF=I S:I>5 RXF=I+1 32 32 S IR=0 F FDA=0:0 S FDA=$O(^PSRX(DA,"A",FDA)) Q:'FDA S IR=FDA 33 33 S IR=IR+1,^PSRX(DA,"A",0)="^52.3DA^"_IR_"^"_IR -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORUTL.m
r628 r636 1 PSOORUTL ;ISC BHAM/SAB - updates order status from oerr ; 6/28/07 7:36am2 ;;7.0;OUTPATIENT PHARMACY;**14,46,146,132,118,199,223,148,249 ,274**;DEC 1997;Build 81 PSOORUTL ;ISC BHAM/SAB - updates order status from oerr ;02/22/95 2 ;;7.0;OUTPATIENT PHARMACY;**14,46,146,132,118,199,223,148,249**;DEC 1997;Build 9 3 3 ;External reference to EN^ORERR - 2187 4 4 ;External reference to ^PS(55 - 2228 … … 104 104 S IR=0 F FDA=0:0 S FDA=$O(^PSRX(DA,"A",FDA)) Q:'FDA S IR=FDA 105 105 S IR=IR+1,^PSRX(DA,"A",0)="^52.3DA^"_IR_"^"_IR 106 S RXF=$S(RXF>5:RXF+1,1:RXF)107 106 S ^PSRX(DA,"A",IR,0)=NOW_"^"_$S(ACT:"U",1:"H")_"^"_POERR("USER")_"^"_RXF_"^"_"RX "_$S('ACT:"placed in a",1:"removed from")_" HOLD status "_$S(+$G(PSUS):"and removed from SUSPENSE ",1:"")_"("_$E(DT,4,5)_"-"_$E(DT,6,7)_"-"_$E(DT,2,3)_") by OERR." 108 107 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOPMP0.m
r628 r636 1 1 PSOPMP0 ;BIRM/MFR - Patient Medication Profile - Listmanager ;10/28/06 2 ;;7.0;OUTPATIENT PHARMACY;**260 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**260**;DEC 1997;Build 84 3 3 ;Reference to EN1^GMRADPT supported by IA #10099 4 4 ;Reference to EN6^GMRVUTL supported by IA #1120 … … 14 14 ; - Patient selection 15 15 W !! S DIC=2,DIC(0)="QEAM" D ^DIC G EXIT:Y<0 S DFN=+Y 16 ;17 S PSODFN=DFN D CHKADDR^PSOBAI(DFN,1,1) ;bad address flag/update18 16 ; 19 17 D LST(PSOSITE,DFN) … … 102 100 ; 103 101 SETSORT(FIELD) ; - Sets the data sorted by the FIELD specified 104 N SEQ,RX,RXNUM,DRUG,DRNAME,QTY,STATUS,STS,ISSDT,DOCDAT,LSTFD,REFREM,DAYSUP,SIG,Z,ORD,GRPCNT,GROUP,RFRX,OI ,PSOBADR102 N SEQ,RX,RXNUM,DRUG,DRNAME,QTY,STATUS,STS,ISSDT,DOCDAT,LSTFD,REFREM,DAYSUP,SIG,Z,ORD,GRPCNT,GROUP,RFRX,OI 105 103 ; 106 104 K ^TMP("PSOPMPSR",$J) … … 120 118 . S REFREM=$$REFREM^PSOPMP1(RX) 121 119 . S DAYSUP=$$GET1^DIQ(52,RX,8) 122 . S PSOBADR=$O(^PSRX(RX,"L",9999),-1)123 . I PSOBADR'="" S PSOBADR=$G(^PSRX(RX,"L",PSOBADR,0)) I PSOBADR["(BAD ADDRESS)" S PSOBADR="B"124 . I PSOBADR'="B" S PSOBADR=""125 120 . S Z="",$P(Z,"^")=RX,$P(Z,"^",2)=RXNUM_$$COPAY^PSOPMP1(RX)_$$ECME^PSOBPSUT(RX),$P(Z,"^",3)=$E(DRNAME,1,30) 126 . S $P(Z,"^",4)=QTY,$P(Z,"^",5)=$P(STATUS,"^",3)_$$CMOP^PSOPMP1(DRUG,RX) _PSOBADR,$P(Z,"^",6)=$P(ISSDT,"^",2)121 . S $P(Z,"^",4)=QTY,$P(Z,"^",5)=$P(STATUS,"^",3)_$$CMOP^PSOPMP1(DRUG,RX),$P(Z,"^",6)=$P(ISSDT,"^",2) 127 122 . S $P(Z,"^",7)=$P(LSTFD,"^",2),$P(Z,"^",8)=REFREM,$P(Z,"^",9)=DAYSUP 128 123 . S SORT=$S(FIELD="RX":RXNUM_" ",FIELD="DR":DRNAME_RXNUM,FIELD="ID":+ISSDT_RXNUM_" ",FIELD="LF":+LSTFD_RXNUM_" ") … … 231 226 ; 232 227 ; - Regular prescription 233 I TYPE="RX" D S VALMBCK="R" D REF228 I TYPE="RX" D 234 229 . N PSOVDA,PSOSAVE,DA,PS 235 . S (PSOVDA,DA)=ORD,PS="REJECT MP"230 . S (PSOVDA,DA)=ORD,PS="REJECT" 236 231 . N LINE,TITLE,PSODFN D DP^PSORXVW 237 232 ; -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOPMP1.m
r628 r636 1 1 PSOPMP1 ;BIRM/MFR - Patient Medication Profile - Listmanager ;04/28/05 2 ;;7.0;OUTPATIENT PHARMACY;**260 ,285,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**260**;DEC 1997;Build 84 3 3 ;Reference to ^PSDRUG("AQ" supported by IA 3165 4 4 ;Reference to EN1^GMRADPT supported by IA 10099 … … 17 17 . . S LBL=GRPLN(LN),POS=41-($L(LBL)\2) 18 18 . . D CNTRL^VALM10(LN,1,POS-1,IOUON_IOINHI,IOINORM) 19 . . D CNTRL^VALM10(LN,POS,$L(LBL),IORVON_IOINHI,IO RVOFF_IOINORM)19 . . D CNTRL^VALM10(LN,POS,$L(LBL),IORVON_IOINHI,IOINORM) 20 20 . . D CNTRL^VALM10(LN,POS+$L(LBL),81-POS-$L(LBL),IOUON_IOINHI,IOINORM) 21 21 Q … … 73 73 FILTER(RX) ; - Filter Rx's that should not be displayed 74 74 I $$GET1^DIQ(52,RX,26,"I")<PSOEXPDC Q 1 75 I $$GET1^DIQ(52,RX,26.1,"I") ,$$GET1^DIQ(52,RX,26.1,"I")<PSOEXPDC,$$GET1^DIQ(52,RX,100,"I")>11,$$GET1^DIQ(52,RX,100,"I")'=16 Q 175 I $$GET1^DIQ(52,RX,26.1,"I")<PSOEXPDC,$$GET1^DIQ(52,RX,100,"I")>11,$$GET1^DIQ(52,RX,100,"I")'=16 Q 1 76 76 I $$GET1^DIQ(52,RX,100,"I")=""!($$GET1^DIQ(52,RX,100,"I")=13) Q 1 77 77 I $$GET1^DIQ(52,RX,.01)="" Q 1 … … 152 152 I GMRAL S ALLERGY="<A>" 153 153 E D ALLERGY^PSOORUT2 I PSONOAL'="" S ALLERGY="<NO ALLERGY ASSESSMENT>" 154 S ALLERGY=IORVON_ALLERGY_IO RVOFF_IOINORM154 S ALLERGY=IORVON_ALLERGY_IOINORM 155 155 I '$G(POS) S POS=80-$L(ALLERGY) 156 156 S LINE=$$SETSTR^VALM1(ALLERGY,LINE,POS,80) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOR52.m
r628 r636 1 1 PSOR52 ;IHS/DSD/JCM - Files refill entries in prescription file ;03/10/93 2 ;;7.0;OUTPATIENT PHARMACY;**10,22,27,181,148,201,260 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**10,22,27,181,148,201,260**;DEC 1997;Build 84 3 3 ;Reference to ^PSDRUG supported by DBIA 221 4 4 ;Reference to PSOUL^PSSLOCK supported by DBIA 2789 … … 84 84 . S ACTION="" D ECMESND^PSOBPSU1(PSOERX,PSOERF,PSOX("FILL DATE"),"RF") 85 85 . I $$FIND^PSOREJUT(PSOERX,PSOERF) D 86 . . S ACTION=$$HDLG^PSOREJU1(PSOERX,PSOERF,"79,88","OF","IOQ"," Q")86 . . S ACTION=$$HDLG^PSOREJU1(PSOERX,PSOERF,"79,88","OF","IOQ","I") 87 87 . I $$STATUS^PSOBPSUT(PSOERX,PSOERF)="E PAYABLE" D 88 88 . . D SAVNDC^PSSNDCUT(+$$GET1^DIQ(52,PSOERX,6,"I"),$G(PSOSITE),$$GETNDC^PSONDCUT(PSOERX,PSOERF)) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOREF.m
r628 r636 1 PSOREF ;BIR/SAB-refill data entry ;4/25/07 8:45am 2 ;;7.0;OUTPATIENT PHARMACY;**1,23,27,36,46,78,130,131,148,206**;DEC 1997;Build 39 1 PSOREF ;BIR/SAB-refill data entry ;1/27/07 13:31 2 ;;7.0;OUTPATIENT PHARMACY;**1,23,27,36,46,78,130,131,148,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 3 16 ;External reference to ^PSDRUG supported by DBIA 221 4 17 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789 … … 9 22 Q 10 23 OERR ;single refil 24 ; 25 S DIC="^VA(200,",DIC(0)="QEZ",X="AUTOFINISH,RX" ;vfah 26 D ^DIC K DIC ;vfah 27 S PSOZAF=+Y ;vfah 28 I $P($G(^PSRX(RXN,"OR1")),"^",5)=$G(PSOZAF) S VALMBCK="",VALMSG="Refill option is not available for Autofinshed Rxs" K PSOZAF Q ;vfah 11 29 I $$LMREJ^PSOREJU1($P(PSOLST(ORN),"^",2),,.VALMSG,.VALMBCK) Q 12 30 I $D(RXRP($P(PSOLST(ORN),"^",2))) S VALMBCK="",VALMSG="A Reprint Label has been requested!" Q … … 29 47 K DIR,DIRUT,DTOUT,PSOOELSE,DTOUT I +Y S (ASK,SPEED,PSOOELSE)=1 D FULL^VALM1 S LST=Y D G:$G(PSOREF("DFLG"))!($G(PSOREF("QFLG"))) SPEEDX 30 48 .F ORD=1:1:$L(LST,",") Q:$P(LST,",",ORD)']""!($G(PSOREF("QFLG"))) S ORN=$P(LST,",",ORD) D:+PSOLST(ORN)=52 49 ..S DIC="^VA(200,",DIC(0)="QEZ",X="AUTOFINISH,RX" ;vfah 50 ..D ^DIC K DIC ;vfah 51 ..S PSOZAF=+Y ;vfah 52 ..I $P($G(^PSRX($P(PSOLST(ORN),"^",2),"OR1")),"^",5)=$G(PSOZAF) W $C(7),!!,"Rx "_$$GET1^DIQ(52,$P(PSOLST(ORN),"^",2),.01)_" is an Autofinish,Rx and can not be refilled" K PSOZAF D PAUSE^VALM1 Q ;vfah 31 53 ..I $$LMREJ^PSOREJU1($P(PSOLST(ORN),"^",2)) W $C(7),!!,"Rx "_$$GET1^DIQ(52,$P(PSOLST(ORN),"^",2),.01)_" has OPEN/UNRESOLVED 3rd Party Payer Reject!" K DIR D PAUSE^VALM1 Q 32 54 ..D PSOL^PSSLOCK($P(PSOLST(ORN),"^",2)) I '$G(PSOMSG) W $C(7),!!,$S($P($G(PSOMSG),"^",2)'="":$P($G(PSOMSG),"^",2),1:"Another person is editing Rx "_$P(^PSRX($P(PSOLST(ORN),"^",2),0),"^")),! D PAUSE^VALM1 K PSOMSG Q … … 85 107 I '$P($G(^PSRX(RXN,"OR1")),"^"),$P($G(^PSDRUG(PSODRG,2)),"^") S $P(^PSRX(RXN,"OR1"),"^")=$P(^PSDRUG(PSODRG,2),"^") 86 108 S CLOZPAT=$S($P($G(^PSDRUG(PSODRG,"CLOZ1")),"^")="PSOCLO1":1,1:0) 87 I 'CLOZPAT I PSODEA["A"&(PSODEA'["B")!(PSODEA["F") !(PSODEA[1)!(PSODEA[2) Q "0^"_$S(PSODEA["A":"Narcotic Drug. ",1:"")_"Order Non-Refillable."109 I 'CLOZPAT I PSODEA["A"&(PSODEA'["B")!(PSODEA["F") Q "0^"_$S(PSODEA["F":"",1:"Narcotic Drug. ")_"Order Non-Refillable." 88 110 K CLOZPAT I DT>$P($G(^PSRX(RXN,2)),"^",6) Q "0^Non-Refillable. Prescription has Expired." 89 111 I $P(^PSRX(RXN,3),"^",2)>$P(^PSRX(RXN,2),"^",6) Q "0^Next Refill Date Past Expiration Date. New Order Required." -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOREJP1.m
r628 r636 1 1 PSOREJP1 ;BIRM/MFR - Third Party Reject Display Screen ;04/29/05 2 ;;7.0;OUTPATIENT PHARMACY;**148,247,260 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**148,247,260**;DEC 1997;Build 84 3 3 ;Reference to File 9002313.93 - BPS NCPDP REJECT CODES supported by IA 4720 4 4 ;Reference to ^PS(59.7 supported by IA 694 … … 26 26 K ^TMP("PSOREJP1",$J) S VALMCNT=0,LINE=0 27 27 D GET^PSOREJU2(RX,FILL,.DATA,REJ,1) 28 D REJ ; Display REJECT Info29 D OTH ; Display Other Rejects Info30 D COM^PSOREJP3 ; DisplayComment31 D INS ; Display Insurance Info32 D CLS ; Display Resolution Info28 D REJ ; Display the REJECT Information 29 D OTH ; Display the Other Rejects Information 30 D COM^PSOREJP3 ; Display the Comment 31 D INS ; Display the Insurance Information 32 D CLS ; Display the Resolution Information 33 33 S VALMCNT=LINE 34 34 Q … … 251 251 ; 252 252 OUT(RX) ; - Supported call by outside PROTOCOLs to act on specific REJECTs 253 N I,RFL,DATA,REJ,PSOBACK,VALMCNT,RXN 254 I '$D(^XUSEC("PSORPH",DUZ)) S VALMSG="PSORPH key required to use the REJ action.",VALMBCK="R" Q 255 I $G(PS)="REJECT" D Q 256 . S VALMSG="REJ action is not available at this point.",VALMBCK="R" 253 N I,RFL,DATA,REJ,PSOBACK,VALMCNT 257 254 S PSOBACK=1 258 255 S (RFL,I)=0 F I=1:1 Q:'$D(^PSRX(RX,1,I)) S RFL=I -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORELD1.m
r628 r636 1 PSORELD1 ;BIR/PWC-HL7 V.2.4 EXTERNAL INTERFACE RELEASE DATE/TIME CONT. ;03/22/04 2 ;;7.0;OUTPATIENT PHARMACY;**156**;DEC 1997 1 PSORELD1 ;BIR/PWC-HL7 V.2.4 EXTERNAL INTERFACE RELEASE DATE/TIME CONT. ;5:23 AM 31 Jan 2008 2 ;;7.0;OUTPATIENT PHARMACY;**156**;DEC 1997;Build 4 3 ;Modified from FOIA VISTA, 4 ;Copyright 2008 WorldVistA. Licensed under the terms of the GNU 5 ;General Public License See attached copy of the License. 6 ; 7 ;This program is free software; you can redistribute it and/or modify 8 ;it under the terms of the GNU General Public License as published by 9 ;the Free Software Foundation; either version 2 of the License, or 10 ;(at your option) any later version. 11 ; 12 ;This program is distributed in the hope that it will be useful, 13 ;but WITHOUT ANY WARRANTY; without even the implied warranty of 14 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 ;GNU General Public License for more details. 16 ; 17 ;You should have received a copy of the GNU General Public License along 18 ;with this program; if not, write to the Free Software Foundation, Inc., 19 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 ; 3 21 ;HLFNC supp. by DBIA 10106 4 22 ;PSNAPIS supp. by DBIA 2531 … … 25 43 D PID(.PSI),PV1(.PSI),PV2(.PSI),ORC(.PSI),RXE(.PSI),RXD(.PSI) 26 44 ; clean up data set by GETDATA 27 K BINGO,RELDT,SITE,SITADD,SITPHN,PSOXN,PSOXN2,PSND1,PSND2,PSND3,PRODUCT,PSOPROD,VANAME,UNIT,PSDOSE,PODOSENM,POIPTR,NRFL,DISPDT,COPAY,ERR,PSONDC,NFDL,NFLD,PSZIP,PSOHZIP,TRADENM,X,Y,UU 28 Q 45 K BINGO,RELDT,SITE,SITADD,SITPHN,PSOXN,PSOXN2,PSND1,PSND2,PSND3,PRODUCT,PSOPROD,VANAME 46 K UNIT,PSDOSE,PODOSENM,POIPTR,NRFL,DISPDT,COPAY,ERR,PSONDC,NFDL,NFLD,PSZIP,PSOHZIP,TRADENM,X,Y,UU 47 QUIT 48 ; ======== 29 49 GETDATA ; this is the place to set all data needed for several segments 30 50 I $G(FP)="F"&('$G(FPN)) D ;original … … 32 52 . S PVDR=$P(^PSRX(IRXN,0),"^",4),QTY=$P(^(0),"^",7),DASPLY=$P(^(0),"^",8),MW=$P(^(0),"^",11),EBY=$P(^(0),"^",16) 33 53 I $G(FP)="F"&($G(FPN)) D ;refill 34 . S FDT=$P(^PSRX(IRXN,1,FPN,0),"^"),MW=$P(^(0),"^",2),QTY=$P(^(0),"^",4),DASPLY=$P(^(0),"^",10),DISPDT=$P(^(0),"^",19),EXDT=$S($P(^(0),"^",15):$P(^(0),"^",15),1:$P(^PSRX(IRXN,2),"^",6)) 54 . S FDT=$P(^PSRX(IRXN,1,FPN,0),"^"),MW=$P(^(0),"^",2),QTY=$P(^(0),"^",4),DASPLY=$P(^(0),"^",10),DISPDT=$P(^(0),"^",19) 55 . S EXDT=$S($P(^(0),"^",15):$P(^(0),"^",15),1:$P(^PSRX(IRXN,2),"^",6)) 35 56 . S VPHARMID=$S($P(^PSRX(IRXN,1,FPN,0),"^",5)'="":$P(^(0),"^",5),1:$P(^PSRX(IRXN,2),"^",10)) 36 . S EBY=$S($P(^PSRX(IRXN,1,FPN,0),"^",5):$P(^(0),"^",5),1:$P(^(0),"^",7)),PVDR=$P(^(0),"^",17),PSONDC=$S($P($G(^PSRX(IRXN,1,FPN,1)),"^",3):$P(^(1),"^",3),1:$P(^PSRX(IRXN,2),"^",7)) 57 . S EBY=$S($P(^PSRX(IRXN,1,FPN,0),"^",5):$P(^(0),"^",5),1:$P(^(0),"^",7)),PVDR=$P(^(0),"^",17) 58 . S PSONDC=$S($P($G(^PSRX(IRXN,1,FPN,1)),"^",3):$P(^(1),"^",3),1:$P(^PSRX(IRXN,2),"^",7)) 37 59 I $G(FP)="P" D ;partial 38 . S FDT=$P(^PSRX(IRXN,"P",FPN,0),"^"),MW=$P(^(0),"^",2),QTY=$P(^(0),"^",4),DASPLY=$P(^(0),"^",10),DISPDT=$P(^(0),"^",13),PVDR=$P(^(0),"^",17),EXDT=$P(^PSRX(IRXN,2),"^",6) 39 . S EBY=$S($P(^PSRX(IRXN,"P",FPN,0),"^",5):$P(^(0),"^",5),1:$P(^(0),"^",7)),VPHARMID=$S($P(^(0),"^",5)'="":$P(^(0),"^",5),1:$P(^PSRX(IRXN,2),"^",10)),PVDR=$P(^PSRX(IRXN,"P",FPN,0),"^",17) 60 . S FDT=$P(^PSRX(IRXN,"P",FPN,0),"^"),MW=$P(^(0),"^",2),QTY=$P(^(0),"^",4),DASPLY=$P(^(0),"^",10),DISPDT=$P(^(0),"^",13) 61 . S PVDR=$P(^(0),"^",17),EXDT=$P(^PSRX(IRXN,2),"^",6) 62 . S EBY=$S($P(^PSRX(IRXN,"P",FPN,0),"^",5):$P(^(0),"^",5),1:$P(^(0),"^",7)) 63 . S VPHARMID=$S($P(^(0),"^",5)'="":$P(^(0),"^",5),1:$P(^PSRX(IRXN,2),"^",10)),PVDR=$P(^PSRX(IRXN,"P",FPN,0),"^",17) 40 64 . S PSONDC=$S($P(^PSRX(IRXN,"P",FPN,0),"^",12):$P(^(0),"^",12),1:$P(^PSRX(IRXN,2),"^",7)) 41 65 S EFDT=$P(^PSRX(IRXN,2),"^",2) S:$G(EFDT) EFDT=$$HLDATE^HLFNC(EFDT,"DT") … … 43 67 S DEAID=$$GET1^DIQ(200,PVDR_",",53.2) 44 68 K DIC,X,Y S DIC="^VA(200,",DIC(0)="N,Z",X=VPHARMID D ^DIC 45 S VPHARM=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)) :1,"""""") K DIC,X,Y69 S VPHARM=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)),1:"""""") K DIC,X,Y 46 70 K DIC,X,Y S DIC="^VA(200,",DIC(0)="N,Z",X=EBY D ^DIC 47 S EBY1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)) :1,"""""") K DIC,X,Y71 S EBY1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)),1:"""""") K DIC,X,Y 48 72 K DIC,X,Y S DIC="^VA(200,",DIC(0)="N,Z",X=PVDR D ^DIC 49 S PVDR1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)) :1,"""""") K DIC,X,Y73 S PVDR1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)),1:"""""") K DIC,X,Y 50 74 S PRIORDT=$P(^PSRX(IRXN,3),"^",4),PRIORDT=$$HLDATE^HLFNC(PRIORDT,"DT") 51 75 S FDT=$$HLDATE^HLFNC(FDT,"DT") … … 55 79 S FIN=$P(^PSRX(IRXN,"OR1"),"^",5) 56 80 K DIC,X,Y S DIC="^VA(200,",DIC(0)="N,Z",X=FIN D ^DIC 57 S FIN1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)) :1,"""""") K DIC,X,Y81 S FIN1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)),1:"""""") K DIC,X,Y 58 82 S SITE=$S($D(^PS(59,PSOSITE,0)):^(0),1:"") 59 83 S PSZIP=$P(SITE,"^",5) S PSOHZIP=$S(PSZIP["-":PSZIP,1:$E(PSZIP,1,5)_$S($E(PSZIP,6,9)]"":"-"_$E(PSZIP,6,9),1:"")) … … 61 85 S CSINER=$P(^PSRX(IRXN,3),"^",3) 62 86 K DIC,X,Y S DIC="^VA(200,",DIC(0)="N,Z",X=CSINER D ^DIC 63 S CSINER1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)) :1,"""""") K DIC,X,Y87 S CSINER1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)),1:"""""") K DIC,X,Y 64 88 D 6^VADPT 65 89 I MW="W" S MP=$S($P($G(^PSRX(IRXN,"MP")),"^"):$P(^("MP"),"^"),1:"""""") … … 87 111 S NFLD=0,UU="" F S UU=$O(^PSRX(IRXN,1,UU)) Q:UU="" S:$D(^PSRX(IRXN,1,UU,0)) NFLD=NFLD+1 88 112 S NRFL=$P(^PSRX(IRXN,0),"^",9),RFRM=(NRFL-NFLD) 89 Q 113 QUIT 114 ; ========= 90 115 PID(PSI) ;patient ID segment 91 Q:'$D(DFN)!$D(PAS) 116 QUIT:'$D(DFN)!$D(PAS) 117 ; 92 118 S HLFS=HL1("FS"),HLECH=HL1("ECH"),HLQ=HL1("Q"),HLVER=HL1("VER") 93 119 K PSPID,PSPID1 … … 127 153 S PAS=1 128 154 K PSPID,PSPID1,PRSEPID,PRSEZTA,SPOT,TMPADD,ADDSEQ 129 Q 155 QUIT 156 ; ========= 130 157 PV1(PSI) ;patient visit segment 131 158 N PV1 ;hardcoded to letter O for Outpatient (Patient class) … … 133 160 S ^TMP("PSO",$J,PSI)=PV1 134 161 S PSI=PSI+1 135 Q 162 QUIT 163 ; ========= 136 164 PV2(PSI) ;patient visit segment (additional information) 137 165 ;PATIENT STATUS AND COPAY … … 140 168 S ^TMP("PSO",$J,PSI)="PV2|"_PV2 141 169 S PSI=PSI+1 142 Q 170 QUIT 171 ; ========= 143 172 ORC(PSI) ;common order segment 144 Q:'$D(DFN) 173 QUIT:'$D(DFN) 174 ; 145 175 N ORC S ORC="" 146 176 S $P(ORC,"|",1)="OE" … … 154 184 S $P(ORC,"|",17)=CLN_CS_CLN1_CS_"99PSC" 155 185 S $P(ORC,"|",19)=$S(CSINER'="":CSINER_CS_CSINER1,1:"") 156 S $P(ORC,"|",21)=$P(SITE,"^",1)_CS_CS_$P(SITE,"^",6)_ 186 ; 3080129 - RCR 187 ; Segment 21 is incomplete. Truncated. 188 ; S $P(ORC,"|",21)=$P(SITE,"^",1)_CS_CS_$P(SITE,"^",6)_ 189 S $P(ORC,"|",21)=$P(SITE,"^",1)_CS_CS_$P(SITE,"^",6) 157 190 S PSZIP=$P(SITE,"^",5) S PSOHZIP=$S(PSZIP["-":PSZIP,1:$E(PSZIP,1,5)_$S($E(PSZIP,6,9)]"":"-"_$E(PSZIP,6,9),1:"")) 158 191 S $P(ORC,"|",22)=$P(SITE,"^",2)_CS_CS_$P(SITE,"^",7)_CS_$S($D(^DIC(5,+$P(SITE,"^",8),0)):$P(^(0),"^",2),1:"UKN")_CS_PSOHZIP 159 192 S $P(ORC,"|",23)="("_$P(SITE,"^",3)_")"_$P(SITE,"^",4) 160 193 S ^TMP("PSO",$J,PSI)="ORC|"_ORC,PSI=PSI+1 161 Q 194 QUIT 195 ; =========== 162 196 RXE(PSI) ;Pharmacy/treatment Encoded Order segment 163 Q:'$D(DFN) 164 N RXE S RXE="" 197 QUIT:'$D(DFN) 198 ; 199 N RXE,PSDRG10 200 S RXE="" 165 201 S $P(RXE,"|",1)="""""" 166 S $P(RXE,"|",2)=$S($P($G(^PSDRUG(IDGN,"ND")),"^",10)'="":$P(^("ND"),"^",10),($G(PSND1)&$G(PSND3)):$P($G(PSOXN2),"^",2),1:"""""")_CS_$G(PSND2)_CS_"99PSNDF"_CS_PSND1_"."_PSND3_"."_$G(IDGN)_CS_$P($G(^PSDRUG(IDGN,0)),"^")_CS_"99PSD" 202 S PSDRG10=$P($G(^PSDRUG(IDGN,"ND")),"^",10) 203 ; 204 ; 29JAN2008 - RCR ; The problem is tha/home/rcr/PSORELD1.mt the last $PIECE is incomplete. This needs to be validated 205 ; S $P(RXE,"|",2)=$S($P($G(^PSDRUG(IDGN,"ND")),"^",10)'="":$P(^("ND"),"^",10),($G(PSND1)&$G(PSND3)):$P($G(PSOXN2),"^",2),1:"""""")_CS_$G(PSND2)_CS_"99PSNDF"_CS_PSND1_"."_PSND3_"."_$G(IDGN)_CS_$P($G(^PSDRUG(IDGN,0)),"^"_CS_"99PSD" 206 S $P(RXE,"|",2)=$S(PSDRG10'="":PSDRG10,($G(PSND1)&$G(PSND3)):$P($G(PSOXN2),"^",2),1:"""""")_CS_$G(PSND2)_CS_"99PSNDF"_CS_PSND1_"."_PSND3_"."_$G(IDGN)_CS_$P($G(^PSDRUG(IDGN,0)),"^")_CS_"99PSD" 167 207 S $P(RXE,"|",3)="" 168 208 I $G(PSOXN)="" S PSOXN="""""" 169 209 S $P(RXE,"|",5)=PSOXN_CS_$S($G(UNIT)'="":$G(UNIT),1:"""""")_CS_"99PSU" 170 S POIPTR=$P($G(^PSRX(IRXN,"OR1")),"^") I POIPTR S PODOSE=$P($G(^PS(50.7,POIPTR,0)),"^",2),PODOSENM=$G(^PS(50.606,PODOSE,0)) 210 S POIPTR=$P($G(^PSRX(IRXN,"OR1")),"^") 211 I POIPTR S PODOSE=$P($G(^PS(50.7,POIPTR,0)),"^",2),PODOSENM=$G(^PS(50.606,PODOSE,0)) 171 212 I '$G(POIPTR) S PODOSE=$P($G(^PS(50.7,$P($G(^PSDRUG(IDGN,2)),"^"),0)),"^",2),PODOSENM=$G(^PS(50.606,PODOSE,0)) 172 213 S TRADENM=$G(^PSRX(IRXN,"TN")) 173 214 S $P(RXE,"|",6)=PODOSE_CS_PODOSENM_CS_"99PSF" 174 215 S $P(RXE,"|",8)=MP 175 S $P(RXE,"|",9)=TRADENM_ 216 ; 217 ; 3080129 - RCR 218 ; Segment 9 is incomplete, truncated. 219 ; S $P(RXE,"|",9)=TRADENM_ 220 S $P(RXE,"|",9)=TRADENM 176 221 S $P(RXE,"|",15)=$P(^PSRX(IRXN,0),"^") 177 222 S ^TMP("PSO",$J,PSI)="RXE|"_RXE,PSI=PSI+1 178 Q 223 QUIT 224 ; ========= 179 225 RXD(PSI) ;pharmacy dispense segment 180 Q:'$D(DFN) 226 QUIT:'$D(DFN) 227 ; 181 228 N RXD S RXD="" 182 229 S $P(RXD,"|",1)=$S($G(NFLD):NFLD,1:0) … … 185 232 S $P(RXD,"|",7)=$P(^PSRX(IRXN,0),"^") 186 233 S $P(RXD,"|",9)=RELDT_RS_BINGO_RS_PSONDC 187 Q 234 QUIT 235 ; ======== -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORENW.m
r628 r636 1 PSORENW ;BIR/SAB-renew main driver ; 4/25/07 8:42am2 ;;7.0;OUTPATIENT PHARMACY;**11,27,30,46,71,96,100,130,148 ,206**;DEC 1997;Build 391 PSORENW ;BIR/SAB-renew main driver ;07/07/96 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,30,46,71,96,100,130,148**;DEC 1997 3 3 ;External reference to ^PSDRUG supported by DBIA 221 4 4 ;External references L, UL, PSOL, and PSOUL^PSSLOCK supported by DBIA 2789 … … 58 58 I $P($G(^PSDRUG(PSODRG,2)),"^",3)'["O" Q "0^Drug is No longer used by Outpatient Pharmacy." 59 59 I $G(^PSDRUG(PSODRG,"I"))]"",DT>$G(^("I")) Q "0^This Drug has been Inactivated." 60 I ($P(PSODRUG0,"^",3)[1)!($P(PSODRUG0,"^",3)[2)!($P(PSODRUG0,"^",3)["W") Q "0^Non-Renewable "_$S($P(PSODRUG0,"^",3)["A":"Drug Narcotic.",1:"Drug.") 60 I $P(PSODRUG0,"^",3)["A",$P(PSODRUG0,"^",3)'["B" Q "0^Non-Renewable Drug Narcotic." 61 I $P(PSODRUG0,"^",3)["W" Q "0^Non-Renewable Drug." 61 62 I $D(^PS(53,+$P(RX0,"^",3),0)),'$P(^(0),"^",5) Q "0^Non-Renewable Prescription." 62 63 S PSOLC=$P(RX0,"^"),PSOLC=$E(PSOLC,$L(PSOLC)) I $A(PSOLC)'<90 Q "0^Max number of renewals (26) has been reached." -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORENW0.m
r628 r636 1 PSORENW0 ;IHS/DSD/JCM-renew main driver continuation ; 4/24/07 9:05am2 ;;7.0;OUTPATIENT PHARMACY;**11,27,32,59,64,46,71,96,100,130,237 ,206**;DEC 1997;Build 391 PSORENW0 ;IHS/DSD/JCM-renew main driver continuation ;2/8/06 8:40am 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,32,59,64,46,71,96,100,130,237**;DEC 1997 3 3 ;External reference to ^PS(50.7 supported by DBIA 2223 4 4 ;External reference to ^PSDRUG supported by DBIA 221 … … 58 58 ; 59 59 S (PSOS,PSOX,PSOY)="" K ACOM,DIR,DIRUT,DIRUT,DUOUT 60 I $G(PSOSD) F S PSOS=$O(PSOSD(PSOS)) Q:PSOS="" F S PSOX=$O(PSOSD(PSOS,PSOX)) Q:PSOX']""!(PSORENW("DFLG")) I PSORENW("OIRXN")=+PSOSD(PSOS,PSOX) S PSOY=PSOSD(PSOS,PSOX) I $ TR($P(PSOY,"^",3),"B")]"" D K ACOM,DIR,DIRUT,DIRUT,DUOUT60 I $G(PSOSD) F S PSOS=$O(PSOSD(PSOS)) Q:PSOS="" F S PSOX=$O(PSOSD(PSOS,PSOX)) Q:PSOX']""!(PSORENW("DFLG")) I PSORENW("OIRXN")=+PSOSD(PSOS,PSOX) S PSOY=PSOSD(PSOS,PSOX) I $P(PSOY,"^",3)]"" D K ACOM,DIR,DIRUT,DIRUT,DUOUT 61 61 . S PSORENW("DFLG")=1 62 62 . W !,$C(7),"Cannot renew Rx # ",$P(PSORENW("RX0"),"^") -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORN52.m
r628 r636 1 PSORN52 ;BIR/DSD - files renewal entries in prescription file ;08/09/93 2 ;;7.0;OUTPATIENT PHARMACY;**1,11,27,37,46,79,71,100,117,157,143,219,148,239,201**;DEC 1997 1 PSORN52 ;BIR/DSD - files renewal entries in prescription file ; 3/11/07 4:42pm 2 ;;7.0;OUTPATIENT PHARMACY;**1,11,27,37,46,79,71,100,117,157,143,219,148,239,201,208**;DEC 1997;Build 39 3 ; Modified from FOIA VistA 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;Ext ref to ^PS(55 sup by DBIA 2228 4 20 ;Ext ref to PSOUL^PSSLOCK sup by DBIA 2789 … … 45 61 I (PSOSCP<50&('$P($G(^PS(53,+$P(^PSRX(PSOX("IRXN"),0),"^",3),0)),"^",7))),$G(DUZ("AG"))="V" S PSOFLAG=0 D COPAY^PSOCPB 46 62 ;I PSOSCP>49!($P($G(^PS(53,+$P(^PSRX(PSOX("IRXN"),0),"^",3),0)),"^",7)=1) S PSOFLAG=0 D SC^PSOMLLD2 63 I PSOAFYN="Y" G AFIN ;vfah 47 64 I PSOSCA&(PSOSCP>49)!((PSOSCA!(PSOBILL=2))&($P($G(^PS(53,+$P(^PSRX(PSOX("IRXN"),0),"^",3),0)),"^",7)=1)) S PSOFLAG=0 D SC^PSOMLLD2 48 65 I $$DT^PSOMLLDT D … … 56 73 I $G(PSONEW("NEWCOPAY")) S ^PSRX(PSOX("IRXN"),"IB")=PSONEW("NEWCOPAY") 57 74 ; 58 D FINISH,ACP^PSOUTIL 75 AFIN D FINISH,ACP^PSOUTIL ;vfah copay not evaluated by Autofinish,Rx 59 76 ; 60 77 N PSOSCFLD S PSOSCFLD=$S(PSOSCP'="":$G(PSOANSQ("SC")),1:"")_"^"_$G(PSOANSQ(PSOX("IRXN"),"MST"))_"^"_$G(PSOANSQ(PSOX("IRXN"),"VEH"))_"^"_$G(PSOANSQ(PSOX("IRXN"),"RAD")) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORX1.m
r628 r636 1 PSORX1 ;BIR/SAB-medication processing driver ;3/28/05 1:14pm 2 ;;7.0;OUTPATIENT PHARMACY;**7,22,23,57,62,46,74,71,90,95,115,117,146,139,135,182,195,233,268**;DEC 1997;Build 9 1 PSORX1 ;BIR/SAB-medication processing driver ; 1/7/07 3:32pm 2 ;;7.0;OUTPATIENT PHARMACY;**7,22,23,57,62,46,74,71,90,95,115,117,146,139,135,182,195,233,268,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External reference PDA^PPPPDA1 supported by DBIA 1374 4 20 ;External reference ^PS(55 supported by DBIA 2228 … … 38 54 K NPPROC,PSOQFLG,DIC,DR,DIQ S DIC=2,DA=PSODFN,DR=.351,DIQ="PSOPTPST" D EN^DIQ1 K DIC,DA,DR,DIQ D DEAD^PSOPTPST I $G(PSOQFLG) S NOPROC=1 Q 39 55 ;PSO*195 move SSN write to here and add DISPPRF call 40 S SSN=$P(^DPT(PSODFN,0),"^",9) W !!?10,$C(7),PSORX("NAME")41 W " ("_$E(SSN,1,3)_"-"_$E(SSN,4,5)_"-"_$E(SSN,6,9)_")" K SSN56 D ^VADPT W !!?10,$C(7),PSORX("NAME") ; correction for VOE 57 W " ",VA("PID") ; Correction with VOE, VA shouldn't be using SSN here! 42 58 S PSONOAL="" D ALLERGY^PSOORUT2 D I PSONOAL'="" D PAUSE 43 59 .I PSONOAL'="" W !,$C(7)," No Allergy Assessment!" -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXDL.m
r628 r636 1 1 PSORXDL ;BIR/SAB - Deletes one prescription ;06/10/96 2 ;;7.0;OUTPATIENT PHARMACY;**4,17,9,27,117,131,148,201 ,291**;DEC 1997;Build 22 ;;7.0;OUTPATIENT PHARMACY;**4,17,9,27,117,131,148,201**;DEC 1997 3 3 ;External reference to ^PS(55 supported by DBIA 2228 4 4 ;External references L, UL, PSOL, and PSOUL^PSSLOCK supported by DBIA 2789 … … 7 7 I '$D(^XUSEC("PSORPH",DUZ)) W !,$C(7),"Requires Pharmacy Key (PSORPH) !" Q 8 8 I '$D(PSOPAR) D ^PSOLSET I '$D(PSOPAR) W $C(7),!!,"SITE PARAMETERS MUST BE DEFINED!",! Q 9 K DA,PSODEFLG,PSOHLRE,PSOHLDAH,QTY,PSOABCDA,PSOREF 10 S (PSDEL,PSOXXDEL)=1,PS="DELETE",DIC("S")="I $P($G(^(0)),""^"",2),$P($G(^(""STA"")),""^"")'=13,$G(^(2))" 11 D A1^PSORXVW K DIC("S") I $G(DA)<1 G KILL 9 K DA,PSODEFLG,PSOHLRE,PSOHLDAH,QTY,PSOABCDA,PSOREF S (PSDEL,PSOXXDEL)=1,PS="DELETE",DIC("S")="I $P($G(^(0)),""^"",2),$P($G(^(""STA"")),""^"")'=13,$G(^(2))" D A1^PSORXVW K DIC("S") G:'$G(DA) KILL 12 10 D FULL^VALM1 13 11 S RXN=+$G(DA) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXED.m
r628 r636 1 PSORXED ;IHS/DSD/JCM-edit rx utility ; 5/18/07 2:53pm2 ;;7.0;OUTPATIENT PHARMACY;**2,16,21,26,56,71,125,201 ,246**;DEC 1997;Build 121 PSORXED ;IHS/DSD/JCM-edit rx utility ;02/18/98 3:14 PM 2 ;;7.0;OUTPATIENT PHARMACY;**2,16,21,26,56,71,125,201**;DEC 1997 3 3 ;External reference to ^PSXEDIT supported by DBIA 2209 4 4 ;External reference to ^DD(52 supported by DBIA 999 … … 24 24 L1 D LOG,POST 25 25 PROCESSX Q 26 CHECK Q L +^PSRX(PSORXED("IRXN")): $S(+$G(^DD("DILOCKTM"))>0:+^DD("DILOCKTM"),1:3)I '$T W $C(7),!!,"Rx Number is Locked by Another User!",! S PSORXED("DFLG")=1 H 5 Q26 CHECK Q L +^PSRX(PSORXED("IRXN")):0 I '$T W $C(7),!!,"Rx Number is Locked by Another User!",! S PSORXED("DFLG")=1 H 5 Q 27 27 I $G(^PSDRUG($P(PSORXED("RX0"),"^",6),"I"))]"",^("I")<DT D G CHECKX 28 28 . W !,$C(7),"This drug has been inactivated. ",! S PSORXED("DFLG")=1 Q … … 54 54 I $L(PSORX("PSOL",PSOX2))+$L(PSORXED("IRXN"))<220 D G LOGX 55 55 .I PSORX("PSOL",PSOX2)'[PSORXED("IRXN")_"," S PSORX("PSOL",PSOX2)=PSORX("PSOL",PSOX2)_PSORXED("IRXN")_"," D SETRP 56 E I $G(PSORX("PSOL",PSOX2+1))'[PSORXED("IRXN")_"," S PSORX("PSOL",PSOX2+1)=PSORXED("IRXN")_"," D SETRP ;;PSO*7*24656 E I PSORX("PSOL",PSOX2+1)'[PSORXED("IRXN")_"," S PSORX("PSOL",PSOX2+1)=PSORXED("IRXN")_"," D SETRP 57 57 LOGX K PSOEDITF,PSOEDITR,PSOEDITL D:$G(RFED) ^PSORXED1 58 58 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXL.m
r628 r636 1 PSORXL ;BHAM ISC/SAB - action to be taken on prescriptions ;03/01/96 9:35 2 ;;7.0;OUTPATIENT PHARMACY;**8,21,24,32,47,135,148**;DEC 1997 3 ;External reference to File #50 supported by DBIA 221 4 ;External references CHPUS^IBACUS and TRI^IBACUS supported by DBIA 2030 1 PSORXL ;BHAM ISC/SAB - action to be taken on prescriptions ;3/13/07 19:21 2 ;;7.0;OUTPATIENT PHARMACY;**8,21,24,32,47,135,148,208**;DEC 1997;Build 39 3 ; Modified from FOIA VistA 4 ; Copyright (C) GNU GPL 2007 WorldVistA 5 ; 6 ;Ext ref to File #50 supported by DBIA 221 7 ;Ext refs CHPUS^IBACUS and TRI^IBACUS supported by DBIA 203 5 8 I $G(PSOTRVV),$G(PPL) S PSORX("PSOL",1)=PPL K PPL 6 9 N SLBL,PSOSONE,PSOKLRXS 7 10 S:'$G(PPL) PPL=$G(PSORX("PSOL",1)) G:$P(PSOPAR,"^",26) P 8 LBL W !! S DIR("A",1)="Label Printer: "_$S($G(SUSPT):PSLION,1:$G(PSOLAP))11 LBL I $G(PSOAFYN)'="Y" W !! S DIR("A",1)="Label Printer: "_$S($G(SUSPT):PSLION,1:$G(PSOLAP)) 9 12 S DIR("A")="LABEL: QUEUE/CHANGE PRINTER"_$S($P(PSOPAR,"^",23):"/HOLD",1:"")_$S($P(PSOPAR,"^",24):"/SUSPEND",1:"")_$S($P(PSOPAR,"^",26):"/LABEL",1:"")_" or '^' to bypass " 10 13 S DIR("?",1)="Enter 'Q' to queue labels to print",DIR("?")="Enter '^' to bypass label functions",DIR("?",4)="Enter 'S' to suspend labels to print later" … … 12 15 S DIR("?",5)="Enter 'C' to select another label printer" 13 16 S:$P(PSOPAR,"^",26) DIR("?",5)="Enter 'L' to print labels without queuing" 14 TRI ; Tricare17 TRI ; 15 18 S X="IBACUS" X ^%ZOSF("TEST") K X I '$T G PASS 16 19 I '$$TRI^IBACUS() G PASS … … 29 32 I '$D(^TMP($J,"PSOBILL")) K ^TMP($J,"PSONOB") G PASS 30 33 I '$D(^TMP($J,"PSONOB")),$D(^TMP($J,"PSOBILL")) S (Y,LBL)="H" G H1 31 ; If some Rx's are billable, and some are not34 ; 32 35 SETP K PSORX("PSOL"),PPL S VVCT=1 F VV=0:0 S VV=$O(^TMP($J,$S($G(PSTRIVAR):"PSONOB",1:"PSOBILL"),VV)) Q:'VV S TRIRX=^TMP($J,$S($G(PSTRIVAR):"PSONOB",1:"PSOBILL"),VV) I +TRIRX D 33 36 .I $G(PSORX("PSOL",1))="" S PSORX("PSOL",1)=TRIRX_"," Q … … 37 40 K ^TMP($J,"PSONOB") S PPL=$G(PSORX("PSOL",1)) 38 41 PASS ; 39 I $E($G(DIR("A")),1,6)'="LABEL:" D RESDIR^PSOCPTRI 40 S DIR(0)="SA^P:PROFILE;Q:QUEUE;C:CHANGE PRINTER"_$S($P(PSOPAR,"^",23):";H:HOLD",1:"")_$S($P(PSOPAR,"^",24):";S:SUSPENSE",1:"")_$S($P(PSOPAR,"^",26):";L:PRINT",1:""),DIR("B")="Q" D ^DIR D G:$D(DIRUT)!($D(DUOUT)) EX 41 .I $D(DIRUT)!($D(DUOUT)) D AL^PSOLBL("UT") I $G(PSOEXREP) S PSOEXREX=1 42 .I $G(PSOPULL) I $D(DIRUT)!($D(DUOUT)) S PSOQFLAG=1 42 I $G(PSOAFYN)'="Y" I $E($G(DIR("A")),1,6)'="LABEL:" D RESDIR^PSOCPTRI 43 I $G(PSOAFYN)'="Y" S DIR(0)="SA^P:PROFILE;Q:QUEUE;C:CHANGE PRINTER"_$S($P(PSOPAR,"^",23):";H:HOLD",1:"")_$S($P(PSOPAR,"^",24):";S:SUSPENSE",1:"")_$S($P(PSOPAR,"^",26):";L:PRINT",1:""),DIR("B")="Q" D ^DIR D G:$D(DIRUT)!($D(DUOUT)) EX 44 .I $G(PSOAFYN)'="Y" I $D(DIRUT)!($D(DUOUT)) D AL^PSOLBL("UT") I $G(PSOEXREP) S PSOEXREX=1 45 .I $G(PSOAFYN)'="Y" I $G(PSOPULL) I $D(DIRUT)!($D(DUOUT)) S PSOQFLAG=1 46 I $G(PSOAFYN)="Y" S PSOLAP=$G(^SC(+ORL,"AFRXCLINPRNT")) 47 I $G(PSOAFYN)="Y" I PSOLAP="" S DIRUT="^" G:$D(DIRUT)!($D(DUOUT)) EX 48 I $G(PSOAFYN)="Y" S PSOLAP=$P(^%ZIS(1,PSOLAP,0),"^",1) 43 49 S:$G(PSOBEDT) NOPP=Y 44 50 I $G(Y)="C" K PSOCLBL,%ZIS("B") S PSOCLBL=1 D @$S('$D(PSOPAR):"^PSOLSET",1:"PLBL^PSOLSET") K PSOCLBL G LBL … … 57 63 D ^%ZISC S PSL=0 58 64 QLBL I $G(PSXSYS),('$G(RXLTOP)),('$G(PSOEXREP)) D RXL^PSOCMOP G:'$G(PPL) D1 59 ;60 65 ;- Submitting list of Rx to ECME for DUR/79 REJECT check and possible submission to 3rd Pary Payer 61 D ECME^PSORXL166 I $G(PSOAFYN)'="Y" D ECME^PSORXL1 ;vfah 62 67 ; 63 68 S ZTRTN="DQ^PSOLBL",ZTIO=$S($G(SUSPT):PSLION,1:PSOLAP),ZTDESC="Outpatient Pharmacy "_$S($G(SUSPT):"SUSPENSE ",$G(DG):"DRUG INTERACTION ",1:"")_"LABELS OUTPUT ROUTINE",ZTDTH=$S($G(PSOTIME):PSOTIME,1:$H),PDUZ=DUZ 64 69 F G="PPL1","PSOSYS","DFN","PSOPAR","PDUZ","PCOMX",$S($G(SUSPT):"PFION",1:"PSOLAP"),"PPL","PSOSITE","RXY","COPIES","SIDE","PSOSUSPR","PSOBARS","PSOBAR1","PSOBAR0","PSODELE","PSOPULL","PSTAT","PSODBQ","PSOEXREP","PSOTREP" S:$D(@G) ZTSAVE(G)="" 70 S ZTSAVE("PSOAFDFN")="",ZTSAVE("PSOAFDUZ")="",ZTSAVE("PSOAFYN")="",ZTSAVE("PSOAFPAT")="",ZTSAVE("PSOAFPNM")="",ZTSAVE("VFASDD")="",ZTSAVE("ORL")="" ;vfah 65 71 S ZTSAVE("PSORX(")="",ZTSAVE("RXRP(")="",ZTSAVE("RXPR(")="",ZTSAVE("RXRS(")="",ZTSAVE("RXFL(")="",ZTSAVE("PCOMH(")="" 66 72 D ^%ZISC,^%ZTLOAD K:$G(PSOSONE) RXRS W:$D(ZTSK)&('$G(SUSPT))&('$G(PSOEXREP)) !!,"LABEL(S) QUEUED TO PRINT",!! -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXL1.m
r628 r636 1 PSORXL1 ;BIR/SAB-action to be taken on prescriptions ; 10/5/07 2:40pm2 ;;7.0;OUTPATIENT PHARMACY;**36,46,148,260 ,274**;DEC 1997;Build 81 PSORXL1 ;BIR/SAB-action to be taken on prescriptions ;03/01/96 2 ;;7.0;OUTPATIENT PHARMACY;**36,46,148,260**;DEC 1997;Build 84 3 3 S S SPPL="",PPL1=1 S:'$G(PPL) PPL=$G(PSORX("PSOL",PPL1)) G:$G(PPL)']"" D1 4 4 S1 F PI=1:1 Q:$P(PPL,",",PI)="" S DA=$P(PPL,",",PI) D … … 33 33 K COMM 34 34 SUSQ Q 35 ;PSO*7*274 allways recalculate RXF 36 ACT S RXF=0 F I=0:0 S I=$O(^PSRX(DA,1,I)) Q:'I S RXF=I S:I>5 RXF=I+1 35 ACT I '$D(RXF) S RXF=0 F I=0:0 S I=$O(^PSRX(DA,1,I)) Q:'I S RXF=I S:I>5 RXF=I+1 37 36 S IR=0 F FDA=0:0 S FDA=$O(^PSRX(DA,"A",FDA)) Q:'FDA S IR=FDA 38 37 S IR=IR+1,^PSRX(DA,"A",0)="^52.3DA^"_IR_"^"_IR -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXPA1.m
r628 r636 1 PSORXPA1 ;BIR/SAB - listman partial prescriptions ;07/14/93 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,56,77,130,152,181,174**;DEC 1997 1 PSORXPA1 ;BIR/SAB - listman partial prescriptions ; 1/15/07 5:42pm 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,56,77,130,152,181,174,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External references L,UL, PSOL, and PSOUL^PSSLOCK supported by DBIA 2789 4 20 ;External reference to ^PSDRUG supported by DBIA 221 5 21 ;External reference to ^DD(52 supported by DBIA 999 22 S DIC="^VA(200,",DIC(0)="QEZ",X="AUTOFINISH,RX" ;vfah 23 D ^DIC K DIC ;vfah 24 S PSOZAF=+Y ;vfah Quits if AUTOFINISH,RX not a user 25 I $P($G(^PSRX(RXN,"OR1")),"^",5)=$G(PSOZAF) S VALMBCK="",VALMSG="Partial option is not available for Autofinshed Rxs" K PSOZAF Q ;vfah 6 26 I $D(RXRP($P(PSOLST(ORN),"^",2))) S VALMBCK="",VALMSG="A Reprint Label has been requested!" Q 7 27 ;I $D(RXPR($P(PSOLST(ORN),"^",2))) S VALMBCK="",VALMSG="A Partial has already been requested!" Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXRP1.m
r628 r636 1 PSORXRP1 ;BIR/SAB-rx speed reprint listman ;03/06/95 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,120,156,148**;DEC 1997 1 PSORXRP1 ;BIR/SAB-rx speed reprint listman ; 12/10/06 9:50pm 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,120,156,148,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789 4 20 SEL N PSODISP,VALMCNT I '$G(PSOCNT) S VALMSG="This patient has no Prescriptions!" S VALMBCK="" Q … … 25 41 ; 26 42 RX ;process reprint request 43 ; 44 S DIC="^VA(200,",DIC(0)="QEZ",X="AUTOFINISH,RX" ;vfah 45 D ^DIC K DIC ;vfah 46 S PSOZAF=+Y ;vfah 47 I $P($G(^PSRX($P(PSOLST(ORN),"^",2),"OR1")),"^",5)=$G(PSOZAF) W $C(7),!!,"Rx "_$$GET1^DIQ(52,$P(PSOLST(ORN),"^",2),.01)_" is an Autofinish,Rx and labels can not be reprinted." K PSOZAF D PAUSE^VALM1 Q ;vfah 48 ; 27 49 Q:$P(^PSRX($P(PSOLST(ORN),"^",2),"STA"),"^")>11 28 50 I $$LMREJ^PSOREJU1($P(PSOLST(ORN),"^",2)) W $C(7),!!,"Rx "_$$GET1^DIQ(52,$P(PSOLST(ORN),"^",2),.01)_" has OPEN/UNRESOLVED 3rd Party Payer Rejects!" K DIR D PAUSE^VALM1 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXRP2.m
r628 r636 1 PSORXRP2 ;BIR/SAB-main menu entry reprint of a Rx label ;10/5/07 7:45am 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,120,138,135,156,185,280**;DEC 1997;Build 5 1 PSORXRP2 ;BIR/SAB-main menu entry reprint of a Rx label ; 12/10/06 9:51pm 2 ;;7.0;OUTPATIENT PHARMACY;**11,27,120,138,135,156,185,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789 4 20 ;External reference ^PS(55 supported by DBIA 2228 … … 9 25 S (PPL,DA,RX,PSORPRX)=+Y,PDA=Y(0),RXF=0,ZD(DA)=DT,REPRINT=1,STA=+$G(^PSRX(+Y,"STA")) 10 26 D PSOL^PSSLOCK(PSORPRX) I '$G(PSOMSG) W !!,$S($P($G(PSOMSG),"^",2)'="":$P($G(PSOMSG),"^",2),1:"Another person is editing this order."),! K PSOMSG G LRP 27 S DIC="^VA(200,",DIC(0)="QEZ",X="AUTOFINISH,RX" ;vfah 28 D ^DIC K DIC ;vfah 29 S PSOZAF=+Y ;vfah 30 I $P(^PSRX(RX,"OR1"),"^",5)=$G(PSOZAF) W $C(7),!,"Cannot Reprint Labels for Autofinished Rxs" D ULR,KILL Q ;vfah 11 31 I $P(^PSRX(RX,"STA"),"^")=14 W $C(7),!,"Cannot Reprint! Discontinued by Provider." D ULR,KILL Q 12 32 I $P(^PSRX(RX,"STA"),"^")=15 W $C(7),!,"Cannot Reprint! Discontinued due to editing." D ULR,KILL Q … … 54 74 E D EN3^PSOUTLA1(DA,75) S D=0 F S D=$O(BSIG(D)) W !,BSIG(D) Q:'$O(BSIG(D)) 55 75 K D,BSIG 56 ;PSO*7*280 If Trade name, don't lookup in ^PSDRUG 57 W !!,$S($G(^PSRX(DA,"TN"))]"":P(6),(P(6)=+P(6))&$D(^PSDRUG(P(6),0)):$P(^(0),"^"),1:P(6)),! S PHYS=$S($D(^VA(200,+P(4),0)):$P(^(0),"^"),1:"Unknown") W PHYS K PHYS 76 W !!,$S((P(6)=+P(6))&$D(^PSDRUG(P(6),0)):$P(^(0),"^"),1:P(6)),! S PHYS=$S($D(^VA(200,+P(4),0)):$P(^(0),"^"),1:"Unknown") W PHYS K PHYS 58 77 W ?25,$S($D(^VA(200,+P(16),0)):$P(^(0),"^"),1:"Unknown"),!,"# of Refills: "_$G(P(9)) 59 78 I $G(RX) D -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXRPT.m
r628 r636 1 PSORXRPT ;BIR/SAB-reprint of a prescription label ;9/20/07 9:40am 2 ;;7.0;OUTPATIENT PHARMACY;**3,21,27,34,120,138,156,148,280**;DEC 1997;Build 5 1 PSORXRPT ;BIR/SAB-reprint of a prescription label ; 12/10/06 8:42pm 2 ;;7.0;OUTPATIENT PHARMACY;**3,21,27,34,120,138,156,148,208**;DEC 1997;Build 39 3 ; Modified from FOIA VISTA, 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External reference to ^PSDRUG supported by DBIA 221 4 20 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789 … … 14 30 .S RX=$P(PSOLST(ORN),"^",2) D VALID^PSORXRP1 S:$G(QFLG) VALMBCK="",VALMSG="A New Label has been requested already!" 15 31 S (PPL,DA,RX)=+Y,PDA=Y(0),RXF=0,ZD(DA)=DT,REPRINT=1,STA=+$G(^PSRX(+Y,"STA")) 32 ; 33 S DIC="^VA(200,",DIC(0)="QEZ",X="AUTOFINISH,RX" ;vfah 34 D ^DIC K DIC ;vfah 35 S PSOZAF=+Y ;vfah 36 I $P($G(^PSRX(RX,"OR1")),"^",5)=$G(PSOZAF) S VALMBCK="",VALMSG="This reprint option is not available for Autofinshed Rxs",QFLG=1 K PSOZAF D ULR,KILL Q ;vfah 37 ; 16 38 I $P(^PSRX(RX,"STA"),"^")=14 S VALMBCK="",VALMSG="Cannot Reprint! Discontinued by Provider.",QFLG=1 D ULR,KILL Q 17 39 I $P(^PSRX(RX,"STA"),"^")=15 S VALMBCK="",VALMSG="Cannot Reprint! Discontinued due to editing.",QFLG=1 D ULR,KILL Q … … 55 77 E D EN3^PSOUTLA1(DA,75) S D=0 F S D=$O(BSIG(D)) W !,BSIG(D) Q:'$O(BSIG(D)) 56 78 K D,BSIG 57 ;PSO*7*280 If trade name is used Stop the DRUG Lookup. 58 W !!,$S($G(^PSRX(DA,"TN"))]"":P(6),(P(6)=+P(6))&$D(^PSDRUG(P(6),0)):$P(^(0),"^"),1:P(6)),! S PHYS=$S($D(^VA(200,+P(4),0)):$P(^(0),"^"),1:"Unknown") W PHYS K PHYS 79 W !!,$S((P(6)=+P(6))&$D(^PSDRUG(P(6),0)):$P(^(0),"^"),1:P(6)),! S PHYS=$S($D(^VA(200,+P(4),0)):$P(^(0),"^"),1:"Unknown") W PHYS K PHYS 59 80 W ?25,$S($D(^VA(200,+P(16),0)):$P(^(0),"^"),1:"Unknown"),!,"# of Refills: "_$G(P(9)) 60 81 I $G(RX) S RXFL(RX)=0 F ZZZ=0:0 S ZZZ=$O(^PSRX(RX,1,ZZZ)) Q:'ZZZ S RXFL(RX)=ZZZ -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXVW.m
r628 r636 1 1 PSORXVW ;BHAM ISC/SAB - listman view of a prescription ;5/25/05 2:10pm 2 ;;7.0;OUTPATIENT PHARMACY;**14,35,46,96,103,88,117,131,146,156,185,210,148,233,260,264 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**14,35,46,96,103,88,117,131,146,156,185,210,148,233,260,264**;DEC 1997;Build 19 3 3 ;External reference to File ^PS(55 supported by DBIA 2228 4 4 ;External reference to ^PS(50.7 supported by DBIA 2223 … … 107 107 S VALM("TITLE")="Rx View "_"("_$P("Error^Active^Non-Verified^Refill^Hold^Non-Verified^Suspended^^^^^Done^Expired^Discontinued^Deleted^Discontinued^Discontinued (Edit)^Provider Hold^","^",ST+2)_")" 108 108 S:$P($G(^PSRX(DA,"PKI")),"^") VALMSG="Digitally Signed Order" 109 D EN^PSOORAL,KILL I $G(PS)="VIEW" GPSORXVW109 D EN^PSOORAL,KILL G:PS="VIEW" PSORXVW 110 110 Q 111 111 ; 112 KILL K ^TMP("PSOAL",$J),PSOAL,IEN,^TMP("PSOHDR",$J) I $G(PS)="VIEW" KDA112 KILL K ^TMP("PSOAL",$J),PSOAL,IEN,^TMP("PSOHDR",$J) K:PS="VIEW" DA 113 113 K ST,RFL,RFLL,RFL1,ST,II,J,N,PHYS,L1,DIRUT,PSDIV,PSEXDT,MED,M1,FFX,DTT,DAT,RX0,RX2,R3,RTN,SIG,STA,P1,PL,P0,Z0,Z1,EXDT,IFN,DIR,DUOUT,DTOUT,PSOELSE 114 114 K LBL,I,RFDATE,%H,%I,RN,RFT,%,%I,DFN,GMRA,GMRAL,HDR,POERR,PTST,REFL,RF,RLD,RX3 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXVW1.m
r628 r636 1 PSORXVW1 ;BIR/SAB-view prescription con't ; 12/4/07 12:28pm2 ;;7.0;OUTPATIENT PHARMACY;**35,47,46,71,99,117,156,193,210,148,258,260 ,240,281**;DEC 1997;Build 411 PSORXVW1 ;BIR/SAB-view prescription con't ;5/26/05 10:07am 2 ;;7.0;OUTPATIENT PHARMACY;**35,47,46,71,99,117,156,193,210,148,258,260**;DEC 1997;Build 84 3 3 ;External reference to ^DD(52 supported by DBIA 999 4 4 ;External reference to ^VA(200 supported by DBIA 10060 … … 43 43 .I $P(P1,"^",5)]"" N PSOACBRK,PSOACBRV D 44 44 ..S PSOACBRV=$P(P1,"^",5) 45 ..;PSO*7*240 Use fileman to format 46 ..K ^UTILITY($J,"W") S X="Comments: "_PSOACBRV,(DIWR,DIWL)=1,DIWF="C80" D ^DIWP F I=1:1:^UTILITY($J,"W",1) S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=$G(^UTILITY($J,"W",1,I,0)) 45 ..I $L(PSOACBRV)<71 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Comments: "_PSOACBRV Q 46 ..I $E(PSOACBRV,1,70)'[" " S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Comments: "_$E(PSOACBRV,1,70),IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=$E(PSOACBRV,71,245) Q 47 ..F PSOACBRK=245:-1 Q:PSOACBRK=0 I $E(PSOACBRV,PSOACBRK)=" ",PSOACBRK<71 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Comments: "_$E(PSOACBRV,1,PSOACBRK),IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=$E(PSOACBRV,PSOACBRK,245) Q 47 48 .I $G(^PSRX(DA,"A",N,1))]"" S IEN=IEN+1,$P(^TMP("PSOAL",$J,IEN,0)," ",5)=$P(^PSRX(DA,"A",N,1),"^") I $P(^PSRX(DA,"A",N,1),"^",2)]"" S ^TMP("PSOAL",$J,IEN,0)=^TMP("PSOAL",$J,IEN,0)_":"_$P(^PSRX(DA,"A",N,1),"^",2) 48 49 .I $O(^PSRX(DA,"A",N,2,0)) F I=0:0 S I=$O(^PSRX(RXN,"A",N,2,I)) Q:'I S MIG=^PSRX(RXN,"A",N,2,I,0) D 49 50 ..F SG=1:1:$L(MIG) S:$L(^TMP("PSOAL",$J,IEN,0)_" "_$P(MIG," ",SG))>80 IEN=IEN+1,$P(^TMP("PSOAL",$J,IEN,0)," ",9)=" " S:$P(MIG," ",SG)'="" ^TMP("PSOAL",$J,IEN,0)=$G(^TMP("PSOAL",$J,IEN,0))_" "_$P(MIG," ",SG) 50 K MIG,SG,I,^UTILITY($J,"W"),DIWF,DIWL,DIWR 51 Q 51 K MIG,SG,I Q 52 52 LBL ;label log 53 53 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=" ",IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Label Log:" … … 121 121 ; 122 122 HLP ; Help Text for the VIEW PRESCRIPTION prompt 123 W !," A prescription number or ECME # may be entered. The ECME" 124 W !," number must be entered in E.NNNNNNN format, where NNNNNNN" 125 W !," is the prescription ECME # (example: E.0289332). Or just" 123 W !," You may enter E.NNNNNNN, where NNNNNNN is the" 124 W !," prescription ECME# (e.g., E.0289332) or," 126 125 D LKP("?") 127 126 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOSD0.m
r628 r636 1 PSOSD0 ;BHAM ISC/SAB - action or informational profile cont. ; 6/21/07 8:20am2 ;;7.0;OUTPATIENT PHARMACY;**2,19,40,66,107,110,258 ,206**;DEC 1997;Build 391 PSOSD0 ;BHAM ISC/SAB - action or informational profile cont. ;3/24/93 2 ;;7.0;OUTPATIENT PHARMACY;**2,19,40,66,107,110,258**;DEC 1997;Build 4 3 3 ;External reference to ^PS(50.605 supported by DBIA 696 4 4 ;External reference to ^SC supported by DBIA 10040 … … 39 39 I 'PSTYPE D:$D(^PSDRUG(+$P(RX0,"^",6),"CLOZ"))&($P($G(^("CLOZ1")),"^")'="PSOCLO1") ^PSOLAB G RXN2 40 40 G:$G(DOD(DFN))]"" RXN2 41 D:+$G(PSOBAR4) BAR S PSRENW=0,PSODEA=$P($G(^PSDRUG(+$P(RX0,"^",6),0)),"^",3) I PSODEA'[" 1",PSODEA'["2",PSODEA'["W",$P($G(^PS(53,+$P(RX0,"^",3),0)),"^",5) S PSRENW=141 D:+$G(PSOBAR4) BAR S PSRENW=0,PSODEA=$P($G(^PSDRUG(+$P(RX0,"^",6),0)),"^",3) I PSODEA'["2",PSODEA'["W",$P($G(^PS(53,+$P(RX0,"^",3),0)),"^",5) S PSRENW=1 42 42 S PSOIFSUP=$S(PSODEA']"":0,PSODEA["S":1,1:0),RXX=$P(RX0,"^"),RXX(1)="",RXX=$O(^PSRX("B",RXX,RXX(1))) 43 43 W:$P($G(^PSRX(RXX,"IB")),"^") !?11,"****COPAY****" D PSRENW^PSOSD2 … … 80 80 I 'PSTYPE D:$D(^PSDRUG(+$P(RX0,"^",6),"CLOZ"))&($P($G(^("CLOZ1")),"^")'="PSOCLO1") ^PSOLAB G RXN2 81 81 G:$G(DOD(DFN))]"" RXN3 82 D:+$G(PSOBAR4) BAR S PSRENW=0,PSODEA=$P($G(^PSDRUG(+$P(RX0,"^",6),0)),"^",3) I PSODEA'[" 1",PSODEA'["2",PSODEA'["W",$P($G(^PS(53,+$P(RX0,"^",3),0)),"^",5) S PSRENW=182 D:+$G(PSOBAR4) BAR S PSRENW=0,PSODEA=$P($G(^PSDRUG(+$P(RX0,"^",6),0)),"^",3) I PSODEA'["2",PSODEA'["W",$P($G(^PS(53,+$P(RX0,"^",3),0)),"^",5) S PSRENW=1 83 83 S PSOIFSUP=$S(PSODEA']"":0,PSODEA["S":1,1:0),RXX=$P(RX0,"^"),RXX(1)="",RXX=$O(^PSRX("B",RXX,RXX(1))) 84 84 W:$P($G(^PSRX(RXX,"IB")),"^") !?11,"****COPAY****" D PSRENW^PSOSD2 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOSD1.m
r628 r636 1 PSOSD1 ;BHAM ISC/SAB/JMB - action or informational profile cont. ; 10/30/07 10:39am2 ;;7.0;OUTPATIENT PHARMACY;**2,17,19,22,40,49,66,107,110,132,233,258 ,240**;DEC 1997;Build 51 PSOSD1 ;BHAM ISC/SAB/JMB - action or informational profile cont. ;11/18/92 2 ;;7.0;OUTPATIENT PHARMACY;**2,17,19,22,40,49,66,107,110,132,233,258**;DEC 1997;Build 4 3 3 ;External reference to ^PS(59.7 is supported by DBIA 694 4 4 ; … … 25 25 D KVA^VADPT K DOD,FILL,DIC,PSCNT,PSDT,PCLASS,PHYS,ZCLASS,PSOPRINT,RXNODE,DIR,X1,X2,PSONUM,PSOPOLP,PSSN4 26 26 Q 27 ; 27 ; 28 28 DAYS K DIR S DIR("A")="Profile Expiration/Discontinued Cutoff",DIR("B")=120,DIR(0)="N^0:9999:0",DIR("?",1)="Enter the number of days which will cut discontinued and expired Rx's from",DIR("?")="the profile." 29 29 D ^DIR Q:$D(DTOUT)!($D(DUOUT)) S PSDAYS=X K DIR S X1=DT,X2=-PSDAYS D C^%DTC S (PSDATE,PSDAY)=X … … 86 86 K DIR,DTOUT,DIRUT,DUOUT S DIR("A")="Do you want this Profile to print in 132 columns or 80 columns: ",DIR("B")="132",DIR(0)="SAM^1:132;8:80;E:Exit" 87 87 D ^DIR G:Y="E"!($D(DUOUT))!($D(DIRUT)) EXIT S PSORM=$S(Y=1:1,1:0) K DIR,X,Y 88 ;PSO*7*240 Go to exit if DUOUT or DTOUT 89 ASK D DAYS G:($D(DUOUT))!($D(DTOUT)) EXIT S PRF=PSODFN_"," D DEV I $D(ZTSK) S VALMSG="Action Profile Queued to Printer." 88 ASK D DAYS S PRF=PSODFN_"," D DEV I $D(ZTSK) S VALMSG="Action Profile Queued to Printer." 90 89 D EXIT K LM 91 90 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOSIGMX.m
r628 r636 1 PSOSIGMX ;BIR/RTR-Utility routine to calculate Max Refills for CPRS ; 7/25/07 11:17am2 ;;7.0;OUTPATIENT PHARMACY;**46,78,108,131,222 ,206**;DEC 1997;Build 391 PSOSIGMX ;BIR/RTR-Utility routine to calculate Max Refills for CPRS ;12/28/00 2 ;;7.0;OUTPATIENT PHARMACY;**46,78,108,131,222**;DEC 1997;Build 12 3 3 ;External reference to PS(55 supported by DBIA 2228 4 4 ;External reference to PSDRUG( supported by DBIA 221 … … 37 37 .I PSOCDEA["2"!(PSOCDEA["3")!(PSOCDEA["4")!(PSOCDEA["5") S PSOCSX=1 38 38 I PSOCSX D 39 .S PSOQX("MAX")=$S( (PSOCDEA[1)!(PSOCDEA[2):0,1:5),PSOMX1=$S($G(PSOMXRX)>PSOQX("MAX"):PSOQX("MAX"),1:$G(PSOMXRX)),PSOQX("MAX")=$S(PSOMX1=5:PSOQX("MAX"),1:PSOMX1)39 .S PSOQX("MAX")=$S(PSOCDEA["2":0,1:5),PSOMX1=$S($G(PSOMXRX)>PSOQX("MAX"):PSOQX("MAX"),1:$G(PSOMXRX)),PSOQX("MAX")=$S(PSOMX1=5:PSOQX("MAX"),1:PSOMX1) 40 40 .S PSOQX("MAX")=$S('PSOQX("MAX"):0,$G(PSOQX("DAYS SUPPLY"))=90:1,1:PSOQX("MAX")),PSODYX=$G(PSOQX("DAYS SUPPLY")),PSODYX1=$S(PSODYX<60:5,PSODYX'<60&(PSODYX'>89):2,PSODYX=90:1,1:0) S PSOQX("MAX")=$S(PSOQX("MAX")'>PSODYX1:PSOQX("MAX"),1:PSODYX1) 41 41 I 'PSOCSX!('$G(PSOQX("DRUG"))) D … … 45 45 .S PSOMXPAT=$O(^YSCL(603.01,"C",+$G(PSOQX("PATIENT")),0)) I 'PSOMXPAT S PSOQX("MAX")=0 Q 46 46 .S PSOMXPAT=$P($G(^YSCL(603.01,PSOMXPAT,0)),"^",3) 47 .I $D(PSOQX("DAYS SUPPLY")) S PSOQX("MAX")=$S(PSOMXPAT="M"&($G(PSOQX("DAYS SUPPLY")) <8):3,PSOMXPAT="M"&($G(PSOQX("DAYS SUPPLY"))<15):1,PSOMXPAT="B"&($G(PSOQX("DAYS SUPPLY"))<8):1,1:0) Q47 .I $D(PSOQX("DAYS SUPPLY")) S PSOQX("MAX")=$S(PSOMXPAT="M"&($G(PSOQX("DAYS SUPPLY")))<8:3,PSOMXPAT="M"&($G(PSOQX("DAYS SUPPLY")))<15:1,PSOMXPAT="B"&($G(PSOQX("DAYS SUPPLY")))<8:1,1:0) Q 48 48 .S PSOQX("MAX")=$S(PSOMXPAT="M":3,PSOMXPAT="B":1,1:0) 49 I $G(PSOQX("DRUG")) I PSOCDEA["A"&(PSOCDEA'["B")!(PSOCDEA["F") !(PSOCDEA[1)!(PSOCDEA[2)S PSOQX("MAX")=049 I $G(PSOQX("DRUG")) I PSOCDEA["A"&(PSOCDEA'["B")!(PSOCDEA["F") S PSOQX("MAX")=0 50 50 I PSONODD S PSOQX("DRUG")=0 51 51 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOSUPOE.m
r628 r636 1 1 PSOSUPOE ;BIR/RTR - Suspense pull via Listman ;3/1/96 2 ;;7.0;OUTPATIENT PHARMACY;**8,21,27,34,130,148 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**8,21,27,34,130,148**;DEC 1997 3 3 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789 4 4 SEL I '$G(PSOCNT) S VALMSG="This patient has no Prescriptions!" S VALMBCK="" Q … … 41 41 . D ECMESND^PSOBPSU1(RXREC,RFL,,"PP") 42 42 . I $$FIND^PSOREJUT(RXREC,RFL) D 43 . . S ACTION=$$HDLG^PSOREJU1(RXREC,RFL,"79,88","PP","IOQ"," Q")43 . . S ACTION=$$HDLG^PSOREJU1(RXREC,RFL,"79,88","PP","IOQ","I") 44 44 ; 45 45 D ULRX K PSOGET,PSOGETF -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOTPCAN.m
r628 r636 1 PSOTPCAN ;BIR/RTR - TPB Utility routine ;08/23/03 2 ;;7.0;OUTPATIENT PHARMACY;**146,153,163,227**;DEC 1997 1 PSOTPCAN ;BIR/RTR - TPB Utility routine ;3/13/07 21:21 2 ;;7.0;OUTPATIENT PHARMACY;**146,153,163,227,208**;DEC 1997;Build 39 3 ; Modified from FOIA VistA 4 ; Copyright (C) 2007 WorldVistA 5 ; 6 ; This program is free software; you can redistribute it and/or modify 7 ; it under the terms of the GNU General Public License as published by 8 ; the Free Software Foundation; either version 2 of the License, or 9 ; (at your option) any later version. 10 ; 11 ; This program is distributed in the hope that it will be useful, 12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ; GNU General Public License for more details. 15 ; 16 ; You should have received a copy of the GNU General Public License 17 ; along with this program; if not, write to the Free Software 18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 3 19 ;External reference to PS(55 supported by DBIA 2228 4 20 ;External reference to VA(200 supported by DBIA 224 … … 114 130 . S PSOTPWR1=$P($G(^PSRX(+$P(^PS(52.41,PSOTPWRN,0),"^",21),0)),"^",3) 115 131 . S PSOTPWR2=$P($G(^PS(53,+PSOTPWR1,0)),"^"),PSOTPWR3=$$UP^XLFSTR(PSOTPWR2) 116 . I PSOTPWR3="NON-VA" D132 . I PSOTPWR3="NON-VA",DUZ("AG")="V" D ; Skip for VOE sites 117 133 . . K DIR W !!,"This order has an Rx Patient Status of 'NON-VA'!",! K DIR S DIR(0)="E",DIR("A")="Press return to continue" D ^DIR K DIR 118 134 . . Q … … 120 136 S PSOTPWR1=$P($G(^PS(55,+$P($G(^PS(52.41,PSOTPWRN,0)),"^",2),"PS")),"^") 121 137 S PSOTPWR2=$P($G(^PS(53,+PSOTPWR1,0)),"^") S PSOTPWR3=$$UP^XLFSTR(PSOTPWR2) 122 I PSOTPWR3="NON-VA" D138 I PSOTPWR3="NON-VA",DUZ("AG")="V" D ; Skip for VOE sites 123 139 .W !!,"This order has an Rx Patient Status of 'NON-VA'!",! K DIR S DIR(0)="E",DIR("A")="Press return to continue" D ^DIR K DIR 124 140 Q -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOUTLA1.m
r628 r636 1 PSOUTLA1 ;BHAM ISC/RTR-Pharmacy utility program cont. ; 5/22/07 10:01am2 ;;7.0;OUTPATIENT PHARMACY;**35,186,218,259 ,206**;DEC 1997;Build 391 PSOUTLA1 ;BHAM ISC/RTR-Pharmacy utility program cont. ;10/20/06 3:44pm 2 ;;7.0;OUTPATIENT PHARMACY;**35,186,218,259**;DEC 1997;Build 5 3 3 ;External reference to File ^PS(55 supported by DBIA 2228 4 4 ;External reference to File ^PSDRUG supported by DBIA 221 … … 109 109 ; 110 110 ;no refills if PSDEA = 'A' & not 'B' or 'F', 111 I (PSDEA["A")&(PSDEA'["B")!(PSDEA["F") !(PSDEA[1)!(PSDEA[2)D Q 1111 I (PSDEA["A")&(PSDEA'["B")!(PSDEA["F") D Q 1 112 112 . S PSMAXRF=$$NUMFILLS(PSIRXN) 113 113 ; -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOVER1.m
r628 r636 1 1 PSOVER1 ;BHAM ISC/SAB - verify one rx ;3/9/05 12:53pm 2 ;;7.0;OUTPATIENT PHARMACY;**32,46,90,131,202,207,148,243,268 ,281**;DEC 1997;Build 412 ;;7.0;OUTPATIENT PHARMACY;**32,46,90,131,202,207,148,243,268**;DEC 1997;Build 9 3 3 ;External reference ^PSDRUG( supported by DBIA 221 4 4 ;External reference to PSOUL^PSSLOCK supported by DBIA 2789 … … 78 78 . S ACTION="" D ECMESND^PSOBPSU1(PSONV,,,$S($O(^PSRX(PSONV,1,0)):"RF",1:"OF")) 79 79 . I $$FIND^PSOREJUT(PSONV) D 80 . . S ACTION=$$HDLG^PSOREJU1(PSONV,0,"79,88","OF","IOQ"," Q")80 . . S ACTION=$$HDLG^PSOREJU1(PSONV,0,"79,88","OF","IOQ","I") 81 81 ; 82 82 KILL S DA=PSONV,DIK="^PS(52.4," D ^DIK K DA,DIK D DCORD^PSONEW2 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA.m
r628 r636 1 PSOXZA ; DRIVER FOR COMPILED XREFS FOR FILE #52 ; 0 5/26/081 PSOXZA ; DRIVER FOR COMPILED XREFS FOR FILE #52 ; 01/17/08 2 2 ; 3 3 N DH,DU,DIKILL,DISET,DIKJ,DIKZ,DIKYR,DIKZA,DIK0Z,DIKZK,DIKDP,DIKM1,DIKUP,DIKUM,DV,DIIX,DIKF,DIAU,DIKNM,DIKDA,DIKLK,DIKLM,DIKY,DIXR,DIKCOND,DIKSVDA,DIKPUSH,X1,X2 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA1.m
r628 r636 1 PSOXZA1 ; COMPILED XREF FOR FILE #52 ; 0 5/26/081 PSOXZA1 ; COMPILED XREF FOR FILE #52 ; 01/17/08 2 2 ; 3 3 S DIKZK=2 … … 75 75 . S:$D(DIKIL) (X2,X2(1))="" 76 76 . K ^PSRX("APKI",$E(X,1,30),DA) 77 CR3 S DIXR=4 6177 CR3 S DIXR=476 78 78 K X 79 79 S DIKZ(0)=$G(^PSRX(DA,0)) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA10.m
r628 r636 1 PSOXZA10 ; COMPILED XREF FOR FILE #52.052311 ; 0 5/26/081 PSOXZA10 ; COMPILED XREF FOR FILE #52.052311 ; 01/17/08 2 2 ; 3 3 S DA=0 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA11.m
r628 r636 1 PSOXZA11 ; COMPILED XREF FOR FILE #52.1 ; 0 5/26/081 PSOXZA11 ; COMPILED XREF FOR FILE #52.1 ; 01/17/08 2 2 ; 3 3 S DA=0 … … 30 30 S X=$P(DIKZ(0),U,18) 31 31 I X'="" I +$G(^PSRX(DA(1),"IB")) K:$P($G(^PSRX(DA(1),1,DA,0)),"^")&($P($G(^(0)),"^",18)) ^PSRX("ACP",$P(^PSRX(DA(1),0),"^",2),$P(^PSRX(DA(1),1,DA,0),"^"),DA,DA(1)) 32 CR1 S DIXR=4 6232 CR1 S DIXR=477 33 33 K X 34 34 S X(1)=$P(DIKZ(0),U,10) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA12.m
r628 r636 1 PSOXZA12 ; COMPILED XREF FOR FILE #52.2 ; 0 5/26/081 PSOXZA12 ; COMPILED XREF FOR FILE #52.2 ; 01/17/08 2 2 ; 3 3 S DA=0 … … 16 16 S X=$P(DIKZ(0),U,19) 17 17 I X'="" S ^PSRX("AM",$E(X,1,30),DA(1),DA)="" 18 CR1 S DIXR=4 6318 CR1 S DIXR=478 19 19 K X 20 20 S X(1)=$P(DIKZ(0),U,10) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA13.m
r628 r636 1 PSOXZA13 ; COMPILED XREF FOR FILE #52.25 ; 0 5/26/081 PSOXZA13 ; COMPILED XREF FOR FILE #52.25 ; 01/17/08 2 2 ; 3 3 S DA=0 … … 10 10 S X=$P(DIKZ(0),U,1) 11 11 I X'="" S ^PSRX(DA(1),"REJ","B",$E(X,1,30),DA)="" 12 CR1 S DIXR= 65212 CR1 S DIXR=224 13 13 K X 14 14 S X(1)=$P(DIKZ(0),U,2) … … 17 17 . K X1,X2 M X1=X,X2=X 18 18 . S ^PSRX("REJDAT",X,DA(1),DA)="" 19 CR2 S DIXR= 65319 CR2 S DIXR=225 20 20 K X 21 21 S DIKZ(0)=$G(^PSRX(DA(1),"REJ",DA,0)) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA14.m
r628 r636 1 PSOXZA14 ; COMPILED XREF FOR FILE #52.2551 ; 0 5/26/081 PSOXZA14 ; COMPILED XREF FOR FILE #52.2551 ; 01/17/08 2 2 ; 3 3 S DA(2)=DA(1) S DA(1)=0 S DA=0 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA2.m
r628 r636 1 PSOXZA2 ; COMPILED XREF FOR FILE #52.01 ; 0 5/26/081 PSOXZA2 ; COMPILED XREF FOR FILE #52.01 ; 01/17/08 2 2 ; 3 3 S DA(1)=DA S DA=0 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA3.m
r628 r636 1 PSOXZA3 ; COMPILED XREF FOR FILE #52.052311 ; 0 5/26/081 PSOXZA3 ; COMPILED XREF FOR FILE #52.052311 ; 01/17/08 2 2 ; 3 3 S DA=0 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA4.m
r628 r636 1 PSOXZA4 ; COMPILED XREF FOR FILE #52.1 ; 0 5/26/081 PSOXZA4 ; COMPILED XREF FOR FILE #52.1 ; 01/17/08 2 2 ; 3 3 S DA=0 … … 30 30 S X=$P(DIKZ(0),U,1) 31 31 I X'="" I +$G(^PSRX(DA(1),"IB")) K:$P($G(^PSRX(DA(1),0)),"^",2)&($P($G(^PSRX(DA(1),1,DA,0)),"^",2)="W")&('$P($G(^(0)),"^",16))&('$P($G(^(0)),"^",18))&('$G(^("IB"))) ^PSRX("ACP",$P(^PSRX(DA(1),0),"^",2),X,DA,DA(1)) 32 CR1 S DIXR=4 6232 CR1 S DIXR=477 33 33 K X 34 34 S DIKZ(0)=$G(^PSRX(DA(1),1,DA,0)) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA5.m
r628 r636 1 PSOXZA5 ; COMPILED XREF FOR FILE #52.2 ; 0 5/26/081 PSOXZA5 ; COMPILED XREF FOR FILE #52.2 ; 01/17/08 2 2 ; 3 3 S DA=0 … … 18 18 S X=$P(DIKZ(0),U,1) 19 19 I X'="" D:'$G(PSOSUSPA) PARKILL^PSOUTLA 20 CR1 S DIXR=4 6320 CR1 S DIXR=478 21 21 K X 22 22 S X(1)=$P(DIKZ(0),U,10) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA6.m
r628 r636 1 PSOXZA6 ; COMPILED XREF FOR FILE #52.25 ; 0 5/26/081 PSOXZA6 ; COMPILED XREF FOR FILE #52.25 ; 01/17/08 2 2 ; 3 3 S DA=0 … … 10 10 S X=$P(DIKZ(0),U,1) 11 11 I X'="" K ^PSRX(DA(1),"REJ","B",$E(X,1,30),DA) 12 CR1 S DIXR= 65212 CR1 S DIXR=224 13 13 K X 14 14 S X(1)=$P(DIKZ(0),U,2) … … 18 18 . S:$D(DIKIL) (X2,X2(1))="" 19 19 . K ^PSRX("REJDAT",X,DA(1),DA) 20 CR2 S DIXR= 65320 CR2 S DIXR=225 21 21 K X 22 22 S DIKZ(0)=$G(^PSRX(DA(1),"REJ",DA,0)) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA7.m
r628 r636 1 PSOXZA7 ; COMPILED XREF FOR FILE #52.2551 ; 0 5/26/081 PSOXZA7 ; COMPILED XREF FOR FILE #52.2551 ; 01/17/08 2 2 ; 3 3 S DA(2)=DA(1) S DA(1)=0 S DA=0 -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA8.m
r628 r636 1 PSOXZA8 ; COMPILED XREF FOR FILE #52 ; 0 5/26/081 PSOXZA8 ; COMPILED XREF FOR FILE #52 ; 01/17/08 2 2 ; 3 3 S DIKZK=1 … … 77 77 . K X1,X2 M X1=X,X2=X 78 78 . I +$P($G(^PSRX(DA,"PKI")),"^")=1 S ^PSRX("APKI",$E(X,1,30),DA)="" 79 CR3 S DIXR=4 6179 CR3 S DIXR=476 80 80 K X 81 81 S DIKZ(0)=$G(^PSRX(DA,0)) -
FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA9.m
r628 r636 1 PSOXZA9 ; COMPILED XREF FOR FILE #52.01 ; 0 5/26/081 PSOXZA9 ; COMPILED XREF FOR FILE #52.01 ; 01/17/08 2 2 ; 3 3 S DA(1)=DA S DA=0
Note:
See TracChangeset
for help on using the changeset viewer.