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

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

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1SPNPSR08 ;HIRMFO/DAD,WAA-HUNT: SCI LEVEL OF INJURY ;8/1/95 14:29
2 ;;2.0;Spinal Cord Dysfunction;**12**;01/02/1997
3 ;
4EN1(D0,BNLOI,ENLOI) ; *** 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,"BEGINNING SCI LEVEL") = NLOI# ^NLOI
9 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"ENDING SCI LEVEL") = NLOI# ^ NLOI
10 ; BNLOI = Beginning NLOI
11 ; ENLOI = Ending NLOI
12 ; Output:
13 ; $S( D0_Meets_Search_Criteria : 1 , 1 : 0 )
14 ;
15 N DFN,I,MEETSRCH,NLOI
16 S MEETSRCH=0
17 S NLOI=$$NLOI($P($G(^SPNL(154,D0,2)),U))
18 I NLOI'<BNLOI,NLOI'>ENLOI S MEETSRCH=1
19 Q MEETSRCH
20 ;
21EN2(ACTION,SEQUENCE) ; *** Prompt entry point
22 ; Input:
23 ; ACTION,SEQUENCE = Search ACTION,SEQUENCE number
24 ; Output:
25 ; SPNLEXIT = $S( User_Abort/Timeout : 1 , 1 : 0 )
26 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"BEGINNING SCI LEVEL") = NLOI# ^NLOI
27 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"ENDING SCI LEVEL") = NLOI# ^ NLOI
28 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,0) = $$EN1^SPNPSR08(D0,BNLOI,ENLOI)
29 ;
30 N DIR,DIRUT,DTOUT,DUOUT,I,NLOI
31 K ^TMP($J,"SPNPRT",ACTION,SEQUENCE),DIR
32 S DIR(0)="POA^154.01:AEMNQZ"
33 S DIR("A")="SCI Level start value: "
34 S DIR("?")="Enter the top-most vertebral level desired"
35 D ^DIR S NLOI("BEGINNING SCI LEVEL")=Y,BNLOI=$$NLOI(Y)
36 S SPNLEXIT=$S($D(DTOUT):1,$D(DUOUT):1,1:0)
37 I 'SPNLEXIT D
38 . K DIR S DIR(0)="POA^154.01:AEMNQZ^K:$$NLOI^SPNPSR08(Y)<$$NLOI^SPNPSR08(NLOI(""BEGINNING SCI LEVEL"")) X"
39 . S DIR("A")="SCI Level end value: "
40 . S DIR("?")="Enter the bottom-most vertebral level desired"
41 . D ^DIR S NLOI("ENDING SCI LEVEL")=Y I Y'="" S ENLOI=$$NLOI(Y)
42 . Q
43 S SPNLEXIT=$S($D(DTOUT):1,$D(DUOUT):1,1:0)
44 I 'SPNLEXIT,Y'="" D
45 . F I="BEGINNING SCI LEVEL","ENDING SCI LEVEL" S ^TMP($J,"SPNPRT",ACTION,SEQUENCE,I)=$$NLOI(NLOI(I))_U_$P(NLOI(I),U,2)
46 . S ^TMP($J,"SPNPRT",ACTION,SEQUENCE,0)="$$EN1^SPNPSR08(D0,"_BNLOI_","_ENLOI_")"
47 . Q
48 Q
49NLOI(D0) ; *** Convert NLOI to number
50 ; Input:
51 ; D0 = SCD NLOI CATEGORY file (#154.01) IEN
52 ; Output:
53 ; Cervical=1, Thoracic=2, Lumbar=3, Sacral=4, Unknown=999
54 ; e.g., T05 ==> 205
55 N X S X=$P($G(^SPNL(154.01,+D0,0)),U)
56 Q $S(X="UNK":999,X?1U2N:$TR(X,"CTLS","1234"),1:0)
Note: See TracBrowser for help on using the repository browser.