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

APCLOSP5.m

Go to the documentation of this file.
APCLOSP5 ; IHS/CMI/LAB - PRINT INHOSP. SECTION ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
INHOSP ;
 I $Y>(IOSL-10) D HEAD^APCLOSP Q:$D(APCLQUIT)
 W !!,"IN-HOSPITAL VISITS"
 I '$D(^XTMP("APCLOS",APCLJOB,APCLBTH,"INHOSPVCOUNT")),'$D(^XTMP("APCLOSP",APCLJOB,APCLBTH,"INHOSPVCOUNT")) W !?10,"[ NO IN-HOSPITAL VISITS TO REPORT ]",! Q
 S X=$S($D(^XTMP("APCLOS",APCLJOB,APCLBTH,"INHOSPVCOUNT")):^("INHOSPVCOUNT"),1:0),Y=$S($D(^XTMP("APCLOSP",APCLJOB,APCLBTH,"INHOSPVCOUNT")):^("INHOSPVCOUNT"),1:0) D CALC^APCLOSUT
 W !!,"There were a total of ",X," In-Hospital visits (",Z,") during the period for",!,"all visit types, including CHS.",!
 W !,"They are broken down below by Type, Location, Service Category, Clinic,",!,"Provider Discipline and leading Diagnoses.  ",!
TYPE ;
 S APCLPTR=0,APCLT="By Type:",APCL1="INHOSPTYPE",APCL2="INHOSPTYPEC",APCLTOT=0,APCLWC=0
 D PROC Q:$D(APCLQUIT)
LOC ;
 S APCLPTR=1,APCLT="By Location:",APCL1="INHOSPLOC",APCL2="INHOSPLOCC",APCLTOT=0,APCLWC=0,APCLGLOB="^AUTTLOC(",APCLPIEC=2
 D PROC Q:$D(APCLQUIT)
OLOC ;
 S APCLPTR=0,APCLT="By Outside Location:",APCL1="INHOSPOLOC",APCL2="INHOSPOLOCC",APCLTOT=0,APCLLWC=0
 D PROC Q:$D(APCLQUIT)
PROV ;
 S APCLPTR=0,APCLT="By Provider Type (Primary and Secondary Providers):",APCL1="INHOSPPROV",APCL2="INHOSPPROVC",APCLTOT=0,APCLWC=0
 D PROC Q:$D(APCLQUIT)
 D ^APCLOSP6
EOJ ;ENTRY POINT
 K APCL1,APCL2,APCL3,APCLX,APCLTOTO,APCLTOTC,APCLLC,APCLT
 Q
GETLINE ;
 S (APCLX,APCLTOTO,APCLTOTC,APCLLC)=0 F  S APCLX=$O(^XTMP("APCLOS",APCLJOB,APCLBTH,APCL1,APCLX)) Q:APCLX=""  S APCLLC=APCLLC+1,APCLTOTC=^XTMP("APCLOS",APCLJOB,APCLBTH,APCL1,APCLX)+APCLTOTC
 S APCLX=0 F  S APCLX=$O(^XTMP("APCLOSP",APCLJOB,APCLBTH,APCL1,APCLX)) Q:APCLX=""  S APCLTOTO=APCLTOTO+^XTMP("APCLOSP",APCLJOB,APCLBTH,APCL1,APCLX)
 Q
PROC ;
 D GETLINE
 I $Y>(IOSL-9) D HEAD^APCLOSP Q:$D(APCLQUIT)
 W !!?10,APCLT
 S APCLN=0 F  S APCLN=$O(^XTMP("APCLOS",APCLJOB,APCLBTH,APCL2,APCLN)) Q:APCLN=""!($D(APCLQUIT))  D PROC1
 D:APCLTOT=1 TOTAL
 Q
PROC1 ;
 S APCLD=0 F  S APCLD=$O(^XTMP("APCLOS",APCLJOB,APCLBTH,APCL2,APCLN,APCLD)) Q:APCLD=""  D PRNT
 Q
PRNT ;
 I $Y>(IOSL-5) D HEAD^APCLOSP Q:$D(APCLQUIT)  W !?10,APCLT W:APCLWC>0 " (cont.)"
 S X=^XTMP("APCLOS",APCLJOB,APCLBTH,APCL2,APCLN,APCLD),Y=$S($D(^XTMP("APCLOSP",APCLJOB,APCLBTH,APCL1,APCLD)):^(APCLD),1:0) D CALC^APCLOSUT
 I APCLPTR=1 D PRNTPTR Q
 W !?13,APCLD,?45,$J(X,7),?55,"(",Z,")" S APCLWC=APCLWC+1
 Q
PRNTPTR ;
 S G=APCLGLOB_APCLD_")"
 W !?13,$P(@G@(0),U,APCLPIEC),?45,$J(X,7),?55,"(",Z,")" S APCLWC=APCLWC+1
 Q
TOTAL ;
 S X=APCLTOTC,Y=APCLTOTO D CALC^APCLOSUT
 W !?15,"TOTAL:",?45,$J(APCLTOTC,8),?55,"(",Z,")"
 Q