source: FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMCSU.m

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1PXRMCSU ;SLC/JVS - Code Set Version-dialog file-Utilities ;4/10/03 12:02
2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
3 ;Variable List
4 ;DATECV =Converted Date
5 Q
6SUB ;==============Sub Routines=============================
7DT6M(DT) ;Add 180 days to DT
8 N DT6M
9 S DT6M=$$FMADD^XLFDT(DT,180,0,0,0)
10 Q DT6M
11CONV(DATE) ;Date time conversion
12 N DATECV
13 S DATECV=$$FMTE^XLFDT(DATE,"5Z")
14 Q DATECV
15CPTA(VARIEN) ; Return all data for cpt code
16 ; INACDATE=Inactive date
17 ; FPP =FUTURE PRESENT PAST
18 ; RETURNS CPTDATA = Whole string of information
19 ; FPPREF = Time Reference (Null if no data)
20 N INACDATE,FPP,FPPREF,CPTDATA
21 S CPTDATA=$$CPT^ICPTCOD(VARIEN,$$DT6M(DT))
22 S INACDATE=$P(CPTDATA,"^",8),FPPREF="" I INACDATE>0 D
23 .S FPP=$S(INACDATE>DT:"Future",INACDATE<DT:"Past",INACDATE=DT:"Today",1:"Unknown")
24 .S FPPREF=FPP
25 Q CPTDATA_"^"_FPPREF
26ICD9A(VARIEN) ; Return all data for cpt code
27 ; INACDATE=Inactive date
28 ; FPP =FUTURE PRESENT PAST
29 ; RETURNS CPTDATA = Whole string of information
30 ; FPPREF = Time Reference (Null if no data)
31 N INACDATE,FPP,FPPREF,ICD9DATA
32 S ICD9DATA=$$ICDDX^ICDCODE(VARIEN,$$DT6M(DT))
33 S INACDATE=$P(ICD9DATA,"^",12),FPPREF="" I INACDATE>0 D
34 .S FPP=$S(INACDATE>DT:"Future",INACDATE<DT:"Past",INACDATE=DT:"Today",1:"Unknown")
35 .S FPPREF=FPP
36 Q ICD9DATA_"^"_FPPREF
37CPT(VARIEN) ; Return code from IEN
38 N VARCODE
39 S VARCODE=$$CPT^ICPTCOD(VARIEN,$$DT6M(DT))
40 S VARCODE=$P(VARCODE,"^",2)
41 Q VARCODE
42CPTD(VARIEN) ;Return CPT code Description from IEN
43 N VARDESC
44 S VARDESC=$$CPT^ICPTCOD(VARIEN,$$DT6M(DT))
45 S VARDESC=$P(VARDESC,"^",3)
46 Q VARDESC
47ICD9(VARIEN) ; Return ICD9 (Diagnosis) Code from IEN
48 N VARCODE
49 S VARCODE=$$ICDDX^ICDCODE(VARIEN,$$DT6M(DT))
50 S VARCODE=$P(VARCODE,"^",2)
51 Q VARCODE
52ICD9D(VARIEN) ; Return ICD9 (Diagnosis) Description from IEN
53 N VARDESC
54 S VARDESC=$$ICDDX^ICDCODE(VARIEN,$$DT6M(DT))
55 S VARDESC=$P(VARDESC,"^",4)
56 Q VARDESC
57ICD0(VARIEN) ; Return ICD0 (Operation) Code from an IEN
58 N VARCODE
59 S VARCODE=$$ICDOP^ICDCODE(VARIEN,$$DT6M(DT))
60 S VARCODE=$P(VARCODE,"^",2)
61 Q VARCODE
62ICD0D(VARIEN) ; Return ICD0 (Operation) Description from IEN
63 N VARCODE
64 S VARDESC=$$ICDOP^ICDCODE(VARIEN,$$DT6M(DT))
65 S VARDESC=$P(VARDESC,"^",5)
66 Q VARDESC
67STATUS(VRSTATUS) ;RETURN STATUS FOR BOTH CPT AND ICD CODES
68 N STATUS
69 ;VRSTATUS = Internal form of status
70 ;STATUS = Exteral form of status
71 S STATUS=$S(($P(VRSTATUS,"^",1)=1)&($P(VRSTATUS,"^",2)>0):"Active",($P(VRSTATUS,"^",1)=0)&($P(VRSTATUS,"^",2)>0):"Inactive",($P(VRSTATUS,"^",1)=0)&($P(VRSTATUS,"^",2)<0):"Unknown",1:"")
72 Q STATUS
Note: See TracBrowser for help on using the repository browser.