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

PSNFDAMG.m

Go to the documentation of this file.
  1. PSNFDAMG ;BIR/DMA - On-Demand FDA Med Guide Display ; 7/19/21 9:24am
  1. ;;4.0;NATIONAL DRUG FILE;**108,263,264,437,572**; 30 Oct 98;Build 3
  1. ;Reference to ^PS(59.7 supported by DBIA #2613
  1. ;
  1. ;Removed On-Demand functionality, preserved URL reference *572
  1. ;
  1. EN(VAPRDIEN) ; Entry point for FDA Med Guide On-Demand Printing
  1. N FDAMGFN,FDAMGURL,PCURL,STATUS,X,PSNIP
  1. S FDAMGFN=$$FDAMG^PSNAPIS(VAPRDIEN)
  1. I FDAMGFN="" D Q
  1. . W !!,"There is no FDA Medication Guide associated with this medication.",!
  1. . D PAUSE
  1. ;
  1. W !!,"The following URL provides the link to the FDA Medication Guide associated"
  1. W !,"with this medication. Copy/paste the URL below into a browser to access"
  1. W !,"the FDA Medication Guide for this drug:"
  1. W !!
  1. ;
  1. ; Concatenating the Web Server URL to the FDA Med Guide file name
  1. S FDAMGURL=$$GET1^DIQ(59.7,1,100)_FDAMGFN
  1. ;
  1. D PRTURL(FDAMGURL)
  1. ;
  1. ;S PSNIP=$S($G(IO("IP"))'="":IO("IP"),1:"127.0.0.1")
  1. ;I $$VERSION^XLFIPV S PSNIP="["_$$CONVERT^XLFIPV(PSNIP)_"]"
  1. ;S PCURL="http://"_PSNIP_":8091/viewmg="
  1. ;
  1. ;W !!,"Please wait...",!
  1. ;
  1. ;Invoking Kernel HTTP Toolkit
  1. ;S STATUS=$$GETURL^XTHC10(PCURL_FDAMGURL)
  1. ;
  1. ;I +STATUS'=200 D
  1. ;. W !,"The system is unable to display FDA Med Guide automatically."
  1. ;. W !
  1. ;. W !,"The FDA Medication Guide will not automatically open on Thin Client and some"
  1. ;. W !,"types of encrypted sessions. If you do not believe this is the reason contact"
  1. ;. W !,"your local technical support for assistance."
  1. ;. W !
  1. ;. W !,"You can copy/paste the link above into your browser's address bar to retrieve"
  1. ;. W !,"the FDA Medication Guide."
  1. ;. W !
  1. ;
  1. D PAUSE
  1. Q
  1. ;
  1. PAUSE ;
  1. N DIR
  1. S DIR("A")="Enter RETURN to continue or '^' to exit",DIR(0)="E"
  1. W !
  1. D ^DIR
  1. ;S DIR("?")="^D HELP^PSNFDAMG("""_$G(FDAMGURL)_""")" D ^DIR
  1. Q
  1. ;
  1. ;HELP(MGURL) ; Help Text
  1. ;N DIR,DIRUT,DIROUT
  1. ;W !,"When unable to get the FDA Medication Guide to display, review the following"
  1. ;W !,"suggestion(s) for troubleshooting potential problems:"
  1. ;W !
  1. ;I $G(MGURL)'="" D
  1. ;. W !,"1) The browser did not open automatically. This may be due to the following:"
  1. ;. W !," - You might be connected to VistA via Thin Client or an encrypted session"
  1. ;. W !," that prevents the FDA Med Guide from automatically displaying. Please"
  1. ;. W !," copy and paste the URL link below into your browser's address bar to"
  1. ;. W !," retrieve the FDA Medication Guide:"
  1. ;. W !! D PRTURL(MGURL) W !
  1. ;. W !," - The computer might not have the required Java software component"
  1. ;. W !," installed or the software might not be functioning properly. Please,"
  1. ;. W !," contact technical support for assistance."
  1. ;. W !
  1. ;. S DIR("A")="Enter RETURN to continue" D PAUSE^VALM1 Q:($G(DIRUT)!$G(DIROUT))
  1. ;. ;
  1. ;. W !,"2) When doing a copy/paste of the link into the browser's address and an HTTP"
  1. ;. W !," 404 - File Not Found error is received. This may be due to the following:"
  1. ;. W !," - A common issue exists when the link is displayed in two lines in the"
  1. ;. W !," terminal screen. When you copy both lines at the same time and paste it"
  1. ;. W !," into the browser's address, the second line is ignored by the browser"
  1. ;. W !," resulting in a 'broken' link. To resolve this issue, copy and paste one"
  1. ;. W !," line at a time from the terminal screen into the browser's address to"
  1. ;. W !," make sure the complete link is used."
  1. ;. W !," - The FDA Medication Guide Server may be down at the moment. Please, wait"
  1. ;. W !," a few minutes and try again. If the problem persists, contact technical"
  1. ;. W !," support for assistance."
  1. ;. ;
  1. ;. W !!,"3) The browser opened automatically, however you receive an HTTP 404 - File"
  1. ;. W !," Not Found error. This may be due to the following:"
  1. ;. W !," - The FDA Medication Guide Server may be down at the moment. Please, wait"
  1. ;. W !," a few minutes and try again. If the problem persists, contact technical"
  1. ;. W !," support for assistance."
  1. ;. W !
  1. ;E D
  1. ;. W !,"1) If no FDA Medication Guide exists for a product that you believe should"
  1. ;. W !," have one, confirm that one is required by visiting the FDA website"
  1. ;. W !," (www.fda.gov). If one is required, log a support ticket to request its"
  1. ;. W !," addition. Please understand that there may be a delay between the time"
  1. ;. W !," that a new Medication Guide is posted to the FDA website and when it is"
  1. ;. W !," made available in VistA through a National Drug File data update patch."
  1. ; Q
  1. ;
  1. PRTURL(FDAMGURL) ; Prints the FDA Med Guide URL
  1. S X=$G(FDAMGURL) I $$LOW^XLFSTR($E(X,1,7))="http://" S X=$E(X,8,999)
  1. W $E(X,1,80) I $L(X)>80 D
  1. . F Q:$E(X,81,999)="" S X=$E(X,81,999) W !,$E(X,1,80)
  1. Q