source: WorldVistAEHR/trunk/r/ICR_IMMUNOLOGY_CASE_REGISTRY-IMR/IMRPNEUM.m@ 1306

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1IMRPNEUM ;;HCIOFO/FT/SPS-Pneumococcal Immunization Report ;05/12/00 16:24
2 ;;2.1;IMMUNOLOGY CASE REGISTRY;**5**;Feb 09, 1998
3 ; check security of user
4 I '$D(^XUSEC("IMRA",DUZ)) S IMRLOC="IMRPNEUM" D ACESSERR^IMRERR,H^XUS K IMRLOC
5 K DIR
6 S DIR("A")="Select the report you want"
7 S DIR(0)="S^1:PNEUMO-VAC FOR A DATE RANGE;2:NO PNEUMO-VAC IN 5 YEARS"
8 S DIR("?",1)="The 'PNEUMO-VAC FOR A DATE RANGE' report will list all ICR patients who had"
9 S DIR("?",2)="a pneumococcal vaccination within the date range selected by the user."
10 S DIR("?",3)=" "
11 S DIR("?",4)="The 'NO PNEUMO-VAC IN 5 YEARS' report will list living ICR patients who have"
12 S DIR("?",5)="no record of a pneumococcal vaccination in the last 5 years."
13 S DIR("?",6)=" "
14 S DIR("?")="Please select the pneumococcal vaccination output you want."
15 D ^DIR K DIR
16 I $D(DIRUT) D KILL Q
17 I Y=2 D ^IMRPNEU1 Q ;no pneumo-vac in 5 years report
18 ; select start/stop dates
19ASK D ^IMRDATE Q:$G(IMRHNBEG)=""
20 S IMRSD=IMRHNBEG,IMRED=IMRHNEND
21 ; select device
22 D IMRDEV^IMREDIT I POP D KILL Q
23 I $D(IO("Q")) D D KILL Q
24 .S ZTRTN="START^IMRPNEUM",ZTDESC="Immunology Pneumococcal Report",ZTIO=ION_";"_IOM_";"_IOSL
25 .S ZTSAVE("IMRED")="",ZTSAVE("IMRSD")=""
26 .D ^%ZTLOAD
27 .K ZTRTN,ZTDESC,ZTSK,ZTIO,ZTSAVE
28 .Q
29START ; start report
30 U IO K ^TMP($J)
31 S (IMRCNT,IMRDFN,IMRPG,IMRUT)=0,IMRLINE=$$REPEAT^XLFSTR("-",79)
32 D GETNOW^IMRACESS ;get the current date/time
33 D HDR
34 S X="PXRHS03" X ^%ZOSF("TEST")
35 I '$T D NODATA,EOP,KILL Q
36 F S IMRDFN=$O(^IMR(158,IMRDFN)) Q:'IMRDFN S X=+^IMR(158,IMRDFN,0) D ^IMRXOR I $D(^DPT(X,0)) D A1
37 I '$D(^TMP($J)) D NODATA,EOP,KILL Q
38 S IMRNAME=""
39 F S IMRNAME=$O(^TMP($J,IMRNAME)) Q:IMRNAME=""!(IMRUT) S IMRDFN=0 F S IMRDFN=$O(^TMP($J,IMRNAME,IMRDFN)) Q:'IMRDFN!(IMRUT) S IMRVDATE=0 F S IMRVDATE=$O(^TMP($J,IMRNAME,IMRDFN,IMRVDATE)) Q:'IMRVDATE!(IMRUT) D
40 .I ($Y+4)>IOSL D EOP Q:IMRUT D HDR
41 .S IMRSSN=$P(^TMP($J,IMRNAME,IMRDFN,IMRVDATE),U,1)
42 .W !,IMRNAME,?32,IMRSSN,?50,$$FMTE^XLFDT(IMRVDATE,"1D")
43 .Q
44 W !!,"Total: ",IMRCNT
45 D:'IMRUT EOP
46 S:$D(ZTQUEUED) ZTREQ="@"
47KILL ; kill variables
48 K ^TMP($J),^TMP("PXI",$J),DIR,DIROUT,DIRUT,DTOUT,DUOUT,I
49 K IMR1,IMR2,IMR3,IMR5YR,IMRCNT,IMRDFN,IMRDTE,IMRED,IMRFLG,IMRLINE,IMRLOOP,IMRNAME,IMRNODE,IMRPG,IMRSD,IMRSSN,IMRSTN,IMRUT,IMRVDATE,IMRVISIT
50 K X,Y
51 D ^%ZISC
52 Q
53A1 ; get data from PCE utility
54 S IMRNODE=$G(^DPT(+X,0))
55 S IMRNAME=$P(IMRNODE,U,1),IMRSSN=$P(IMRNODE,U,9)
56 K ^TMP("PXI",$J)
57 D IMMUN^PXRHS03(+X)
58 Q:'$D(^TMP("PXI",$J))
59 S IMRLOOP=0
60 F S IMRLOOP=$O(^TMP("PXI",$J,"PNEUMO-VAC",IMRLOOP)) Q:'IMRLOOP S IMRLOOP(1)=0 F S IMRLOOP(1)=$O(^TMP("PXI",$J,"PNEUMO-VAC",IMRLOOP,IMRLOOP(1))) Q:'IMRLOOP(1) D
61 .S IMRVISIT=$P($G(^TMP("PXI",$J,"PNEUMO-VAC",IMRLOOP,IMRLOOP(1),0)),U,3)
62 .Q:'IMRVISIT
63 .Q:IMRVISIT<IMRSD
64 .Q:IMRVISIT>IMRED
65 .S ^TMP($J,IMRNAME,IMRDFN,IMRVISIT)=IMRSSN,IMRCNT=IMRCNT+1
66 .Q
67 Q
68HDR ; report header
69 W:$Y>0 @IOF
70 S IMRPG=IMRPG+1
71 W !?25,"PNEUMOCOCCAL VACCINATION REPORT",?70,"Page ",IMRPG
72 W !?25,"From "_$$FMTE^XLFDT(IMRSD,"1D")_" to "_$$FMTE^XLFDT(IMRED,"1D")
73 W !?25,"Run Date: ",IMRDTE
74 W !,"NAME",?32,"SSN",?50,"DATE"
75 W !,IMRLINE
76 Q
77EOP ; end of page question
78 Q:$D(IO("S"))
79 I IOST["C-" K DIR W ! S DIR(0)="E" D ^DIR K DIR I 'Y S IMRUT=1
80 Q
81NODATA ; no data message
82 W !,"There was no data for this report."
83 Q
Note: See TracBrowser for help on using the repository browser.