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

AMHLESA2.m

Go to the documentation of this file.
AMHLESA2  ; IHS/TUCSON/LAB -VISIT DISPLAY ;      
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
DISP(AMHR) ;EP
 NEW AMHARRY
 K ^TMP("AMHLESA1",$J)
 S AMHARRY="^TMP(""AMHLESA1"",$J)"
 Q:'$D(AMHR)
 Q:'AMHR
 NEW DFN S DFN=$P(^AMHREC(AMHR,0),U,8)
 Q:'DFN
 Q:'$D(^AMHREC(AMHR,0))
 D BUILD
 D XIT
 Q
 ;
SET ;set array
 S AMHCTR=AMHCTR+1
 S @AMHARRY@(AMHCTR,0)=AMHSTR
 S AMHSTR=""
 Q
BUILD ; build array
 NEW AMHAR,AMHSTR,AMHCTR,AMHX,AMHH,AMHV
 I $E(IOST)'="P" D TERM^VALM0
 S Y=DFN D ^AUPNPAT
 S AMHSTR="",AMHCTR=0
 S AMHH="Patient Name",AMHV=$E($P(^DPT(DFN,0),U),1,20) D BUILD1
 S AMHH="Chart #" S AMHV="",AMHV=$$HRN^AUPNPAT(DFN,DUZ(2)) D BUILD1
 S AMHH="Date of Birth" S AMHV=$$DOB^AUPNPAT(DFN,"E") D BUILD1
 S AMHH="Sex",AMHV=AUPNSEX D BUILD1
 S AMHSTR="" D SET
 S AMHH="Tribe",AMHV=$$TRIBE^AUPNPAT(DFN,"E") D BUILD1
SAN ;
 S AMHSTR="=============== "_"BH SAN DATA ITEMS"_" ===============",X=(80-$L(AMHSTR)\2) D SET ;$J("",X)_AMHSTR D SET
 I AMHVTYPE="U" D SANU Q
1 ;EP
 K AMHAR
 D ENP^XBDIQ1(9002011,AMHR,"7701;7702;7703;7704;7706;7707;7901","AMHAR(","E")
 S F=0 F  S F=$O(AMHAR(F)) Q:F'=+F  I AMHAR(F)]"" D
 .S AMHH=$P(^DD(9002011,F,0),U)
 .S AMHV=AMHAR(F)
 .D BUILD1
2 ;
 K AMHAR
 F AMHX=7709,7717,7711,7712 I $D(^DD(9002011,AMHX,0)),$O(^AMHREC(AMHR,AMHX,0)) D
 .S AMHSTR=$P(^DD(9002011,AMHX,0),U) D SET
 .K AMHAR D ENP^XBDIQ1(9002011,AMHR,AMHX,"AMHAR(","E")
 .S F=0 F  S F=$O(AMHAR(AMHX,F)) Q:F'=+F  S AMHSTR=AMHAR(AMHX,F) D SET
 .S AMHSTR="" D SET
 .Q
3 ;
 K AMHAR
 D ENP^XBDIQ1(9002011,AMHR,7713,"AMHAR(","E")
 S F=0 F  S F=$O(AMHAR(F)) Q:F'=+F  I AMHAR(F)]"" D
 .S AMHH=$P(^DD(9002011,F,0),U)
 .S AMHV=AMHAR(F)
 .D BUILD1
4 ;
 K AMHAR
 F AMHX=7715 I $D(^DD(9002011,AMHX,0)),$O(^AMHREC(AMHR,AMHX,0)) D
 .S AMHSTR=$P(^DD(9002011,AMHX,0),U) D SET
 .K AMHAR D ENP^XBDIQ1(9002011,AMHR,AMHX,"AMHAR(","E")
 .S F=0 F  S F=$O(AMHAR(AMHX,F)) Q:F'=+F  S AMHSTR=AMHAR(AMHX,F) D SET
 .S AMHSTR="" D SET
5 ;
 K AMHAR
 D ENP^XBDIQ1(9002011,AMHR,"7902;7719;7721;7722;7903;7904;7905","AMHAR(","E")
 S F=0 F  S F=$O(AMHAR(F)) Q:F'=+F  I AMHAR(F)]"" D
 .S AMHH=$P(^DD(9002011,F,0),U)
 .S AMHV=AMHAR(F)
 .D BUILD1
