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

PSGWI016.m

Go to the documentation of this file.
  1. PSGWI016 ; ; 04-JAN-1994
  1. ;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
  1. Q:'DIFQ(58.19) 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. ;;^DIC(58.19,0,"GL")
  1. ;;=^PSI(58.19,
  1. ;;^DIC("B","PHARMACY AOU INVENTORY",58.19)
  1. ;;=
  1. ;;^DIC(58.19,"%",0)
  1. ;;=^1.005^1^1
  1. ;;^DIC(58.19,"%",1,0)
  1. ;;=PSGW
  1. ;;^DIC(58.19,"%","B","PSGW",1)
  1. ;;=
  1. ;;^DIC(58.19,"%D",0)
  1. ;;=^^8^8^2930816^^^^
  1. ;;^DIC(58.19,"%D",1,0)
  1. ;;=This file contains information that pertains to each individual inventory
  1. ;;^DIC(58.19,"%D",2,0)
  1. ;;=such as date/time of inventory, responsible employee, ID number, and
  1. ;;^DIC(58.19,"%D",3,0)
  1. ;;=inventory group.
  1. ;;^DIC(58.19,"%D",4,0)
  1. ;;=
  1. ;;^DIC(58.19,"%D",5,0)
  1. ;;=*** NOTE *** There is a cross-reference called "AINV" that is not
  1. ;;^DIC(58.19,"%D",6,0)
  1. ;;=VA FileMan compatible and has SACC exemption which allows its use.
  1. ;;^DIC(58.19,"%D",7,0)
  1. ;;=If you create any local cross-references for this file DO NOT use the
  1. ;;^DIC(58.19,"%D",8,0)
  1. ;;=name "AINV" as this will overwrite the existing cross-reference.
  1. ;;^DD(58.19,0)
  1. ;;=FIELD^^3^6
  1. ;;^DD(58.19,0,"DDA")
  1. ;;=N
  1. ;;^DD(58.19,0,"DT")
  1. ;;=2930714
  1. ;;^DD(58.19,0,"ID",1)
  1. ;;=W:$D(^("0")) " ",$S($D(^VA(200,+$P(^("0"),U,3),0))#2:$P(^(0),U,1),1:""),@("$E("_DIC_"Y,0),0)")
  1. ;;^DD(58.19,0,"ID",2)
  1. ;;=W:$D(^("0")) " ",$P(^("0"),U,2)
  1. ;;^DD(58.19,0,"ID","WRITE")
  1. ;;=S GRP=$P(^PSI(58.19,Y,0),U,4) W !,?6 F LP=2:1:($L(GRP,",")-1) S PC=$P(GRP,",",LP) W $S($D(^PSI(58.2,PC,0)):$P(^(0),U),1:"") W:LP<($L(GRP,",")-1) ", "
  1. ;;^DD(58.19,0,"IX","B",58.19,.01)
  1. ;;=
  1. ;;^DD(58.19,0,"NM","PHARMACY AOU INVENTORY")
  1. ;;=
  1. ;;^DD(58.19,0,"PT",58.12,.01)
  1. ;;=
  1. ;;^DD(58.19,.001,0)
  1. ;;=ID^NJ6,0^^ ^K:+X'=X!(X>999999)!(X<1)!(X?.E1"."1N.N) X
  1. ;;^DD(58.19,.001,3)
  1. ;;=Number that uniquely identifies this inventory.
  1. ;;^DD(58.19,.001,21,0)
  1. ;;=^^1^1^2871009^
  1. ;;^DD(58.19,.001,21,1,0)
  1. ;;=This contains a number that uniquely identifies this inventory.
  1. ;;^DD(58.19,.01,0)
  1. ;;=DATE/TIME FOR INVENTORY^RD^^0;1^S %DT="ESTX" D ^%DT S X=Y K:Y<1 X
  1. ;;^DD(58.19,.01,1,0)
  1. ;;=^.1^^-1
  1. ;;^DD(58.19,.01,1,2,0)
  1. ;;=^^TRIGGER^58.19^2
  1. ;;^DD(58.19,.01,1,2,1)
  1. ;;=K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(2)=$C(59)_$S($D(^DD(58.19,2,0)):$P(^(0),U,3),1:""),Y(1)=$S($D(^PSI(58.19,D0,0)):^(0),1:"") S X=$P($P(Y(2),$C(59)_$P(Y(1),U,2)_":",2),$C(59),1) S DIU=X K Y X ^DD(58.19,.01,1,2,1.1) X ^DD(58.19,.01,1,2,1.4)
  1. ;;^DD(58.19,.01,1,2,1.1)
  1. ;;=S X=DIV S X=DIV D DW^%DTC S X=X,Y(1)=X S X=1,Y(2)=X S X=3,X=$E(Y(1),Y(2),X)
  1. ;;^DD(58.19,.01,1,2,1.4)
  1. ;;=S DIH=$S($D(^PSI(58.19,DIV(0),0)):^(0),1:""),DIV=X S %=$P(DIH,U,3,999),^(0)=$P(DIH,U,1,1)_U_DIV_$S(%]"":U_%,1:""),DIH=58.19,DIG=2 D ^DICR:$N(^DD(DIH,DIG,1,0))>0
  1. ;;^DD(58.19,.01,1,2,2)
  1. ;;=Q
  1. ;;^DD(58.19,.01,1,2,"%D",0)
  1. ;;=^^2^2^2930827^
  1. ;;^DD(58.19,.01,1,2,"%D",1,0)
  1. ;;=This cross-reference sets the DAY OF THE WEEK (58.19,2) from the date
  1. ;;^DD(58.19,.01,1,2,"%D",2,0)
  1. ;;=selected.
  1. ;;^DD(58.19,.01,1,2,"CREATE VALUE")
  1. ;;=$E(DAYOFWEEK(#.01),1,3)
  1. ;;^DD(58.19,.01,1,2,"DELETE VALUE")
  1. ;;=NO EFFECT
  1. ;;^DD(58.19,.01,1,2,"FIELD")
  1. ;;=DAY
  1. ;;^DD(58.19,.01,1,3,0)
  1. ;;=^^TRIGGER^58.19^1
  1. ;;^DD(58.19,.01,1,3,1)
  1. ;;=K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^PSI(58.19,D0,0)):^(0),1:"") S X=$S('$D(^VA(200,+$P(Y(1),U,3),0)):"",1:$P(^(0),U,1)) S DIU=X K Y X ^DD(58.19,.01,1,3,1.1) X ^DD(58.19,.01,1,3,1.4)
  1. ;;^DD(58.19,.01,1,3,1.1)
  1. ;;=S X=DIV S X=$S($D(DUZ):DUZ,1:0) S X=X
  1. ;;^DD(58.19,.01,1,3,1.4)
  1. ;;=S DIH=$S($D(^PSI(58.19,DIV(0),0)):^(0),1:""),DIV=X X "F %=0:0 Q:$L($P(DIH,U,2,99)) S DIH=DIH_U" S %=$P(DIH,U,4,999),^(0)=$P(DIH,U,1,2)_U_DIV_$S(%]"":U_%,1:""),DIH=58.19,DIG=1 D ^DICR:$N(^DD(DIH,DIG,1,0))>0
  1. ;;^DD(58.19,.01,1,3,2)
  1. ;;=Q
  1. ;;^DD(58.19,.01,1,3,"%D",0)
  1. ;;=^^2^2^2930827^
  1. ;;^DD(58.19,.01,1,3,"%D",1,0)
  1. ;;=This cross-reference sets the field PERSON DOING INVENTORY (58.19,1)
  1. ;;^DD(58.19,.01,1,3,"%D",2,0)
  1. ;;=using the variable DUZ.
  1. ;;^DD(58.19,.01,1,3,"CREATE VALUE")
  1. ;;=USER#
  1. ;;^DD(58.19,.01,1,3,"DELETE VALUE")
  1. ;;=NO EFFECT
  1. ;;^DD(58.19,.01,1,3,"FIELD")
  1. ;;=PERSON
  1. ;;^DD(58.19,.01,1,4,0)
  1. ;;=58.19^B
  1. ;;^DD(58.19,.01,1,4,1)
  1. ;;=S ^PSI(58.19,"B",$E(X,1,30),DA)=""
  1. ;;^DD(58.19,.01,1,4,2)
  1. ;;=K ^PSI(58.19,"B",$E(X,1,30),DA)
  1. ;;^DD(58.19,.01,3)
  1. ;;=Enter date/time when inventory of ward(s) was taken.