PXRMREDT ;SLC/PKR,PJH - Edit PXRM reminder definition. ;03/29/2022
;;2.0;CLINICAL REMINDERS;**4,6,12,18,26,47,45,65**;Feb 04, 2005;Build 438
;
;---------------
EEDIT ;Entry point for PXRM DEFINITION EDIT option.
;Build list of finding file definitions.
N DA,DEF,DEF1,DEF2,DIC,NEW,Y
D DEF^PXRMRUTL("811.902",.DEF,.DEF1,.DEF2)
S DIC="^PXD(811.9,"
LOOP ;
S Y=$$GETDEF
I Y=-1 Q
S DA=$P(Y,U,1)
S NEW=$P(Y,U,3)
D ALL(DIC,DA,.DEF1,NEW)
G LOOP
Q
;
;---------------
GETDEF() ;Let a user select a definition and return the IEN.
N DA,DIC,DLAYGO,DTOUT,DUOUT,Y
S DIC="^PXD(811.9,"
S DIC(0)="AEMQL"
S DIC("A")="Select Reminder Definition: "
S DLAYGO=811.9
GETNAME ;Get the name of the reminder definition to edit.
;Set the starting place for additions.
D SETSTART^PXRMCOPY(DIC)
W !
S DIC("W")="W $$LUDISP^PXRMREDT(Y)"
D ^DIC
I ($D(DTOUT))!($D(DUOUT)) Q -1
Q Y
;
;---------------
;Select section of reminder to edit, also called at ALL by PXRMEDIT.
;----------------------------------
;ALL(DIC,DA,DEF1,NEW) ;
ALL(ROOT,DA,DEF1,NEW) ;
;Get list of findings/terms for reminder
N BLDLOGIC,DIK,DIR,DTOUT,DUOUT,LIST,NODE,OPTION,TYPE
;Note that DIR is newed here because it may be defined from the
;definition copy and if it is defined it can cause ^DIE to not work
;properly.
STRTEDIT S BLDLOGIC=0
;Build finding list
S NODE="^PXD(811.9)"
D LIST(NODE,DA,.DEF1,.LIST)
;If this is a new reminder enter all fields
I $G(NEW) D EDIT(ROOT,DA) Q
;National reminder allows editing of term findings only
I '$$VEDIT^PXRMUTIL(ROOT,DA) D Q:$D(DUOUT)!$D(DTOUT)
.S TYPE=""
.F S TYPE=$O(LIST(TYPE)) Q:TYPE="" D
.. I TYPE="RT" Q
.. K LIST(TYPE)
.I '$D(LIST) S DUOUT=1 Q
.S BLDLOGIC=1
.D TFIND(DA,.LIST)
.I $D(Y) S DUOUT=1
;Otherwise choose fields to edit
I $$VEDIT^PXRMUTIL(ROOT,DA) F D Q:($G(OPTION)="^")!$D(DUOUT)!$D(DTOUT)
.S OPTION=$$OPTION^PXRMREDT Q:(OPTION="^")!$D(DUOUT)!$D(DTOUT)
.;All details
.I OPTION="A" D
.. S BLDLOGIC=1
.. D EDIT(ROOT,DA)
.;Set up local variables
.N DIE,DR S DIE=ROOT N DIC
.;Descriptions
.I OPTION="G" D
..D GEN
.;Baseline Frequency
.I OPTION="B" D
..S BLDLOGIC=1
..D BASE
.;Findings
.I OPTION="F" D
..S BLDLOGIC=1
..D FIND(.LIST)
.;Function findings
.I OPTION="FF" D
..S BLDLOGIC=1
..D FFIND
.;Logic
.I OPTION="L" D
..S BLDLOGIC=1
..D LOGIC
.;Custom date due
. I OPTION="C" D
..S BLDLOGIC=1
..D CDUE
.;Dialog
.I OPTION="D" D
..D DIALOG
.;Web addresses
.I OPTION="W" D
..D WEB
.;If necessary build the internal logic strings.
.I BLDLOGIC D BLDALL^PXRMLOGX(DA,"","")
. I '$D(^PXD(811.9,DA)) Q
. I OPTION="^" G STRTEDIT
. W !,"Checking integrity of the definition ...",#
. N OUTPUT
. I '$$DEF^PXRMICHK(DA,.OUTPUT,1) G STRTEDIT
.;If it passes the integrity check save the edit history.
. D SEHIST^PXRMUTIL(811.9,ROOT,DA)
Q
;
;Reminder Edit
;---------------
EDIT(ROOT,DA) ;
N DIC,DIDEL,DIE,DR,OUTPUT,RESULT
S DIE=ROOT,DIDEL=811.9
;Edit the fields in the same order they are printed by a reminder
;inquiry.
;Reminder name
W !!
S DR=".01"
D ^DIE
;If DA is undefined then the entry was deleted and we are done.
I '$D(DA) S DTOUT=1 Q
I $D(Y) S DTOUT=1 Q
;
;Other fields
D GEN Q:$D(Y)
D BASE Q:$D(Y)
D FIND(.LIST) Q:$D(Y)
D FFIND Q:$D(Y)
D LOGIC Q:$D(Y)
D DIALOG Q:$D(Y)
D WEB Q:$D(Y)
W #
I '$D(^PXD(811.9,DA)) Q
I '$$DEF^PXRMICHK(DA,.OUTPUT,1) G STRTEDIT
;If it passes the integrity check save the edit history.
D SEHIST^PXRMUTIL(811.9,DIC,DA)
Q
;
GEN ;Print name
W !!
S DR="1.2"
D ^DIE
I $D(Y) Q
;
CLASS ;
;Class
W !!
S DR="100"
D ^DIE
I $D(Y) Q
;Sponsor
S DR="101"
D ^DIE
I $D(Y) Q
;Make sure Class and Sponsor Class are in synch.
S RESULT=$$VSPONSOR^PXRMINTR(X)
I RESULT=0 G CLASS
;Review date, Usage
S DR="102;103"
D ^DIE
I $D(Y) Q
;
;Related VA-* reminder
W !!
S DR="1.4"
D ^DIE
I $D(Y) Q
;
;Inactive flag
W !!
S DR="1.6"
D ^DIE
I $D(Y) Q
;Ignore on N/A
S DR=1.8
D ^DIE
I $D(Y) Q
;
;Rescission Date
S DR="69"
D ^DIE
I $D(Y) Q
;
;Reminder description
W !!
S DR="2"
D ^DIE
I $D(Y) Q
;
;Technical description
W !!
S DR="3"
D ^DIE
;
;Priority
W !!
S DR="1.91"
D ^DIE
Q
;
BASE W !!,"Baseline Frequency"
;Do in advance time frame
S DR=1.3
D ^DIE
I $D(Y) Q
;
;Sex specific
S DR=1.9
D ^DIE
I $D(Y) Q
FARS ;
W !!,"Baseline frequency age range set"
S DR="7"
S DR(2,811.97)=".01;1;2;3;4"
D ^DIE
I $$OVLAP^PXRMAGE G FARS
D SNMLA^PXRMFNFT(DA)
Q
;
FIND(LIST) ;Edit findings (multiple)
D FIND^PXRMREDF(.LIST)
D SNMLF^PXRMFNFT(DA,20)
Q
;
FFIND W !!,"Function Findings"
D FFIND^PXRMREDF
D SNMLF^PXRMFNFT(DA,25)
Q
;
LOGIC W !!,"Patient Cohort and Resolution Logic"
S DR="30T;60T;61T;70T;71T;34T;65T;66T;75T;76T"
D ^DIE
;Make sure the Patient Cohort Logic at least contains the default.
I $G(^PXD(811.9,DA,31))="" D
. S ^PXD(811.9,DA,31)="(SEX)&(AGE)"
. S ^PXD(811.9,DA,32)="2"_U_"SEX;AGE"
W !!,"Contraindicated and Refused Logic"
S DR="80T;83T;84T;90T;93T;94T"
D ^DIE
D SNMLL^PXRMFNFT(DA)
Q
;
CDUE W !!,"Custom Date Due"
S DR=45
D ^DIE
Q
;
DIALOG W !!,"Reminder Dialog"
S DR="51"
D ^DIE
Q
;
WEB W !!,"Web Addresses for Reminder Information"
S DR="50"
D ^DIE
Q
;
;Get full list of findings
;---------------
LIST(GBL,DA,DEF1,ARRAY) ;
N CNT,DATA,GLOB,IEN,NAME,NODE,SUB,TYPE
;Clear passed arrays
K ARRAY
S CNT=0
;Build cross reference global to file number
;Get each finding
S SUB=0 F S SUB=$O(@GBL@(DA,20,SUB)) Q:'SUB D
.S DATA=$G(@GBL@(DA,20,SUB,0)) I DATA="" Q
.;Determine global and global IEN
.S NODE=$P(DATA,U),GLOB=$P(NODE,";",2),IEN=$P(NODE,";")
.;Ignore null entries
.I (GLOB="")!(IEN="") Q
.;Work out the file type
.S TYPE=$G(DEF1(GLOB)) Q:TYPE=""
.S CNT=CNT+1
.I $P($G(@(U_GLOB_IEN_",0)")),U)="" D
..W !,"**WARNING** Finding #"_SUB_" does not exist, select finding `"_SUB_" to edit it." Q
.E S NAME=$P($G(@(U_GLOB_IEN_",0)")),U) S ARRAY(TYPE,NAME,SUB)=IEN
Q
;
;---------------
;Choose which part of Reminder to edit
OPTION() ;
N DIR,X,Y
;Display warning message if un-mapped terms exist
K DIROUT,DIRUT
S DIR(0)="SO"_U
S DIR(0)=DIR(0)_"A:All reminder details;"
S DIR(0)=DIR(0)_"G:General;"
S DIR(0)=DIR(0)_"B:Baseline Frequency;"
S DIR(0)=DIR(0)_"F:Findings;"
S DIR(0)=DIR(0)_"FF:Function Findings;"
S DIR(0)=DIR(0)_"L:Logic;"
S DIR(0)=DIR(0)_"C:Custom date due;"
S DIR(0)=DIR(0)_"D:Reminder Dialog;"
S DIR(0)=DIR(0)_"W:Web Addresses;"
S DIR("A",1)="Select a section to edit; press ENTER when you are done editing."
S DIR("A")="To quit and exit type '^'"
S DIR("?")="Select which section of the reminder you wish to edit."
S DIR("??")="^D HELP^PXRMREDF(2)"
D ^DIR K DIR
I (Y="")!(Y="^") S DUOUT=1
Q Y
;
;---------------
LUDISP(IEN) ;Use for DIC("W") to augment look-up display.
N CLASS,EM,INACTIVE,TEXT
S INACTIVE=$P(^PXD(811.9,IEN,0),U,6)
S CLASS=$P(^PXD(811.9,IEN,100),U,1)
I INACTIVE'="" S INACTIVE="("_$$EXTERNAL^DILFD(811.9,1.6,"",INACTIVE,.EM)_")"
S CLASS=$$EXTERNAL^DILFD(811.9,100,"",CLASS,.EM)
S TEXT=" "_CLASS_" "_INACTIVE
Q TEXT
;
;---------------
PNEDIT ;Allow for editing the print name of national reminders.
N DA,DDSFILE,DR,EDITDT,FDA,MSG,NPNAME,OPNAME,WPTMP,Y
S DDSFILE=811.9
S DR="[PXRM DEF PRINT NAME EDIT]"
NXT1 S Y=$$GETDEF
I Y=-1 Q
S DA=$P(Y,U,1)
S OPNAME=$P(^PXD(811.9,DA,0),U,3)
D ^DDS
S NPNAME=$P(^PXD(811.9,DA,0),U,3)
I NPNAME'=OPNAME D
. S EDITDT=$$NOW^XLFDT
. S WPTMP(1)="The Print Name was edited\\"
. S WPTMP(2)=" by: "_$P(^VA(200,DUZ,0),U,1)_"\\"
. S WPTMP(3)=" on: "_$$FMTE^XLFDT(EDITDT,"5Z")_"\\"
. S WPTMP(4)=" "
. S WPTMP(5)="Original: "_OPNAME_"\\"
. S WPTMP(6)="New: "_NPNAME_"\\"
. S IENS="+1,"_DA_","
. S FDA(811.9001,IENS,.01)=EDITDT
. S FDA(811.9001,IENS,1)=DUZ
. S FDA(811.9001,IENS,2)="WPTMP"
. D UPDATE^DIE("","FDA","","MSG")
G NXT1
Q
;
;---------------
TFIND(DA,LIST) ;Allow edit of term findings for national reminders.
N DIR,IENLIST,IND,JND,NAME,NAMELIST,SUB,X,Y
S IND=0,NAME=""
F S NAME=$O(LIST("RT",NAME)) Q:NAME="" D
. S IND=IND+1
. S NAMELIST(IND)=$$RJ^XLFSTR(IND,3)_" "_NAME
. S SUB=$O(LIST("RT",NAME,""))
. S IENLIST(IND)=LIST("RT",NAME,SUB)
M DIR("A")=NAMELIST
S DIR("A")="Enter your list"
S DIR(0)="LO^1:"_IND
W !!,"Select term(s) for finding edit:"
D ^DIR
I $D(DIROUT)!$D(DIRUT) S LIST="" Q
I $D(DUOUT)!$D(DTOUT) S LIST="" Q
F IND=1:1:$L(Y,",")-1 D
. S JND=$P(Y,",",IND)
. S NAME=$P(NAMELIST(JND),JND,2)
. W !!,"Reminder Term:",NAME
. D TMAP^PXRMREDF(DA,IENLIST(JND))
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMREDT 8834 printed Dec 13, 2024@01:48:49 Page 2
PXRMREDT ;SLC/PKR,PJH - Edit PXRM reminder definition. ;03/29/2022
+1 ;;2.0;CLINICAL REMINDERS;**4,6,12,18,26,47,45,65**;Feb 04, 2005;Build 438
+2 ;
+3 ;---------------
EEDIT ;Entry point for PXRM DEFINITION EDIT option.
+1 ;Build list of finding file definitions.
+2 NEW DA,DEF,DEF1,DEF2,DIC,NEW,Y
+3 DO DEF^PXRMRUTL("811.902",.DEF,.DEF1,.DEF2)
+4 SET DIC="^PXD(811.9,"
LOOP ;
+1 SET Y=$$GETDEF
+2 IF Y=-1
QUIT
+3 SET DA=$PIECE(Y,U,1)
+4 SET NEW=$PIECE(Y,U,3)
+5 DO ALL(DIC,DA,.DEF1,NEW)
+6 GOTO LOOP
+7 QUIT
+8 ;
+9 ;---------------
GETDEF() ;Let a user select a definition and return the IEN.
+1 NEW DA,DIC,DLAYGO,DTOUT,DUOUT,Y
+2 SET DIC="^PXD(811.9,"
+3 SET DIC(0)="AEMQL"
+4 SET DIC("A")="Select Reminder Definition: "
+5 SET DLAYGO=811.9
GETNAME ;Get the name of the reminder definition to edit.
+1 ;Set the starting place for additions.
+2 DO SETSTART^PXRMCOPY(DIC)
+3 WRITE !
+4 SET DIC("W")="W $$LUDISP^PXRMREDT(Y)"
+5 DO ^DIC
+6 IF ($DATA(DTOUT))!($DATA(DUOUT))
QUIT -1
+7 QUIT Y
+8 ;
+9 ;---------------
+10 ;Select section of reminder to edit, also called at ALL by PXRMEDIT.
+11 ;----------------------------------
+12 ;ALL(DIC,DA,DEF1,NEW) ;
ALL(ROOT,DA,DEF1,NEW) ;
+1 ;Get list of findings/terms for reminder
+2 NEW BLDLOGIC,DIK,DIR,DTOUT,DUOUT,LIST,NODE,OPTION,TYPE
+3 ;Note that DIR is newed here because it may be defined from the
+4 ;definition copy and if it is defined it can cause ^DIE to not work
+5 ;properly.
STRTEDIT SET BLDLOGIC=0
+1 ;Build finding list
+2 SET NODE="^PXD(811.9)"
+3 DO LIST(NODE,DA,.DEF1,.LIST)
+4 ;If this is a new reminder enter all fields
+5 IF $GET(NEW)
DO EDIT(ROOT,DA)
QUIT
+6 ;National reminder allows editing of term findings only
+7 IF '$$VEDIT^PXRMUTIL(ROOT,DA)
Begin DoDot:1
+8 SET TYPE=""
+9 FOR
SET TYPE=$ORDER(LIST(TYPE))
if TYPE=""
QUIT
Begin DoDot:2
+10 IF TYPE="RT"
QUIT
+11 KILL LIST(TYPE)
End DoDot:2
+12 IF '$DATA(LIST)
SET DUOUT=1
QUIT
+13 SET BLDLOGIC=1
+14 DO TFIND(DA,.LIST)
+15 IF $DATA(Y)
SET DUOUT=1
End DoDot:1
if $DATA(DUOUT)!$DATA(DTOUT)
QUIT
+16 ;Otherwise choose fields to edit
+17 IF $$VEDIT^PXRMUTIL(ROOT,DA)
FOR
Begin DoDot:1
+18 SET OPTION=$$OPTION^PXRMREDT
if (OPTION="^")!$DATA(DUOUT)!$DATA(DTOUT)
QUIT
+19 ;All details
+20 IF OPTION="A"
Begin DoDot:2
+21 SET BLDLOGIC=1
+22 DO EDIT(ROOT,DA)
End DoDot:2
+23 ;Set up local variables
+24 NEW DIE,DR
SET DIE=ROOT
NEW DIC
+25 ;Descriptions
+26 IF OPTION="G"
Begin DoDot:2
+27 DO GEN
End DoDot:2
+28 ;Baseline Frequency
+29 IF OPTION="B"
Begin DoDot:2
+30 SET BLDLOGIC=1
+31 DO BASE
End DoDot:2
+32 ;Findings
+33 IF OPTION="F"
Begin DoDot:2
+34 SET BLDLOGIC=1
+35 DO FIND(.LIST)
End DoDot:2
+36 ;Function findings
+37 IF OPTION="FF"
Begin DoDot:2
+38 SET BLDLOGIC=1
+39 DO FFIND
End DoDot:2
+40 ;Logic
+41 IF OPTION="L"
Begin DoDot:2
+42 SET BLDLOGIC=1
+43 DO LOGIC
End DoDot:2
+44 ;Custom date due
+45 IF OPTION="C"
Begin DoDot:2
+46 SET BLDLOGIC=1
+47 DO CDUE
End DoDot:2
+48 ;Dialog
+49 IF OPTION="D"
Begin DoDot:2
+50 DO DIALOG
End DoDot:2
+51 ;Web addresses
+52 IF OPTION="W"
Begin DoDot:2
+53 DO WEB
End DoDot:2
+54 ;If necessary build the internal logic strings.
+55 IF BLDLOGIC
DO BLDALL^PXRMLOGX(DA,"","")
+56 IF '$DATA(^PXD(811.9,DA))
QUIT
+57 IF OPTION="^"
GOTO STRTEDIT
+58 WRITE !,"Checking integrity of the definition ...",#
+59 NEW OUTPUT
+60 IF '$$DEF^PXRMICHK(DA,.OUTPUT,1)
GOTO STRTEDIT
+61 ;If it passes the integrity check save the edit history.
+62 DO SEHIST^PXRMUTIL(811.9,ROOT,DA)
End DoDot:1
if ($GET(OPTION)="^")!$DATA(DUOUT)!$DATA(DTOUT)
QUIT
+63 QUIT
+64 ;
+65 ;Reminder Edit
+66 ;---------------
EDIT(ROOT,DA) ;
+1 NEW DIC,DIDEL,DIE,DR,OUTPUT,RESULT
+2 SET DIE=ROOT
SET DIDEL=811.9
+3 ;Edit the fields in the same order they are printed by a reminder
+4 ;inquiry.
+5 ;Reminder name
+6 WRITE !!
+7 SET DR=".01"
+8 DO ^DIE
+9 ;If DA is undefined then the entry was deleted and we are done.
+10 IF '$DATA(DA)
SET DTOUT=1
QUIT
+11 IF $DATA(Y)
SET DTOUT=1
QUIT
+12 ;
+13 ;Other fields
+14 DO GEN
if $DATA(Y)
QUIT
+15 DO BASE
if $DATA(Y)
QUIT
+16 DO FIND(.LIST)
if $DATA(Y)
QUIT
+17 DO FFIND
if $DATA(Y)
QUIT
+18 DO LOGIC
if $DATA(Y)
QUIT
+19 DO DIALOG
if $DATA(Y)
QUIT
+20 DO WEB
if $DATA(Y)
QUIT
+21 WRITE #
+22 IF '$DATA(^PXD(811.9,DA))
QUIT
+23 IF '$$DEF^PXRMICHK(DA,.OUTPUT,1)
GOTO STRTEDIT
+24 ;If it passes the integrity check save the edit history.
+25 DO SEHIST^PXRMUTIL(811.9,DIC,DA)
+26 QUIT
+27 ;
GEN ;Print name
+1 WRITE !!
+2 SET DR="1.2"
+3 DO ^DIE
+4 IF $DATA(Y)
QUIT
+5 ;
CLASS ;
+1 ;Class
+2 WRITE !!
+3 SET DR="100"
+4 DO ^DIE
+5 IF $DATA(Y)
QUIT
+6 ;Sponsor
+7 SET DR="101"
+8 DO ^DIE
+9 IF $DATA(Y)
QUIT
+10 ;Make sure Class and Sponsor Class are in synch.
+11 SET RESULT=$$VSPONSOR^PXRMINTR(X)
+12 IF RESULT=0
GOTO CLASS
+13 ;Review date, Usage
+14 SET DR="102;103"
+15 DO ^DIE
+16 IF $DATA(Y)
QUIT
+17 ;
+18 ;Related VA-* reminder
+19 WRITE !!
+20 SET DR="1.4"
+21 DO ^DIE
+22 IF $DATA(Y)
QUIT
+23 ;
+24 ;Inactive flag
+25 WRITE !!
+26 SET DR="1.6"
+27 DO ^DIE
+28 IF $DATA(Y)
QUIT
+29 ;Ignore on N/A
+30 SET DR=1.8
+31 DO ^DIE
+32 IF $DATA(Y)
QUIT
+33 ;
+34 ;Rescission Date
+35 SET DR="69"
+36 DO ^DIE
+37 IF $DATA(Y)
QUIT
+38 ;
+39 ;Reminder description
+40 WRITE !!
+41 SET DR="2"
+42 DO ^DIE
+43 IF $DATA(Y)
QUIT
+44 ;
+45 ;Technical description
+46 WRITE !!
+47 SET DR="3"
+48 DO ^DIE
+49 ;
+50 ;Priority
+51 WRITE !!
+52 SET DR="1.91"
+53 DO ^DIE
+54 QUIT
+55 ;
BASE WRITE !!,"Baseline Frequency"
+1 ;Do in advance time frame
+2 SET DR=1.3
+3 DO ^DIE
+4 IF $DATA(Y)
QUIT
+5 ;
+6 ;Sex specific
+7 SET DR=1.9
+8 DO ^DIE
+9 IF $DATA(Y)
QUIT
FARS ;
+1 WRITE !!,"Baseline frequency age range set"
+2 SET DR="7"
+3 SET DR(2,811.97)=".01;1;2;3;4"
+4 DO ^DIE
+5 IF $$OVLAP^PXRMAGE
GOTO FARS
+6 DO SNMLA^PXRMFNFT(DA)
+7 QUIT
+8 ;
FIND(LIST) ;Edit findings (multiple)
+1 DO FIND^PXRMREDF(.LIST)
+2 DO SNMLF^PXRMFNFT(DA,20)
+3 QUIT
+4 ;
FFIND WRITE !!,"Function Findings"
+1 DO FFIND^PXRMREDF
+2 DO SNMLF^PXRMFNFT(DA,25)
+3 QUIT
+4 ;
LOGIC WRITE !!,"Patient Cohort and Resolution Logic"
+1 SET DR="30T;60T;61T;70T;71T;34T;65T;66T;75T;76T"
+2 DO ^DIE
+3 ;Make sure the Patient Cohort Logic at least contains the default.
+4 IF $GET(^PXD(811.9,DA,31))=""
Begin DoDot:1
+5 SET ^PXD(811.9,DA,31)="(SEX)&(AGE)"
+6 SET ^PXD(811.9,DA,32)="2"_U_"SEX;AGE"
End DoDot:1
+7 WRITE !!,"Contraindicated and Refused Logic"
+8 SET DR="80T;83T;84T;90T;93T;94T"
+9 DO ^DIE
+10 DO SNMLL^PXRMFNFT(DA)
+11 QUIT
+12 ;
CDUE WRITE !!,"Custom Date Due"
+1 SET DR=45
+2 DO ^DIE
+3 QUIT
+4 ;
DIALOG WRITE !!,"Reminder Dialog"
+1 SET DR="51"
+2 DO ^DIE
+3 QUIT
+4 ;
WEB WRITE !!,"Web Addresses for Reminder Information"
+1 SET DR="50"
+2 DO ^DIE
+3 QUIT
+4 ;
+5 ;Get full list of findings
+6 ;---------------
LIST(GBL,DA,DEF1,ARRAY) ;
+1 NEW CNT,DATA,GLOB,IEN,NAME,NODE,SUB,TYPE
+2 ;Clear passed arrays
+3 KILL ARRAY
+4 SET CNT=0
+5 ;Build cross reference global to file number
+6 ;Get each finding
+7 SET SUB=0
FOR
SET SUB=$ORDER(@GBL@(DA,20,SUB))
if 'SUB
QUIT
Begin DoDot:1
+8 SET DATA=$GET(@GBL@(DA,20,SUB,0))
IF DATA=""
QUIT
+9 ;Determine global and global IEN
+10 SET NODE=$PIECE(DATA,U)
SET GLOB=$PIECE(NODE,";",2)
SET IEN=$PIECE(NODE,";")
+11 ;Ignore null entries
+12 IF (GLOB="")!(IEN="")
QUIT
+13 ;Work out the file type
+14 SET TYPE=$GET(DEF1(GLOB))
if TYPE=""
QUIT
+15 SET CNT=CNT+1
+16 IF $PIECE($GET(@(U_GLOB_IEN_",0)")),U)=""
Begin DoDot:2
+17 WRITE !,"**WARNING** Finding #"_SUB_" does not exist, select finding `"_SUB_" to edit it."
QUIT
End DoDot:2
+18 IF '$TEST
SET NAME=$PIECE($GET(@(U_GLOB_IEN_",0)")),U)
SET ARRAY(TYPE,NAME,SUB)=IEN
End DoDot:1
+19 QUIT
+20 ;
+21 ;---------------
+22 ;Choose which part of Reminder to edit
OPTION() ;
+1 NEW DIR,X,Y
+2 ;Display warning message if un-mapped terms exist
+3 KILL DIROUT,DIRUT
+4 SET DIR(0)="SO"_U
+5 SET DIR(0)=DIR(0)_"A:All reminder details;"
+6 SET DIR(0)=DIR(0)_"G:General;"
+7 SET DIR(0)=DIR(0)_"B:Baseline Frequency;"
+8 SET DIR(0)=DIR(0)_"F:Findings;"
+9 SET DIR(0)=DIR(0)_"FF:Function Findings;"
+10 SET DIR(0)=DIR(0)_"L:Logic;"
+11 SET DIR(0)=DIR(0)_"C:Custom date due;"
+12 SET DIR(0)=DIR(0)_"D:Reminder Dialog;"
+13 SET DIR(0)=DIR(0)_"W:Web Addresses;"
+14 SET DIR("A",1)="Select a section to edit; press ENTER when you are done editing."
+15 SET DIR("A")="To quit and exit type '^'"
+16 SET DIR("?")="Select which section of the reminder you wish to edit."
+17 SET DIR("??")="^D HELP^PXRMREDF(2)"
+18 DO ^DIR
KILL DIR
+19 IF (Y="")!(Y="^")
SET DUOUT=1
+20 QUIT Y
+21 ;
+22 ;---------------
LUDISP(IEN) ;Use for DIC("W") to augment look-up display.
+1 NEW CLASS,EM,INACTIVE,TEXT
+2 SET INACTIVE=$PIECE(^PXD(811.9,IEN,0),U,6)
+3 SET CLASS=$PIECE(^PXD(811.9,IEN,100),U,1)
+4 IF INACTIVE'=""
SET INACTIVE="("_$$EXTERNAL^DILFD(811.9,1.6,"",INACTIVE,.EM)_")"
+5 SET CLASS=$$EXTERNAL^DILFD(811.9,100,"",CLASS,.EM)
+6 SET TEXT=" "_CLASS_" "_INACTIVE
+7 QUIT TEXT
+8 ;
+9 ;---------------
PNEDIT ;Allow for editing the print name of national reminders.
+1 NEW DA,DDSFILE,DR,EDITDT,FDA,MSG,NPNAME,OPNAME,WPTMP,Y
+2 SET DDSFILE=811.9
+3 SET DR="[PXRM DEF PRINT NAME EDIT]"
NXT1 SET Y=$$GETDEF
+1 IF Y=-1
QUIT
+2 SET DA=$PIECE(Y,U,1)
+3 SET OPNAME=$PIECE(^PXD(811.9,DA,0),U,3)
+4 DO ^DDS
+5 SET NPNAME=$PIECE(^PXD(811.9,DA,0),U,3)
+6 IF NPNAME'=OPNAME
Begin DoDot:1
+7 SET EDITDT=$$NOW^XLFDT
+8 SET WPTMP(1)="The Print Name was edited\\"
+9 SET WPTMP(2)=" by: "_$PIECE(^VA(200,DUZ,0),U,1)_"\\"
+10 SET WPTMP(3)=" on: "_$$FMTE^XLFDT(EDITDT,"5Z")_"\\"
+11 SET WPTMP(4)=" "
+12 SET WPTMP(5)="Original: "_OPNAME_"\\"
+13 SET WPTMP(6)="New: "_NPNAME_"\\"
+14 SET IENS="+1,"_DA_","
+15 SET FDA(811.9001,IENS,.01)=EDITDT
+16 SET FDA(811.9001,IENS,1)=DUZ
+17 SET FDA(811.9001,IENS,2)="WPTMP"
+18 DO UPDATE^DIE("","FDA","","MSG")
End DoDot:1
+19 GOTO NXT1
+20 QUIT
+21 ;
+22 ;---------------
TFIND(DA,LIST) ;Allow edit of term findings for national reminders.
+1 NEW DIR,IENLIST,IND,JND,NAME,NAMELIST,SUB,X,Y
+2 SET IND=0
SET NAME=""
+3 FOR
SET NAME=$ORDER(LIST("RT",NAME))
if NAME=""
QUIT
Begin DoDot:1
+4 SET IND=IND+1
+5 SET NAMELIST(IND)=$$RJ^XLFSTR(IND,3)_" "_NAME
+6 SET SUB=$ORDER(LIST("RT",NAME,""))
+7 SET IENLIST(IND)=LIST("RT",NAME,SUB)
End DoDot:1
+8 MERGE DIR("A")=NAMELIST
+9 SET DIR("A")="Enter your list"
+10 SET DIR(0)="LO^1:"_IND
+11 WRITE !!,"Select term(s) for finding edit:"
+12 DO ^DIR
+13 IF $DATA(DIROUT)!$DATA(DIRUT)
SET LIST=""
QUIT
+14 IF $DATA(DUOUT)!$DATA(DTOUT)
SET LIST=""
QUIT
+15 FOR IND=1:1:$LENGTH(Y,",")-1
Begin DoDot:1
+16 SET JND=$PIECE(Y,",",IND)
+17 SET NAME=$PIECE(NAMELIST(JND),JND,2)
+18 WRITE !!,"Reminder Term:",NAME
+19 DO TMAP^PXRMREDF(DA,IENLIST(JND))
End DoDot:1
+20 QUIT
+21 ;