Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: NURAMHE

NURAMHE.m

Go to the documentation of this file.
NURAMHE ;HIRMFO/MD,FT-NURSING MANHOURS ENTER/EDIT FUNCTION ;8/14/96  09:45
 ;;4.0;NURSING SERVICE;**20**;Apr 25, 1997
EN1 ;PATIENT CARE ENTRY POINT FROM OPTION NURAMN-MANED
 Q:'$D(^DIC(213.9,1,"OFF"))  Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
 S DIC="^NURSF(211.4,",DIC("A")="Select Nursing UNIT: ",DIC(0)="AEQZ"
 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"""
 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"""
 W ! D ^DIC K DIC I "^"[X!(+Y'>0) G QUIT
 S NCWARD=+Y
 S NUROUTSW=0,X="T",%DT="" D ^%DT D:+Y D^DIQ S %DT("B")=Y
NXDT S %DT("A")="Select DATE: ",%DT="AEX" W ! D ^%DT K %DT
 I "^"[X!(+Y'>0) G QUIT
 G:"^"[X QUIT S NURDAY=+Y D SHIFT G:NUROUTSW QUIT D EDIT G:NUROUTSW QUIT
 K SHIFT G NXDT
EDIT ; PROCESS SELECTED SHIFT(S)
 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
 Q
SHIFT 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
 I NURSHFT["?" W !,"Enter shift selection(s) (i.e., N,D,E - ND - DE etc)." G SHIFT
 I NURSHFT?1L S NURSHFT=$C($A(NURSHFT)-32)
 I '((NURSHFT="A")!(NURSHFT="ALL")!(NURSHFT="N")!(NURSHFT="D")!(NURSHFT="E"))&($L(NURSHFT)'>1) G MSG
 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
 I NURSHFT="A"!(NURSHFT="ALL") F NURX=1:1:3 S SHIFT(NURX)=$S(NURX=1:"N",NURX=2:"D",1:"E")
 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)
 Q
QUIT D ^NURAKILL
 Q
MAIN ;LOOP PROCESS
 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
 S DIE="^NURSA(213.4,",DR="[NURA-I-PATHOURS]" D ^DIE L -^NURSA(213.4,DA,0)
 S NURNODE=$P(^NURSA(213.4,DA,0),"^",2,4) I '(SAVENODE=NURNODE) S DR="10////^S X=DUZ" D ^DIE
 I $D(^NURSA(213.4,DA,0)),$P(^(0),"^",8) W !!,"ENTERED BY: ",$P(^VA(200,$P(^NURSA(213.4,DA,0),"^",8),0),"^")
 Q
MSG W !,$C(7)," ** IMPROPER SHIFT SELECTION **" G SHIFT