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

SDPPRT.m

Go to the documentation of this file.
  1. SDPPRT ;ALB/CAW - Patient Profile - Print ;10/15/93
  1. ;;5.3;Scheduling;**6,19,41,140,132**;AUG 13, 1993
  1. ;
  1. EN ;Print entire patient profile
  1. ;
  1. D ENS^%ZISS
  1. D DIR G:SDERR ENQ
  1. W !!,$$LINE("Device Selection")
  1. S %ZIS="PMQ" D ^%ZIS I POP G ENQ
  1. I '$D(IO("Q")) D PRINT G ENQ
  1. S Y=$$QUE
  1. ENQ D:'$D(ZTQUEUED) ^%ZISC
  1. K SDERR,SDTYP S VALMBCK="R" Q
  1. ;
  1. QUE() ; -- que job
  1. ; return: did job que [ 1|yes 0|no ]
  1. ;
  1. N X K ZTSK,IO("Q")
  1. S ZTDESC="Patient Profile",ZTRTN="PRINT^SDPPRT"
  1. F X="DFN","SDACT","SDBD","SDBEG","SDED","SDEND","SDTYP","SDTYP(","SDPRINT","SDRANGE" S ZTSAVE(X)=""
  1. D ^%ZTLOAD W:$D(ZTSK) " (Task: ",ZTSK,")"
  1. Q $D(ZTSK)
  1. ;
  1. PRINT ;Print actual patient profile
  1. U IO N SDWHERE,SDALL,SDGO K ^TMP("SD",$J),^TMP("SDAPT",$J),^TMP("SDENR",$J),^TMP("SDPP",$J),^TMP("SDPPALL",$J)
  1. S (SDPAGE,SDTYP)=0,SDGO=1 D INIT1^SDPP,INIT^SDPPALL
  1. S (SDALL,SDWHERE)=0 I '$$HDR G PRINTQ
  1. F S SDWHERE=$O(^TMP("SDPP",$J,SDWHERE)) Q:'SDWHERE S:($Y+6>IOSL) SDGO=$$HDR G:'SDGO PRINTQ W !,^TMP("SDPP",$J,SDWHERE,0)
  1. F S SDALL=$O(^TMP("SDPPALL",$J,SDALL)) Q:'SDALL S:($Y+6>IOSL) SDGO=$$HDR G:'SDGO PRINTQ W !,^TMP("SDPPALL",$J,SDALL,0)
  1. PRINTQ K ^TMP("SDPP",$J),^TMP("SDPPALL",$J) S SDLN=0 D:'$D(ZTQUEUED) INIT1^SDPP
  1. I SDGO,SDPAGE,$E(IOST,1,2)="C-" D PAUSE^VALM1 Q
  1. Q
  1. LINE(STR) ; -- print line
  1. ; input: STR := text to insert
  1. ; output: none
  1. ; return: text to use
  1. ;
  1. N X
  1. S:STR]"" STR=" "_STR_" "
  1. S $P(X,"_",(IOM/2)-($L(STR)/2))=""
  1. Q X_STR_X
  1. ;
  1. DIR ;Ask what they want printed
  1. N SDYN S SDPRINT=1,SDERR=0
  1. I $O(^DPT(DFN,"S",SDBD)) D I SDERR G DIRQ
  1. .S DIR(0)="Y",DIR("B")="YES",DIR("A")="Do you want to print appointments",DIR("?")="Enter 'NO' if you do not want the appointments, otherwise enter 'YES'."
  1. .D ^DIR K DIR I $D(DIRUT) S SDERR=1 Q
  1. .I Y S SDTYP(2)=""
  1. IF $$EXOE^SDOE(DFN,SDBD,SDED) D I SDERR G DIRQ
  1. .S DIR(0)="Y",DIR("B")="YES",DIR("A")="Do you want to print add/edits",DIR("?")="Enter 'NO' if you do not want the add/edits, otherwise enter 'YES'."
  1. .D ^DIR K DIR I $D(DIRUT) S SDERR=1 Q
  1. .I Y S SDTYP(1)=""
  1. I $D(^DPT(DFN,"DE")) D I SDERR G DIRQ
  1. .S DIR(0)="Y",DIR("B")="YES",DIR("A")="Do you want to print enrollments",DIR("?")="Enter 'NO' if you do not want the enrollments, otherwise enter 'YES'."
  1. .D ^DIR K DIR I $D(DIRUT) S SDERR=1 Q
  1. .I Y S SDTYP(4)="",SDACT=0
  1. I $D(^DPT(DFN,"DIS")),$S('SDRANGE:1,+$O(^("DIS",9999999-(SDED+.9)))&($O(^(9999999-(SDED+.9)))<(9999999-(SDBD-.1))):1,1:0) D I SDERR G DIRQ
  1. .S DIR(0)="Y",DIR("B")="YES",DIR("A")="Do you want to print dispositions",DIR("?")="Enter 'NO' if you do not want the dispositions, otherwise enter 'YES'."
  1. .D ^DIR K DIR I $D(DIRUT) S SDERR=1 Q
  1. .I Y S SDTYP(3)=""
  1. S SDYN=$$LST^DGMTU(DFN) I SDYN D I SDERR G DIRQ
  1. .S DIR(0)="Y",DIR("B")="YES",DIR("A")="Do you want to print means test",DIR("?")="Enter 'NO' if you do not want the means test, otherwise enter 'YES'."
  1. .D ^DIR K DIR I $D(DIRUT) S SDERR=1 Q
  1. .I Y S SDTYP(5)=""
  1. ;adding team information - chris mckee 2/6/96
  1. S DIR(0)="Y",DIR("B")="YES",DIR("A")="Do you want to print team information",DIR("?")="Enter 'NO' if you do not want the team information, otherwise enter 'YES'."
  1. D ^DIR K DIR I $D(DIRUT) S SDERR=1 Q
  1. I Y S SDTYP(7)="",GBL="^TMP(""SDPP"","_$J_")"
  1. DIRQ Q
  1. ;
  1. HDR() ; -- print header
  1. ; return: continue processing [ 1|yes 0|no ]
  1. ;
  1. N Y
  1. I SDPAGE,$E(IOST,1,2)="C-" D PAUSE^VALM1 G:'Y HDRQ
  1. S SDPAGE=SDPAGE+1 D PID^VADPT6
  1. W @IOF,*13,"PATIENT PROFILE: ",$P(^DPT(DFN,0),U)_" ("_VA("BID")_")",?45,$S($D(^DPT(DFN,.1)):"Ward: "_^(.1),1:"Outpatient"),?70,"Page: ",SDPAGE
  1. ;
  1. W !,"Dates: ",$S(SDBD:$TR($$FMTE^XLFDT(SDBD,"5DF")," ","0"),1:"All"),$S(SDED'=9999999:" to "_$TR($$FMTE^XLFDT(SDED,"5DF")," ","0"),1:" Dates")
  1. W ?45,"Report Date: ",$P($$NOW^VALM1,":",1,2)
  1. W !,SDASH S Y=1
  1. HDRQ Q Y