PXRMDLFI ; SLC/PKR - Handle Reminder dialog findings. ;06/08/2009
;;2.0;CLINICAL REMINDERS;**12**;Feb 04, 2005;Build 73
;
;=================================================
DISP(IEN,SC) ;Display findings and additional findings.
;Called from print template PXRM DIALOG ELEMENT. SC is the starting
;column for the display.
N ABBR,FI,FIEN,FMTSTR,GBL,IND,JND,NAME,NL,OUTPUT,TEXT,VPLIST
;Finding output
;This is the full calculation S FMTSTR=SC_"R2^2L1^"_(72-SC-4)_"L"
S FMTSTR=SC_"R2^2L1^"_(68-SC)_"L"
S FI=$P($G(^PXRMD(801.41,IEN,1)),U,5)
I FI'="" D
.;Get the variable pointer list.
. D BLDRLIST^PXRMVPTR(801.41,15,.VPLIST)
. S FIEN=$P(FI,";",1)
. S GBL=$P(FI,";",2)
. S ABBR=$P(VPLIST(GBL),U,4)
. S NAME=$P($G(@(U_GBL_FIEN_",0)")),U,1)
. S TEXT="Finding Item:"_U_ABBR_U_NAME
I FI="" S TEXT="Finding Item:"_"^none"
D COLFMT^PXRMTEXT(FMTSTR,TEXT," ",.NL,.OUTPUT)
F IND=1:1:NL W !,OUTPUT(IND)
;
;Additional findings
;This is the full calculation S FMTSTR=SC_"R2^4L1^"_(72-SC-13)_"L^9L1^3R"
S FMTSTR=SC_"R2^4L1^"_(59-SC)_"L^9L1^3R"
S TEXT="Additional Findings:"
I '$D(^PXRMD(801.41,IEN,3)) S TEXT=TEXT_U_"none"
D COLFMT^PXRMTEXT(FMTSTR,TEXT," ",.NL,.OUTPUT)
F IND=1:1:NL W !,OUTPUT(IND)
I '$D(^PXRMD(801.41,IEN,3)) Q
;Get the variable pointer list.
K VPLIST
D BLDRLIST^PXRMVPTR(801.4118,.01,.VPLIST)
S JND=0
F S JND=+$O(^PXRMD(801.41,IEN,3,JND)) Q:JND=0 D
. S FI=^PXRMD(801.41,IEN,3,JND,0)
. S FIEN=$P(FI,";",1)
. S GBL=$P(FI,";",2)
. S ABBR=$P(VPLIST(GBL),U,4)
. S NAME=$P($G(@(U_GBL_FIEN_",0)")),U,1)
. S TEXT=U_ABBR_U_NAME_U_"Finding #"_U_JND
. D COLFMT^PXRMTEXT(FMTSTR,TEXT," ",.NL,.OUTPUT)
. F IND=1:1:NL W !,OUTPUT(IND)
Q
;
;=================================================
INPUT(IEN) ;Input finding and additional findings.
;Called from input template PXRM EDIT ELEMENT
N ABBR,FI,FIEN,FMTSTR,GBL,IND,JND,NL,OUTPUT,SAVEFI,TEXT,VPLIST
;Protect FileMan variables
N D,D0,DA,DC,DE,DG,DH,DI,DIC,DIDEL,DIE,DIEDA,DIEL,DIEN,DIETMP
N DIEXREF,DIFLD,DIEIENS,DINUSE,DIP,DISYS,DK,DL,DM,DP,DQ,DR,DU
N X,Y
S FI=$P($G(^PXRMD(801.41,IEN,1)),U,5)
I FI'="" D
.;Get the variable pointer list.
. D BLDRLIST^PXRMVPTR(801.41,15,.VPLIST)
. S FIEN=$P(FI,";",1)
. S GBL=$P(FI,";",2)
. S ABBR=$P(VPLIST(GBL),U,4)
. S NAME=$P($G(@(U_GBL_FIEN_",0)")),U,1)
. S FMTSTR="13L1^2L1^60L"
. S TEXT="Finding item:"_U_ABBR_U_NAME
. D COLFMT^PXRMTEXT(FMTSTR,TEXT," ",.NL,.OUTPUT)
. F IND=1:1:NL W !,OUTPUT(IND)
S DIE="^PXRMD(801.41,"
S DA=IEN,DR=15
D ^DIE
I $D(Y) Q U
S SAVEFI=X
I $P(X,";",2)="YTT(601.71," D MHLICR(+X)
;
;Additional findings.
S FMTSTR="4L1^60L1^9L1^3R"
;Get the variable pointer list.
K VPLIST
D BLDRLIST^PXRMVPTR(801.4118,.01,.VPLIST)
;Setup DA(1) for additional findings.
K DA S DA(1)=IEN
AFLIST W !!,"Additional findings:"
I '$D(^PXRMD(801.41,IEN,3,"B")) W " none"
S JND=0
F S JND=+$O(^PXRMD(801.41,IEN,3,JND)) Q:JND=0 D
. S FI=^PXRMD(801.41,IEN,3,JND,0)
. S FIEN=$P(FI,";",1)
. S GBL=$P(FI,";",2)
. S ABBR=$P(VPLIST(GBL),U,4)
. S NAME=$P($G(@(U_GBL_FIEN_",0)")),U,1)
. S TEXT=ABBR_U_NAME_U_"Finding #"_U_JND
. D COLFMT^PXRMTEXT(FMTSTR,TEXT," ",.NL,.OUTPUT)
. F IND=1:1:NL W !,OUTPUT(IND)
;Edit, if done quit,if not go back to AFLIST.
S DIC="^PXRMD(801.41,"_IEN_",3,"
S DIC(0)="AELQ"
S DIC("A")="Select ADDITIONAL FINDING: "
S DIC("P")=$P(^DD(801.41,18,0),U,2)
D ^DIC
I $G(DUOUT) Q U
I Y=-1 Q SAVEFI
S DIE=DIC K DIC
S DIE("NO^")="OUTOK"
S DA=+Y,GBL=$P($P(Y,U,2),";",2) Q:GBL=""
S DR=".01"
W !!,"Editing Finding Number: "_$G(DA)
D ^DIE
I $D(Y) Q U
S $P(^PXRMD(801.41,IEN,3,0),U,3)=0
I $D(Y) Q SAVEFI
;Check if deleted
I '$D(DA) Q SAVEFI
G AFLIST
Q
;
;=================================================
MHLICR(IEN) ;Check to see if mental health licensing is required.
;DBIA #5042
I $$RL^YTQPXRM3(IEN)="Y" D
. W !,"This MH test requires a license."
. W !,"The question text will not appear in the progress note.",!
. H 1
Q
PXRMDLFI ; SLC/PKR - Handle Reminder dialog findings. ;06/08/2009
+1 ;;2.0;CLINICAL REMINDERS;**12**;Feb 04, 2005;Build 73
+2 ;
+3 ;=================================================
DISP(IEN,SC) ;Display findings and additional findings.
+1 ;Called from print template PXRM DIALOG ELEMENT. SC is the starting
+2 ;column for the display.
+3 NEW ABBR,FI,FIEN,FMTSTR,GBL,IND,JND,NAME,NL,OUTPUT,TEXT,VPLIST
+4 ;Finding output
+5 ;This is the full calculation S FMTSTR=SC_"R2^2L1^"_(72-SC-4)_"L"
+6 SET FMTSTR=SC_"R2^2L1^"_(68-SC)_"L"
+7 SET FI=$PIECE($GET(^PXRMD(801.41,IEN,1)),U,5)
+8 IF FI'=""
Begin DoDot:1
+9 ;Get the variable pointer list.
+10 DO BLDRLIST^PXRMVPTR(801.41,15,.VPLIST)
+11 SET FIEN=$PIECE(FI,";",1)
+12 SET GBL=$PIECE(FI,";",2)
+13 SET ABBR=$PIECE(VPLIST(GBL),U,4)
+14 SET NAME=$PIECE($GET(@(U_GBL_FIEN_",0)")),U,1)
+15 SET TEXT="Finding Item:"_U_ABBR_U_NAME
End DoDot:1
+16 IF FI=""
SET TEXT="Finding Item:"_"^none"
+17 DO COLFMT^PXRMTEXT(FMTSTR,TEXT," ",.NL,.OUTPUT)
+18 FOR IND=1:1:NL
WRITE !,OUTPUT(IND)
+19 ;
+20 ;Additional findings
+21 ;This is the full calculation S FMTSTR=SC_"R2^4L1^"_(72-SC-13)_"L^9L1^3R"
+22 SET FMTSTR=SC_"R2^4L1^"_(59-SC)_"L^9L1^3R"
+23 SET TEXT="Additional Findings:"
+24 IF '$DATA(^PXRMD(801.41,IEN,3))
SET TEXT=TEXT_U_"none"
+25 DO COLFMT^PXRMTEXT(FMTSTR,TEXT," ",.NL,.OUTPUT)
+26 FOR IND=1:1:NL
WRITE !,OUTPUT(IND)
+27 IF '$DATA(^PXRMD(801.41,IEN,3))
QUIT
+28 ;Get the variable pointer list.
+29 KILL VPLIST
+30 DO BLDRLIST^PXRMVPTR(801.4118,.01,.VPLIST)
+31 SET JND=0
+32 FOR
SET JND=+$ORDER(^PXRMD(801.41,IEN,3,JND))
IF JND=0
QUIT
Begin DoDot:1
+33 SET FI=^PXRMD(801.41,IEN,3,JND,0)
+34 SET FIEN=$PIECE(FI,";",1)
+35 SET GBL=$PIECE(FI,";",2)
+36 SET ABBR=$PIECE(VPLIST(GBL),U,4)
+37 SET NAME=$PIECE($GET(@(U_GBL_FIEN_",0)")),U,1)
+38 SET TEXT=U_ABBR_U_NAME_U_"Finding #"_U_JND
+39 DO COLFMT^PXRMTEXT(FMTSTR,TEXT," ",.NL,.OUTPUT)
+40 FOR IND=1:1:NL
WRITE !,OUTPUT(IND)
End DoDot:1
+41 QUIT
+42 ;
+43 ;=================================================
INPUT(IEN) ;Input finding and additional findings.
+1 ;Called from input template PXRM EDIT ELEMENT
+2 NEW ABBR,FI,FIEN,FMTSTR,GBL,IND,JND,NL,OUTPUT,SAVEFI,TEXT,VPLIST
+3 ;Protect FileMan variables
+4 NEW D,D0,DA,DC,DE,DG,DH,DI,DIC,DIDEL,DIE,DIEDA,DIEL,DIEN,DIETMP
+5 NEW DIEXREF,DIFLD,DIEIENS,DINUSE,DIP,DISYS,DK,DL,DM,DP,DQ,DR,DU
+6 NEW X,Y
+7 SET FI=$PIECE($GET(^PXRMD(801.41,IEN,1)),U,5)
+8 IF FI'=""
Begin DoDot:1
+9 ;Get the variable pointer list.
+10 DO BLDRLIST^PXRMVPTR(801.41,15,.VPLIST)
+11 SET FIEN=$PIECE(FI,";",1)
+12 SET GBL=$PIECE(FI,";",2)
+13 SET ABBR=$PIECE(VPLIST(GBL),U,4)
+14 SET NAME=$PIECE($GET(@(U_GBL_FIEN_",0)")),U,1)
+15 SET FMTSTR="13L1^2L1^60L"
+16 SET TEXT="Finding item:"_U_ABBR_U_NAME
+17 DO COLFMT^PXRMTEXT(FMTSTR,TEXT," ",.NL,.OUTPUT)
+18 FOR IND=1:1:NL
WRITE !,OUTPUT(IND)
End DoDot:1
+19 SET DIE="^PXRMD(801.41,"
+20 SET DA=IEN
SET DR=15
+21 DO ^DIE
+22 IF $DATA(Y)
QUIT U
+23 SET SAVEFI=X
+24 IF $PIECE(X,";",2)="YTT(601.71,"
DO MHLICR(+X)
+25 ;
+26 ;Additional findings.
+27 SET FMTSTR="4L1^60L1^9L1^3R"
+28 ;Get the variable pointer list.
+29 KILL VPLIST
+30 DO BLDRLIST^PXRMVPTR(801.4118,.01,.VPLIST)
+31 ;Setup DA(1) for additional findings.
+32 KILL DA
SET DA(1)=IEN
AFLIST WRITE !!,"Additional findings:"
+1 IF '$DATA(^PXRMD(801.41,IEN,3,"B"))
WRITE " none"
+2 SET JND=0
+3 FOR
SET JND=+$ORDER(^PXRMD(801.41,IEN,3,JND))
IF JND=0
QUIT
Begin DoDot:1
+4 SET FI=^PXRMD(801.41,IEN,3,JND,0)
+5 SET FIEN=$PIECE(FI,";",1)
+6 SET GBL=$PIECE(FI,";",2)
+7 SET ABBR=$PIECE(VPLIST(GBL),U,4)
+8 SET NAME=$PIECE($GET(@(U_GBL_FIEN_",0)")),U,1)
+9 SET TEXT=ABBR_U_NAME_U_"Finding #"_U_JND
+10 DO COLFMT^PXRMTEXT(FMTSTR,TEXT," ",.NL,.OUTPUT)
+11 FOR IND=1:1:NL
WRITE !,OUTPUT(IND)
End DoDot:1
+12 ;Edit, if done quit,if not go back to AFLIST.
+13 SET DIC="^PXRMD(801.41,"_IEN_",3,"
+14 SET DIC(0)="AELQ"
+15 SET DIC("A")="Select ADDITIONAL FINDING: "
+16 SET DIC("P")=$PIECE(^DD(801.41,18,0),U,2)
+17 DO ^DIC
+18 IF $GET(DUOUT)
QUIT U
+19 IF Y=-1
QUIT SAVEFI
+20 SET DIE=DIC
KILL DIC
+21 SET DIE("NO^")="OUTOK"
+22 SET DA=+Y
SET GBL=$PIECE($PIECE(Y,U,2),";",2)
IF GBL=""
QUIT
+23 SET DR=".01"
+24 WRITE !!,"Editing Finding Number: "_$GET(DA)
+25 DO ^DIE
+26 IF $DATA(Y)
QUIT U
+27 SET $PIECE(^PXRMD(801.41,IEN,3,0),U,3)=0
+28 IF $DATA(Y)
QUIT SAVEFI
+29 ;Check if deleted
+30 IF '$DATA(DA)
QUIT SAVEFI
+31 GOTO AFLIST
+32 QUIT
+33 ;
+34 ;=================================================
MHLICR(IEN) ;Check to see if mental health licensing is required.
+1 ;DBIA #5042
+2 IF $$RL^YTQPXRM3(IEN)="Y"
Begin DoDot:1
+3 WRITE !,"This MH test requires a license."
+4 WRITE !,"The question text will not appear in the progress note.",!
+5 HANG 1
End DoDot:1
+6 QUIT