- PSGWI006 ; ; 04-JAN-1994
- ;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
- 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
- Q Q
- ;;^DD(58.11,1,1,0)
- ;;=^.1
- ;;^DD(58.11,1,1,1,0)
- ;;=^^TRIGGER^58.11^11
- ;;^DD(58.11,1,1,1,1)
- ;;=K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(1)=$S($D(^PSI(58.1,D0,1,D1,0)):^(0),1:"") S X=$P(Y(1),U,5) S DIU=X K Y S X=DIV S X="Y" X ^DD(58.11,1,1,1,1.4)
- ;;^DD(58.11,1,1,1,1.4)
- ;;=S DIH=$S($D(^PSI(58.1,DIV(0),1,DIV(1),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.11,DIG=11 D ^DICR:$N(^DD(DIH,DIG,1,0))>0
- ;;^DD(58.11,1,1,1,2)
- ;;=Q
- ;;^DD(58.11,1,1,1,"%D",0)
- ;;=^^2^2^2930827^
- ;;^DD(58.11,1,1,1,"%D",1,0)
- ;;=This cross-reference sets a flag in the LEVEL CHG field (58.11,11) if
- ;;^DD(58.11,1,1,1,"%D",2,0)
- ;;=there has been any change to the stock level for an item.
- ;;^DD(58.11,1,1,1,"CREATE VALUE")
- ;;="Y"
- ;;^DD(58.11,1,1,1,"DELETE VALUE")
- ;;=NO EFFECT
- ;;^DD(58.11,1,1,1,"FIELD")
- ;;=LEVEL CHG
- ;;^DD(58.11,1,3)
- ;;=Type a whole number between 0 and 9999
- ;;^DD(58.11,1,21,0)
- ;;=^^2^2^2871008^^^^
- ;;^DD(58.11,1,21,1,0)
- ;;=This contains the quantity that is the required stock level for the item
- ;;^DD(58.11,1,21,2,0)
- ;;=in the Area of Use.
- ;;^DD(58.11,1,"DT")
- ;;=2850227
- ;;^DD(58.11,2,0)
- ;;=INVENTORY^58.12P^^1;0
- ;;^DD(58.11,2,21,0)
- ;;=^^2^2^2871008^^^^
- ;;^DD(58.11,2,21,1,0)
- ;;=This allows selection of inventory by entering a unique key of
- ;;^DD(58.11,2,21,2,0)
- ;;=DATE AND TIME.
- ;;^DD(58.11,3,0)
- ;;=TYPE OF INVENTORY^58.13PA^^2;0
- ;;^DD(58.11,3,12)
- ;;=Enter type for item
- ;;^DD(58.11,3,12.1)
- ;;=S DIC("S")="I $P(^(0),""^"",1)'=""ALL"""
- ;;^DD(58.11,5,0)
- ;;=WARD (FOR ITEM)^58.26PA^^4;0
- ;;^DD(58.11,10,0)
- ;;=LOCATION^F^^0;8^K:$L(X)>12!($L(X)<1) X
- ;;^DD(58.11,10,3)
- ;;=ANSWER MUST BE 1-12 CHARACTERS IN LENGTH
- ;;^DD(58.11,10,21,0)
- ;;=^^5^5^2871008^^^
- ;;^DD(58.11,10,21,1,0)
- ;;=This is the location address of the item in the Area of Use.
- ;;^DD(58.11,10,21,2,0)
- ;;=It can consist of up to 3 levels, each separated by a comma.
- ;;^DD(58.11,10,21,3,0)
- ;;=For example, "MR,CA,S3" or "CUR,CB,D1".
- ;;^DD(58.11,10,21,4,0)
- ;;=This information is used to sort items on inventory sheets and other
- ;;^DD(58.11,10,21,5,0)
- ;;=printouts.
- ;;^DD(58.11,10,"DT")
- ;;=2840619
- ;;^DD(58.11,11,0)
- ;;=LEVEL CHG^F^^0;5^K:$L(X)>10!($L(X)<1) X
- ;;^DD(58.11,11,3)
- ;;=Answer must be 1-10 characters in length
- ;;^DD(58.11,11,5,1,0)
- ;;=58.11^1^1
- ;;^DD(58.11,11,21,0)
- ;;=^^1^1^2871008^^
- ;;^DD(58.11,11,21,1,0)
- ;;=This contains the change in stock level for the item.
- ;;^DD(58.11,11,"DT")
- ;;=2841218
- ;;^DD(58.11,12,0)
- ;;=NON-STANDARD ITEM^S^1:YES;0:NO;^0;6^Q
- ;;^DD(58.11,12,21,0)
- ;;=^^4^4^2900209^^^
- ;;^DD(58.11,12,21,1,0)
- ;;=This identifies if an item is a standard stocked item in the Area
- ;;^DD(58.11,12,21,2,0)
- ;;=of Use or not. Enter 1 if the item is not a standard stocked item,
- ;;^DD(58.11,12,21,3,0)
- ;;=but is being added as an on-demand request. Enter 0 if the item is
- ;;^DD(58.11,12,21,4,0)
- ;;=a standard stocked item in the AOU.
- ;;^DD(58.11,12,"DT")
- ;;=2850208
- ;;^DD(58.11,13,0)
- ;;=REORDER LEVEL^NJ4,0^^0;11^K:+X'=X!(X>9999)!(X<0)!(X?.E1"."1N.N) X
- ;;^DD(58.11,13,3)
- ;;=Type a Number between 0 and 9999, 0 Decimal Digits
- ;;^DD(58.11,13,21,0)
- ;;=^^2^2^2881101^
- ;;^DD(58.11,13,21,1,0)
- ;;=This field contains the on-hand level that must be reached before an item
- ;;^DD(58.11,13,21,2,0)
- ;;=will have replacements dispensed.
- ;;^DD(58.11,13,"DT")
- ;;=2881101
- ;;^DD(58.11,14,0)
- ;;=MINIMUM QUANTITY TO DISPENSE^NJ4,0^^0;12^K:+X'=X!(X>9999)!(X<1)!(X?.E1"."1N.N) X
- ;;^DD(58.11,14,3)
- ;;=Type a Number between 1 and 9999, 0 Decimal Digits.
- ;;^DD(58.11,14,21,0)
- ;;=^^1^1^2910117^^^
- ;;^DD(58.11,14,21,1,0)
- ;;=This field contains the minimum quantity that will be dispensed of an item.
- ;;^DD(58.11,14,"DT")
- ;;=2910117
- ;;^DD(58.11,15,0)
- ;;=RETURNS^58.15D^^3;0
- ;;^DD(58.11,16,0)
- ;;=ON-DEMAND REQUEST DATE/TIME^58.28DA^^5;0
- ;;^DD(58.11,30,0)
- ;;=INACTIVATION DATE^D^^0;3^S %DT="EX" D ^%DT S X=Y K:Y<1 X
- ;;^DD(58.11,30,1,0)
- ;;=^.1
- ;;^DD(58.11,30,1,1,0)
- ;;=58.11^AC^MUMPS
- ;;^DD(58.11,30,1,1,1)
- ;;=S ^PSI(58.1,DA(1),1,DA,"I",X)=""
- PSGWI006 ; ; 04-JAN-1994
- +1 ;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
- +2 IF 'DIFQ(58.1)
- QUIT
- FOR I=1:2
- SET X=$TEXT(Q+I)
- IF X=""
- QUIT
- SET Y=$EXTRACT($TEXT(Q+I+1),4,999)
- SET X=$EXTRACT(X,4,999)
- IF $ASCII(Y)=126
- SET I=I+1
- SET Y=$EXTRACT(Y,2,999)_$EXTRACT($TEXT(Q+I+1),5,99)
- IF $ASCII(Y)=61
- SET Y=$EXTRACT(Y,2,999)
- XECUTE NO
- IF '$TEST
- SET @X=Y
- Q QUIT
- +1 ;;^DD(58.11,1,1,0)
- +2 ;;=^.1
- +3 ;;^DD(58.11,1,1,1,0)
- +4 ;;=^^TRIGGER^58.11^11
- +5 ;;^DD(58.11,1,1,1,1)
- +6 ;;=K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(1)=$S($D(^PSI(58.1,D0,1,D1,0)):^(0),1:"") S X=$P(Y(1),U,5) S DIU=X K Y S X=DIV S X="Y" X ^DD(58.11,1,1,1,1.4)
- +7 ;;^DD(58.11,1,1,1,1.4)
- +8 ;;=S DIH=$S($D(^PSI(58.1,DIV(0),1,DIV(1),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.11,DIG=11 D ^DICR:$N(^DD(DIH,DIG,1,0))>0
- +9 ;;^DD(58.11,1,1,1,2)
- +10 ;;=Q
- +11 ;;^DD(58.11,1,1,1,"%D",0)
- +12 ;;=^^2^2^2930827^
- +13 ;;^DD(58.11,1,1,1,"%D",1,0)
- +14 ;;=This cross-reference sets a flag in the LEVEL CHG field (58.11,11) if
- +15 ;;^DD(58.11,1,1,1,"%D",2,0)
- +16 ;;=there has been any change to the stock level for an item.
- +17 ;;^DD(58.11,1,1,1,"CREATE VALUE")
- +18 ;;="Y"
- +19 ;;^DD(58.11,1,1,1,"DELETE VALUE")
- +20 ;;=NO EFFECT
- +21 ;;^DD(58.11,1,1,1,"FIELD")
- +22 ;;=LEVEL CHG
- +23 ;;^DD(58.11,1,3)
- +24 ;;=Type a whole number between 0 and 9999
- +25 ;;^DD(58.11,1,21,0)
- +26 ;;=^^2^2^2871008^^^^
- +27 ;;^DD(58.11,1,21,1,0)
- +28 ;;=This contains the quantity that is the required stock level for the item
- +29 ;;^DD(58.11,1,21,2,0)
- +30 ;;=in the Area of Use.
- +31 ;;^DD(58.11,1,"DT")
- +32 ;;=2850227
- +33 ;;^DD(58.11,2,0)
- +34 ;;=INVENTORY^58.12P^^1;0
- +35 ;;^DD(58.11,2,21,0)
- +36 ;;=^^2^2^2871008^^^^
- +37 ;;^DD(58.11,2,21,1,0)
- +38 ;;=This allows selection of inventory by entering a unique key of
- +39 ;;^DD(58.11,2,21,2,0)
- +40 ;;=DATE AND TIME.
- +41 ;;^DD(58.11,3,0)
- +42 ;;=TYPE OF INVENTORY^58.13PA^^2;0
- +43 ;;^DD(58.11,3,12)
- +44 ;;=Enter type for item
- +45 ;;^DD(58.11,3,12.1)
- +46 ;;=S DIC("S")="I $P(^(0),""^"",1)'=""ALL"""
- +47 ;;^DD(58.11,5,0)
- +48 ;;=WARD (FOR ITEM)^58.26PA^^4;0
- +49 ;;^DD(58.11,10,0)
- +50 ;;=LOCATION^F^^0;8^K:$L(X)>12!($L(X)<1) X
- +51 ;;^DD(58.11,10,3)
- +52 ;;=ANSWER MUST BE 1-12 CHARACTERS IN LENGTH
- +53 ;;^DD(58.11,10,21,0)
- +54 ;;=^^5^5^2871008^^^
- +55 ;;^DD(58.11,10,21,1,0)
- +56 ;;=This is the location address of the item in the Area of Use.
- +57 ;;^DD(58.11,10,21,2,0)
- +58 ;;=It can consist of up to 3 levels, each separated by a comma.
- +59 ;;^DD(58.11,10,21,3,0)
- +60 ;;=For example, "MR,CA,S3" or "CUR,CB,D1".
- +61 ;;^DD(58.11,10,21,4,0)
- +62 ;;=This information is used to sort items on inventory sheets and other
- +63 ;;^DD(58.11,10,21,5,0)
- +64 ;;=printouts.
- +65 ;;^DD(58.11,10,"DT")
- +66 ;;=2840619
- +67 ;;^DD(58.11,11,0)
- +68 ;;=LEVEL CHG^F^^0;5^K:$L(X)>10!($L(X)<1) X
- +69 ;;^DD(58.11,11,3)
- +70 ;;=Answer must be 1-10 characters in length
- +71 ;;^DD(58.11,11,5,1,0)
- +72 ;;=58.11^1^1
- +73 ;;^DD(58.11,11,21,0)
- +74 ;;=^^1^1^2871008^^
- +75 ;;^DD(58.11,11,21,1,0)
- +76 ;;=This contains the change in stock level for the item.
- +77 ;;^DD(58.11,11,"DT")
- +78 ;;=2841218
- +79 ;;^DD(58.11,12,0)
- +80 ;;=NON-STANDARD ITEM^S^1:YES;0:NO;^0;6^Q
- +81 ;;^DD(58.11,12,21,0)
- +82 ;;=^^4^4^2900209^^^
- +83 ;;^DD(58.11,12,21,1,0)
- +84 ;;=This identifies if an item is a standard stocked item in the Area
- +85 ;;^DD(58.11,12,21,2,0)
- +86 ;;=of Use or not. Enter 1 if the item is not a standard stocked item,
- +87 ;;^DD(58.11,12,21,3,0)
- +88 ;;=but is being added as an on-demand request. Enter 0 if the item is
- +89 ;;^DD(58.11,12,21,4,0)
- +90 ;;=a standard stocked item in the AOU.
- +91 ;;^DD(58.11,12,"DT")
- +92 ;;=2850208
- +93 ;;^DD(58.11,13,0)
- +94 ;;=REORDER LEVEL^NJ4,0^^0;11^K:+X'=X!(X>9999)!(X<0)!(X?.E1"."1N.N) X
- +95 ;;^DD(58.11,13,3)
- +96 ;;=Type a Number between 0 and 9999, 0 Decimal Digits
- +97 ;;^DD(58.11,13,21,0)
- +98 ;;=^^2^2^2881101^
- +99 ;;^DD(58.11,13,21,1,0)
- +100 ;;=This field contains the on-hand level that must be reached before an item
- +101 ;;^DD(58.11,13,21,2,0)
- +102 ;;=will have replacements dispensed.
- +103 ;;^DD(58.11,13,"DT")
- +104 ;;=2881101
- +105 ;;^DD(58.11,14,0)
- +106 ;;=MINIMUM QUANTITY TO DISPENSE^NJ4,0^^0;12^K:+X'=X!(X>9999)!(X<1)!(X?.E1"."1N.N) X
- +107 ;;^DD(58.11,14,3)
- +108 ;;=Type a Number between 1 and 9999, 0 Decimal Digits.
- +109 ;;^DD(58.11,14,21,0)
- +110 ;;=^^1^1^2910117^^^
- +111 ;;^DD(58.11,14,21,1,0)
- +112 ;;=This field contains the minimum quantity that will be dispensed of an item.
- +113 ;;^DD(58.11,14,"DT")
- +114 ;;=2910117
- +115 ;;^DD(58.11,15,0)
- +116 ;;=RETURNS^58.15D^^3;0
- +117 ;;^DD(58.11,16,0)
- +118 ;;=ON-DEMAND REQUEST DATE/TIME^58.28DA^^5;0
- +119 ;;^DD(58.11,30,0)
- +120 ;;=INACTIVATION DATE^D^^0;3^S %DT="EX" D ^%DT S X=Y K:Y<1 X
- +121 ;;^DD(58.11,30,1,0)
- +122 ;;=^.1
- +123 ;;^DD(58.11,30,1,1,0)
- +124 ;;=58.11^AC^MUMPS
- +125 ;;^DD(58.11,30,1,1,1)
- +126 ;;=S ^PSI(58.1,DA(1),1,DA,"I",X)=""