source: WorldVistAEHR/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNPSR17.m

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

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1SPNPSR17 ;HIRMFO/JWR,WAA-HUNT: PROSTHETICS CLASS ;3/1/96
2 ;;2.0;Spinal Cord Dysfunction;**24**;01/02/1997
3 ;
4EN1(D0,ACTION,SEQUENCE) ; *** Search entry point
5 ; Input:
6 ; ACTION,SEQUENCE = Search ACTION,SEQUENCE number
7 ; D0 = SCD (SPINAL CORD) REGISTRY file (#154) IEN
8 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"PROSTH",CN) = IEN ^ NAME
9 ; Output:
10 ; $S( D0_Meets_Search_Criteria : 1 , 1 : 0 )
11 ;
12 ;N AGE,DFN,I,MEETSRCH,VA,VADM,VAERR
13 S MEETSRCH=0
14 S DFN=+$P($G(^SPNL(154,+D0,0)),U)
15 G:'$D(^RMPR(665,DFN,5,0)) EXIT
16 S CN=""
17 S SPN2=0 F S SPN2=$O(^RMPR(665,DFN,5,SPN2)) Q:SPN2<1 D Q:MEETSRCH=1
18 . S SPN3=$G(^RMPR(665,DFN,5,SPN2,0)),SPN4=$P(SPN3,U,4),SPN3=+SPN3
19 . Q:SPN4="" Q:'$D(^RMPR(661,SPN4,0))
20 . S SPN5=$P($G(^RMPR(661,SPN4,0)),U,3) Q:SPN5=""
21 . S SPN6=$P($G(^RMPR(663,SPN5,0)),U) Q:SPN6=""
22 .; old code was looking at the whole value based on temp and was wrong
23 .; now it only looks at the 1st piece of the tmp($j
24 .; F S CN=$O(^TMP($J,"SPNPRT",ACTION,SEQUENCE,"PROSTH",CN)) Q:CN<1 I SPN6=^(CN) S MEETSRCH=1 Q:MEETSRCH=1
25 . F S CN=$O(^TMP($J,"SPNPRT",ACTION,SEQUENCE,"PROSTH",CN)) Q:CN<1 I SPN6=$P($G(^TMP($J,"SPNPRT",ACTION,SEQUENCE,"PROSTH",CN)),U,1) S MEETSRCH=1 Q:MEETSRCH=1
26 . Q
27EXIT Q MEETSRCH
28 ;
29EN2(ACTION,SEQUENCE) ; *** Prompt entry point
30 ; Input:
31 ; ACTION,SEQUENCE = Search ACTION,SEQUENCE number
32 ; Output:
33 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"PROSTH",IEN) = RATIO ^ NAME
34 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,0) = $$EN1^SPNPSR17(D0,ACTION,SEQUENCE)
35 ; SPNLEXIT = $S( User_Abort/Timeout : 1 , 1 : 0 )
36 ;
37 N DIC,AGE,DIR,DIRUT,DTOUT,DUOUT,I,SPNLFLG
38DIR K ^TMP($J,"SPNPRT",ACTION,SEQUENCE),DIR,DIC
39 F S DIC=663,DIC(0)="AEMNQZ" D Q:Y<1!(SPNLEXIT)
40 . D ^DIC
41 . I $D(DUOUT)!($D(DTOUT)) S SPNLEXIT=1 Q
42 . I Y<1 Q
43 . I $D(^TMP($J,"SPNPRT",ACTION,SEQUENCE,"PROSTH",Y)) W !!," ***You have already chosen that one***",! Q
44 . W " ",$P($G(^RMPR(663,+Y,0)),U,3) S DIC("A")="Another: "
45 . S ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"PROSTH",Y)=$P(Y,U,2)_U_$P($G(^RMPR(663,+Y,0)),U,3)
46 . Q
47 I Y<1,('SPNLEXIT) S ^TMP($J,"SPNPRT",ACTION,SEQUENCE,0)="$$EN1^SPNPSR17(D0,"""_ACTION_""","_SEQUENCE_")"
48 I SPNLEXIT K ^TMP($J,"SPNPRT",ACTION,SEQUENCE)
49 Q
Note: See TracBrowser for help on using the repository browser.