PXRMDBLD ; SLC/PJH - Reminder Dialog Generation. ;10/30/2014
;;2.0;CLINICAL REMINDERS;**12,47**;Feb 04, 2005;Build 291
;
;Called from PXRMGEDT
;
;AGP Most of this routine can probably be deleted. First round commented it out
;
START ;
N ANS,DIC,DNAME,LIT,LIT1,MSG,NAME,REDO,REM,RLNK,RNAME,ORY
N PXRMENAB,PXRMLINK,PXRMREPL,PXRMREM
D ADD^PXRMDEDT
;Prompt for auto or manual addition
;S ANS="" D ASK(.ANS) Q:$D(DUOUT)!$D(DTOUT)
;Auto
;I ANS="Y" D AUTO Q
;Manual
;I ANS'="Y" D ADD^PXRMDEDT
END Q
;
;Called by protocol PXRM DIALOG ADD
;----------------------------------
;ADD(PXRMITEM) ;
;N ANS,DNAME,DTOUT,DUOUT
;S VALMBCK="R"
;W IORESET
;W !,PXRMHD
;S DNAME=""
;D ASK^PXRMDBLD(.ANS) Q:$D(DTOUT)!$D(DUOUT)
;I ANS="Y" D AUTOP(PXRMITEM)
;Q
;
;Ask autogenerate/manual
;-----------------------
;ASK(YESNO) ;
;N X,Y,TEXT,DIR
;K DIROUT,DIRUT,DTOUT,DUOUT
;S DIR(0)="YA0"
;S DIR("A")="GENERATE DIALOG AUTOMATICALLY: "
;S DIR("B")="N"
;S DIR("?")="Enter Y or N. For detailed help type ??"
;S DIR("??")=U_"D HELP^PXRMDBLD(1)"
;D ^DIR K DIR
;I $D(DIROUT) S DTOUT=1
;I $D(DTOUT)!($D(DUOUT)) Q
;S YESNO=$E(Y(0))
;Q
;
;Source reminder for auto-generate
;---------------------------------
;AUTO S DIC("A")="SELECT REMINDER TO GENERATE DIALOG FROM: "
;S LIT1="You must select a reminder!"
;D SEL(811.9,"AEQMZ",.PXRMREM)
;Q:$D(DTOUT)!$D(DUOUT)
;S REM=$P(PXRMREM(1),U),DNAME=""
;Display related dialogs
;D DISP(REM)
;Promt for type of generate
;D AUTOP(REM)
;Q
;
;Autogenerate prompts
;--------------------
;AUTOP(REM) ;
;S RNAME=$P($G(^PXD(811.9,REM,0)),U)
;F D Q:$D(DUOUT)!$D(DTOUT)!(DNAME]"")
;.N CONFIRM,X,Y,DIR,DA
;.K DIROUT,DIRUT,DTOUT,DUOUT
;.S DIR(0)="F"_U_"3:40"_U_"K:(X?.N)!'(X'?1P.E) X"
;.S DIR("A")="ENTER A UNIQUE DIALOG NAME"
;.S DIR("B")=RNAME
;.S DIR("?")="Select a unique name for the generated dialog."
;.S DIR("??")=U_"D HELP^PXRMDBLD(6)"
;.D ^DIR K DIR
;.I $D(DIROUT) S DTOUT=1
;.I $D(DTOUT)!($D(DUOUT)) Q
;.I Y["""" D EN^DDIOL(" name cannot contain quotes!") Q
;.I $D(^PXRMD(801.41,"B",Y)) D Q:$G(DTOUT)=1
;..D CONFIRM(.CONFIRM,Y) I CONFIRM="Y" D Q:$G(DTOUT)=1
;...S DA=$O(^PXRMD(801.41,"B",Y,""))
;...I $P($G(^PXRMD(801.41,DA,0)),U,3)="" D Q:$G(DTOUT)=1
;....W !!,"THE CURRENT DIALOG IS ENABLED PLEASE DISABLE IT BEFORE "
;....W "CONTINING." H 2 S DTOUT=1 Q
;..I '$$OVER(Y) S DTOUT=1 Q
;..S Y=$$NAME^PXRMDCPY(DA,Y)
;..;If this is the linked reminder clear it
;..I $P($G(^PXD(811.9,REM,51)),U)=$G(DA) S $P(^PXD(811.9,REM,51),U)=""
;.;Option to LINK DIALOG to REMINDER if reminder is not linked already
;.S RLNK=$P($G(^PXD(811.9,REM,51)),U),PXRMLINK=0
;.I 'RLNK D LINK(.PXRMLINK) Q:$D(DTOUT)!$D(DUOUT)
;.;Option to enable dialog
;.D ENABLE(.PXRMENAB) Q:$D(DTOUT)!$D(DUOUT)
;.;Option to replace existing dialog elements
;.D REPL(.PXRMREPL) Q:$D(DTOUT)!$D(DUOUT)
;.;Use name entered
;.S DNAME=Y
;
;Q:$D(DUOUT)!$D(DTOUT)
;Build dialog
;N CHECK D BUILD^PXRMDBL1(REM,DNAME,.CHECK)
;D FINDCHCK(DNAME)
;Q
;
;;Display dialogs autogenerated from this reminder
;;------------------------------------------------
;DISP(RIEN) ;
;N ARRAY,DSUB,FIRST
;;Get Autogenerated dialogs
;S FIRST=1,DSUB=""
;F S DSUB=$O(^PXRMD(801.41,"AG",RIEN,DSUB)) Q:'DSUB D
;.I FIRST W !!,"Associated Dialogs:" S FIRST=0
;.W ?25,$P($G(^PXRMD(801.41,DSUB,0)),U),!
;Q
;
;;Disable generated dialog
;;------------------------
;ENABLE(YESNO) ;
;N X,Y,TEXT,DIR
;K DIROUT,DIRUT,DTOUT,DUOUT
;S DIR(0)="YA0"
;S DIR("A")="ENABLE DIALOG: "
;S DIR("B")="NO"
;S DIR("?")="Enter Y or N. For detailed help type ??"
;S DIR("??")=U_"D HELP^PXRMDBLD(4)"
;D ^DIR K DIR
;I $D(DIROUT) S DTOUT=1
;I $D(DTOUT)!($D(DUOUT)) Q
;S YESNO=$E(Y(0))
;Q
;
;FINDCHCK(DNAME) ;
;W !!,"Scanning dialog "_DNAME_" for inactived findings."
;N CNT,DIALIEN,DIEN,DLGARR,ERRCNT,ERRMSG,FAIL,NAME,STDFILES
;N STRTEXT,TEXT,TYPE,WRITMSG
;;
;S WRITMSG=0
;D DIALDSAR^PXRMFRPT(.STDFILES) I '$D(STDFILES) Q
;S DIALIEN=$O(^PXRMD(801.41,"B",DNAME,"")) Q:DIALIEN'>0
;S ERRCNT=0,CNT=0,FAIL=0
;S STRTEXT(1)="Dialog "_DNAME_" contains errors. Review the dialog before using it in CPRS."
;D BUILDMSG^PXRMDLRP(.STRTEXT,.CNT,.TEXT)
;;
;;build array of dialog items
;D DITEMAR^PXRMDLRP(DIALIEN,.DLGARR,.ERRCNT,.ERRMSG,.FAIL)
;;
;;bad data format in the dialog
;I FAIL="F" D Q
;.D BUILDMSG^PXRMDLRP(.ERRMSG,.CNT,.TEXT)
;.D EN^DDIOL(.TEXT)
;.H 2
;;
;;scan for inactive finding items, checks against standardized files
;S DIEN=0 F S DIEN=$O(DLGARR(DIEN)) Q:DIEN'>0 D
;.K ERRMSG
;.I $$DISABCHK^PXRMDLG6(DIEN,.STDFILES,.ERRMSG)=1 Q
;.;
;.S NAME=$P($G(^PXRMD(801.41,DIEN,0)),U)
;.S TYPE=$$EXTERNAL^DILFD(801.41,4,"",$P($G(^PXRMD(801.41,DIEN,0)),U,4))
;.S $P(^PXRMD(801.41,DIEN,0),U,3)=1
;.S STRTEXT(1)="Dialog "_TYPE_" "_NAME_" has been marked disable for the following reason(s)."
;.D BUILDMSG^PXRMDLRP(.STRTEXT,.CNT,.TEXT)
;.D BUILDMSG^PXRMDLRP(.ERRMSG,.CNT,.TEXT)
;.S WRITMSG=1
;;
;I WRITMSG=1 D EN^DDIOL(.TEXT) H 2
;Q
;Link dialog to reminder
;-----------------------
;LINK(YESNO) ;
;N X,Y,TEXT,DIR
;K DIROUT,DIRUT,DTOUT,DUOUT
;S DIR(0)="YA0"
;S DIR("A")="LINK DIALOG TO REMINDER: "
;S DIR("B")="YES"
;S DIR("?")="Enter Y or N. For detailed help type ??"
;S DIR("??")=U_"D HELP^PXRMDBLD(5)"
;D ^DIR K DIR
;I $D(DIROUT) S DTOUT=1
;I $D(DTOUT)!($D(DUOUT)) Q
;S YESNO=$E(Y(0))
;Q
;;
;;Option to override existing dialog
;;----------------------------------
;OVER(DNAME) ;
;N DIR,X,Y
;S DIR(0)="Y",DIR("B")="NO"
;S DIR("A")="OVERWRITE EXISTING REMINDER DIALOG "
;S DIR("?")="Enter Y or N. For detailed help type ??"
;S DIR("??")=U_"D HELP^PXRMDBLD(2)"
;D ^DIR K DIR
;I $D(DIROUT) S DTOUT=1
;I $D(DTOUT)!($D(DUOUT)) Q 0
;Q $S(Y(0)="YES":1,1:0)
;;
;;Option to replace existing dialog elements
;;------------------------------------------
;REPL(INP) ;
;N DIR,X,Y
;S DIR(0)="Y",DIR("B")="NO"
;S DIR("A")="REPLACE ANY EXISTING DIALOG ELEMENTS"
;S DIR("?")="Enter Y or N. For detailed help type ??"
;S DIR("??")=U_"D HELP^PXRMDBLD(3)"
;D ^DIR K DIR
;I $D(DIROUT) S DTOUT=1
;I $D(DTOUT)!($D(DUOUT)) Q
;S INP=$S(Y(0)="YES":1,1:0)
;Q
;;
;;Reminder selection
;;------------------
;SEL(FILE,MODE,ARRAY) ;
;N X,Y,CNT
;K DIROUT,DIRUT,DTOUT,DUOUT
;S CNT=0
;W !
;F D Q:$D(DTOUT) Q:$D(DUOUT) Q:CNT>0 Q:(Y=-1)&(CNT>0)
;.S DIC=FILE,DIC(0)=MODE
;.D ^DIC
;.I X=(U_U) S DTOUT=1
;.I '$D(DTOUT),('$D(DUOUT)) D
;..I +Y'=-1 D Q
;...S CNT=CNT+1,ARRAY(CNT)=Y_U_Y(0,0)_U_$P(Y(0),U,3)
;..W:CNT=0 !,LIT1
;.K DIC
;Q
;
;CONFIRM(YESNO,NAME) ;
;N X,Y,TEXT,DIR
;K DIROUT,DIRUT,DTOUT,DUOUT
;S DIR(0)="YA0"
;S DIR("A")="YOU ARE ABOUT TO OVERWRITE THE EXISTING DIALOG "_NAME_" CONTINUE? "
;S DIR("B")="N"
;S DIR("?")="Enter Y or N. For detailed help type ??"
;S DIR("??")=U_"D HELP^PXRMDBLD(1)"
;D ^DIR K DIR
;I $D(DIROUT) S DTOUT=1
;I $D(DTOUT)!($D(DUOUT)) Q
;S YESNO=$E(Y(0))
;Q
;;
;General help text routine.
;--------------------------
HELP(CALL) ;
N HTEXT
N DIWF,DIWL,DIWR,IC
S DIWF="C75",DIWL=0,DIWR=75
;
I CALL=1 D
.S HTEXT(1)="Enter Yes to generate reminder dialog automatically for a"
.S HTEXT(2)="selected reminder. Enter No to create a reminder dialog"
.S HTEXT(3)="using the standard fileman edit."
I CALL=2 D
.S HTEXT(1)="Enter Yes to replace the existing reminder dialog."
.S HTEXT(2)="Enter No to return and enter an alternative dialog name."
I CALL=3 D
.S HTEXT(1)="For each FINDING ITEM on the reminder a dialog element"
.S HTEXT(2)="will be created. A separate DIALOG ELEMENT is created for"
.S HTEXT(3)="each enabled RESOLUTION STATUS in the FINDING TYPE"
.S HTEXT(4)="PARAMETERS for this finding type. The dialog element is"
.S HTEXT(5)="unique for finding type, finding item name and resolution"
.S HTEXT(6)="status name."
.S HTEXT(7)="e.g. VM WEIGHT DONE will be generated for the finding item"
.S HTEXT(8)=" vitals measurement/weight."
.S HTEXT(9)=""
.S HTEXT(10)="Enter Yes to rebuild all dialog elements used by this"
.S HTEXT(11)="reminder overwriting any existing modifications."
.S HTEXT(12)=""
.S HTEXT(13)="Enter No to use existing dialog elements if they exist."
.S HTEXT(14)="New dialog elements will be created if they don't already"
.S HTEXT(15)="exist."
I CALL=4 D
.S HTEXT(1)="Enter Yes to create a dialog enabled for use in CPRS."
.S HTEXT(2)="Enter No to create a dialog disabled for CPRS."
I CALL=5 D
.S HTEXT(1)="If the source reminder is not linked to any other dialog"
.S HTEXT(2)="enter Yes to link the reminder to the generated dialog."
.S HTEXT(3)="Enter No if no link should be made."
I CALL=6 D
.S HTEXT(1)="Enter the name of the dialog. The default is the reminder"
.S HTEXT(2)="name. If the name of an existing dialog is specified the"
.S HTEXT(3)="option to override the existing dialog will be given."
K ^UTILITY($J,"W")
S IC=""
F S IC=$O(HTEXT(IC)) Q:IC="" D
. S X=HTEXT(IC)
. D ^DIWP
W !
S IC=0
F S IC=$O(^UTILITY($J,"W",0,IC)) Q:IC="" D
. W !,^UTILITY($J,"W",0,IC,0)
K ^UTILITY($J,"W")
W !
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMDBLD 9313 printed Oct 16, 2024@17:44:26 Page 2
PXRMDBLD ; SLC/PJH - Reminder Dialog Generation. ;10/30/2014
+1 ;;2.0;CLINICAL REMINDERS;**12,47**;Feb 04, 2005;Build 291
+2 ;
+3 ;Called from PXRMGEDT
+4 ;
+5 ;AGP Most of this routine can probably be deleted. First round commented it out
+6 ;
START ;
+1 NEW ANS,DIC,DNAME,LIT,LIT1,MSG,NAME,REDO,REM,RLNK,RNAME,ORY
+2 NEW PXRMENAB,PXRMLINK,PXRMREPL,PXRMREM
+3 DO ADD^PXRMDEDT
+4 ;Prompt for auto or manual addition
+5 ;S ANS="" D ASK(.ANS) Q:$D(DUOUT)!$D(DTOUT)
+6 ;Auto
+7 ;I ANS="Y" D AUTO Q
+8 ;Manual
+9 ;I ANS'="Y" D ADD^PXRMDEDT
END QUIT
+1 ;
+2 ;Called by protocol PXRM DIALOG ADD
+3 ;----------------------------------
+4 ;ADD(PXRMITEM) ;
+5 ;N ANS,DNAME,DTOUT,DUOUT
+6 ;S VALMBCK="R"
+7 ;W IORESET
+8 ;W !,PXRMHD
+9 ;S DNAME=""
+10 ;D ASK^PXRMDBLD(.ANS) Q:$D(DTOUT)!$D(DUOUT)
+11 ;I ANS="Y" D AUTOP(PXRMITEM)
+12 ;Q
+13 ;
+14 ;Ask autogenerate/manual
+15 ;-----------------------
+16 ;ASK(YESNO) ;
+17 ;N X,Y,TEXT,DIR
+18 ;K DIROUT,DIRUT,DTOUT,DUOUT
+19 ;S DIR(0)="YA0"
+20 ;S DIR("A")="GENERATE DIALOG AUTOMATICALLY: "
+21 ;S DIR("B")="N"
+22 ;S DIR("?")="Enter Y or N. For detailed help type ??"
+23 ;S DIR("??")=U_"D HELP^PXRMDBLD(1)"
+24 ;D ^DIR K DIR
+25 ;I $D(DIROUT) S DTOUT=1
+26 ;I $D(DTOUT)!($D(DUOUT)) Q
+27 ;S YESNO=$E(Y(0))
+28 ;Q
+29 ;
+30 ;Source reminder for auto-generate
+31 ;---------------------------------
+32 ;AUTO S DIC("A")="SELECT REMINDER TO GENERATE DIALOG FROM: "
+33 ;S LIT1="You must select a reminder!"
+34 ;D SEL(811.9,"AEQMZ",.PXRMREM)
+35 ;Q:$D(DTOUT)!$D(DUOUT)
+36 ;S REM=$P(PXRMREM(1),U),DNAME=""
+37 ;Display related dialogs
+38 ;D DISP(REM)
+39 ;Promt for type of generate
+40 ;D AUTOP(REM)
+41 ;Q
+42 ;
+43 ;Autogenerate prompts
+44 ;--------------------
+45 ;AUTOP(REM) ;
+46 ;S RNAME=$P($G(^PXD(811.9,REM,0)),U)
+47 ;F D Q:$D(DUOUT)!$D(DTOUT)!(DNAME]"")
+48 ;.N CONFIRM,X,Y,DIR,DA
+49 ;.K DIROUT,DIRUT,DTOUT,DUOUT
+50 ;.S DIR(0)="F"_U_"3:40"_U_"K:(X?.N)!'(X'?1P.E) X"
+51 ;.S DIR("A")="ENTER A UNIQUE DIALOG NAME"
+52 ;.S DIR("B")=RNAME
+53 ;.S DIR("?")="Select a unique name for the generated dialog."
+54 ;.S DIR("??")=U_"D HELP^PXRMDBLD(6)"
+55 ;.D ^DIR K DIR
+56 ;.I $D(DIROUT) S DTOUT=1
+57 ;.I $D(DTOUT)!($D(DUOUT)) Q
+58 ;.I Y["""" D EN^DDIOL(" name cannot contain quotes!") Q
+59 ;.I $D(^PXRMD(801.41,"B",Y)) D Q:$G(DTOUT)=1
+60 ;..D CONFIRM(.CONFIRM,Y) I CONFIRM="Y" D Q:$G(DTOUT)=1
+61 ;...S DA=$O(^PXRMD(801.41,"B",Y,""))
+62 ;...I $P($G(^PXRMD(801.41,DA,0)),U,3)="" D Q:$G(DTOUT)=1
+63 ;....W !!,"THE CURRENT DIALOG IS ENABLED PLEASE DISABLE IT BEFORE "
+64 ;....W "CONTINING." H 2 S DTOUT=1 Q
+65 ;..I '$$OVER(Y) S DTOUT=1 Q
+66 ;..S Y=$$NAME^PXRMDCPY(DA,Y)
+67 ;..;If this is the linked reminder clear it
+68 ;..I $P($G(^PXD(811.9,REM,51)),U)=$G(DA) S $P(^PXD(811.9,REM,51),U)=""
+69 ;.;Option to LINK DIALOG to REMINDER if reminder is not linked already
+70 ;.S RLNK=$P($G(^PXD(811.9,REM,51)),U),PXRMLINK=0
+71 ;.I 'RLNK D LINK(.PXRMLINK) Q:$D(DTOUT)!$D(DUOUT)
+72 ;.;Option to enable dialog
+73 ;.D ENABLE(.PXRMENAB) Q:$D(DTOUT)!$D(DUOUT)
+74 ;.;Option to replace existing dialog elements
+75 ;.D REPL(.PXRMREPL) Q:$D(DTOUT)!$D(DUOUT)
+76 ;.;Use name entered
+77 ;.S DNAME=Y
+78 ;
+79 ;Q:$D(DUOUT)!$D(DTOUT)
+80 ;Build dialog
+81 ;N CHECK D BUILD^PXRMDBL1(REM,DNAME,.CHECK)
+82 ;D FINDCHCK(DNAME)
+83 ;Q
+84 ;
+85 ;;Display dialogs autogenerated from this reminder
+86 ;;------------------------------------------------
+87 ;DISP(RIEN) ;
+88 ;N ARRAY,DSUB,FIRST
+89 ;;Get Autogenerated dialogs
+90 ;S FIRST=1,DSUB=""
+91 ;F S DSUB=$O(^PXRMD(801.41,"AG",RIEN,DSUB)) Q:'DSUB D
+92 ;.I FIRST W !!,"Associated Dialogs:" S FIRST=0
+93 ;.W ?25,$P($G(^PXRMD(801.41,DSUB,0)),U),!
+94 ;Q
+95 ;
+96 ;;Disable generated dialog
+97 ;;------------------------
+98 ;ENABLE(YESNO) ;
+99 ;N X,Y,TEXT,DIR
+100 ;K DIROUT,DIRUT,DTOUT,DUOUT
+101 ;S DIR(0)="YA0"
+102 ;S DIR("A")="ENABLE DIALOG: "
+103 ;S DIR("B")="NO"
+104 ;S DIR("?")="Enter Y or N. For detailed help type ??"
+105 ;S DIR("??")=U_"D HELP^PXRMDBLD(4)"
+106 ;D ^DIR K DIR
+107 ;I $D(DIROUT) S DTOUT=1
+108 ;I $D(DTOUT)!($D(DUOUT)) Q
+109 ;S YESNO=$E(Y(0))
+110 ;Q
+111 ;
+112 ;FINDCHCK(DNAME) ;
+113 ;W !!,"Scanning dialog "_DNAME_" for inactived findings."
+114 ;N CNT,DIALIEN,DIEN,DLGARR,ERRCNT,ERRMSG,FAIL,NAME,STDFILES
+115 ;N STRTEXT,TEXT,TYPE,WRITMSG
+116 ;;
+117 ;S WRITMSG=0
+118 ;D DIALDSAR^PXRMFRPT(.STDFILES) I '$D(STDFILES) Q
+119 ;S DIALIEN=$O(^PXRMD(801.41,"B",DNAME,"")) Q:DIALIEN'>0
+120 ;S ERRCNT=0,CNT=0,FAIL=0
+121 ;S STRTEXT(1)="Dialog "_DNAME_" contains errors. Review the dialog before using it in CPRS."
+122 ;D BUILDMSG^PXRMDLRP(.STRTEXT,.CNT,.TEXT)
+123 ;;
+124 ;;build array of dialog items
+125 ;D DITEMAR^PXRMDLRP(DIALIEN,.DLGARR,.ERRCNT,.ERRMSG,.FAIL)
+126 ;;
+127 ;;bad data format in the dialog
+128 ;I FAIL="F" D Q
+129 ;.D BUILDMSG^PXRMDLRP(.ERRMSG,.CNT,.TEXT)
+130 ;.D EN^DDIOL(.TEXT)
+131 ;.H 2
+132 ;;
+133 ;;scan for inactive finding items, checks against standardized files
+134 ;S DIEN=0 F S DIEN=$O(DLGARR(DIEN)) Q:DIEN'>0 D
+135 ;.K ERRMSG
+136 ;.I $$DISABCHK^PXRMDLG6(DIEN,.STDFILES,.ERRMSG)=1 Q
+137 ;.;
+138 ;.S NAME=$P($G(^PXRMD(801.41,DIEN,0)),U)
+139 ;.S TYPE=$$EXTERNAL^DILFD(801.41,4,"",$P($G(^PXRMD(801.41,DIEN,0)),U,4))
+140 ;.S $P(^PXRMD(801.41,DIEN,0),U,3)=1
+141 ;.S STRTEXT(1)="Dialog "_TYPE_" "_NAME_" has been marked disable for the following reason(s)."
+142 ;.D BUILDMSG^PXRMDLRP(.STRTEXT,.CNT,.TEXT)
+143 ;.D BUILDMSG^PXRMDLRP(.ERRMSG,.CNT,.TEXT)
+144 ;.S WRITMSG=1
+145 ;;
+146 ;I WRITMSG=1 D EN^DDIOL(.TEXT) H 2
+147 ;Q
+148 ;Link dialog to reminder
+149 ;-----------------------
+150 ;LINK(YESNO) ;
+151 ;N X,Y,TEXT,DIR
+152 ;K DIROUT,DIRUT,DTOUT,DUOUT
+153 ;S DIR(0)="YA0"
+154 ;S DIR("A")="LINK DIALOG TO REMINDER: "
+155 ;S DIR("B")="YES"
+156 ;S DIR("?")="Enter Y or N. For detailed help type ??"
+157 ;S DIR("??")=U_"D HELP^PXRMDBLD(5)"
+158 ;D ^DIR K DIR
+159 ;I $D(DIROUT) S DTOUT=1
+160 ;I $D(DTOUT)!($D(DUOUT)) Q
+161 ;S YESNO=$E(Y(0))
+162 ;Q
+163 ;;
+164 ;;Option to override existing dialog
+165 ;;----------------------------------
+166 ;OVER(DNAME) ;
+167 ;N DIR,X,Y
+168 ;S DIR(0)="Y",DIR("B")="NO"
+169 ;S DIR("A")="OVERWRITE EXISTING REMINDER DIALOG "
+170 ;S DIR("?")="Enter Y or N. For detailed help type ??"
+171 ;S DIR("??")=U_"D HELP^PXRMDBLD(2)"
+172 ;D ^DIR K DIR
+173 ;I $D(DIROUT) S DTOUT=1
+174 ;I $D(DTOUT)!($D(DUOUT)) Q 0
+175 ;Q $S(Y(0)="YES":1,1:0)
+176 ;;
+177 ;;Option to replace existing dialog elements
+178 ;;------------------------------------------
+179 ;REPL(INP) ;
+180 ;N DIR,X,Y
+181 ;S DIR(0)="Y",DIR("B")="NO"
+182 ;S DIR("A")="REPLACE ANY EXISTING DIALOG ELEMENTS"
+183 ;S DIR("?")="Enter Y or N. For detailed help type ??"
+184 ;S DIR("??")=U_"D HELP^PXRMDBLD(3)"
+185 ;D ^DIR K DIR
+186 ;I $D(DIROUT) S DTOUT=1
+187 ;I $D(DTOUT)!($D(DUOUT)) Q
+188 ;S INP=$S(Y(0)="YES":1,1:0)
+189 ;Q
+190 ;;
+191 ;;Reminder selection
+192 ;;------------------
+193 ;SEL(FILE,MODE,ARRAY) ;
+194 ;N X,Y,CNT
+195 ;K DIROUT,DIRUT,DTOUT,DUOUT
+196 ;S CNT=0
+197 ;W !
+198 ;F D Q:$D(DTOUT) Q:$D(DUOUT) Q:CNT>0 Q:(Y=-1)&(CNT>0)
+199 ;.S DIC=FILE,DIC(0)=MODE
+200 ;.D ^DIC
+201 ;.I X=(U_U) S DTOUT=1
+202 ;.I '$D(DTOUT),('$D(DUOUT)) D
+203 ;..I +Y'=-1 D Q
+204 ;...S CNT=CNT+1,ARRAY(CNT)=Y_U_Y(0,0)_U_$P(Y(0),U,3)
+205 ;..W:CNT=0 !,LIT1
+206 ;.K DIC
+207 ;Q
+208 ;
+209 ;CONFIRM(YESNO,NAME) ;
+210 ;N X,Y,TEXT,DIR
+211 ;K DIROUT,DIRUT,DTOUT,DUOUT
+212 ;S DIR(0)="YA0"
+213 ;S DIR("A")="YOU ARE ABOUT TO OVERWRITE THE EXISTING DIALOG "_NAME_" CONTINUE? "
+214 ;S DIR("B")="N"
+215 ;S DIR("?")="Enter Y or N. For detailed help type ??"
+216 ;S DIR("??")=U_"D HELP^PXRMDBLD(1)"
+217 ;D ^DIR K DIR
+218 ;I $D(DIROUT) S DTOUT=1
+219 ;I $D(DTOUT)!($D(DUOUT)) Q
+220 ;S YESNO=$E(Y(0))
+221 ;Q
+222 ;;
+223 ;General help text routine.
+224 ;--------------------------
HELP(CALL) ;
+1 NEW HTEXT
+2 NEW DIWF,DIWL,DIWR,IC
+3 SET DIWF="C75"
SET DIWL=0
SET DIWR=75
+4 ;
+5 IF CALL=1
Begin DoDot:1
+6 SET HTEXT(1)="Enter Yes to generate reminder dialog automatically for a"
+7 SET HTEXT(2)="selected reminder. Enter No to create a reminder dialog"
+8 SET HTEXT(3)="using the standard fileman edit."
End DoDot:1
+9 IF CALL=2
Begin DoDot:1
+10 SET HTEXT(1)="Enter Yes to replace the existing reminder dialog."
+11 SET HTEXT(2)="Enter No to return and enter an alternative dialog name."
End DoDot:1
+12 IF CALL=3
Begin DoDot:1
+13 SET HTEXT(1)="For each FINDING ITEM on the reminder a dialog element"
+14 SET HTEXT(2)="will be created. A separate DIALOG ELEMENT is created for"
+15 SET HTEXT(3)="each enabled RESOLUTION STATUS in the FINDING TYPE"
+16 SET HTEXT(4)="PARAMETERS for this finding type. The dialog element is"
+17 SET HTEXT(5)="unique for finding type, finding item name and resolution"
+18 SET HTEXT(6)="status name."
+19 SET HTEXT(7)="e.g. VM WEIGHT DONE will be generated for the finding item"
+20 SET HTEXT(8)=" vitals measurement/weight."
+21 SET HTEXT(9)=""
+22 SET HTEXT(10)="Enter Yes to rebuild all dialog elements used by this"
+23 SET HTEXT(11)="reminder overwriting any existing modifications."
+24 SET HTEXT(12)=""
+25 SET HTEXT(13)="Enter No to use existing dialog elements if they exist."
+26 SET HTEXT(14)="New dialog elements will be created if they don't already"
+27 SET HTEXT(15)="exist."
End DoDot:1
+28 IF CALL=4
Begin DoDot:1
+29 SET HTEXT(1)="Enter Yes to create a dialog enabled for use in CPRS."
+30 SET HTEXT(2)="Enter No to create a dialog disabled for CPRS."
End DoDot:1
+31 IF CALL=5
Begin DoDot:1
+32 SET HTEXT(1)="If the source reminder is not linked to any other dialog"
+33 SET HTEXT(2)="enter Yes to link the reminder to the generated dialog."
+34 SET HTEXT(3)="Enter No if no link should be made."
End DoDot:1
+35 IF CALL=6
Begin DoDot:1
+36 SET HTEXT(1)="Enter the name of the dialog. The default is the reminder"
+37 SET HTEXT(2)="name. If the name of an existing dialog is specified the"
+38 SET HTEXT(3)="option to override the existing dialog will be given."
End DoDot:1
+39 KILL ^UTILITY($JOB,"W")
+40 SET IC=""
+41 FOR
SET IC=$ORDER(HTEXT(IC))
if IC=""
QUIT
Begin DoDot:1
+42 SET X=HTEXT(IC)
+43 DO ^DIWP
End DoDot:1
+44 WRITE !
+45 SET IC=0
+46 FOR
SET IC=$ORDER(^UTILITY($JOB,"W",0,IC))
if IC=""
QUIT
Begin DoDot:1
+47 WRITE !,^UTILITY($JOB,"W",0,IC,0)
End DoDot:1
+48 KILL ^UTILITY($JOB,"W")
+49 WRITE !
+50 QUIT