PSO7E684 ;WILM/BDB - Environment routine for patch PSO*7*684 ;4/22/2022
;;7.0;OUTPATIENT PHARMACY;**684,545**;DEC 1997;Build 270
;External reference to ^XOB(18.12 supported by DBIA 5813
;External reference to ^XOB(18.02 supported by DBIA 5814
;External reference to ^XUSRB1 is supported by DBIA 2240
;
N HANDPSO,TITLE,LIFE,DEALABEL,DEARR
S HANDPSO="PSO70684-INSTALL"
S TITLE="REFRESH DOJ/DEA"
S LIFE=7
;
I $$P545CHK7(),$$PROD^XUPROD() Q ; Don't auto-run migration after PSO*7*545 is installed
;
D FIELD^DID(8991.9,.01,,"LABEL","DEALABEL","DEAERR") I $G(DEALABEL("LABEL"))'="DEA NUMBER" D Q
. S XPDABORT=1
. D BMES^XPDUTL("The DEA NUMBERS file (#8991.9) is missing - please install XU*8.0*688")
;
; Ensure Web Service and Server exist and are configured/encrypted
I '$$FIND1^DIC(18.12,,,"PSO DOJ/DEA WEB SERVER")!'$$FIND1^DIC(18.02,,,"PSO DOJ/DEA WEB SERVICE") D DEAWS
;
L +^XTMP(HANDPSO):0 I '$T D Q
. S XPDABORT=1
. D BMES^XPDUTL(TITLE_" job is already running. Halting...")
. D MES^XPDUTL("")
D INITXTMP(HANDPSO,TITLE,LIFE)
S ^XTMP(HANDPSO,"STATUS")="Start of Install"
L -^XTMP(HANDPSO)
Q
;
INITXTMP(HANDPSO,TITLE,LIFE) ; -- Initialize ^XTMP according to SAC standards.
N BEGDT,PURGDT
S BEGDT=$$NOW^XLFDT()
S PURGDT=$$FMADD^XLFDT(BEGDT,LIFE)
S ^XTMP(HANDPSO,0)=PURGDT_"^"_BEGDT_"^"_TITLE
Q
;
P545CHK7() ; Have more than 7 days elapsed since PSO*7*545 was installed?
N P545INST,P545X,P545FIRST
S P545INST=$$PATCH^XPDUTL("PSO*7.0*545")
Q:'P545INST 0
S P545X=$$INSTALDT^XPDUTL("PSO*7.0*545",.DATA)
S P545FIRST=$O(DATA(""))
I $$FMDIFF^XLFDT($$DT^XLFDT(),P545FIRST)>7 Q 1
Q 0
;
DEAWS ; Install DEA Web Service
; 1st: Makes an entry/update to the WEB SERVICE FILE #18.02 in global ^XOB(18.02,
; 2nd: Makes an entry/update to the WEB SERVICE FILE #18.02 in global ^XOB(18.02,
; 3nd: Makes an entry/update to the WEB SERVER FILE #18.12 in global ^XOB(18.12,
;
N FDA ; -- FileMan Data Array
N WEBVICE ; -- Web Service Internal Entry Number
N WEBVER ; -- Web Server Internal Entry Number
N MULTIEN ; -- Web Service Multiple Internal Entry Number
N WSTAT ; -- Web Service Status
N IENROOT,MSGROOT,IENROOT1,VICEIEN
N PSODEAC,PSODEAMSG
;
N DIR,DTOUT,DUOUT,DIRUT,DIROUT,SERVADD,X,Y,ENVRMT
S ENVRMT="" I $$PROD^XUPROD S ENVRMT="P"
;
S SERVADD=$S(ENVRMT="P":"prod.deals.vaec.domain.ext",1:"dev.deals.vaec.domain.ext")
;
K FDA
S FDA(18.02,"?+1,",.01)="PSO DOJ/DEA WEB SERVICE" ; NAME
S FDA(18.02,"?+1,",.02)="REST" ; TYPE
S FDA(18.02,"?+1,",200)="/deaInfo/" ; CONTEXT ROOT
S FDA(18.02,"?+1,",201)="" ; AVAILABILITY RESOURCE
D UPDATE^DIE("E","FDA","IENROOT","MSGROOT")
K IENROOT,MSGROOT,FDA
;
S FDA(18.12,"?+1,",.01)="PSO DOJ/DEA WEB SERVER" ; NAME
S FDA(18.12,"?+1,",.03)=443 ; PORT
S FDA(18.12,"?+1,",.04)=SERVADD ; SERVER
S FDA(18.12,"?+1,",.06)="ENABLED" ; STATUS 1-ENABLED / 0-DISABLED
S FDA(18.12,"?+1,",.07)=10 ; DEFAULT HTTP TIMEOUT
S FDA(18.12,"?+1,",1.01)="YES" ; LOGIN REQUIRED
S FDA(18.12,"?+1,",3.01)="TRUE" ; SSL ENABLED
S FDA(18.12,"?+1,",3.02)="encrypt_only_tlsv12" ; SSL CONFIGURATION
S FDA(18.12,"?+1,",3.03)=443 ; SSL PORT
I ENVRMT="P" D
. S FDA(18.12,"?+1,",200)="user"
. S FDA(18.12,"?+1,",300)=$$ENCRYP^XUSRB1("hkttHhdfn6XK")
I ENVRMT'="P" D
. S FDA(18.12,"?+1,",200)="user"
. S FDA(18.12,"?+1,",300)=$$ENCRYP^XUSRB1("pass")
D UPDATE^DIE("E","FDA","IENROOT","MSGROOT")
;
S IENROOT1=$G(IENROOT(1)),MULTIEN=0
;
S WEBVER=$S(IENROOT1:IENROOT1,1:WEBVER)
K IENROOT,MSGROOT,FDA
S VICEIEN=0 F S VICEIEN=$O(^XOB(18.12,WEBVER,100,"B",VICEIEN)) Q:'VICEIEN I $$GET1^DIQ(18.02,VICEIEN,.01)="PSO DOJ/DEA WEB SERVICE" S MULTIEN=VICEIEN Q
S MULTIEN=$S(MULTIEN:MULTIEN,1:"+1")
S FDA(18.121,MULTIEN_","_WEBVER_",",.01)="PSO DOJ/DEA WEB SERVICE" ; WEB SERVICE
S FDA(18.121,MULTIEN_","_WEBVER_",",.06)="ENABLED" ; STATUS 1-ENABLED / 0-DISABLED
D UPDATE^DIE("E","FDA","IENROOT","MSGROOT")
Q
;
;
MSDTHLP ; Migration Start Date/Time Help
W !,"Enter the scheduled date/time to queue the DEA migration."
W !,"The migration may several hours to run."
Q
;
MSHLP ; Migration Start Help Text
W !," During the DEA migration, an attempt is made to migrate"
W !," all DEA numbers from the NEW PERSON file (#200) to the"
W !," DEA NUMBERS file (#8991.9). "
W !
W !," DEA numbers successfully validated by the DEA web service"
W !," (PSO DOJ/DEA WEB SERVICE) are migrated and linked to the"
W !," associated provider in the NEW PERSON file."
W !
W !," Providers that cannot be migrated are recorded in the "
W !," DEA Migration Report [PSO DEA MIGRATION REPORT]."
W !," Upon completion of the migration, a Mailman message is"
W !," sent to holders of the PSDMGR key with the subject"
W !," ""DEA Migration Complete MM/DD/YYYY"", where MM/DD/YYYY is"
W !," the Date/Time the migration completed."
W !
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSO7E684 5379 printed Oct 16, 2024@18:24:19 Page 2
PSO7E684 ;WILM/BDB - Environment routine for patch PSO*7*684 ;4/22/2022
+1 ;;7.0;OUTPATIENT PHARMACY;**684,545**;DEC 1997;Build 270
+2 ;External reference to ^XOB(18.12 supported by DBIA 5813
+3 ;External reference to ^XOB(18.02 supported by DBIA 5814
+4 ;External reference to ^XUSRB1 is supported by DBIA 2240
+5 ;
+6 NEW HANDPSO,TITLE,LIFE,DEALABEL,DEARR
+7 SET HANDPSO="PSO70684-INSTALL"
+8 SET TITLE="REFRESH DOJ/DEA"
+9 SET LIFE=7
+10 ;
+11 ; Don't auto-run migration after PSO*7*545 is installed
IF $$P545CHK7()
IF $$PROD^XUPROD()
QUIT
+12 ;
+13 DO FIELD^DID(8991.9,.01,,"LABEL","DEALABEL","DEAERR")
IF $GET(DEALABEL("LABEL"))'="DEA NUMBER"
Begin DoDot:1
+14 SET XPDABORT=1
+15 DO BMES^XPDUTL("The DEA NUMBERS file (#8991.9) is missing - please install XU*8.0*688")
End DoDot:1
QUIT
+16 ;
+17 ; Ensure Web Service and Server exist and are configured/encrypted
+18 IF '$$FIND1^DIC(18.12,,,"PSO DOJ/DEA WEB SERVER")!'$$FIND1^DIC(18.02,,,"PSO DOJ/DEA WEB SERVICE")
DO DEAWS
+19 ;
+20 LOCK +^XTMP(HANDPSO):0
IF '$TEST
Begin DoDot:1
+21 SET XPDABORT=1
+22 DO BMES^XPDUTL(TITLE_" job is already running. Halting...")
+23 DO MES^XPDUTL("")
End DoDot:1
QUIT
+24 DO INITXTMP(HANDPSO,TITLE,LIFE)
+25 SET ^XTMP(HANDPSO,"STATUS")="Start of Install"
+26 LOCK -^XTMP(HANDPSO)
+27 QUIT
+28 ;
INITXTMP(HANDPSO,TITLE,LIFE) ; -- Initialize ^XTMP according to SAC standards.
+1 NEW BEGDT,PURGDT
+2 SET BEGDT=$$NOW^XLFDT()
+3 SET PURGDT=$$FMADD^XLFDT(BEGDT,LIFE)
+4 SET ^XTMP(HANDPSO,0)=PURGDT_"^"_BEGDT_"^"_TITLE
+5 QUIT
+6 ;
P545CHK7() ; Have more than 7 days elapsed since PSO*7*545 was installed?
+1 NEW P545INST,P545X,P545FIRST
+2 SET P545INST=$$PATCH^XPDUTL("PSO*7.0*545")
+3 if 'P545INST
QUIT 0
+4 SET P545X=$$INSTALDT^XPDUTL("PSO*7.0*545",.DATA)
+5 SET P545FIRST=$ORDER(DATA(""))
+6 IF $$FMDIFF^XLFDT($$DT^XLFDT(),P545FIRST)>7
QUIT 1
+7 QUIT 0
+8 ;
DEAWS ; Install DEA Web Service
+1 ; 1st: Makes an entry/update to the WEB SERVICE FILE #18.02 in global ^XOB(18.02,
+2 ; 2nd: Makes an entry/update to the WEB SERVICE FILE #18.02 in global ^XOB(18.02,
+3 ; 3nd: Makes an entry/update to the WEB SERVER FILE #18.12 in global ^XOB(18.12,
+4 ;
+5 ; -- FileMan Data Array
NEW FDA
+6 ; -- Web Service Internal Entry Number
NEW WEBVICE
+7 ; -- Web Server Internal Entry Number
NEW WEBVER
+8 ; -- Web Service Multiple Internal Entry Number
NEW MULTIEN
+9 ; -- Web Service Status
NEW WSTAT
+10 NEW IENROOT,MSGROOT,IENROOT1,VICEIEN
+11 NEW PSODEAC,PSODEAMSG
+12 ;
+13 NEW DIR,DTOUT,DUOUT,DIRUT,DIROUT,SERVADD,X,Y,ENVRMT
+14 SET ENVRMT=""
IF $$PROD^XUPROD
SET ENVRMT="P"
+15 ;
+16 SET SERVADD=$SELECT(ENVRMT="P":"prod.deals.vaec.domain.ext",1:"dev.deals.vaec.domain.ext")
+17 ;
+18 KILL FDA
+19 ; NAME
SET FDA(18.02,"?+1,",.01)="PSO DOJ/DEA WEB SERVICE"
+20 ; TYPE
SET FDA(18.02,"?+1,",.02)="REST"
+21 ; CONTEXT ROOT
SET FDA(18.02,"?+1,",200)="/deaInfo/"
+22 ; AVAILABILITY RESOURCE
SET FDA(18.02,"?+1,",201)=""
+23 DO UPDATE^DIE("E","FDA","IENROOT","MSGROOT")
+24 KILL IENROOT,MSGROOT,FDA
+25 ;
+26 ; NAME
SET FDA(18.12,"?+1,",.01)="PSO DOJ/DEA WEB SERVER"
+27 ; PORT
SET FDA(18.12,"?+1,",.03)=443
+28 ; SERVER
SET FDA(18.12,"?+1,",.04)=SERVADD
+29 ; STATUS 1-ENABLED / 0-DISABLED
SET FDA(18.12,"?+1,",.06)="ENABLED"
+30 ; DEFAULT HTTP TIMEOUT
SET FDA(18.12,"?+1,",.07)=10
+31 ; LOGIN REQUIRED
SET FDA(18.12,"?+1,",1.01)="YES"
+32 ; SSL ENABLED
SET FDA(18.12,"?+1,",3.01)="TRUE"
+33 ; SSL CONFIGURATION
SET FDA(18.12,"?+1,",3.02)="encrypt_only_tlsv12"
+34 ; SSL PORT
SET FDA(18.12,"?+1,",3.03)=443
+35 IF ENVRMT="P"
Begin DoDot:1
+36 SET FDA(18.12,"?+1,",200)="user"
+37 SET FDA(18.12,"?+1,",300)=$$ENCRYP^XUSRB1("hkttHhdfn6XK")
End DoDot:1
+38 IF ENVRMT'="P"
Begin DoDot:1
+39 SET FDA(18.12,"?+1,",200)="user"
+40 SET FDA(18.12,"?+1,",300)=$$ENCRYP^XUSRB1("pass")
End DoDot:1
+41 DO UPDATE^DIE("E","FDA","IENROOT","MSGROOT")
+42 ;
+43 SET IENROOT1=$GET(IENROOT(1))
SET MULTIEN=0
+44 ;
+45 SET WEBVER=$SELECT(IENROOT1:IENROOT1,1:WEBVER)
+46 KILL IENROOT,MSGROOT,FDA
+47 SET VICEIEN=0
FOR
SET VICEIEN=$ORDER(^XOB(18.12,WEBVER,100,"B",VICEIEN))
if 'VICEIEN
QUIT
IF $$GET1^DIQ(18.02,VICEIEN,.01)="PSO DOJ/DEA WEB SERVICE"
SET MULTIEN=VICEIEN
QUIT
+48 SET MULTIEN=$SELECT(MULTIEN:MULTIEN,1:"+1")
+49 ; WEB SERVICE
SET FDA(18.121,MULTIEN_","_WEBVER_",",.01)="PSO DOJ/DEA WEB SERVICE"
+50 ; STATUS 1-ENABLED / 0-DISABLED
SET FDA(18.121,MULTIEN_","_WEBVER_",",.06)="ENABLED"
+51 DO UPDATE^DIE("E","FDA","IENROOT","MSGROOT")
+52 QUIT
+53 ;
+54 ;
MSDTHLP ; Migration Start Date/Time Help
+1 WRITE !,"Enter the scheduled date/time to queue the DEA migration."
+2 WRITE !,"The migration may several hours to run."
+3 QUIT
+4 ;
MSHLP ; Migration Start Help Text
+1 WRITE !," During the DEA migration, an attempt is made to migrate"
+2 WRITE !," all DEA numbers from the NEW PERSON file (#200) to the"
+3 WRITE !," DEA NUMBERS file (#8991.9). "
+4 WRITE !
+5 WRITE !," DEA numbers successfully validated by the DEA web service"
+6 WRITE !," (PSO DOJ/DEA WEB SERVICE) are migrated and linked to the"
+7 WRITE !," associated provider in the NEW PERSON file."
+8 WRITE !
+9 WRITE !," Providers that cannot be migrated are recorded in the "
+10 WRITE !," DEA Migration Report [PSO DEA MIGRATION REPORT]."
+11 WRITE !," Upon completion of the migration, a Mailman message is"
+12 WRITE !," sent to holders of the PSDMGR key with the subject"
+13 WRITE !," ""DEA Migration Complete MM/DD/YYYY"", where MM/DD/YYYY is"
+14 WRITE !," the Date/Time the migration completed."
+15 WRITE !
+16 QUIT