source: WorldVistAEHR/trunk/r/ICR_IMMUNOLOGY_CASE_REGISTRY-IMR/IMRPNEU1.m@ 1006

Last change on this file since 1006 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1IMRPNEU1 ;;HCIOFO/FT-Pneumococcal Immunization Rpt ;(cont.) 1/20/98 11:33
2 ;;2.1;IMMUNOLOGY CASE REGISTRY;;Feb 09, 1998
3 ; show all living ICR patients who have not had a pneumococcal
4 ; vaccination in the last 5 years
5 I '$D(^XUSEC("IMRA",DUZ)) S IMRLOC="IMRPNEUM" D ACESSERR^IMRERR,H^XUS K IMRLOC
6 ; select device
7 D IMRDEV^IMREDIT I POP D KILL^IMRPNEUM Q
8 I $D(IO("Q")) D D KILL^IMRPNEUM Q
9 .S ZTRTN="START^IMRPNEU1",ZTDESC="Immunology No Pneumo-Vac Report",ZTIO=ION_";"_IOM_";"_IOSL
10 .D ^%ZTLOAD
11 .K ZTRTN,ZTDESC,ZTSK,ZTIO,ZTSAVE
12 .Q
13START ; start report
14 U IO K ^TMP($J)
15 S (IMRCNT,IMRDFN,IMRPG,IMRUT)=0,IMRLINE=$$REPEAT^XLFSTR("-",79)
16 S IMR5YR=DT-50000 ;calculate date of 5 years ago
17 D GETNOW^IMRACESS ;get the current date/time
18 D HDR
19 S X="PXRHS03" X ^%ZOSF("TEST")
20 I '$T D NODATA^IMRPNEUM,EOP^IMRPNEUM,KILL^IMRPNEUM Q
21 F S IMRDFN=$O(^IMR(158,IMRDFN)) Q:'IMRDFN D
22 .Q:$P($G(^IMR(158,IMRDFN,5)),U,19)>0 ;quit if patient is dead
23 .S X=+^IMR(158,IMRDFN,0) D ^IMRXOR
24 .I $D(^DPT(X,0)) D A1
25 .Q
26 I '$D(^TMP($J)) D NODATA^IMRPNEUM,EOP^IMRPNEUM,KILL^IMRPNEUM Q
27 S IMRNAME=""
28 F S IMRNAME=$O(^TMP($J,IMRNAME)) Q:IMRNAME=""!(IMRUT) S IMRDFN=0 F S IMRDFN=$O(^TMP($J,IMRNAME,IMRDFN)) Q:'IMRDFN!(IMRUT) D
29 .I ($Y+4)>IOSL D EOP^IMRPNEUM Q:IMRUT D HDR
30 .S IMRNODE=$G(^TMP($J,IMRNAME,IMRDFN))
31 .S IMRSSN=$P(IMRNODE,U,1),IMRVISIT=$P(IMRNODE,U,2)
32 .W !,IMRNAME,?32,IMRSSN,?50,$$FMTE^XLFDT(IMRVISIT,"1D")
33 .Q
34 W !!,"Total: ",IMRCNT
35 D:'IMRUT EOP^IMRPNEUM
36 S:$D(ZTQUEUED) ZTREQ="@"
37KILL ; kill variables
38 D KILL^IMRPNEUM
39 Q
40A1 ; get data from PCE utility
41 K ^TMP("PXI",$J) S IMR1=X
42 D IMMUN^PXRHS03(IMR1)
43 S IMRLOOP=+$O(^TMP("PXI",$J,"PNEUMO-VAC",0))
44 S IMRLOOP(1)=+$O(^TMP("PXI",$J,"PNEUMO-VAC",IMRLOOP,0))
45 S IMRVISIT=$P($G(^TMP("PXI",$J,"PNEUMO-VAC",IMRLOOP,IMRLOOP(1),0)),U,3)
46 I 'IMRVISIT!(IMRVISIT<IMR5YR) D
47 .S IMRNODE=$G(^DPT(IMR1,0))
48 .S:IMRVISIT="" IMRVISIT="None on file"
49 .S IMRNAME=$P(IMRNODE,U,1),IMRSSN=$P(IMRNODE,U,9)
50 .S ^TMP($J,IMRNAME,IMRDFN)=IMRSSN_U_IMRVISIT
51 .S IMRCNT=IMRCNT+1
52 .Q
53 Q
54HDR ; report header
55 W:$Y>0 @IOF
56 S IMRPG=IMRPG+1
57 W !?25,"5 YEAR PNEUMOCOCCAL VACCINATION WARNING",?70,"Page ",IMRPG
58 W !?25,"Run Date: ",IMRDTE
59 W !,"NAME",?32,"SSN",?50,"LAST PNEUMO-VAC DATE"
60 W !,IMRLINE
61 Q
Note: See TracBrowser for help on using the repository browser.