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

APCLCH1S.m

Go to the documentation of this file.
APCLCH1S ; IHS/CMI/LAB - community health profile print ;
 ;;2.0;IHS PCC SUITE;**10,11**;MAY 14, 2009;Build 58
 ;
 ;cmi/anch/maw 9/10/2007 code set versioning in TOP5INJ
 ;
SETV ;EP
 S:'$D(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"AGE DIST","F")) ^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"AGE DIST","F")="0^0^0^0^0^0^0^0^0^0^0"
 S:'$D(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"AGE DIST","M")) ^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"AGE DIST","M")="0^0^0^0^0^0^0^0^0^0^0"
 S:'$D(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"AGE DIST","U")) ^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"AGE DIST","U")="0^0^0^0^0^0^0^0^0^0^0"
 S:'$D(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"LIVREG")) ^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"LIVREG")=0
 S:'$D(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"HADHC")) ^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"HADHC")=0
 S:'$D(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"BIRTHS")) ^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"BIRTHS")=0
 S:'$D(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"DEATHS")) ^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"DEATHS")=0
 S:'$D(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"MCRA")) ^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"MCRA")=0
 S:'$D(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"MCRB")) ^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"MCRB")=0
 S:'$D(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"MCD")) ^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"MCD")=0
 S:'$D(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"PI")) ^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"PI")=0
 Q
EN ;EP - called from apclch1p
TOP5INJ ;
 I $Y>(IOSL-6) D HEAD^APCLCH1P Q:$D(APCLQUIT)
 W !!!?5,"The Top 10 Causes of Injury were:",!
 W !?5,APCLCOM,?43,$E($P(^AUTTSU(APCLSU,0),U),1,25)," Service Unit",!
 W ?5,$TR($J("",$L(APCLCOM))," ","-"),?43,$TR($J("",33)," ","-"),!
 K APCLR S (APCLX,C)=0 F  S APCLX=$O(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"REPORT","INJC",APCLX)) Q:APCLX=""!(C>10)  D
 .;S APCLY=0 F  S APCLY=$O(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"REPORT","INJC",APCLX,APCLY)) Q:APCLY'=+APCLY  S C=C+1,APCLR(C)=$E($P(^ICD9(APCLY,0),U,3),1,25)_"^"_^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"REPORT","INJC",APCLX,APCLY)
 .;cmi/anch/maw 9/10/2007 split lines below and added csv due to line length
 .S APCLY=0 F  S APCLY=$O(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"REPORT","INJC",APCLX,APCLY)) Q:APCLY'=+APCLY  D
 ..S C=C+1,APCLR(C)=$E($P($$ICDDX^ICDEX(APCLY),U,4),1,25)_"^"_^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"REPORT","INJC",APCLX,APCLY)
 K APCLS S (APCLX,C)=0 F  S APCLX=$O(^XTMP("APCLCH1",APCLJOB,APCLBTH,"SU","INJC",APCLX)) Q:APCLX=""!(C>10)  D
 .;S APCLY=0 F  S APCLY=$O(^XTMP("APCLCH1",APCLJOB,APCLBTH,"SU","INJC",APCLX,APCLY)) Q:APCLY'=+APCLY  S C=C+1,APCLS(C)=$E($P(^ICD9(APCLY,0),U,3),1,25)_"^"_^XTMP("APCLCH1",APCLJOB,APCLBTH,"SU","INJC",APCLX,APCLY)
 .S APCLY=0 F  S APCLY=$O(^XTMP("APCLCH1",APCLJOB,APCLBTH,"SU","INJC",APCLX,APCLY)) Q:APCLY'=+APCLY  S C=C+1,APCLS(C)=$E($P($$ICDDX^ICDEX(APCLY),U,4),1,25)_"^"_^XTMP("APCLCH1",APCLJOB,APCLBTH,"SU","INJC",APCLX,APCLY)
 S (APCLX,APCLC)=0 F  S APCLX=$O(APCLR(APCLX)) Q:APCLX'=+APCLX!($D(APCLQUIT))  D
 .I $Y>(IOSL-4) D HEAD^APCLCH1P Q:$D(APCLQUIT)  W !,"Top 10 causes of injury (cont.)",!
  .W !?5,$P(APCLR(APCLX),U),?32,"(",$P(APCLR(APCLX),U,2),")" S APCLC=APCLX I $D(APCLS(APCLX)) W ?43,$P(APCLS(APCLX),U),?70,"(",$P(APCLS(APCLX),U,2),")"
 S APCLX=C F  S APCLX=$O(APCLS(APCLX)) Q:APCLX'=+APCLX!($D(APCLQUIT))  D
 .I $Y>(IOSL-4) D HEAD^APCLCH1P Q:$D(APCLQUIT)  W !,"Top 10 causes of injury (cont.)",!
 .W !?43,$P(APCLS(APCLX),U),?70,"(",$P(APCLS(APCLX),U,2),")"
TOP5DENT ;
 I $Y>(IOSL-6) D HEAD^APCLCH1P Q:$D(APCLQUIT)
 W !!!?5,"The Top Dental Services were:",!
 W !?5,APCLCOM,?43,$E($P(^AUTTSU(APCLSU,0),U),1,25)," Service Unit",!
 W ?5,$TR($J("",$L(APCLCOM))," ","-"),?43,$TR($J("",33)," ","-"),!
 K APCLR S (APCLX,C)=0 F  S APCLX=$O(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"REPORT","DENTALC",APCLX)) Q:APCLX=""!(C>10)  D
 .S APCLY=0 F  S APCLY=$O(^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"REPORT","DENTALC",APCLX,APCLY)) Q:APCLY'=+APCLY  D
 ..S C=C+1,APCLR(C)=$E($P(^AUTTADA(APCLY,0),U,2),1,25)_"^"_^XTMP("APCLCH1",APCLJOB,APCLBTH,"RP",APCLCOM,"REPORT","DENTALC",APCLX,APCLY)
 K APCLS S (APCLX,C)=0 F  S APCLX=$O(^XTMP("APCLCH1",APCLJOB,APCLBTH,"SU","DENTALC",APCLX)) Q:APCLX=""!(C>10)  D
 .S APCLY=0 F  S APCLY=$O(^XTMP("APCLCH1",APCLJOB,APCLBTH,"SU","DENTALC",APCLX,APCLY)) Q:APCLY'=+APCLY  S C=C+1,APCLS(C)=$E($P(^AUTTADA(APCLY,0),U,2),1,25)_"^"_^XTMP("APCLCH1",APCLJOB,APCLBTH,"SU","DENTALC",APCLX,APCLY)
 S (APCLX,APCLC)=0 F  S APCLX=$O(APCLR(APCLX)) Q:APCLX'=+APCLX!($D(APCLQUIT))  D
 .I $Y>(IOSL-4) D HEAD^APCLCH1P Q:$D(APCLQUIT)  W !,"Top 10 dental services (cont.)",!
  .W !?5,$P(APCLR(APCLX),U),?32,"(",$P(APCLR(APCLX),U,2),")" S APCLC=APCLX I $D(APCLS(APCLX)) W ?43,$P(APCLS(APCLX),U),?70,"(",$P(APCLS(APCLX),U,2),")"
 S APCLX=C F  S APCLX=$O(APCLS(APCLX)) Q:APCLX'=+APCLX!($D(APCLQUIT))  D
 .I $Y>(IOSL-4) D HEAD^APCLCH1P Q:$D(APCLQUIT)  W !,"Top 10 dental services (cont.)",!
 .W !?43,$P(APCLS(APCLX),U),?70,"(",$P(APCLS(APCLX),U,2),")"
 Q