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

AMHPOST1.m

Go to the documentation of this file.
AMHPOST1 ; IHS/CMI/LAB - DISPLAY A TREATMENT PLAN ;
 ;;3.0;IHS BEHAVIORAL HEALTH;;JAN 27, 2003
 ;
GATHER ;gather up and display all problems/goals/methods
 S AMHA=0,AMHRCNT=0 F  S AMHA=$O(^AMHPTPP("AD",AMHXX,AMHA)) Q:AMHA'=+AMHA  D GATHER1
 Q
GATHER1 ;
 S AMHRCNT=AMHRCNT+1
 S AMHLINE=0,AMH0=^AMHPTPP(AMHA,0)
 S AMHZ1=AMHRCNT_".  Problem:  "_$P(AMH0,U)
 W !!,AMHZ1
 W !,?5,"DESCRIPTION:"
 K AMHPCNT,AMHPRNM S AMHPCNT=0,AMHNODE=11,AMHDA=AMHA,AMHFILE=9002011.62 D WP^AMHLETP4
 I $D(AMHPRNM) S AMHZ1=0 F  S AMHZ1=$O(AMHPRNM(AMHZ1)) Q:AMHZ1'=+AMHZ1  W !?5,AMHPRNM(AMHZ1)
 S AMHZ1="Date Established: "_$$VAL^XBDIQ1(9002011.62,AMHA,.08),$E(AMHZ1,42)="By: "_$E($$VAL^XBDIQ1(9002011.62,AMHA,.06),1,25)
 W !!?5,AMHZ1
 S AMHZ1="Date Last Modified: "_$$VAL^XBDIQ1(9002011.62,AMHA,.08),$E(AMHZ1,42)="By: "_$E($$VAL^XBDIQ1(9002011.62,AMHA,.06),1,25)
 W !?5,AMHZ1
G ;get goals
 S AMHZ1="GOALS:"
 W !!?8,AMHZ1
 S (AMHB,AMHB1)=0 F  S AMHB=$O(^AMHPTPGL("AD",AMHA,AMHB)) Q:AMHB'=+AMHB  S AMHB1=AMHB1+1 D
 .K AMHPCNT,AMHPRNM S AMHPCNT=0,AMHNODE=11,AMHCOL=10,AMHDA=AMHB,AMHFILE=9002011.63 D WP^AMHLETP4
 .I $D(AMHPRNM) W ! S AMHZ=0 F  S AMHZ=$O(AMHPRNM(AMHZ)) Q:AMHZ'=+AMHZ  S AMHZ1="" S:AMHZ=1 AMHZ1="Goal #"_AMHB1_"  "_AMHPRNM(AMHZ) S:AMHZ'=1 AMHZ1=AMHPRNM(AMHZ) W !?8,AMHZ1
 .S AMHZ1="",AMHZ1="Date Established: "_$$VAL^XBDIQ1(9002011.63,AMHB,.08),$E(AMHZ1,44)="By: "_$E($$VAL^XBDIQ1(9002011.63,AMHB,.06),1,25)
 .W !?8,AMHZ1
 .S AMHZ1="",AMHZ1="Date Last Modified: "_$$VAL^XBDIQ1(9002011.63,AMHB,.04),$E(AMHZ1,44)="By: "_$E($$VAL^XBDIQ1(9002011.63,AMHB,.05),1,25)
 .W !?8,AMHZ1
 .S AMHZ1="Status: "_$$VAL^XBDIQ1(9002011.63,AMHB,.12)
 .W !?8,AMHZ1
 .;comments for this goal
 .S AMHZ1="COMMENTS:"
 .W !?8,AMHZ1
 .S AMHD=0 F  S AMHD=$O(^AMHPTPGL(AMHB,12,AMHD)) Q:AMHD'=+AMHD  D
 ..S AMHZ=^AMHPTPGL(AMHB,12,AMHD,0)
 ..S AMHZ1="Comments made by "_$S($P(AMHZ,U,2):$P(^VA(200,$P(AMHZ,U,2),0),U),1:"")_" on "_$$FMTE^XLFDT($P(AMHZ,U))
 ..W !?8,AMHZ1
 ..K AMHPCNT,AMHPRNM S AMHPCNT=0,AMHCOL=10,AMHNODE=11,AMHDA=AMHD,AMHG="^AMHPTPGL("_AMHB_",12," D WP^AMHLETP4
 ..I $D(AMHPRNM) S AMHZ=0 F  S AMHZ=$O(AMHPRNM(AMHZ)) Q:AMHZ'=+AMHZ  S AMHZ1="" S:AMHZ=1 AMHZ1=AMHB1_") "_AMHPRNM(AMHZ) S:AMHZ'=1 AMHZ1=AMHPRNM(AMHZ) W !?10,AMHZ1
 .S AMHZ1="TREATMENT METHODS:"
 .W !!?10,AMHZ1
