source: WorldVistAEHR/trunk/r/DSS_EXTRACTS-ECX/ECXDIVIV.m@ 1764

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

revised back to 6/30/08 version

File size: 2.9 KB
Line 
1ECXDIVIV ;BIR/CML-Enter/Edit and Print IV Room Division ; [ 11/15/96 11:12 AM ]
2 ;;3.0;DSS EXTRACTS;**8**;Dec 22, 1997
3 ;
4ED ;enter/edit division field for iv rooms
5 N CHKFLG,DIC,DIE,DA,DR
6 W !!,"This option allows editing of the DIVISION field for IV Rooms.",!
7 S CHKFLG=0,OUT=0
8 D CHK Q:CHKFLG
9 F D Q:OUT
10 .W ! S DIC=59.5,DIC(0)="QEAMZ" D ^DIC
11 .I Y<0 S OUT=1 Q
12 .I $G(^PS(59.5,+Y,"I"))]"" W " *INACTIVE*",$C(7)
13 .S DIE=DIC,DA=+Y
14 .S DR=.02 D ^DIE K DA
15 Q
16 ;
17PRT ;print worksheet
18 W !!,"This option will produce a worksheet listing all entries in the IV Room file"
19 W !,"(#59.5). It should be used to help DSS and Pharmacy services define and"
20 W !,"review the DIVISION assignments for each IV Room.",!! S QFLG=0
21 S QFLG=0,CHKFLG=0
22 D CHK Q:CHKFLG
23 D EN^XUTMDEVQ("START^ECXDIVIV","DSS - IV Room List")
24 I POP D
25 .W !,"NO DEVICE SELECTED OR REPORT PRINTED!!"
26 .D PAUSE
27 Q
28 ;
29START ;queued entry point
30 N CHKFLG,DIV,DIVNM,INACT,IV,IVRM,JJ,LN1,LN2,PDT,PG,QFLG,SS,X,Y
31 I '$D(DT) S DT=$$HTFM^XLFDT(+$H)
32 K ^TMP("ECXDIVIV",$J) S QFLG=0,IV=0
33 F S IV=$O(^PS(59.5,IV)) Q:'IV I $D(^PS(59.5,IV,0)) D
34 .S IVRM=$E($P(^PS(59.5,IV,0),U),1,30),DIV=$P(^(0),U,4)
35 .S DIVNM=$S(DIV="":"ZZZ",1:$E($P(^DG(40.8,DIV,0),U),1,30))
36 .K INACT I $P($G(^PS(59.5,IV,"I")),U)]"" S INACT=$$FMTE^XLFDT($P(^PS(59.5,IV,"I"),U),1)
37 .S ^TMP("ECXDIVIV",$J,DIVNM,IVRM)=$S($D(INACT):INACT,1:"")
38 ;print report
39 S PG=0,PDT=$$FMTE^XLFDT(DT),$P(LN1,"-",81)="",$P(LN2,"_",30)=""
40 D HDR
41 I '$D(^TMP("ECXDIVIV",$J)) W !!,"No Data found for this worksheet."
42 I $D(^TMP("ECXDIVIV",$J)) S DIVNM="" D
43 .F S DIVNM=$O(^TMP("ECXDIVIV",$J,DIVNM)) Q:DIVNM="" Q:QFLG D
44 ..S IVRM=""
45 ..F S IVRM=$O(^TMP("ECXDIVIV",$J,DIVNM,IVRM)) Q:IVRM="" Q:QFLG D
46 ...S INACT=^TMP("ECXDIVIV",$J,DIVNM,IVRM)
47 ...D:$Y+4>IOSL HDR Q:QFLG
48 ...W !!,IVRM,?34,$S(DIVNM="ZZZ":LN2,1:DIVNM),?60,INACT
49 I $E(IOST)="C"&('QFLG) D PAUSE
50 K ^TMP("ECXDIVIV",$J) S:$D(ZTQUEUED) ZTREQ="@"
51 W:$E(IOST)'="C" @IOF
52 D ^%ZISC
53 Q
54 ;
55HDR ;header
56 I $E(IOST)="C" S SS=22-$Y F JJ=1:1:SS W !
57 I $E(IOST)="C",PG>0 S DIR(0)="E" W ! D ^DIR K DIR I 'Y S QFLG=1
58 Q:QFLG
59 S PG=PG+1 W:$Y!($E(IOST)="C") @IOF
60 W !,"IV Room Worksheet",?72,"Page: ",PG,!,"Printed ",PDT
61 W !!,"IV ROOM",?34,"DIVISION",?60,"INACTIVE DATE",!,LN1
62 Q
63 ;
64CHK ;check for existence of necessary files for division functionality
65 S CHKFLG=0
66 I '$O(^PS(59.5,0)) D Q:CHKFLG
67 .W !,"The IV Room file (#59.5) does not exist!"
68 .S CHKFLG=1 D PAUSE
69 I '$D(^ECX(728.113,0)) D Q:CHKFLG
70 .W $C(7),!!,"Your facility appears to be running a version of Inpatient Medications prior to"
71 .W !,"version 4.5 which is necessary to use this option."
72 .S CHKFLG=1 D PAUSE
73 K TEST1 D FIELD^DID(59.5,.02,"","TYPE","TEST1")
74 I '$D(TEST1) D
75 .W $C(7),!!,"The Inpatient Medications Patch PSJ*4.5*27 has not yet been installed!"
76 .W !,"It must be loaded before you can proceed with this option."
77 .S CHKFLG=1 D PAUSE
78 Q
79 ;
80PAUSE ;pause screen
81 I $E(IOST)="C" D
82 .S SS=22-$Y F JJ=1:1:SS W !
83 .S DIR(0)="E" W ! D ^DIR K DIR
84 Q
Note: See TracBrowser for help on using the repository browser.