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

PSO7P545.m

Go to the documentation of this file.
PSO7P545 ;DAL/JCH - Post Install routine for patch PSO*7*545 ;12/3/2018
 ;;7.0;OUTPATIENT PHARMACY;**545**;DEC 1997;Build 270
 ; Reference to ^VA(200 in ICR #10060
 ; Reference to ^VA(200 in ICR #7420
 ; Reference to ACCESS^XQCHK in ICR #10078
 ; Reference to LKOPT^XPDMENU in ICR #1157
 Q
 ;
POST ;
 D PUT^XPAR("SYS","PSOEPCS EXPIRED DEA FAILOVER",1,1)
 ;
 N BY,ENTRY,ERR,ROOT,WHEN,DUZ
 N DIFROM
 S DUZ=.5
 ;
 ; Check to see if PSO EPCS PSDRPH AUDIT is already scheduled.
 K ROOT D OPTSTAT^XUTMOPT("PSO EPCS PSDRPH AUDIT",.ROOT)
 I $D(ROOT(1)),$P(ROOT(1),"^",2)'="",$P(ROOT(1),"^",3)'="" G CONT1
 ;
 ; Change from XU EPCS PSDRPH AUDIT to PSO EPCS PSDRPH AUDIT
 K ROOT D OPTSTAT^XUTMOPT("XU EPCS PSDRPH AUDIT",.ROOT)
 I $D(ROOT(1)) F ENTRY=1:1:ROOT D
 . I $P(ROOT(ENTRY),"^",2)="" Q
 . I $P(ROOT(ENTRY),"^",3)="" Q
 . S WHEN=$P(ROOT(ENTRY),"^",2),BY=$P(ROOT(ENTRY),"^",3)
 . D RESCH^XUTMOPT("PSO EPCS PSDRPH AUDIT",WHEN,"",BY,"L",.ERR)
 . D RESCH^XUTMOPT("XU EPCS PSDRPH AUDIT","@","","@","",.ERR)
CONT1 ;
 ;
 ; Check to see if PSO EPCS LOGICAL ACCESS is already scheduled.
 K ROOT D OPTSTAT^XUTMOPT("PSO EPCS LOGICAL ACCESS",.ROOT)
 I $D(ROOT(1)),$P(ROOT(1),"^",2)'="",$P(ROOT(1),"^",3)'="" G CONT2
 ;
 ; Change from XU EPCS LOGICAL ACCESS to PSO EPCS LOGICAL ACCESS
 K ROOT D OPTSTAT^XUTMOPT("XU EPCS LOGICAL ACCESS",.ROOT)
 I $D(ROOT(1)) F ENTRY=1:1:ROOT D
 . I $P(ROOT(ENTRY),"^",2)="" Q
 . I $P(ROOT(ENTRY),"^",3)="" Q
 . S WHEN=$P(ROOT(ENTRY),"^",2),BY=$P(ROOT(ENTRY),"^",3)
 . D RESCH^XUTMOPT("PSO EPCS LOGICAL ACCESS",WHEN,"",BY,"L",.ERR)
 . D RESCH^XUTMOPT("XU EPCS LOGICAL ACCESS","@","","@","",.ERR)
CONT2 ;
 ; Attach options to menu
 D MENU
 ; Extend ^XTMP Purge Date to 90 days
 D DEAPRGDT
 ; Convert Users with XU EPCS EDIT DATA Secondary Menu to PSO EPCS GUI CONTEXT
 D PSOSEC
 ;
 Q
 ;
 N MENU,OPTION,CHECK,CHOICE,SYN,ORD,TYPE,OFF,UPDATE
 S TYPE="MENUADD" F OFF=1:1 S CHOICE=$P($T(@TYPE+OFF),";;",2) Q:CHOICE="DONE"  D
 . S OPTION=$P(CHOICE,"^"),MENU=$P(CHOICE,"^",2),SYN=$P(CHOICE,"^",3),ORD=$P(CHOICE,"^",4)
 . S CHECK=$$ADD^XPDMENU(MENU,OPTION,SYN,ORD)
 . D BMES^XPDUTL(">>> "_OPTION_" Option"_$S('CHECK:" NOT added to "_MENU,1:" added to "_MENU)_" <<<")
 Q
 ;
 ;;PSO EPCS DEA INTEGRITY REPORT^PSO EPCS UTILITY FUNCTIONS^15^15
 ;;PSO EPCS DEA MANUAL ENTRY^PSO EPCS UTILITY FUNCTIONS^13^13
 ;;PSO EPCS DISUSER PRIVS^PSO EPCS UTILITY FUNCTIONS^3^3
 ;;PSO EPCS EDIT DEA# AND XDATE^PSO EPCS UTILITY FUNCTIONS^12^12
 ;;PSO EPCS EXPIRED DEA FAILOVER^PSO EPCS UTILITY FUNCTIONS^10^10
 ;;PSO EPCS MANUAL DEA REPORT^PSO EPCS UTILITY FUNCTIONS^14^14
 ;;PSO EPCS PRINT EDIT AUDIT^PSO EPCS UTILITY FUNCTIONS^6^6
 ;;PSO EPCS PRIVS^PSO EPCS UTILITY FUNCTIONS^2^2
 ;;PSO EPCS SET PARMS^PSO EPCS UTILITY FUNCTIONS^5^5
 ;;PSO VAMC MBM PHARMACY MODE^PSO EPCS UTILITY FUNCTIONS^11^11
 ;;DONE
 Q
 ;
DEAPRGDT ; Change the DEA migration purge date in XTMP to 90 days in the future
 N HANDPSO,MIGHDR,BEGDT,PRGDT
 S HANDPSO=$O(^XTMP("PSODEAWB-3400101.0001"),-1)
 Q:HANDPSO=""
 S MIGHDR=$G(^XTMP(HANDPSO,0))
 Q:MIGHDR'["DEA INITIAL IMPORT"
 S BEGDT=$P(MIGHDR,"^",2)
 S PURGDT=$$FMADD^XLFDT(BEGDT,90)
 S $P(MIGHDR,"^")=PURGDT
 S ^XTMP(HANDPSO,0)=MIGHDR
 Q
 ;
 ;External reference to ^XUSEC supported by DBIA 10076
PSOSEC ; Add PSO EPCS GUI CONTEXT to active users holding the XUEPCSEDIT key and having the XU EPCS EDIT DATA option as a secondary menu.
 ; Active user defined as NOT Disuser'd, No Termination Date or Reason
 N PSODUZ,PSOEPKEY,PSOMENI,PSNWMENI,NPFIL
 S PSOEPKEY="XUEPCSEDIT"
 S PSNWMENI=$$LKOPT^XPDMENU("PSO EPCS GUI CONTEXT") Q:'PSNWMENI
 S PSOMENI=$$LKOPT^XPDMENU("XU EPCS EDIT DATA") Q:'PSOMENI
 SET ^XTMP("PSOEPCS-GUIMENU",0)=$$FMADD^XLFDT($$DT^XLFDT(),180)_U_$$DT^XLFDT()_U_"Convert EPCS GUI Users Secondary Menu Option"
 S PSODUZ=0 F  S PSODUZ=$O(^XUSEC(PSOEPKEY,PSODUZ)) Q:'PSODUZ  D
 . N PSOERR,PSOFDA,PSOPTIEN,PSOFDA,PSOPTIENS
 . Q:$$ACCESS^XQCHK(PSODUZ,PSNWMENI)>0  ; Quit if user already has PSO EPCS GUI CONTEXT
 . Q:$$ACCESS^XQCHK(PSODUZ,PSOMENI)<1  ; Quit if user doesn't have old option XU EPCS EDIT DATA
 . S PSOPTIEN=$$FIND1^DIC(200.03,","_PSODUZ_",",,"XU EPCS EDIT DATA") Q:'PSOPTIEN  ; Shouldn't be possible unless x-ref is corrupted
 . S PSOPTIENS=PSOPTIEN_","_PSODUZ_","
 . S PSOFDA(200.03,PSOPTIENS,.01)=PSNWMENI
 . S PSOFDA(200.03,PSOPTIENS,2)=""
 . D FILE^DIE("","PSOFDA","PSOERR")
 . SET ^XTMP("PSOEPCS-GUIMENU",PSODUZ)=$$GET1^DIQ(200,PSODUZ,.01)_"^"_$G(PSOERR("DIERR",1,"TEXT",1))
 Q