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

ABSPOSEC.m

Go to the documentation of this file.
  1. 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
  1. ;
  1. ; This routine is an environment checker used with the installation
  1. ; of patch 1 of the Point of Sale software.
  1. ; It will check for the following RPMS packages, their version
  1. ; and patch numbers before allowing the user to continue
  1. ; with the installation of patch 1 for Point of Sale:
  1. ;
  1. ; Fileman (DI) v21
  1. ; Kernel (XU) v8.0
  1. ; IHS Patient Dictionaries (AUPN) V99.1
  1. ; IHS Dictionary Pointers (AUT) V98.1, patch 8
  1. ; Outpatient Pharmacy (PSO) V6.0 patch 3
  1. ; Pharmacy Point of Sale (ABSP) V1.0
  1. ;
  1. ; (XPDQUIT will be set to 2 if the above mention packages are not
  1. ; at the require version and patch level. 2 indicates that
  1. ; the KIDS install will abort the installation, but will leave the
  1. ; ^XTMP global in place.)
  1. ;
  1. ;
  1. CHECK ;EP - called from Kids install routine
  1. ; First let's make sure they have DUZ(0) defined, and greet the user
  1. ;
  1. N ABSPERS,X,ABSPMSG
  1. I '$G(DUZ) W !,"DUZ UNDEFINED OR 0." D SORRY(2) Q
  1. I '$L($G(DUZ(0))) W !,"DUZ(0) UNDEFINED OR NULL." D SORRY(2) Q
  1. ;
  1. S ABSPERS=$P($G(^VA(200,DUZ,0)),U)
  1. W !!,$$CJ^XLFSTR("Hello, "_$P(ABSPERS,",",2)_" "_$P(ABSPERS,","),IOM)
  1. W !!,$$CJ^XLFSTR("Checking Environment for "_$P($T(+2),";",4)_" Ver: "_$P($T(+2),";",3)_" Patch: "_$P($T(+2),";",5)_".",IOM),!
  1. ;
  1. ;now lets get the the nitty gritty and check the packages
  1. ; and their versions
  1. ;
  1. Q:'$$VCHK("DI","21.0",2)
  1. Q:'$$VCHK("XU","8.0",2)
  1. Q:'$$VCHK("AUPN","99.1",2)
  1. Q:'$$VCHK("AUT","98.1",2)
  1. Q:'$$VCHK("PSO","6.0",2)
  1. Q:'$$VCHK("ABSP","1.0",2)
  1. W !!
  1. ;
  1. ; okay - we have the packages, and they are on the right version
  1. ; but lets check for a couple of patchs
  1. ;
  1. ; first outpatient pharmacy patch 3 - not in package or kids file
  1. ; so we will look for a routine that was new in patch 3
  1. ;
  1. S X="APSQUTL" X ^%ZOSF("TEST")
  1. I '$T S ABSPMSG="Outpatient Pharmacy V6.0 Patch 3 MUST be loaded to continue." D SORRY(ABSPMSG,2)
  1. ;
  1. ; now let's see if IHS dictionary pointers have at least patch 8
  1. ;
  1. S ABSPPK="AUT*98.1*8"
  1. S ABSPPTCH=$$INSTALLD(ABSPPK)
  1. I 'ABSPPTCH S ABSPMSG="IHS Dictionary Pointers (AUT) must be at V98.1 patch 8 to continue with this load" D SORRY(ABSPMSG,2)
  1. ;
  1. ;
  1. Q
  1. ;
  1. VCHK(ABSPPRE,ABSPVER,ABSPQUIT) ; Check versions needed
  1. ;
  1. NEW ABSPV
  1. S ABSPV=$$VERSION^XPDUTL(ABSPPRE)
  1. W !,$$CJ^XLFSTR("Need at least "_ABSPPRE_" v "_ABSPVER_"....."_ABSPPRE_" v "_ABSPV_" Present ",IOM)
  1. I ABSPV<ABSPVER KILL DIFQ S XPDQUIT=ABSPQUIT W *7,!,$$CJ^XLFSTR("Sorry....",IOM) S ABSPV=$$DIR^XBDIR("E","Press RETURN") Q 0
  1. Q 1
  1. ;
  1. ;
  1. INSTALLD(ABSPPKG) ;check for a specific patch
  1. ; ABSPPKG in the form of AUT*98.1*8
  1. ;
  1. N DIC,X,Y
  1. ;
  1. ;lookup the package
  1. S X=$P(ABSPPKG,"*",1)
  1. S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
  1. D IX^DIC
  1. I Y<1 Q 0
  1. ;
  1. ; lookup the version
  1. S DIC=DIC_+Y_",22,",X=$P(ABSPPKG,"*",2)
  1. D ^DIC
  1. I Y<1 Q 0
  1. ;
  1. ;lookup the patch
  1. ;
  1. S DIC=DIC_+Y_",""PAH"",",X=$P(ABSPPKG,"*",3)
  1. D ^DIC
  1. Q $S(Y<1:0,1:1)
  1. ;
  1. ;
  1. SORRY(ABSPMSG,ABSPCD) ; let the user know we didn't have what we needed
  1. ;
  1. K DIFQ
  1. S XPDQUIT=ABSPCD
  1. I $T W !,$$CJ^XLFSTR(ABSPMSG,IOM)
  1. W *7,!,$$CJ^XLFSTR("Sorry.....",IOM),$$DIR^XBDIR("E","Press RETURN")
  1. Q
  1. ;