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

PXRMDLED.m

Go to the documentation of this file.
  1. PXRMDLED ;SLC/AGP - DIALOG UTILITIES. ;08/04/2020
  1. ;;2.0;CLINICAL REMINDERS;**45,71**;Feb 04, 2005;Build 43
  1. Q
  1. ;
  1. DICPROMPT(RESULT,GBL,ZERO,PROMPT,SCREEN,NUM) ;
  1. S DIC=GBL
  1. S DIC(0)=ZERO
  1. S DIC("A")=PROMPT
  1. ;Current dialog type only
  1. I SCREEN'="" S DIC("S")=SCREEN
  1. S DIC("??")=U_"D HELP^PXRMDLED("_NUM_")"
  1. W !
  1. D ^DIC
  1. I $D(DIROUT) S DTOUT=1
  1. I $D(DTOUT)!($D(DUOUT)) Q
  1. S RESULT=Y
  1. Q
  1. ;
  1. DIRPROMPT(RESULT,ZERO,PROMPT,NUM) ;
  1. S DIR(0)=ZERO
  1. S DIR("A")=PROMPT
  1. S DIR("?")=$S(NUM=2:"Enter the name of the template to create.",1:"Enter Y or N. For detailed help type ??")
  1. S DIR("??")=U_"D HELP^PXRMDLED("_NUM_")"
  1. W !
  1. D ^DIR K DIR
  1. I $D(DIROUT) S DTOUT=1
  1. I $D(DTOUT)!($D(DUOUT)) Q
  1. S RESULT=Y
  1. Q
  1. ;
  1. EN ;
  1. N DIEN,DIC,DIR,DNAME,DR,DIROUT,DIRUT,DTOUT,DUOUT,TEMPNAME,TIEN,TNAME,VALUE,X,Y
  1. FINDDIAL ;find dialog name #801.41
  1. D DICPROMPT(.VALUE,"^PXRMD(801.41,","AEMQ","Select Dialog Definition: ","I $P(^(0),U,4)=""R""",1)
  1. Q:$D(DTOUT)!($D(DUOUT))
  1. I +VALUE=-1 Q
  1. S DIEN=+VALUE
  1. S DNAME=$P(VALUE,U,2)
  1. ;
  1. TNAME ;user supply template name #8927.1
  1. D DIRPROMPT(.TEMPNAME,"F^3:60","Enter template name",2)
  1. Q:$D(DTOUT)&($D(DUOUT)) G:$D(DUOUT) FINDDIAL
  1. ;
  1. ATTACH ;attach to a note title
  1. K VALUE
  1. D DIRPROMPT(.VALUE,"Y","Link template to Document Title",3)
  1. Q:$D(DTOUT)&($D(DUOUT)) G:$D(DUOUT) TNAME
  1. I VALUE=0 D LINK(DNAME,"",TEMPNAME,1) Q
  1. ;
  1. DOC ;find note title 8927.1
  1. K VALUE
  1. D DICPROMPT(.VALUE,"^TIU(8925.1,","AEMQ","Select Document Definition: ","I $P(^(0),U,4)=""DOC""",4)
  1. Q:$D(DTOUT)&($D(DUOUT)) G:$D(DUOUT) ATTACH
  1. I +VALUE=-1 G ATTACH
  1. S TIEN=+VALUE
  1. S TNAME=$P(VALUE,U,2)
  1. I $D(^TIU(8927,"AL",TIEN_";TIU(8925.1,")) D G DOC
  1. .W !,TNAME_" has an existing template link to it."
  1. .W !,"Cannot link to this note title."
  1. D LINK(DNAME,TNAME,TEMPNAME,0)
  1. Q
  1. ;
  1. ;link dialog to template and attach to a note title
  1. D LINK2TIU^PXRMDUTL(DNAME,TITLE,TEMPNAME,TEMPONLY,"TIU(8925.1,")
  1. H 1
  1. Q
  1. ;
  1. HELP(NUM) ; help prompts
  1. N HTEXT
  1. I NUM=1 D
  1. .S HTEXT(1)="Select the Reminder Dialog Definition to link to a Template."
  1. I NUM=2 D
  1. .S HTEXT(1)="Enter the template display name."
  1. I NUM=3 D
  1. .S HTEXT(1)="Select No to add the template to the Shared Folder only."
  1. .S HTEXT(2)="Select Yes to link the tempplate to a document title."
  1. I NUM=4 D
  1. .S HTEXT(1)="Select the document title to link the template to."
  1. D HELP^PXRMEUT(.HTEXT)
  1. Q