source: WorldVistAEHR/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNMISS2.m@ 1046

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1SPNMISS2 ;WDE/SAN-DIEGO;PRINT REPORT ON MISSING DATA ELEMENTS; 1-18-2005
2 ;;2.0;Spinal Cord Dysfunction;**24**;01/02/97
3 ;
4 ;
5EN ;
6 W @IOF
7 S PAGE=0,SPNCON=""
8 D HDR
9 S EQ="",$P(EQ,"-",80)="-"
10 I $D(^TMP($J))=0 W !," No Missing Data to Report." D KILL^SPNMISS Q
11 S PTNAM="" F S PTNAM=$O(^TMP($J,PTNAM)) Q:PTNAM="" S DFN=0 F S DFN=$O(^TMP($J,PTNAM,DFN)) Q:(DFN=0)!('+DFN) D Q:SPNCON="^"
12 .S X=$$GET1^DIQ(2,DFN_",",.09) S SPNSSN=$E(X,1,3)_"-"_$E(X,4,5)_"-"_$E(X,6,9)
13 .W !,$$GET1^DIQ(2,DFN_",",.01),?30,SPNSSN D D SSN
14 ..S FIELD=0 F S FIELD=$O(^TMP($J,PTNAM,DFN,FIELD)) Q:(FIELD="")!('+FIELD) W !?20,$G(^TMP($J,PTNAM,DFN,FIELD))
15 .W !,EQ
16 .I $E(IOST,1)="P" I $Y>(IOSL-9) D HDR
17 .I $E(IOST,1)="C" I $Y>(IOSL-7) D CONT Q:SPNCON="^" D HDR
18 I SPNCON'["^" I $E(IOST,1)="C" D CONT
19 D STATS
20 K STATS K ^TMP($J),DUPDFN,X,Y,SS,DFN,PTNAM,SPNCON,EQ,PTCNT,FIELD,SPNSSN
21 K SPNEXIT,SUBCNT,SSN,SPNLEXIT,SPNIO,SPNDD,SPNCNT
22 Q
23SSN ;
24 S X=0 F S X=$O(^TMP($J,PTNAM,DFN,"SSN",X)) Q:X="" D
25 .S DUPDFN=$P(^TMP($J,PTNAM,DFN,"SSN",X),U,1)
26 .W !?20,"Possible Duplicate SSN Assigned to ",$P($G(^DPT(DUPDFN,0)),U,1)
27 .Q
28 Q
29HDR ;
30 W @IOF
31 S PAGE=PAGE+1
32 W !," SCD Registry Missing Data Report ","Run Date: ",$$FMTE^XLFDT($$NOW^XLFDT,"5DZP")," Page ",PAGE
33 W !,"Patient Name",?30,"SSN"
34 W !,"=============================================================================="
35 Q
36CONT ;
37 I $E(IOST,1)="C" R !?20,"Press Return To Continue Or ^ to Exit ",SPNCON:DTIME
38 I SPNCON="^" S PTNAM="ZZZZZZZZZZZZZZZZZZZZZZZZZZZZ" Q
39 Q
40STATS ;
41 S PTCNT=0
42 S X="" F S X=$O(^TMP($J,X)) Q:X="" S Y=0 F S Y=$O(^TMP($J,X,Y)) Q:Y="" S PTCNT=PTCNT+1 S FIELD="" F S FIELD=$O(^TMP($J,X,Y,FIELD)) Q:FIELD="" D
43 .I $D(STATS(FIELD))=0 S STATS(FIELD)=0
44 .S STATS(FIELD)=STATS(FIELD)+1
45 .S SS="" S SS=$O(^TMP($J,X,Y,"SSN",SS))
46 D HDR
47 W !?20,"Total # of Patients with Missing Data: ",$J(STATS(0),3,0)
48 I $G(STATS(991.01)) W !?20,"# Missing ICN: ",$J(STATS(991.01),3,0)
49 I $G(STATS(.02)) W !?20,"# Missing Registration Date: ",$J(STATS(.02),3,0)
50 I $G(STATS(.05)) W !?20,"# Missing Date of Last Review: ",$J(STATS(.05),3,0)
51 I $G(STATS(1.1)) W !?20,"# Missing SCI Network: ",$J(STATS(1.1),3,0)
52 I $G(STATS(.03)) W !?20,"# Missing Registration Status: ",$J(STATS(.03),3,0)
53 I $G(STATS("SSN")) W !?20,"# of Possible Duplicate SSNs: ",$J(STATS("SSN"),3,0)
Note: See TracBrowser for help on using the repository browser.