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

GMPLUTL4.m

Go to the documentation of this file.
  1. GMPLUTL4 ; SLC/KER/TC -- PL Utilities (Misc) ;03/07/17 08:48
  1. ;;2.0;Problem List;**26,49**;Aug 25, 1994;Build 43
  1. ;
  1. ; External References
  1. ; ICR 10066 XMZ^XMA2
  1. ; ICR 10070 ENT1^XMD
  1. ; DBIA 10096 ^%ZOSF("TEST")
  1. ;
  1. ; Variable Used but NEWed/KILLed Elsewhere
  1. ; IOT, ORWINDEV
  1. ;
  1. ;=================================================
  1. ASKYN(GMPLDEF,GMPLTEXT) ;
  1. N DIR,Y
  1. K DIROUT,DIRUT,DTOUT,DUOUT
  1. S DIR(0)="Y0"
  1. S DIR("A")=GMPLTEXT
  1. S DIR("B")=GMPLDEF
  1. S DIR("?")="Enter Y or N."
  1. W !
  1. D ^DIR
  1. I $D(DTOUT)!$D(DUOUT) S Y=GMPLDEF
  1. Q Y
  1. ;
  1. ;============================================
  1. GETEHF(GMPLEXT,GMPLDPTH) ;Get an existing host file.
  1. ;Build a list of all .EXT files in the current directory.
  1. N GMPLDEXT,DIR,DIROUT,DIRUT,DTOUT,DUOUT
  1. N GMPLFSPC,GMPLFLST,GMPLPATH,X,Y,GMPLFILE
  1. I GMPLEXT="" D
  1. . S DIR(0)="FAU"_U_"1:32"
  1. . S DIR("A")="Enter a file extension: "
  1. . S DIR("?")="A file specification has the format name.extension."
  1. . D ^DIR
  1. . S GMPLEXT=Y
  1. I $D(DIRUT) Q ""
  1. S GMPLDEXT="*."_GMPLEXT
  1. S GMPLFSPC(GMPLDEXT)=""
  1. S GMPLPATH=$S($G(GMPLDPTH)'="":GMPLDPTH,1:$$PWD^%ZISH)
  1. S DIR(0)="FAU"_U_"1:32"
  1. S DIR("A")="Enter a path: "
  1. S DIR("B")=GMPLPATH
  1. S DIR("?",1)="A host file is a file on your host system."
  1. S DIR("?",2)="A complete host file consists of a path, file name, and extension."
  1. S DIR("?",3)="A path consists of a device and directory name."
  1. I $G(GMPLEXT)'="" S DIR("?",4)="The default extension is "_GMPLEXT_"."
  1. S DIR("?")="The default path is "_GMPLPATH
  1. D ^DIR
  1. I $D(DIRUT) Q ""
  1. S GMPLPATH=Y
  1. S Y=$$LIST^%ZISH(GMPLPATH,"GMPLFSPC","GMPLFLST")
  1. I Y D
  1. . W !,"The following "_GMPLEXT_" files were found in ",GMPLPATH
  1. . S GMPLFILE=""
  1. . F S GMPLFILE=$O(GMPLFLST(GMPLFILE)) Q:GMPLFILE="" W !,?2,GMPLFILE
  1. E W !,"No "_GMPLEXT_" files were found in path ",GMPLPATH
  1. ;
  1. K DIR,X,Y
  1. S DIR(0)="FAOU"_U_"1:32"
  1. S DIR("A")="Enter a file name: "
  1. S DIR("?",1)="A file name has the format NAME.EXTENSION, the default extension is "_GMPLEXT
  1. S DIR("?",2)="Therefore if you type in FILE for the file name, the host file will be"
  1. S DIR("?")=" "_GMPLPATH_"FILE."_GMPLEXT
  1. D ^DIR
  1. I $D(DIRUT) Q ""
  1. S GMPLFILE=Y
  1. ;Add the default extension if there isn't one.
  1. I GMPLFILE'["." S GMPLFILE=GMPLFILE_"."_GMPLEXT
  1. Q GMPLPATH_U_GMPLFILE
  1. ;
  1. PTR(X) ; Output to Printer
  1. ; 1 = Yes
  1. ; 0 = No
  1. Q:+($$VISTA)>0!(+($$HFP)>0) 1
  1. Q 0
  1. ;
  1. VISTA(X) ; Vista Printer
  1. Q:$E($G(ION),1,3)="NUL" 0 Q:$G(IOT)'="HFS"&($E($G(IOST),1,2)["P-")&($G(IOST)'="P-OTHER") 1
  1. Q 0
  1. ;
  1. HFP(X) ; Host File sent to Printer
  1. ; Check ORWINDEV
  1. N GMTS85 S GMTS85=$$PROK("ORWRP",85)
  1. Q:+($G(GMTS85))>0&(+($G(ORWINDEV))>0) 1
  1. ; Check Host File Server
  1. Q:$G(IOT)'="HFS" 0
  1. ; Host File for GUI Scrollable Window
  1. Q:$E($G(ION),1,14)["OR WORKSTATION" 0
  1. ; TCP/IP Printer
  1. Q:$G(IO)["$PRT"!($G(IO)["PRN|") 1
  1. ; Windows Printer
  1. Q:$E($G(ION),1,14)["OR WINDOWS HFS" 1
  1. ; Host Files (file or unspecifed printer)
  1. Q 0
  1. ;
  1. ; Miscellaneous
  1. PROK(X,Y) ; Routine and Patch # OK
  1. N GMTS,GMTSI,GMTSO S X=$G(X),Y=$G(Y) Q:'$L(X) 0 Q:Y'=""&(+Y=0)
  1. S Y=+Y,GMTS=$$ROK(X) Q:'GMTS 0 Q:+Y=0 1 S GMTSO=0,GMTS=$T(@("+2^"_X)),GMTS=$P($P(GMTS,"**",2),"**",1)
  1. F GMTSI=1:1:$L(GMTS,",") S:+($P(GMTS,",",GMTSI))=Y GMTSO=1 Q:GMTSO=1
  1. S X=GMTSO Q X
  1. ROK(X) ; Routine OK (in UCI)
  1. S X=$G(X) Q:'$L(X) 0 Q:$L(X)>8 0 X ^%ZOSF("TEST") Q:$T 1 Q 0
  1. SEND(GMPLNODE,GMPLSUB,GMPLTO,GMPLFROM) ; Send a MailMan message whose text is in
  1. ;^TMP(GMPLNODE,$J,N,0). GMPLSUB is the subject. GMPLTO is the optional
  1. ;list of addresses, setup exactly like ;the MailMan XMY array.
  1. ;GMPLFROM is the optional message from, if it is not defined then from will be
  1. ;Problem List Support. This can be free text or a DUZ.
  1. ;
  1. N GMPLNL,XMDUZ,XMSUB,XMY,XMZ
  1. ;
  1. ;Make sure the subject does not exceed 64 characters.
  1. S XMSUB=$E(GMPLSUB,1,64)
  1. ;
  1. ;Make the default sender Problem List.
  1. S XMDUZ=$S($G(GMPLFROM)="":"Problem List Support",1:GMPLFROM)
  1. ;
  1. RETRY ;Get the message number.
  1. D XMZ^XMA2
  1. I XMZ<1 G RETRY
  1. ;
  1. ;Load the message
  1. M ^XMB(3.9,XMZ,2)=^TMP(GMPLNODE,$J)
  1. K ^TMP(GMPLNODE,$J)
  1. S GMPLNL=$O(^XMB(3.9,XMZ,2,""),-1)
  1. S ^XMB(3.9,XMZ,2,0)="^3.92^"_+GMPLNL_U_+GMPLNL_U_DT
  1. ;
  1. ;Send message to TO list if it is defined.
  1. I $D(GMPLTO) M XMY=GMPLTO D ENT1^XMD Q
  1. ;