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

PSACON.m

Go to the documentation of this file.
  1. PSACON ;BIR/LTL-Display Connected Drug and Procurement History ;7/23/97
  1. ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;**15**; 10/24/97
  1. ;References to $$DESCR^PRCPUX1 are covered by IA #259
  1. ;References to ^DIC(51.5 are covered by IA #1931
  1. ;References to $$NSN^PRCPUX1 are covered by IA #259
  1. ;References to $$UNITCODE^PRCPUX1 are covered by IA #259
  1. ;References to $$UNITVAL^PRCPUX1 are covered by IA #259
  1. ;References to $$VENNAME^PRCPUX1 are covered by IA #259
  1. ;References to ^PSDRUG( are covered by IA #2095
  1. ;References to ^PRC( are covered by IA #214
  1. ;References to ^PRCP( are covered by IA #214
  1. ;
  1. N DA,DIC,DTOUT,DUOUT,PSA,PSACON,PSAW,X,Y
  1. D DT^DICRW
  1. F S DIC="^PSDRUG(",DIC(0)="AEMQZ",DIC("S")="I $S('$D(^(""I"")):1,+^(""I"")>DT:1,1:0)",DIC("W")="W:'$O(^(441,0)) ?65,""NOT CONNECTED""" W ! D ^DIC K DA,DIC G:Y<0 END S PSA=+Y D G:Y<0 END G:$G(PSAW) ^PSACONW D:$G(PSACON) ^PSACON1 D ^PSACON2
  1. .W @IOF,!!,$P($G(^PSDRUG(+PSA,0)),U),!!,?25,"** FROM THE DRUG FILE **",!!
  1. .W "FSN: ",$P($G(^PSDRUG(+PSA,0)),U,6),?40,"NDC: ",$P($G(^PSDRUG(+PSA,2)),U,4),!!
  1. .S PSA(5)=$S($P($G(^PSDRUG(+PSA,660)),U,5):$P($G(^(660)),U,5),1:1)
  1. .S PSA(6)=$P($G(^DIC(51.5,+$P($G(^PSDRUG(+PSA,660)),U,2),0)),U)
  1. .W "PACKAGING: ",PSA(5),"/",PSA(6)
  1. .S PSA(8)=$P($G(^PSDRUG(+PSA,660)),U,8)
  1. .W ?20,"PRICE: $",$P($G(^PSDRUG(+PSA,660)),U,3),"/",PSA(6)
  1. .W ?40,"PRICE/DISPENSE UNIT: $",$P($G(^PSDRUG(+PSA,660)),U,6),"/",PSA(8)
  1. .S PSA(15)=$O(^PSDRUG(+PSA,441,0)),PSA(1)=$G(^(+PSA(15),0))
  1. .;more than one item linked
  1. .D:$O(^PSDRUG(+PSA,441,PSA(15))) Q:Y<0 K DIC,DA
  1. ..W !!,"There is more than one item linked to this drug.",!
  1. ..S DIC="^PSDRUG(+PSA,441,",DIC(0)="AEQ",DA(1)=+PSA
  1. ..S DIC("W")="W ?10,$$DESCR^PRCPUX1(0,$G(^(0)))"
  1. ..D ^DIC Q:Y<0 S PSA(1)=$G(^PSDRUG(+PSA,441,+Y,0)) K DIC,DA
  1. .I 'PSA(1) S Y=-1 Q
  1. .D:PSA(1) Q:$D(DTOUT)!($D(DUOUT))
  1. ..W !!?25,"<< FROM THE ITEM MASTER FILE >>",!!
  1. ..S PSA(11)=$G(^PRC(441,+PSA(1),0))
  1. ..W "ITEM #: ",PSA(1),?15,$$DESCR^PRCPUX1(0,PSA(1)),!!
  1. ..W "NSN: ",$$NSN^PRCPUX1(PSA(1))
  1. ..I $P($G(^PRC(440,+$P(PSA(11),U,8),0)),U,11)="S" S PSAW=$O(^PRCP(445,"AC","W","")) Q
  1. ..S PSA(3)=$O(^PRC(441,+PSA(1),2,0))
  1. ..I PSA(3)&('$O(^PRC(441,+PSA(1),2,+PSA(3)))) D Q
  1. ...W ?40,"ONLY VENDOR: ",$E($$VENNAME^PRCPUX1(+PSA(3)_"PRC(440"),1,28),!!
  1. ...S PSA(33)=$G(^PRC(441,+PSA(1),2,+PSA(3),0))
  1. ...W "VENDOR STOCK #: ",$P(PSA(33),U,4)
  1. ...W ?40,"NDC: ",$P(PSA(33),U,5),!!
  1. ...W "PACKAGING: ",$$UNITVAL^PRCPUX1($P(PSA(33),U,8),$P(PSA(33),U,7))
  1. ...W ?20,"PRICE: $",$P(PSA(33),U,2),"/",$$UNITCODE^PRCPUX1($P(PSA(33),U,7))
  1. ...W ?40,"PRICE/DISPENSE UNIT: $",$P(PSA(33),U,2)/PSA(5)
  1. ...W !!,"MINIMUM ORDER: ",$P(PSA(33),U,12)
  1. ...S Y=$P(PSA(33),U,6) X ^DD("DD")
  1. ...S Y=$E(Y,1,4)_$S($L(Y)=10:$E(Y,7,10),$L(Y)=11:$E(Y,8,11),1:"")
  1. ...W ?20,"PRICE DATE: ",Y
  1. ...W ?40,"REQUIRED ORDER MULTIPLE: ",$P(PSA(33),U,11),!!
  1. ..W !!,"LAST VENDOR ORDERED: ",$$VENNAME^PRCPUX1($P(PSA(11),U,4)_"PRC(440"),!!
  1. ..W "MANDATORY SOURCE: ",$$VENNAME^PRCPUX1($P(PSA(11),U,8)_"PRC(440"),!
  1. ..K IO("Q") N %ZIS,IOP,POP S %ZIS="Q",%ZIS("A")="For Vendor listing, please select DEVICE: " D ^%ZIS I POP S DTOUT=1,Y=-1 W !,"NO DEVICE SELECTED OR OUTPUT PRINTED!" Q
  1. ..I $D(IO("Q")) N ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTDTH,ZTSK S ZTRTN="^PSACON1",ZTDESC="DRUG VENDORS",ZTSAVE("PSA*")="" D ^%ZTLOAD,HOME^%ZIS S Y=1 Q
  1. ..S (DTOUT,PSACON)=1 Q
  1. END K PSAOUT Q