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

ENXIP60.m

Go to the documentation of this file.
  1. ENXIP60 ;WCIOFO/SAB- PATCH INSTALL ROUTINE ;12/17/1998
  1. ;;7.0;ENGINEERING;**60**;Aug 17, 1993
  1. Q
  1. ;
  1. PS ;Post Install Entry Point
  1. N ENX
  1. ;
  1. ; only perform during 1st install
  1. I $$PATCH^XPDUTL("EN*7.0*60") D BMES^XPDUTL(" Skipping post install since patch was previously installed.") Q
  1. ;
  1. ; create KIDS checkpoints with call backs
  1. F ENX="FRDOC" D
  1. . S Y=$$NEWCP^XPDUTL(ENX,ENX_"^ENXIP60")
  1. . I 'Y D BMES^XPDUTL("ERROR Creating "_ENX_" Checkpoint.")
  1. Q
  1. ;
  1. FRDOC ; Transmit FR Documents for all assets currently reported to FAP
  1. ; so XAREA (CMR) value will be populated in FAP
  1. N ENAMT,ENC,ENDA,ENFUND,ENSGL,ENSTA,ENT,ENX
  1. ;
  1. D BMES^XPDUTL(" Generating FR Documents to update FAP with CMR values...")
  1. ;
  1. ; estimate count of equipment to examine
  1. S ENC("TOT")=$P($G(^ENG(6915.2,0)),U,4)-$P($G(^ENG(6915.5,0)),U,4)
  1. I ENC("TOT")<1 S ENC("TOT")=1
  1. S ENC("EQ")=0 ; count of evaluated equipment
  1. S XPDIDTOT=ENC("TOT") ; set total for status bar
  1. S ENC("UPD")=5 ; initial % required to update status bar
  1. ;
  1. ; loop thru equipment in FA DOCUMENT LOG file
  1. S ENDA=0 F S ENDA=$O(^ENG(6915.2,"B",ENDA)) Q:'ENDA D
  1. . Q:+$$CHKFA^ENFAUTL(ENDA)'>0 ; not currently reported to FAP
  1. . ;
  1. . S ENC("EQ")=ENC("EQ")+1
  1. . S ENC("%")=ENC("EQ")*100/ENC("TOT") ; calculate % complete
  1. . ; check if status bar should be updated
  1. . I ENC("%")>ENC("UPD"),ENC("%")<100 D
  1. . . D UPDATE^XPDID(ENC("EQ")) ; update status bar
  1. . . S ENC("UPD")=ENC("UPD")+5 ; increase update criteria by 5%
  1. . ;
  1. . ; generate an FR Document
  1. . S ENX=$$XFR(ENDA)
  1. . I 'ENX D Q
  1. . . N ENI,ENX
  1. . . D MES^XPDUTL("ERROR: Couldn't create FR Doc. for ENTRY # "_ENDA)
  1. . . Q:'$D(^TMP($J,"BAD",ENDA)) ; don't know reasons
  1. . . ; List Problems with Equipment/Document
  1. . . ; Input
  1. . . ; ENDA - equipment entry #
  1. . . ; ^TMP($J,"BAD",ENDA) - number of problems
  1. . . ; ^TMP($J,"BAD",ENDA,seqn #) - description of a problem
  1. . . F ENI=1:1:^TMP($J,"BAD",ENDA) D
  1. . . . D MES^XPDUTL(" "_^TMP($J,"BAD",ENDA,ENI))
  1. . . K ^TMP($J,"BAD",ENDA)
  1. . ;
  1. . ; update FR Document counter (append space to force alpha sort)
  1. . S ENSTA=$$GET1^DIQ(6914,ENDA_",",60)_" " S:ENSTA=" " ENSTA="UNK"
  1. . S ENT(ENSTA)=$G(ENT(ENSTA))+1
  1. ;
  1. ; report results
  1. S ENX=" Summary report of FR Documents generated by the patch:"
  1. D BMES^XPDUTL(ENX)
  1. S ENX=" Station Count"
  1. D BMES^XPDUTL(ENX)
  1. S ENX=" ------- -----"
  1. D MES^XPDUTL(ENX)
  1. S ENT=0
  1. S ENSTA="" F S ENSTA=$O(ENT(ENSTA)) Q:ENSTA="" D
  1. . S ENX=" "_$$LJ^XLFSTR(ENSTA,10)_$J(ENT(ENSTA),5)
  1. . D MES^XPDUTL(ENX)
  1. . S ENT=ENT+ENT(ENSTA)
  1. S ENX=" ======= ====="
  1. D MES^XPDUTL(ENX)
  1. S ENX=" "_$$LJ^XLFSTR("total",10)_$J(ENT,5)
  1. D MES^XPDUTL(ENX)
  1. Q
  1. ;
  1. XFR(ENDA) ; Transmit FR Document
  1. ; input ENDA - equipment entry
  1. ; returns 1 if success or if failed
  1. ; output ^TMP($J,"BAD",equipment entry
  1. ; will be defined if the document failed validation
  1. ;
  1. N DA,ENBAT,ENDO,ENEQ,ENFA,ENFAP,ENFR,ENX,I
  1. S ENEQ("DA")=ENDA
  1. S ENBAT("SILENT")=1
  1. S ENX=$$CHKFA^ENFAUTL(ENEQ("DA"))
  1. S ENFA("DA")=$P(ENX,U,4)
  1. F I=1,2,3,8,9 S ENEQ(I)=$G(^ENG(6914,ENEQ("DA"),I))
  1. ; create FR document
  1. S ENDO=1,ENFR("DA")=""
  1. D ADDFR^ENFAXFR
  1. D:ENDO
  1. . ; populate FR Document with existing data from equipment file
  1. . S ENFAP(100)=$G(^ENG(6915.6,ENFR("DA"),100))
  1. . S $P(ENFAP(100),U,2)=$P(ENEQ(9),U,7) ; fund (required)
  1. . S $P(ENFAP(100),U,3)=$P(ENEQ(9),U,8) ; a/o (required)
  1. . S $P(ENFAP(100),U,5)=$P(ENEQ(9),U,6) ; boc (deleted when blank sent)
  1. . S $P(ENFAP(100),U,6)=$P(ENEQ(2),U,9) ; cmr (determines cost cr, xarea)
  1. . S ^ENG(6915.6,ENFR("DA"),100)=ENFAP(100)
  1. D:ENDO CVTDATA^ENFAXFR
  1. D:ENDO
  1. . S ENFAP("DOC")="FR" D ^ENFAVAL
  1. . I $D(^TMP($J,"BAD",ENEQ("DA"))) S ENDO=0
  1. I 'ENDO,$G(ENFR("DA"))]"" D
  1. . S DA=ENFR("DA"),DIK="^ENG(6915.6," D ^DIK K DIK
  1. D:ENDO UPDATE^ENFAXFR
  1. I $G(ENFR("DA"))]"" L -^ENG(6915.6,ENFR("DA"))
  1. Q ENDO
  1. ;
  1. ;ENXIP57