[613] | 1 | ECXWRD ;BIR/CML,ALB/JAP Print Active Wards for Fiscal Year ; Nov 25,1996
|
---|
| 2 | ;;3.0;DSS EXTRACTS;**2,8**;Dec 22, 1997
|
---|
| 3 | ;
|
---|
| 4 | EN ;entry point from option
|
---|
| 5 | N DATE,YR,MON,FY,POP,ZTSK
|
---|
| 6 | D NOW^%DTC S DATE=$$FMTE^XLFDT(%,"5D"),YR=+$P(DATE,"/",3),MON=+$P(DATE,"/",1),FY=$S(MON<10:YR,1:YR+1)
|
---|
| 7 | W !!,"This option prints a list of all MAS wards that were active at any time"
|
---|
| 8 | W !,"during FY",FY,". The list is sorted by Medical Center Division and displays"
|
---|
| 9 | W !,"the pointer to the Hospital Location file (#44) and DSS Department data"
|
---|
| 10 | W !,"if available."
|
---|
| 11 | W !!,"This report requires a print width of 132 characters.",!!
|
---|
| 12 | S ECXPGM="START^ECXWRD",ECXDESC="DSS-Print Active Wards for Fiscal Year",ECXSAVE("FY")=""
|
---|
| 13 | W ! D DEVICE^ECXUTLA(ECXPGM,ECXDESC,.ECXSAVE)
|
---|
| 14 | I ECXSAVE("POP")=1 D Q
|
---|
| 15 | .W !,"No device selected... try again later.!!"
|
---|
| 16 | I ECXSAVE("ZTSK")=0 U IO D START^ECXWRD
|
---|
| 17 | I IO'=IO(0) D ^%ZISC
|
---|
| 18 | D HOME^%ZIS
|
---|
| 19 | K ECXSAVE,ECXPGM,ECXDESC
|
---|
| 20 | K ECXDIVN,ECFYB,ECFYE,ECXWD,ECXWDN,ECXDEPT,ECXDESC,FY,^TMP("ECXWRD",$J)
|
---|
| 21 | Q
|
---|
| 22 | START ;
|
---|
| 23 | N QFLG,%,%H,%I,JJ,SS,HDT,DATA
|
---|
| 24 | K ^TMP("ECXWRD",$J)
|
---|
| 25 | S ECXFY=FY-1700
|
---|
| 26 | S ECFYB=ECXFY-1_"1000",ECFYE=ECXFY_"1001"
|
---|
| 27 | ;gather data
|
---|
| 28 | S ECXWD=0
|
---|
| 29 | F S ECXWD=$O(^DIC(42,ECXWD)) Q:'ECXWD I $D(^DIC(42,ECXWD,0)) D
|
---|
| 30 | .S EC=^DIC(42,ECXWD,0) D CHK Q:X=1
|
---|
| 31 | .S DR=".01;.03;.015;.017;44",DIQ(0)="IE",DIQ="ECX",DA=ECXWD,DIC="^DIC(42," K ECX D EN^DIQ1
|
---|
| 32 | .S ECXWDN=$G(ECX(42,ECXWD,.01,"E"))
|
---|
| 33 | .S ECXDIVN=$G(ECX(42,ECXWD,.015,"E")) S:ECXDIVN="" ECXDIVN="UNKNOWN"
|
---|
| 34 | .S ^TMP("ECXWRD",$J,ECXDIVN,ECXWDN)=$G(ECX(42,ECXWD,44,"I"))_U_$G(ECX(42,ECXWD,.03,"E"))_U_$G(ECX(42,ECXWD,.017,"E"))_U
|
---|
| 35 | .I $D(^ECX(727.4,ECXWD)) D
|
---|
| 36 | ..S ECXDEPT=$P(^ECX(727.4,ECXWD,0),U,2) Q:ECXDEPT=""
|
---|
| 37 | ..D REVERSE^ECXDSSD(ECXDEPT,.ECXDESC)
|
---|
| 38 | ..S ^TMP("ECXWRD",$J,ECXDIVN,ECXWDN)=^TMP("ECXWRD",$J,ECXDIVN,ECXWDN)_ECXDEPT_U_ECXDESC
|
---|
| 39 | ;print the report
|
---|
| 40 | S (PG,QFLG)=0,$P(LN,"-",130)="" D NOW^%DTC S Y=$E(%,1,12) X ^DD("DD") S HDT=Y
|
---|
| 41 | D HDR
|
---|
| 42 | I '$D(^TMP("ECXWRD",$J)) W !!,"NO DATA FOUND FOR THIS REPORT" Q
|
---|
| 43 | S ECXDIVN=""
|
---|
| 44 | F S ECXDIVN=$O(^TMP("ECXWRD",$J,ECXDIVN)) Q:ECXDIVN="" Q:QFLG D
|
---|
| 45 | .D:$Y+4>IOSL HDR Q:QFLG
|
---|
| 46 | .W !!,"DIVISION: ",ECXDIVN S ECXWDN="" D
|
---|
| 47 | ..F S ECXWDN=$O(^TMP("ECXWRD",$J,ECXDIVN,ECXWDN)) Q:ECXWDN="" Q:QFLG D
|
---|
| 48 | ...S DATA=^TMP("ECXWRD",$J,ECXDIVN,ECXWDN),ECXDEPT=$P(DATA,U,4)
|
---|
| 49 | ...D:$Y+4>IOSL HDR Q:QFLG W !?5,$E(ECXWDN,1,20),?30,ECXDEPT,?45,$P(DATA,U,1),?60,$E($P(DATA,U,2),1,18),?80,$P(DATA,U,3)
|
---|
| 50 | ...Q:ECXDEPT=""
|
---|
| 51 | ...D:$Y+4>IOSL HDR Q:QFLG
|
---|
| 52 | ...W !?30,"[Svc: "_$E($P(DATA,U,5),1,20)_" "_"Prod. Unit: "_$E($P(DATA,U,6),1,40)_" "_"Div: "_$P(DATA,U,7)_"]",!
|
---|
| 53 | I $E(IOST)="C"&('QFLG) S DIR(0)="E" D D ^DIR K DIR
|
---|
| 54 | .S SS=22-$Y F JJ=1:1:SS W !
|
---|
| 55 | W:$E(IOST)'="C" @IOF D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
|
---|
| 56 | K ECXDIVN,ECFYB,ECFYE,ECXWD,ECXWDN,ECXDEPT,ECXDESC,FY,^TMP("ECXWRD",$J)
|
---|
| 57 | Q
|
---|
| 58 | ;
|
---|
| 59 | CHK ;has this ward been active?
|
---|
| 60 | ; output
|
---|
| 61 | ; X = 1 if inactive (out-of-service), 0 otherwise
|
---|
| 62 | ;
|
---|
| 63 | N ECX,ECY
|
---|
| 64 | S X=1 Q:'$D(ECXWD) S ECY=ECFYB
|
---|
| 65 | I '$O(^DIC(42,ECXWD,"OOS",0)) S X=0 Q
|
---|
| 66 | S ECX=+$O(^DIC(42,ECXWD,"OOS","AINV",9999998.9-ECY)),ECX=$S($D(^DIC(42,ECXWD,"OOS",+$O(^(+ECX,0)),0)):^(0),1:"")
|
---|
| 67 | I '$P(ECX,U,6) S X=0 Q
|
---|
| 68 | I $P(ECX,U,6),'$P(ECX,U,4) S X=1 Q
|
---|
| 69 | I $P(ECX,U,6),$P(ECX,U,4)<ECFYE S X=0 Q
|
---|
| 70 | S X=1
|
---|
| 71 | Q
|
---|
| 72 | ;
|
---|
| 73 | HDR ;header and page control
|
---|
| 74 | I $E(IOST)="C" S SS=22-$Y F JJ=1:1:SS W !
|
---|
| 75 | I $E(IOST)="C",PG>0 S DIR(0)="E" W ! D ^DIR K DIR I 'Y S QFLG=1 Q
|
---|
| 76 | S PG=PG+1 W:$Y!($E(IOST)="C") @IOF W !,"Active Wards for FY",FY,!,"Printed on ",HDT,!
|
---|
| 77 | W !?30,"DSS",?45,"Pointer",?60,"Ward",?80,"Ward"
|
---|
| 78 | W !?5,"WARD",?30,"Department",?45,"to File #44",?60,"Service",?80,"Specialty"
|
---|
| 79 | W !,LN
|
---|
| 80 | Q
|
---|