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

BCHDHS.m

Go to the documentation of this file.
BCHDHS ; IHS/CMI/LAB - CHR HEALTH SUMMARY COMPONENT ; 
 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
 ;
 ;IHS/TUCSON/LAB - patch 2 - 06/03/97 - fixed the display of referral data
 ;Called from health summary component called CHR.
 ;Extracts and writes information on the health summary from the
 ;CHR data file.
 ;
CHR ;EP called from health summary
 X APCHSCKP Q:$D(APCHSQIT)  X:'APCHSNPG APCHSBRK
OUTPT ; ********** CHR PROBLEM CODES AND DESIGNATED PROVIDER
 ; <SETUP>
 I '$D(^BCHR("AE",APCHSPAT)) X APCHSCKP Q:$D(APCHSQIT)  W !,"No CHR Records on File.",! Q
 ; <DISPLAY>
 S BCHSPVD=0
 F BCHSIVD=0:0 S BCHSIVD=$O(^BCHR("AE",APCHSPAT,BCHSIVD)) Q:BCHSIVD=""!(BCHSIVD>APCHSDLM)  D ONEDATE Q:$D(APCHSQIT)  S:(BCHSDAT'=BCHSPVD)&BCHSDTU APCHSNDM=APCHSNDM-BCHSDTU,BCHSPVD=BCHSDAT Q:APCHSNDM=0
OUTPTX K BCHSIVD,BCHSDTU,BCHSVDF,BCHSFAC,BCHSPFN,BCHSMTX,BCHSPVD,BCHSOVT,BCHSNDT,BCHSCLI,BCHSPDN,BCHSICD,BCHSICL,BCHSDAT,BCHSN,BCHSQ,BCHSR,BCHSX,BCHS,BCHACTL,BCHSNRQ
 K BCHSNFL,BCHSNSH,BCHSNAB,BCHSVSC,BCHSFAC,Y,D0
 Q
ONEDATE S Y=-BCHSIVD\1+9999999 X APCHSCVD S BCHSDAT=Y S BCHSPFN="",BCHSDTU=0,BCHSNDT=(BCHSDAT'=BCHSPVD)
 S BCHSVDF="" F BCHSQ=0:0 S BCHSVDF=$O(^BCHR("AE",APCHSPAT,BCHSIVD,BCHSVDF)) Q:BCHSVDF=""  S BCHSN=^BCHR(BCHSVDF,0) D GETSITE,DSPVIS Q:$D(APCHSQIT)
 Q
 ;
GETSITE ;
 S BCHACTL=$P(BCHSN,U,6) I BCHACTL]"" S BCHACTL=$E($P(^BCHTACTL(BCHACTL,0),U),1,10)
 S BCHSFAC=$P(BCHSN,U,5) I BCHSFAC]"" S BCHSFAC=$P(^AUTTLOC(BCHSFAC,0),U,2)
 I BCHSFAC="" S BCHSFAC=BCHACTL
 Q
DSPVIS ;
 S BCHSDTU=1
 I $O(^BCHRPROB("AD",BCHSVDF,""))="" D NOPOV Q
 S BCHSPDN="" F BCHSQ=0:0 S BCHSPDN=$O(^BCHRPROB("AD",BCHSVDF,BCHSPDN)) Q:'BCHSPDN  S BCHSR=^BCHRPROB(BCHSPDN,0) D HASPOV
 ;display measurements
 K X N Z S Y=$G(^BCHR(BCHSVDF,12)) I Y]"" S Z="BP^WT^HT^HC^VU^VC^TMP^PU^RESP^PPD",C=0 F I=1:1:10 I $P(Y,U,I)]"" S C=C+1,X(C)=$P(Z,U,I)_"^"_$P(Y,U,I)
 I $D(X) S I=0,J=25,C=0 F  S I=$O(X(I)) Q:I'=+I  S C=C+1 W:C=1 ! W ?J,$P(X(I),U),"  ",$P(X(I),U,2) S J=J+18 S:C=3 C=0,J=25
 NEW BCHF F BCHF=1301:1:1308 S BCHX=$$VAL^XBDIQ1(90002,BCHSVDF,BCHF) I BCHX]"" D
 .X APCHSCKP Q:$D(APCHSQIT)  S:APCHSNPG BCHSNDT=1
 .I BCHSNDT W BCHSDAT S BCHSPFN="",BCHSNDT=0
 .W !?25,$P(^DD(90002,BCHF,0),U),?55,BCHX
 .Q
 I $P(BCHSN,U,9)]"" W !?25,"Evaluation:  ",$$EXTSET^XBFUNC(90002,.09,$P(BCHSN,U,9)),! ;IHS/TUCSON/LAB - patch 2
 NEW BCHREFB,BCHREFT,C
 S X=0,C=0 F  S X=$O(^BCHR(BCHSVDF,41,X)) Q:X'=+X  S C=C+1,BCHREFB(C)=$P(^BCHTREF($P(^BCHR(BCHSVDF,41,X,0),U),0),U,1)
 S X=0,C=0 F  S X=$O(^BCHR(BCHSVDF,42,X)) Q:X'=+X  S C=C+1,BCHREFT(C)=$P(^BCHTREF($P(^BCHR(BCHSVDF,42,X,0),U),0),U,1)
 W !?5,"Referred to CHR by: ",?45,"Referred by CHR to: "
 F X=1:1:20 I $D(BCHREFB(X))!($D(BCHREFT(X))) Q:$D(APCHSQIT)  D
 .X APCHSCKP Q:$D(APCHSQIT)
 .W !?5,$G(BCHREFB(X)),?45,$G(BCHREFT(X))
 W !!
 Q
 ;
NOPOV ;
 S APCHSTXT="",(BCHSICD,APCHSNRQ)="<CHR POV's not yet entered>"
 G COMMON
 ;
HASPOV ;
 S BCHSICD=$E($P(^BCHTPROB($P(BCHSR,U),0),U),1,20)_"  ("_$P(^BCHTPROB($P(BCHSR,U),0),U,2)_") - "
 S BCHSICD=BCHSICD_$S($P(BCHSR,U,4):$E($P(^BCHTSERV($P(BCHSR,U,4),0),U),1,20),1:"??service")_"   AT: "_$P(BCHSR,U,5)_$S($P(BCHSR,U,7):"  -  S/R",1:"")
 S BCHSNRQ=$P(BCHSR,U,6) S:BCHSNRQ BCHSNRQ=$P(^AUTNPOV(BCHSNRQ,0),U) S APCHSTXT=""
 D COMMON
 Q
COMMON ;
 X APCHSCKP Q:$D(APCHSQIT)  S:APCHSNPG BCHSNDT=1
 I BCHSNDT W BCHSDAT S BCHSPFN="",BCHSNDT=0
 W ?9,BCHSFAC,?20,$$PPINI^BCHUTIL(BCHSVDF) S APCHSICL=25,APCHSNRQ=BCHSICD D PRTTXT^APCHSUTL
 S APCHSTXT="",APCHSICL=25,APCHSNRQ=BCHSNRQ D PRTTXT^APCHSUTL
 Q