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

PSO7E684.m

Go to the documentation of this file.
  1. PSO7E684 ;WILM/BDB - Environment routine for patch PSO*7*684 ;4/22/2022
  1. ;;7.0;OUTPATIENT PHARMACY;**684,545**;DEC 1997;Build 270
  1. ;External reference to ^XOB(18.12 supported by DBIA 5813
  1. ;External reference to ^XOB(18.02 supported by DBIA 5814
  1. ;External reference to ^XUSRB1 is supported by DBIA 2240
  1. ;
  1. N HANDPSO,TITLE,LIFE,DEALABEL,DEARR
  1. S HANDPSO="PSO70684-INSTALL"
  1. S TITLE="REFRESH DOJ/DEA"
  1. S LIFE=7
  1. ;
  1. I $$P545CHK7(),$$PROD^XUPROD() Q ; Don't auto-run migration after PSO*7*545 is installed
  1. ;
  1. D FIELD^DID(8991.9,.01,,"LABEL","DEALABEL","DEAERR") I $G(DEALABEL("LABEL"))'="DEA NUMBER" D Q
  1. . S XPDABORT=1
  1. . D BMES^XPDUTL("The DEA NUMBERS file (#8991.9) is missing - please install XU*8.0*688")
  1. ;
  1. ; Ensure Web Service and Server exist and are configured/encrypted
  1. I '$$FIND1^DIC(18.12,,,"PSO DOJ/DEA WEB SERVER")!'$$FIND1^DIC(18.02,,,"PSO DOJ/DEA WEB SERVICE") D DEAWS
  1. ;
  1. L +^XTMP(HANDPSO):0 I '$T D Q
  1. . S XPDABORT=1
  1. . D BMES^XPDUTL(TITLE_" job is already running. Halting...")
  1. . D MES^XPDUTL("")
  1. D INITXTMP(HANDPSO,TITLE,LIFE)
  1. S ^XTMP(HANDPSO,"STATUS")="Start of Install"
  1. L -^XTMP(HANDPSO)
  1. Q
  1. ;
  1. INITXTMP(HANDPSO,TITLE,LIFE) ; -- Initialize ^XTMP according to SAC standards.
  1. N BEGDT,PURGDT
  1. S BEGDT=$$NOW^XLFDT()
  1. S PURGDT=$$FMADD^XLFDT(BEGDT,LIFE)
  1. S ^XTMP(HANDPSO,0)=PURGDT_"^"_BEGDT_"^"_TITLE
  1. Q
  1. ;
  1. P545CHK7() ; Have more than 7 days elapsed since PSO*7*545 was installed?
  1. N P545INST,P545X,P545FIRST
  1. S P545INST=$$PATCH^XPDUTL("PSO*7.0*545")
  1. Q:'P545INST 0
  1. S P545X=$$INSTALDT^XPDUTL("PSO*7.0*545",.DATA)
  1. S P545FIRST=$O(DATA(""))
  1. I $$FMDIFF^XLFDT($$DT^XLFDT(),P545FIRST)>7 Q 1
  1. Q 0
  1. ;
  1. DEAWS ; Install DEA Web Service
  1. ; 1st: Makes an entry/update to the WEB SERVICE FILE #18.02 in global ^XOB(18.02,
  1. ; 2nd: Makes an entry/update to the WEB SERVICE FILE #18.02 in global ^XOB(18.02,
  1. ; 3nd: Makes an entry/update to the WEB SERVER FILE #18.12 in global ^XOB(18.12,
  1. ;
  1. N FDA ; -- FileMan Data Array
  1. N WEBVICE ; -- Web Service Internal Entry Number
  1. N WEBVER ; -- Web Server Internal Entry Number
  1. N MULTIEN ; -- Web Service Multiple Internal Entry Number
  1. N WSTAT ; -- Web Service Status
  1. N IENROOT,MSGROOT,IENROOT1,VICEIEN
  1. N PSODEAC,PSODEAMSG
  1. ;
  1. N DIR,DTOUT,DUOUT,DIRUT,DIROUT,SERVADD,X,Y,ENVRMT
  1. S ENVRMT="" I $$PROD^XUPROD S ENVRMT="P"
  1. ;
  1. S SERVADD=$S(ENVRMT="P":"prod.deals.vaec.domain.ext",1:"dev.deals.vaec.domain.ext")
  1. ;
  1. K FDA
  1. S FDA(18.02,"?+1,",.01)="PSO DOJ/DEA WEB SERVICE" ; NAME
  1. S FDA(18.02,"?+1,",.02)="REST" ; TYPE
  1. S FDA(18.02,"?+1,",200)="/deaInfo/" ; CONTEXT ROOT
  1. S FDA(18.02,"?+1,",201)="" ; AVAILABILITY RESOURCE
  1. D UPDATE^DIE("E","FDA","IENROOT","MSGROOT")
  1. K IENROOT,MSGROOT,FDA
  1. ;
  1. S FDA(18.12,"?+1,",.01)="PSO DOJ/DEA WEB SERVER" ; NAME
  1. S FDA(18.12,"?+1,",.03)=443 ; PORT
  1. S FDA(18.12,"?+1,",.04)=SERVADD ; SERVER
  1. S FDA(18.12,"?+1,",.06)="ENABLED" ; STATUS 1-ENABLED / 0-DISABLED
  1. S FDA(18.12,"?+1,",.07)=10 ; DEFAULT HTTP TIMEOUT
  1. S FDA(18.12,"?+1,",1.01)="YES" ; LOGIN REQUIRED
  1. S FDA(18.12,"?+1,",3.01)="TRUE" ; SSL ENABLED
  1. S FDA(18.12,"?+1,",3.02)="encrypt_only_tlsv12" ; SSL CONFIGURATION
  1. S FDA(18.12,"?+1,",3.03)=443 ; SSL PORT
  1. I ENVRMT="P" D
  1. . S FDA(18.12,"?+1,",200)="user"
  1. . S FDA(18.12,"?+1,",300)=$$ENCRYP^XUSRB1("hkttHhdfn6XK")
  1. I ENVRMT'="P" D
  1. . S FDA(18.12,"?+1,",200)="user"
  1. . S FDA(18.12,"?+1,",300)=$$ENCRYP^XUSRB1("pass")
  1. D UPDATE^DIE("E","FDA","IENROOT","MSGROOT")
  1. ;
  1. S IENROOT1=$G(IENROOT(1)),MULTIEN=0
  1. ;
  1. S WEBVER=$S(IENROOT1:IENROOT1,1:WEBVER)
  1. K IENROOT,MSGROOT,FDA
  1. 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
  1. S MULTIEN=$S(MULTIEN:MULTIEN,1:"+1")
  1. S FDA(18.121,MULTIEN_","_WEBVER_",",.01)="PSO DOJ/DEA WEB SERVICE" ; WEB SERVICE
  1. S FDA(18.121,MULTIEN_","_WEBVER_",",.06)="ENABLED" ; STATUS 1-ENABLED / 0-DISABLED
  1. D UPDATE^DIE("E","FDA","IENROOT","MSGROOT")
  1. Q
  1. ;
  1. ;
  1. MSDTHLP ; Migration Start Date/Time Help
  1. W !,"Enter the scheduled date/time to queue the DEA migration."
  1. W !,"The migration may several hours to run."
  1. Q
  1. ;
  1. MSHLP ; Migration Start Help Text
  1. W !," During the DEA migration, an attempt is made to migrate"
  1. W !," all DEA numbers from the NEW PERSON file (#200) to the"
  1. W !," DEA NUMBERS file (#8991.9). "
  1. W !
  1. W !," DEA numbers successfully validated by the DEA web service"
  1. W !," (PSO DOJ/DEA WEB SERVICE) are migrated and linked to the"
  1. W !," associated provider in the NEW PERSON file."
  1. W !
  1. W !," Providers that cannot be migrated are recorded in the "
  1. W !," DEA Migration Report [PSO DEA MIGRATION REPORT]."
  1. W !," Upon completion of the migration, a Mailman message is"
  1. W !," sent to holders of the PSDMGR key with the subject"
  1. W !," ""DEA Migration Complete MM/DD/YYYY"", where MM/DD/YYYY is"
  1. W !," the Date/Time the migration completed."
  1. W !
  1. Q