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