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

NURQRPT1.m

Go to the documentation of this file.
NURQRPT1 ;HIRMFO/YH-QI SUMMARY REPORT, PART 2 ;4/22/96
 ;;4.0;NURSING SERVICE;;Apr 25, 1997
EN1 D HDR^NURQRPT0 Q:$G(NUROUT)  S NURQB="",$P(NURQB," ",40)=""
 S NURQTXT="A. DISCIPLINES: "_$S($D(NURQAR)&($D(NURQSRVC)):NURQAR_", "_$$GET1^DIQ(49,+NURQSRVC,.01,"I"),1:""),NURQTXT(1)=$E(NURQB,1,4) D DIWP^NURQRPT3(.NURQTXT)
 Q:$G(NUROUT)  D DATA Q:$G(NUROUT)  D RECEIVR^NURQRPT2 Q:$G(NUROUT)  D REFER^NURQRPT3
 Q:$G(NUROUT)  W !!,?40,"ENTERED BY: " I $D(^VA(200,+NURQND,0)),$P(^(0),"^")'="" W $P(^(0),"^")
 W !,"F. LOCATION INFORMATION:" D LOC
 Q
LOC ;PRINT DATA FOR EACH UNIT
 I $G(NUREQWRD),'$D(^NURQ(217,DA,2,"B",+NUREQWRD)) D:($Y>(IOSL-7)) HDR^NURQRPT0 W !,?3,"No location information entered for "_$S($D(^SC(+NUREQWRD,0)):$P($P($G(^(0)),"^"),"NUR ",2),1:" "),! Q
 S (D1,D1(1))=0 F  S D1=$O(NUREQWRD(D1)) Q:D1'>0!$G(NUROUT)  S NURQWRD=$P(NUREQWRD(D1),"^"),D1(1)=D1(1)+1 D
 .D:($Y>(IOSL-7)) HDR^NURQRPT0 Q:$G(NUROUT)  W !!,?3,"**********",!,?3,D1(1)_". "_$P(NUREQWRD(D1),"^",2)
 .W !,?6,"A. SURVEY STATISTCS:"
 .S NURDEM=$$SURLOC^NURQUTL1(NURQSVN) D:'NURDEM&($Y>(IOSL-7)) HDR^NURQRPT0 Q:$G(NUROUT)  W:'NURDEM !!,?9,"No statistics data for this unit",! D:NURDEM ^NURQUTL3
 .Q:$G(NUROUT)  D:($Y>(IOSL-7)) HDR^NURQRPT0 Q:$G(NUROUT)  W !,?6,"B. IMPORTANT FUNCTIONS:"
 .D IMPORTNT Q:$G(NUROUT)
 .D:($Y>(IOSL-7)) HDR^NURQRPT0 Q:$G(NUROUT)  W !!,?6,"C. PERFORMANCE MEASUREMENTS:" D PERFORM^NURQRPT4
 .Q
 Q
IMPORTNT ;PRINT IMPORTANT FUNCTION
 D:($Y>(IOSL-7)) HDR^NURQRPT0 Q:$G(NUROUT)  W ! D FHEADR^NURQRPT0
 Q:$G(NUROUT)  I $P($G(^NURQ(217,DA,2,D1,2,0)),"^",4)>0 D
 .S NLEVL=0 F D2=0:0 S D2=$O(^NURQ(217,DA,2,D1,2,D2)) Q:D2'>0!$G(NUROUT)  K ^UTILITY($J) N X S X=$P($G(^NURQ(217,DA,2,D1,2,D2,0)),"^") S DIWF="",DIWL=0,DIWR=20 D ^DIWP K NFUNC S NFUNC=0 D MERGE^NURQRPT3(.NFUNC,19) S:$G(NLEVL)<NFUNC NLEVL=NFUNC D
 ..I $P($G(^NURQ(217,DA,2,D1,2,D2,1,0)),"^",3)>0 D CARE
 ..Q:$G(NUROUT)  I $P($G(^NURQ(217,DA,2,D1,2,D2,2,0)),"^",3)>0 D PRACT
 ..Q:$G(NUROUT)  I NLEVL>0 D WRITE^NURQRPT3 Q
 ..E  W !,"No Important Function entered"
 K NCARE1,NCARE2,NPRACT1,NPRACT2,ND3,K,NURSERVC,NURSERVP Q
