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

XPDANLYZ1.m

Go to the documentation of this file.
XPDANLYZ1 ;OAK/RSF- BUILD ANALYZER ;10/28/22
 ;;8.0;KERNEL;**782**;Jul 10, 1995;Build 4
 ;;Per VHA Directive 2004-038, this routine should not be modified.
 ;
START(XPDRC) ; OPTION XPDANLYZ which passes XPDRC=4 an XPDRC=5 to run initially for build
 ; other options pass other numbers to run other things
 N XPDARR,END,XPDPG,XPDRTN,XPDR,XPQR,XPDCAR,XPDHR,XPDN,XPDSPC,XPDIS,XPDIS2,TCNT,XTOG S (END,XPDPG,XPDR,XPDIS2,TCNT,XTOG)=0
 N X,XPDATE,XPDLINE,XPDBN,%,%H,%I D NOW^%DTC S XPDATE=X,XPDIS=1
 I XPDRC=5 S XPDRC=4,XPDIS2=1  ;WILL HAVE FULL SQA CHECK-DOES NOT REFINE CODE CHECKS
 I XPDRC=6 S XPDRC=4,XTOG=1  ;SHOW SQA LINES IN ANALYSIS SECTION (NEEDS OPTION CREATED IF WANTED)
 I XPDRC=1 S XPDLINE="File Analysis" D FILENUM^XPDANLYZ4  ;THESE THREE HAVE NOT BEEN USED RECENTLY.  IF WANTED, WILL NEED CODE CHECKED AND OPTIONS ADDED
 I XPDRC=2 S XPDLINE="Option Analysis" D OPTME^XPDANLYZ2
 I XPDRC=3 S XPDLINE="RPC Analysis" D RPCHK^XPDANLYZ2
 I XPDRC=4 N XPDCS,TRKN,XPOPT,XPDREF,XPRSPL,XPPATH,XPDTOP,XPDBIEN,XPDSQA,XPMM,XTMPARR,XPDXRR,XPDTRR,XPDKT,XPDROUT,XPTL,XPNS,XPEX,XPTK,PFL D BUILDME^XPDANLYZ6
 Q:XPDRC>6
 G:END X1
 ;
