- ABSPOSEC ; IHS/SD/lwj - Point of Sale environment checker [ 05/28/2002 10:03 AM ]
- ;;1.0;PHARMACY POINT OF SALE;**1**;JUN 21, 2001
- ;
- ; This routine is an environment checker used with the installation
- ; of patch 1 of the Point of Sale software.
- ; It will check for the following RPMS packages, their version
- ; and patch numbers before allowing the user to continue
- ; with the installation of patch 1 for Point of Sale:
- ;
- ; Fileman (DI) v21
- ; Kernel (XU) v8.0
- ; IHS Patient Dictionaries (AUPN) V99.1
- ; IHS Dictionary Pointers (AUT) V98.1, patch 8
- ; Outpatient Pharmacy (PSO) V6.0 patch 3
- ; Pharmacy Point of Sale (ABSP) V1.0
- ;
- ; (XPDQUIT will be set to 2 if the above mention packages are not
- ; at the require version and patch level. 2 indicates that
- ; the KIDS install will abort the installation, but will leave the
- ; ^XTMP global in place.)
- ;
- ;
- CHECK ;EP - called from Kids install routine
- ; First let's make sure they have DUZ(0) defined, and greet the user
- ;
- N ABSPERS,X,ABSPMSG
- I '$G(DUZ) W !,"DUZ UNDEFINED OR 0." D SORRY(2) Q
- I '$L($G(DUZ(0))) W !,"DUZ(0) UNDEFINED OR NULL." D SORRY(2) Q
- ;
- S ABSPERS=$P($G(^VA(200,DUZ,0)),U)
- W !!,$$CJ^XLFSTR("Hello, "_$P(ABSPERS,",",2)_" "_$P(ABSPERS,","),IOM)
- W !!,$$CJ^XLFSTR("Checking Environment for "_$P($T(+2),";",4)_" Ver: "_$P($T(+2),";",3)_" Patch: "_$P($T(+2),";",5)_".",IOM),!
- ;
- ;now lets get the the nitty gritty and check the packages
- ; and their versions
- ;
- Q:'$$VCHK("DI","21.0",2)
- Q:'$$VCHK("XU","8.0",2)
- Q:'$$VCHK("AUPN","99.1",2)
- Q:'$$VCHK("AUT","98.1",2)
- Q:'$$VCHK("PSO","6.0",2)
- Q:'$$VCHK("ABSP","1.0",2)
- W !!
- ;
- ; okay - we have the packages, and they are on the right version
- ; but lets check for a couple of patchs
- ;
- ; first outpatient pharmacy patch 3 - not in package or kids file
- ; so we will look for a routine that was new in patch 3
- ;
- S X="APSQUTL" X ^%ZOSF("TEST")
- I '$T S ABSPMSG="Outpatient Pharmacy V6.0 Patch 3 MUST be loaded to continue." D SORRY(ABSPMSG,2)
- ;
- ; now let's see if IHS dictionary pointers have at least patch 8
- ;
- S ABSPPK="AUT*98.1*8"
- S ABSPPTCH=$$INSTALLD(ABSPPK)
- I 'ABSPPTCH S ABSPMSG="IHS Dictionary Pointers (AUT) must be at V98.1 patch 8 to continue with this load" D SORRY(ABSPMSG,2)
- ;
- ;
- Q
- ;
- VCHK(ABSPPRE,ABSPVER,ABSPQUIT) ; Check versions needed
- ;
- NEW ABSPV
- S ABSPV=$$VERSION^XPDUTL(ABSPPRE)
- W !,$$CJ^XLFSTR("Need at least "_ABSPPRE_" v "_ABSPVER_"....."_ABSPPRE_" v "_ABSPV_" Present ",IOM)
- I ABSPV<ABSPVER KILL DIFQ S XPDQUIT=ABSPQUIT W *7,!,$$CJ^XLFSTR("Sorry....",IOM) S ABSPV=$$DIR^XBDIR("E","Press RETURN") Q 0
- Q 1
- ;
- ;
- INSTALLD(ABSPPKG) ;check for a specific patch
- ; ABSPPKG in the form of AUT*98.1*8
- ;
- N DIC,X,Y
- ;
- ;lookup the package
- S X=$P(ABSPPKG,"*",1)
- S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
- D IX^DIC
- I Y<1 Q 0
- ;
- ; lookup the version
- S DIC=DIC_+Y_",22,",X=$P(ABSPPKG,"*",2)
- D ^DIC
- I Y<1 Q 0
- ;
- ;lookup the patch
- ;
- S DIC=DIC_+Y_",""PAH"",",X=$P(ABSPPKG,"*",3)
- D ^DIC
- Q $S(Y<1:0,1:1)
- ;
- ;
- SORRY(ABSPMSG,ABSPCD) ; let the user know we didn't have what we needed
- ;
- K DIFQ
- S XPDQUIT=ABSPCD
- I $T W !,$$CJ^XLFSTR(ABSPMSG,IOM)
- W *7,!,$$CJ^XLFSTR("Sorry.....",IOM),$$DIR^XBDIR("E","Press RETURN")
- Q
- ;
- ABSPOSEC ; IHS/SD/lwj - Point of Sale environment checker [ 05/28/2002 10:03 AM ]
- +1 ;;1.0;PHARMACY POINT OF SALE;**1**;JUN 21, 2001
- +2 ;
- +3 ; This routine is an environment checker used with the installation
- +4 ; of patch 1 of the Point of Sale software.
- +5 ; It will check for the following RPMS packages, their version
- +6 ; and patch numbers before allowing the user to continue
- +7 ; with the installation of patch 1 for Point of Sale:
- +8 ;
- +9 ; Fileman (DI) v21
- +10 ; Kernel (XU) v8.0
- +11 ; IHS Patient Dictionaries (AUPN) V99.1
- +12 ; IHS Dictionary Pointers (AUT) V98.1, patch 8
- +13 ; Outpatient Pharmacy (PSO) V6.0 patch 3
- +14 ; Pharmacy Point of Sale (ABSP) V1.0
- +15 ;
- +16 ; (XPDQUIT will be set to 2 if the above mention packages are not
- +17 ; at the require version and patch level. 2 indicates that
- +18 ; the KIDS install will abort the installation, but will leave the
- +19 ; ^XTMP global in place.)
- +20 ;
- +21 ;
- CHECK ;EP - called from Kids install routine
- +1 ; First let's make sure they have DUZ(0) defined, and greet the user
- +2 ;
- +3 NEW ABSPERS,X,ABSPMSG
- +4 IF '$GET(DUZ)
- WRITE !,"DUZ UNDEFINED OR 0."
- DO SORRY(2)
- QUIT
- +5 IF '$LENGTH($GET(DUZ(0)))
- WRITE !,"DUZ(0) UNDEFINED OR NULL."
- DO SORRY(2)
- QUIT
- +6 ;
- +7 SET ABSPERS=$PIECE($GET(^VA(200,DUZ,0)),U)
- +8 WRITE !!,$$CJ^XLFSTR("Hello, "_$PIECE(ABSPERS,",",2)_" "_$PIECE(ABSPERS,","),IOM)
- +9 WRITE !!,$$CJ^XLFSTR("Checking Environment for "_$PIECE($TEXT(+2),";",4)_" Ver: "_$PIECE($TEXT(+2),";",3)_" Patch: "_$PIECE($TEXT(+2),";",5)_".",IOM),!
- +10 ;
- +11 ;now lets get the the nitty gritty and check the packages
- +12 ; and their versions
- +13 ;
- +14 IF '$$VCHK("DI","21.0",2)
- QUIT
- +15 IF '$$VCHK("XU","8.0",2)
- QUIT
- +16 IF '$$VCHK("AUPN","99.1",2)
- QUIT
- +17 IF '$$VCHK("AUT","98.1",2)
- QUIT
- +18 IF '$$VCHK("PSO","6.0",2)
- QUIT
- +19 IF '$$VCHK("ABSP","1.0",2)
- QUIT
- +20 WRITE !!
- +21 ;
- +22 ; okay - we have the packages, and they are on the right version
- +23 ; but lets check for a couple of patchs
- +24 ;
- +25 ; first outpatient pharmacy patch 3 - not in package or kids file
- +26 ; so we will look for a routine that was new in patch 3
- +27 ;
- +28 SET X="APSQUTL"
- XECUTE ^%ZOSF("TEST")
- +29 IF '$TEST
- SET ABSPMSG="Outpatient Pharmacy V6.0 Patch 3 MUST be loaded to continue."
- DO SORRY(ABSPMSG,2)
- +30 ;
- +31 ; now let's see if IHS dictionary pointers have at least patch 8
- +32 ;
- +33 SET ABSPPK="AUT*98.1*8"
- +34 SET ABSPPTCH=$$INSTALLD(ABSPPK)
- +35 IF 'ABSPPTCH
- SET ABSPMSG="IHS Dictionary Pointers (AUT) must be at V98.1 patch 8 to continue with this load"
- DO SORRY(ABSPMSG,2)
- +36 ;
- +37 ;
- +38 QUIT
- +39 ;
- VCHK(ABSPPRE,ABSPVER,ABSPQUIT) ; Check versions needed
- +1 ;
- +2 NEW ABSPV
- +3 SET ABSPV=$$VERSION^XPDUTL(ABSPPRE)
- +4 WRITE !,$$CJ^XLFSTR("Need at least "_ABSPPRE_" v "_ABSPVER_"....."_ABSPPRE_" v "_ABSPV_" Present ",IOM)
- +5 IF ABSPV<ABSPVER
- KILL DIFQ
- SET XPDQUIT=ABSPQUIT
- WRITE *7,!,$$CJ^XLFSTR("Sorry....",IOM)
- SET ABSPV=$$DIR^XBDIR("E","Press RETURN")
- QUIT 0
- +6 QUIT 1
- +7 ;
- +8 ;
- INSTALLD(ABSPPKG) ;check for a specific patch
- +1 ; ABSPPKG in the form of AUT*98.1*8
- +2 ;
- +3 NEW DIC,X,Y
- +4 ;
- +5 ;lookup the package
- +6 SET X=$PIECE(ABSPPKG,"*",1)
- +7 SET DIC="^DIC(9.4,"
- SET DIC(0)="FM"
- SET D="C"
- +8 DO IX^DIC
- +9 IF Y<1
- QUIT 0
- +10 ;
- +11 ; lookup the version
- +12 SET DIC=DIC_+Y_",22,"
- SET X=$PIECE(ABSPPKG,"*",2)
- +13 DO ^DIC
- +14 IF Y<1
- QUIT 0
- +15 ;
- +16 ;lookup the patch
- +17 ;
- +18 SET DIC=DIC_+Y_",""PAH"","
- SET X=$PIECE(ABSPPKG,"*",3)
- +19 DO ^DIC
- +20 QUIT $SELECT(Y<1:0,1:1)
- +21 ;
- +22 ;
- SORRY(ABSPMSG,ABSPCD) ; let the user know we didn't have what we needed
- +1 ;
- +2 KILL DIFQ
- +3 SET XPDQUIT=ABSPCD
- +4 IF $TEST
- WRITE !,$$CJ^XLFSTR(ABSPMSG,IOM)
- +5 WRITE *7,!,$$CJ^XLFSTR("Sorry.....",IOM),$$DIR^XBDIR("E","Press RETURN")
- +6 QUIT
- +7 ;