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

APCLSILT.m

Go to the documentation of this file.
  1. APCLSILT ;IHS/CMI/LAB - AGGREGATE ILI REPORT PRINT; ; 10 Oct 2011 7:36 AM
  1. ;;3.0;IHS PCC REPORTS;**24,25,26,27,28,29,30**;FEB 05, 1997;Build 27
  1. C(X,X2,X3) ;
  1. D COMMA^%DTC
  1. Q X
  1. ;
  1. ;
  1. ILISEX ;EP
  1. D HEADER^APCLSILR Q:$D(APCLQUIT)
  1. W "TABLE 2: ILI Diagnoses by Sex"
  1. W !,"This table provides a patient/visit count, by sex, for ILI diagnosis. An ILI"
  1. W !,"diagnosis is defined as a visit with an diagnosis contained in the "
  1. W !,"SURVEILLANCE ILI NO TMP NEEDED taxonomy."
  1. W !," OR"
  1. W !,"a temperature of >=100 AND one of the ICD diagnosis in the SURVEILLANCE ILI"
  1. W !,"taxonomy."
  1. W !!,"An unduplicated count of patients is also provided.",!!,?40,"# patients",?60,"# visits",!
  1. I APCLLOCT="O" G LOCSEX
  1. W !,"ALL FACILITIES COMBINED",!
  1. S APCLSEX="" F S APCLSEX=$O(APCLILIS(APCLSEX)) Q:APCLSEX=""!($D(APCLQUIT)) D
  1. .I $Y>(IOSL-3) D HEADER^APCLSILR Q:$D(APCLQUIT) D SUBHEAD3
  1. .W ?2,APCLSEX,?40,$$C($P(APCLILIS(APCLSEX),U,2),0,7),?60,$$C($P(APCLILIS(APCLSEX),U,1),0,7),!
  1. .Q
  1. Q:$D(APCLQUIT)
  1. W $$REPEAT^XLFSTR("-",79),!
  1. LOCSEX S APCLLOC="" F S APCLLOC=$O(APCLSEXL(APCLLOC)) Q:APCLLOC=""!($D(APCLQUIT)) D
  1. .I $Y>(IOSL-8) D HEADER^APCLSILR Q:$D(APCLQUIT) D SUBHEAD3
  1. .W !!,APCLLOC
  1. .S APCLSEX="" F S APCLSEX=$O(APCLSEXL(APCLLOC,APCLSEX)) Q:APCLSEX=""!($D(APCLQUIT)) D
  1. ..W !?2,APCLSEX,?40,$$C($P(APCLSEXL(APCLLOC,APCLSEX),U,2),0,7),?60,$$C($P(APCLSEXL(APCLLOC,APCLSEX),U,1),0,7),!
  1. .W $$REPEAT^XLFSTR("-",79),!
  1. Q
  1. ILIAVM ;EP - meds
  1. D HEADER^APCLSILR Q:$D(APCLQUIT)
  1. W "TABLE 3: ILI Anti-Viral Medications Dispensed"
  1. W !,"This table provides a count by drug name of the number of visits on which"
  1. W !,"an Anti-Viral Medication was dispensed. Anti-Viral Medications are defined"
  1. W !,"as any medication contained in the FLU ANTIVIRAL MEDS taxonomy or any "
  1. W !,"Medication whose drug name contains OSELTAMIVIR or ZANAMIVIR. An unduplicated"
  1. W !," unduplicated count of patients is also provided.",!,?40,"# patients",?60,"# visits",!
  1. S APCLD="" F S APCLD=$O(APCLMEDS(APCLD)) Q:APCLD=""!($D(APCLQUIT)) D
  1. .I $Y>(IOSL-3) D HEADER^APCLSILR Q:$D(APCLQUIT) D SUBHEAD4
  1. .W ?2,APCLD,?40,$$C($P(APCLMEDS(APCLD),U,2),0,7),?60,$$C($P(APCLMEDS(APCLD),U,1),0,7),!
  1. .Q
  1. Q
  1. SUBHEAD3 ;
  1. W !,"TABLE 2: ILI Diagnoses by Sex",!,?40,"# patients",?60,"# visits",!
  1. Q
  1. SUBHEAD4 ;
  1. W "TABLE 3: ILI Anti-Viral Medications Dispensed",!!,?40,"# patients",?60,"# prescriptions",!
  1. Q
  1. ILIAGEP ;EP
  1. D HEADER^APCLSILR
  1. W "TABLE 4: ILI Diagnoses by Age by Visit"
  1. W !,"This table displays a visit count by age group. Only visits on which "
  1. W !,"there was at least one ILI diagnosis are counted. An ILI diagnosis"
  1. W !,"is defined as a visit with one of the codes in the SURVEILLANCE ILI"
  1. W !,"NO TMP NEEDED taxonomy."
  1. W !," OR"
  1. W !,"a temperature of >=100 AND one of the codes in the SURVEILLANCE ILI"
  1. W !,"taxonomy."
  1. W !,"The visits have to be defined as 'surveillance' visits. The definition "
  1. W !,"of these visits is the following:"
  1. W !," - a Hospitalization"
  1. W !," - a visit to a PHN"
  1. W !," - an Ambulatory visit (service categories A, O, R, S) to one of the "
  1. W !," following clinics: 01 GENERAL, 06 DIABETIC, 10 GYN, 12 IMMUNIZATION,"
  1. W !," 13 INTERNAL MEDICINE, 20 PEDIATRICS, 24 WELL CHILD CARE, "
  1. W !," 28 FAMILY PRACTICE, 30 EMERGENCY ROOM, 57 EPSDT, "
  1. W !," 70 WOMEN'S HEALTH, 80 URGENT CARE, 89 EVENING"
  1. W !!,"Age",?19," 0-4y",?29,"5-24y",?39,"25-49y",?49,"50-64y",?59,"65y+",?69,"TOTAL",!
  1. W !,"Ambulatory ILI"
  1. W ?19,$$C($G(APCLAGEG("I","A","0-4y")),0,7)
  1. W ?29,$$C($G(APCLAGEG("I","A","5-24y")),0,7)
  1. W ?39,$$C($G(APCLAGEG("I","A","25-49y")),0,7)
  1. W ?49,$$C($G(APCLAGEG("I","A","50-64y")),0,7)
  1. W ?59,$$C($G(APCLAGEG("I","A","65y+")),0,7)
  1. W ?69,$$C($G(APCLAGEG("I","A","TOTAL")),0,7),!
  1. W "Diagnosis",!
  1. W $$REPEAT^XLFSTR("-",79),!
  1. ;W !,"Ambulatory"
  1. ;W ?14,$$C($G(APCLAGEG("H","A","6-23m")),0,7)
  1. ;W ?22,$$C($G(APCLAGEG("H","A","24-59m")),0,7)
  1. ;W ?30,$$C($G(APCLAGEG("H","A","60m-18y")),0,7)
  1. ;W ?38,$$C($G(APCLAGEG("H","A","19-24y")),0,7)
  1. ;W ?46,$$C($G(APCLAGEG("H","A","25-49y")),0,7)
  1. ;W ?54,$$C($G(APCLAGEG("H","A","50-64y")),0,7)
  1. ;W ?62,$$C($G(APCLAGEG("H","A","65+y")),0,7)
  1. ;W ?72,$$C($G(APCLAGEG("H","A","TOTAL")),0,7),!
  1. ;W "H1N1 DXS",!
  1. ;W $$REPEAT^XLFSTR("-",79),!
  1. W !,"Hospital ILI"
  1. W ?19,$$C($G(APCLAGEG("I","H","0-4y")),0,7)
  1. W ?29,$$C($G(APCLAGEG("I","H","5-24y")),0,7)
  1. W ?39,$$C($G(APCLAGEG("I","H","25-49y")),0,7)
  1. W ?49,$$C($G(APCLAGEG("I","H","50-64y")),0,7)
  1. W ?59,$$C($G(APCLAGEG("I","H","65y+")),0,7)
  1. W ?69,$$C($G(APCLAGEG("I","H","TOTAL")),0,7),!
  1. W "Diagnosis",!
  1. W $$REPEAT^XLFSTR("-",79),!
  1. ;W !,"Hospital"
  1. ;W ?14,$$C($G(APCLAGEG("H","H","6-23m")),0,7)
  1. ;W ?22,$$C($G(APCLAGEG("H","H","24-59m")),0,7)
  1. ;W ?30,$$C($G(APCLAGEG("H","H","60m-18y")),0,7)
  1. ;W ?38,$$C($G(APCLAGEG("H","H","19-24y")),0,7)
  1. ;W ?46,$$C($G(APCLAGEG("H","H","25-49y")),0,7)
  1. ;W ?54,$$C($G(APCLAGEG("H","H","50-64y")),0,7)
  1. ;W ?62,$$C($G(APCLAGEG("H","H","65+y")),0,7)
  1. ;W ?72,$$C($G(APCLAGEG("H","H","TOTAL")),0,7),!
  1. ;W "H1N1 DXS",!
  1. ;W $$REPEAT^XLFSTR("-",79),!
  1. Q
  1. VACAGEP ;EP
  1. D HEADER^APCLSILR
  1. W "TABLE 5: Seasonal Flu Immunizations by Age by Visit"
  1. W !,"This table displays a count for immunizations by age group. Only visits on"
  1. W !,"which a Seasonal Flu immunization was dispensed are counted. The "
  1. W !,"definition of the immunizations are:"
  1. W !," - Seasonal Flu: Immunization CVX codes 15, 16, 88, 111, 135, 140, 141, 144,"
  1. W !," 149, 151, 153, 155, 158"
  1. W !," CPT 90654-90662, 90672-90673, 90685-90686, 90724, G0008, G8108"
  1. W !," Diagnoses V04.8, V04.81, V06.6"
  1. W !," Procedure: 99.52"
  1. I APCLLOCT="O" G LOCAGE
  1. W !!,"ALL FACILITIES"
  1. W !!,"Age",?14," 6-23m",?22,"24-59m",?30,"60m-18y",?38,"19-24y",?46,"25-49y",?54,"50-64y",?62," 65+y",?72,"TOTAL",!
  1. W !,"Seasonal"
  1. W ?14,$$C($G(APCLIMMG("I","A","6-23m")),0,7)
  1. W ?22,$$C($G(APCLIMMG("I","A","24-59m")),0,7)
  1. W ?30,$$C($G(APCLIMMG("I","A","60m-18y")),0,7)
  1. W ?38,$$C($G(APCLIMMG("I","A","19-24y")),0,7)
  1. W ?46,$$C($G(APCLIMMG("I","A","25-49y")),0,7)
  1. W ?54,$$C($G(APCLIMMG("I","A","50-64y")),0,7)
  1. W ?62,$$C($G(APCLIMMG("I","A","65+y")),0,7)
  1. W ?72,$$C($G(APCLIMMG("I","A","TOTAL")),0,7),!
  1. W "Flu",!
  1. W $$REPEAT^XLFSTR("-",79),!
  1. ;W !,"H1N1"
  1. ;W ?14,$$C($G(APCLIMMG("H","A","6-23m")),0,7)
  1. ;W ?22,$$C($G(APCLIMMG("H","A","24-59m")),0,7)
  1. ;W ?30,$$C($G(APCLIMMG("H","A","60m-18y")),0,7)
  1. ;W ?38,$$C($G(APCLIMMG("H","A","19-24y")),0,7)
  1. ;W ?46,$$C($G(APCLIMMG("H","A","25-49y")),0,7)
  1. ;W ?54,$$C($G(APCLIMMG("H","A","50-64y")),0,7)
  1. ;W ?62,$$C($G(APCLIMMG("H","A","65+y")),0,7)
  1. ;W ?72,$$C($G(APCLIMMG("H","A","TOTAL")),0,7),!
  1. ;W $$REPEAT^XLFSTR("-",79),!
  1. LOCAGE W !
  1. S APCLLOC="" F S APCLLOC=$O(APCLIMML(APCLLOC)) Q:APCLLOC=""!($D(APCLQUIT)) D
  1. .I $Y>(IOSL-14) D HEADER^APCLSILR
  1. .W !!,APCLLOC
  1. .W !!,"Age",?14," 6-23m",?22,"24-59m",?30,"60m-18y",?38,"19-24y",?46,"25-49y",?54,"50-64y",?62," 65+y",?72,"TOTAL",!
  1. .W !,"Seasonal"
  1. .W ?14,$$C($G(APCLIMML(APCLLOC,"I","A","6-23m")),0,7)
  1. .W ?22,$$C($G(APCLIMML(APCLLOC,"I","A","24-59m")),0,7)
  1. .W ?30,$$C($G(APCLIMML(APCLLOC,"I","A","60m-18y")),0,7)
  1. .W ?38,$$C($G(APCLIMML(APCLLOC,"I","A","19-24y")),0,7)
  1. .W ?46,$$C($G(APCLIMML(APCLLOC,"I","A","25-49y")),0,7)
  1. .W ?54,$$C($G(APCLIMML(APCLLOC,"I","A","50-64y")),0,7)
  1. .W ?62,$$C($G(APCLIMML(APCLLOC,"I","A","65+y")),0,7)
  1. .W ?72,$$C($G(APCLIMML(APCLLOC,"I","A","TOTAL")),0,7),!
  1. .W "Flu",!
  1. .W $$REPEAT^XLFSTR("-",79),!
  1. .;W !,"H1N1"
  1. .;W ?14,$$C($G(APCLIMML(APCLLOC,"H","A","6-23m")),0,7)
  1. .;W ?22,$$C($G(APCLIMML(APCLLOC,"H","A","24-59m")),0,7)
  1. .;W ?30,$$C($G(APCLIMML(APCLLOC,"H","A","60m-18y")),0,7)
  1. .;W ?38,$$C($G(APCLIMML(APCLLOC,"H","A","19-24y")),0,7)
  1. .;W ?46,$$C($G(APCLIMML(APCLLOC,"H","A","25-49y")),0,7)
  1. .;W ?54,$$C($G(APCLIMML(APCLLOC,"H","A","50-64y")),0,7)
  1. .;W ?62,$$C($G(APCLIMML(APCLLOC,"H","A","65+y")),0,7)
  1. .;W ?72,$$C($G(APCLIMML(APCLLOC,"H","A","TOTAL")),0,7),!
  1. .;W $$REPEAT^XLFSTR("-",79),!
  1. Q
  1. D HEADER^APCLSILR
  1. W "TABLE 7: Potential Adverse Events"
  1. W !!,"This table contains a tally of all patients who were seen for a"
  1. W !,"diagnosis that may be considered to be an adverse event. Adverse"
  1. W !,"Event diagnoses are:"
  1. W !,"ITP: 287.31"
  1. W !,"2nd TP: 287.4"
  1. W !,"TP: 287.5"
  1. W !,"Bells Palsy: 351.0"
  1. W !,"GBS: 357.0"
  1. W !,"Febrile Seizures Simple: 780.31 < 5 yrs"
  1. W !,"Febrile Seizures Complex: 780.32 < 5 yrs"
  1. I $Y>(IOSL-16) D HEADER^APCLSILR Q:$D(APCLQUIT)
  1. D TAB7SUB
  1. W !,$$REPEAT^XLFSTR("-",79)
  1. W !
  1. I '$D(APCLTAB7) W !!,"There were no visits for adverse events during the time period.",!! Q
  1. F X="ITP: 287.31","2nd TP: 287.4","TP: 287.5","Bells Palsy: 351.0","GBS: 357.0","Febrile Seizures Simple: 780.31 < 5 yrs","Febrile Seizures Complex: 780.32 < 5 yrs" D
  1. .I '$D(APCLTAB7(X,1)) S APCLTAB7(X,1)=0
  1. .I '$D(APCLTAB7(X,0)) S APCLTAB7(X,0)=0
  1. F APCLX="ITP: 287.31","2nd TP: 287.4","TP: 287.5","Bells Palsy: 351.0","GBS: 357.0","Febrile Seizures Simple: 780.31 < 5 yrs","Febrile Seizures Complex: 780.32 < 5 yrs" Q:$D(APCLQUIT) D
  1. .I $L(APCLX)<25 W APCLX
  1. .I $L(APCLX)>24 W $P(APCLX,":",1),!,$P(APCLX,":",2)
  1. .W ?26,$$C($G(APCLTAB7(APCLX,1)),0,7),?46,$$C($G(APCLTAB7(APCLX,0)),0,7)
  1. .W ?66,$$C(($G(APCLTAB7(APCLX,0))+$G(APCLTAB7(APCLX,1))),0,7),!
  1. .W $$REPEAT^XLFSTR("-",79),!
  1. .Q
  1. Q:$D(APCLQUIT)
  1. ;write footer
  1. I $Y>(IOSL-6) D HEADER^APCLSILR Q:$D(APCLQUIT)
  1. W !!,"Note: Follow up investigation is needed to determine if the adverse event"
  1. W !,"could be associated with vaccine adverse events that may be a result of"
  1. W !,"vaccination should be reported to the Vaccine Adverse Event Reporting"
  1. W !,"System (VAERS)."
  1. W !
  1. Q
  1. TAB7SUB ;
  1. W !!,"TABLE 7: Potential Adverse Events"
  1. W !,"Potential Adverse",?26,"Seasonal flu",?46,"No seasonal flu",?66,"Total # of"
  1. W !,"Events",?26,"vaccine in the ",?46,"vaccine in the",?66,"Adverse Events"
  1. W !?26,"60 days prior to",?46,"60 days prior to"
  1. W !?26,"adverse event",?46,"adverse event"
  1. W !,$$REPEAT^XLFSTR("-",79)
  1. W !
  1. Q
  1. TAB8 ;EP - WRITE OUT TABLE 8
  1. D HEADER^APCLSILR
  1. W "TABLE 8: Potential Adverse Events from live virus seasonal Flu vaccine"
  1. W !!,"This table contains a tally of all patients who were seen for a"
  1. W !,"diagnosis that may be considered to be an adverse event after"
  1. W !,"receiving the Seasonal Flu Live Virus vaccine."
  1. W !,"The adverse event diagnoses are:"
  1. W !?5,"Asthma (ICD Codes): 493.0*, 493.9*"
  1. W !?5,"Wheezing (ICD Codes): 786.07"
  1. W !?5,"Influenza (ICD Codes): 488.1 (H1N1)"
  1. W !
  1. I $Y>(IOSL-16) D HEADER^APCLSILR Q:$D(APCLQUIT)
  1. W !,"Potential Adverse",?26,"Live virus vaccine",?46,"No Live virus",?66,"Total # of"
  1. W !,"Events",?26,"(CVX code 111) 14",?46,"vaccine (CVX code",?66,"Adverse Events"
  1. W !?26,"days prior to",?46,"111) 14 days prior"
  1. W !?26,"adverse event",?46,"to adverse event"
  1. W !
  1. W !,$$REPEAT^XLFSTR("-",79)
  1. W !
  1. I '$D(APCLTAB8) W !!,"There were no visits for adverse events during the time period.",!! Q
  1. F X="Asthma","Wheezing","Influenza" D
  1. .I '$D(APCLTAB8(X,1)) S APCLTAB8(X,1)=0
  1. .I '$D(APCLTAB8(X,0)) S APCLTAB8(X,0)=0
  1. S APCLX="" F S APCLX=$O(APCLTAB8(APCLX)) Q:APCLX=""!($D(APCLQUIT)) D
  1. .W APCLX,?26,$$C($G(APCLTAB8(APCLX,1)),0,7),?46,$$C($G(APCLTAB8(APCLX,0)),0,7)
  1. .W ?66,$$C(($G(APCLTAB8(APCLX,1))+$G(APCLTAB8(APCLX,0))),0,7),!
  1. .W $$REPEAT^XLFSTR("-",79),!
  1. .Q
  1. Q:$D(APCLQUIT)
  1. ;write footer
  1. I $Y>(IOSL-6) D HEADER^APCLSILR Q:$D(APCLQUIT)
  1. W !!,"Note: Follow up investigation is needed to determine if the adverse event"
  1. W !,"could be associated with vaccine adverse events that may be a result of"
  1. W !,"vaccination should be reported to the Vaccine Adverse Event Reporting"
  1. W !,"System (VAERS)."
  1. W !
  1. Q
  1. TAB8SUB ;
  1. W "TABLE 8: Potential Adverse Events Related to H1N1 Live Virus"
  1. W !,"Adverse",?40,"Patients who received"
  1. W !,"Events",?40,"H1N1 Live"
  1. W !?40,"Nasal Vaccine"
  1. W !,$$REPEAT^XLFSTR("-",79)
  1. W !
  1. Q
  1. TAB9 ;EP - WRITE OUT TABLE 7
  1. Q ;table 9 taken out in patch 27
  1. D HEADER^APCLSILR
  1. W "TABLE 9: Adverse Events without an ILI / H1N1 vaccination"
  1. W !!,"This table contains a tally of all patient visits during the time"
  1. W !,"period ",$$FMTE^XLFDT(APCLBD)," to ",$$FMTE^XLFDT(APCLED)
  1. W !,"where a potential ILI or H1N1 adverse event is diagnosed for a "
  1. W !,"patient that does not have a documented H1N1 or ILI vaccination. "
  1. W !,"These adverse events diagnoses are:"
  1. W !?5,"Thrombocytopenia (ICD Codes): 287.31; 287.4; 287.5"
  1. W !?5,"Encephalitis/Myelitis (ICD Codes): 323.5; 323.51; 323.52; 323.6; 323.61;"
  1. W !?10,"323.62; 323.63; 323.8; 323.81; 323.82; 323.9; 341.2"
  1. W !?10,"Neuritis (ICD Codes): 351.0; 357.0; specifically Bell's palsy,"
  1. W !?10,"Guillain-Barre' syndrome, postinfectious polyneuritis"
  1. W !?5,"Optic Neuritis (ICD Codes): 377.30; 377.31; 377.32; 377.39"
  1. W !?5,"Anaphylactic Shock (ICD Codes): 995.0; 999.4"
  1. W !?5,"Other diagnosis in the SURVEILLANCE ADV EV NO H1N1 taxonomy: 798*; 674.90;"
  1. W !?10,"674.92; 674.94;"
  1. W !,"When finding the date of the most recent H1N1 vaccine, the search starts"
  1. W !,"on the 1st of June prior to the end date selected by the user. If the"
  1. W !,"patient does not have a documented H1N1 vaccine after June 1 it is "
  1. W !,"assumed that they did not have a vaccination this 'flu season'."
  1. I $Y>(IOSL-16) D HEADER^APCLSILR Q:$D(APCLQUIT)
  1. W !,"Diagnosis or",?40,"No ILI or H1N1 Vaccination"
  1. W !,"Conditions",?40,"# visits"
  1. W !,$$REPEAT^XLFSTR("-",79)
  1. W !
  1. F X="Thrombocytopenia","Anaphylactic Shock","Sudden Death","Optic Neuritis","Encephalitis/Myelitis" D
  1. .I '$D(APCLTAB9(X)) S APCLTAB9(X)=0
  1. S APCLX="" F S APCLX=$O(APCLTAB9(APCLX)) Q:APCLX=""!($D(APCLQUIT)) D
  1. .W APCLX,?40,$$C($G(APCLTAB9(APCLX)),0,7),!,!
  1. .W $$REPEAT^XLFSTR("-",79),!
  1. .Q
  1. Q
  1. TAB9SUB ;
  1. W "TABLE 9: Adverse Events without an ILI / H1N1 vaccination"
  1. W !,"Diagnosis or",?40,"No ILI or H1N1 Vaccination"
  1. W !,"Conditions",?40,"# visits"
  1. W !,$$REPEAT^XLFSTR("-",79)
  1. W !
  1. Q