PME ;Build Analysis report
 I XPDIS=1 S END=0 N POP,IO,IOP,%ZIS,ZTIO  D  G:POP X1
 . W ! S %ZIS("A")="Print Analysis to which Device:   " S %ZIS="MQ" D ^%ZIS Q:POP  Q:'$G(ZTIO)']""
 . I $D(IO("Q")) D  ;queue the report
 .. S ZTRTN="PNT^XPDANLYZ1"
 .. S ZTSAVE("ORY(")="",ZTSAVE("*")=""  ;,ZTSAVE("XPDRC")=""XPDCOMP,XPDCOMP,XPDR,XPDIS,XPDRC,"XPDARR("
 .. S ZTDESC="Build Analysis Report"
 .. D ^%ZTLOAD
 .. K ZTDESC,ZTRTN,ZTSAVE
 .. I $D(ZTSK)[0 W !!?5,"Report canceled!"
 .. E  W !!?5,"Report queued."
 .. D HOME^%ZIS
 .. K %ZIS
 . I $D(IO("Q")) K IO("Q") S END=1 Q
 . ;I '$D(IO("S")) S END=1 Q
 . S XPDPG=1,END=0
 . U IO
 . I $E(IOST,1,2)="C-" W @IOF  ;sending to screen, so clear screen first
 G:END X1
 ;
PNT ;Queue the report
 N XPDCOMP,XPDNUM,XPDCNT,XPDFLD,XPDW S XPDCNT=0
 N XPDSP S XPDSP=$J(" ",3)
 I XPDRC'=4 S XPDSP=""
 I XPDRC=4 N XPDBB S XPDBB=$O(XPDARR("BUILD",0)) Q:'XPDBB  D PB1^XPDANLYZ5
 ;GET ALL COMPONENTS PLUS BUILD AND FILE
 N XPDCHK,XPDC1,CLEN S XPDCHK="BUILD,FILE,"
 S XPDC1="" F  S XPDC1=$O(XPDCS(XPDC1)) Q:XPDC1']""  S XPDCHK=XPDCHK_XPDC1_","
 S XPDCHK=$$TRIM^XLFSTR(XPDCHK,"R",","),CLEN=$L(XPDCHK,",")
 N XPDXX,XPDOLD,XPDFNUM S XPDOLD="" F XPDXX=1:1:CLEN S XPDCOMP=$P(XPDCHK,",",XPDXX) S:$D(XPDCS(XPDCOMP)) XPDFNUM=XPDCS(XPDCOMP) D
 . S XPDNUM=0 F  S XPDNUM=$O(XPDARR(XPDCOMP,XPDNUM)) Q:'XPDNUM  D
 .. I XPDCOMP="BUILD" S XPDOLD="BUILD"
 .. I $G(XPDOLD)]"",XPDOLD'=XPDCOMP D
 ... I $D(XPDARR(XPDOLD,"WARNING")) D PWARN^XPDANLYZ6(XPDOLD)
 ... S XPDCNT=XPDCNT+1,XPDW(XPDCNT)=$TR($J("-",79)," ","-"),XPDCNT=XPDCNT+1,XPDW(XPDCNT)=XPDCOMP_":",XPDOLD=XPDCOMP,XPDHR(XPDCNT)=XPDCOMP
 .. N TMPTX S TMPTX="" I XPDCOMP["TEMPLATE",XPDCOMP'["LIST" S TMPTX=$J(" ",(40-$L(XPDSP_XPDARR(XPDCOMP,XPDNUM,"NAME"))))_$$GET1^DIQ(XPDFNUM,XPDNUM_",",4)_" file (#"_$$GET1^DIQ(XPDFNUM,XPDNUM_",",4,"I")_")"
 .. S:XPDCOMP'="BUILD" XPDCNT=XPDCNT+1,XPDW(XPDCNT)="",XPDCNT=XPDCNT+1,XPDW(XPDCNT)=XPDSP_XPDARR(XPDCOMP,XPDNUM,"NAME")_TMPTX  ;_" (#"_XPDNUM_")" ;,XPDCNT=XPDCNT+1,XPDW(XPDCNT)=""
 .. S:XPDCOMP="FILE" XPDW(XPDCNT)=XPDSP_XPDARR(XPDCOMP,XPDNUM,"NAME")_" (#"_XPDNUM_")"
 .. I XPDRC<4 D
 ... S XPDCNT=XPDCNT+1,XPDW(XPDCNT)=XPDCOMP_" Description:"
 ... S:XPDCOMP="OPTION" XPDW(XPDCNT)="Option Description" S:XPDCOMP="REMOTE PROCEDURE" XPDW(XPDCNT)="RPC Description" S:XPDCOMP="MAIL GROUP" XPDW(XPDCNT)="Mail Group Description"
 ... S:XPDCOMP="BUILD" XPDW(XPDCNT)="BUILD Description" S:XPDCOMP="BULLETIN" XPDW(XPDCNT)="Bulletin Description"
 ... I XPDARR(XPDCOMP,XPDNUM,"DESCRIPT")="Yes" N II S II=0 F  S II=$O(XPDARR(XPDCOMP,XPDNUM,"DESCRIPTION",II)) Q:'II  S XPDCNT=XPDCNT+1,XPDW(XPDCNT)=XPDARR(XPDCOMP,XPDNUM,"DESCRIPTION",II)
 ... I XPDARR(XPDCOMP,XPDNUM,"DESCRIPT")="No" S XPDCNT=XPDCNT+1,XPDW(XPDCNT)="     DESCRIPTION missing."
 .. I XPDRC=4,XPDCOMP="BUILD" D BTXT^XPDANLYZ6
 .. N FSKP S FSKP=1  ;LINE SKIP IN FILE  ;XPDCNT=XPDCNT+1,XPDW(XPDCNT)=$J(" ",5)_"File Issues:" 
 .. I '$D(XPDARR(XPDCOMP,XPDNUM,"WARNING")),('$D(XPDARR(XPDCOMP,XPDNUM,"FIELD-WARNING"))),XPDCOMP'="BUILD" S XPDCNT=XPDCNT+1,XPDW(XPDCNT)=$J(" ",5)_"No issues noted."
 .. E  I XPDCOMP="FILE",'$D(XPDARR(XPDCOMP,XPDNUM,"WARNING")) S FSKP=0  ;S XPDCNT=XPDCNT+1,XPDW(XPDCNT)=$J(" ",5)_"File Issues: None"
 .. N XPDWRN S XPDWRN="" I $D(XPDARR(XPDCOMP,XPDNUM,"WARNING"))!($D(XPDARR(XPDCOMP,XPDNUM,"FIELD-WARNING"))) D
 ... I $D(XPDARR(XPDCOMP,XPDNUM,"WARNING")) D:XPDCOMP="FILE" FADJ^XPDANLYZ3(0,"File Issues:") F  S XPDWRN=$O(XPDARR(XPDCOMP,XPDNUM,"WARNING",XPDWRN)) Q:XPDWRN']""  S XPDCNT=XPDCNT+1 D
 .... I (XPDCOMP="FILE"),((XPDWRN="ADIC")!(XPDWRN="ADIZ")) D @XPDWRN^XPDANLYZ6(XPDARR(XPDCOMP,XPDNUM,"WARNING",XPDWRN))
 .... E  S XPDW(XPDCNT)=$J(" ",5)_"* "_XPDARR(XPDCOMP,XPDNUM,"WARNING",XPDWRN)
 ... I $D(XPDARR(XPDCOMP,XPDNUM,"FIELD-WARNING")) D:XPDCOMP="FILE" FADJ^XPDANLYZ3(FSKP,"Field Issues:") S XPDFLD=0 F  S XPDFLD=$O(XPDARR(XPDCOMP,XPDNUM,XPDFLD)) Q:'XPDFLD  D
 .... I $D(XPDARR(XPDCOMP,XPDNUM,XPDFLD,"WARNING")) S XPDWRN=" " F  S XPDWRN=$O(XPDARR(XPDCOMP,XPDNUM,XPDFLD,"WARNING",XPDWRN)) Q:XPDWRN']""  S XPDCNT=XPDCNT+1 D
 ..... I XPDWRN'="SUBFILE" S XPDW(XPDCNT)=$J(" ",5)_"* "_XPDARR(XPDCOMP,XPDNUM,XPDFLD,"WARNING",XPDWRN)
 ..... I XPDWRN="SUBFILE" D
 ...... N XPDTMP S XPDTMP=$O(XPDARR(XPDCOMP,XPDNUM,XPDFLD,"WARNING",XPDWRN,"")),XPDW(XPDCNT)="     "_$P(XPDARR(XPDCOMP,XPDNUM,XPDFLD,"WARNING",XPDWRN,XPDTMP),":")_":"
 ...... S XPDCNT=XPDCNT+1,XPDW(XPDCNT)=$J(" ",7)_"* "_$P(XPDARR(XPDCOMP,XPDNUM,XPDFLD,"WARNING",XPDWRN,XPDTMP),":",2)
 ;If build, get routine info
 S END=0
 N XPFNAME1,XPFNAME3,XPFNAME4,XPBA1,TMPT,LNUM I XPDRC=4 S XPDLINE=XPDLINE_" "_XPDBN D RTE1^XPDANLYZ3
 I XPDRC'=4 D  G:END X1
 . N RR S RR=0 F  S RR=$O(XPDW(RR)) Q:'RR  W !,XPDW(RR) I ($Y+5)>IOSL S TMPT=XPDLINE_" - (continued)" D HDR(TMPT) Q:END
 . D PDESC^XPDANLYZ3
 ;ONLY XPDRC=4 (BUILD)FOR REST OF TAG
 N XPDMM I XPDR D MMT^XPDANLYZ3  ;SET SPELL CHECK ARRAY
 I XPDIS=1 D  G:END=2 X1 G:END=1 X2  ;PRINT
 . D BA^XPDANLYZ5
 . N RR S RR=0 F  S RR=$O(XPBA1(RR)) Q:'RR  W !,XPBA1(RR) I $E(IOST,1,2)="C-",($Y+5)>IOSL S LNUM=$O(XPDHR(RR+2),-1),TMPT=XPDARR("BUILD",XPDBB,"NAME")_" - "_XPDHR(LNUM)_" (cont.)" D HDR(TMPT) Q:END
 . Q:END
 . I ('XPDR)&('XPQR) S END=1 Q  ;ONLY WANT TO SEE ANLYSIS SECTION
 . I XPQR D  Q:END  ;W !!,"SQA CHECKLIST REVIEW:",! 
 .. D SQAMM^XPDANLYZ5
 .. N LL S LL=0 F  S LL=$O(XPMM(LL)) Q:'LL  W !,XPMM(LL) I $E(IOST,1,2)="C-",($Y+5)>IOSL N AA S AA=LL,AA=$O(XPDROUT(AA),-1),TMPT=XPDARR("BUILD",XPDBB,"NAME")_" - SQA LINE REVIEW, "_XPDROUT($G(AA,0))_" (cont.)" D HDR(TMPT) Q:END
 . I XPDR Q:'$D(XPDMM)  W !! N TTT S TTT=0 F  S TTT=$O(XPDMM(TTT)) Q:'TTT  D  Q:END  ;W !!,"Compiling Description/Routine text review." H .5 W !," . " H .5  W ". " H .5 
 .. W !,XPDMM(TTT) I $E(IOST,1,2)="C-",($Y+5)>IOSL S TMPT=XPDARR("BUILD",XPDBB,"NAME")_" - TEXT REVIEW (cont.)" D HDR(TMPT) Q:END
 . W !!,"**  Analysis Complete  **",!! H 2
 . S END=1 Q
 I XPDIS=2 D  G:END=1 X2 G:END=2 X1 ;CREATE TEXT FILES
 . S DIR(0)="F",DIR("A",1)="Set the path to place the .TXT files",DIR("A",2)="or accept the standard default."
 . S DIR("A",3)="",DIR("A")="PATH",DIR("B")=XPPATH
 . S DIR("?",1)="Full path specification up to, but not including, the filename. This includes "
 . S DIR("?",2)="any trailing slashes or brackets."
 . S DIR("?")=" "
 . D ^DIR S:$D(DTOUT) END=1 S:$D(DIRUT) END=1 Q:END
 . S XPPATH=Y
 . D FILEME^XPDANLYZ5(1)
 . W !!,"Build Analysis file was created."
 . W !,"File:"
 . W !,?10,XPPATH_XPFNAME1
 . I ('XPDR)&('XPQR) S END=1 Q  ;ONLY WANT TO SEE ANLYSIS SECTION
 . I XPQR W ! H 1 D FILEME^XPDANLYZ5(4) D
 .. W !,"SQA Checklist review file was created."
 .. W !,"File:"
 .. W !,?5,XPPATH_XPFNAME4
 . I XPDR W ! H 1 D FILEME^XPDANLYZ5(3) D
 .. W !,"Description/Routine text review file was created."
 .. W !,"File:"
 .. W !,?5,XPPATH_XPFNAME3
 . ;W !!,"Use SFTP to move text documents to your PC.",!,"(Detailed instructions for moving files in the Build Analyzer documentation.)"
 . W !!,"**  Analysis Complete  **",!! H 2
 . S END=1
 I XPDIS=3 N XPSUB,XMSUB,XMTEXT,XMDUZ D  Q:END  ;CREATE MAILMAN MESSAGES
 . D BA^XPDANLYZ5 W !,"BUILD ANALYSIS email:"
 . S (XPSUB,XMSUB)="Build Analysis - "_XPDBN,XMTEXT="XPBA1(",XMDUZ="Kernel Build Analyzer" D ^XMD  ;,XMY(DUZ)=""
 .  W !!,"Check for email with subject of "_XPSUB,!
 . I ('XPDR)&('XPQR) S END=1 ;ONLY WANT TO SEE ANLYSIS SECTION
 . I XPQR W !! D
 .. W !!,"SQA Checklist review email:"
 .. D SQAMM^XPDANLYZ5 N XSUB3 S (XSUB3,XMSUB)="SQA Analysis - "_XPDBN,XMTEXT="XPMM(",XMDUZ="Kernel Build Analyzer" D ^XMD  ;,XMY(DUZ)=""
 .. W !,"Check for email with subject of: "
 .. W !,?10,XSUB3,! S END=1
 . I XPDR Q:'$D(XPDMM)  D
 .. W !!,"Routine/Component Text email:"
 .. N XPSUB1 S (XPSUB1,XMSUB)="Routine and Component Text - "_XPDBN,XMTEXT="XPDMM(",XMDUZ="Kernel Build Analyzer" D ^XMD   ;XMY(DUZ)="",
 .. W !,"Check for email with subject of: "
 .. W !,?10,XPSUB1,! S END=1
 . W !!,"**  Analysis Complete  **",!! H 2
 . Q:END
X2 I $E(IOST,1,2)="C-" D
 . W !! N DIRUT K DIR S DIR(0)="E",DIR("A")="Press <Enter> or '^' to exit"
 . D ^DIR ;Q:$D(DIRUT)
X1 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@" K DIR,DIC,XPDFARR,FLDARR,XPDRC,Y W @IOF Q
 ;
HDR(HTXT) ;header information
 I $E(IOST,1,2)="C-" D  G:END X1
 . W !! N DIRUT K DIR S DIR(0)="E",DIR("A")="Press <Enter> to continue or '^' to exit"
 . S DIR("?")="Press <Enter> to continue display, ""^"" to exit option."
 . D ^DIR ;Q:$D(DIRUT)
 . I '$G(Y) S END=2 Q
 S XPDPG=XPDPG+1
 I $E(IOST,1,2)="C-" W @IOF  W !,HTXT,$$RJ^XLFSTR($$FMTE^XLFDT(XPDATE),79-$L(HTXT)," ")
 E  W !,HTXT,$$RJ^XLFSTR($$FMTE^XLFDT(XPDATE)_";  Pg: "_XPDPG,79-$L(HTXT)," ")
 W !,$TR($J("=",79)," ","=")
 Q
 ;