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

ENEQMED1.m

Go to the documentation of this file.
  1. ENEQMED1 ;WISC/SAB-Multiple Equipment Edit, Continued ;5/19/1998
  1. ;;7.0;ENGINEERING;**35,39,51**;Aug 17, 1993
  1. FLD ; get fields and values
  1. ; dic("s") contains national fields that can be edited and also
  1. ; allows any local fields (Y>1000) to be selected
  1. W !
  1. S DIC="^DD(6914,",DIC(0)="AQE"
  1. I ENFA D
  1. . W !,"Note: Some fields can not be modified because one or more of the"
  1. . W !,"selected equipment items are reported to Fixed Assets (FMS)."
  1. . S DIC("S")="I Y>1000!(""^1^2^3^4^5^6^10^11^12.5^13.5^14^17^19.5^19.6^20^21^24^25^26^27^33^40^51^52^53^70^""[(U_Y_U))"
  1. I 'ENFA S DIC("S")="I Y>1000!(""^1^2^3^4^5^6^7^10^11^12^12.5^13^13.5^14^^15^16^17^18^19^19.5^19.6^20^20.1^20.5^21^22^24^25^26^27^31^32^33^34^35^38^40^51^52^53^60^61^62^63^64^70^""[(U_Y_U))"
  1. D ^DIC K DIC G:$D(DTOUT)!$D(DUOUT) EXIT G:Y'>0 FLDEND
  1. S ENFLD=+Y,ENFLDN=$P(Y,U,2)
  1. K ^TMP($J,"ENFLD",ENFLD)
  1. ; special handling for serial #, nxrn #, va pm number, replacing
  1. I "^5^17^25^51^"[(U_ENFLD_U) D G:$D(DIRUT) EXIT G FLD
  1. . W !,"This option requires that the ",ENFLDN," be individually entered"
  1. . W !,"for each equipment item."
  1. . S DIR(0)="Y",DIR("B")="NO"
  1. . S DIR("A")="Should "_ENFLDN_" be asked for each of the "_ENC("SEL")_" items"
  1. . D ^DIR K DIR I 'Y W !,ENFLDN," will not be changed." Q
  1. . S ^TMP($J,"ENFLD",ENFLD)=""
  1. ; special handling for parent system, location, local identifier
  1. I "^2^24^26^"[(U_ENFLD_U) D G:$D(DIRUT) EXIT G:Y FLD
  1. . W !,ENFLDN," can be individually entered for each equipment item."
  1. . S DIR(0)="Y",DIR("B")="NO"
  1. . S DIR("A")="Should "_ENFLDN_" be asked for each of the "_ENC("SEL")_" items"
  1. . D ^DIR K DIR Q:$D(DIRUT) I Y S ^TMP($J,"ENFLD",ENFLD)=""
  1. ; special handling for comments wp
  1. I "^40^"[(U_ENFLD_U) D G FLD
  1. . K ^TMP($J,"ENCOM")
  1. . S DIC="^TMP($J,""ENCOM"",",DIWESUB="COMMENTS" D EN^DIWE K DIWESUB
  1. . I $D(^TMP($J,"ENCOM")) S ^TMP($J,"ENFLD",ENFLD)="^TMP($J,""ENCOM"","
  1. ; special handling for spex wp
  1. I "^70^"[(U_ENFLD_U) D G FLD
  1. . I '$D(^XUSEC("ENEDSPEX",DUZ)) D Q
  1. . . W $C(7),!,"Can't edit SPEX. Security key ENEDSPEX is required."
  1. . K ^TMP($J,"ENSPEX")
  1. . S DIC="^TMP($J,""ENSPEX"",",DIWESUB="SPEX" D EN^DIWE K DIWESUB
  1. . I $D(^TMP($J,"ENSPEX")) S ^TMP($J,"ENFLD",ENFLD)="^TMP($J,""ENSPEX"","
  1. ; special handling fields requiring ENEDNX key
  1. I 'ENEDNX,ENNX,"^7^12^12.5^18^19^20.1^33^34^35^36^38^52^60^61^62^63^64^"[(U_ENFLD_U) D G FLD
  1. . W $C(7),!,ENFLDN," can not be modified because some of the selected"
  1. . W !,"equipment items are NX and you do not hold security key ENEDNX."
  1. VAL ;
  1. K DA S DA=ENDAT,DIR(0)="6914,"_ENFLD
  1. D ^DIR K DIR G:$D(DTOUT) EXIT I $D(DUOUT) W !,ENFLDN," will not be changed." G FLD
  1. S ENVALI=$P(Y,U)
  1. S ENVALE=$P($G(Y(0)),U) S:ENVALE']"" ENVALE=$P(Y,U)
  1. I X="@" D
  1. . S DIR(0)="Y",DIR("A")="Do you want to delete "_ENFLDN
  1. . D ^DIR K DIR Q:$D(DIRUT) I Y S ENVALI="@",ENVALE="(deleted)"
  1. I ENVALI']"" W !,"You must enter a value (or '^' to skip field)" G VAL
  1. S ^TMP($J,"ENFLD",ENFLD)=ENVALI_U_ENVALE
  1. G FLD
  1. FLDEND ;
  1. ; special handling for PM data
  1. I $D(^XUSEC("ENEDPM",DUZ)) D G:$D(DIRUT) EXIT
  1. . S DIR(0)="Y",DIR("B")="NO"
  1. . S DIR("A")="Do you want to replace any existing PM data"
  1. . D ^DIR K DIR Q:$D(DIRUT)!'Y
  1. . S ENCATI=$P($G(^TMP($J,"ENFLD",6)),U)
  1. . I ENCATI="" D
  1. . . S ENC("CAT")=0
  1. . . F ENI=1:1 S ENL=$P(ENL("SEL"),",",ENI) Q:'ENL D Q:ENC("CAT")>1
  1. . . . I $P(ENL(ENL),U),ENCATI'=$P(ENL(ENL),U) S ENCATI=$P(ENL(ENL),U),ENC("CAT")=ENC("CAT")+1
  1. . . I ENC("CAT")'=1 S ENCATI=""
  1. . S ^ENG(6914,ENDAT,1)=ENCATI
  1. . S DIE=6914,DA=ENDAT,ENXP=2 D XNPMSE^ENEQPMP
  1. . K ENA,ENB,ENDA,ENDTYP,ENDVTYP,ENSH,ENSHOP
  1. . S ^TMP($J,"ENFLD",30)=ENDAT
  1. I '$D(^TMP($J,"ENFLD")) D G:Y FLD G EXIT
  1. . W !,"No fields were specified!"
  1. . S DIR(0)="Y",DIR("A")="Do you want to modify some fields"
  1. . S DIR("B")="YES" D ^DIR K DIR
  1. ; get values for individually asked fields (if any)
  1. S ENASK=0
  1. S ENFLD=0 F S ENFLD=$O(^TMP($J,"ENFLD",ENFLD)) Q:'ENFLD!ENASK I ^(ENFLD)="" S ENASK="1"
  1. I ENASK W !,"Now enter data for fields which are asked for each item."
  1. I ENASK S ENDA=0 F S ENDA=$O(^TMP($J,"ENSEL",ENDA)) Q:'ENDA D G:$D(DIRUT) EXIT
  1. . W !!,"CONTROL #: ",ENDA
  1. . S ENFLD=0
  1. . F S ENFLD=$O(^TMP($J,"ENFLD",ENFLD)) Q:'ENFLD I ^(ENFLD)="" D Q:$D(DIRUT)
  1. . . S ENFLDN=$$GET1^DID(6914,ENFLD,"","LABEL")
  1. . . S ENGOT=0 F D Q:ENGOT!$D(DTOUT)!$D(DUOUT)
  1. . . . K DA S DA=ENDA S DIR(0)="6914,"_ENFLD
  1. . . . D ^DIR K DIR Q:$D(DTOUT)!$D(DUOUT)
  1. . . . S ENVALI=$P(Y,U)
  1. . . . S ENVALE=$P($G(Y(0)),U) S:ENVALE']"" ENVALE=$P(Y,U)
  1. . . . I X="@" D
  1. . . . . S DIR(0)="Y",DIR("A")="Do you want to delete "_ENFLDN
  1. . . . . D ^DIR K DIR Q:$D(DIRUT) I Y S ENVALI="@",ENVALE="(deleted)"
  1. . . . I ENVALI']"" D I Y!$D(DIRUT) Q
  1. . . . . S DIR(0)="Y",DIR("B")="YES"
  1. . . . . S DIR("A")="Do you want to enter a "_ENFLDN_" for this item"
  1. . . . . D ^DIR K DIR
  1. . . . I ENFLD=25,ENVALI]"",ENVALI'="@" D Q:ENI ; unique VA PM NUMBER
  1. . . . . S ENI=0
  1. . . . . F S ENI=$O(^TMP($J,"ENFLD",25,ENI)) Q:'ENI Q:$P($G(^(ENI)),U)=ENVALI
  1. . . . . I ENI W $C(7),!,"IN USE (Entry Number: ",ENI,")"
  1. . . . S ^TMP($J,"ENFLD",ENFLD,ENDA)=ENVALI_U_ENVALE
  1. . . . S ENGOT=1
  1. G UPD^ENEQMED2
  1. EXIT ;
  1. G EXIT^ENEQMED2
  1. ;ENEQMED1