CARE K NURSERVC S ND3=0 F D3=0:0 S D3=$O(^NURQ(217,DA,2,D1,2,D2,1,D3)) Q:D3'>0!$G(NUROUT)  N X S NURSERVC=+$P($G(^(D3,0)),"^"),NURSERVC(1)=$$GET1^DIQ(49,+$P($G(^NURQ(217.1,+NURSERVC,1)),"^",2),.01,"I"),X=$G(^NURQ(217.1,+NURSERVC,0)) D
 .S DIWF="",DIWL=0,DIWR=18 K ^UTILITY($J) D ^DIWP S NARY="NCARE"_D3,ND3=D3 K @NARY S @NARY=0 D MERGE^NURQRPT3(.@NARY,18)
 .N X S X=NURSERVC(1) K NSERCV S NURSERVC=0,DIWF="",DIWL=0,DIWR=9 K ^UTILITY($J) D ^DIWP,MERGE^NURQRPT3(.NURSERVC,9)
 .S NI=$S(@NARY>NURSERVC:@NARY,1:NURSERVC)
 .F NI(1)=1:1:NI S @(NARY_"("_NI(1)_")")=$E($G(@(NARY_"("_NI(1)_")"))_$E(NURQB,1,18),1,18)_" "_$E($G(NURSERVC(NI(1)))_$E(NURQB,1,9),1,9)
 .S @NARY=NI
 K NCARE S NCARE=0 I ND3>0 F I=1:1:ND3 D
 .S NARY="NCARE"_I,J=@NARY
 .F K=1:1:J S NCARE=NCARE+1,NCARE(NCARE)=@(NARY_"("_K_")")
 S:NCARE>NLEVL NLEVL=NCARE
 Q
PRACT K NURSERVP S ND3=0 F D3=0:0 S D3=$O(^NURQ(217,DA,2,D1,2,D2,2,D3)) Q:D3'>0  N X S NURSERVP=+$P($G(^(D3,0)),"^"),NURSERVP(1)=$$GET1^DIQ(49,+$P($G(^NURQ(217.1,+NURSERVP,1)),"^",2),.01,"I"),X=$G(^NURQ(217.1,+NURSERVP,0)) D
 .S DIWF="",DIWL=0,DIWR=19 K ^UTILITY($J) D ^DIWP S NARY="NPRACT"_D3,ND3=D3 K @NARY S @NARY=0 D MERGE^NURQRPT3(.@NARY,18)
 .N X S X=NURSERVP(1) K NURSERVP S NURSERVP=0,DIWF="",DIWL=0,DIWR=9 K ^UTILITY($J) D ^DIWP,MERGE^NURQRPT3(.NURSERVP,9)
 .S NI=$S(@NARY>NURSERVP:@NARY,1:NURSERVP)
 .F NI(1)=1:1:NI S @(NARY_"("_NI(1)_")")=$E($G(@(NARY_"("_NI(1)_")"))_$E(NURQB,1,18),1,18)_" "_$E($G(NURSERVP(NI(1)))_$E(NURQB,1,9),1,9)
 .S @NARY=NI
 K NPRACT S NPRACT=0 I ND3>0 F I=1:1:ND3 D
 .S NARY="NPRACT"_I,J=@NARY
 .F K=1:1:J S NPRACT=NPRACT+1,NPRACT(NPRACT)=@(NARY_"("_K_")")
 S:NPRACT>NLEVL NLEVL=NPRACT
 S:NURSERVP>NLEVL NLEVL=NURSERVP
 Q
DATA ;PRINT DATA INFORMATION
 W !,"B. DATA:" I $D(^NURQ(217,DA,5,0)),$P($G(^(0)),"^",3)>0 D
 .S NURQTXT="   1. DATA SOURCE: " F D1=0:0 S D1=$O(^NURQ(217,DA,5,D1)) Q:D1'>0!$G(NUROUT)  I $P($G(^NURQ(217,DA,5,D1,0)),"^")'="" S NURQTXT=NURQTXT_" "_$P(^(0),"^")
 .S NURQTXT(1)=$E(NURQB,1,6) D DIWP^NURQRPT3(.NURQTXT)
 E  W !,?3,"1. DATA SOURCE:"
 ;PRINT SAMPLE SIZE
 Q:$G(NUROUT)  W !,?3,"2. SAMPLE SIZE: "_$S($P($G(^NURQ(217,DA,7)),"^")'="":$P(^(7),"^"),1:"")
 ;PRINT METHODOLOGY
 Q:$G(NUROUT)  I $D(^NURQ(217,DA,6,0)),$P($G(^(0)),"^",3)>0 D
 .S NURQTXT="   3. METHODOLOGY:" F D1=0:0 S D1=$O(^NURQ(217,DA,6,D1)) Q:D1'>0  I $P($G(^NURQ(217,DA,6,D1,0)),"^")'="" S NURQTXT=NURQTXT_" "_$P($G(^(0)),"^")
 .S NURQTXT(1)=$E(NURQB,1,6) D DIWP^NURQRPT3(.NURQTXT)
 E  W !,?3,"3. METHODOLOGY:"
  S NURQFREQ=$S($D(^NURQ(217.3,+$P($G(^NURQ(217,DA,7)),"^",2),0)):$P(^(0),"^"),1:"") D:($Y>(IOSL-7)) HDR^NURQRPT0 Q:$G(NUROUT)  W !,?3,"4. FREQUENCY: "_NURQFREQ
 Q:$G(NUROUT)  S NURQTXT="   5. MONITORING PERIOD: "_$P($G(^NURQ(217,DA,7)),"^",3) D DIWP^NURQRPT3(.NURQTXT)
 Q:$G(NUROUT)  D:($Y>(IOSL-7)) HDR^NURQRPT0 Q:$G(NUROUT)  W !,?3,"6. SURVEY STATISTICS: " S (NURDEM,NURQWRD)=0 D ^NURQUTL3
 Q