source: WorldVistAEHR/trunk/r/ONCOLOGY-ONC/ONCSEDEM.m@ 1720

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

initial load of WorldVistAEHR

File size: 1.7 KB
Line 
1ONCSEDEM ;Hines OIFO/SG - EDITS API (DEMO) ; 11/6/06 11:56am
2 ;;2.11;ONCOLOGY;**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 CFGNAME,MSGLST,RC,REQUEST
12 W !!?10,"DEMO CLIENT FOR THE EDITS API",!
13 D CLEAR^ONCSAPIE(1)
14 S REQUEST=$NA(^TMP("ONCSEDEM",$J,1))
15 S MSGLST=$NA(^TMP("ONCSEDEM",$J,2))
16 ;
17 ;--- Check the DLL version
18 S RC=$$CHKVER^ONCSAPIV(.ONCSAPI)
19 D:RC<0 PRTERRS^ONCSAPIE(),CLEAR^ONCSAPIE()
20 ;
21 D
22 . ;--- Ask user for configuration name
23 . S RC=$$GETCFG(.CFGNAME) Q:RC
24 . ;--- Prepare and execute the EDITS request
25 . W !,"Validating the data..."
26 . S RC=$$RBQPREP^ONCSED01(.ONCSAPI,.REQUEST,CFGNAME) Q:RC<0
27 . D NAACCR(.REQUEST)
28 . S RC=$$RBQEXEC^ONCSED01(.ONCSAPI,.REQUEST,MSGLST) Q:RC<0
29 . I RC>0 D Q:RC<0
30 . . N %ZIS,IOP,POP
31 . . S %ZIS("B")="BROWSER"
32 . . D ^%ZIS Q:$G(POP) U IO
33 . . S RC=$$REPORT^ONCSED01(.ONCSAPI,MSGLST,"MT")
34 . . D ^%ZISC
35 ;
36 ;--- Error processing and cleanup
37 D:RC<0 PRTERRS^ONCSAPIE()
38 K ^TMP("ONCSEDEM",$J)
39 Q
40 ;
41 ;***** ASKS USER FOR CONFIGURATION NAME
42 ;
43 ; .CFGNAME Reference to a local variable where the name
44 ; will be returned to.
45 ;
46 ; Return values:
47 ;
48 ; <0 Error Descriptor (see ^ONCSAPI for details)
49 ; 0 Ok
50 ; 1 User canceled the output ('^' was entered)
51 ; 2 Timeout
52 ;
53GETCFG(CFGNAME) ;
54 N DA,DIR,DIRUT,DTOUT,DUOUT,RC,X,Y
55 S CFGNAME=""
56 S DIR(0)="FO",DIR("B")="DEFAULT"
57 S DIR("A")="Configuration name"
58 D ^DIR
59 S RC=$S($D(DUOUT):1,$D(DTOUT):2,1:0) Q:RC RC
60 S CFGNAME=X
61 Q 0
62 ;
63 ;***** GENERATES A NAACCR RECORD WITH RANDOM DATA
64NAACCR(ONCDST) ;
65 N I,TMP
66 F I=1:1:10 D
67 . S TMP="",$P(TMP,$C(64+$R(58)),$R(513)+1)=""
68 . D WRITE^ONCSNACR(.ONCDST,TMP)
69 Q
Note: See TracBrowser for help on using the repository browser.