1 | PXRMCSU ;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
|
---|
6 | SUB ;==============Sub Routines=============================
|
---|
7 | DT6M(DT) ;Add 180 days to DT
|
---|
8 | N DT6M
|
---|
9 | S DT6M=$$FMADD^XLFDT(DT,180,0,0,0)
|
---|
10 | Q DT6M
|
---|
11 | CONV(DATE) ;Date time conversion
|
---|
12 | N DATECV
|
---|
13 | S DATECV=$$FMTE^XLFDT(DATE,"5Z")
|
---|
14 | Q DATECV
|
---|
15 | CPTA(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
|
---|
26 | ICD9A(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
|
---|
37 | CPT(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
|
---|
42 | CPTD(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
|
---|
47 | ICD9(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
|
---|
52 | ICD9D(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
|
---|
57 | ICD0(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
|
---|
62 | ICD0D(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
|
---|
67 | STATUS(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
|
---|