source: FOIAVistA/trunk/r/ONCOLOGY-ONC/ONCSAPID.m@ 1354

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

initial load of FOIAVistA 6/30/08 version

File size: 4.1 KB
Line 
1ONCSAPID ;Hines OIFO/SG - COLLABORATIVE STAGING (DEMO) ; 12/7/06 9:33am
2 ;;2.11;ONCOLOGY;**40,47**;Mar 07, 1995;Build 19
3 ;
4 Q
5 ;
6 ;***** DEMO ENTRY POINT
7 ;
8 ; [.ONCSAPI] Reference to the API descriptor (see ^ONCSAPI)
9 ;
10DEMO(ONCSAPI) ;
11 N DISPLAY,EXIT,I,INPUT,RC,STATUS,STORE
12 W !!?10,"DEMO CLIENT FOR THE COLLABORATIVE STAGING API",!
13 D CLEAR^ONCSAPIE(1)
14 ;--- Check the DLL version
15 S RC=$$CHKVER^ONCSAPIV(.ONCSAPI)
16 D:RC<0 PRTERRS^ONCSAPIE()
17 ;
18 ;---
19 S EXIT=0
20 F D Q:EXIT
21 . D CLEAR^ONCSAPIE()
22 . ;--- Review/Edit input values
23 . S RC=$$INPUT(.INPUT)
24 . I RC<0 S EXIT=1 Q
25 . ;--- Call the CS API
26 . S RC=$$CALC^ONCSAPI3(.ONCSAPI,.INPUT,.STORE,.DISPLAY,.STATUS)
27 . ;--- Display the output values
28 . W !!,"Output values of the Collaborative Staging API",!
29 . I $D(STORE)>1 S I="" D W !
30 . . F S I=$O(STORE(I)) Q:I="" D
31 . . . W !?2,$NA(STORE(I))_"="""_$G(STORE(I))_""""
32 . . . W ?42,$NA(DISPLAY(I))_"="""_$G(DISPLAY(I))_""""
33 . I RC D D ZW^ONCSAPIU("STATUS")
34 . . W !,"$$CALC^ONCSAPI3="""_RC_"""",!
35 . ;--- Display formatted error messages
36 . D:RC<0 PRTERRS^ONCSAPIE()
37 . ;--- Pause the output
38 . S EXIT=$$PAGE^ONCSAPIU() W !
39 ;---
40 Q
41 ;
42 ;***** USER INPUT FOR THE DEMO ENTRY POINT
43 ;
44 ; .ONCINP Reference to a local variable for input parameters
45 ;
46 ; Return values:
47 ;
48 ; -2 Timeout
49 ; -1 User entered an up-arrow
50 ; 0 Ok
51 ;
52INPUT(ONCINP) ;
53 ;;HIST ^8000^4^Histologic Type ICD-O-3
54 ;;SITE ^C000^4^Primary Site
55 ;;BEHAV ^3 ^1^Behavior Code ICD-O-3
56 ;;GRADE ^1 ^1^Grade
57 ;;AGE ^043 ^3^Age at Diagnosis
58 ;;SIZE ^010 ^3^CS Tumor Size^1
59 ;;EXT ^20 ^2^CS Extension^2
60 ;;EXTEVAL ^0 ^1^CS Size/Ext Eval^3
61 ;;NODES ^11 ^2^CS Lymph Nodes^4
62 ;;NODESEVAL^0 ^1^CS Reg Nodes Eval^5
63 ;;LNPOS ^98 ^2^Regional Nodes Positive^6
64 ;;LNEXAM ^00 ^2^Regional Nodes Examined^7
65 ;;METS ^00 ^2^CS Mets at DX^8
66 ;;METSEVAL ^0 ^1^CS Mets Eval^9
67 ;;SSF1 ^001 ^3^CS Site-Specific Factor 1^10
68 ;;SSF2 ^000 ^3^CS Site-Specific Factor 2^11
69 ;;SSF3 ^000 ^3^CS Site-Specific Factor 3^12
70 ;;SSF4 ^000 ^3^CS Site-Specific Factor 4^13
71 ;;SSF5 ^000 ^3^CS Site-Specific Factor 5^14
72 ;;SSF6 ^000 ^3^CS Site-Specific Factor 6^15
73 ;
74 N DIR,DIRUT,DTOUT,DUOUT,FLDLST,ICOL,IFLD,IIF,IROW,ML,NAME,NFL,NR,ONCBUF,RC,TABLE,TMP,VAL,X,Y
75 W !,"Input values for Collaborative Staging API"
76 S RC=0
77 ;--- Determine number of fields and load default values
78 F NFL=1:1 S TMP=$P($T(INPUT+NFL),";;",2) Q:TMP="" D
79 . S FLDESCR(NFL)=TMP,NAME=$TR($P(TMP,U)," ")
80 . S:'$D(ONCINP(NAME)) ONCINP(NAME)=$TR($P(TMP,U,2)," ")
81 S NFL=NFL-1
82 ;
83 ;--- Review and/or edit field values
84 F W ! D Q:RC
85 . ;--- Display current values
86 . S NR=NFL\2
87 . F IROW=1:1:NR W ! D
88 . . F ICOL=1,2 D
89 . . . S IFLD=NR*(ICOL-1)+IROW,X=(ICOL-1)*40
90 . . . S TMP=$P($T(INPUT+IFLD),";;",2),NAME=$TR($P(TMP,U)," ")
91 . . . W ?(X+2),"["_$J(IFLD,2)_"] "_$P(TMP,U,4)
92 . . . W ?(X+35),$G(ONCINP(NAME))
93 . ;
94 . ;--- Ask for field(s) to be edited
95 . K DIR
96 . S DIR(0)="LO^1:"_NFL_":0"
97 . S DIR("A")="Select a field"
98 . S DIR("?")="Enter field number(s), '^' to exit, or hit RETURN to call the CS API."
99 . W ! D ^DIR
100 . I $D(DTOUT) S RC=-2 Q
101 . I $D(DUOUT) S RC=-1 Q
102 . I '$G(Y) S RC=1 Q
103 . S FLDLST=Y
104 . ;
105 . F IIF=1:1 S IFLD=$P(FLDLST,",",IIF) Q:IFLD'>0 D Q:RC<0
106 . . ;--- Edit the field value
107 . . S TMP=$P($T(INPUT+IFLD),";;",2)
108 . . S NAME=$TR($P(TMP,U)," "),ML=+$TR($P(TMP,U,3)," ")
109 . . S TABLE=+$TR($P(TMP,U,5)," ")
110 . . K DIR
111 . . S DIR(0)="FO^1:"_ML
112 . . S:TABLE>0 $P(DIR(0),U,3)="D INPUT^ONCSAPI1("_TABLE_","_ML_",,$G(ONCINP(""SITE"")),$G(ONCINP(""HIST"")))"
113 . . S DIR("A")=$P(TMP,U,4)
114 . . S DIR("B")=$G(ONCINP(NAME))
115 . . S X=$S(ML>1:ML_" characters",1:"1 character")
116 . . S DIR("?")="Enter the field value ("_X_")"
117 . . S:TABLE>0 DIR("??")="^D HELP^ONCSAPI1("_TABLE_",,$G(ONCINP(""SITE"")),$G(ONCINP(""HIST"")))"
118 . . W !
119 . . S TMP=$$TBLTTL^ONCSAPIT(,$G(ONCINP("SITE")),$G(ONCINP("HIST")),TABLE)
120 . . I TMP'<0 D:$P(TMP,U,3)'="" WW^ONCSAPIU($P(TMP,U,3),75)
121 . . D ^DIR
122 . . I $D(DTOUT) S RC=-2 Q
123 . . I $D(DUOUT) S RC=-1 Q
124 . . S ONCINP(NAME)=Y
125 . S:(RC=-1)!(RC=-2) RC=0
126 ;---
127 Q $S(RC<0:RC,1:0)
Note: See TracBrowser for help on using the repository browser.