source: WorldVistAEHR/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNCTSHO.m@ 1746

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

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1SPNCTSHO ;WDE/SD SHOW ANN AND CONT ;6/27/02 05:15
2 ;;2.0;Spinal Cord Dysfunction;**19,20,21**;01/02/1997
3 ;
4 ;
5EN(SPNDFN) ;
6 ;
7 ;S SPNA=$P($G(^TMP($J,0)),U,2)
8 ;I (SPNA=0)!(SPNA="") S SPNEXIT=1 Q ;no care episodes on file
9 D HDR
10 D SHOW
11 Q
12SHOW ; display records in ^tmp($j
13 S (SPNOTOL,SPNFD0,SPNOTNE,SPNW,SPNX,SPNY,SPNZ,SPNIEN,SPNSEL,SPNEXIT,SPNSUB,SPNFD0)=0
14 ; spnw = number spnx = outcome type spny= date recorded
15 S SPNOUT=0
16 S SPNW=0 F S SPNW=$O(^TMP($J,SPNW)) Q:SPNW="" S SPNX=0 F OUT=1:1 S SPNX=$O(^TMP($J,SPNW,SPNX)) Q:SPNX="" S SPNY=0 F S SPNY=$O(^TMP($J,SPNW,SPNX,SPNY)) Q:(SPNY="")!('+SPNY) D I SPNEXIT=1 S OUT=99999 Q
17 .Q:SPNOUT=1
18 .S SPNFIEN=0 S SPNFIEN=$G(^TMP($J,SPNW,SPNX,SPNY))
19 .W !,SPNW,") ",$$FMTE^XLFDT(SPNX,"5DZP")
20 .I SPNCTYP=3 W ?15,$$GET1^DIQ(154.1,SPNFIEN_",",.02)
21 .I SPNCTYP=4 W ?15,$$GET1^DIQ(154.1,SPNFIEN_",",.021),?38,$$GET1^DIQ(154.1,SPNFIEN_",",.02)
22 .S SPNEDSS=$P($G(^SPNL(154.1,SPNFIEN,"MS")),U,9) I SPNEDSS'="" W ?62,"EDSS: ",$P($G(^SPNL(154.2,SPNEDSS,0)),U,1)
23 .S SPNSUB=SPNSUB+1,SPNLINE=SPNLINE+1
24 .I SPNLINE>15 D SEL I SPNEXIT=0 I SPNFD0=0 D HDR
25 .I +SPNFD0 Q
26 .Q:SPNOUT=1
27 Q:SPNOUT=1
28 I '+SPNFD0 I SPNEXIT=0 D SEL
29 Q
30HDR ;
31 I $D(IOF) W @IOF
32 S OUT=0
33 S SPNCTYP=$P($G(^TMP($J,0)),U,4)
34 I $D(SPNHDR)=0 S SPNHDR=" Episodes of care"
35 W !?20,SPNHDR
36 S SPNSSN=$P($G(^DPT(SPNDFN,0)),U,9) S SPNSSN=$E(SPNSSN,1,3)_"-"_$E(SPNSSN,4,5)_"-"_$E(SPNSSN,6,9)
37 W !!,"Patient: ",$P(^DPT(SPNDFN,0),U,1)," SSN: ",SPNSSN
38 W !,"--------------------------------------------------------------------------"
39 S SPNLINE=3
40 Q
41SEL ;prompt for a selection from the list
42 Q:SPNOUT=1
43 S (SPNSEL,SPNEXIT,Y)=0,SPNTOT=$P($G(^TMP($J,0)),U,1)
44 W !,"--------------------------------------------------------------------------"
45 I SPNSUB=0 W !?2,"There are no ",SPNHDR," Outcomes on file.",!?2,"(An ASIA should be entered first if you add outcomes.)"
46 I SPNSUB>0 W !?2,"Select 1-",SPNSUB," of ",SPNTOT," to view/edit an outcome, '^' to exit, or " I SPNSUB'=SPNTOT W "press"
47 I SPNSUB>0 I SPNSUB'=SPNTOT W !?2,"<Return> to see the next group"
48 W !?2,"<A> to Add a new outcome"
49PICK R !?5,"Selection: ",SPNSEL:DTIME
50 I SPNSEL["?" W !?2,"Enter a number within the range allowed, or one of the designated keys." G PICK
51 I SPNSEL=0 W !,$C(7),?10,"Selected number is outside the range." G PICK
52 I "Aa^"'[SPNSEL,(SPNSEL'?1.5N) W !,$C(7) G PICK
53 I SPNSEL="a" S SPNSEL="A"
54 I SPNSEL="A" S SPNEXIT=1 S SPNOUT=1 Q
55 I SPNSEL="^" S SPNEXIT=1 S SPNOUT=1 Q
56 I (SPNSEL>$P($G(^TMP($J,0)),U,1))!(SPNSEL>SPNSUB) W !,$C(7),?10,"Selected number is outside the range." G PICK
57 I SPNSEL="" I SPNSUB=SPNTOT S SPNEXIT=1 Q
58 I SPNEXIT=0 I +SPNSEL I $D(^TMP($J,SPNSEL)) D
59 .S (SPNB,SPNX)=""
60 .S SPNB=$O(^TMP($J,SPNSEL,SPNB))
61 .S SPNX=$O(^TMP($J,SPNSEL,SPNB,SPNX))
62 .S SPNFD0=$P($G(^TMP($J,SPNSEL,SPNB,SPNX)),U,1)
63 .I SPNFD0="" S SPNFD0="" S SPNEXIT=1 Q
64 .S SPNFTYPE=$P($G(^SPNL(154.1,SPNFD0,0)),U,2)
65 .I SPNFTYPE="" S SPNEXIT=1 Q
66 .S SPNOUT=1 S OUT=99999 Q
67 I SPNEXIT=1 S SPNOUT=1
68 Q
Note: See TracBrowser for help on using the repository browser.