PXRMOUTC ; SLC/PKR - Clinical Maintenance output. ;05/26/2022
;;2.0;CLINICAL REMINDERS;**4,6,17,26,47,46,42,65**;Feb 04, 2005;Build 438
;================================================
CM(DEFARR,PXRMPDEM,PCLOGIC,RESLOGIC,RESDATE,FIEVAL,OUTTYPE) ;Prepare the
;Clinical maintenance (OUTTYPE=5) and order check (OUTTPYPE=55)
;output.
N DISPLAY,IND,JND,FINDING,FLIST,FLISTNODE,FTYPE
N HDR,NHDR,IFIEVAL,LIST,NFLINES,NTXT,NUM,NUMLINES
N TEMP,TEXT
S FLISTNODE("PCL")=32,FLISTNODE("RES")=36,FLISTNODE("AGE")=40,FLISTNODE("INFO")=42
S FLISTNODE("CONTRA")=81,FLISTNODE("REFUSED")=91
S NTXT=0
;Check for a dead patient
I +$G(PXRMPDEM("DOD"))>0 D
. S TEMP=$$FMTE^XLFDT(PXRMPDEM("DOD"),"5DZ")
. S TEXT="Patient is deceased, date of death: "_TEMP
. D ADDTXT^PXRMOUTU(1,PXRMRM,.NTXT,TEXT)
;Display the frequency information only if there is resolution logic.
I RESLOGIC'="",OUTTYPE=5 D FREQ(.DEFARR,.NTXT,.TEXT)
;Output the AGE match/no match text.
D AGE^PXRMFNFT(PXRMPDEM("DFN"),.DEFARR,.FIEVAL,.NTXT)
;Process the findings in the order: patient cohort, resolution,
;age, and informational.
F FTYPE="PCL","RES","AGE","CONTRA","REFUSED","INFO" D
. S LIST=DEFARR(FLISTNODE(FTYPE))
.;Output the general logic text.
. I FTYPE="PCL" D LOGIC^PXRMFNFT(PXRMPDEM("DFN"),PCLOGIC,FTYPE,"D",.DEFARR,.FIEVAL,.NTXT)
. I FTYPE="RES",$P(PCLOGIC,U,1) D LOGIC^PXRMFNFT(PXRMPDEM("DFN"),RESLOGIC,FTYPE,"D",.DEFARR,.FIEVAL,.NTXT)
.;Process the findings for each type.
. K TEXT
. S (NHDR,NFLINES)=0
. S NUM=+$P(LIST,U,1)
. S FLIST=$P(LIST,U,2)
. F IND=1:1:NUM D
.. S FINDING=$P(FLIST,";",IND)
..;No output for age or sex findings.
.. I (FINDING="AGE")!(FINDING="SEX") Q
..;If the finding is not defined skip it. This can occur when the
..;reminder is N/A.
.. I '$D(FIEVAL(FINDING)) Q
.. K IFIEVAL
.. I FIEVAL(FINDING) D
... M IFIEVAL=FIEVAL(FINDING)
...;Remove any false occurrences so they are not displayed.
... S JND=0
... F S JND=+$O(IFIEVAL(JND)) Q:JND=0 K:'IFIEVAL(JND) IFIEVAL(JND)
.. E D
... S IFIEVAL=0
..;Function findings are processed as a group.
.. I IFIEVAL,FINDING'["FF" D FOUT(1,.IFIEVAL,.NFLINES,.TEXT)
..;Output the found/not found text for the finding.
.. D FINDING^PXRMFNFT(PXRMPDEM("DFN"),FINDING,.FIEVAL,.IFIEVAL,.NFLINES,.TEXT)
.;
.;Display function finding values for this FTYPE, skip INFO only.
. I (FTYPE'="INFO"),(FLIST["FF") D FFOUT(3,NUM,FLIST,.FIEVAL,.NFLINES,.TEXT)
.;If there was any text for this finding type create a header.
. I OUTTYPE=5 D HEADER(FTYPE,NFLINES,RESDATE,.NHDR,.HDR)
.;Output the header and the finding text.
. D ADDTXTA^PXRMOUTU(1,PXRMRM,.NTXT,NHDR,.HDR)
. D COPYTXT^PXRMOUTU(.NTXT,NFLINES,.TEXT)
;If there are any contraindications, precautions, or refusals output them.
;Use CRSTATUS and the line counts to determine if the CONTRAINDICATED and
;REFUSED true and false text should be output.
I (CRSTATUS="CONTRA") D
. S NUMLINES=$P(DEFARR(85),U,1)
. I NUMLINES>0 D CRLOGIC^PXRMFNFT(PXRMPDEM("DFN"),NUMLINES,83,.NTXT)
I (CRSTATUS'="CONTRA") D
. S NUMLINES=$P(DEFARR(85),U,2)
. I NUMLINES>0 D CRLOGIC^PXRMFNFT(PXRMPDEM("DFN"),NUMLINES,84,.NTXT)
I (CRSTATUS="REFUSED") D
. S NUMLINES=$P(DEFARR(95),U,1)
. I NUMLINES>0 D CRLOGIC^PXRMFNFT(PXRMPDEM("DFN"),NUMLINES,93,.NTXT)
I (CRSTATUS'="CONTRA"),(CRSTATUS'="REFUSED") D
. S NUMLINES=$P(DEFARR(95),U,2)
. I NUMLINES>0 D CRLOGIC^PXRMFNFT(PXRMPDEM("DFN"),NUMLINES,94,.NTXT)
;
I $D(FIEVAL("CONTRA")) D OUTPUTCONREF^PXRMIMM(1,"CONTRA",.DEFARR,.FIEVAL,.NTXT)
I $D(FIEVAL("REFUSED")) D OUTPUTCONREF^PXRMIMM(1,"REFUSED",.DEFARR,.FIEVAL,.NTXT)
I $D(FIEVAL("PRECAUTION")) D OUTPUTCONREF^PXRMIMM(1,"PRECAUTION",.DEFARR,.FIEVAL,.NTXT)
;Output INFO nodes
D INFO^PXRMOUTU(PXRMITEM,.NTXT)
;Check for term warnings.
I '$D(^TMP(PXRMPID,$J,PXRMITEM,"WARNING")) Q
N DESC,NTW
K TEXT
S DESC="NOTERM",NTW=2
F S DESC=$O(^TMP(PXRMPID,$J,PXRMITEM,"WARNING",DESC)) Q:DESC'["NOTERM" D
. S NTW=NTW+1,TEXT(NTW)=$P(^TMP(PXRMPID,$J,PXRMITEM,"WARNING",DESC),":",2)_"\\"
I NTW>2 D
. S TEXT(1)=""
. S TEXT(2)="Term Warnings:\\"
. D ADDTXTA^PXRMOUTU(1,PXRMRM,.NTXT,NTW,.TEXT)
Q
;
;================================================
FOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Do output for individual findings
;in the FINDING array.
I $D(IFIEVAL("TERM")) D OUTPUT^PXRMTERM(1,.IFIEVAL,.NFLINES,.TEXT) Q
N FTYPE
S FTYPE=$P(IFIEVAL("FINDING"),U,1)
S FTYPE=$P(FTYPE,";",2)
I FTYPE="AUTTEDT(" D OUTPUT^PXRMEDU(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="AUTTEXAM(" D OUTPUT^PXRMEXAM(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="AUTTHF(" D OUTPUT^PXRMHF(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="AUTTIMM(" D OUTPUT^PXRMIMM(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="AUTTSK(" D OUTPUT^PXRMSKIN(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="GMRD(120.51," D OUTPUT^PXRMVITL(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="LAB(60," D OUTPUT^PXRMLAB(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="ORD(101.43," D OUTPUT^PXRMORDR(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="PS(50.605," D OUTPUT^PXRMDRCL(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="PSDRUG(" D OUTPUT^PXRMDRUG(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="PSNDF(50.6," D OUTPUT^PXRMDGEN(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="PS(55," D OUTPUT^PXRMDRUG(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="PS(55NVA," D OUTPUT^PXRMDRUG(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="PSRX(" D OUTPUT^PXRMDRUG(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="PXD(811.2," D OUTPUT^PXRMTAX(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="PXRMD(802.4," D OUTPUT^PXRMFF(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="PXRMD(810.9," D OUTPUT^PXRMLOCF(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="PXRMD(811.4," D OUTPUT^PXRMCF(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="RAMIS(71," D OUTPUT^PXRMRAD(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
I FTYPE="YTT(601.71," D OUTPUT^PXRMMH(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
Q
;
;================================================
FFOUT(INDENT,NUM,FLIST,FIEVAL,NLINES,TEXT) ;Output for function findings.
;Only display the Function Finding in Reminder Test.
I '$D(PXRMDEBG) Q
N IND,FFNUM,FFLIST,FFTEXT,FINDING,NOUT,TEXTOUT
F IND=1:1:NUM D
. S FINDING=$P(FLIST,";",IND)
. I '$D(FIEVAL(FINDING)) Q
. I $E(FINDING,1,2)="FF" S FFNUM=$P(FINDING,"FF",2),FFLIST(FFNUM)=""
I '$D(FFLIST) Q
S FFNUM=$O(FFLIST(0))
S FFTEXT="FF("_FFNUM_")="_FIEVAL("FF"_FFNUM)
F S FFNUM=$O(FFLIST(FFNUM)) Q:FFNUM="" D
. S FFTEXT=FFTEXT_", FF("_FFNUM_")="_FIEVAL("FF"_FFNUM)
D FORMATS^PXRMTEXT(INDENT,PXRMRM,FFTEXT,.NOUT,.TEXTOUT)
F IND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(IND)
S NLINES=NLINES+1,TEXT(NLINES)=""
Q
;
;================================================
FREQ(DEFARR,NTXT,TEXT) ;Display the frequency information.
N FREQ,TEMP
;If there was a custom date due print out that information.
I $D(^TMP(PXRMPID,$J,PXRMITEM,"zCDUE")) D
. S TEMP=^TMP(PXRMPID,$J,PXRMITEM,"zCDUE")
. S TEXT=$$OUTPUT^PXRMCDUE(TEMP,.DEFARR)
. I DEFARR(31)["AGE" D
.. S TEMP=$G(^TMP(PXRMPID,$J,PXRMITEM,"zFREQARNG"))
.. I TEMP'="" S TEXT=TEXT_" Applicable"_$$FMTAGE^PXRMAGE($P(TEMP,U,2),$P(TEMP,U,3))_"."
. D ADDTXT^PXRMOUTU(1,PXRMRM,.NTXT,TEXT)
E D
. S TEMP=$G(^TMP(PXRMPID,$J,PXRMITEM,"zFREQARNG"))
. I TEMP'="" D
.. S FREQ=$P(TEMP,U,1)
.. S TEXT=$$FMTFREQ^PXRMAGE(FREQ)
.. I FREQ=-1 S TEXT=TEXT_" for this patient."
.. I DEFARR(31)["AGE",FREQ'=-1 S TEXT=TEXT_$$FMTAGE^PXRMAGE($P(TEMP,U,2),$P(TEMP,U,3))_"."
.. D ADDTXT^PXRMOUTU(2,PXRMRM,.NTXT,TEXT)
Q
;
;================================================
K HDR
I FTYPE="RES" D Q
. I +RESDATE'=0 D Q
.. S HDR(2)="Resolution: Last done - "_$$EDATE^PXRMDATE(RESDATE)
.. S NHDR=2
.. S HDR(1)="\\"
. I '$D(HDR(2)),NLINES>0 D
.. S HDR(2)="Resolution:"
.. S NHDR=2
.. S HDR(1)="\\"
;
I NLINES=0 Q
S NHDR=2
S HDR(1)="\\"
I FTYPE="PCL" S HDR(2)="Cohort:" Q
I FTYPE="AGE" S HDR(2)="Age/Frequency:" Q
I FTYPE="CONTRA" S HDR(2)="Contraindicated:" Q
I FTYPE="REFUSED" S HDR(2)="Refused:" Q
I FTYPE="INFO" S HDR(2)="Information:"
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMOUTC 8198 printed Dec 13, 2024@01:46:58 Page 2
PXRMOUTC ; SLC/PKR - Clinical Maintenance output. ;05/26/2022
+1 ;;2.0;CLINICAL REMINDERS;**4,6,17,26,47,46,42,65**;Feb 04, 2005;Build 438
+2 ;================================================
CM(DEFARR,PXRMPDEM,PCLOGIC,RESLOGIC,RESDATE,FIEVAL,OUTTYPE) ;Prepare the
+1 ;Clinical maintenance (OUTTYPE=5) and order check (OUTTPYPE=55)
+2 ;output.
+3 NEW DISPLAY,IND,JND,FINDING,FLIST,FLISTNODE,FTYPE
+4 NEW HDR,NHDR,IFIEVAL,LIST,NFLINES,NTXT,NUM,NUMLINES
+5 NEW TEMP,TEXT
+6 SET FLISTNODE("PCL")=32
SET FLISTNODE("RES")=36
SET FLISTNODE("AGE")=40
SET FLISTNODE("INFO")=42
+7 SET FLISTNODE("CONTRA")=81
SET FLISTNODE("REFUSED")=91
+8 SET NTXT=0
+9 ;Check for a dead patient
+10 IF +$GET(PXRMPDEM("DOD"))>0
Begin DoDot:1
+11 SET TEMP=$$FMTE^XLFDT(PXRMPDEM("DOD"),"5DZ")
+12 SET TEXT="Patient is deceased, date of death: "_TEMP
+13 DO ADDTXT^PXRMOUTU(1,PXRMRM,.NTXT,TEXT)
End DoDot:1
+14 ;Display the frequency information only if there is resolution logic.
+15 IF RESLOGIC'=""
IF OUTTYPE=5
DO FREQ(.DEFARR,.NTXT,.TEXT)
+16 ;Output the AGE match/no match text.
+17 DO AGE^PXRMFNFT(PXRMPDEM("DFN"),.DEFARR,.FIEVAL,.NTXT)
+18 ;Process the findings in the order: patient cohort, resolution,
+19 ;age, and informational.
+20 FOR FTYPE="PCL","RES","AGE","CONTRA","REFUSED","INFO"
Begin DoDot:1
+21 SET LIST=DEFARR(FLISTNODE(FTYPE))
+22 ;Output the general logic text.
+23 IF FTYPE="PCL"
DO LOGIC^PXRMFNFT(PXRMPDEM("DFN"),PCLOGIC,FTYPE,"D",.DEFARR,.FIEVAL,.NTXT)
+24 IF FTYPE="RES"
IF $PIECE(PCLOGIC,U,1)
DO LOGIC^PXRMFNFT(PXRMPDEM("DFN"),RESLOGIC,FTYPE,"D",.DEFARR,.FIEVAL,.NTXT)
+25 ;Process the findings for each type.
+26 KILL TEXT
+27 SET (NHDR,NFLINES)=0
+28 SET NUM=+$PIECE(LIST,U,1)
+29 SET FLIST=$PIECE(LIST,U,2)
+30 FOR IND=1:1:NUM
Begin DoDot:2
+31 SET FINDING=$PIECE(FLIST,";",IND)
+32 ;No output for age or sex findings.
+33 IF (FINDING="AGE")!(FINDING="SEX")
QUIT
+34 ;If the finding is not defined skip it. This can occur when the
+35 ;reminder is N/A.
+36 IF '$DATA(FIEVAL(FINDING))
QUIT
+37 KILL IFIEVAL
+38 IF FIEVAL(FINDING)
Begin DoDot:3
+39 MERGE IFIEVAL=FIEVAL(FINDING)
+40 ;Remove any false occurrences so they are not displayed.
+41 SET JND=0
+42 FOR
SET JND=+$ORDER(IFIEVAL(JND))
if JND=0
QUIT
if 'IFIEVAL(JND)
KILL IFIEVAL(JND)
End DoDot:3
+43 IF '$TEST
Begin DoDot:3
+44 SET IFIEVAL=0
End DoDot:3
+45 ;Function findings are processed as a group.
+46 IF IFIEVAL
IF FINDING'["FF"
DO FOUT(1,.IFIEVAL,.NFLINES,.TEXT)
+47 ;Output the found/not found text for the finding.
+48 DO FINDING^PXRMFNFT(PXRMPDEM("DFN"),FINDING,.FIEVAL,.IFIEVAL,.NFLINES,.TEXT)
End DoDot:2
+49 ;
+50 ;Display function finding values for this FTYPE, skip INFO only.
+51 IF (FTYPE'="INFO")
IF (FLIST["FF")
DO FFOUT(3,NUM,FLIST,.FIEVAL,.NFLINES,.TEXT)
+52 ;If there was any text for this finding type create a header.
+53 IF OUTTYPE=5
DO HEADER(FTYPE,NFLINES,RESDATE,.NHDR,.HDR)
+54 ;Output the header and the finding text.
+55 DO ADDTXTA^PXRMOUTU(1,PXRMRM,.NTXT,NHDR,.HDR)
+56 DO COPYTXT^PXRMOUTU(.NTXT,NFLINES,.TEXT)
End DoDot:1
+57 ;If there are any contraindications, precautions, or refusals output them.
+58 ;Use CRSTATUS and the line counts to determine if the CONTRAINDICATED and
+59 ;REFUSED true and false text should be output.
+60 IF (CRSTATUS="CONTRA")
Begin DoDot:1
+61 SET NUMLINES=$PIECE(DEFARR(85),U,1)
+62 IF NUMLINES>0
DO CRLOGIC^PXRMFNFT(PXRMPDEM("DFN"),NUMLINES,83,.NTXT)
End DoDot:1
+63 IF (CRSTATUS'="CONTRA")
Begin DoDot:1
+64 SET NUMLINES=$PIECE(DEFARR(85),U,2)
+65 IF NUMLINES>0
DO CRLOGIC^PXRMFNFT(PXRMPDEM("DFN"),NUMLINES,84,.NTXT)
End DoDot:1
+66 IF (CRSTATUS="REFUSED")
Begin DoDot:1
+67 SET NUMLINES=$PIECE(DEFARR(95),U,1)
+68 IF NUMLINES>0
DO CRLOGIC^PXRMFNFT(PXRMPDEM("DFN"),NUMLINES,93,.NTXT)
End DoDot:1
+69 IF (CRSTATUS'="CONTRA")
IF (CRSTATUS'="REFUSED")
Begin DoDot:1
+70 SET NUMLINES=$PIECE(DEFARR(95),U,2)
+71 IF NUMLINES>0
DO CRLOGIC^PXRMFNFT(PXRMPDEM("DFN"),NUMLINES,94,.NTXT)
End DoDot:1
+72 ;
+73 IF $DATA(FIEVAL("CONTRA"))
DO OUTPUTCONREF^PXRMIMM(1,"CONTRA",.DEFARR,.FIEVAL,.NTXT)
+74 IF $DATA(FIEVAL("REFUSED"))
DO OUTPUTCONREF^PXRMIMM(1,"REFUSED",.DEFARR,.FIEVAL,.NTXT)
+75 IF $DATA(FIEVAL("PRECAUTION"))
DO OUTPUTCONREF^PXRMIMM(1,"PRECAUTION",.DEFARR,.FIEVAL,.NTXT)
+76 ;Output INFO nodes
+77 DO INFO^PXRMOUTU(PXRMITEM,.NTXT)
+78 ;Check for term warnings.
+79 IF '$DATA(^TMP(PXRMPID,$JOB,PXRMITEM,"WARNING"))
QUIT
+80 NEW DESC,NTW
+81 KILL TEXT
+82 SET DESC="NOTERM"
SET NTW=2
+83 FOR
SET DESC=$ORDER(^TMP(PXRMPID,$JOB,PXRMITEM,"WARNING",DESC))
if DESC'["NOTERM"
QUIT
Begin DoDot:1
+84 SET NTW=NTW+1
SET TEXT(NTW)=$PIECE(^TMP(PXRMPID,$JOB,PXRMITEM,"WARNING",DESC),":",2)_"\\"
End DoDot:1
+85 IF NTW>2
Begin DoDot:1
+86 SET TEXT(1)=""
+87 SET TEXT(2)="Term Warnings:\\"
+88 DO ADDTXTA^PXRMOUTU(1,PXRMRM,.NTXT,NTW,.TEXT)
End DoDot:1
+89 QUIT
+90 ;
+91 ;================================================
FOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Do output for individual findings
+1 ;in the FINDING array.
+2 IF $DATA(IFIEVAL("TERM"))
DO OUTPUT^PXRMTERM(1,.IFIEVAL,.NFLINES,.TEXT)
QUIT
+3 NEW FTYPE
+4 SET FTYPE=$PIECE(IFIEVAL("FINDING"),U,1)
+5 SET FTYPE=$PIECE(FTYPE,";",2)
+6 IF FTYPE="AUTTEDT("
DO OUTPUT^PXRMEDU(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+7 IF FTYPE="AUTTEXAM("
DO OUTPUT^PXRMEXAM(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+8 IF FTYPE="AUTTHF("
DO OUTPUT^PXRMHF(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+9 IF FTYPE="AUTTIMM("
DO OUTPUT^PXRMIMM(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+10 IF FTYPE="AUTTSK("
DO OUTPUT^PXRMSKIN(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+11 IF FTYPE="GMRD(120.51,"
DO OUTPUT^PXRMVITL(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+12 IF FTYPE="LAB(60,"
DO OUTPUT^PXRMLAB(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+13 IF FTYPE="ORD(101.43,"
DO OUTPUT^PXRMORDR(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+14 IF FTYPE="PS(50.605,"
DO OUTPUT^PXRMDRCL(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+15 IF FTYPE="PSDRUG("
DO OUTPUT^PXRMDRUG(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+16 IF FTYPE="PSNDF(50.6,"
DO OUTPUT^PXRMDGEN(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+17 IF FTYPE="PS(55,"
DO OUTPUT^PXRMDRUG(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+18 IF FTYPE="PS(55NVA,"
DO OUTPUT^PXRMDRUG(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+19 IF FTYPE="PSRX("
DO OUTPUT^PXRMDRUG(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+20 IF FTYPE="PXD(811.2,"
DO OUTPUT^PXRMTAX(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+21 IF FTYPE="PXRMD(802.4,"
DO OUTPUT^PXRMFF(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+22 IF FTYPE="PXRMD(810.9,"
DO OUTPUT^PXRMLOCF(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+23 IF FTYPE="PXRMD(811.4,"
DO OUTPUT^PXRMCF(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+24 IF FTYPE="RAMIS(71,"
DO OUTPUT^PXRMRAD(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+25 IF FTYPE="YTT(601.71,"
DO OUTPUT^PXRMMH(INDENT,.IFIEVAL,.NLINES,.TEXT)
QUIT
+26 QUIT
+27 ;
+28 ;================================================
FFOUT(INDENT,NUM,FLIST,FIEVAL,NLINES,TEXT) ;Output for function findings.
+1 ;Only display the Function Finding in Reminder Test.
+2 IF '$DATA(PXRMDEBG)
QUIT
+3 NEW IND,FFNUM,FFLIST,FFTEXT,FINDING,NOUT,TEXTOUT
+4 FOR IND=1:1:NUM
Begin DoDot:1
+5 SET FINDING=$PIECE(FLIST,";",IND)
+6 IF '$DATA(FIEVAL(FINDING))
QUIT
+7 IF $EXTRACT(FINDING,1,2)="FF"
SET FFNUM=$PIECE(FINDING,"FF",2)
SET FFLIST(FFNUM)=""
End DoDot:1
+8 IF '$DATA(FFLIST)
QUIT
+9 SET FFNUM=$ORDER(FFLIST(0))
+10 SET FFTEXT="FF("_FFNUM_")="_FIEVAL("FF"_FFNUM)
+11 FOR
SET FFNUM=$ORDER(FFLIST(FFNUM))
if FFNUM=""
QUIT
Begin DoDot:1
+12 SET FFTEXT=FFTEXT_", FF("_FFNUM_")="_FIEVAL("FF"_FFNUM)
End DoDot:1
+13 DO FORMATS^PXRMTEXT(INDENT,PXRMRM,FFTEXT,.NOUT,.TEXTOUT)
+14 FOR IND=1:1:NOUT
SET NLINES=NLINES+1
SET TEXT(NLINES)=TEXTOUT(IND)
+15 SET NLINES=NLINES+1
SET TEXT(NLINES)=""
+16 QUIT
+17 ;
+18 ;================================================
FREQ(DEFARR,NTXT,TEXT) ;Display the frequency information.
+1 NEW FREQ,TEMP
+2 ;If there was a custom date due print out that information.
+3 IF $DATA(^TMP(PXRMPID,$JOB,PXRMITEM,"zCDUE"))
Begin DoDot:1
+4 SET TEMP=^TMP(PXRMPID,$JOB,PXRMITEM,"zCDUE")
+5 SET TEXT=$$OUTPUT^PXRMCDUE(TEMP,.DEFARR)
+6 IF DEFARR(31)["AGE"
Begin DoDot:2
+7 SET TEMP=$GET(^TMP(PXRMPID,$JOB,PXRMITEM,"zFREQARNG"))
+8 IF TEMP'=""
SET TEXT=TEXT_" Applicable"_$$FMTAGE^PXRMAGE($PIECE(TEMP,U,2),$PIECE(TEMP,U,3))_"."
End DoDot:2
+9 DO ADDTXT^PXRMOUTU(1,PXRMRM,.NTXT,TEXT)
End DoDot:1
+10 IF '$TEST
Begin DoDot:1
+11 SET TEMP=$GET(^TMP(PXRMPID,$JOB,PXRMITEM,"zFREQARNG"))
+12 IF TEMP'=""
Begin DoDot:2
+13 SET FREQ=$PIECE(TEMP,U,1)
+14 SET TEXT=$$FMTFREQ^PXRMAGE(FREQ)
+15 IF FREQ=-1
SET TEXT=TEXT_" for this patient."
+16 IF DEFARR(31)["AGE"
IF FREQ'=-1
SET TEXT=TEXT_$$FMTAGE^PXRMAGE($PIECE(TEMP,U,2),$PIECE(TEMP,U,3))_"."
+17 DO ADDTXT^PXRMOUTU(2,PXRMRM,.NTXT,TEXT)
End DoDot:2
End DoDot:1
+18 QUIT
+19 ;
+20 ;================================================
+1 KILL HDR
+2 IF FTYPE="RES"
Begin DoDot:1
+3 IF +RESDATE'=0
Begin DoDot:2
+4 SET HDR(2)="Resolution: Last done - "_$$EDATE^PXRMDATE(RESDATE)
+5 SET NHDR=2
+6 SET HDR(1)="\\"
End DoDot:2
QUIT
+7 IF '$DATA(HDR(2))
IF NLINES>0
Begin DoDot:2
+8 SET HDR(2)="Resolution:"
+9 SET NHDR=2
+10 SET HDR(1)="\\"
End DoDot:2
End DoDot:1
QUIT
+11 ;
+12 IF NLINES=0
QUIT
+13 SET NHDR=2
+14 SET HDR(1)="\\"
+15 IF FTYPE="PCL"
SET HDR(2)="Cohort:"
QUIT
+16 IF FTYPE="AGE"
SET HDR(2)="Age/Frequency:"
QUIT
+17 IF FTYPE="CONTRA"
SET HDR(2)="Contraindicated:"
QUIT
+18 IF FTYPE="REFUSED"
SET HDR(2)="Refused:"
QUIT
+19 IF FTYPE="INFO"
SET HDR(2)="Information:"
+20 QUIT
+21 ;