Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSOCPPRE

PSOCPPRE.m

Go to the documentation of this file.
  1. PSOCPPRE ;BIR/SAB - enhanced dup drug checker for copy orders ;09/21/06 11:34am
  1. ;;7.0;OUTPATIENT PHARMACY;**251,375,387**;DEC 1997;Build 13
  1. ;External references PSOL and PSOUL^PSSLOCK supported by DBIA 2789
  1. ;External references to ^ORRDI1 controlled subscription supported by DBIA 4659
  1. ;External references to ^XTMP("ORRDI" supported by DBIA 4660
  1. ;External references to ^PSSHRQ2 supported by DBIA 5369
  1. S LIST="PSOPEP",$P(PSONULN,"-",79)="-",(STA,DNM)="" N PSODLQT
  1. F S STA=$O(PSOSD(STA)) Q:STA="" F S DNM=$O(PSOSD(STA,DNM)) Q:DNM="" D Q:$G(PSORX("DFLG"))
  1. .I STA="PENDING" D ^PSODDPR1 Q
  1. .I STA="ZNONVA" D NVA^PSODDPR1 Q
  1. .D:PSODRUG("NAME")=$P(DNM,"^")&('$D(^XUSEC("PSORPH",DUZ))) Q:$G(PSORX("DFLG"))
  1. ..I $P($G(PSOPAR),"^",16) D DUP^PSODDPRE Q:$G(PSORX("DFLG"))
  1. ..I $P(PSOPAR,"^",2),'$P($G(PSOPAR),"^",16) D DUP^PSODDPRE Q:$G(PSORX("DFLG"))
  1. ..I '$P(PSOPAR,"^",2),'$P($G(PSOPAR),"^",16) D DUP^PSODDPRE Q:$G(PSORX("DFLG"))
  1. .D:PSODRUG("NAME")=$P(DNM,"^")&($D(^XUSEC("PSORPH",DUZ))) DUP^PSODDPRE
  1. Q:$G(PSORX("DFLG"))
  1. D HD^PSODDPR2():(($Y+5)'>IOSL)
  1. D REMOTE
  1. Q
  1. OBX S LIST="PSOPEPS"
  1. K ^TMP($J,"DD"),^TMP($J,"DC"),^TMP($J,"DI"),PSODLQT,DTOUT,DUOUT,DIRUT,PSODOSD
  1. K HZVA,ZVA,ZORS,ZZDGDG,ON,DRG,SV,DGI,PSORX("INTERVENE"),DIR,ZTHER,IT
  1. K DIR I $P(^TMP($J,LIST,"OUT",0),"^")=-1 G EXIT
  1. K ^TMP($J,LIST,"IN","PING"),^TMP($J,LIST,"OUT","DRUGDRUG"),^TMP($J,LIST,"OUT","THERAPY")
  1. W !,"Now Processing Enhanced Order Checks! Please wait...",! H 2
  1. D FDB^PSODDPRE S PDRG=PSODRUG("IEN"),DO=0 D REMOTE^PSODDPR4
  1. D IN^PSSHRQ2(LIST) ;if patient has meds
  1. ;
  1. K DIR
  1. I $P(^TMP($J,LIST,"OUT",0),"^")=-1 D DATACK^PSODDPRE G EXIT
  1. D ^PSODDPR2 ;if order checks returned
  1. ;
  1. EXIT ;
  1. I $G(PSODLQT)!$G(PSORX("DFLG")) S PSODOSD=1
  1. D ^PSOBUILD K CAN,DA,DIR,DNM,DUPRX0,ISSD,J,LSTFL,MSG,PHYS,PSOCLC,PSONULN,REA,RFLS,RX0,RX2,RXREC,ST,Y,ZZ,ACT,PSOCLOZ,PSOLR,PSOLDT,PSOCD,SIG
  1. K ^TMP($J,LIST,"IN","PING"),^TMP($J,LIST,"OUT","DRUGDRUG"),^TMP($J,LIST,"OUT","THERAPY"),^TMP($J,"PSOPEPS"),^TMP($J,"PSORDI")
  1. K DO,LIST,DNM,PSONULN,PSORX("DFLG"),RXRECCOP,STA,Y,PSODLQT
  1. K HZVA,ZVA,ZORS,ZZDGDG,ON,DRG,SV,DGI,PSORX("INTERVENE"),DIR,ZTHER,IT
  1. S VALMBCK="R"
  1. Q
  1. ULRX ;
  1. I '$G(RXRECCOP) Q
  1. D PSOUL^PSSLOCK(RXRECCOP)
  1. Q
  1. ;
  1. REMOTE ;
  1. I $T(HAVEHDR^ORRDI1)']"" Q
  1. I '$$HAVEHDR^ORRDI1 Q
  1. I $D(^XTMP("ORRDI","OUTAGE INFO","DOWN")) G REMOTE2
  1. D HD^PSODDPR2():(($Y+5)'>IOSL)
  1. W !!,"Now doing remote order checks. Please wait...",!
  1. D REMOTE^PSOORRDI(PSODFN,PSODRUG("IEN"))
  1. D HD^PSODDPR2():(($Y+5)'>IOSL)
  1. I '$D(^XUSEC("PSORPH",DUZ)),$P(PSOPAR,"^",2),$G(PSOTECCK) G REMOTE2
  1. I $D(^TMP($J,"DD")) D DUP^PSOORRD2
  1. REMOTE2 ;
  1. K ^TMP($J,"DD"),^TMP($J,"DC"),^TMP($J,"DI")
  1. Q