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