1 | SPNFEDT2 ;HISC/DAD-FIM EDIT UTILITIES ;8/28/96 12:44
|
---|
2 | ;;2.0;Spinal Cord Dysfunction;**12,19**;01/02/1997
|
---|
3 | ;
|
---|
4 | SCORE(SPNFD0) ; *** Display FIM scores
|
---|
5 | ; SPNFD0 = IEN in the Outcomes file (#154.1)
|
---|
6 | N SPNFTEXT,SPNFTYPE,SPNFUNDL,X
|
---|
7 | S SPNFTYPE=$P($G(^SPNL(154.1,SPNFD0,0)),U,2)
|
---|
8 | S SPNFTEXT(1)="(Computed from incomplete data)"
|
---|
9 | S SPNFTEXT(2)="(No data or invalid data found)"
|
---|
10 | S SPNFUNDL=$TR($J("",79)," ","=")
|
---|
11 | W !!,SPNFUNDL
|
---|
12 | I SPNFTYPE=2 D
|
---|
13 | . W !?3,"Motor FIM Score:" S X=$$EN1^SPNFUTL0(SPNFD0)
|
---|
14 | . W ?38,$S(X:$J(+X,6,1),1:$J(X,6))
|
---|
15 | . W:X["*" "*",?48,SPNFTEXT(1) W:X["ERROR" ?48,SPNFTEXT(2)
|
---|
16 | . W !?3,"Cognitive FIM Score:" S X=$$EN2^SPNFUTL0(SPNFD0)
|
---|
17 | . W ?38,$S(X:$J(+X,6,1),1:$J(X,6))
|
---|
18 | . W:X["*" "*",?48,SPNFTEXT(1) W:X["ERROR" ?48,SPNFTEXT(2)
|
---|
19 | . W !?3,"Total FIM Score:" S X=$$EN3^SPNFUTL0(SPNFD0)
|
---|
20 | . W ?38,$S(X:$J(+X,6,1),1:$J(X,6))
|
---|
21 | . W:X["*" "*",?48,SPNFTEXT(1) W:X["ERROR" ?48,SPNFTEXT(2)
|
---|
22 | . Q
|
---|
23 | I SPNFTYPE=1 D
|
---|
24 | . S X=$$EN3^SPNFUTL0(SPNFD0)
|
---|
25 | . W !,"Self Report of Function total score: ",X
|
---|
26 | . W:X["*" " ",SPNFTEXT(1) W:X["ERROR" " ",SPNFTEXT(2)
|
---|
27 | . Q
|
---|
28 | I "^1^2^"'[(U_SPNFTYPE_U) D
|
---|
29 | . W !?3,"ERROR, unknown record type: '",SPNFTYPE,"'"
|
---|
30 | . Q
|
---|
31 | W !,SPNFUNDL,!
|
---|
32 | H 2
|
---|
33 | Q
|
---|
34 | ;
|
---|
35 | FIND(SPNFTYPE,SPNFDFN) ; *** Find patient record
|
---|
36 | ; SPNFTYPE = FIM type
|
---|
37 | ; SPNFDFN = Patient file (#2) IEN
|
---|
38 | ;
|
---|
39 | ; Returns: IEN ^ Flag ( 0^-1 or IEN^0 or 0^1 )
|
---|
40 | ; IEN = If the patient SPNFDFN has only one record of FIM type
|
---|
41 | ; SPNFTYPE then return the IEN of that record SPNFD0.
|
---|
42 | ; Else if the patient has no records, or multiple records
|
---|
43 | ; return IEN = 0
|
---|
44 | ; Flag = -1 No records for this patient
|
---|
45 | ; 0 One record for this patient
|
---|
46 | ; +1 Number of records for this patient
|
---|
47 | ;
|
---|
48 | N SPNFD0,SPNFDATE,SPNFNUMB
|
---|
49 | S (SPNFD0(0),SPNFDATE,SPNFNUMB)=0
|
---|
50 | F S SPNFDATE=$O(^SPNL(154.1,"AA",SPNFTYPE,SPNFDFN,SPNFDATE)) Q:SPNFDATE'>0 D
|
---|
51 | . S SPNFD0=0
|
---|
52 | . F S SPNFD0=$O(^SPNL(154.1,"AA",SPNFTYPE,SPNFDFN,SPNFDATE,SPNFD0)) Q:SPNFD0'>0 D
|
---|
53 | .. S SPNFNUMB=SPNFNUMB+1 I SPNFD0(0)'>0 S SPNFD0(0)=SPNFD0
|
---|
54 | .. Q
|
---|
55 | . Q
|
---|
56 | S SPNFNUMB=$S(SPNFNUMB=0:-1,SPNFNUMB=1:0,1:SPNFNUMB)
|
---|
57 | I SPNFNUMB S SPNFD0(0)=0
|
---|
58 | Q SPNFD0(0)_U_SPNFNUMB
|
---|