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

AMHLETP4.m

Go to the documentation of this file.
AMHLETP4 ; IHS/CMI/LAB - MENTAL HLTH ROUTINE ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
 ;
GATHER ;gather up and display all problems/goals/methods
 K ^TMP("AMHPTPP",$J)
 NEW AMHA,AMHB,AMHC,X,Y,Z,AMHL
 S (AMHA,AMHLINE,AMHRCNT)=0 F  S AMHA=$O(^AMHPTPP("AD",AMHTP,AMHA)) Q:AMHA'=+AMHA  S AMH0=^AMHPTPP(AMHA,0) D
 .S AMHRCNT=$G(AMHRCNT)+1
 .S X=AMHRCNT_") "_IORVON_"Problem: "_IORVOFF_IOINHI_$E($P(AMH0,U),1,44)_IOINORM,$E(X,60)="Status: "_$$VAL^XBDIQ1(9002011.62,AMHA,.12) D S S ^TMP("AMHPTPP",$J,"IDX",AMHRCNT,AMHLINE)=AMHA
 .S Y=0 F  S Y=$O(^AMHPTPP(AMHA,11,Y)) Q:Y'=+Y  S X="",$E(X,5)=^AMHPTPP(AMHA,11,Y,0) D S
 .S X="    Date Established:  "_$$VAL^XBDIQ1(9002011.62,AMHA,.08),$E(X,42)="Established by: "_$E($$VAL^XBDIQ1(9002011.62,AMHA,.06),1,25) D S
 .S X="    Date Last Modified: "_$$VAL^XBDIQ1(9002011.62,AMHA,.08),$E(X,42)="Modified by: "_$E($$VAL^XBDIQ1(9002011.62,AMHA,.06),1,25) D S
 .Q
 Q  ;*** new format
WP ;EP - Entry point to print wp fields pass node in AMHNODE
 ;PASS FILE IN AMHFILE, ENTRY IN AMHDA
 NEW AMHX,AMHPCNT
 S AMHPCNT=0
 K AMHPRNM
 S AMHX=0 F  S AMHX=$O(^AMHPTXP(AMHDA,AMHNODE,AMHX)) Q:AMHX'=+AMHX  D
 .S AMHPCNT=AMHPCNT+1
 .S AMHPRNM(AMHPCNT)=^AMHPTXP(AMHDA,AMHNODE,AMHX,0)
 .Q
 Q
NWP ;EP
 K ^UTILITY($J,"W")
 S AMHX=0
 S AMHG=$S($G(AMHG)]"":AMHG,1:^DIC(AMHFILE,0,"GL")),AMHG=AMHG_AMHDA_","_AMHNODE_",AMHX)"
 S DIWL=$S($G(AMHCOL):AMHCOL,1:1),DIWR=70 F  S AMHX=$O(@AMHG) Q:AMHX'=+AMHX  D
 .S Y=$P(AMHG,")")_",0)" S X=$TR(@Y,$C(10)) D ^DIWP
 .Q
WPS ;EP
 S Z=0 F  S Z=$O(^UTILITY($J,"W",DIWL,Z)) Q:Z'=+Z  S AMHPCNT=AMHPCNT+1,AMHPRNM(AMHPCNT)=^UTILITY($J,"W",DIWL,Z,0)
 K DIWL,DIWR,DIWF,Z
 K ^UTILITY($J,"W"),AMHNODE,AMHFILE,AMHDA,AMHG,AMHCOL
 Q
S ;
 S AMHLINE=AMHLINE+1
 S ^TMP("AMHPTPP",$J,AMHLINE,0)=X
 Q
EOP ;
 W ! S DIR("A")="Press enter...",DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S AMHQUIT="" Q
 Q