6 ;
 K AMHAR
 F AMHX=7724 I $D(^DD(9002011,AMHX,0)),$O(^AMHREC(AMHR,AMHX,0)) D
 .S AMHSTR=$P(^DD(9002011,AMHX,0),U) D SET
 .K AMHAR D ENP^XBDIQ1(9002011,AMHR,AMHX,"AMHAR(","E")
 .S F=0 F  S F=$O(AMHAR(AMHX,F)) Q:F'=+F  S AMHSTR=AMHAR(AMHX,F) D SET
 .S AMHSTR="" D SET
 .Q
 S AMHSTR="" D SET
 Q
BUILD1 ;
 S AMHSTR=$E(AMHH,1,21)_":",AMHSTR=$$SETSTR^VALM1(AMHV,AMHSTR,24,$L(AMHV))
 D SET
 Q
SANU ;EP
 K AMHAR
 F AMHX=7801 I $D(^DD(9002011,AMHX,0)) D
 .S AMHSTR=$P(^DD(9002011,AMHX,0),U) D SET
 .K AMHAR D ENP^XBDIQ1(9002011,AMHR,AMHX,"AMHAR(","E")
 .S F=0 F  S F=$O(AMHAR(AMHX,F)) Q:F'=+F  S AMHSTR=AMHAR(AMHX,F) D SET
 .S AMHSTR="" D SET
 .Q
78 ;
 K AMHAR
 D ENP^XBDIQ1(9002011,AMHR,7802,"AMHAR(","E")
 S F=0 F  S F=$O(AMHAR(F)) Q:F'=+F  I AMHAR(F)]"" D
 .S AMHH=$P(^DD(9002011,F,0),U)
 .S AMHV=AMHAR(F)
 .D BUILD1
783 ;
 K AMHAR
 F AMHX=7803:1:7805 I $D(^DD(9002011,AMHX,0)) D
 .S AMHSTR=$P(^DD(9002011,AMHX,0),U) D SET
 .K AMHAR D ENP^XBDIQ1(9002011,AMHR,AMHX,"AMHAR(","E")
 .S F=0 F  S F=$O(AMHAR(AMHX,F)) Q:F'=+F  S AMHSTR=AMHAR(AMHX,F) D SET
 .S AMHSTR="" D SET
 .Q
786 ; 
 K AMHAR
 D ENP^XBDIQ1(9002011,AMHR,7806,"AMHAR(","E")
 S F=0 F  S F=$O(AMHAR(F)) Q:F'=+F  I AMHAR(F)]"" D
 .S AMHH=$P(^DD(9002011,F,0),U)
 .S AMHV=AMHAR(F)
 .D BUILD1
787 ;
 K AMHAR
 F AMHX=7808:1:7809 I $D(^DD(9002011,AMHX,0)) D
 .S AMHSTR=$P(^DD(9002011,AMHX,0),U) D SET
 .K AMHAR D ENP^XBDIQ1(9002011,AMHR,AMHX,"AMHAR(","E")
 .S F=0 F  S F=$O(AMHAR(AMHX,F)) Q:F'=+F  S AMHSTR=AMHAR(AMHX,F) D SET
 .S AMHSTR="" D SET
 .Q
7811 ;
 K AMHAR
 D ENP^XBDIQ1(9002011,AMHR,"7811;7812","AMHAR(","E")
 S F=0 F  S F=$O(AMHAR(F)) Q:F'=+F  I AMHAR(F)]"" D
 .S AMHH=$P(^DD(9002011,F,0),U)
 .S AMHV=AMHAR(F)
 .D BUILD1
7813 ;
 K AMHAR
 F AMHX=7813 I $D(^DD(9002011,AMHX,0)) D
 .S AMHSTR=$P(^DD(9002011,AMHX,0),U) D SET
 .K AMHAR D ENP^XBDIQ1(9002011,AMHR,AMHX,"AMHAR(","E")
 .S F=0 F  S F=$O(AMHAR(AMHX,F)) Q:F'=+F  S AMHSTR=AMHAR(AMHX,F) D SET
 .S AMHSTR="" D SET
 .Q
XIT ;
 Q