IBDY336 ;ALB/ESD - PRE AND POST INSTALL FOR PATCH IBD*3*36 ; AUG 1, 2000
;;3.0;AUTOMATED INFO COLLECTION SYS;**36**;APR 24, 1997
;
PRE ;- Create EF block list report and clear workspace before install
D BLKLIST
D CLWKSP
Q
;
;
POST ;- Add toolkit blocks
D TKBLKS
Q
;
;
CLWKSP ;- Clear the AICS Import/Export Workspace (files in #358) before
;- loading new toolkit blocks
;
D MES^XPDUTL("")
D BMES^XPDUTL(">>> Clearing AICS Import/Export workspace...")
D DLTALL^IBDE2
D MES^XPDUTL(">>> ...completed.")
Q
;
;
BLKLIST ;- List tool kit blocks, forms, div(s), and clinic(s) so that users can
;- find and change them to the new EF blocks containing MST indicator
;
N ARRYVAL,BLKIEN,BLKNAM,BLOCK,CLINIC,CNT,DIV,DIVNAM,FORMIEN,FORM,LINE,LINECNT,MULTI
K ^TMP("DILIST",$J),^TMP($J,"IBDCS"),^TMP($J,"IBDCN"),^TMP("IBD36",$J)
;
;- Display info msg to patch installer
D USERMSG
;
;- Var used in CLINIC^IBDF15A call for multiple divs; must be defined
S MULTI=0
S LINECNT=19
F LINE=1:1 S BLKNAM=$P($T(LIST+LINE),";;",2) Q:(BLKNAM="QUIT") D
. D FIND^DIC(357.1,"",".01;.02","",BLKNAM)
. F CNT=0:0 S CNT=$O(^TMP("DILIST",$J,2,CNT)) Q:'CNT D
.. S BLKIEN=+$G(^TMP("DILIST",$J,2,CNT))
.. ;
.. ;- Get block and what form it's on
.. S BLOCK=$P($G(^IBE(357.1,BLKIEN,0)),"^")
.. S FORMIEN=+$P($G(^IBE(357.1,BLKIEN,0)),"^",2)
.. S FORM=$P($G(^IBE(357,FORMIEN,0)),"^")
.. ;
.. ;- Don't list blocks on the Form tool kit
.. Q:FORMIEN<1!(FORM="")!(FORM="TOOL KIT")!(FORM="TOOLKIT BLOCKS")
.. ;
.. ;- Get list of clinics and division(s) using form
.. D CLINIC^IBDF15A(FORMIEN,FORM)
.. S (CLINIC,DIVNAM)="",DIV=0
.. F S DIVNAM=$O(^TMP($J,"IBDCS",DIVNAM)) Q:DIVNAM="" F S DIV=$O(^TMP($J,"IBDCS",DIVNAM,DIV)) Q:'DIV D
... F S CLINIC=$O(^TMP($J,"IBDCS",DIVNAM,DIV,FORM,FORMIEN,CLINIC)) Q:CLINIC="" D WRITELST(.LINECNT)
;
;- Briefly explain rpt and list old and new EF blocks
D XMHDR
I '$D(^TMP("IBD36",$J,19)) S ^TMP("IBD36",$J,19)=" No AICS encounter form information found"
D XM
D MES^XPDUTL(">>> ...completed.")
K ^TMP("DILIST",$J),^TMP($J,"IBDCS"),^TMP($J,"IBDCN"),^TMP("IBD36",$J)
Q
;
;
WRITELST(CNT) ;- Print block & form on 1st line, clinic & division on 2nd line
N LINE
S LINE=$$SETSTR^VALM1(" Block: "_BLOCK,"",1,40),LINE=$$SETSTR^VALM1(" Form: "_FORM,LINE,43,36)
D INCR(.CNT)
S LINE=$$SETSTR^VALM1("Clinic: "_CLINIC,"",1,40),LINE=$$SETSTR^VALM1(" Division: "_$E(DIVNAM,1,25),LINE,43,36)
D INCR(.CNT)
S LINE=$$SETSTR^VALM1(" ","",1,80)
D INCR(.CNT)
Q
;
;
INCR(CNT) ;- Create output array
S ^TMP("IBD36",$J,CNT)=LINE
S CNT=CNT+1
Q
;
;
XM ;- Send mail message to patch installer
N DIFROM,XMSUB,XMDUZ,XMTEXT,XMY
S XMSUB="Patch IBD*3*36 Encounter Form Block Report"
S XMDUZ=.5
S XMY(DUZ)=""
S XMY(XMDUZ)=""
S XMTEXT="^TMP(""IBD36"",$J,"
D ^XMD
Q
;
;
XMHDR ;- Report header
;
S ^TMP("IBD36",$J,1)=" Patch IBD*3*36 contains a number of encounter form blocks which were"
S ^TMP("IBD36",$J,2)=" modified to include the MST classification indicator. These new"
S ^TMP("IBD36",$J,3)=" encounter form blocks should replace the existing encounter form"
S ^TMP("IBD36",$J,4)=" blocks on all applicable encounter forms."
S ^TMP("IBD36",$J,5)=" "
S ^TMP("IBD36",$J,6)=" This report will assist the user in replacing these blocks by listing the"
S ^TMP("IBD36",$J,7)=" existing encounter form blocks, the encounter form(s) they are located on,"
S ^TMP("IBD36",$J,8)=" and all clinic(s), and division(s) using the encounter form."
S ^TMP("IBD36",$J,9)=" "
S ^TMP("IBD36",$J,10)=" Old block New block"
S ^TMP("IBD36",$J,11)=" ========= ========="
S ^TMP("IBD36",$J,12)=" "
S ^TMP("IBD36",$J,13)=" HIDDEN CLASSICATIONS (V2.1) HIDDEN CLASSIFICATN (V2.1 MST)"
S ^TMP("IBD36",$J,14)=" HIDDEN CLASSIFICATIONS (V3.0) HIDDEN CLASSIFICATN (V3.0 MST)"
S ^TMP("IBD36",$J,15)=" SC CONDITIONS (V2.1) SC CONDITIONS (V2.1 MST)"
S ^TMP("IBD36",$J,16)=" HIDDEN SC TREATMENT QUESTIONS HIDDEN SC TREATMNT QUEST (MST)"
S ^TMP("IBD36",$J,17)=" BASIC DEMOGRAPHICS BASIC DEMOGRAPHICS (MST)"
S ^TMP("IBD36",$J,18)=" "
Q
;
;
USERMSG ;- Info message displayed during patch install
;
D BMES^XPDUTL(">>> Creating encounter form block report to aid user in finding existing")
D MES^XPDUTL(">>> encounter form blocks and replacing them with blocks containing the")
D MES^XPDUTL(">>> MST indicator.")
D BMES^XPDUTL(">>> This report will be sent as a mail message to the patch installer")
D MES^XPDUTL(">>> with the subject ""Patch IBD*3*36 Encounter Form Block Report"".")
Q
;
;
TKBLKS ;- Add MST tool kit blocks to AICS Tool Kit
;
N A,ARY,BLK,CNT,CNT1,CNTB,CNTF,EXCLUDE,FORM,FORMNM,NAME,IBDNM,IBDBLK,IBDX,IBTKBLK,NEWBLOCK,NEWFORM,NUM,ORD,SUMMARY,X,Y
;
;- Add all tool kit blocks
S FORMNM="TOOL KIT"
S (CNTB,CNTF)=0,NUM=1
D BMES^XPDUTL(">>> Adding MST Tool Kit blocks to the AICS Tool Kit...")
;
;- Display error msg and exit if Tool Kit not found
I '$O(^IBE(357,"B",FORMNM,0)) D TKERR Q
;
;- Get blocks from Imp/Exp EF Block file
S ORD="" F S ORD=$O(^IBE(358.1,"D",ORD)) Q:ORD="" S BLK=0 F S BLK=$O(^IBE(358.1,"D",ORD,BLK)) Q:'BLK D
. S NAME=$P($G(^IBE(358.1,+BLK,0)),"^")
. ;
. ;- Not a tool kit block
. Q:$P($G(^IBE(358.1,BLK,0)),"^",14)'=1
. ;
. ;- Delete block if it already exists
. S IBTKBLK=1
. S IBDNM="" F S IBDNM=$O(^IBE(357.1,"B",IBDNM)) Q:IBDNM="" S IBDBLK=0 F S IBDBLK=+$O(^IBE(357.1,"B",IBDNM,IBDBLK)) Q:'IBDBLK D
.. I $P($G(^IBE(357.1,IBDBLK,0)),"^")=NAME D DLTBLK^IBDFU3(IBDBLK,"",357.1)
. S NEWBLOCK=$$COPYBLK^IBDFU2(BLK,$$TKFORM^IBDFU2C,358.1,357.1,"","",$$TKORDER^IBDF13)
. S CNTB=CNTB+1
. D:$G(NEWBLOCK) DLTBLK^IBDFU3(BLK,"",358.1)
. ;
. ;- Add block name to array (used in summary at end)
. S SUMMARY(NUM)=NAME
. S NUM=NUM+1
. ;
. ;- Display msg to user
. D BMES^XPDUTL(">>> Moving encounter form block "_$G(NAME)_" from")
. D MES^XPDUTL(" AICS Import/Export files to AICS Tool Kit.")
;
;- Clear workspace
D DLTALL^IBDE2
D BMES^XPDUTL("... completed.")
;
SUMM ;- EF block summary displayed to user
D BMES^XPDUTL("Summary of Encounter Form Blocks Added to Tool Kit:")
D MES^XPDUTL("===================================================")
D MES^XPDUTL("")
F IBDX=0:0 S IBDX=$O(SUMMARY(IBDX)) Q:'IBDX D
. D MES^XPDUTL($G(SUMMARY(IBDX)))
I '$D(SUMMARY) D
. D MES^XPDUTL(">>> ERROR: Missing data in IMP/EXP ENCOUNTER FORM BLOCK file (#358.1).")
. D MES^XPDUTL(">>> No Encounter Form Blocks were installed. Please contact National")
. D MES^XPDUTL(">>> Vista Support for assistance.")
Q
;
;
TKERR ;- Display error msg if Tool Kit not found
D BMES^XPDUTL(">>> ERROR: No AICS Tool Kit found. New encounter form blocks can not be")
D MES^XPDUTL(">>> installed. Please contact National Vista Support for assistance.")
Q
;
;
LIST ;- List of encounter form blocks
;;HIDDEN CLASSICATIONS
;;HIDDEN CLASSIFICATIONS
;;SC CONDITIONS
;;BASIC DEMOGRAPHICS
;;HIDDEN SC TREATMENT QUESTIONS
;;QUIT
IBDY336 ;ALB/ESD - PRE AND POST INSTALL FOR PATCH IBD*3*36 ; AUG 1, 2000
+1 ;;3.0;AUTOMATED INFO COLLECTION SYS;**36**;APR 24, 1997
+2 ;
PRE ;- Create EF block list report and clear workspace before install
+1 DO BLKLIST
+2 DO CLWKSP
+3 QUIT
+4 ;
+5 ;
POST ;- Add toolkit blocks
+1 DO TKBLKS
+2 QUIT
+3 ;
+4 ;
CLWKSP ;- Clear the AICS Import/Export Workspace (files in #358) before
+1 ;- loading new toolkit blocks
+2 ;
+3 DO MES^XPDUTL("")
+4 DO BMES^XPDUTL(">>> Clearing AICS Import/Export workspace...")
+5 DO DLTALL^IBDE2
+6 DO MES^XPDUTL(">>> ...completed.")
+7 QUIT
+8 ;
+9 ;
BLKLIST ;- List tool kit blocks, forms, div(s), and clinic(s) so that users can
+1 ;- find and change them to the new EF blocks containing MST indicator
+2 ;
+3 NEW ARRYVAL,BLKIEN,BLKNAM,BLOCK,CLINIC,CNT,DIV,DIVNAM,FORMIEN,FORM,LINE,LINECNT,MULTI
+4 KILL ^TMP("DILIST",$JOB),^TMP($JOB,"IBDCS"),^TMP($JOB,"IBDCN"),^TMP("IBD36",$JOB)
+5 ;
+6 ;- Display info msg to patch installer
+7 DO USERMSG
+8 ;
+9 ;- Var used in CLINIC^IBDF15A call for multiple divs; must be defined
+10 SET MULTI=0
+11 SET LINECNT=19
+12 FOR LINE=1:1
SET BLKNAM=$PIECE($TEXT(LIST+LINE),";;",2)
IF (BLKNAM="QUIT")
QUIT
Begin DoDot:1
+13 DO FIND^DIC(357.1,"",".01;.02","",BLKNAM)
+14 FOR CNT=0:0
SET CNT=$ORDER(^TMP("DILIST",$JOB,2,CNT))
IF 'CNT
QUIT
Begin DoDot:2
+15 SET BLKIEN=+$GET(^TMP("DILIST",$JOB,2,CNT))
+16 ;
+17 ;- Get block and what form it's on
+18 SET BLOCK=$PIECE($GET(^IBE(357.1,BLKIEN,0)),"^")
+19 SET FORMIEN=+$PIECE($GET(^IBE(357.1,BLKIEN,0)),"^",2)
+20 SET FORM=$PIECE($GET(^IBE(357,FORMIEN,0)),"^")
+21 ;
+22 ;- Don't list blocks on the Form tool kit
+23 IF FORMIEN<1!(FORM="")!(FORM="TOOL KIT")!(FORM="TOOLKIT BLOCKS")
QUIT
+24 ;
+25 ;- Get list of clinics and division(s) using form
+26 DO CLINIC^IBDF15A(FORMIEN,FORM)
+27 SET (CLINIC,DIVNAM)=""
SET DIV=0
+28 FOR
SET DIVNAM=$ORDER(^TMP($JOB,"IBDCS",DIVNAM))
IF DIVNAM=""
QUIT
FOR
SET DIV=$ORDER(^TMP($JOB,"IBDCS",DIVNAM,DIV))
IF 'DIV
QUIT
Begin DoDot:3
+29 FOR
SET CLINIC=$ORDER(^TMP($JOB,"IBDCS",DIVNAM,DIV,FORM,FORMIEN,CLINIC))
IF CLINIC=""
QUIT
DO WRITELST(.LINECNT)
End DoDot:3
End DoDot:2
End DoDot:1
+30 ;
+31 ;- Briefly explain rpt and list old and new EF blocks
+32 DO XMHDR
+33 IF '$DATA(^TMP("IBD36",$JOB,19))
SET ^TMP("IBD36",$JOB,19)=" No AICS encounter form information found"
+34 DO XM
+35 DO MES^XPDUTL(">>> ...completed.")
+36 KILL ^TMP("DILIST",$JOB),^TMP($JOB,"IBDCS"),^TMP($JOB,"IBDCN"),^TMP("IBD36",$JOB)
+37 QUIT
+38 ;
+39 ;
WRITELST(CNT) ;- Print block & form on 1st line, clinic & division on 2nd line
+1 NEW LINE
+2 SET LINE=$$SETSTR^VALM1(" Block: "_BLOCK,"",1,40)
SET LINE=$$SETSTR^VALM1(" Form: "_FORM,LINE,43,36)
+3 DO INCR(.CNT)
+4 SET LINE=$$SETSTR^VALM1("Clinic: "_CLINIC,"",1,40)
SET LINE=$$SETSTR^VALM1(" Division: "_$EXTRACT(DIVNAM,1,25),LINE,43,36)
+5 DO INCR(.CNT)
+6 SET LINE=$$SETSTR^VALM1(" ","",1,80)
+7 DO INCR(.CNT)
+8 QUIT
+9 ;
+10 ;
INCR(CNT) ;- Create output array
+1 SET ^TMP("IBD36",$JOB,CNT)=LINE
+2 SET CNT=CNT+1
+3 QUIT
+4 ;
+5 ;
XM ;- Send mail message to patch installer
+1 NEW DIFROM,XMSUB,XMDUZ,XMTEXT,XMY
+2 SET XMSUB="Patch IBD*3*36 Encounter Form Block Report"
+3 SET XMDUZ=.5
+4 SET XMY(DUZ)=""
+5 SET XMY(XMDUZ)=""
+6 SET XMTEXT="^TMP(""IBD36"",$J,"
+7 DO ^XMD
+8 QUIT
+9 ;
+10 ;
XMHDR ;- Report header
+1 ;
+2 SET ^TMP("IBD36",$JOB,1)=" Patch IBD*3*36 contains a number of encounter form blocks which were"
+3 SET ^TMP("IBD36",$JOB,2)=" modified to include the MST classification indicator. These new"
+4 SET ^TMP("IBD36",$JOB,3)=" encounter form blocks should replace the existing encounter form"
+5 SET ^TMP("IBD36",$JOB,4)=" blocks on all applicable encounter forms."
+6 SET ^TMP("IBD36",$JOB,5)=" "
+7 SET ^TMP("IBD36",$JOB,6)=" This report will assist the user in replacing these blocks by listing the"
+8 SET ^TMP("IBD36",$JOB,7)=" existing encounter form blocks, the encounter form(s) they are located on,"
+9 SET ^TMP("IBD36",$JOB,8)=" and all clinic(s), and division(s) using the encounter form."
+10 SET ^TMP("IBD36",$JOB,9)=" "
+11 SET ^TMP("IBD36",$JOB,10)=" Old block New block"
+12 SET ^TMP("IBD36",$JOB,11)=" ========= ========="
+13 SET ^TMP("IBD36",$JOB,12)=" "
+14 SET ^TMP("IBD36",$JOB,13)=" HIDDEN CLASSICATIONS (V2.1) HIDDEN CLASSIFICATN (V2.1 MST)"
+15 SET ^TMP("IBD36",$JOB,14)=" HIDDEN CLASSIFICATIONS (V3.0) HIDDEN CLASSIFICATN (V3.0 MST)"
+16 SET ^TMP("IBD36",$JOB,15)=" SC CONDITIONS (V2.1) SC CONDITIONS (V2.1 MST)"
+17 SET ^TMP("IBD36",$JOB,16)=" HIDDEN SC TREATMENT QUESTIONS HIDDEN SC TREATMNT QUEST (MST)"
+18 SET ^TMP("IBD36",$JOB,17)=" BASIC DEMOGRAPHICS BASIC DEMOGRAPHICS (MST)"
+19 SET ^TMP("IBD36",$JOB,18)=" "
+20 QUIT
+21 ;
+22 ;
USERMSG ;- Info message displayed during patch install
+1 ;
+2 DO BMES^XPDUTL(">>> Creating encounter form block report to aid user in finding existing")
+3 DO MES^XPDUTL(">>> encounter form blocks and replacing them with blocks containing the")
+4 DO MES^XPDUTL(">>> MST indicator.")
+5 DO BMES^XPDUTL(">>> This report will be sent as a mail message to the patch installer")
+6 DO MES^XPDUTL(">>> with the subject ""Patch IBD*3*36 Encounter Form Block Report"".")
+7 QUIT
+8 ;
+9 ;
TKBLKS ;- Add MST tool kit blocks to AICS Tool Kit
+1 ;
+2 NEW A,ARY,BLK,CNT,CNT1,CNTB,CNTF,EXCLUDE,FORM,FORMNM,NAME,IBDNM,IBDBLK,IBDX,IBTKBLK,NEWBLOCK,NEWFORM,NUM,ORD,SUMMARY,X,Y
+3 ;
+4 ;- Add all tool kit blocks
+5 SET FORMNM="TOOL KIT"
+6 SET (CNTB,CNTF)=0
SET NUM=1
+7 DO BMES^XPDUTL(">>> Adding MST Tool Kit blocks to the AICS Tool Kit...")
+8 ;
+9 ;- Display error msg and exit if Tool Kit not found
+10 IF '$ORDER(^IBE(357,"B",FORMNM,0))
DO TKERR
QUIT
+11 ;
+12 ;- Get blocks from Imp/Exp EF Block file
+13 SET ORD=""
FOR
SET ORD=$ORDER(^IBE(358.1,"D",ORD))
IF ORD=""
QUIT
SET BLK=0
FOR
SET BLK=$ORDER(^IBE(358.1,"D",ORD,BLK))
IF 'BLK
QUIT
Begin DoDot:1
+14 SET NAME=$PIECE($GET(^IBE(358.1,+BLK,0)),"^")
+15 ;
+16 ;- Not a tool kit block
+17 IF $PIECE($GET(^IBE(358.1,BLK,0)),"^",14)'=1
QUIT
+18 ;
+19 ;- Delete block if it already exists
+20 SET IBTKBLK=1
+21 SET IBDNM=""
FOR
SET IBDNM=$ORDER(^IBE(357.1,"B",IBDNM))
IF IBDNM=""
QUIT
SET IBDBLK=0
FOR
SET IBDBLK=+$ORDER(^IBE(357.1,"B",IBDNM,IBDBLK))
IF 'IBDBLK
QUIT
Begin DoDot:2
+22 IF $PIECE($GET(^IBE(357.1,IBDBLK,0)),"^")=NAME
DO DLTBLK^IBDFU3(IBDBLK,"",357.1)
End DoDot:2
+23 SET NEWBLOCK=$$COPYBLK^IBDFU2(BLK,$$TKFORM^IBDFU2C,358.1,357.1,"","",$$TKORDER^IBDF13)
+24 SET CNTB=CNTB+1
+25 IF $GET(NEWBLOCK)
DO DLTBLK^IBDFU3(BLK,"",358.1)
+26 ;
+27 ;- Add block name to array (used in summary at end)
+28 SET SUMMARY(NUM)=NAME
+29 SET NUM=NUM+1
+30 ;
+31 ;- Display msg to user
+32 DO BMES^XPDUTL(">>> Moving encounter form block "_$GET(NAME)_" from")
+33 DO MES^XPDUTL(" AICS Import/Export files to AICS Tool Kit.")
End DoDot:1
+34 ;
+35 ;- Clear workspace
+36 DO DLTALL^IBDE2
+37 DO BMES^XPDUTL("... completed.")
+38 ;
SUMM ;- EF block summary displayed to user
+1 DO BMES^XPDUTL("Summary of Encounter Form Blocks Added to Tool Kit:")
+2 DO MES^XPDUTL("===================================================")
+3 DO MES^XPDUTL("")
+4 FOR IBDX=0:0
SET IBDX=$ORDER(SUMMARY(IBDX))
IF 'IBDX
QUIT
Begin DoDot:1
+5 DO MES^XPDUTL($GET(SUMMARY(IBDX)))
End DoDot:1
+6 IF '$DATA(SUMMARY)
Begin DoDot:1
+7 DO MES^XPDUTL(">>> ERROR: Missing data in IMP/EXP ENCOUNTER FORM BLOCK file (#358.1).")
+8 DO MES^XPDUTL(">>> No Encounter Form Blocks were installed. Please contact National")
+9 DO MES^XPDUTL(">>> Vista Support for assistance.")
End DoDot:1
+10 QUIT
+11 ;
+12 ;
TKERR ;- Display error msg if Tool Kit not found
+1 DO BMES^XPDUTL(">>> ERROR: No AICS Tool Kit found. New encounter form blocks can not be")
+2 DO MES^XPDUTL(">>> installed. Please contact National Vista Support for assistance.")
+3 QUIT
+4 ;
+5 ;
LIST ;- List of encounter form blocks
+1 ;;HIDDEN CLASSICATIONS
+2 ;;HIDDEN CLASSIFICATIONS
+3 ;;SC CONDITIONS
+4 ;;BASIC DEMOGRAPHICS
+5 ;;HIDDEN SC TREATMENT QUESTIONS
+6 ;;QUIT