APCHSBRW ; IHS/CMI/LAB - Browse Health Summary ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;This routine allows the user to display a HS using the
; browse feature.
;
BROWSE ;EP - called from option BROWSE HEALTH SUMMARY
;
I $T(VIEWR^XBLM)="" W !!!?5,"*** Browser Utility not available!! ***" Q
D GETTYP
I '$D(APCHSTYP) G END
D SELPT
G:'$D(APCHSPAT) END
;QUIT IF NO PATIENT
S DFN=APCHSPAT
S APCHHDR="PCC Health Summary for "_$P(^DPT(DFN,0),U)
D VIEWR^XBLM("EN^APCHS",APCHHDR)
D END
Q
;
GETTYP ; EP - get health summary TYPE
K APCHSTYP
K DIC S DIC=9001015,DIC("A")="Select health summary type: ",DIC(0)="AEQM"
S X="" I DUZ(2),$D(^APCCCTRL(DUZ(2),0))#2 S X=$P(^(0),U,3)
I $D(^DISV(DUZ,"^APCHSCTL(")) S Y=^("^APCHSCTL(") I $D(^APCHSCTL(Y,0)) S X=$P(^(0),U,1)
S:X="" X="ADULT REGULAR"
S DIC("B")=X
D ^DIC I Y>0 S APCHSTYP=+Y
K DIE,DA,DR,DD
Q
SELPT ;select patient
K APCHSPAT
K DIC S DIC=9000001,DIC("A")="Select patient: ",DIC(0)="AEQM" D ^DIC
K DIC
Q:$D(DUOUT)
I Y="" G SELPT
I Y>0 S APCHSPAT=+Y
Q:Y<0
Q:$D(DUOUT)
W:$D(^AUPNPAT(APCHSPAT,41,DUZ(2),0)) !,"Patient's chart number is ",$P(^(0),U,2),!
Q
;
END K APCHSTYP,APCHSPAT,POP,X,Y
D EOJ^APCHS
K DA,D0,DFN,APCHHDR
K APCHSCCL,APCHSDCL,APCHSQT
D KILL^AUPNPAT
K DIC,DUOUT
Q
APCHSBRW ; IHS/CMI/LAB - Browse Health Summary ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;This routine allows the user to display a HS using the
+3 ; browse feature.
+4 ;
BROWSE ;EP - called from option BROWSE HEALTH SUMMARY
+1 ;
+2 IF $TEXT(VIEWR^XBLM)=""
WRITE !!!?5,"*** Browser Utility not available!! ***"
QUIT
+3 DO GETTYP
+4 IF '$DATA(APCHSTYP)
GOTO END
+5 DO SELPT
+6 IF '$DATA(APCHSPAT)
GOTO END
+7 ;QUIT IF NO PATIENT
+8 SET DFN=APCHSPAT
+9 SET APCHHDR="PCC Health Summary for "_$PIECE(^DPT(DFN,0),U)
+10 DO VIEWR^XBLM("EN^APCHS",APCHHDR)
+11 DO END
+12 QUIT
+13 ;
GETTYP ; EP - get health summary TYPE
+1 KILL APCHSTYP
+2 KILL DIC
SET DIC=9001015
SET DIC("A")="Select health summary type: "
SET DIC(0)="AEQM"
+3 SET X=""
IF DUZ(2)
IF $DATA(^APCCCTRL(DUZ(2),0))#2
SET X=$PIECE(^(0),U,3)
+4 IF $DATA(^DISV(DUZ,"^APCHSCTL("))
SET Y=^("^APCHSCTL(")
IF $DATA(^APCHSCTL(Y,0))
SET X=$PIECE(^(0),U,1)
+5 IF X=""
SET X="ADULT REGULAR"
+6 SET DIC("B")=X
+7 DO ^DIC
IF Y>0
SET APCHSTYP=+Y
+8 KILL DIE,DA,DR,DD
+9 QUIT
SELPT ;select patient
+1 KILL APCHSPAT
+2 KILL DIC
SET DIC=9000001
SET DIC("A")="Select patient: "
SET DIC(0)="AEQM"
DO ^DIC
+3 KILL DIC
+4 IF $DATA(DUOUT)
QUIT
+5 IF Y=""
GOTO SELPT
+6 IF Y>0
SET APCHSPAT=+Y
+7 IF Y<0
QUIT
+8 IF $DATA(DUOUT)
QUIT
+9 IF $DATA(^AUPNPAT(APCHSPAT,41,DUZ(2),0))
WRITE !,"Patient's chart number is ",$PIECE(^(0),U,2),!
+10 QUIT
+11 ;
END KILL APCHSTYP,APCHSPAT,POP,X,Y
+1 DO EOJ^APCHS
+2 KILL DA,D0,DFN,APCHHDR
+3 KILL APCHSCCL,APCHSDCL,APCHSQT
+4 DO KILL^AUPNPAT
+5 KILL DIC,DUOUT
+6 QUIT