BAREV820 ; IHS/SD/LSL - ENVIRONMENT CHECK V1.8 PATCH 820; 06/01/2010
;;1.8;IHS ACCOUNTS RECEIVABLE;**20**;OCT 26,2005
;
K XPDQUIT ;CLEAR FLAG
I '$G(DUZ) D Q
. W !,"DUZ UNDEFINED OR 0"
. D SORRY(2)
;
I '$L($G(DUZ(0))) D Q
. W !,"DUZ(0) UNDEFINED OR NULL"
. D SORRY(2)
;
S X=$P(^VA(200,DUZ,0),U) ;User's name
W !!,$$CJ^XLFSTR("Hello, "_$P(X,",",2)_" "_$P(X,","),IOM)
W !!,$$CJ^XLFSTR("Checking Environment for "_$P($T(+2),";",4)_" V "_$P($T(+2),";",3),IOM)
;
N BARXU
S BARXU=$$INSTALLD("XU","8.0",1011) ;Find current Kernel version and patch
I $P(BARXU,"*",2)<8 S BARXU=0
I $P(BARXU,"*",3)'=1011 S BARXU=0
W !,$$CJ^XLFSTR("Need at least XU v8.0 Patch 1011..... "_$S(BARXU=0:"NOT ",1:"")_"Present",IOM)
I BARXU=0 D SORRY(2)
;
I $$VCHK("DI","22.0",2) ;FileMan V22.0
;
N BARXB
S BARXB=$$INSTALLD("XB","2.6",11) ;Find current IHS utilities version and patch
I $P(BARXB,"*",2)<3 S BARXB=0
I $P(BARXU,"*",3)'=11 S BARXU=0
;
I $$VCHK("BAR","1.8",2) ;Accounts Receivable V1.8
;A/R IS NO LONGER CUMULATIVE AFTER PATCH 6
;LAST CUMULATIVE PATCH WAS PATCH 6
N BAR,I
F I=6:1:7,9,10,12,13,14,15,16,17,18,19 D
.S BAR=$$INSTALLD("BAR","1.8",I)
.I $P(BAR,"*",3)'=I S BAR=0 D
..W !,$$CJ^XLFSTR("Need Accounts Receivable v1.8 Patch "_I_"..... "_$S(BAR=0:"NOT ",1:"")_"Present",IOM)
I BAR=0 D SORRY(2)
;
3PB N BARABM
S BARABM=$$INSTALLD("ABM","2.6",4)
I $P(BARABM,"*",2)<2.6 S BARABM=0
I $P(BARABM,"*",3)<4 S BARABM=0
W !,$$CJ^XLFSTR("Need at least Third Party Billing v2.6 Patch 4..... "_$S(BARABM=0:"NOT ",1:"")_"Present",IOM)
I BARABM=0 D SORRY(2)
;
N DA,DIC
S X="BAR"
S DIC="^DIC(9.4,"
S DIC(0)=""
S D="C"
D IX^DIC
I Y<0,$D(^DIC(9.4,"C","BAR")) D
. W !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM)
. W !,$$CJ^XLFSTR("PACKAGE File with an ""BAR"" prefix.",IOM)
. W !,$$CJ^XLFSTR("One entry needs to be deleted.",IOM)
. D SORRY(2)
. Q
;
I $G(XPDQUIT) W !,$$CJ^XLFSTR("FIX IT! Before Proceeding.",IOM),!!,*7,*7,*7 Q
;
W !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
D HELP^XBHELP("INTROE","BAREV810")
;
I $G(XPDENV)=1 D
. ; The following line prevents the "Disable Options..." and "Move
. ; Routines..." questions from being asked during the install.
. S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
. D HELP^XBHELP("INTROI","BAREV810")
. Q
;
I '$$DIR^XBDIR("E","","","","","",1) D SORRY(2)
Q
PRE ;EP - Pre-install
K DIC,DIE,DIR,DIK,X,Y,DA
S DIK="^BARTBL("
S DA=772
D ^DIK
;
S X1=DT
S X2=-365
D C^%DTC
S BAREDT=$$SDT^BARDUTL(X)
D MES^XPDUTL("Checking for ERAs uploaded after "_BAREDT_" that aren't completely posted...")
S BARFIRST=0
S BARHOLD=DUZ(2)
S DUZ(2)=0
F S DUZ(2)=$O(^BAREDI("I",DUZ(2))) Q:'DUZ(2) D
.S ERAFILE=""
.F S ERAFILE=$O(^BAREDI("I",DUZ(2),"B",ERAFILE),-1) Q:$G(ERAFILE)="" D Q:($P(ERAFILE,"_",3)<BAREDT)
..I $P(ERAFILE,"_",3)<BAREDT Q ;ERA file is more than 1 year old
..S IMPDA=0
..F S IMPDA=$O(^BAREDI("I",DUZ(2),"B",ERAFILE,IMPDA)) Q:'IMPDA D
...S BARPFLG=0,BARFLG=0
...S CLMDA=0
...F S CLMDA=$O(^BAREDI("I",DUZ(2),IMPDA,30,CLMDA)) Q:'CLMDA D
....S CLMSTAT=$P($G(^BAREDI("I",DUZ(2),IMPDA,30,CLMDA,0)),U,2)
....I CLMSTAT="P" S BARPFLG=1
....I CLMSTAT'="P" S BARFLG=1
...I BARPFLG=1&(BARFLG=1) D
....S DTTM=$$GET1^DIQ(90056.02,IMPDA,.02,"E")
....S HOSTF=$$GET1^DIQ(90056.02,IMPDA,.05,"E")
....S LOC=$$GET1^DIQ(9999999.06,DUZ(2),.02,"E")
....I BARFIRST=0 S BARFIRST=1 W ! D BMES^XPDUTL("LOCATION ERA FILE HOSTFILE")
....D MES^XPDUTL(LOC_" "_ERAFILE_" "_HOSTF)
....S BARMFLG=1
I +$G(BARMFLG)=1 D
.D BMES^XPDUTL("The above list indicates files that may contain one or more checks that are not")
.D MES^XPDUTL("posted to completion.")
.D BMES^XPDUTL("Please post all possible ERAs prior to installing patch 20.")
.D MES^XPDUTL("Any incomplete ERAs will need OIT assistance in posting once patch 20 is")
.D MES^XPDUTL("installed.")
S DUZ(2)=BARHOLD
Q
;
POST ;EP - POST INSTALL
;
D EN^BARADJR3 ;update SARs and Table Types
;
D BMES^XPDUTL("Post-install routine is complete.")
Q
;
;
;
SORRY(X) ;
KILL DIFQ
S XPDQUIT=X
W *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
Q
; ***
VCHK(BARPRE,BARVER,BARQUIT) ; Check versions needed.
;
N BARV
S BARV=$$VERSION^XPDUTL(BARPRE)
W !,$$CJ^XLFSTR("Need at least "_BARPRE_" v "_BARVER_"....."_BARPRE_" v "_BARV_" Present",IOM)
I BARV<BARVER KILL DIFQ S XPDQUIT=BARQUIT D SORRY(BARQUIT) Q 0
Q 1
; ***
INSTALLD(BARNM,BARVR,BARPT) ;EP ;RLT
; RLT - 04/05/05 - Per Don Jackson, modified this tag to use
; PATCH^XPDUTL. Removed the reverse $O, problem
; with XU patch numbers. VA (lower than 1000) and
; IHS patch numers (1000 and higher) not loaded
; in numerical order. No longer
; verifies that a lower version did not get
; reinstalled over a higher version.
N BARVNUM,BARPATCH
;1 get current version
S BARVNUM=$$VERSION^XPDUTL(BARNM)
I '+BARVNUM Q 0
;2 is needed patch loaded
S BARPATCH=$$PATCH^XPDUTL(BARNM_"*"_BARVR_"*"_BARPT)
I '+BARPATCH Q 0
Q BARNM_"*"_BARVNUM_"*"_BARPT
;
; ********************************************************************
INTROE ; Intro text during KIDS Environment check.
;;This distribution Modifies Accounts Receivable and does not contain
;;previous patch modifications for version 1.8.
;;
;; This patch is **not** cumulative.
;;
;;###
;;
;
INTROI ; Intro text during KIDS Install.
;;If you run interactively, results will be displayed on your screen,
;;and recorded in the entry in the INSTALL file.
;;If you queue to TaskMan, remember not to Q to the HOME device.
;;###
BAREV820 ; IHS/SD/LSL - ENVIRONMENT CHECK V1.8 PATCH 820; 06/01/2010
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**20**;OCT 26,2005
+2 ;
+3 ;CLEAR FLAG
KILL XPDQUIT
+4 IF '$GET(DUZ)
Begin DoDot:1
+5 WRITE !,"DUZ UNDEFINED OR 0"
+6 DO SORRY(2)
End DoDot:1
QUIT
+7 ;
+8 IF '$LENGTH($GET(DUZ(0)))
Begin DoDot:1
+9 WRITE !,"DUZ(0) UNDEFINED OR NULL"
+10 DO SORRY(2)
End DoDot:1
QUIT
+11 ;
+12 ;User's name
SET X=$PIECE(^VA(200,DUZ,0),U)
+13 WRITE !!,$$CJ^XLFSTR("Hello, "_$PIECE(X,",",2)_" "_$PIECE(X,","),IOM)
+14 WRITE !!,$$CJ^XLFSTR("Checking Environment for "_$PIECE($TEXT(+2),";",4)_" V "_$PIECE($TEXT(+2),";",3),IOM)
+15 ;
+16 NEW BARXU
+17 ;Find current Kernel version and patch
SET BARXU=$$INSTALLD("XU","8.0",1011)
+18 IF $PIECE(BARXU,"*",2)<8
SET BARXU=0
+19 IF $PIECE(BARXU,"*",3)'=1011
SET BARXU=0
+20 WRITE !,$$CJ^XLFSTR("Need at least XU v8.0 Patch 1011..... "_$SELECT(BARXU=0:"NOT ",1:"")_"Present",IOM)
+21 IF BARXU=0
DO SORRY(2)
+22 ;
+23 ;FileMan V22.0
IF $$VCHK("DI","22.0",2)
+24 ;
+25 NEW BARXB
+26 ;Find current IHS utilities version and patch
SET BARXB=$$INSTALLD("XB","2.6",11)
+27 IF $PIECE(BARXB,"*",2)<3
SET BARXB=0
+28 IF $PIECE(BARXU,"*",3)'=11
SET BARXU=0
+29 ;
+30 ;Accounts Receivable V1.8
IF $$VCHK("BAR","1.8",2)
+31 ;A/R IS NO LONGER CUMULATIVE AFTER PATCH 6
+32 ;LAST CUMULATIVE PATCH WAS PATCH 6
+33 NEW BAR,I
+34 FOR I=6:1:7,9,10,12,13,14,15,16,17,18,19
Begin DoDot:1
+35 SET BAR=$$INSTALLD("BAR","1.8",I)
+36 IF $PIECE(BAR,"*",3)'=I
SET BAR=0
Begin DoDot:2
+37 WRITE !,$$CJ^XLFSTR("Need Accounts Receivable v1.8 Patch "_I_"..... "_$SELECT(BAR=0:"NOT ",1:"")_"Present",IOM)
End DoDot:2
End DoDot:1
+38 IF BAR=0
DO SORRY(2)
+39 ;
3PB NEW BARABM
+1 SET BARABM=$$INSTALLD("ABM","2.6",4)
+2 IF $PIECE(BARABM,"*",2)<2.6
SET BARABM=0
+3 IF $PIECE(BARABM,"*",3)<4
SET BARABM=0
+4 WRITE !,$$CJ^XLFSTR("Need at least Third Party Billing v2.6 Patch 4..... "_$SELECT(BARABM=0:"NOT ",1:"")_"Present",IOM)
+5 IF BARABM=0
DO SORRY(2)
+6 ;
+7 NEW DA,DIC
+8 SET X="BAR"
+9 SET DIC="^DIC(9.4,"
+10 SET DIC(0)=""
+11 SET D="C"
+12 DO IX^DIC
+13 IF Y<0
IF $DATA(^DIC(9.4,"C","BAR"))
Begin DoDot:1
+14 WRITE !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM)
+15 WRITE !,$$CJ^XLFSTR("PACKAGE File with an ""BAR"" prefix.",IOM)
+16 WRITE !,$$CJ^XLFSTR("One entry needs to be deleted.",IOM)
+17 DO SORRY(2)
+18 QUIT
End DoDot:1
+19 ;
+20 IF $GET(XPDQUIT)
WRITE !,$$CJ^XLFSTR("FIX IT! Before Proceeding.",IOM),!!,*7,*7,*7
QUIT
+21 ;
+22 WRITE !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
+23 DO HELP^XBHELP("INTROE","BAREV810")
+24 ;
+25 IF $GET(XPDENV)=1
Begin DoDot:1
+26 ; The following line prevents the "Disable Options..." and "Move
+27 ; Routines..." questions from being asked during the install.
+28 SET (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
+29 DO HELP^XBHELP("INTROI","BAREV810")
+30 QUIT
End DoDot:1
+31 ;
+32 IF '$$DIR^XBDIR("E","","","","","",1)
DO SORRY(2)
+33 QUIT
PRE ;EP - Pre-install
+1 KILL DIC,DIE,DIR,DIK,X,Y,DA
+2 SET DIK="^BARTBL("
+3 SET DA=772
+4 DO ^DIK
+5 ;
+6 SET X1=DT
+7 SET X2=-365
+8 DO C^%DTC
+9 SET BAREDT=$$SDT^BARDUTL(X)
+10 DO MES^XPDUTL("Checking for ERAs uploaded after "_BAREDT_" that aren't completely posted...")
+11 SET BARFIRST=0
+12 SET BARHOLD=DUZ(2)
+13 SET DUZ(2)=0
+14 FOR
SET DUZ(2)=$ORDER(^BAREDI("I",DUZ(2)))
IF 'DUZ(2)
QUIT
Begin DoDot:1
+15 SET ERAFILE=""
+16 FOR
SET ERAFILE=$ORDER(^BAREDI("I",DUZ(2),"B",ERAFILE),-1)
IF $GET(ERAFILE)=""
QUIT
Begin DoDot:2
+17 ;ERA file is more than 1 year old
IF $PIECE(ERAFILE,"_",3)<BAREDT
QUIT
+18 SET IMPDA=0
+19 FOR
SET IMPDA=$ORDER(^BAREDI("I",DUZ(2),"B",ERAFILE,IMPDA))
IF 'IMPDA
QUIT
Begin DoDot:3
+20 SET BARPFLG=0
SET BARFLG=0
+21 SET CLMDA=0
+22 FOR
SET CLMDA=$ORDER(^BAREDI("I",DUZ(2),IMPDA,30,CLMDA))
IF 'CLMDA
QUIT
Begin DoDot:4
+23 SET CLMSTAT=$PIECE($GET(^BAREDI("I",DUZ(2),IMPDA,30,CLMDA,0)),U,2)
+24 IF CLMSTAT="P"
SET BARPFLG=1
+25 IF CLMSTAT'="P"
SET BARFLG=1
End DoDot:4
+26 IF BARPFLG=1&(BARFLG=1)
Begin DoDot:4
+27 SET DTTM=$$GET1^DIQ(90056.02,IMPDA,.02,"E")
+28 SET HOSTF=$$GET1^DIQ(90056.02,IMPDA,.05,"E")
+29 SET LOC=$$GET1^DIQ(9999999.06,DUZ(2),.02,"E")
+30 IF BARFIRST=0
SET BARFIRST=1
WRITE !
DO BMES^XPDUTL("LOCATION ERA FILE HOSTFILE")
+31 DO MES^XPDUTL(LOC_" "_ERAFILE_" "_HOSTF)
+32 SET BARMFLG=1
End DoDot:4
End DoDot:3
End DoDot:2
IF ($PIECE(ERAFILE,"_",3)<BAREDT)
QUIT
End DoDot:1
+33 IF +$GET(BARMFLG)=1
Begin DoDot:1
+34 DO BMES^XPDUTL("The above list indicates files that may contain one or more checks that are not")
+35 DO MES^XPDUTL("posted to completion.")
+36 DO BMES^XPDUTL("Please post all possible ERAs prior to installing patch 20.")
+37 DO MES^XPDUTL("Any incomplete ERAs will need OIT assistance in posting once patch 20 is")
+38 DO MES^XPDUTL("installed.")
End DoDot:1
+39 SET DUZ(2)=BARHOLD
+40 QUIT
+41 ;
POST ;EP - POST INSTALL
+1 ;
+2 ;update SARs and Table Types
DO EN^BARADJR3
+3 ;
+4 DO BMES^XPDUTL("Post-install routine is complete.")
+5 QUIT
+6 ;
+7 ;
+8 ;
SORRY(X) ;
+1 KILL DIFQ
+2 SET XPDQUIT=X
+3 WRITE *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
+4 QUIT
+5 ; ***
VCHK(BARPRE,BARVER,BARQUIT) ; Check versions needed.
+1 ;
+2 NEW BARV
+3 SET BARV=$$VERSION^XPDUTL(BARPRE)
+4 WRITE !,$$CJ^XLFSTR("Need at least "_BARPRE_" v "_BARVER_"....."_BARPRE_" v "_BARV_" Present",IOM)
+5 IF BARV<BARVER
KILL DIFQ
SET XPDQUIT=BARQUIT
DO SORRY(BARQUIT)
QUIT 0
+6 QUIT 1
+7 ; ***
INSTALLD(BARNM,BARVR,BARPT) ;EP ;RLT
+1 ; RLT - 04/05/05 - Per Don Jackson, modified this tag to use
+2 ; PATCH^XPDUTL. Removed the reverse $O, problem
+3 ; with XU patch numbers. VA (lower than 1000) and
+4 ; IHS patch numers (1000 and higher) not loaded
+5 ; in numerical order. No longer
+6 ; verifies that a lower version did not get
+7 ; reinstalled over a higher version.
+8 NEW BARVNUM,BARPATCH
+9 ;1 get current version
+10 SET BARVNUM=$$VERSION^XPDUTL(BARNM)
+11 IF '+BARVNUM
QUIT 0
+12 ;2 is needed patch loaded
+13 SET BARPATCH=$$PATCH^XPDUTL(BARNM_"*"_BARVR_"*"_BARPT)
+14 IF '+BARPATCH
QUIT 0
+15 QUIT BARNM_"*"_BARVNUM_"*"_BARPT
+16 ;
+17 ; ********************************************************************
INTROE ; Intro text during KIDS Environment check.
+1 ;;This distribution Modifies Accounts Receivable and does not contain
+2 ;;previous patch modifications for version 1.8.
+3 ;;
+4 ;; This patch is **not** cumulative.
+5 ;;
+6 ;;###
+7 ;;
+8 ;
INTROI ; Intro text during KIDS Install.
+1 ;;If you run interactively, results will be displayed on your screen,
+2 ;;and recorded in the entry in the INSTALL file.
+3 ;;If you queue to TaskMan, remember not to Q to the HOME device.
+4 ;;###