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

PSAVIN.m

Go to the documentation of this file.
  1. PSAVIN ;BIR/LTL-Report of Inventory items' link to DRUG FILE ;7/23/97
  1. ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;**15**; 10/24/97
  1. ;
  1. ;References to $$DESCR^PRCPUX1 are covered by IA #259
  1. ;References to $$INVNAME^PRCPUX1 are covered by IA #259
  1. ;References to ^PSDRUG( are covered by IA #2095
  1. ;References to ^PSDRUG("AB" are covered by IA #2095
  1. ;References to ^PRCP( are covered by IA #214
  1. ;
  1. D DT^DICRW N DIR,DIRUT,X,Y,PSALOC,PSAOUT,DIC,DTOUT,DUOUT,PSAINV,PSAIT
  1. LOOK ;Select Inventory point
  1. S DIC="^PRCP(445,",DIC(0)="AEMQ",DIC("S")="I $P($G(^(0)),U,20)=""D""",PRCPPRIV=1 D ^DIC K DIC,PRCPPRIV S PSAINV=+Y,PSAIT=0 I Y<0 S PSAOUT=1 G QUIT
  1. I '$O(^PSD(58.8,"P",+PSAINV,0)) W !!,$$INVNAME^PRCPUX1(PSAINV)_" is NOT linked to a Drug Accountability Location.",!!
  1. S PSALOC=$O(^PSD(58.8,"P",+PSAINV,0)) W:PSALOC !!,$$INVNAME^PRCPUX1(PSAINV)_" is linked to",!!,$P($G(^PSD(58.8,+PSALOC,0)),U),!!
  1. DEV ;asks device and queueing info
  1. K IO("Q") N %ZIS,IOP,POP S %ZIS="Q" D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED!" S PSAOUT=1 G QUIT
  1. I $D(IO("Q")) N ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTDTH,ZTSK S ZTRTN="START^PSAVIN",ZTDESC="Inventory items link to DRUG FILE Report",ZTSAVE("PSA*")="" D ^%ZTLOAD,HOME^%ZIS S PSAOUT=1 G QUIT
  1. START N %DT,DIR,DIRUT,PSALN,PSAD,PSAPG,PSAOUT,PSARPDT,X,Y S (PSAPG,PSAOUT)=0,Y=DT D DD^%DT S PSARPDT=Y
  1. D HEADER
  1. LOOP F S PSAIT=$O(^PRCP(445,PSAINV,1,PSAIT)) Q:'PSAIT D:$Y+4>IOSL HEADER Q:PSAOUT D
  1. .W !!,PSAIT,?10,$E($$DESCR^PRCPUX1(PSAINV,PSAIT),1,33),?45,$E($S($P($G(^PSDRUG(+$O(^PSDRUG("AB",+PSAIT,0)),0)),U)]"":$P($G(^(0)),U),1:"NONE"),1,34)
  1. QUIT I $E(IOST)'="C" W @IOF
  1. I $E(IOST,1,2)="C-",'$G(PSAOUT) W !! S DIR(0)="EA",DIR("A")="END OF REPORT! Press <RET> to return to the menu." D ^DIR
  1. D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@" K IO("Q")
  1. Q
  1. I $E(IOST,1,2)'="P-",PSAPG S DIR(0)="E" D ^DIR K DIR I 'Y S PSAOUT=1 Q
  1. I $$S^%ZTLOAD W !!,"Task #",$G(ZTSK),", ",$G(ZTDESC)," was stopped by ",$P($G(^VA(200,+$G(DUZ),0)),U),"." S PSAOUT=1 Q
  1. W:$Y @IOF S $P(PSALN,"-",81)="",PSAPG=PSAPG+1 W !,$E($$INVNAME^PRCPUX1(PSAINV),1,23)_" Items' Link to DRUG file",?50,PSARPDT,?70,"PAGE: "_PSAPG,!,PSALN,!,"ITEM",?10,"DESCRIPTION",?45,"DRUG FILE LINK"
  1. Q