source: FOIAVistA/trunk/r/NURSING_SERVICE-NUR/NURAMHE.m@ 1203

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1NURAMHE ;HIRMFO/MD,FT-NURSING MANHOURS ENTER/EDIT FUNCTION ;8/14/96 09:45
2 ;;4.0;NURSING SERVICE;**20**;Apr 25, 1997
3EN1 ;PATIENT CARE ENTRY POINT FROM OPTION NURAMN-MANED
4 Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
5 S DIC="^NURSF(211.4,",DIC("A")="Select Nursing UNIT: ",DIC(0)="AEQZ"
6 I DUZ(0)'["n",DUZ(0)'["@" S DIC("S")="I $P($G(^SC(+$G(NURSF(211.4,+Y,0)),0)),U)'[""MAS ONLY"",$P($G(^SC(+$G(NURSF(211.4,+Y,0)),0)),U)'[""MASONLY"",$P($G(^NURSF(211.4,+Y,""I"")),U)'=""I"""
7 E S DIC("S")="I $P($G(^SC(+$G(^NURSF(211.4,+Y,0)),0)),U)'[""MAS ONLY"",$P($G(^SC(+$G(^NURSF(211.4,+Y,0)),0)),U)'[""MASONLY"""
8 W ! D ^DIC K DIC I "^"[X!(+Y'>0) G QUIT
9 S NCWARD=+Y
10 S NUROUTSW=0,X="T",%DT="" D ^%DT D:+Y D^DIQ S %DT("B")=Y
11NXDT S %DT("A")="Select DATE: ",%DT="AEX" W ! D ^%DT K %DT
12 I "^"[X!(+Y'>0) G QUIT
13 G:"^"[X QUIT S NURDAY=+Y D SHIFT G:NUROUTSW QUIT D EDIT G:NUROUTSW QUIT
14 K SHIFT G NXDT
15EDIT ; PROCESS SELECTED SHIFT(S)
16 F NURDA=0:0 S NURDA=$O(SHIFT(NURDA)) Q:NURDA="" S NPWARD=NCWARD D EN6^NURSAUTL W !!,"...Editing "_$S(SHIFT(NURDA)="E":"EVENING",SHIFT(NURDA)="D":"DAY",SHIFT(NURDA)="N":"NIGHT",1:"")_" SHIFT for ward "_NPWARD_"...",! D MAIN Q:NUROUTSW
17 Q
18SHIFT R !!,"Select Shift(s) (Enter N - Night D - DAY E - Evening or A for All Shifts): ",NURSHFT:DTIME,! I "^"[NURSHFT!('$T)!(NURSHFT="") S NUROUTSW=1 Q
19 I NURSHFT["?" W !,"Enter shift selection(s) (i.e., N,D,E - ND - DE etc)." G SHIFT
20 I NURSHFT?1L S NURSHFT=$C($A(NURSHFT)-32)
21 I '((NURSHFT="A")!(NURSHFT="ALL")!(NURSHFT="N")!(NURSHFT="D")!(NURSHFT="E"))&($L(NURSHFT)'>1) G MSG
22 I $L(NURSHFT)>1 F I=1:1:5 I $E(NURSHFT,I)'=","&($E(NURSHFT,I)'="D")&($E(NURSHFT,I)'="N")&($E(NURSHFT,I)'="E")&($E(NURSHFT,I)'="") G MSG
23 I NURSHFT="A"!(NURSHFT="ALL") F NURX=1:1:3 S SHIFT(NURX)=$S(NURX=1:"N",NURX=2:"D",1:"E")
24 E F NURX=1:1:$L(NURSHFT) S:$E(NURSHFT,NURX)'="," SHIFT($S($E(NURSHFT,NURX)="N":1,$E(NURSHFT,NURX)="D":2,$E(NURSHFT,NURX)="E":3,1:0))=$E(NURSHFT,NURX)
25 Q
26QUIT D ^NURAKILL
27 Q
28MAIN ;LOOP PROCESS
29 S NURSHFT=SHIFT(NURDA) S X=NURDAY_NURSHFT_NCWARD D EN1^NURAMHU S SAVENODE=$P(^NURSA(213.4,DA,0),"^",2,4) L +^NURSA(213.4,DA,0):1 I '$T W !!,"ANOTHER PROCESS IS WORKING ON THIS ENTRY",$C(7) S NUROUTSW=1 Q
30 S DIE="^NURSA(213.4,",DR="[NURA-I-PATHOURS]" D ^DIE L -^NURSA(213.4,DA,0)
31 S NURNODE=$P(^NURSA(213.4,DA,0),"^",2,4) I '(SAVENODE=NURNODE) S DR="10////^S X=DUZ" D ^DIE
32 I $D(^NURSA(213.4,DA,0)),$P(^(0),"^",8) W !!,"ENTERED BY: ",$P(^VA(200,$P(^NURSA(213.4,DA,0),"^",8),0),"^")
33 Q
34MSG W !,$C(7)," ** IMPROPER SHIFT SELECTION **" G SHIFT
Note: See TracBrowser for help on using the repository browser.