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

PSGWI009.m

Go to the documentation of this file.
  1. PSGWI009 ; ; 04-JAN-1994
  1. ;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
  1. Q:'DIFQ(58.1) F I=1:2 S X=$T(Q+I) Q:X="" S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,99) S:$A(Y)=61 Y=$E(Y,2,999) X NO E S @X=Y
  1. Q Q
  1. ;;^DD(58.12,1,"DT")
  1. ;;=2850227
  1. ;;^DD(58.12,3,0)
  1. ;;=COMPILED INTO AMIS?^S^1:YES;0:NO;^0;4^Q
  1. ;;^DD(58.12,3,.1)
  1. ;;=COMPILED FLAG
  1. ;;^DD(58.12,3,21,0)
  1. ;;=^^5^5^2910221^^^^
  1. ;;^DD(58.12,3,21,1,0)
  1. ;;=A TaskMan background routine ^PSGWUAS (option PSGW UPDATE AMIS STATS) runs
  1. ;;^DD(58.12,3,21,2,0)
  1. ;;=each night. As the data for an inventory transaction is completed, this
  1. ;;^DD(58.12,3,21,3,0)
  1. ;;="COMPILED FLAG" will be set to "1". This will enable the cross-reference
  1. ;;^DD(58.12,3,21,4,0)
  1. ;;=^PSI(58.5,"AMIS") to be recompiled via the option PSGW RE-INDEX AMIS or
  1. ;;^DD(58.12,3,21,5,0)
  1. ;;=via VA FileMan should the need arise.
  1. ;;^DD(58.12,3,"DT")
  1. ;;=2880126
  1. ;;^DD(58.12,3.5,0)
  1. ;;=ON HAND^NJ4,0^^0;6^K:+X'=X!(X>9999)!(X<0)!(X?.E1"."1N.N) X
  1. ;;^DD(58.12,3.5,1,0)
  1. ;;=^.1
  1. ;;^DD(58.12,3.5,1,1,0)
  1. ;;=^^TRIGGER^58.12^4
  1. ;;^DD(58.12,3.5,1,1,1)
  1. ;;=Q:$D(DIU(0)) K DIV S DIV=X,D0=DA(2),DIV(0)=D0,D1=DA(1),DIV(1)=D1,D2=DA,DIV(2)=D2 S Y(1)=$S($D(^PSI(58.1,D0,1,D1,1,D2,0)):^(0),1:"") S X=$P(Y(1),U,5) S DIU=X K Y X ^DD(58.12,3.5,1,1,1.1) X ^DD(58.12,3.5,1,1,1.4)
  1. ;;^DD(58.12,3.5,1,1,1,9.2)
  1. ;;=S Y(1)=$S($D(^PSI(58.1,D0,1,D1,1,D2,0)):^(0),1:"") S X=DIV<$P(Y(1),U,2),Y(2)=X,Y(3)=X S X=$P(Y(1),U,2),Y(4)=X S X=DIV,Y=X,X=Y(4),X=X-Y,Y(5)=X S X=1,Y(6)=X S X=0
  1. ;;^DD(58.12,3.5,1,1,1.1)
  1. ;;=S X=DIV X ^DD(58.12,3.5,1,1,1,9.2) S X=$S(Y(2):Y(5),Y(6):X)
  1. ;;^DD(58.12,3.5,1,1,1.4)
  1. ;;=S DIH=$S($D(^PSI(58.1,DIV(0),1,DIV(1),1,DIV(2),0)):^(0),1:""),DIV=X X "F %=0:0 Q:$L($P(DIH,U,4,99)) S DIH=DIH_U" S %=$P(DIH,U,6,999),DIU=$P(DIH,U,5),^(0)=$P(DIH,U,1,4)_U_DIV_$S(%]"":U_%,1:""),DIH=58.12,DIG=4 D ^DICR:$N(^DD(DIH,DIG,1,0))>0
  1. ;;^DD(58.12,3.5,1,1,2)
  1. ;;=Q
  1. ;;^DD(58.12,3.5,1,1,"%D",0)
  1. ;;=^^5^5^2930827^
  1. ;;^DD(58.12,3.5,1,1,"%D",1,0)
  1. ;;=This cross-reference sets the value of the field DISPENSING QUANTITY
  1. ;;^DD(58.12,3.5,1,1,"%D",2,0)
  1. ;;=(58.12,4) for sites that are NOT merging their pick lists and inventory
  1. ;;^DD(58.12,3.5,1,1,"%D",3,0)
  1. ;;=sheets. This value will be calculated using the following logic:
  1. ;;^DD(58.12,3.5,1,1,"%D",4,0)
  1. ;;=ON HAND<STOCK LEVEL then DISPENSE QUANTITY=STOCK LEVEL-ON HAND
  1. ;;^DD(58.12,3.5,1,1,"%D",5,0)
  1. ;;=ON HAND>or=STOCK LEVEL then DISPENSE QUANTITY=zero
  1. ;;^DD(58.12,3.5,1,1,"CREATE VALUE")
  1. ;;=$S((ON-HAND)<LEVEL:(LEVEL-(ON-HAND)),1:0)
  1. ;;^DD(58.12,3.5,1,1,"DELETE VALUE")
  1. ;;=NO EFFECT
  1. ;;^DD(58.12,3.5,1,1,"FIELD")
  1. ;;=DISPENSE
  1. ;;^DD(58.12,3.5,3)
  1. ;;=Type a whole number between 0 and 9999
  1. ;;^DD(58.12,3.5,21,0)
  1. ;;=^^1^1^2871008^^^
  1. ;;^DD(58.12,3.5,21,1,0)
  1. ;;=This contains the quantity of the item currently in the Area of Use.
  1. ;;^DD(58.12,3.5,"DT")
  1. ;;=2850718
  1. ;;^DD(58.12,4,0)
  1. ;;=DISPENSE QUANTITY^NJ4,0^^0;5^K:+X'=X!(X>9999)!(X<0)!(X?.E1"."1N.N) X
  1. ;;^DD(58.12,4,1,0)
  1. ;;=^.1
  1. ;;^DD(58.12,4,1,1,0)
  1. ;;=58.12^AMIS^MUMPS
  1. ;;^DD(58.12,4,1,1,1)
  1. ;;=Q:$D(PSGWV) D QD^PSGWUTL
  1. ;;^DD(58.12,4,1,1,2)
  1. ;;=Q:$D(PSGWV) D KQD^PSGWUTL
  1. ;;^DD(58.12,4,1,1,"%D",0)
  1. ;;=^^4^4^2930811^
  1. ;;^DD(58.12,4,1,1,"%D",1,0)
  1. ;;=This cross-reference is set everytime a quantity greater than zero is
  1. ;;^DD(58.12,4,1,1,"%D",2,0)
  1. ;;=dispensed for a stock item. The nightly job "Update AMIS Stats File" will
  1. ;;^DD(58.12,4,1,1,"%D",3,0)
  1. ;;=process this cross-reference and store the data in the AR/WS Stats File
  1. ;;^DD(58.12,4,1,1,"%D",4,0)
  1. ;;=(#58.5). After the cross-reference is processed, it is deleted.
  1. ;;^DD(58.12,4,1,2,0)
  1. ;;=58.12^AMISERR^MUMPS
  1. ;;^DD(58.12,4,1,2,1)
  1. ;;=Q:$D(PSGWV) D QDERR^PSGWUTL
  1. ;;^DD(58.12,4,1,2,2)
  1. ;;=Q:$D(PSGWV) D KQDERR^PSGWUTL
  1. ;;^DD(58.12,4,1,2,"%D",0)
  1. ;;=^^5^5^2930811^
  1. ;;^DD(58.12,4,1,2,"%D",1,0)
  1. ;;=This cross-reference is set by the nightly job "Update AMIS Stats file"
  1. ;;^DD(58.12,4,1,2,"%D",2,0)
  1. ;;=if an AMIS transaction is found to have invalid or missing Inpatient
  1. ;;^DD(58.12,4,1,2,"%D",3,0)
  1. ;;=Site data. Existence of this cross-reference will cause a MailMan message
  1. ;;^DD(58.12,4,1,2,"%D",4,0)
  1. ;;=to be sent to holders of the PSGWMGR security key informing them of the
  1. ;;^DD(58.12,4,1,2,"%D",5,0)
  1. ;;=invalid or missing data.
  1. ;;^DD(58.12,4,3)
  1. ;;=Type a Number between 0 and 9999, 0 Decimal Digits.