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

RORP029.m

Go to the documentation of this file.
  1. RORP029 ;ALB/TK - CCR PRE/POST-INSTALL PATCH 29 ;29 Jul 2014 4:02 PM
  1. ;;1.5;CLINICAL CASE REGISTRIES;**29**;Feb 17, 2006;Build 18
  1. ;
  1. ; This routine uses the following IAs:
  1. ; #3277 OWNSKEY^XUSRB (supported)
  1. ; #10141 BMES^XPDUTL
  1. ; MES^XPDUTL
  1. ; #2056 GET1^DIQ (supported)
  1. ; #2053 UPDATE^DIE (supported)
  1. ; #2054 CLEAN^DILF (supported)
  1. ;
  1. ;******************************************************************************
  1. ;******************************************************************************
  1. ; --- ROUTINE MODIFICATION LOG ---
  1. ;
  1. ;PKG/PATCH DATE DEVELOPER MODIFICATION
  1. ;----------- ---------- ----------- ----------------------------------------
  1. ;ROR*1.5*29 APR 2016 T KOPP Patch 29 pre and post install
  1. ;******************************************************************************
  1. ;******************************************************************************
  1. ;
  1. Q
  1. ;Pre-Install routine for Patch 29
  1. PRE ;
  1. ; CHECK FOR ROR VA IRM KEY, ABORT IF USER DOES NOT POSSESS
  1. N RORKEYOK
  1. D BMES^XPDUTL("Verifying installing user has the ROR VA IRM security key")
  1. D OWNSKEY^XUSRB(.RORKEYOK,"ROR VA IRM",DUZ)
  1. I '$G(RORKEYOK(0)) D Q
  1. . S XPDABORT=1
  1. . D BMES^XPDUTL("****** INSTALL ABORTED!!! ******")
  1. . D BMES^XPDUTL("This patch can only be installed by a user who is assigned the ROR VA IRM key")
  1. . D BMES^XPDUTL("Restart the installation again once the appropriate key has been assigned")
  1. D BMES^XPDUTL(" User has the ROR VA IRM key - OK to install")
  1. Q
  1. ;
  1. ;Post-Install routine for Patch 29
  1. POST ;
  1. D BMES^XPDUTL("Post install started")
  1. D BMES^XPDUTL("Adding new reports to all registries")
  1. D UPDREG
  1. ;
  1. D BMES^XPDUTL("Adding new selection panel to reports")
  1. D UPDPAN
  1. ;
  1. D CLEAN^DILF
  1. D BMES^XPDUTL("Post install completed")
  1. Q
  1. ;
  1. UPDREG ; Add new reports to all registries
  1. N CT,DIERR,RORDATA,REGNAME,REGIEN,RORERR,RORFDA,RORMSG,X,Y,Z
  1. S REGIEN=0 F S REGIEN=$O(^ROR(798.1,REGIEN)) Q:'REGIEN D
  1. . ; Extract field #27 AVAILABLE REPORTS - Quit if "24,25" already exists in the record . Add ,24,25 to report list
  1. . ; VA HEPB registry does not have report 25
  1. . S RORDATA=$$GET1^DIQ(798.1,REGIEN_",",27,"I")
  1. . S REGNAME=$P($$REGNAME^RORUTL01(REGIEN),U)
  1. . I RORDATA[$S(REGNAME'="VA HEPB":"24,25",1:",24") D Q
  1. .. D BMES^XPDUTL(" o New reports already exist for registry #"_REGIEN)
  1. . K RORFDA,RORMSG
  1. . S RORFDA(798.1,REGIEN_",",27)=RORDATA_",24"_$S(REGNAME'="VA HEPB":",25",1:"")
  1. . D UPDATE^DIE("","RORFDA",,"RORMSG")
  1. . I $D(DIERR) D Q
  1. .. K RORERR
  1. .. D DBS^RORERR("RORMSG",-112,,,798.1,REGIEN)
  1. .. M RORMSG=RORERR
  1. .. K RORERR
  1. .. S RORERR(1)=" Update of registry "_$P($G(^ROR(798.1,REGIEN,0)),U)_" with new reports"
  1. .. S RORERR(2)=" encountered the following error. Please report this error to your CCR contact:"
  1. .. S RORERR(3)=""
  1. .. S Z=0,CT=3 F S Z=$O(RORMSG("DIERR",1,"TEXT",Z)) Q:'Z S CT=CT+1,RORERR(CT)=$J("",10)_$G(RORMSG("DIERR",1,"TEXT",Z))
  1. .. S CT=CT+1,RORERR(CT)=" "
  1. .. D MES^XPDUTL(.RORERR)
  1. D COMPL
  1. Q
  1. ;
  1. UPDPAN ; Add new panel to all reports with OTHER DIAGNOSIS panel
  1. N CT,DIERR,P1,P2,RORDATA,RORRPT,RORERR,RORFDA,RORMSG,X,Y,Z
  1. S RORRPT=0 F S RORRPT=$O(^ROR(799.34,RORRPT)) Q:'RORRPT D
  1. . ; Extract field #1 PARAMETER PANELS - Quit if ",190," already exists in the record . Add ,190 after ,180
  1. . S RORDATA=$$GET1^DIQ(799.34,RORRPT_",",1,"I")
  1. . Q:RORDATA'["180"
  1. . I RORDATA[",180,190" D Q
  1. .. D BMES^XPDUTL(" o New selection panel 190 already exists for report #"_RORRPT)
  1. . K RORFDA,RORMSG
  1. . S P1=$P(RORDATA,",180"),P2=$P(RORDATA,",180",2)
  1. . S RORFDA(799.34,RORRPT_",",1)=P1_",180,190"_P2
  1. . D UPDATE^DIE("","RORFDA",,"RORMSG")
  1. . I $D(DIERR) D Q
  1. .. K RORERR
  1. .. D DBS^RORERR("RORMSG",-112,,,799.34,RORRPT)
  1. .. M RORMSG=RORERR
  1. .. K RORERR
  1. .. S RORERR(1)=" Update of report "_$P($G(^ROR(799.34,RORRPT,0)),U)_" with new panel"
  1. .. S RORERR(2)=" encountered the following error. Please report this error to your CCR contact:"
  1. .. S RORERR(3)=""
  1. .. S Z=0,CT=3 F S Z=$O(RORMSG("DIERR",1,"TEXT",Z)) Q:'Z S CT=CT+1,RORERR(CT)=$J("",10)_$G(RORMSG("DIERR",1,"TEXT",Z))
  1. .. S CT=CT+1,RORERR(CT)=" "
  1. .. D MES^XPDUTL(.RORERR)
  1. D COMPL
  1. Q
  1. ;
  1. COMPL ;
  1. D BMES^XPDUTL(" >> Step complete")
  1. Q
  1. ;