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

AMHLETPP.m

Go to the documentation of this file.
AMHLETPP ; IHS/CMI/LAB - DISPLAY A TREATMENT PLAN ;
 ;;4.0;IHS BEHAVIORAL HEALTH;**1,4**;JUN 18, 2010;Build 28
 ;
PRINT ;EP - called from xbdbque
 Q:'$G(AMHTP)
 Q:'$D(^AMHPTXP(AMHTP))
 S DFN=$P(^AMHPTXP(AMHTP,0),U,2)
 S (AMHQUIT,AMHPG)=0
 S AMHIOSL=$S($G(AMHGUI):55,1:IOSL)
 ;print/display treatment plan
 I AMHPREV="R" G REV^AMHLETP3
 D HEAD
 ;I $Y>(AMHIOSL-5) D HEAD Q:AMHQUIT
 W !,"Date Established:  ",?30,$$FMTE^XLFDT($P(^AMHPTXP(AMHTP,0),U))
 W !,"Admit Date:  ",?30,$$FMTE^XLFDT($P(^AMHPTXP(AMHTP,0),U,16))
 W !,"Anticipated Completion Date:  ",?30,$$FMTE^XLFDT($P(^AMHPTXP(AMHTP,0),U,3))
 W !,"Date Closed:  ",?30,$$FMTE^XLFDT($P(^AMHPTXP(AMHTP,0),U,12))
 I $Y>(AMHIOSL-4) D HEAD Q:AMHQUIT
 W !,"Provider:  ",?30,$S($P(^AMHPTXP(AMHTP,0),U,4):$E($P(^VA(200,$P(^AMHPTXP(AMHTP,0),U,4),0),U),1,25),1:"<not recorded>")
 W !,"Supervisor:  ",?30,$S($P(^AMHPTXP(AMHTP,0),U,5):$E($P(^VA(200,$P(^AMHPTXP(AMHTP,0),U,5),0),U),1,25),1:"<not recorded>")
 W !?3,"  Date Concurred:  ",?30,$$FMTE^XLFDT($P(^AMHPTXP(AMHTP,0),U,6))
NR ;
 W !,"Review Date:  ",?30,$$FMTE^XLFDT($P(^AMHPTXP(AMHTP,0),U,9))
 I $O(^AMHPTXP(AMHTP,17,0)) D
 .W !,"Participants in Plan Creation:"
 .S AMHX=0 F  S AMHX=$O(^AMHPTXP(AMHTP,17,AMHX)) Q:AMHX'=+AMHX  D
 ..I $Y>(AMHIOSL-3) D HEAD Q:AMHQUIT
 ..W !?3,$P(^AMHPTXP(AMHTP,17,AMHX,0),U,1),?40,$P(^AMHPTXP(AMHTP,17,AMHX,0),U,2)
 Q:AMHQUIT
 ;W !,"Status:",?27,$$VAL^XBDIQ1(9002011.56,AMHTP,.15)
 W !!,"DIAGNOSIS",!
 ;IF HAVE 2100 DISPLAY IT
 I '$O(^AMHPTXP(AMHTP,21,0)) G I
 K AMHPCNT,AMHPRNM S AMHPCNT=0,AMHNODE=21,AMHDA=AMHTP,AMHFILE=9002011.56 D WP^AMHLETP4
 I $D(AMHPRNM) S X=0 F  S X=$O(AMHPRNM(X)) Q:X'=+X!(AMHQUIT)  D:$Y>(AMHIOSL-3) HEAD Q:AMHQUIT  W $TR(AMHPRNM(X),$C(10)),!
I ;
 I '$O(^AMHPTXP(AMHTP,6,0)) G II
 W !,"AXIS I",!
 K AMHPCNT,AMHPRNM S AMHPCNT=0,AMHNODE=6,AMHDA=AMHTP,AMHFILE=9002011.56 D WP^AMHLETP4
 I $D(AMHPRNM) S X=0 F  S X=$O(AMHPRNM(X)) Q:X'=+X!(AMHQUIT)  D:$Y>(AMHIOSL-3) HEAD Q:AMHQUIT  W $TR(AMHPRNM(X),$C(10)),!
 Q:AMHQUIT
II ;
 I '$O(^AMHPTXP(AMHTP,8,0)) G III
 W !,"AXIS II",!
 K AMHPCNT,AMHPRNM S AMHPCNT=0,AMHNODE=8,AMHDA=AMHTP,AMHFILE=9002011.56 D WP^AMHLETP4
 I $D(AMHPRNM) S X=0 F  S X=$O(AMHPRNM(X)) Q:X'=+X!(AMHQUIT)  D:$Y>(AMHIOSL-3) HEAD Q:AMHQUIT  W $TR(AMHPRNM(X),$C(10)),!
 Q:AMHQUIT
III ;
 I '$O(^AMHPTXP(AMHTP,7,0)) G IV
 W !,"AXIS III",!
 K AMHPCNT,AMHPRNM S AMHPCNT=0,AMHNODE=7,AMHDA=AMHTP,AMHFILE=9002011.56 D WP^AMHLETP4
 I $D(AMHPRNM) S X=0 F  S X=$O(AMHPRNM(X)) Q:X'=+X!(AMHQUIT)  D:$Y>(AMHIOSL-3) HEAD Q:AMHQUIT  W $TR(AMHPRNM(X),$C(10)),!
 Q:AMHQUIT
