source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURARNCT.m@ 862

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

initial load of WorldVistAEHR

File size: 3.0 KB
RevLine 
[613]1NURARNCT ;HIRMFO/RM/MD,FT-REPORT SHOWING NOT CLASSIFIED PATIENTS FOR HOSP. 2/2/96 ;8/9/96 11:35
2 ;;4.0;NURSING SERVICE;**20**;Apr 25, 1997
3 Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
4 S (NURQUIT,NURQUEUE,NURMDSW,NURSW1)=0
5 D EN9^NURSAGSP I NURMDSW W ! S DIC(0)="AEMQZ" D EN8^NURSAGSP I $G(NUROUT) G QUIT
6 W ! S ZTRTN="Q1^NURARNCT" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
7Q1 ;
8 D NOW^%DTC S Y=% X ^DD("DD") S NDATE=$P(Y,":",1,2) S (NURSW1,NURPAGE)=0 K ^TMP($J) D SORT
9 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
10 U IO S NBR=0 Q:NURQUIT S NBR=1 D WRTE
11QUIT ; KILL LOCAL VARIABLES
12 K ^TMP($J) D CLOSE^NURSUT1,^NURAKILL
13 Q
14SORT 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
15 Q
16SORT1 ;
17 S:'NURMDSW NURFAC(2)=" BLANK"
18 I NURMDSW S NURFAC(2)=$$EN12^NURSUT3($G(NL1))
19 I NURMDSW,'$G(NURFAC),$G(NURFAC(1))'=$G(NURFAC(2)) Q
20 D 1^VADPT W:$E(IOST)="C" "." S NCLAS=$O(^NURSA(214.6,"AA",DFN,"")) I NCLAS="" S NCLAS=0 G A
21 D EN6^NURSCUTL S NURSCLAS("CL")=1 D EN2^NURSCUTL S NCLAS=$S(NURSCLAS="":"",$D(^NURSA(214.6,NURSCLAS,0)):^(0),1:"")
22A 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
23 . 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")
24 . 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)=""
25 . Q
26 Q
27WRTE ;
28 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
29 Q
30AA 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
31 . 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
32 . . I 'NURSW1!($Y>(IOSL-4)) D HEADER Q:NURQUIT
33 . . S NBR=1,Y=$P(NSUB,"--",1) D:+Y D^DIQ S NCLAS=$S(Y'=0:Y,1:"NOT CLASSIFIED YET")
34 . . S DFN=$P(NSUB,"--",2) D ^NURSAPCH
35 . . W !!,$S(NRMBD'=" BLANK":NRMBD,1:""),?18,$S(NNM'=" BLANK":$E(NNM,1,20),1:""),?48,NCLAS,?71,NURSX,!,?18,SSN
36 . . Q
37 . Q
38 Q
39HEADER ;
40 I NURSW1,$E(IOST)="C",'NURQUEUE D ENDPG^NURSUT1 S:NUROUT NURQUIT=+NUROUT Q:NURQUIT
41 S NURSW1=1,NURPAGE=NURPAGE+1
42 W:$E(IOST)="C"!(NURPAGE>1) @IOF
43 W !,NDATE,?18,"CURRENT UNCLASSIFIED PATIENT REPORT FOR THE HOSPITAL",?72,"PAGE: "_NURPAGE
44 W !!,"ROOM-BED",?18,"PATIENT",?50,"LAST CLASSIFIED",?70,"ABSENCE",!,?18,"SSN",!
45 F X=1:1:80 W "-"
46 I NURMDSW W !,?35,$S($G(NURFAC(3))=" BLANK":"NO FACLILTY",1:$G(NURFAC(3)))
47 W:NL1'="" !!,?5,"WARD: ",NL1
48 Q
Note: See TracBrowser for help on using the repository browser.