ENXUIPS ;WIRMFO/SAB- POST-INIT ;1/8/97
;;7.0;ENGINEERING;**41**;Aug 17, 1993
N DA,ENDA,ENMFG,ENX
D BMES^XPDUTL(" Searching local entries for duplicate MFG/DIV...")
K ^TMP($J)
S ENDA=49999 F S ENDA=$O(^ENG("MFG",ENDA)) Q:'ENDA D
. S ENMFG=$P($G(^ENG("MFG",ENDA,0)),U) Q:ENMFG=""
. S DA=0 F S DA=$O(^ENG("MFG","B",$E(ENMFG,1,30),DA)) Q:'DA D
. . I DA'=ENDA,$P($G(^ENG("MFG",DA,0)),U)=ENMFG S ^TMP($J,ENMFG,DA)=""
. I $D(^TMP($J,ENMFG)) S ^TMP($J,ENMFG,ENDA)=""
I '$D(^TMP($J)) D MES^XPDUTL(" No duplicate MFG/DIVs were found.")
I $D(^TMP($J)) D
. D MES^XPDUTL(" Duplicate MFG/DIVs were found.")
. D MES^XPDUTL(" You can use the FileMan ENTER OR EDIT FILE ENTRIES")
. D MES^XPDUTL(" option to delete a Local entry and change all")
. D MES^XPDUTL(" pointers to reference the corresponding National")
. D MES^XPDUTL(" entry. Use the MFGID number to select enties.")
. S ENMFG="" F S ENMFG=$O(^TMP($J,ENMFG)) Q:ENMFG="" D
. . D BMES^XPDUTL(" Duplicate MFGR: "_ENMFG)
. . S DA=0 F S DA=$O(^TMP($J,ENMFG,DA)) Q:'DA D
. . . S ENX=" "_$S(DA<50000:"National",1:"Local")_" MFGID: "_DA
. . . D MES^XPDUTL(ENX)
K ^TMP($J)
Q
;ENXUIPS
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENXUIPS 1205 printed Dec 13, 2024@01:57:07 Page 2
ENXUIPS ;WIRMFO/SAB- POST-INIT ;1/8/97
+1 ;;7.0;ENGINEERING;**41**;Aug 17, 1993
+2 NEW DA,ENDA,ENMFG,ENX
+3 DO BMES^XPDUTL(" Searching local entries for duplicate MFG/DIV...")
+4 KILL ^TMP($JOB)
+5 SET ENDA=49999
FOR
SET ENDA=$ORDER(^ENG("MFG",ENDA))
if 'ENDA
QUIT
Begin DoDot:1
+6 SET ENMFG=$PIECE($GET(^ENG("MFG",ENDA,0)),U)
if ENMFG=""
QUIT
+7 SET DA=0
FOR
SET DA=$ORDER(^ENG("MFG","B",$EXTRACT(ENMFG,1,30),DA))
if 'DA
QUIT
Begin DoDot:2
+8 IF DA'=ENDA
IF $PIECE($GET(^ENG("MFG",DA,0)),U)=ENMFG
SET ^TMP($JOB,ENMFG,DA)=""
End DoDot:2
+9 IF $DATA(^TMP($JOB,ENMFG))
SET ^TMP($JOB,ENMFG,ENDA)=""
End DoDot:1
+10 IF '$DATA(^TMP($JOB))
DO MES^XPDUTL(" No duplicate MFG/DIVs were found.")
+11 IF $DATA(^TMP($JOB))
Begin DoDot:1
+12 DO MES^XPDUTL(" Duplicate MFG/DIVs were found.")
+13 DO MES^XPDUTL(" You can use the FileMan ENTER OR EDIT FILE ENTRIES")
+14 DO MES^XPDUTL(" option to delete a Local entry and change all")
+15 DO MES^XPDUTL(" pointers to reference the corresponding National")
+16 DO MES^XPDUTL(" entry. Use the MFGID number to select enties.")
+17 SET ENMFG=""
FOR
SET ENMFG=$ORDER(^TMP($JOB,ENMFG))
if ENMFG=""
QUIT
Begin DoDot:2
+18 DO BMES^XPDUTL(" Duplicate MFGR: "_ENMFG)
+19 SET DA=0
FOR
SET DA=$ORDER(^TMP($JOB,ENMFG,DA))
if 'DA
QUIT
Begin DoDot:3
+20 SET ENX=" "_$SELECT(DA<50000:"National",1:"Local")_" MFGID: "_DA
+21 DO MES^XPDUTL(ENX)
End DoDot:3
End DoDot:2
End DoDot:1
+22 KILL ^TMP($JOB)
+23 QUIT
+24 ;ENXUIPS