Ignore:
Timestamp:
Dec 4, 2009, 8:26:01 PM (15 years ago)
Author:
George Lilly
Message:

WorldVistAEHR overlayed on FOIAVistA

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:45pm
    2  ;;7.0;OUTPATIENT PHARMACY;**12,28,56,125,152,232,268,275**;DEC 1997;Build 8
     1PSOBINGO ;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
    33 ;External Ref. to ^PS(55 is supp. by DBIA# 2228
    44 ;External Ref. to ^PSDRUG(, is supp. by DBIA# 221
    55 ;
    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
    87 ;
    98 S (FLAG,FLAG1)=0,(TRIPS,JOES,ADV,DGP)="" G:'$G(PSOAP) END D:'$D(PSOPAR) ^PSOLSET G:'$D(PSOPAR) END
     
    8584FIRST ;Set 1st dup
    8685 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
     86BROW 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
    9387 Q
    9488SETNEW 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  
    11PSOBPSU1 ;BIRM/MFR - BPS (ECME) Utilities 1 ;10/15/04
    2  ;;7.0;OUTPATIENT PHARMACY;**148,260,281**;DEC 1997;Build 41
     2 ;;7.0;OUTPATIENT PHARMACY;**148,260**;DEC 1997;Build 84
    33 ;Reference to $$EN^BPSNCPDP supported by IA 4415
    44 ;References to $$NDCFMT^PSSNDCUT,$$GETNDC^PSSNDCUT supported by IA 4707
     
    4545 I $$NDCFMT^PSSNDCUT($G(NDC))="" D
    4646 . 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))
    4848 ;
    4949 ; - Creating ECME Activity Log on the PRESCRIPTION file
     
    6363 I $G(RVTX)="",FROM="ED" S RVTX="RX EDITED"
    6464 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)
    6665 ;
    6766 ; - Reseting the Re-transmission flag
     
    7069 ; - Logging ECME Activity Log to the PRESCRIPTION file
    7170 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)_")"
    7674 . 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)_")"
    7876 . S:FROM="PE"!(FROM="PP") X="PULLED FROM SUSPENSE(NDC:"_$$GETNDC^PSONDCUT(RX,RFL)_")"
    7977 . S:FROM="PC" X="CMOP TRANSMISSION(NDC:"_$$GETNDC^PSONDCUT(RX,RFL)_")"
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOBPSUT.m

    r628 r636  
    11PSOBPSUT ;BIRM/MFR - BPS (ECME) Utilities ; 07 Jun 2005  8:39 PM
    2  ;;7.0;OUTPATIENT PHARMACY;**148,247,260,281**;DEC 1997;Build 41
     2 ;;7.0;OUTPATIENT PHARMACY;**148,247,260**;DEC 1997;Build 84
    33 ;Reference to $$ECMEON^BPSUTIL supported by IA 4410
    44 ;Reference to IBSEND^BPSECMP2 supported by IA 4411
     
    2626 ;
    2727 ; - Get the REFILL # (multiple IEN)
    28  N STATUS
    2928 I '$D(RFL) S RFL=$$LSTRFL^PSOBPSU1(RX)
    3029 ; - Not the latest fill for the prescription
    3130 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
    3533 ; Will suspend for CMOP
    3634 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:20am
    2  ;;7.0;OUTPATIENT PHARMACY;**23,82,119,132,235,206**;DEC 1997;Build 39
     1PSOBUILD ;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
    33 ;External reference ^PS(50.606 supported by DBIA 2174
    44 ;External reference ^PS(50.7 supported by DBIA 2223
     
    4545 S PSODRG=+$P(PSORX0,"^",6) G:'$D(^PSDRUG(PSODRG,0)) GETX S PSODRUG0=^PSDRUG(PSODRG,0),PSOVACL=$P(PSODRUG0,"^",2),PSODYS=$P(PSORX0,"^",8)
    4646 ;
    47  I PSOST0<12!(PSOST0=16),PSOEXPDT<DT D:$P(PSORX0,"^",15)'=11
     47 I PSOST0<12,PSOEXPDT<DT D:$P(PSORX0,"^",15)'=11
    4848 .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
    4949 .D ECAN^PSOUTL(DA) K DA
     
    6161 I $P($G(^PSDRUG(PSODRG,2)),"^",3)'["O" S PSOSTN=PSOSTN_"M"
    6262 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"
    6565 I $D(^PS(53,+$P(PSORX0,"^",3),0)),'$P(^(0),"^",5) S PSOSTN=PSOSTN_"D"
    6666 I PSOST0=1 S PSOSTN=PSOSTN_"E"
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCAN2.m

    r628 r636  
    11PSOCAN2 ;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 41
     2 ;;7.0;OUTPATIENT PHARMACY;**8,18,62,46,88,164,235,148,259**;DEC 1997;Build 5
    33 ;External reference to ^PSDRUG supported by dbia 221
    44REINS N DODR
     
    3030 . N ACTION
    3131 . 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")
    3333 ;
    3434 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
     1PSOCAN4 ;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
    319 ;External reference to File #200 supported by DBIA 224
    420 ;External reference NA^ORX1 supported by DBIA 2186
     
    5268OK S ORD=SAVORD,ORN=SAVORN Q
    5369NOOR ;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
    6281NOORXP I $G(PSOCANRA),'$G(PSOCANRZ) D REQ
    6382NOORX 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:35am
    2  ;;7.0;OUTPATIENT PHARMACY;**2,16,21,27,43,61,126,148,274**;DEC 1997;Build 8
     1PSOCMOP ;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
    33 ;External reference to ^PS(55 supported by DBIA 2228
    44 ;External reference to ^PSDRUG supported by DBIA 221
     
    7979 D REVERSE^PSOBPSU1(RXN,,"DC",3)
    8080 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+1
     81ACT 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
    8282 S IR=0 F FDA=0:0 S FDA=$O(^PSRX(DA,"A",FDA)) Q:'FDA  S IR=FDA
    8383 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:21am
    2  ;;7.0;OUTPATIENT PHARMACY;**10,9,71,85,114,157,143,239,201,275**;DEC 1997;Build 8
     1PSOCPC ;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
    33 ;
    44 ;REF/IA
     
    7979 . D ASKEXEM
    8080 I $D(PSOCHG) D
    81  . ;PSO*7*275 IBQ node should not be present in some cases.
    82  . K ^PSRX(PSODA,"IBQ")
    8381 . S:PSOSCP<50&($TR(PSOIBQ,"^")'="")&($P($G(^PS(53,+$G(PSOPATST),0)),"^",7)'=1) ^PSRX(PSODA,"IBQ")=PSOIBQ
    8482 . 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:36pm
    2  ;;7.0;OUTPATIENT PHARMACY;**4,17,19,28,89,212,246**;DEC 1997;Build 12
     1PSOCSTM ;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
    33 ;External Ref. to ^PS(55 DBIA# 2228
    44 ;External Ref. to ^DPT DBIA# 10035
    55 ;External Ref. to ^PSDRUG DBIA# 221
    66 ;
    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
    98 ;
    109 Q:$$MTHLCK(1)            ;get lock, quit if already locked    PSO*212
     
    3332 Q
    3433 ;
    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
     34SRCH1 D INI F PSDT1=PSDT:0:PSDTX S PSDT1=$O(^PSRX("AL",PSDT1)) Q:'PSDT1!($E(PSDT1,1,7)>PSDTX)  D
    3935 .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
    4036 .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
    4438 .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
    4539 .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:41am
    2  ;;7.0;OUTPATIENT PHARMACY;**206**;DEC 1997;Build 39
     1PSODEA ;BHAM ISC/  - HELP TEXT FOR DEA FIELD IN DRUG FILE ; 06/03/92 17:28
     2 ;;7.0;OUTPATIENT PHARMACY;;DEC 1997
    33 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,"
    44 W !,"A SCHEDULE 3 NARCOTIC WILL BE CODED '3A' AND A SCHEDULE 2 DEPRESSANT",!,"WILL BE CODED '2L'.  THE CODES ARE:",!
     
    2121 ;;R          RESTRICTED ITEMS
    2222 ;;S          SUPPLY ITEMS
    23  ;;B          ALLOW REFILL (SCH. 3, 4, 5 ONLY)
     23 ;;B          ALLOW REFILL (SCH. 3, 4, 5 NARCOTICS ONLY)
    2424 ;;W          NOT RENEWABLE
    2525 ;;
    2626EDIT ;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 Q
     27 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
    2828 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:36am
    2  ;;7.0;OUTPATIENT PHARMACY;**10,27,48,130,144,132,188,207,243,274**;DEC 1997;Build 8
     1PSODGDGI ;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
    33 ;External reference to ^PS(56 supported by DBIA 2229
    44 ;External reference to ^PSDRUG supported by DBIA 221
     
    4141 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
    4242 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 Q
     43BLD I $D(^XUSEC("PSORPH",DUZ)) S PSORX("PHARM")=DUZ D PHARM Q
    4444 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
    4545 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:03pm
    2  ;;7.0;OUTPATIENT PHARMACY;**37,46,111,117,146,164,211,264,275**;DEC 1997;Build 8
     1PSODIR ;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
    33 ;External reference PSDRUG( supported by DBIA 221
    44 ;External reference PS(50.7 supported by DBIA 2223
     
    6666 N DA K INS1,DD,DIR,DIRUT S D=0 F  S D=$O(PSODIR("SIG",D)) Q:'D  S DD=$G(DD)+1
    6767 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
    7069 .K ^TMP($J) S D=0 F  S D=$O(PSODIR("SIG",D)) Q:'D  S ^TMP($J,"SIG",D,0)=PSODIR("SIG",D)
    7170 .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:22am
    2  ;;7.0;OUTPATIENT PHARMACY;**23,46,78,102,121,131,146,166,184,222,268,206**;DEC 1997;Build 39
     1PSODIR1 ;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
    33 ;Ext ref ^PS(55-DBIA 2228, ^PSDRUG(-DBIA 221
    44PTSTAT(PSODIR) ;
     
    109109 .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)
    110110 .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 REFILLX
    112  .I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")[1)!(PSODRUG("DEA")[2)!'$O(^PSRX(+$G(PSODIR("IRXN")),1,0))!('$G(PSOLOKED)) D  Q
     111 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
    113113 ..S VALMSG="No refills allowed on "_$S(PSODRUG("DEA")["F":"this drug.",1:"Narcotics.") W !,VALMSG,!
    114114 ..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:28am
    2  ;;7.0;OUTPATIENT PHARMACY;**3,46,184,222,206**;DEC 1997;Build 39
     1PSODIR3 ;ISC-BIRM/SAB - rx order entry contd ;09/27/96
     2 ;;7.0;OUTPATIENT PHARMACY;**3,46,184,222**;DEC 1997;Build 12
    33 ;
    44EXP(PSODIR) ;
     
    7777 .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)
    7878 .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  Q
    80  .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 ..")
    8181 .W !,VALMSG,!
    8282 .S:$D(PSODIR("FIELD")) PSODIR("FIELD")=0 S PSODIR("# OF REFILLS")=0
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODISP.m

    r628 r636  
    11PSODISP ;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
    319 ;Reference to $$SERV^IBARX1 supported by DBIA 2245
    420 ;Reference to ^PSD(58.8 supported by DBIA 1036
     
    1430 S Y=$G(^PS(59,PSOSITE,"IB")),PSOIBSS=$$SERV^IBARX1(+Y) I 'PSOIBSS D IBSSR^PSOUTL I 'PSOIBFL D   G EXIT
    1531 .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
     32AC1 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
    1836 ;check for Drug Acct background job K8 & K7.1
    1937 S X="PSA IV ALL LOCATIONS",DIC(0)="MZ",DIC=19.2 D ^DIC I Y=-1 K DIC,X,Y G BC
     
    2543 K PSA,DIC,DA,X,Y,DIQ
    2644BC ;
     45 I $G(PSOAFYN)="Y",$G(PSZAR)="1" Q  ;vfah - VOE
    2746 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
    2949 I $D(DIRUT)!($D(DTOUT))!($D(DUOUT)) K DIRUT,DTOUT,DUOUT G AC1
    3050 I X'["-" D BCI W:'$G(RXP) !,"INVALID PRESCRIPTION NUMBER" G:'$G(RXP) BC S MAN=1 G BC1
     
    6282 .I $$MANREL^PSOBPSUT(RXP,0,$G(PSOPID))="^" K LBLP Q
    6383 .;
    64  .S:$D(^PSDRUG(QDRUG,660.1)) ^PSDRUG(QDRUG,660.1)=^PSDRUG(QDRUG,660.1)-QTY
     84 .S:$D(^PSDRUG(QDRUG,660.1))&($G(PSOAFYN)'="Y") ^PSDRUG(QDRUG,660.1)=^PSDRUG(QDRUG,660.1)-QTY ;vfah - VOE
    6585 .D NOW^%DTC S DIE="^PSRX(",DA=RXP,DR="31///"_%_";23////"_PSRH_";32.1///@;32.2///@",PSODT=% D ^DIE K DIE,DR,DA,LBL
    6686 .;
     
    7898 N BFILL S BFILL=0
    7999 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
    81101 ;initialize bingo board variables
    82102 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  
    11PSODISPS ;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
    319 ;External reference ^PS(59.7 supported by DBIA 694
    420 ;External reference to ^PSDRUG("AQ" supported by DBIA 3165
     
    3955 .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)
    4056 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
    4258XMIT I $G(PSODISP)=2.4 D  ;build an send HL7 v2.4 messages to dispense system
    4359 . 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  
    11PSODRDUP ;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
    319 ;
    420 ;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
    522 S $P(PSONULN,"-",79)="-",(STA,DNM)="" K CLS
    623 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  
    11PSODRG ;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
    319 ;Reference ^PSDRUG supported by DBIA 221
    420 ;Reference ^PS(50.7 supported by DBIA 2223
     
    87103 K NFI Q
    88104POST ;order checks
     105 I $G(PSOAFYN)="Y" G POSTX ;vfam - VOE
    89106 K PSORX("INTERVENE") N STAT,SIG,PTR,NDF,VAP S PSORX("DFLG")=0
    90107 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:41am
    2  ;;7.0;OUTPATIENT PHARMACY;**3,23,29,48,46,117,131,222,268,206**;DEC 1997;Build 39
     1PSOHELP ;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
    33 ;External reference ^PS(51 supported by DBIA 2224
    44 ;External reference ^PSDRUG( supported by DBIA 221
     
    6363 S PSODEA=$P(^PSDRUG(P(5),0),"^",3),CS=0
    6464 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 Q
     65 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
    6666 F DEA=1:1 Q:$E(PSODEA,DEA)=""  I $E(+PSODEA,DEA)>1,$E(+PSODEA,DEA)<6 S CS=1
    6767 S PSOELSE=CS I PSOELSE D
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOHELP3.m

    r628 r636  
    11PSOHELP3 ;BHAM ISC/SAB - outpatient utility routine #4 ;2/17/93 18:00:36
    2  ;;7.0;OUTPATIENT PHARMACY;**20,291**;DEC 1997;Build 2
     2 ;;7.0;OUTPATIENT PHARMACY;**20**;DEC 1997
    33XREF ;code to create 'APD' xref on Drug Interaction file (#56)
    44 ;I '$D(ZTSK),'$D(PSMSG) D WAIT^DICD W "Building 'APD' X-Ref."
     
    1616 Q
    1717DRUG ;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).",!
    2118 K X,Y,DA,DIC S DIC(0)="AQEM",DIC=50 D ^DIC I $G(DUOUT) K DIC,Y,X,DA Q
    2219 I Y<0 G OUT
    2320 S (DRG,DA)=+Y K DIC,DR,DIQ S DIC=50,DR=16,DIQ="PSODRG",DIQ(0)="I"
    2421 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")
    2824 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 Q
    30  S (FBCK,%DT(0))=Y,%DT("A")="Enter ending fill date: " D ^%DT
     25 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
    3127 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
    3829 I Y S PSOQ=1 K ZTDTH D  G OUT
    3930 .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
     33EN 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
     38OUT K G,COST,I,X,Y,REF,RXN,FDT,FAHD,FBCK,DRG,PSOQ,DIRUT I $D(ZTQUEUED) S ZTREQ="@"
    5039 Q
    5140POST ;post install entry point.  builds new "ADL" xref for file 52 pso*7*20
     
    5847 K X,Y,DEF,FTY,IFN S ZTREQ="@"
    5948 Q
    60 REFILL ;
    61  N FILL,FDT,RXN
    62  S FDT=FBCK-1 F  S FDT=$O(^PSRX("AD",FDT)) Q:'FDT  D  Q:FDT>FAHD
    63  .I '$G(PSOFUTR),FDT>FAHD Q
    64  .S RXN="" F  S RXN=$O(^PSRX("AD",FDT,RXN)) Q:'RXN  D
    65  ..I $P($G(^PSRX(RXN,0)),"^",6)'=DRG Q
    66  ..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)=COST
    67  Q
    68 PARTIAL ;
    69   N FILL,FDT,RXN
    70   S FDT=FBCK-1 F  S FDT=$O(^PSRX("ADP",FDT)) Q:'FDT  D  Q:FDT>FAHD
    71  .I '$G(PSOFUTR),FDT>FAHD Q
    72  .S RXN="" F  S RXN=$O(^PSRX("ADP",FDT,RXN)) Q:'RXN  D
    73  ..I $P($G(^PSRX(RXN,0)),"^",6)'=DRG Q
    74  ..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)=COST
    75  Q
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOHLD.m

    r628 r636  
    11PSOHLD ;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 41
     2 ;;7.0;OUTPATIENT PHARMACY;**1,16,21,24,27,32,55,82,114,130,166,148,268**;DEC 1997;Build 9
    33 ;External reference to ^DD(52-DBIA 999,  VA(200-DBIA 224, NA^ORX1-DBIA 2186,
    44 ; L, UL, PSOL, and PSOUL^PSSLOCK-DBIA 2789, ^%DTC-DBIA 10000, ^DIE-DBIA 10018, ^DIR-DBIA 10026,
     
    5050 . D ECMESND^PSOBPSU1(RX,RFL,,$S(RFL:"RF",1:"OF"))
    5151 . 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")
    5353 ;
    5454 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
     1PSOHLEXP ;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
    34 ;
    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
     5EN N PSOEXRX,PSOEXCOM,PSOEXSTS,SUSD,PSOEXSTA,ZZDT,IFN,NODE,RF,PIFN,PSUSD,PRFDT,PDA,PSDTEST,ORN
    86 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))
    189 .Q:$P($G(^PSRX(PSOEXRX,2)),"^",6)'=ZZDT
    19  .K CMOP S DA=PSOEXRX I DA D ^PSOCMOPA  ;*257 ;SET UP CMOP() ARRAY
    2010 .S DA=$O(^PS(52.5,"B",PSOEXRX,0))
    2111 .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
     
    2313 .I $G(^PSRX(PSOEXRX,"H"))]"" K:$P(^PSRX(PSOEXRX,"H"),"^") ^PSRX("AH",$P(^PSRX(PSOEXRX,"H"),"^"),PSOEXRX) S ^PSRX(PSOEXRX,"H")=""
    2414 .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
    3119 ..S $P(^PSRX(PSOEXRX,0),"^",19)=1
    3220 ..D EN^PSOHLSN1(PSOEXRX,"SC","ZE","Prescription is expired")
    33  .I PSOEXSTA>9&(PSOEXSTA'=16) Q
     21 .Q:PSOEXSTA>9
    3422 .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")
    3624 .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)
    3825 .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
    3926 ..D REVERSE^PSOBPSU1(PSOEXRX,PSUSD,"DE",5,"RX EXPIRED")
    4027 ..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)
    5331 .S $P(^PSRX(PSOEXRX,0),"^",19)=1
    5432 .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,DR
    5633 Q
    5734NSET ;
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOHLSN.m

    r628 r636  
    11PSOHLSN ;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 1
     2 ;;7.0;OUTPATIENT PHARMACY;**1,7,15,24,27,30,55,46,98,88,121**;DEC 1997
    33 ;Externel reference EN^ORERR supported by DBIA 2187
    44 ;
     
    1212 I '$G(PSIEN) Q
    1313 I $G(STAT)="OC"!($G(STAT)="OD")!($G(STAT)="CR")!($G(STAT)="DR") D
    14  .D CHKOLDRX
    1514 .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)
    1615 S PSZERO=$G(^PS(52.41,PSIEN,0)),PSOHSTAT=$G(STAT)
     
    161160 .S PVAR=$S(PVAR="":PVAR1,1:PVAR_PVAR1)
    162161 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 PSOHLSN1
    164  N PSOOLD
    165  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)=1
    167  Q
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOHLSN1.m

    r628 r636  
    11PSOHLSN1 ;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 1
     2 ;;7.0;OUTPATIENT PHARMACY;**1,10,24,27,55,46,71,101,99,121,139,157,181,143,235,239**;DEC 1997
    33 ;Ref #50.606-DBIA 2174
    44 ;#50.607-2221
     
    2121 S COUNT=0,NULLFLDS="F JJ=0:1:LIMIT S FIELD(JJ)="""""
    2222 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) Q
    2423 I STAT'="SN",STAT'="ZC",'$P($G(^PSRX(PSRXIEN,"OR1")),"^",2) Q
    2524 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:57am
    2  ;;7.0;OUTPATIENT PHARMACY;**8,19,30,36,47,71,92,120,157,244,206**;DEC 1997;Build 39
     1PSOLBL ;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
    33 ;DBIAs PSDRUG-221, PS(55-2228, IBARX-125, PSXSRP-2201, %ZIS-3435, DPT-3097
    44 ;
    5  ;*244 rem test for part fill when testing status > 11
     5 ;*244 remove test for partial fill when testing status > 11
    66 ;
    77DQ I $D(PSOIOS),PSOIOS]"" D DEVBAR^PSOBMST
     
    6868 .K PSMP(PSI)
    6969 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=0
     70 I (($G(PS55X)]"")&(PS55>1)&(PS55X<DT)) S PS55=1
    7171 S:MW="M" MW=$S((PS55=1!(PS55=4)):"R",1:MW)
    7272 S MW=$S(MW="M":"REGULAR",MW="R":"CERTIFIED",1:"WINDOW")
     
    7474 ;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")
    7575 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=0
     76 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
    7777 S VRPH=$P(^PSRX(RX,2),"^",10),PSCLN=+$P(RXY,"^",5),PSCLN=$S($D(^SC(PSCLN,0)):$P(^(0),"^",2),1:"UNKNOWN")
    7878 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 ;12/19/06 10:45am
    2  ;;7.0;OUTPATIENT PHARMACY;**26,70,156,244,233,246**;DEC 1997;Build 12
     1PSOLBL4 ;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
    33 ;External reference to ^PSDRUG supported by DBIA 221
    44 ;
    55 ;*244 - ignore RX's with a status > 11
    6  ;*246 - send marked drugs & print label (option 4) now working
    76 ;
    87 N DIC,AP,X,Y,DPRT,QPRT
     
    1312 .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
    1413 .I '$G(QPRT) S $P(PSOPAR,"^",30)=0
    15  Q:'$P($G(PSOPAR),"^",30)                ;HL7 interface turned off
     14 Q:'$P($G(PSOPAR),"^",30)
    1615 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,NOTMD
     16HL 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
    1817 S HLOSITE=$P($G(PSOPAR),"^",30)
    1918 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=1
     19 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
    2322 .Q:'$G(HLRX)
    2423 .Q:'$D(^PSRX(HLRX,0))
     
    2726 .I $P($G(^PSRX(HLRX,"STA")),"^")>11!('$P(^PSRX(HLRX,0),"^",2)) Q
    2827 .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_","
     43SOMDQ 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")
    4547 .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
    4648 .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 ACLOG
    48  .S HLINGF=0 I $P(^UTILITY($J,"PSOHLL",II),"^",5),$O(^PSRX(HLINRX,"DAI",0)) S HLINGF=1 D
    49  ..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+1
    50  .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)=1
    52  .E  S $P(^UTILITY($J,"PSOHLL",II),"^",7)=0
    53  .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"))
    5456 .I $P(^PSRX(HLINRX,"STA"),"^")>0,$P(^("STA"),"^")'=2,'$G(PSODBQ) Q
    55  .S $P(^UTILITY($J,"PSOHLL",II),"^",8)=1
     57 .S $P(^UTILITY($J,"PSOHLL",HLCOT),"^",8)=1
    5658 ;
    5759AAA D STRT^PSOHLSG5
     
    100102 Q
    101103RPT ;
    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)
    104106 Q
    105107SETZ ;
     
    111113 D ^%ZTLOAD
    112114 Q
     115SOMD ;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
     1PSOLBLN ;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
    319 ;External reference to ^PSDRUG supported by DBIA 221
    420 ;External reference to ^VA(200 supported by DBIA 224
     
    1935 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:" ")_")"
    2036 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 ;
    2140L1 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)"
    2241 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
     
    5372L13 I $G(WARN)'="",'$G(PSOBLALL) I '$G(PSDFNFLG),'$G(PSOLAPPL) D WARN^PSOLBL2
    5473 W @IOF
     74 ;
     75PSOAFPL1 I $G(PSOAFYN)="Y" D PSOAFP ;vfah
     76 ;
    5577REP I COPIES>0 S SIDE=1 G ST
    5678 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
     
    6587 .S ^PSRX(RX,"L",IR,0)=NOW_"^"_$S($G(RXP):99-RXPI,1:RXF)_"^"_"ROUTING="_$G(MW)_" (BAD ADDRESS)"_"^"_PDUZ
    6688 S ^PSRX(RX,"TYPE")=0 K RXF,IR,FDA,NOW,I,PCOMH(RX)
     89PSOAFPL2 I $G(PSOAFYN)="Y" G PSOAFPL3 ;vfah
    6790 I $G(WARN)'="" I $G(PSDFNFLG)!($G(PSOLAPPL)) D ALLWARN^PSOLBLN1
    6891 I $G(WARN)="" I $G(PSDFNFLG)!($G(PSOLAPPL)) D ALL^PSOLBLS
    6992 I $G(PSOBLALL) D:$G(WARN)="" ALL^PSOLBLS D:$G(WARN)'="" ALLWARN^PSOLBLN1
    7093 I '$D(PSSPND),$P(PSOPAR,"^",18) I $G(PSDFNFLG)!($G(PSOLAPPL))!($G(PSOBLALL)) D CHCK2^PSOTRLBL
     94PSOAFPL3 ;vfah
    7195 D:$G(PSOBLALL) TRAIL^PSOLBL2
    7296END ;
    7397 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 ;
    74101 D KILL^PSOLBL2 Q
     102 ;
     103 Q  ;vfah
     104 ;
     105PSOAFP ;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 ;
     111AFFAX ;
     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 ;
     128AFPTS 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 ;
     133AFPTL D BEGLP^PSOAFPTL
     134 ;
     135AFKILL 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
     1PSOLBLN2 ;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
    319 Q:'+$G(RXN)!('$G(PSOTRAIL))!('+$G(DFN))
    420 I $G(PSOBLALL),$P(PPL,",",PI+1)'="" Q
     
    4056 .S ^TMP($J,"PSOSUSP",PSSPCNT)="  "_$$ZZ^PSOSUTL(PSSSRX) S PSSPCNT=PSSPCNT+1 K SPNUM,SPDATE,Y
    4157PRINT 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)_" "_EDT
     58 ;W ?54,VADM(1)_" "_$E($P(VADM(2),"^",2),5,12)_" "_EDT ;vfah
    4359 W ! I PRCOPAY,$G(PSOBARS) S X="S",X2=PSOTRDFN,X1=$X W ?54,@PSOBAR1,PSOTRDFN,@PSOBAR0,$C(13) S $X=0
    4460 I PRCOPAY,'$G(PSOBARS) W !!!
    4561 I 'PRCOPAY W !
    4662 I 'PSSUFLG D PRSUS G END
    47  S (PSNONARR,PSNOADDR,PSNOBOTH)=0 F TTT=1:1 Q:$G(PSNOBOTH)  D
    48  .W $G(^TMP($J,"PSOMAIL",TTT)) S:'$O(^(TTT)) PSNOADDR=1
    49  .W ?54,$G(^TMP($J,"PSONARR",TTT)),! S:'$O(^(TTT)) PSNONARR=1
    50  .I PSNOADDR,PSNONARR S PSNOBOTH=1
     63 ;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
    5167END K ^TMP($J,"PSONARR"),^TMP($J,"PSOMAIL"),^TMP($J,"PSOSUSP"),^UTILITY($J,"W")
    5268 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
    5471 Q
    5572PRSUS 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:00am
    2  ;;7.0;OUTPATIENT PHARMACY;**120,157,189,161,244,200,206**;DEC 1997;Build 39
     1PSOLLLI ;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
    33 ;
    44 ;DBIAs PSDRUG-221, PS(55-2228, SC-10040, IBARX-125, PSXSRP-2201, %ZIS-3435, DPT-3097, ^TMP($J,"PSNPPIO"-3794
     
    8787 S MAILCOM=""
    8888 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=0
     89 I PS55X]"",PS55>1,PS55X<DT S PS55=1
    9090 S:MW="M" MW=$S((PS55=1!(PS55=4)):"R",1:MW)
    9191 S MAILCOM=$P($G(^PS(59,PSOSITE,9)),"^")
     
    9494 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
    9595 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=0
     96 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
    9797 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"
    9898 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
     1PSOLMPO ;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
    319EN ; -- 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
    522 Q
    623 ;
  • 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
     1PSOLSET ;BHAM ISC/SAB - site parameter set up ;3/13/07  19:50
     2VERS ;;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
    319 ;Reference to ^PS(59.7 supported by DBIA 694
    420 ;Reference to ^PSX(550 supported by DBIA 2230
     
    3349 .S %ZIS="MNQ",%ZIS("A")="Select PROFILE PRINTER: " S:$G(PSOCLBL)&($D(PSOPROP)) %ZIS("B")=PSOPROP
    3450 .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
     53LBL S %ZIS="MNQ",%ZIS("A")=PSOAFPFX S:$G(PSOCLBL)&($D(PSOLAP))!($G(SUSPT)) %ZIS("B")=$S($G(SUSPT):PSLION,1:PSOLAP) ;vfah
    3654 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))
    3755 N PSOIOS S PSOIOS=IOS D DEVBAR^PSOBMST
    3856 S PSOBARS=PSOBAR1]""&(PSOBAR0]"")&$P(PSOPAR,"^",19),PSOIOS=IOS D ^%ZISC
    3957LASK 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 ;
    4076 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
    4177P2 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:17am
    2  ;;7.0;OUTPATIENT PHARMACY;**40,73,139,148,257**;DEC 1997;Build 19
    3  ;;
     1PSOMAUEX ;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
    44 ;External reference to STATUS^ORQOR2 is supported by DBIA 3458
    5  ;External reference to ^PS(59.7 is supported by DBIA 694
    6  ;External reference to LOCK1^ORX2 and UNLK1^ORX2 are supported by DBIA 867
    75 ;
    86 I '$G(DT) S DT=$$DT^XLFDT
     
    2321 W !,"*******************************************************************************"
    2422 W !!
    25  S ZZDT=$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 'ZZDT D  Q  ; V7.0 inst. dt not found, quit this job
     23 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
    2725 .W !!!,"***** Outpatient installation date was not found, *****"
    2826 .W !,"***** therefore this job cannot be run!!!!!       *****",!!
     
    3028 ; - Ask for START DATE
    3129 K %DT S %DT(0)=-DT,%DT="AEP",%DT("A")="Start Date: "
    32  S %DT("B")=$$FMTE^XLFDT($$FMADD^XLFDT(ZZDT\1,-121))
     30 S %DT("B")=$$FMTE^XLFDT($$FMADD^XLFDT(ZZIDT\1-121))
    3331 W ! D ^%DT I Y<0!($D(DTOUT)) Q
    34  S ZZDT=Y
     32 S ZZIDT=Y
    3533 ;
    3634 K %DT D NOW^%DTC S %DT="RAEX",%DT(0)=%,%DT("A")="Select the Date/Time to queue this job: "
    3735 W ! D ^%DT K %DT I $D(DTOUT)!(Y<0) W !!!?10,"Job not queued!" Q
    38  S ZTDTH=$G(Y),ZTSAVE("ZZDT")="",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 "
    3937 D ^%ZTLOAD
    4038 W:$D(ZTSK) !!,"Task Queued !",!
    4139 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="@"
     40EN 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="@"
    5044 Q
    5145EN1 ;
     
    5549 Q
    5650EN2 ;
    57   N CPRSDC,CPRSSTA
    58  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 ^PSOCMOPA
    6251 S DA=$O(^PS(52.5,"B",PSOEXRX,0))
    6352 I DA,$P($G(^PS(52.5,DA,0)),"^",2),$P($G(^(0)),"^",3) S DIK="^PS(52.5," D ^DIK K DIK
     
    6554 I $G(^PSRX(PSOEXRX,"H"))]"" K:$P(^PSRX(PSOEXRX,"H"),"^") ^PSRX("AH",$P(^PSRX(PSOEXRX,"H"),"^"),PSOEXRX) S ^PSRX(PSOEXRX,"H")=""
    6655 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
    6762 ;
    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
    7865 .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")
    7968 .S (PIFN,PSUSD,PRFDT)=0
    8069 .F  S PIFN=$O(^PSRX(PSOEXRX,1,PIFN)) Q:'PIFN  S PSUSD=PIFN,PRFDT=+$P($G(^PSRX(PSOEXRX,1,PIFN,0)),"^")
    8170 .D REVERSE^PSOBPSU1(PSOEXRX,+PSUSD,"DE",5,"RX EXPIRED")
    8271 .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) Q
    84  .;If CPRS side already DC'd or expired, just send the expiration to the HDR
    85  .I CPRSDC[(","_CPRSSTA_",") D EN^PSOHDR("PRES",PSOEXRX) Q
    86  .S $P(^PSRX(PSOEXRX,0),"^",19)=1
    87  .D EN^PSOHLSN1(PSOEXRX,"SC","ZE","Prescription past expiration date")
    8872 Q
    8973EN3 ;
    9074 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
    9175 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
    10078ENX I 'PSDTEST K ^PSRX(PSOEXRX,1,PSUSD),^PSRX("AD",PRFDT,PSOEXRX,PSUSD),^PSRX(PSOEXRX,1,"B",PRFDT,PSUSD) D NSET
    10179 Q
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSON52.m

    r628 r636  
    11PSON52 ;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
    319 ;External reference ^PS(55 supported by DBIA 2228
    420 ;External reference to PSOUL^PSSLOCK supported by DBIA 2789
    521 ;External reference to ^XUSEC supported by DBIA 10076
    622 ;External reference SWSTAT^IBBAPI supported by DBIA 4663
    7  ;External reference SAVNDC^PSSNDCUT supported by DBIA 4707
    823EN(PSOX) ;Entry Point
    924START ;
     
    6681 ;Next line, set SC question based on Copay status?
    6782IBQ ;I $G(PSOBILL)=2 S ^PSRX(PSOX("IRXN"),"IBQ")=$S($G(PSOX("NEWCOPAY")):0,1:1)
     83 I $G(PSOAFYN)="Y" S PSOSCP="" ;vfah
    6884 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"))
    6985 I PSOSCP<50&($TR(PSOSCFLD,"^")'="")&($P($G(^PS(53,+$G(PSONEW("PATIENT STATUS")),0)),"^",7)'=1) D
     
    103119 ;
    104120 ; - 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")
    113126 ;
    114127FINISHP ;
  • 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
     1PSONEW ;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
    319 ;External references L and UL^PSSLOCK supported by DBIA 2789
    420 ;External reference to ^VA(200 supported by DBIA 224
     
    6581COUN ;patient counseling
    6682 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
    6885 I $D(DIRUT)!('PSOCOU) S PSOCOUU=0 D:'$G(SPEED) PRONTE Q
    6986 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)
    7087PRONTE K PSONOTE,DIR,DIRUT,DUOUT
    7188 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
    7391 .S PSONOTE=+Y Q  ;I 'Y!($D(DIRUT)) Q
    7492NOORX K X,Y,DIR,DUOUT,DTOUT,DIRUT
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSONEWF.m

    r628 r636  
    11PSONEWF ;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
    319 ;External reference VADPT supported by DBIA 10061
    420START ;
     21 I $G(PSOAFYN)="Y" Q  ; vfam
    522 N PSOPENIB,PSOSCOTH,PSOSCOTX,PSOMESFI
    623 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  
    11PSOORAL ;BHAM-ISC/SAB - activity log list ; 28-APR-1995
    2  ;;7.0;OUTPATIENT PHARMACY;**148,281**;DEC 1997;Build 41
     2 ;;7.0;OUTPATIENT PHARMACY;**148**;DEC 1997
    33EN ; -- main entry point for PSO LM ACTIVITY LOGS
    44 D EN^VALM("PSO LM ACTIVITY LOGS")
     
    1010 ;
    1111INIT ; -- init variables and list array
    12  I $G(PS)="VIEW"!($G(PS)="DELETE")!($G(PS)="REJECT")!($G(PS)="REJECTMP") D
     12 I $G(PS)="VIEW"!($G(PS)="DELETE")!($G(PS)="REJECT") D
    1313 .I ST<12,$P(RX2,"^",6)<DT S ST=11
    1414 .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:25pm
    2  ;;7.0;OUTPATIENT PHARMACY;**71,156,148,247,240**;DEC 1997;Build 5
     1PSOORAL1 ;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
    33 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))
    44 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"
     
    3434 .I $P(P1,"^",5)]"" N PSOACBRK,PSOACBRV D
    3535 ..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
    3839 .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)
    3940 .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
    4041 ..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,DIWR
     42 K MIG,SG,I
    4243 Q
    4344LBL ;label log
     
    8485 .I $P(P1,"^",5)]"" D
    8586 ..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
    8890 .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
    8991 ..F SG=1:1:$L(MIG) D
     
    9193 ...S:$P(MIG," ",SG)'="" ^TMP("PSOAL",$J,IEN,0)=$G(^TMP("PSOAL",$J,IEN,0))_" "_$P(MIG," ",SG)
    9294 D DISPREJ
    93  K ^UTILITY($J,"W"),DIWR,DIWF,DIWL
    9495 Q
    9596 ;
  • 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:25am
    2  ;;7.0;OUTPATIENT PHARMACY;**5,23,46,78,114,117,131,146,223,148,244,249,268,206**;DEC 1997;Build 39
     1PSOORED1 ;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
    33 ;External reference ^PS(55 supported by DBIA 2228
    44 ;External reference ^PS(50.7 supported by DBIA 2223
     
    131131 .S PSOX1=PTRF,PSOX=$S(PSOX1=11:11,1:PSOX1),PSOX=$S('PSOX:0,PSDAYS=90:3,1:PSOX)
    132132 .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")=0
     133 I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F") S PSORENW("# OF REFILLS")=0
    134134 K PSDY,PSDY1,PTRF,PSOX,PSOX1,PSDAYS,CS
    135135 Q
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORED2.m

    r628 r636  
    11PSOORED2 ;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 41
     2 ;;7.0;OUTPATIENT PHARMACY;**2,51,46,78,102,114,117,133,159,148,247,260**;DEC 1997;Build 84
    33 ;Reference to $$DIVNCPDP^BPSBUTL supported by IA 4719
    44 ;Reference to $$ECMEON^BPSUTIL supported by IA 4410
     
    5252 D GETS^DIQ(52.1,DA_","_DA(1)_",",".01;1;1.1;8;11;81","I","FLDS")
    5353 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 RXs
    5554 D ^DIE S QUIT=$D(Y) K FEV,RFN,RFM,X,Y,DR
    5655 I '$G(DA) D REVERSE^PSOBPSU1(PSORXED("IRXN"),RFL,"DE",5) K CMRL,RFED D:$D(PSORX("PSOL"))&($G(DI)=.01) RFD Q
    5756 I 'CMRL,'QUIT S DR="1;1.2:5;8" D ^DIE S QUIT=$D(Y)
    58 RFE I '$D(^PSRX(PSORXED("IRXN"),1,RFL)) Q
     57 I '$D(^PSRX(PSORXED("IRXN"),1,RFL)) Q
    5958 I 'QUIT,$$STATUS^PSOBPSUT(PSORXED("IRXN"),RFL)'="" D
    6059 . S NDC=$$GETNDC^PSONDCUT(PSORXED("IRXN"),RFL)
     
    7473 . . D ECMESND^PSOBPSU1(RX,RFL,,"ED",$$GETNDC^PSONDCUT(RX,RFL),,$S($P(CHANGED,"^",2):"REFILL DIVISION CHANGED",1:"REFILL EDITED"),,+$G(CHGNDC))
    7574 . . ;- 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")
    7776 K DIE,CMRL,DA,DR
    7877 Q
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORED6.m

    r628 r636  
    11PSOORED6 ;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;Build 4
     2 ;;7.0;OUTPATIENT PHARMACY;**78,104,117,133,143,219,148,247,268,260**;DEC 1997;Build 84
    33 ;External reference to ^PSDRUG supported by DBIA 221
    44 ;External reference to ^PS(50.7 supported by DBIA 2223
     
    5252 S DIC("B")=$P(^PS(50.7,PSOI,0),"^"),DIC="^PS(50.7,",DIC(0)="AEMQZ"
    5353 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
    5755 G:Y<1 PSOI Q:PSOI=+Y
    5856 S PSODRUG("OI")=+Y,PSODRUG("OIN")=Y(0,0) K DIC
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOORED7.m

    r628 r636  
    11PSOORED7 ;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 41
     2 ;;7.0;OUTPATIENT PHARMACY;**148,247**;DEC 1997;Build 18
    33 ;called from psooredt. cmop edit checks.
    44 ;Reference to file #50 supported by IA 221
     
    5959 . . D ECMESND^PSOBPSU1(RX,0,,"ED",$$GETNDC^PSONDCUT(RX,0),,$S($P(CHANGED,"^",2):"RX DIVISION CHANGED",1:"RX EDITED"),,+$G(CHGNDC))
    6060 . . ;- 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")
    6262 Q
    6363 ;
     
    7272 I $$DIVNCPDP^BPSBUTL(+$G(PRIOR(52,RX_",",20,"I")))'=$$DIVNCPDP^BPSBUTL(+$G(SAVED(52,RX_",",20,"I"))) S CHANGED="1^1"
    7373 Q CHANGED
    74  ;;
    75 NDCDAWDE(ST,FLN,RXN) ; allow edit of NDC & DAW for DC'd/expired ECME RXs
    76  ;;  input: (r) ST  - the Rx status code
    77  ;;         (r) FLN - field number selected for editing
    78  ;;         (r) RXN - prescription #
    79  ;; output: VALMSG for inappropriate field selection or use
    80  ;;         PSODRUG & RSORXED arrays updated if edited
    81  Q:$G(ST)=""!($G(FLN)="")!($G(RXN)="")
    82  I '((ST=11)!(ST=12)) S VALMSG=("Invalid selection!") Q
    83  I '((FLN=2)!(FLN=20)!(FLN=21)) S VALMSG=("Invalid selection!") Q
    84  I $$STATUS^PSOBPSUT(RXN,$$LSTRFL^PSOBPSU1(RXN))="" S VALMSG=("Invalid selection!") Q
    85  ;
    86  ; edit NDCs
    87  I FLN=2 D  Q
    88  .N NDC
    89  .S NDC=$$GETNDC^PSONDCUT(RXN,0)
    90  .D NDCEDT^PSONDCUT(RXN,"",$G(DRG),$G(PSOSITE),.NDC)
    91  .I $G(NDC)="^" Q
    92  .S (PSODRUG("NDC"),PSORXED("FLD",27))=NDC
    93  ;;
    94  ; edit refill NDCs/DAWs
    95  I FLN=20 D  Q
    96  .I $$LSTRFL^PSOBPSU1(RXN)=0 S VALMSG="Invalid selection!" Q
    97  .D REF^PSOORED2
    98  ;;
    99  ; edit DAW
    100  I FLN=21 D  Q
    101  .N DAW
    102  .D EDTDAW^PSODAWUT(RXN,0,.DAW)
    103  .I $G(DAW)="^" Q
    104  .S (PSODRUG("DAW"),PSORXED("FLD",81))=DAW
    105  Q
    106  ;;
  • 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
     1PSOOREDT ;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 ;
    311 ;External reference to ^PSDRUG supported by DBIA 221
    412 ;External reference to PSSLOCK supported by DBIA 2789
     
    3846 Q
    3947 ;
    40 EDT ; Rx Edit (Backdoor)
    41  K NCPDPFLG
     48EDT S NCPDPFLG=0
    4249 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)
    4350 S (RX0,PSORXED("RX0"))=^PSRX($P(PSOLST(ORN),"^",2),0),PSORXED("RX2")=$G(^(2)),PSORXED("RX3")=$G(^(3)),PSOSIG=$P(^("SIG"),"^")
     
    5259 .D:'$G(CHK) POP^PSOSIGNO(DA),CHK Q:$G(PSORXED("DFLG"))
    5360 .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)) Q
    5561 .I FLN=20,'$G(REF) S VALMSG="There is no Refill Data to be edited." Q
    5662 .S DR=$P(FDR,"^",FLN) I DR="RF" D REF^PSOORED2 Q
    5763 .I DR="PSOCOU" D PSOCOU^PSOORED6 Q
    58  .I FLN=2,'$P(PSOPAR,"^",3),$$RXRLDT^PSOBPSUT(RXN,0),$$STATUS^PSOBPSUT(RXN,0)'="" D  Q
     64 .I FLN=2,'$P(PSOPAR,"^",3) D  Q
    5965 ..N NDC D NDC^PSODRG(RXN,0,,.NDC) I $G(NDC)="^"!($G(NDC)="") Q
    6066 ..S (PSODRUG("NDC"),PSORXED("FLD",27))=NDC
     
    100106 ;
    101107 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 ;
    102114 I $P(^PSRX(PSORXED("IRXN"),"STA"),"^")=16 S PSORXED("DFLG")=1 S VALMSG="Prescriptions on Provider Hold cannot be edited." Q
    103115CHKX 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
     1PSOORFI1 ;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
    35 ;Ref. ^PS(50.7 supp. DBIA 2223
    46 ;Ref. ^PSDRUG( supp. DBIA 221
     
    1517 S (OI,PSODRUG("OI"))=$P(OR0,"^",8),PSODRUG("OIN")=$P(^PS(50.7,$P(OR0,"^",8),0),"^"),OID=$P(OR0,"^",9)
    1618 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
    1720 I '$P(OR0,"^",9) D DREN^PSOORNW2
    1821DRG I $P($G(^PSDRUG(+$G(PSODRUG("IEN")),"CLOZ1")),"^")="PSOCLO1" D CLOZ^PSOORFI2
     
    7275 . I $G(PSOMAX) S PSONEW("# OF REFILLS")=$S(+$P(OR0,"^",11)>PSOMAX:PSOMAX,1:+$P(OR0,"^",11)) Q
    7376 .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)
    7578 S ^TMP("PSOPO",$J,IEN,0)=^TMP("PSOPO",$J,IEN,0)_$S($D(CLOZPAT):+$G(PSONEW("QTY")),1:$P(OR0,"^",10))
    7679 I $P($G(^PSDRUG(+$G(PSODRUG("IEN")),5)),"^")]"" D
     
    9295 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
    9396 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 Pharmacist
    95  I $G(PSOACTOV) S PSOACT=""
    9697 D:'$G(ACP) EN^PSOLMPO S:$G(ACP) VALMBCK="Q" D:$G(PKI1)=2 DCP^PSOPKIV1
    9798 Q
    9899POST ;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
    100102SIG ;displays possible sig
    101103 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
     1PSOORFI2 ;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
    57HLP 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
    68HELP ;
     
    2022 .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
    2123 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
     24PROFILE ;
     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
    2629 K DIR,DUOUT,DIRUT,DTOUT
    2730 Q
    2831DC 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)
    3033 .D NOOR^PSOCAN4 Q:$D(DIRUT)
    3134 .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"
    3239 I '$G(PSOELSE) K PSOELSE S PSONOOR="A" G DE
    3340 K PSOELSE I $D(DIRUT) K DIRUT,DUOUT,DTOUT,Y Q
    3441 S ACOM=Y
    35 DE Q:'$D(^PS(52.41,ORD,0))
     42DE I $G(PSOAFYN)="Y" Q
     43 I $G(PSOAFYN)'="Y" Q:'$D(^PS(52.41,ORD,0))
    3644 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)
    3745 S $P(^PS(52.41,ORD,0),"^",3)="DC",POERR("PLACER")=$P(^(0),"^"),POERR("STAT")="OC"
     
    4250 S Y=-1 Q
    4351 ;
    44 RF ;process refill request from CPRS
     52RF ;
    4553 S PSOREF("IRXN")=$P(OR0,"^",19) D PSOL^PSSLOCK($P(OR0,"^",19)) I '$G(PSOMSG) D  D PAUSE^VALM1 K PSOREF,PSOMSG Q
    4654 .I $P($G(PSOMSG),"^",2)'="" W $C(7),!!,$P(PSOMSG,"^",2),! Q
     
    5260 S PSONEW("DAYS SUPPLY")=$P(^PSRX(PSOREF("IRXN"),0),"^",8),PSONEW("# OF REFILLS")=$P(^(0),"^",9) D FULL^VALM1
    5361 W !!,"Processing Refill Request for Rx "_$P(^PSRX(PSOREF("IRXN"),0),"^")
    54  ;S:$G(PSOREQFD)]"" PSORX("FILL DATE")=PSOREQFD
    5562 D FILLDT^PSODIR2(.PSOREF) I PSOREF("DFLG") S VALMBCK="R" G END
    56  ;S:$G(PSORX("FILL DATE"))]"" PSOREQFD=PSORX("FILL DATE")
    5763 ;
    58  ;S:$G(PSOREQMP)]"" PSORX(" METHOD OF PICK-UP")=PSOREQMP
    5964 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")
    6165 S:'$G(PSOFROM)'="NEW" PSOFROM="REFILL" S PSOREF("DFLG")=0
    6266 D ^PSOREF0
     
    8892KPRIZ K PSOQUIT,POERR("QFLG")
    8993 Q
    90 INST ;Select Institution
     94INST ;
    9195 I '$G(PSOSITE) D ^PSOLSET I '$G(PSOSITE) S PSOIQUIT=1 Q
    9296 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
    9499 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
    95100 I PSCT=1 Q
     
    104109 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)),"^")
    105110 Q
    106 CLOZ ;checks clozapine status of patient
     111CLOZ ;
    107112 S CLOZPAT=$O(^YSCL(603.01,"C",PSODFN,0))
    108113 S CLOZPAT=$P($G(^YSCL(603.01,+CLOZPAT,0)),"^",3)
     
    113118 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"
    114119 Q
    115 USER(USER) ;returns .01 of 200
     120USER(USER) ;
    116121 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
    117122 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
     1PSOORFI3 ;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
    35 ;PPPPDA1-1374,SC(-2675,40.8-728,51.2-2226,50.607-2221,55-2228,PSSLOCK-2789,DPT-10035,ORX2-867
    46 ;
     
    5860L1 ;Lock single order
    5961 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 DIR
     62 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
    6163 Q
    6264UL1 ;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
     1PSOORFI4 ;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
    35 ;External reference to ^PS(51.2 supported by DBIA 2226
    46 ;External reference to ^PS(50.607 supported by DBIA 2221
     
    3032 .D EN^DDIOL("Provider Comments: ","","!")
    3133 .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
    3438 .S PSOPRC=1,NI=0 F I=0:0 S I=$O(PSONEW("SIG",I)) Q:'I  S NI=I
    3539 .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)
    3942 ..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 INS1
     43 .F I=0:0 S I=$O(PRC(I)) Q:'I  S NI=NI+1,(PSONEW("SIG",NI),PSONEW("INS",NI))=PRC(I)
    4144 .I $E(PSONEW("SIG",1))=" " S PSONEW("SIG",1)=$E(PSONEW("SIG",1),2,250)
    42  .D EN^PSOFSIG(.PSONEW,1) K NI,NC,X
     45 .D EN^PSOFSIG(.PSONEW,1) K NI,NC
    4346 Q
    4447DOSE ;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
     1PSOORFIN ;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 ;
    36 ;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
    59 D INST^PSOORFI2 I $G(PSOIQUIT) K PSOIQUIT G EX
    610 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
    814 G:Y="PA" PAT G:Y="PR" PRI G:Y="CL" ^PSOORFI3
    915 K DIR S PSOSORT="ROUTE"
    1016 S DIR("?")="^D RT^PSOORFI1",DIR("A")="Route",DIR(0)="SBM^W:WINDOW;M:MAIL;C:CLINIC;E:EXIT",DIR("B")="WINDOW"
    1117 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
    1219 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
    1320 .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)
     
    4451 .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
    4552 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
     53PAT 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
    4958 S PSOSORT=PSOSORT_"^ALL"
    5059 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))
     
    6473 G EX
    6574SPAT 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
    7082 D LK I $G(POERR("QFLG")) G SPAT
    7183 N SNGLPAT S SNGLPAT=1
     
    7385 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
    7486 .S X=PAT D ULP
    75  S ORD=0 F  S ORD=$O(^PS(52.41,"P",PAT,ORD)) Q:'ORD!($G(POERR("QFLG")))  D
     87 I PSOAFYN'="Y" S ORD=0 F  S ORD=$O(^PS(52.41,"P",PAT,ORD)) Q:'ORD!($G(POERR("QFLG")))  D  ;vhah
    7688 .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
    7790 I $O(PSORX("PSOL",0))!($D(RXRS)) D LBL
     91 I $G(PSOAFYN)="Y" S PSOAFDON=1 ;vfah
    7892 S PSOFIN=1,X=PAT D ULP G SPAT
    7993ORD I $G(PSOBCK) N LST,ORN
     
    91105 .K PSOREEDT S (PSOORRNW,PSOFDR)=1,PSORENW("OIRXN")=$P(OR0,"^",21),PSOOPT=3,(PSORENW("DFLG"),PSORENW("QFLG"))=0 D ^PSOORRNW,SQR^PSOORFI3
    92106 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^PSOORFI3
     107 N PSODRUG,PSONEW S PSOFROM="PENDING" D:'$G(PSOTPBFG) DSPL^PSOTPCAN(ORD) D DSPL^PSOORFI1:'$D(ZTSK),SQN^PSOORFI3
    94108SUCC ;
    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
    99110 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 ;
     112LBL ;
     113 D LBL^PSOORFI5
    102114 Q
     115 ;
    103116CHK ;
    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
    110118 Q
     119 ;
    111120PRI K DIR S PSOSORT="PRIORITY"
    112121 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  
    11PSOORNE2 ;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 41
     2 ;;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
    33 ;^PSDRUG( -  221
    44 ;^YSCL(603.01 - 2697
     
    3131 .S CLOZPAT=$S(CLOZPAT="M":2,CLOZPAT="B":1,1:0)
    3232 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")
    3434 .D GET^PSOORNE5 S PSOACT=PSOACT_$S(ACTREN:"N",1:""),PSOACT=PSOACT_$S(ACTREF:"R",1:"")
    3535 .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
     1PSOORNE4 ;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
    35 ;^SC DBIA-10040;^PS(50.7-2223;^PS(50.606-2174;^PS(50.607-2221;^PS(51.2-2226;^PSDRUG-221;^PS(55-2228
    46EN(PSONEW) N FLD,LST,VALMCNT
     
    79 .K PSONEW("DOSE"),PSONEW("UNITS"),PSONEW("DOSE ORDERED"),PSONEW("ROUTE")
    810 .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
     11RDD 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
    1114 Q
    1215EDT 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:29am
    2  ;;7.0;OUTPATIENT PHARMACY;**11,27,32,46,78,99,117,131,146,171,180,210,222,268,206**;DEC 1997;Build 39
     1PSOORNE5 ;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
    33 ;External reference to ^PSDRUG supported by DBIA 221
    44 ;External references L and UL^PSSLOCK supported by DBIA 2789
     
    5151 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
    5252 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 Q
     53 I '$D(CLOZPAT) I PSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F") S (PSONEW("# OF REFILLS"),PSONEW("N# REF"))=0 Q
    5454 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
    5555 I PSODIR("CS") D
     
    7272 S:PSORFRM<0 PSORFRM=0 S:PSORFRM=0 ACTREF=0
    7373 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=0
     74 I $P(PSODRUG0,"^",3)["A"&($P(PSODRUG0,"^",3)'["B")!($P(PSODRUG0,"^",3)["F") S ACTREF=0
    7575 ;renews
    7676 I $P(PSOPAR,"^",4)=0 S ACTREN=0 Q
     
    7878 I $G(^PSDRUG(PSODRG,"I"))]"",DT>$G(^("I")) S ACTREN=0,VALMSG="This Drug has been Inactivated."
    7979 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
    8182 I $D(^PS(53,+$P(RX0,"^",3),0)),'$P(^(0),"^",5) S ACTREN=0
    8283 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
     1PSOORNEW ;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 ;
    311 ;^PS(50.7 -2223
    412 ;^PSDRUG -221
    513 ;^PS(50.606 -2174
    614 ;^PS(55 -2228
    7  ;
    815 ;PSO*237 quit Finish if Today > Issue date + 365
    9  ;
    1016DSPL I $G(PSODSPL) S VALMBCK="Q" K PSODSPL,PSOANSQD Q
    1117 Q:'$D(PSOLMC)  K ^TMP("PSOPO",$J) S PSOLMC=PSOLMC+1
     
    1521 .S (OI,PSODRUG("OI"))=$P(OR0,"^",8),PSODRUG("OIN")=$P(^PS(50.7,$P(OR0,"^",8),0),"^"),OID=$P(OR0,"^",9)
    1622 .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")=0
     23 I '$D(CLOZPAT) I $G(PSODRUG("DEA"))["A",$G(PSODRUG("DEA"))'["B"!($G(PSODRUG("DEA"))["F") S PSONEW("# OF REFILLS")=0
    1824 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)
    1925 S IEN=0 D OBX^PSOORFI1,DIN^PSONFI(PSODRUG("OI"),$S($G(PSODRUG("IEN")):PSODRUG("IEN"),1:""))
     
    6672 S:PSOLMC>1 VALMBCK="R"
    6773 Q
    68 ORCHK D PROVCOM^PSOORFI4,ORCHK^PSOORFI4
     74ORCHK D PROVCOM^PSOORFI4
     75 I $G(PSOAFYN)'="Y" D ORCHK^PSOORFI4
    6976 Q
    7077EDT 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))
     
    8592 D RXNCHK^PSOORNE1 I $G(PSONEW("QFLG")) S PSONEW("DFLG")=1 Q
    8693 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
    8896 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"
    9099 D KV I 'Y K PSOANSQ G DSPL
    91100 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"
    95105 S PSONEW("POE")=1 D EN^PSON52(.PSONEW) G:$G(PSONEW("DFLG")) ABORT D DCORD^PSONEW2
    96106 D NPSOSD^PSOUTIL(.PSONEW),FULL^VALM1 K PSORX("MAIL/WINDOW")
    97107 D EOJ^PSONEW
    98 ABORT S VALMBCK="Q",DIR(0)="E",DIR("A")="Press Return to Continue" D ^DIR,CLEAN^PSOVER1,KV
     108ABORT ;
     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
    99111 Q
    100112KV K DIRUT,DUOUT,DTOUT,DIR
     
    136148 ;
    137149DRGMSG ;
    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:30am
    2  ;;7.0;OUTPATIENT PHARMACY;**23,46,78,117,131,133,172,148,222,268,206**;DEC 1997;Build 39
     1PSOORNW1 ;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
    33 ;Reference ^YSCL(603.01 supported by DBIA 2697
    44 ;Reference ^PS(55 supported by DBIA 2228
     
    6767 E  D
    6868 .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 Q
     69 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
    7070 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
    7171 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
     1PSOORNW2 ;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
    319 ;Reference to ^YSCL(603.01 supported by DBIA 2697
    420 ;Reference to ^PS(55 supported by DBIA 2228
     
    1127 S DIC("B")=$S($G(PSODRUG("OIN"))]"":PSODRUG("OIN"),1:""),DIC="^PS(50.7,",DIC(0)="AEMQZ"
    1228 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
    1630 S PSOY=Y
    1731 I +Y'=OI D  I 'Y!($D(DIRUT)) D KV,MP1^PSOOREDX K DIC,Y,PSOY S OUT=1 Q
     
    3751 .S PSONEW("# OF REFILLS")=$S(PSONEW("# OF REFILLS")>PSOMAX:PSOMAX,1:PSONEW("# OF REFILLS"))
    3852 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) D
    40  .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 ...")
    4155 Q
    4256 ;
     
    6276 .S:'$G(PSONEW("# OF REFILLS")) PSONEW("# OF REFILLS")=$S(+$P(OR0,"^",11)>PSOMAX:PSOMAX,1:+$P(OR0,"^",11))
    6377 .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  Q
    65  ..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 ...")
    6680 .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  Q
    68  .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 ...")
    6983 S (PSONEW("N# REF"),PSOMAX,PSONEW("# OF REFILLS"))=+$P(OR0,"^",11)
    7084ASK S PSONEW("FLD")=9 D REFILL^PSODIR1(.PSONEW) ; Get # of refills
     
    8810214 S PSONEW("FLD")=13 D RMK^PSODIR2(.PSONEW) ; Get Remarks
    89103 Q
     104 ;
     105DRGMSG ;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 ;
    90110DREN ;
    91111 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
     1PSOORRNW ;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
    319 ;External reference to ^PSDRUG supported by DBIA 221
    420 ;External reference to ^PS(50.607 supported by DBIA 2221
     
    622 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789
    723 S PSORENXX=$P($G(OR0),"^",21),PSOFROM="NEW" K PRC,PHI
    8  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
     24 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
    925 .I $P($G(PSOMSG),"^",2)'="" W $C(7),!!,$P(PSOMSG,"^",2) Q
    1026 .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
    1230 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 2
     31 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
    1432 I $P($G(^PSRX($P(OR0,"^",21),"OR1")),"^",4) D  D PROCESSX^PSORENW0 D UL Q
    1533 .W !!,"Cannot Renew Rx # "_$P(^PSRX($P(OR0,"^",21),0),"^"),!," Drug: "_$P($G(^PSDRUG($P(^PSRX($P(OR0,"^",21),0),"^",6),0)),"^")_"."
     
    5270 .S PSOCS=0 K DIR,DIC,PSOX
    5371 .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
    5673 E  S PSOMAX=$P(OR0,"^",11)
    5774 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:36am
    2  ;;7.0;OUTPATIENT PHARMACY;**1,14,30,46,132,148,233,274**;DEC 1997;Build 8
     1PSOORUT1 ;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
    33 ;External reference to ^PSDRUG supported by DBIA 221
    44 ;External reference to ^PSXOPUTL supported by DBIA 2203
     
    2929 .I $$SUBMIT^PSOBPSUT(DA) D ECMESND^PSOBPSU1(DA,,$$RXFLDT^PSOBPSUT(DA),$S('$O(^PSRX(DA,1,0)):"OF",1:"RF"))
    3030 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+1
     31ACT1 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
    3232 S IR=0 F FDA=0:0 S FDA=$O(^PSRX(DA,"A",FDA)) Q:'FDA  S IR=FDA
    3333 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:36am
    2  ;;7.0;OUTPATIENT PHARMACY;**14,46,146,132,118,199,223,148,249,274**;DEC 1997;Build 8
     1PSOORUTL ;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
    33 ;External reference to EN^ORERR - 2187
    44 ;External reference to ^PS(55 - 2228
     
    104104 S IR=0 F FDA=0:0 S FDA=$O(^PSRX(DA,"A",FDA)) Q:'FDA  S IR=FDA
    105105 S IR=IR+1,^PSRX(DA,"A",0)="^52.3DA^"_IR_"^"_IR
    106  S RXF=$S(RXF>5:RXF+1,1:RXF)
    107106 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."
    108107 Q
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOPMP0.m

    r628 r636  
    11PSOPMP0 ;BIRM/MFR - Patient Medication Profile - Listmanager ;10/28/06
    2  ;;7.0;OUTPATIENT PHARMACY;**260,281**;DEC 1997;Build 41
     2 ;;7.0;OUTPATIENT PHARMACY;**260**;DEC 1997;Build 84
    33 ;Reference to EN1^GMRADPT supported by IA #10099
    44 ;Reference to EN6^GMRVUTL supported by IA #1120
     
    1414 ; - Patient selection
    1515 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/update
    1816 ;
    1917 D LST(PSOSITE,DFN)
     
    102100 ;
    103101SETSORT(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,PSOBADR
     102 N SEQ,RX,RXNUM,DRUG,DRNAME,QTY,STATUS,STS,ISSDT,DOCDAT,LSTFD,REFREM,DAYSUP,SIG,Z,ORD,GRPCNT,GROUP,RFRX,OI
    105103 ;
    106104 K ^TMP("PSOPMPSR",$J)
     
    120118 . S REFREM=$$REFREM^PSOPMP1(RX)
    121119 . 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=""
    125120 . 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)
    127122 . S $P(Z,"^",7)=$P(LSTFD,"^",2),$P(Z,"^",8)=REFREM,$P(Z,"^",9)=DAYSUP
    128123 . S SORT=$S(FIELD="RX":RXNUM_" ",FIELD="DR":DRNAME_RXNUM,FIELD="ID":+ISSDT_RXNUM_" ",FIELD="LF":+LSTFD_RXNUM_" ")
     
    231226 ;
    232227 ; - Regular prescription
    233  I TYPE="RX" D  S VALMBCK="R" D REF
     228 I TYPE="RX" D
    234229 . N PSOVDA,PSOSAVE,DA,PS
    235  . S (PSOVDA,DA)=ORD,PS="REJECTMP"
     230 . S (PSOVDA,DA)=ORD,PS="REJECT"
    236231 . N LINE,TITLE,PSODFN D DP^PSORXVW
    237232 ;
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOPMP1.m

    r628 r636  
    11PSOPMP1 ;BIRM/MFR - Patient Medication Profile - Listmanager ;04/28/05
    2  ;;7.0;OUTPATIENT PHARMACY;**260,285,281**;DEC 1997;Build 41
     2 ;;7.0;OUTPATIENT PHARMACY;**260**;DEC 1997;Build 84
    33 ;Reference to ^PSDRUG("AQ" supported by IA 3165
    44 ;Reference to EN1^GMRADPT supported by IA 10099
     
    1717 . . S LBL=GRPLN(LN),POS=41-($L(LBL)\2)
    1818 . . D CNTRL^VALM10(LN,1,POS-1,IOUON_IOINHI,IOINORM)
    19  . . D CNTRL^VALM10(LN,POS,$L(LBL),IORVON_IOINHI,IORVOFF_IOINORM)
     19 . . D CNTRL^VALM10(LN,POS,$L(LBL),IORVON_IOINHI,IOINORM)
    2020 . . D CNTRL^VALM10(LN,POS+$L(LBL),81-POS-$L(LBL),IOUON_IOINHI,IOINORM)
    2121 Q
     
    7373FILTER(RX) ; - Filter Rx's that should not be displayed
    7474 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 1
     75 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
    7676 I $$GET1^DIQ(52,RX,100,"I")=""!($$GET1^DIQ(52,RX,100,"I")=13) Q 1
    7777 I $$GET1^DIQ(52,RX,.01)="" Q 1
     
    152152 I GMRAL S ALLERGY="<A>"
    153153 E  D ALLERGY^PSOORUT2 I PSONOAL'="" S ALLERGY="<NO ALLERGY ASSESSMENT>"
    154  S ALLERGY=IORVON_ALLERGY_IORVOFF_IOINORM
     154 S ALLERGY=IORVON_ALLERGY_IOINORM
    155155 I '$G(POS) S POS=80-$L(ALLERGY)
    156156 S LINE=$$SETSTR^VALM1(ALLERGY,LINE,POS,80)
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOR52.m

    r628 r636  
    11PSOR52 ;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 41
     2 ;;7.0;OUTPATIENT PHARMACY;**10,22,27,181,148,201,260**;DEC 1997;Build 84
    33 ;Reference to ^PSDRUG supported by DBIA 221
    44 ;Reference to PSOUL^PSSLOCK supported by DBIA 2789
     
    8484 . S ACTION="" D ECMESND^PSOBPSU1(PSOERX,PSOERF,PSOX("FILL DATE"),"RF")
    8585 . 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")
    8787 . I $$STATUS^PSOBPSUT(PSOERX,PSOERF)="E PAYABLE" D
    8888 . . 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
     1PSOREF ;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 ;
    316 ;External reference to ^PSDRUG supported by DBIA 221
    417 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789
     
    922 Q
    1023OERR ;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
    1129 I $$LMREJ^PSOREJU1($P(PSOLST(ORN),"^",2),,.VALMSG,.VALMBCK) Q
    1230 I $D(RXRP($P(PSOLST(ORN),"^",2))) S VALMBCK="",VALMSG="A Reprint Label has been requested!" Q
     
    2947 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
    3048 .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
    3153 ..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
    3254 ..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
     
    85107 I '$P($G(^PSRX(RXN,"OR1")),"^"),$P($G(^PSDRUG(PSODRG,2)),"^") S $P(^PSRX(RXN,"OR1"),"^")=$P(^PSDRUG(PSODRG,2),"^")
    86108 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."
    88110 K CLOZPAT I DT>$P($G(^PSRX(RXN,2)),"^",6) Q "0^Non-Refillable.  Prescription has Expired."
    89111 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  
    11PSOREJP1 ;BIRM/MFR - Third Party Reject Display Screen ;04/29/05
    2  ;;7.0;OUTPATIENT PHARMACY;**148,247,260,281**;DEC 1997;Build 41
     2 ;;7.0;OUTPATIENT PHARMACY;**148,247,260**;DEC 1997;Build 84
    33 ;Reference to File 9002313.93 - BPS NCPDP REJECT CODES supported by IA 4720
    44 ;Reference to ^PS(59.7 supported by IA 694
     
    2626 K ^TMP("PSOREJP1",$J) S VALMCNT=0,LINE=0
    2727 D GET^PSOREJU2(RX,FILL,.DATA,REJ,1)
    28  D REJ           ; Display REJECT Info
    29  D OTH           ; Display Other Rejects Info
    30  D COM^PSOREJP3  ; Display Comment
    31  D INS           ; Display Insurance Info
    32  D CLS           ; Display Resolution Info
     28 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
    3333 S VALMCNT=LINE
    3434 Q
     
    251251 ;
    252252OUT(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
    257254 S PSOBACK=1
    258255 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
     1PSORELD1 ;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 ;
    321 ;HLFNC supp. by DBIA 10106
    422 ;PSNAPIS supp. by DBIA 2531
     
    2543 D PID(.PSI),PV1(.PSI),PV2(.PSI),ORC(.PSI),RXE(.PSI),RXD(.PSI)
    2644 ; 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 ;  ========
    2949GETDATA ; this is the place to set all data needed for several segments
    3050 I $G(FP)="F"&('$G(FPN)) D    ;original
     
    3252 . S PVDR=$P(^PSRX(IRXN,0),"^",4),QTY=$P(^(0),"^",7),DASPLY=$P(^(0),"^",8),MW=$P(^(0),"^",11),EBY=$P(^(0),"^",16)
    3353 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))
    3556 . 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))
    3759 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)
    4064 . S PSONDC=$S($P(^PSRX(IRXN,"P",FPN,0),"^",12):$P(^(0),"^",12),1:$P(^PSRX(IRXN,2),"^",7))
    4165 S EFDT=$P(^PSRX(IRXN,2),"^",2) S:$G(EFDT) EFDT=$$HLDATE^HLFNC(EFDT,"DT")
     
    4367 S DEAID=$$GET1^DIQ(200,PVDR_",",53.2)
    4468 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,Y
     69 S VPHARM=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)),1:"""""") K DIC,X,Y
    4670 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,Y
     71 S EBY1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)),1:"""""") K DIC,X,Y
    4872 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,Y
     73 S PVDR1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)),1:"""""") K DIC,X,Y
    5074 S PRIORDT=$P(^PSRX(IRXN,3),"^",4),PRIORDT=$$HLDATE^HLFNC(PRIORDT,"DT")
    5175 S FDT=$$HLDATE^HLFNC(FDT,"DT")
     
    5579 S FIN=$P(^PSRX(IRXN,"OR1"),"^",5)
    5680 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,Y
     81 S FIN1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)),1:"""""") K DIC,X,Y
    5882 S SITE=$S($D(^PS(59,PSOSITE,0)):^(0),1:"")
    5983 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:""))
     
    6185 S CSINER=$P(^PSRX(IRXN,3),"^",3)
    6286 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,Y
     87 S CSINER1=$S(+Y:$$HLNAME^HLFNC($P(Y,"^",2)),1:"""""") K DIC,X,Y
    6488 D 6^VADPT
    6589 I MW="W" S MP=$S($P($G(^PSRX(IRXN,"MP")),"^"):$P(^("MP"),"^"),1:"""""")
     
    87111 S NFLD=0,UU="" F  S UU=$O(^PSRX(IRXN,1,UU)) Q:UU=""  S:$D(^PSRX(IRXN,1,UU,0)) NFLD=NFLD+1
    88112 S NRFL=$P(^PSRX(IRXN,0),"^",9),RFRM=(NRFL-NFLD)
    89  Q
     113 QUIT
     114 ;  =========
    90115PID(PSI) ;patient ID segment
    91  Q:'$D(DFN)!$D(PAS)
     116 QUIT:'$D(DFN)!$D(PAS)
     117 ;
    92118 S HLFS=HL1("FS"),HLECH=HL1("ECH"),HLQ=HL1("Q"),HLVER=HL1("VER")
    93119 K PSPID,PSPID1
     
    127153 S PAS=1
    128154 K PSPID,PSPID1,PRSEPID,PRSEZTA,SPOT,TMPADD,ADDSEQ
    129  Q
     155 QUIT
     156 ;  =========
    130157PV1(PSI) ;patient visit segment
    131158 N PV1  ;hardcoded to letter O for Outpatient (Patient class)
     
    133160 S ^TMP("PSO",$J,PSI)=PV1
    134161 S PSI=PSI+1
    135  Q
     162 QUIT
     163 ;  =========
    136164PV2(PSI) ;patient visit segment (additional information)
    137165 ;PATIENT STATUS AND COPAY
     
    140168 S ^TMP("PSO",$J,PSI)="PV2|"_PV2
    141169 S PSI=PSI+1
    142  Q
     170 QUIT
     171 ;  =========
    143172ORC(PSI) ;common order segment
    144  Q:'$D(DFN)
     173 QUIT:'$D(DFN)
     174 ;
    145175 N ORC S ORC=""
    146176 S $P(ORC,"|",1)="OE"
     
    154184 S $P(ORC,"|",17)=CLN_CS_CLN1_CS_"99PSC"
    155185 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)
    157190 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:""))
    158191 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
    159192 S $P(ORC,"|",23)="("_$P(SITE,"^",3)_")"_$P(SITE,"^",4)
    160193 S ^TMP("PSO",$J,PSI)="ORC|"_ORC,PSI=PSI+1
    161  Q
     194 QUIT
     195 ;  ===========
    162196RXE(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=""
    165201 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"
    167207 S $P(RXE,"|",3)=""
    168208 I $G(PSOXN)="" S PSOXN=""""""
    169209 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))
    171212 I '$G(POIPTR) S PODOSE=$P($G(^PS(50.7,$P($G(^PSDRUG(IDGN,2)),"^"),0)),"^",2),PODOSENM=$G(^PS(50.606,PODOSE,0))
    172213 S TRADENM=$G(^PSRX(IRXN,"TN"))
    173214 S $P(RXE,"|",6)=PODOSE_CS_PODOSENM_CS_"99PSF"
    174215 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
    176221 S $P(RXE,"|",15)=$P(^PSRX(IRXN,0),"^")
    177222 S ^TMP("PSO",$J,PSI)="RXE|"_RXE,PSI=PSI+1
    178  Q
     223 QUIT
     224 ;  =========
    179225RXD(PSI) ;pharmacy dispense segment
    180  Q:'$D(DFN)
     226 QUIT:'$D(DFN)
     227 ;
    181228 N RXD S RXD=""
    182229 S $P(RXD,"|",1)=$S($G(NFLD):NFLD,1:0)
     
    185232 S $P(RXD,"|",7)=$P(^PSRX(IRXN,0),"^")
    186233 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:42am
    2  ;;7.0;OUTPATIENT PHARMACY;**11,27,30,46,71,96,100,130,148,206**;DEC 1997;Build 39
     1PSORENW ;BIR/SAB-renew main driver ;07/07/96
     2 ;;7.0;OUTPATIENT PHARMACY;**11,27,30,46,71,96,100,130,148**;DEC 1997
    33 ;External reference to ^PSDRUG supported by DBIA 221
    44 ;External references L, UL, PSOL, and PSOUL^PSSLOCK supported by DBIA 2789
     
    5858 I $P($G(^PSDRUG(PSODRG,2)),"^",3)'["O" Q "0^Drug is No longer used by Outpatient Pharmacy."
    5959 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."
    6162 I $D(^PS(53,+$P(RX0,"^",3),0)),'$P(^(0),"^",5) Q "0^Non-Renewable Prescription."
    6263 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:05am
    2  ;;7.0;OUTPATIENT PHARMACY;**11,27,32,59,64,46,71,96,100,130,237,206**;DEC 1997;Build 39
     1PSORENW0 ;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
    33 ;External reference to ^PS(50.7 supported by DBIA 2223
    44 ;External reference to ^PSDRUG supported by DBIA 221
     
    5858 ;
    5959 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,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 $P(PSOY,"^",3)]"" D  K ACOM,DIR,DIRUT,DIRUT,DUOUT
    6161 . S PSORENW("DFLG")=1
    6262 . 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
     1PSORN52 ;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
    319 ;Ext ref to ^PS(55 sup by DBIA 2228
    420 ;Ext ref to PSOUL^PSSLOCK sup by DBIA 2789
     
    4561 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
    4662 ;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
    4764 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
    4865 I $$DT^PSOMLLDT D
     
    5673 I $G(PSONEW("NEWCOPAY")) S ^PSRX(PSOX("IRXN"),"IB")=PSONEW("NEWCOPAY")
    5774 ;
    58  D FINISH,ACP^PSOUTIL
     75AFIN D FINISH,ACP^PSOUTIL ;vfah copay not evaluated by Autofinish,Rx
    5976 ;
    6077 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
     1PSORX1 ;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
    319 ;External reference PDA^PPPPDA1 supported by DBIA 1374
    420 ;External reference ^PS(55 supported by DBIA 2228
     
    3854 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
    3955 ;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 SSN
     56 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!
    4258 S PSONOAL="" D ALLERGY^PSOORUT2 D  I PSONOAL'="" D PAUSE
    4359 .I PSONOAL'="" W !,$C(7),"     No Allergy Assessment!"
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXDL.m

    r628 r636  
    11PSORXDL ;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 2
     2 ;;7.0;OUTPATIENT PHARMACY;**4,17,9,27,117,131,148,201**;DEC 1997
    33 ;External reference to ^PS(55 supported by DBIA 2228
    44 ;External references L, UL, PSOL, and PSOUL^PSSLOCK supported by DBIA 2789
     
    77 I '$D(^XUSEC("PSORPH",DUZ)) W !,$C(7),"Requires Pharmacy Key (PSORPH) !" Q
    88 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
    1210 D FULL^VALM1
    1311 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:53pm
    2  ;;7.0;OUTPATIENT PHARMACY;**2,16,21,26,56,71,125,201,246**;DEC 1997;Build 12
     1PSORXED ;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
    33 ;External reference to ^PSXEDIT supported by DBIA 2209
    44 ;External reference to ^DD(52 supported by DBIA 999
     
    2424L1 D LOG,POST
    2525PROCESSX 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 Q
     26CHECK 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
    2727 I $G(^PSDRUG($P(PSORXED("RX0"),"^",6),"I"))]"",^("I")<DT D  G CHECKX
    2828 . W !,$C(7),"This drug has been inactivated. ",! S PSORXED("DFLG")=1 Q
     
    5454 I $L(PSORX("PSOL",PSOX2))+$L(PSORXED("IRXN"))<220 D  G LOGX
    5555 .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*246
     56 E  I PSORX("PSOL",PSOX2+1)'[PSORXED("IRXN")_"," S PSORX("PSOL",PSOX2+1)=PSORXED("IRXN")_"," D SETRP
    5757LOGX K PSOEDITF,PSOEDITR,PSOEDITL D:$G(RFED) ^PSORXED1
    5858 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
     1PSORXL ;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
    58 I $G(PSOTRVV),$G(PPL) S PSORX("PSOL",1)=PPL K PPL
    69 N SLBL,PSOSONE,PSOKLRXS
    710 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))
     11LBL I $G(PSOAFYN)'="Y" W !! S DIR("A",1)="Label Printer: "_$S($G(SUSPT):PSLION,1:$G(PSOLAP))
    912 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 "
    1013 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"
     
    1215 S DIR("?",5)="Enter 'C' to select another label printer"
    1316 S:$P(PSOPAR,"^",26) DIR("?",5)="Enter 'L' to print labels without queuing"
    14 TRI ;Tricare
     17TRI ;
    1518 S X="IBACUS" X ^%ZOSF("TEST") K X I '$T G PASS
    1619 I '$$TRI^IBACUS() G PASS
     
    2932 I '$D(^TMP($J,"PSOBILL")) K ^TMP($J,"PSONOB") G PASS
    3033 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 not
     34 ;
    3235SETP 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
    3336 .I $G(PSORX("PSOL",1))="" S PSORX("PSOL",1)=TRIRX_"," Q
     
    3740 K ^TMP($J,"PSONOB") S PPL=$G(PSORX("PSOL",1))
    3841PASS ;
    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)
    4349 S:$G(PSOBEDT) NOPP=Y
    4450 I $G(Y)="C" K PSOCLBL,%ZIS("B") S PSOCLBL=1 D @$S('$D(PSOPAR):"^PSOLSET",1:"PLBL^PSOLSET") K PSOCLBL G LBL
     
    5763 D ^%ZISC S PSL=0
    5864QLBL I $G(PSXSYS),('$G(RXLTOP)),('$G(PSOEXREP)) D RXL^PSOCMOP G:'$G(PPL) D1
    59  ;
    6065 ;- Submitting list of Rx to ECME for DUR/79 REJECT check and possible submission to 3rd Pary Payer
    61  D ECME^PSORXL1
     66 I $G(PSOAFYN)'="Y" D ECME^PSORXL1 ;vfah
    6267 ;
    6368 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
    6469 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
    6571 S ZTSAVE("PSORX(")="",ZTSAVE("RXRP(")="",ZTSAVE("RXPR(")="",ZTSAVE("RXRS(")="",ZTSAVE("RXFL(")="",ZTSAVE("PCOMH(")=""
    6672 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:40pm
    2  ;;7.0;OUTPATIENT PHARMACY;**36,46,148,260,274**;DEC 1997;Build 8
     1PSORXL1 ;BIR/SAB-action to be taken on prescriptions ;03/01/96
     2 ;;7.0;OUTPATIENT PHARMACY;**36,46,148,260**;DEC 1997;Build 84
    33S S SPPL="",PPL1=1 S:'$G(PPL) PPL=$G(PSORX("PSOL",PPL1)) G:$G(PPL)']"" D1
    44S1 F PI=1:1 Q:$P(PPL,",",PI)=""  S DA=$P(PPL,",",PI) D
     
    3333 K COMM
    3434SUSQ 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
     35ACT 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
    3736 S IR=0 F FDA=0:0 S FDA=$O(^PSRX(DA,"A",FDA)) Q:'FDA  S IR=FDA
    3837 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
     1PSORXPA1 ;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
    319 ;External references L,UL, PSOL, and PSOUL^PSSLOCK supported by DBIA 2789
    420 ;External reference to ^PSDRUG supported by DBIA 221
    521 ;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
    626 I $D(RXRP($P(PSOLST(ORN),"^",2))) S VALMBCK="",VALMSG="A Reprint Label has been requested!" Q
    727 ;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
     1PSORXRP1 ;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
    319 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789
    420SEL N PSODISP,VALMCNT I '$G(PSOCNT) S VALMSG="This patient has no Prescriptions!" S VALMBCK="" Q
     
    2541 ;
    2642RX ;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 ;
    2749 Q:$P(^PSRX($P(PSOLST(ORN),"^",2),"STA"),"^")>11
    2850 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
     1PSORXRP2 ;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
    319 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789
    420 ;External reference ^PS(55 supported by DBIA 2228
     
    925 S (PPL,DA,RX,PSORPRX)=+Y,PDA=Y(0),RXF=0,ZD(DA)=DT,REPRINT=1,STA=+$G(^PSRX(+Y,"STA"))
    1026 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
    1131 I $P(^PSRX(RX,"STA"),"^")=14 W $C(7),!,"Cannot Reprint! Discontinued by Provider." D ULR,KILL Q
    1232 I $P(^PSRX(RX,"STA"),"^")=15 W $C(7),!,"Cannot Reprint! Discontinued due to editing." D ULR,KILL Q
     
    5474 E  D EN3^PSOUTLA1(DA,75) S D=0 F  S D=$O(BSIG(D)) W !,BSIG(D) Q:'$O(BSIG(D))
    5575 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
    5877 W ?25,$S($D(^VA(200,+P(16),0)):$P(^(0),"^"),1:"Unknown"),!,"# of Refills: "_$G(P(9))
    5978 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
     1PSORXRPT ;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
    319 ;External reference to ^PSDRUG supported by DBIA 221
    420 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789
     
    1430 .S RX=$P(PSOLST(ORN),"^",2) D VALID^PSORXRP1 S:$G(QFLG) VALMBCK="",VALMSG="A New Label has been requested already!"
    1531 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 ;
    1638 I $P(^PSRX(RX,"STA"),"^")=14 S VALMBCK="",VALMSG="Cannot Reprint! Discontinued by Provider.",QFLG=1 D ULR,KILL Q
    1739 I $P(^PSRX(RX,"STA"),"^")=15 S VALMBCK="",VALMSG="Cannot Reprint! Discontinued due to editing.",QFLG=1 D ULR,KILL Q
     
    5577 E  D EN3^PSOUTLA1(DA,75) S D=0 F  S D=$O(BSIG(D)) W !,BSIG(D) Q:'$O(BSIG(D))
    5678 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
    5980 W ?25,$S($D(^VA(200,+P(16),0)):$P(^(0),"^"),1:"Unknown"),!,"# of Refills: "_$G(P(9))
    6081 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  
    11PSORXVW ;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 41
     2 ;;7.0;OUTPATIENT PHARMACY;**14,35,46,96,103,88,117,131,146,156,185,210,148,233,260,264**;DEC 1997;Build 19
    33 ;External reference to File ^PS(55 supported by DBIA 2228
    44 ;External reference to ^PS(50.7 supported by DBIA 2223
     
    107107 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)_")"
    108108 S:$P($G(^PSRX(DA,"PKI")),"^") VALMSG="Digitally Signed Order"
    109  D EN^PSOORAL,KILL I $G(PS)="VIEW" G PSORXVW
     109 D EN^PSOORAL,KILL G:PS="VIEW" PSORXVW
    110110 Q
    111111 ;
    112 KILL K ^TMP("PSOAL",$J),PSOAL,IEN,^TMP("PSOHDR",$J) I $G(PS)="VIEW" K DA
     112KILL K ^TMP("PSOAL",$J),PSOAL,IEN,^TMP("PSOHDR",$J) K:PS="VIEW" DA
    113113 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
    114114 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:28pm
    2  ;;7.0;OUTPATIENT PHARMACY;**35,47,46,71,99,117,156,193,210,148,258,260,240,281**;DEC 1997;Build 41
     1PSORXVW1 ;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
    33 ;External reference to ^DD(52 supported by DBIA 999
    44 ;External reference to ^VA(200 supported by DBIA 10060
     
    4343 .I $P(P1,"^",5)]"" N PSOACBRK,PSOACBRV D
    4444 ..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
    4748 .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)
    4849 .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
    4950 ..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
    5252LBL ;label log
    5353 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=" ",IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Label Log:"
     
    121121 ;
    122122HLP ; 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,"
    126125 D LKP("?")
    127126 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:20am
    2  ;;7.0;OUTPATIENT PHARMACY;**2,19,40,66,107,110,258,206**;DEC 1997;Build 39
     1PSOSD0 ;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
    33 ;External reference to ^PS(50.605 supported by DBIA 696
    44 ;External reference to ^SC supported by DBIA 10040
     
    3939 I 'PSTYPE D:$D(^PSDRUG(+$P(RX0,"^",6),"CLOZ"))&($P($G(^("CLOZ1")),"^")'="PSOCLO1") ^PSOLAB G RXN2
    4040 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=1
     41 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
    4242 S PSOIFSUP=$S(PSODEA']"":0,PSODEA["S":1,1:0),RXX=$P(RX0,"^"),RXX(1)="",RXX=$O(^PSRX("B",RXX,RXX(1)))
    4343 W:$P($G(^PSRX(RXX,"IB")),"^") !?11,"****COPAY****" D PSRENW^PSOSD2
     
    8080 I 'PSTYPE D:$D(^PSDRUG(+$P(RX0,"^",6),"CLOZ"))&($P($G(^("CLOZ1")),"^")'="PSOCLO1") ^PSOLAB G RXN2
    8181 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=1
     82 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
    8383 S PSOIFSUP=$S(PSODEA']"":0,PSODEA["S":1,1:0),RXX=$P(RX0,"^"),RXX(1)="",RXX=$O(^PSRX("B",RXX,RXX(1)))
    8484 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:39am
    2  ;;7.0;OUTPATIENT PHARMACY;**2,17,19,22,40,49,66,107,110,132,233,258,240**;DEC 1997;Build 5
     1PSOSD1 ;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
    33 ;External reference to ^PS(59.7 is supported by DBIA 694
    44 ;
     
    2525 D KVA^VADPT K DOD,FILL,DIC,PSCNT,PSDT,PCLASS,PHYS,ZCLASS,PSOPRINT,RXNODE,DIR,X1,X2,PSONUM,PSOPOLP,PSSN4
    2626 Q
    27  ; 
     27 ;
    2828DAYS 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."
    2929 D ^DIR Q:$D(DTOUT)!($D(DUOUT))  S PSDAYS=X K DIR S X1=DT,X2=-PSDAYS D C^%DTC S (PSDATE,PSDAY)=X
     
    8686 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"
    8787 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."
     88ASK D DAYS S PRF=PSODFN_"," D DEV I $D(ZTSK) S VALMSG="Action Profile Queued to Printer."
    9089 D EXIT K LM
    9190 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:17am
    2  ;;7.0;OUTPATIENT PHARMACY;**46,78,108,131,222,206**;DEC 1997;Build 39
     1PSOSIGMX ;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
    33 ;External reference to PS(55 supported by DBIA 2228
    44 ;External reference to PSDRUG( supported by DBIA 221
     
    3737 .I PSOCDEA["2"!(PSOCDEA["3")!(PSOCDEA["4")!(PSOCDEA["5") S PSOCSX=1
    3838 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)
    4040 .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)
    4141 I 'PSOCSX!('$G(PSOQX("DRUG"))) D
     
    4545 .S PSOMXPAT=$O(^YSCL(603.01,"C",+$G(PSOQX("PATIENT")),0)) I 'PSOMXPAT S PSOQX("MAX")=0 Q
    4646 .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) Q
     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) Q
    4848 .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")=0
     49 I $G(PSOQX("DRUG")) I PSOCDEA["A"&(PSOCDEA'["B")!(PSOCDEA["F") S PSOQX("MAX")=0
    5050 I PSONODD S PSOQX("DRUG")=0
    5151 Q
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOSUPOE.m

    r628 r636  
    11PSOSUPOE ;BIR/RTR - Suspense pull via Listman ;3/1/96
    2  ;;7.0;OUTPATIENT PHARMACY;**8,21,27,34,130,148,281**;DEC 1997;Build 41
     2 ;;7.0;OUTPATIENT PHARMACY;**8,21,27,34,130,148**;DEC 1997
    33 ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789
    44SEL I '$G(PSOCNT) S VALMSG="This patient has no Prescriptions!" S VALMBCK="" Q
     
    4141 . D ECMESND^PSOBPSU1(RXREC,RFL,,"PP")
    4242 . 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")
    4444 ;
    4545 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
     1PSOTPCAN ;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
    319 ;External reference to PS(55 supported by DBIA 2228
    420 ;External reference to VA(200 supported by DBIA 224
     
    114130 . S PSOTPWR1=$P($G(^PSRX(+$P(^PS(52.41,PSOTPWRN,0),"^",21),0)),"^",3)
    115131 . S PSOTPWR2=$P($G(^PS(53,+PSOTPWR1,0)),"^"),PSOTPWR3=$$UP^XLFSTR(PSOTPWR2)
    116  . I PSOTPWR3="NON-VA" D
     132 . I PSOTPWR3="NON-VA",DUZ("AG")="V" D  ; Skip for VOE sites
    117133 . . 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
    118134 . . Q
     
    120136 S PSOTPWR1=$P($G(^PS(55,+$P($G(^PS(52.41,PSOTPWRN,0)),"^",2),"PS")),"^")
    121137 S PSOTPWR2=$P($G(^PS(53,+PSOTPWR1,0)),"^") S PSOTPWR3=$$UP^XLFSTR(PSOTPWR2)
    122  I PSOTPWR3="NON-VA" D
     138 I PSOTPWR3="NON-VA",DUZ("AG")="V" D  ; Skip for VOE sites
    123139 .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
    124140 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:01am
    2  ;;7.0;OUTPATIENT PHARMACY;**35,186,218,259,206**;DEC 1997;Build 39
     1PSOUTLA1 ;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
    33 ;External reference to File ^PS(55 supported by DBIA 2228
    44 ;External reference to File ^PSDRUG supported by DBIA 221
     
    109109 ;
    110110 ;no refills if PSDEA = 'A' & not 'B' or 'F',
    111  I (PSDEA["A")&(PSDEA'["B")!(PSDEA["F")!(PSDEA[1)!(PSDEA[2) D  Q 1
     111 I (PSDEA["A")&(PSDEA'["B")!(PSDEA["F") D  Q 1
    112112 . S PSMAXRF=$$NUMFILLS(PSIRXN)
    113113 ;
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOVER1.m

    r628 r636  
    11PSOVER1 ;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 41
     2 ;;7.0;OUTPATIENT PHARMACY;**32,46,90,131,202,207,148,243,268**;DEC 1997;Build 9
    33 ;External reference ^PSDRUG( supported by DBIA 221
    44 ;External reference to PSOUL^PSSLOCK supported by DBIA 2789
     
    7878 . S ACTION="" D ECMESND^PSOBPSU1(PSONV,,,$S($O(^PSRX(PSONV,1,0)):"RF",1:"OF"))
    7979 . 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")
    8181 ;
    8282KILL 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 ; 05/26/08
     1PSOXZA ; DRIVER FOR COMPILED XREFS FOR FILE #52 ; 01/17/08
    22 ;
    33 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 ; 05/26/08
     1PSOXZA1 ; COMPILED XREF FOR FILE #52 ; 01/17/08
    22 ;
    33 S DIKZK=2
     
    7575 . S:$D(DIKIL) (X2,X2(1))=""
    7676 . K ^PSRX("APKI",$E(X,1,30),DA)
    77 CR3 S DIXR=461
     77CR3 S DIXR=476
    7878 K X
    7979 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 ; 05/26/08
     1PSOXZA10 ; COMPILED XREF FOR FILE #52.052311 ; 01/17/08
    22 ;
    33 S DA=0
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA11.m

    r628 r636  
    1 PSOXZA11 ; COMPILED XREF FOR FILE #52.1 ; 05/26/08
     1PSOXZA11 ; COMPILED XREF FOR FILE #52.1 ; 01/17/08
    22 ;
    33 S DA=0
     
    3030 S X=$P(DIKZ(0),U,18)
    3131 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=462
     32CR1 S DIXR=477
    3333 K X
    3434 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 ; 05/26/08
     1PSOXZA12 ; COMPILED XREF FOR FILE #52.2 ; 01/17/08
    22 ;
    33 S DA=0
     
    1616 S X=$P(DIKZ(0),U,19)
    1717 I X'="" S ^PSRX("AM",$E(X,1,30),DA(1),DA)=""
    18 CR1 S DIXR=463
     18CR1 S DIXR=478
    1919 K X
    2020 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 ; 05/26/08
     1PSOXZA13 ; COMPILED XREF FOR FILE #52.25 ; 01/17/08
    22 ;
    33 S DA=0
     
    1010 S X=$P(DIKZ(0),U,1)
    1111 I X'="" S ^PSRX(DA(1),"REJ","B",$E(X,1,30),DA)=""
    12 CR1 S DIXR=652
     12CR1 S DIXR=224
    1313 K X
    1414 S X(1)=$P(DIKZ(0),U,2)
     
    1717 . K X1,X2 M X1=X,X2=X
    1818 . S ^PSRX("REJDAT",X,DA(1),DA)=""
    19 CR2 S DIXR=653
     19CR2 S DIXR=225
    2020 K X
    2121 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 ; 05/26/08
     1PSOXZA14 ; COMPILED XREF FOR FILE #52.2551 ; 01/17/08
    22 ;
    33 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 ; 05/26/08
     1PSOXZA2 ; COMPILED XREF FOR FILE #52.01 ; 01/17/08
    22 ;
    33 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 ; 05/26/08
     1PSOXZA3 ; COMPILED XREF FOR FILE #52.052311 ; 01/17/08
    22 ;
    33 S DA=0
  • FOIAVistA/tag/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOXZA4.m

    r628 r636  
    1 PSOXZA4 ; COMPILED XREF FOR FILE #52.1 ; 05/26/08
     1PSOXZA4 ; COMPILED XREF FOR FILE #52.1 ; 01/17/08
    22 ;
    33 S DA=0
     
    3030 S X=$P(DIKZ(0),U,1)
    3131 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=462
     32CR1 S DIXR=477
    3333 K X
    3434 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 ; 05/26/08
     1PSOXZA5 ; COMPILED XREF FOR FILE #52.2 ; 01/17/08
    22 ;
    33 S DA=0
     
    1818 S X=$P(DIKZ(0),U,1)
    1919 I X'="" D:'$G(PSOSUSPA) PARKILL^PSOUTLA
    20 CR1 S DIXR=463
     20CR1 S DIXR=478
    2121 K X
    2222 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 ; 05/26/08
     1PSOXZA6 ; COMPILED XREF FOR FILE #52.25 ; 01/17/08
    22 ;
    33 S DA=0
     
    1010 S X=$P(DIKZ(0),U,1)
    1111 I X'="" K ^PSRX(DA(1),"REJ","B",$E(X,1,30),DA)
    12 CR1 S DIXR=652
     12CR1 S DIXR=224
    1313 K X
    1414 S X(1)=$P(DIKZ(0),U,2)
     
    1818 . S:$D(DIKIL) (X2,X2(1))=""
    1919 . K ^PSRX("REJDAT",X,DA(1),DA)
    20 CR2 S DIXR=653
     20CR2 S DIXR=225
    2121 K X
    2222 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 ; 05/26/08
     1PSOXZA7 ; COMPILED XREF FOR FILE #52.2551 ; 01/17/08
    22 ;
    33 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 ; 05/26/08
     1PSOXZA8 ; COMPILED XREF FOR FILE #52 ; 01/17/08
    22 ;
    33 S DIKZK=1
     
    7777 . K X1,X2 M X1=X,X2=X
    7878 . I +$P($G(^PSRX(DA,"PKI")),"^")=1 S ^PSRX("APKI",$E(X,1,30),DA)=""
    79 CR3 S DIXR=461
     79CR3 S DIXR=476
    8080 K X
    8181 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 ; 05/26/08
     1PSOXZA9 ; COMPILED XREF FOR FILE #52.01 ; 01/17/08
    22 ;
    33 S DA(1)=DA S DA=0
Note: See TracChangeset for help on using the changeset viewer.