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

NURACE7.m

Go to the documentation of this file.
NURACE7 ;HIRMFO/MD-RM-PATIENT CLASSIFICATION DRIVER-cont. ;6/6/96
 ;;4.0;NURSING SERVICE;**7**;Apr 25, 1997
EN1 ; SET LOCAL VARIABLES WITH PATIENT DATA
 I NURSBS=11 S CONFIGX="USER",(FACTX,FACTORS)="N/A",COMMENTX=""
 G:CLASSREV=0 PRINTIT
 I NURSCLAS'>0 W !,$C(7)," NO PREVIOUS CLASSIFICATION--CANNOT REVIEW " Q
 S NURSOLDC=NURSCLAS
 S NURSREV=$O(^NURSA(214.7,"AA",DFN,NURSCLAS,"")) G:NURSREV="" A2
 S NURSREV=$O(^NURSA(214.7,"AA",DFN,NURSCLAS,NURSREV,"")) G:(NURSREV="")!(NURSREV=0) A2
A1 S NRX=^NURSA(214.7,NURSREV,0),REVDATE=$P(NRX,"^",1),REVNO=$P(NRX,"^",6),REVIEWER=$S(REVNO="":"",'$D(^VA(200,REVNO,0)):"",1:$P(^(0),"^",1)) G PRINTIT
A2 S (REVNO,REVIEWER,REVDATE)=""
PRINTIT ;GO TO CLASSIFY PATIENT
 S OUTSW=0 D EN1^NURACE1 I OUTSW L -^NURSF(214,DFN) Q
 G FINAL21:NOREVSW,FINAL2:NURSRTSW
 I CONFIGX="COMPUTER" S COMMENTX="" G FINAL2
 I NURSBS=11 S COMMENTX="",CONFIGX="USER" G FINAL2
COMADD ;ENTER COMMENTS IF NECESSARY
 W !!,"Enter Comments: " W:(COMMENTX'="") COMMENTX,!,"//" R X:DTIME S:X=""&$T X=COMMENTX
 I (X="^")!('$T) D EN4^NURACE8 L -^NURSF(214,DFN) S OUTSW=1 Q
 I $L(X)>50!(X["?") W !,$C(7),"ANSWER MUST BE 1 TO 50 CHARACTERS IN LENGTH:" G COMADD
 F I=1:1:$L(X) Q:$E(X,1)'=" "  S X=$E(X,2,$L(X))
 I X="" W !,$C(7),"*** WHEN CHANGING THE CLASSIFICATION, COMMENTS MUST BE FILLED IN ***" G COMADD
 I X=COMMENTX G FINAL2
 I X="@" W $C(7),"   *** COMMENTS CANNOT BE DELETED ***" G COMADD
 I X'?1A.ANP!(X["^") W !,"ANSWER MUST BE 1 TO 50 CHARACTERS IN LENGTH" G COMADD
 S CHANGESW=1,COMMENTX=X
FINAL2 ;ADD PATIENT CLASSIFICATION TO DATABASE
 W !!
 L -^NURSF(214,DFN) S CONFIGX=$E(CONFIGX,1)
 S X="N",%DT="T" D ^%DT S DATEX=Y S:$E(DATEX,8)'="." DATEX=$E(DATEX,1,7)_".00001"
CHK I $$DUPCLAS^NURSCUTL(DATEX,DFN) S DATEX=(DATEX+.000001) G CHK
 S DA=$P(^NURSA(214.6,0),U,3)
LOCK S DA=DA+1 L +^NURSA(214.6,DA,0):0 I '$T!$D(^NURSA(214.6,DA)) L -^NURSA(214.6,DA,0) G LOCK
 S ^NURSA(214.6,DA,0)=DATEX_"^"_DFN_"^"_CLASSX_"^"_FACTORS_"^"_CONFIGX_"^"_DUZ_"^"_COMMENTX_"^"_NURSWARD_"^"_NURSBS_"^^"_NURSRMBD S X=^NURSA(214.6,DA,0)
 S ^NURSA(214.6,"AA",$P(X,"^",2),9999999-$P(X,"^",1),DA)=""
 S ^NURSA(214.6,"B",$E($P(X,"^",1),1,30),DA)=""
 S ^NURSA(214.6,"C",$E($P(X,"^",2),1,30),DA)=""
 S ^NURSA(214.6,"E",$E($P(X,"^",8),1,30),DA)=""
 S $P(^NURSA(214.6,0),U,3,4)=DA_"^"_($P(^NURSA(214.6,0),"^",4)+1) L -^NURSA(214.6,DA,0)
 S NEWREV=DA
FINAL21 ;
 I CLASSREV=1 D ADDREV
 Q
ADDREV ; ADD REVIEWED CLASSIFICATION DATA
 S NOREVSW=$S('NOREVSW:"Y",1:"N")
 S DA=$P(^NURSA(214.7,0),"^",3)
LOCK1 S DA=DA+1 L +^NURSA(214.7,DA,0):0 I '$T!$D(^NURSA(214.7,DA)) L -^NURSA(214.7,DA,0) G LOCK1
 S X="N",%DT="T" D ^%DT S NURSRVDT=Y S:'$D(NEWREV) NEWREV=""
 S ^NURSA(214.7,DA,0)=NURSRVDT_"^"_DFN_"^"_NURSOLDC_"^"_NOREVSW_"^"_NEWREV_"^"_DUZ S X=^NURSA(214.7,DA,0)
 S ^NURSA(214.7,"AA",$P(X,"^",2),$P(X,"^",3),9999999-$P(X,"^",1),DA)=""
 S ^NURSA(214.7,"B",$E($P(X,"^",1),1,30),DA)=""
 S ^NURSA(214.7,"C",$E($P(X,"^",2),1,30),DA)=""
 S ^NURSA(214.7,0)=$P(^NURSA(214.7,0),"^",1,2)_"^"_DA_"^"_($P(^NURSA(214.7,0),"^",4)+1) L -^NURSA(214.7,DA,0)
 Q