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

ENXIP68.m

Go to the documentation of this file.
  1. ENXIP68 ;WCIOFO/SAB-PATCH INSTALL ROUTINE ;2/8/2001
  1. ;;7.0;ENGINEERING;**68**;Aug 17, 1993
  1. Q
  1. ;
  1. PS ; post-install entry point
  1. ; create KIDS checkpoints with call backs
  1. N ENX,Y
  1. F ENX="OBC" D
  1. . S Y=$$NEWCP^XPDUTL(ENX,ENX_"^ENXIP68")
  1. . I 'Y D BMES^XPDUTL("ERROR Creating "_ENX_" Checkpoint.")
  1. Q
  1. ;
  1. OBC ; Move ORIGINAL BAR CODE ID data (post-install)
  1. N ENC,ENDA,ENOBC,XPDIDTOT,DA,DIK
  1. ;
  1. ; If field 28.1 not ORIGINAL BAR CODE ID then already done
  1. I $$GET1^DID(6914,28.1,"","LABEL")'="ORIGINAL BAR CODE ID" D Q
  1. . D BMES^XPDUTL(" ORIGINAL BAR CODE ID data already processed. Skipping step.")
  1. ;
  1. I '$D(^ENG(6914,"OEE")) D
  1. .D BMES^XPDUTL(" No ORIGINAL BAR CODE ID data to move. Skipping step.")
  1. E D
  1. . ; must be some data to move
  1. . ; loop through file 6914 - move data from 28.1 into new multiple
  1. . D BMES^XPDUTL(" Moving ORIGINAL BAR CODE ID data in file 6914...")
  1. . ; init variables
  1. . S ENC("TOT")=$P($G(^ENG(6914,0)),U,4) ; total # of items to process
  1. . I ENC("TOT")=0 S ENC("TOT")=1 ; avoid divide by zero error
  1. . S ENC("EQU")=0 ; count of evaluated items
  1. . S ENC("OBC")=0 ; count of ORIGINAL BAR CODE IDs moved
  1. . S XPDIDTOT=ENC("TOT") ; set total for status bar
  1. . S ENC("UPD")=5 ; initial % required to update status bar
  1. . ; loop thru equipment
  1. . S ENDA=0 F S ENDA=$O(^ENG(6914,ENDA)) Q:'ENDA D
  1. . . S ENC("EQU")=ENC("EQU")+1
  1. . . S ENC("%")=ENC("EQU")*100/ENC("TOT") ; calculate % complete
  1. . . ; check if status bar should be updated
  1. . . I ENC("%")>ENC("UPD") D
  1. . . . D UPDATE^XPDID(ENC("EQU")) ; update status bar
  1. . . . S ENC("UPD")=ENC("UPD")+5 ; increase update criteria by 5%
  1. . . ; get single valued ORIGINAL BAR CODE ID
  1. . . S ENOBC=$P($G(^ENG(6914,ENDA,3)),U,14)
  1. . . Q:ENOBC="" ; nothing to move
  1. . . Q:$O(^ENG(6914,ENDA,12,0)) ; unexpected - value in multiple
  1. . . ; put original bar code id in multiple field
  1. . . S ^ENG(6914,ENDA,12,0)="^6914.05^1^1"
  1. . . S ^ENG(6914,ENDA,12,1,0)=ENOBC
  1. . . S ^ENG(6914,ENDA,12,"B",ENOBC,1)=""
  1. . . ; delete modifier from old location
  1. . . S $P(^ENG(6914,ENDA,3),U,14)=""
  1. . . K ^ENG(6914,"OEE",ENOBC,ENDA)
  1. . . ; set whole file x-ref for new multiple
  1. . . S ^ENG(6914,"OEE",ENOBC,ENDA,1)=""
  1. . . ; increment counter
  1. . . S ENC("OBC")=ENC("OBC")+1
  1. . ;
  1. . ; report results
  1. . D MES^XPDUTL(" "_ENC("OBC")_" ORIGINAL BAR CODE IDs were moved.")
  1. ;
  1. ; delete field 28.1 from data dictionary
  1. S DIK="^DD(6914,",DA=28.1,DA(1)=6914 D ^DIK
  1. ;
  1. Q
  1. ;
  1. ;ENXIP68