source: FOIAVistA/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNPM1D.m@ 635

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

initial load of FOIAVistA 6/30/08 version

File size: 2.1 KB
Line 
1SPNPM1D ;SD/AB-PROGRAM MEASURE #1 - GET THE DENOMINATOR ;4/9/98
2 ;;2.0;Spinal Cord Dysfunction;**6**;01/02/1997
3MAIN ;-- Called from MAIN^SPNPM1
4 ;-- This will get the denominator of PM #1 which is the number of SCD-R who have a REGISTRATION STATUS of SCD - CURRENTLY served by the end of FY 97 AND who have any of the given SCI ICD9 codes in the PTF file (for any date)
5 ;-- Note: PTF file (#45) goes back to 1977, although regular use of PTF was from 1984 to present
6 D TMPLOOP
7EXIT ;
8 Q
9TMPLOOP ;-- Loop thru ^TMP($,"SPNPM1","DFN") and get total of all Pts who have a PTF SCI ICD-9 code (from any Transmitted PTF record)
10 ;-- Quit if ^TMP global not found
11 I '$D(^TMP($J,"SPNPM1","DFN")),'$D(^TMP($J,"SPNPMDX","SPNICD")) Q
12 S (SPN("DFN"),SPN("TOT_NO_PTF"),SPN("TOT_NO_ICD"),SPN("TOT_PTF"),SPN("TOT_ICD"))=0
13 F S SPN("DFN")=$O(^TMP($J,"SPNPM1","DFN",SPN("DFN"))) Q:'+SPN("DFN") D
14 .;-- Quit if NO PTF records for this patient, but 1st increment TOT_NO_PTF record counter
15 .I '+$D(^DGPT("B",SPN("DFN"))) S SPN("TOT_NO_PTF")=SPN("TOT_NO_PTF")+1 Q
16 .;-- Check every PTF record for this Pt for any SCI ICD-9 codes
17 .D CHKPTF
18 .;-- If ICD_FLG=1 (SCD Pt has PTF record /w SCI ICD-9 code) increment TOT-PTF counter
19 .I +SPN("ICD_FLG") S SPN("TOT_PTF")=SPN("TOT_PTF")+1
20 .;-- Else increment TOT_NO_ICD counter
21 .E S SPN("TOT_NO_ICD")=SPN("TOT_NO_ICD")+1
22 .Q
23 Q
24CHKPTF ;-- Called from TMPLOOP, check all Transmitted PTF records for this patient to see if any contain SCI ICD-9 codes
25 S (SPN("PTF_IEN"),SPN("ICD_FLG"))=0
26 F S SPN("PTF_IEN")=$O(^DGPT("B",SPN("DFN"),SPN("PTF_IEN"))) Q:'+SPN("PTF_IEN")!(+SPN("ICD_FLG")) D
27 .;-- Quit if PTF record doesn't have STATUS=3 (Transmitted) or TYPE OF RECORD'=1 (PTF)
28 .Q:$P($G(^DGPT(SPN("PTF_IEN"),0)),U,6)'=3!($P($G(^DGPT(SPN("PTF_IEN"),0)),U,11)'=1)
29 .;-- Look for SCI Dx codes
30 .D CHKICD ;-- If SCI ICD-9 code found set flag (ICD_FLG=1)
31 .Q
32 Q
33CHKICD ;-- Called from CHKPTF, check for matching SCI ICD-9 codes (in ICD temp global)
34 F SPN("PIECE")=10,11,16,17,18,19,20,21,22,23,24 D Q:+SPN("ICD_FLG")
35 .S SPN("ICDPT")=$P($G(^DGPT(SPN("PTF_IEN"),70)),U,SPN("PIECE"))
36 .I +SPN("ICDPT"),$D(^TMP($J,"SPNPMDX","SPNICD",SPN("ICDPT"))) S SPN("ICD_FLG")=1
37 .Q
38 Q
Note: See TracBrowser for help on using the repository browser.