- ENXIP60 ;WCIOFO/SAB- PATCH INSTALL ROUTINE ;12/17/1998
- ;;7.0;ENGINEERING;**60**;Aug 17, 1993
- Q
- ;
- PS ;Post Install Entry Point
- N ENX
- ;
- ; only perform during 1st install
- I $$PATCH^XPDUTL("EN*7.0*60") D BMES^XPDUTL(" Skipping post install since patch was previously installed.") Q
- ;
- ; create KIDS checkpoints with call backs
- F ENX="FRDOC" D
- . S Y=$$NEWCP^XPDUTL(ENX,ENX_"^ENXIP60")
- . I 'Y D BMES^XPDUTL("ERROR Creating "_ENX_" Checkpoint.")
- Q
- ;
- FRDOC ; Transmit FR Documents for all assets currently reported to FAP
- ; so XAREA (CMR) value will be populated in FAP
- N ENAMT,ENC,ENDA,ENFUND,ENSGL,ENSTA,ENT,ENX
- ;
- D BMES^XPDUTL(" Generating FR Documents to update FAP with CMR values...")
- ;
- ; estimate count of equipment to examine
- S ENC("TOT")=$P($G(^ENG(6915.2,0)),U,4)-$P($G(^ENG(6915.5,0)),U,4)
- I ENC("TOT")<1 S ENC("TOT")=1
- S ENC("EQ")=0 ; count of evaluated equipment
- S XPDIDTOT=ENC("TOT") ; set total for status bar
- S ENC("UPD")=5 ; initial % required to update status bar
- ;
- ; loop thru equipment in FA DOCUMENT LOG file
- S ENDA=0 F S ENDA=$O(^ENG(6915.2,"B",ENDA)) Q:'ENDA D
- . Q:+$$CHKFA^ENFAUTL(ENDA)'>0 ; not currently reported to FAP
- . ;
- . S ENC("EQ")=ENC("EQ")+1
- . S ENC("%")=ENC("EQ")*100/ENC("TOT") ; calculate % complete
- . ; check if status bar should be updated
- . I ENC("%")>ENC("UPD"),ENC("%")<100 D
- . . D UPDATE^XPDID(ENC("EQ")) ; update status bar
- . . S ENC("UPD")=ENC("UPD")+5 ; increase update criteria by 5%
- . ;
- . ; generate an FR Document
- . S ENX=$$XFR(ENDA)
- . I 'ENX D Q
- . . N ENI,ENX
- . . D MES^XPDUTL("ERROR: Couldn't create FR Doc. for ENTRY # "_ENDA)
- . . Q:'$D(^TMP($J,"BAD",ENDA)) ; don't know reasons
- . . ; List Problems with Equipment/Document
- . . ; Input
- . . ; ENDA - equipment entry #
- . . ; ^TMP($J,"BAD",ENDA) - number of problems
- . . ; ^TMP($J,"BAD",ENDA,seqn #) - description of a problem
- . . F ENI=1:1:^TMP($J,"BAD",ENDA) D
- . . . D MES^XPDUTL(" "_^TMP($J,"BAD",ENDA,ENI))
- . . K ^TMP($J,"BAD",ENDA)
- . ;
- . ; update FR Document counter (append space to force alpha sort)
- . S ENSTA=$$GET1^DIQ(6914,ENDA_",",60)_" " S:ENSTA=" " ENSTA="UNK"
- . S ENT(ENSTA)=$G(ENT(ENSTA))+1
- ;
- ; report results
- S ENX=" Summary report of FR Documents generated by the patch:"
- D BMES^XPDUTL(ENX)
- S ENX=" Station Count"
- D BMES^XPDUTL(ENX)
- S ENX=" ------- -----"
- D MES^XPDUTL(ENX)
- S ENT=0
- S ENSTA="" F S ENSTA=$O(ENT(ENSTA)) Q:ENSTA="" D
- . S ENX=" "_$$LJ^XLFSTR(ENSTA,10)_$J(ENT(ENSTA),5)
- . D MES^XPDUTL(ENX)
- . S ENT=ENT+ENT(ENSTA)
- S ENX=" ======= ====="
- D MES^XPDUTL(ENX)
- S ENX=" "_$$LJ^XLFSTR("total",10)_$J(ENT,5)
- D MES^XPDUTL(ENX)
- Q
- ;
- XFR(ENDA) ; Transmit FR Document
- ; input ENDA - equipment entry
- ; returns 1 if success or if failed
- ; output ^TMP($J,"BAD",equipment entry
- ; will be defined if the document failed validation
- ;
- N DA,ENBAT,ENDO,ENEQ,ENFA,ENFAP,ENFR,ENX,I
- S ENEQ("DA")=ENDA
- S ENBAT("SILENT")=1
- S ENX=$$CHKFA^ENFAUTL(ENEQ("DA"))
- S ENFA("DA")=$P(ENX,U,4)
- F I=1,2,3,8,9 S ENEQ(I)=$G(^ENG(6914,ENEQ("DA"),I))
- ; create FR document
- S ENDO=1,ENFR("DA")=""
- D ADDFR^ENFAXFR
- D:ENDO
- . ; populate FR Document with existing data from equipment file
- . S ENFAP(100)=$G(^ENG(6915.6,ENFR("DA"),100))
- . S $P(ENFAP(100),U,2)=$P(ENEQ(9),U,7) ; fund (required)
- . S $P(ENFAP(100),U,3)=$P(ENEQ(9),U,8) ; a/o (required)
- . S $P(ENFAP(100),U,5)=$P(ENEQ(9),U,6) ; boc (deleted when blank sent)
- . S $P(ENFAP(100),U,6)=$P(ENEQ(2),U,9) ; cmr (determines cost cr, xarea)
- . S ^ENG(6915.6,ENFR("DA"),100)=ENFAP(100)
- D:ENDO CVTDATA^ENFAXFR
- D:ENDO
- . S ENFAP("DOC")="FR" D ^ENFAVAL
- . I $D(^TMP($J,"BAD",ENEQ("DA"))) S ENDO=0
- I 'ENDO,$G(ENFR("DA"))]"" D
- . S DA=ENFR("DA"),DIK="^ENG(6915.6," D ^DIK K DIK
- D:ENDO UPDATE^ENFAXFR
- I $G(ENFR("DA"))]"" L -^ENG(6915.6,ENFR("DA"))
- Q ENDO
- ;
- ;ENXIP57
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENXIP60 3949 printed Mar 13, 2025@21:01:30 Page 2
- ENXIP60 ;WCIOFO/SAB- PATCH INSTALL ROUTINE ;12/17/1998
- +1 ;;7.0;ENGINEERING;**60**;Aug 17, 1993
- +2 QUIT
- +3 ;
- PS ;Post Install Entry Point
- +1 NEW ENX
- +2 ;
- +3 ; only perform during 1st install
- +4 IF $$PATCH^XPDUTL("EN*7.0*60")
- DO BMES^XPDUTL(" Skipping post install since patch was previously installed.")
- QUIT
- +5 ;
- +6 ; create KIDS checkpoints with call backs
- +7 FOR ENX="FRDOC"
- Begin DoDot:1
- +8 SET Y=$$NEWCP^XPDUTL(ENX,ENX_"^ENXIP60")
- +9 IF 'Y
- DO BMES^XPDUTL("ERROR Creating "_ENX_" Checkpoint.")
- End DoDot:1
- +10 QUIT
- +11 ;
- FRDOC ; Transmit FR Documents for all assets currently reported to FAP
- +1 ; so XAREA (CMR) value will be populated in FAP
- +2 NEW ENAMT,ENC,ENDA,ENFUND,ENSGL,ENSTA,ENT,ENX
- +3 ;
- +4 DO BMES^XPDUTL(" Generating FR Documents to update FAP with CMR values...")
- +5 ;
- +6 ; estimate count of equipment to examine
- +7 SET ENC("TOT")=$PIECE($GET(^ENG(6915.2,0)),U,4)-$PIECE($GET(^ENG(6915.5,0)),U,4)
- +8 IF ENC("TOT")<1
- SET ENC("TOT")=1
- +9 ; count of evaluated equipment
- SET ENC("EQ")=0
- +10 ; set total for status bar
- SET XPDIDTOT=ENC("TOT")
- +11 ; initial % required to update status bar
- SET ENC("UPD")=5
- +12 ;
- +13 ; loop thru equipment in FA DOCUMENT LOG file
- +14 SET ENDA=0
- FOR
- SET ENDA=$ORDER(^ENG(6915.2,"B",ENDA))
- if 'ENDA
- QUIT
- Begin DoDot:1
- +15 ; not currently reported to FAP
- if +$$CHKFA^ENFAUTL(ENDA)'>0
- QUIT
- +16 ;
- +17 SET ENC("EQ")=ENC("EQ")+1
- +18 ; calculate % complete
- SET ENC("%")=ENC("EQ")*100/ENC("TOT")
- +19 ; check if status bar should be updated
- +20 IF ENC("%")>ENC("UPD")
- IF ENC("%")<100
- Begin DoDot:2
- +21 ; update status bar
- DO UPDATE^XPDID(ENC("EQ"))
- +22 ; increase update criteria by 5%
- SET ENC("UPD")=ENC("UPD")+5
- End DoDot:2
- +23 ;
- +24 ; generate an FR Document
- +25 SET ENX=$$XFR(ENDA)
- +26 IF 'ENX
- Begin DoDot:2
- +27 NEW ENI,ENX
- +28 DO MES^XPDUTL("ERROR: Couldn't create FR Doc. for ENTRY # "_ENDA)
- +29 ; don't know reasons
- if '$DATA(^TMP($JOB,"BAD",ENDA))
- QUIT
- +30 ; List Problems with Equipment/Document
- +31 ; Input
- +32 ; ENDA - equipment entry #
- +33 ; ^TMP($J,"BAD",ENDA) - number of problems
- +34 ; ^TMP($J,"BAD",ENDA,seqn #) - description of a problem
- +35 FOR ENI=1:1:^TMP($JOB,"BAD",ENDA)
- Begin DoDot:3
- +36 DO MES^XPDUTL(" "_^TMP($JOB,"BAD",ENDA,ENI))
- End DoDot:3
- +37 KILL ^TMP($JOB,"BAD",ENDA)
- End DoDot:2
- QUIT
- +38 ;
- +39 ; update FR Document counter (append space to force alpha sort)
- +40 SET ENSTA=$$GET1^DIQ(6914,ENDA_",",60)_" "
- if ENSTA=" "
- SET ENSTA="UNK"
- +41 SET ENT(ENSTA)=$GET(ENT(ENSTA))+1
- End DoDot:1
- +42 ;
- +43 ; report results
- +44 SET ENX=" Summary report of FR Documents generated by the patch:"
- +45 DO BMES^XPDUTL(ENX)
- +46 SET ENX=" Station Count"
- +47 DO BMES^XPDUTL(ENX)
- +48 SET ENX=" ------- -----"
- +49 DO MES^XPDUTL(ENX)
- +50 SET ENT=0
- +51 SET ENSTA=""
- FOR
- SET ENSTA=$ORDER(ENT(ENSTA))
- if ENSTA=""
- QUIT
- Begin DoDot:1
- +52 SET ENX=" "_$$LJ^XLFSTR(ENSTA,10)_$JUSTIFY(ENT(ENSTA),5)
- +53 DO MES^XPDUTL(ENX)
- +54 SET ENT=ENT+ENT(ENSTA)
- End DoDot:1
- +55 SET ENX=" ======= ====="
- +56 DO MES^XPDUTL(ENX)
- +57 SET ENX=" "_$$LJ^XLFSTR("total",10)_$JUSTIFY(ENT,5)
- +58 DO MES^XPDUTL(ENX)
- +59 QUIT
- +60 ;
- XFR(ENDA) ; Transmit FR Document
- +1 ; input ENDA - equipment entry
- +2 ; returns 1 if success or if failed
- +3 ; output ^TMP($J,"BAD",equipment entry
- +4 ; will be defined if the document failed validation
- +5 ;
- +6 NEW DA,ENBAT,ENDO,ENEQ,ENFA,ENFAP,ENFR,ENX,I
- +7 SET ENEQ("DA")=ENDA
- +8 SET ENBAT("SILENT")=1
- +9 SET ENX=$$CHKFA^ENFAUTL(ENEQ("DA"))
- +10 SET ENFA("DA")=$PIECE(ENX,U,4)
- +11 FOR I=1,2,3,8,9
- SET ENEQ(I)=$GET(^ENG(6914,ENEQ("DA"),I))
- +12 ; create FR document
- +13 SET ENDO=1
- SET ENFR("DA")=""
- +14 DO ADDFR^ENFAXFR
- +15 if ENDO
- Begin DoDot:1
- +16 ; populate FR Document with existing data from equipment file
- +17 SET ENFAP(100)=$GET(^ENG(6915.6,ENFR("DA"),100))
- +18 ; fund (required)
- SET $PIECE(ENFAP(100),U,2)=$PIECE(ENEQ(9),U,7)
- +19 ; a/o (required)
- SET $PIECE(ENFAP(100),U,3)=$PIECE(ENEQ(9),U,8)
- +20 ; boc (deleted when blank sent)
- SET $PIECE(ENFAP(100),U,5)=$PIECE(ENEQ(9),U,6)
- +21 ; cmr (determines cost cr, xarea)
- SET $PIECE(ENFAP(100),U,6)=$PIECE(ENEQ(2),U,9)
- +22 SET ^ENG(6915.6,ENFR("DA"),100)=ENFAP(100)
- End DoDot:1
- +23 if ENDO
- DO CVTDATA^ENFAXFR
- +24 if ENDO
- Begin DoDot:1
- +25 SET ENFAP("DOC")="FR"
- DO ^ENFAVAL
- +26 IF $DATA(^TMP($JOB,"BAD",ENEQ("DA")))
- SET ENDO=0
- End DoDot:1
- +27 IF 'ENDO
- IF $GET(ENFR("DA"))]""
- Begin DoDot:1
- +28 SET DA=ENFR("DA")
- SET DIK="^ENG(6915.6,"
- DO ^DIK
- KILL DIK
- End DoDot:1
- +29 if ENDO
- DO UPDATE^ENFAXFR
- +30 IF $GET(ENFR("DA"))]""
- LOCK -^ENG(6915.6,ENFR("DA"))
- +31 QUIT ENDO
- +32 ;
- +33 ;ENXIP57