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

NURARNCT.m

Go to the documentation of this file.
NURARNCT ;HIRMFO/RM/MD,FT-REPORT SHOWING NOT CLASSIFIED PATIENTS FOR HOSP. 2/2/96 ;8/9/96  11:35
 ;;4.0;NURSING SERVICE;**20**;Apr 25, 1997
 Q:'$D(^DIC(213.9,1,"OFF"))  Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
 S (NURQUIT,NURQUEUE,NURMDSW,NURSW1)=0
 D EN9^NURSAGSP I NURMDSW W ! S DIC(0)="AEMQZ" D EN8^NURSAGSP I $G(NUROUT) G QUIT
 W ! S ZTRTN="Q1^NURARNCT" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
Q1 ;
 D NOW^%DTC S Y=% X ^DD("DD") S NDATE=$P(Y,":",1,2) S (NURSW1,NURPAGE)=0 K ^TMP($J) D SORT
 I $O(^TMP($J,""))="" S NL1="",NURFAC(3)=$S($G(NURFAC)=0:NURFAC(1),1:"") D HEADER W !,"THERE IS NO DATA FOR THIS REPORT" G QUIT
 U IO S NBR=0 Q:NURQUIT  S NBR=1 D WRTE
QUIT ; KILL LOCAL VARIABLES
 K ^TMP($J) D CLOSE^NURSUT1,^NURAKILL
 Q
SORT F NL1=0:0 S NL1=$O(^NURSF(214,"AF","A",NL1)) Q:NL1'>0  F DA=0:0 S DA=$O(^NURSF(214,"AF","A",NL1,DA)) Q:DA'>0  S NDAT=$S($D(^NURSF(214,DA,0)):^(0),1:""),DFN=$P(NDAT,"^") D:DFN'="" SORT1
 Q
SORT1 ;
 S:'NURMDSW NURFAC(2)=" BLANK"
 I NURMDSW S NURFAC(2)=$$EN12^NURSUT3($G(NL1))
 I NURMDSW,'$G(NURFAC),$G(NURFAC(1))'=$G(NURFAC(2)) Q
 D 1^VADPT W:$E(IOST)="C" "." S NCLAS=$O(^NURSA(214.6,"AA",DFN,"")) I NCLAS="" S NCLAS=0 G A
 D EN6^NURSCUTL S NURSCLAS("CL")=1 D EN2^NURSCUTL S NCLAS=$S(NURSCLAS="":"",$D(^NURSA(214.6,NURSCLAS,0)):^(0),1:"")
A I $P($P(NCLAS,"^"),".")<DT S NBED=$S($P(NDAT,"^",4)="":"",$D(^NURSF(213.3,$P(NDAT,"^",4),0)):$P(^(0),"^"),1:"") I NBED'="HEMODIALYSIS",NBED'="DOMICILIARY",NBED'="RECOVERY ROOM" D
 .  S NRMBD=$S(VAIN(5)'="":VAIN(5),1:"  BLANK"),NNM=$S(VADM(1)'="":VADM(1),1:"  BLANK"),SSN=$S(+$G(VADM(2))'="":$P(VADM(2),U,2),1:" BLANK")
 .  S NPWARD=NL1 D EN6^NURSAUTL S NPWARD=$S(NPWARD'="":NPWARD,1:"  BLANK") S ^TMP($J,NURFAC(2),NPWARD,NRMBD,NNM,+$P(NCLAS,"^")_"--"_DFN,SSN)=""
 .  Q
 Q
WRTE ;
 S NURFAC(3)="" F  S NURFAC(3)=$O(^TMP($J,NURFAC(3))) Q:NURFAC(3)=""!(NURQUIT)  D:NURSW1 HEADER Q:NURQUIT  D AA Q:NURQUIT
 Q
AA S NL1="" F  S NL1=$O(^TMP($J,NURFAC(3),NL1)) Q:NL1=""!(NURQUIT)  W:NURSW1 !!,?5,"WARD: ",NL1 S NRMBD="" F  S NRMBD=$O(^TMP($J,NURFAC(3),NL1,NRMBD)) Q:NRMBD=""!NURQUIT  D  Q:NURQUIT
 .  S NNM="" F  S NNM=$O(^TMP($J,NURFAC(3),NL1,NRMBD,NNM)) Q:NNM=""!NURQUIT  S NSUB="" F  S NSUB=$O(^TMP($J,NURFAC(3),NL1,NRMBD,NNM,NSUB)) Q:NSUB=""!NURQUIT  S SSN="" F  S SSN=$O(^(NSUB,SSN))  Q:SSN=""!NURQUIT  D  Q:NURQUIT
 .  .  I 'NURSW1!($Y>(IOSL-4)) D HEADER Q:NURQUIT
 .  .  S NBR=1,Y=$P(NSUB,"--",1) D:+Y D^DIQ S NCLAS=$S(Y'=0:Y,1:"NOT CLASSIFIED YET")
 .  .  S DFN=$P(NSUB,"--",2) D ^NURSAPCH
 .  .  W !!,$S(NRMBD'="  BLANK":NRMBD,1:""),?18,$S(NNM'="  BLANK":$E(NNM,1,20),1:""),?48,NCLAS,?71,NURSX,!,?18,SSN
 .  .  Q
 .  Q
 Q
 I NURSW1,$E(IOST)="C",'NURQUEUE D ENDPG^NURSUT1 S:NUROUT NURQUIT=+NUROUT Q:NURQUIT
 S NURSW1=1,NURPAGE=NURPAGE+1
 W:$E(IOST)="C"!(NURPAGE>1) @IOF
 W !,NDATE,?18,"CURRENT UNCLASSIFIED PATIENT REPORT FOR THE HOSPITAL",?72,"PAGE: "_NURPAGE
 W !!,"ROOM-BED",?18,"PATIENT",?50,"LAST CLASSIFIED",?70,"ABSENCE",!,?18,"SSN",!
 F X=1:1:80 W "-"
 I NURMDSW W !,?35,$S($G(NURFAC(3))="  BLANK":"NO FACLILTY",1:$G(NURFAC(3)))
 W:NL1'="" !!,?5,"WARD: ",NL1
 Q