M .;
 .S (AMHC,AMHC1)=0 F  S AMHC=$O(^AMHPTPM("AD",AMHB,AMHC)) Q:AMHC'=+AMHC  S AMHC1=AMHC1+1 D
 ..K AMHPCNT,AMHPRNM S AMHPCNT=0,AMHNODE=11,AMHCOL=15,AMHDA=AMHC,AMHFILE=9002011.64 D WP^AMHLETP4
 ..I $D(AMHPRNM) W ! S AMHZ=0 F  S AMHZ=$O(AMHPRNM(AMHZ)) Q:AMHZ'=+AMHZ  S AMHZ1="" S:AMHZ=1 AMHZ1=AMHC1_") "_AMHPRNM(AMHZ) S:AMHZ'=1 AMHZ1=AMHPRNM(AMHZ) W !?10,AMHZ1
 ..S AMHZ1="Date Established: "_$$VAL^XBDIQ1(9002011.64,AMHC,.04),$E(AMHZ1,44)="By: "_$E($$VAL^XBDIQ1(9002011.64,AMHC,.09),1,25)
 ..W !?10,AMHZ1
 ..S AMHZ1="Frequency: "_$$VAL^XBDIQ1(9002011.64,AMHC,.07),$E(AMHZ1,42)="By: "_$$VAL^XBDIQ1(9002011.64,AMHC,.05)
 ..W !?10,AMHZ1
 Q
METHOD ;EP called from amhletpp
 I '$D(^AMHPTXPG("AD",AMHTP)) Q
 W !!?2,"METHODS:"
DISPMETH ;
 K AMHRMETH S (AMHGIEN,AMHC)=0 F  S AMHGIEN=$O(^AMHPTXPG("AD",AMHTP,AMHGIEN)) Q:AMHGIEN'=+AMHGIEN  S AMHC=AMHC+1 D
 .S AMHMETH0=^AMHPTXPG(AMHGIEN,0)
 .S AMHRMETH(AMHC)=AMHGIEN
 .W !?2,AMHC,")  Date Method Established: ",$$FTIME^VALM1($P(AMHMETH0,U,4))," Therapist: " W:$P(AMHMETH0,U,5) $E($P(^VA(200,$P(AMHMETH0,U,5),0),U),1,25) W !
 .K AMHPCNT,AMHPRNM S AMHPCNT=0,AMHNODE=11,AMHDA=AMHGIEN,AMHFILE=9002011.57 D WP^AMHLETP4
 .I $D(AMHPRNM) S X=0 F  S X=$O(AMHPRNM(X)) Q:X'=+X  W ?6,AMHPRNM(X),!
 .K AMHLETXT S AMHLETP("ICL")=0,AMHLETP("NRQ")="Method:  "_$G(^AMHPTXPG(AMHGIEN,12)),AMHLETP("TXT")="",AMHLEC=0
 .D GETTXT^AMHLETP
 .S X=0 F  S X=$O(AMHLETXT(X)) Q:X'=+X  W !?6,AMHLETXT(X)
 .K AMHLETXT S AMHLETP("ICL")=0,AMHLETP("NRQ")="Duration:  "_$G(^AMHPTXPG(AMHGIEN,13)),AMHLETP("TXT")="",AMHLEC=0
 .D GETTXT^AMHLETP
 .S X=0 F  S X=$O(AMHLETXT(X)) Q:X'=+X   W !?6,AMHLETXT(X)
 .W !?6,"Target Date: ",$$FTIME^VALM1($P(AMHMETH0,U,7)),!?6,"Status: " W:$P(AMHMETH0,U,8)]"" $$EXTSET^XBFUNC(9002011.57,.08,$P(AMHMETH0,U,8))
 .W !?6,"Date Reviewed w/client: ",$$FTIME^VALM1($P(AMHMETH0,U,6)),!
 .Q
 Q