IV ;
 I $G(^AMHPTXP(AMHTP,15))="",'$O(^AMHPTXP(AMHTP,9,0)) G V
 W !,"AXIS IV   "
 I $G(^AMHPTXP(AMHTP,15))]"" D
 .K AMHLETXT S AMHLETP("ICL")=0,AMHLETP("LGTH")=65,AMHLETP("NRQ")=$G(^AMHPTXP(AMHTP,15)),AMHLETP("TXT")="",AMHLEC=0
 .D GETTXT^AMHLETP
 .W ! S X=0 F  S X=$O(AMHLETXT(X)) Q:X'=+X!(AMHQUIT)  D:$Y>(AMHIOSL-3) HEAD Q:AMHQUIT  W ?12,$TR(AMHLETXT(X),$C(10)),!
 S AMHX=0 F  S AMHX=$O(^AMHPTXP(AMHTP,9,AMHX)) Q:AMHX'=+AMHX!(AMHQUIT)  D:$Y>(AMHIOSL-3) HEAD Q:AMHQUIT  D
 .I $P(^AMHPTXP(AMHTP,9,AMHX,0),U) W ?12,$P(^AMHTAXIV($P(^AMHPTXP(AMHTP,9,AMHX,0),U),0),U,1)_" "_$P(^AMHTAXIV($P(^AMHPTXP(AMHTP,9,AMHX,0),U),0),U,2),!
 Q:AMHQUIT
V ;
 I $P($G(^AMHPTXP(AMHTP,16)),U,1)="",$P($G(^AMHPTXP(AMHTP,16)),U,2)="" G GATHER
 K AMHLETXT S AMHLETP("ICL")=0,AMHLETP("LGTH")=65,AMHLETP("NRQ")=$P($G(^AMHPTXP(AMHTP,16)),U,1) S:$P($G(^AMHPTXP(AMHTP,16)),U,2)]"" AMHLETP("NRQ")=AMHLETP("NRQ")_"   GAF Scale Type: "_$P($G(^AMHPTXP(AMHTP,16)),U,2) S AMHLETP("TXT")="",AMHLEC=0
 D GETTXT^AMHLETP
 W !,"AXIS V    " S X=0 F  S X=$O(AMHLETXT(X)) Q:X'=+X!(AMHQUIT)  D:$Y>(AMHIOSL-3) HEAD Q:AMHQUIT  W ?12,$TR(AMHLETXT(X),$C(10)),!
 Q:AMHQUIT
GATHER ;gather up and display all problems/goals/met
PL ;
 I $Y>(AMHIOSL-4) D HEAD Q:AMHQUIT
 W !!!,"PROBLEM LIST"
DX ;
TPP ;
 I $Y>(AMHIOSL-4) D HEAD Q:AMHQUIT
 W !,$G(^AMHPTXP(AMHTP,11)),!
 W !!,"TREATMENT PLAN (Problems/Goals/Objectives/Methods)",!
 K AMHPCNT,AMHPRNM S AMHPCNT=0,AMHNODE=18,AMHDA=AMHTP,AMHFILE=9002011.56 D WP^AMHLETP4
 I $D(AMHPRNM) S X=0 F  S X=$O(AMHPRNM(X)) Q:X'=+X!(AMHQUIT)  D:$Y>(AMHIOSL-3) HEAD Q:AMHQUIT  W $TR(AMHPRNM(X),$C(10)),!
 Q:AMHQUIT
 D ^AMHLETP3
 Q
 I 'AMHPG G HEAD1
 NEW X
 I '$G(AMHBROW),$E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S AMHQUIT=1 Q
 ;Q
HEAD1 ;EP
 I AMHPG W:$D(IOF) @IOF
 S AMHPG=AMHPG+1
 W:$G(AMHGUI) "ZZZZZZZ",!
 W !?13,"********** CONFIDENTIAL PATIENT INFORMATION **********"
 W !,$TR($J("",80)," ","*")
 W !,"*",?79,"*"
 W !,"*  TREATMENT PLAN",?45,"Printed: "_$$FMTE^XLFDT($$NOW^XLFDT),?79,"*"
 W !,"*  Name:  ",$P(^DPT(DFN,0),U),?68,"Page ",AMHPG,?79,"*"
 W !,"*  ",$E($P(^DIC(4,DUZ(2),0),U),1,25),?30,"DOB:  ",$$FMTE^XLFDT($P(^DPT(DFN,0),U,3),"2D"),?46,"Sex:  ",$P(^DPT(DFN,0),U,2),?54,"  Chart #:  ",$P(^AUTTLOC(DUZ(2),0),U,7),$P($G(^AUPNPAT(DFN,41,DUZ(2),0)),U,2),?79,"*"
 W !,"*",?79,"*"
 W !,$TR($J("",80)," ","*"),!
 Q