1 | TIUFC ; SLC/MAM - LM Template C (Create DDEF) INIT, Action NEXT LEVEL ;4/28/97 21:46
|
---|
2 | ;;1.0;TEXT INTEGRATION UTILITIES;;Jun 20, 1997
|
---|
3 | EN ; -- main entry point for LM Template TIUFC CREATE DDEF
|
---|
4 | ; Requires TIUFWHO, set in options TIUFC CREATE DDEFS MGR/NATL
|
---|
5 | ; TIUFCBEG is used to set message bar msgs:
|
---|
6 | ; TIUFCBEG = 1 if done EN, no more, not even Start Over.
|
---|
7 | ; 0 if Selected any action
|
---|
8 | ; C in TIUFCDA,TIUFDITM,TIUFCNM,TIUFCTYP,TIUFCTDA,TIUFCLPS stands for
|
---|
9 | ;Current Position, the highlighted line.
|
---|
10 | N TIUF,TIUFCMSG,CREATEDA,CREATENM,TIUFCONE,TIUFCBEG,TIUFCDA,TIUFCITM,TIUFCNM,TIUFTMPL,TIUFCTYP,TIUFCTDA,TIUFCLPS,TIUFVCN1,XQORM,TIUFXNOD,TIUFLFT
|
---|
11 | S TIUFTMPL="C",TIUFCLPS=0
|
---|
12 | N TIUFPRIV D SETUP^TIUFL S:$D(DTOUT) VALMQUIT=1 G:$G(VALMQUIT) ENX
|
---|
13 | S TIUFCBEG=1
|
---|
14 | I "NM"[TIUFWHO D EN^VALM("TIUFC CREATE DDEFS MGR")
|
---|
15 | ENX Q
|
---|
16 | ;
|
---|
17 | HDR ; -- header code
|
---|
18 | S VALMHDR(1)=$$CENTER^TIUFL("BASICS",79)
|
---|
19 | Q
|
---|
20 | ;
|
---|
21 | HEADER ; Header field of Protocol TIUFC ACTION MENU.
|
---|
22 | N DEFAULT
|
---|
23 | I $G(TIUFCONE) S TIUFCBEG=0 ;used in $$vmsg
|
---|
24 | I '$G(TIUFCONE) S TIUFCONE=1
|
---|
25 | S VALMSG=$$VMSG^TIUFL
|
---|
26 | D SHOW^VALM
|
---|
27 | S TIUFCITM=$$HASITEMS^TIUFLF1(TIUFCDA) ;Update since items could have been deleted
|
---|
28 | S DEFAULT=$S($G(TIUFCTYP)="CL"&'$G(TIUFCITM):"Class/DocumentClass",$G(TIUFCTYP)="CL":"Next Level",$G(TIUFCTYP)="DC":"Title",$G(TIUFCTYP)="TL":"Component",$G(TIUFCTYP)='"CO":"Next Level",1:"")
|
---|
29 | S XQORM("B")=$S(VALMCNT'>(VALMBG+VALM("LINES")-1):DEFAULT,1:"Next Screen")
|
---|
30 | Q
|
---|
31 | ;
|
---|
32 | INIT ; -- init variables and list array
|
---|
33 | D INIT^TIUFH I $D(DTOUT) G INITX
|
---|
34 | S TIUFCDA=^TMP("TIUF",$J,"CLINDOC") ;IFN of Current Position in Hier
|
---|
35 | S TIUFCNM="CLINICAL DOCUMENTS",TIUFCITM=$$HASITEMS^TIUFLF1(TIUFCDA),TIUFCTYP="CL"
|
---|
36 | K TIUFCMSG
|
---|
37 | S VALMBG=1
|
---|
38 | S TIUFCMSG(1)=" To create a new CLINICAL DOCUMENTS, Select Class/DocumentClass; or to Go Down a"
|
---|
39 | I VALMCNT'>VALM("LINES") S TIUFCMSG(2)="Level, Select NEXT LEVEL." G INITX
|
---|
40 | I VALMCNT>VALM("LINES") S TIUFCMSG(2)="Level, Screen to (+/-) Desired CLINICAL DOCUMENTS Item, and Select NEXT LEVEL."
|
---|
41 | INITX I $D(DTOUT) S VALMQUIT=1
|
---|
42 | Q
|
---|
43 | ;
|
---|
44 | NEXT ; TEMPLATE C Action Next Level: Navigate hierarchy.
|
---|
45 | ; Called by Protocol TIUFC ACTION NEXT LEVEL
|
---|
46 | ; Requires TIUFI,TIUFCNM,TIUFCDA,TIUFCITM
|
---|
47 | N LINENO,INFO,BEG,END,XPDLCNT,DIR,X,Y,NODE0,LINENO,IINFO,NMWIDTH,TIUFY
|
---|
48 | N MISSITEM,TIUFXNOD,XFLG,IFILEDA,DTOUT,DIRUT,DIROUT,ILINE
|
---|
49 | S VALMBCK="",TIUFXNOD=$G(XQORNOD(0))
|
---|
50 | S LINENO=$O(^TMP("TIUF1IDX",$J,"DAF",TIUFCDA,""))
|
---|
51 | S INFO=^TMP("TIUF1IDX",$J,LINENO),XPDLCNT=$P(INFO,U,3)
|
---|
52 | S BEG=(LINENO+1),END=LINENO+XPDLCNT
|
---|
53 | I TIUFCTYP="TL" W !!," You are already at the bottom Level. To create Components, enter Component,",!,"or to create Subcomponents, select Detailed Display for the Component, then",!,"edit Items of Component.",! D PAUSE^TIUFXHLX G NEXTX
|
---|
54 | I 'TIUFCITM W !!," No Items: You must Create Items at this level before going down a level.",! D PAUSE^TIUFXHLX G NEXTX
|
---|
55 | S TIUFY=+$P($P(TIUFXNOD,U,4),"=",2) I TIUFY'<BEG,TIUFY'>END,$D(^TMP("TIUF1IDX",$J,TIUFY)) G POSTSEL
|
---|
56 | K TIUFY
|
---|
57 | S DIR(0)="NA^"_BEG_":"_END_":0"
|
---|
58 | S DIR("?",1)=" Your Current Position in the Hierarchy is "_TIUFCNM_"."
|
---|
59 | S DIR("?",2)="You have chosen to go down another level. This means you must select an Item"
|
---|
60 | S DIR("?")="of "_TIUFCNM_", Line "_BEG_"-"_END_"."
|
---|
61 | I TIUFCITM S DIR("A")=" Select "_TIUFCNM_" Item (Line "_BEG_"-"_END_"): " D ^DIR S TIUFY=Y K DIR,X,Y I 'TIUFY G NEXTX
|
---|
62 | POSTSEL S VALMBCK="R"
|
---|
63 | S IINFO=^TMP("TIUF1IDX",$J,TIUFY),TIUFCDA=$P(IINFO,U,2),TIUFCTDA=$P(IINFO,U,6)
|
---|
64 | S ILINE=^TMP("TIUF1",$J,TIUFY,0)
|
---|
65 | S NODE0=^TIU(8925.1,TIUFCDA,0),TIUFCTYP=$P(NODE0,U,4) S:TIUFCTYP="DOC" TIUFCTYP="TL"
|
---|
66 | I TIUFCTYP="" W !!," Entry has no Type. Can't select entry",! D PAUSE^TIUFXHLX G NEXTX
|
---|
67 | S TIUFCNM=$P(NODE0,U) I $L(TIUFCNM)>30 S TIUFCNM=$E(TIUFCNM,1,30)
|
---|
68 | K TIUFCMSG
|
---|
69 | D PARSE^TIUFLLM(.INFO)
|
---|
70 | S VALMCNT=VALMCNT-XPDLCNT D COLLAPSE^TIUFH1(.INFO) S TIUFCLPS=1
|
---|
71 | ; Has already been expanded; so items exist in file:
|
---|
72 | S LINENO=+INFO+1
|
---|
73 | D CEXPAND1 S VALMCNT=VALMCNT+1,TIUFCLPS=0
|
---|
74 | D CNTRL^VALM10(LINENO-1,8,^TMP("TIUF",$J,"NMWIDTH"),IOINORM,IOINORM)
|
---|
75 | D CNTRL^VALM10(LINENO,8,^TMP("TIUF",$J,"NMWIDTH"),IOINHI,IOINORM)
|
---|
76 | D PARSE^TIUFLLM(.IINFO)
|
---|
77 | S IFILEDA=$P(IINFO,U,2),MISSITEM=$$MISSITEM^TIUFLF4(IFILEDA)
|
---|
78 | I MISSITEM W !!," Corrupt Database: File Entry "_IFILEDA_" Has Nonexistent Item "_MISSITEM_" ; See IRM",! D PAUSE^TIUFXHLX S VALMBCK="" G NEXTX
|
---|
79 | D EXPAND1^TIUFH1(.IINFO)
|
---|
80 | S VALMCNT=VALMCNT+IINFO("XPDLCNT")
|
---|
81 | S VALMBG=+INFO
|
---|
82 | S TIUFCITM=$S($P(IINFO,U,3):1,1:0)
|
---|
83 | I TIUFCTYP="TL" S TIUFCMSG(1)=" You have reached the bottom of the tree. Select COMPONENT to create a",TIUFCMSG(2)="Component of "_TIUFCNM_". (SubComponents are created using Detailed Display",TIUFCMSG(3)="and then Item.)" G NEXTX
|
---|
84 | S TIUFCMSG(1)=" Select "_$S(TIUFCTYP="DC":"TITLE",1:"CLASS/DOCUMENTCLASS")_" to create a new "_TIUFCNM
|
---|
85 | S TIUFCMSG(2)="or to Go Down a Level, Select NEXT LEVEL."
|
---|
86 | I VALMCNT>VALM("LINES") S TIUFCMSG(2)="or to Go Down a Level, Screen to (+/-) Desired ",TIUFCMSG(3)=TIUFCNM_" Item, and Select NEXT LEVEL."
|
---|
87 | NEXTX I $D(DTOUT) S VALMBCK="Q"
|
---|
88 | Q
|
---|
89 | ;
|
---|
90 | CEXPAND1 ; Set selected Next Level item of current branch into LM array (i.e. expands current branch to include next level. DOESN'T Update INFO.
|
---|
91 | S $P(ILINE," ")=LINENO_$S($L(LINENO)<$L(+IINFO):" ",1:"")
|
---|
92 | S ^TMP("TIUF1",$J,LINENO,0)=ILINE
|
---|
93 | S $P(IINFO,U)=LINENO,^TMP("TIUF1IDX",$J,LINENO)=IINFO
|
---|
94 | S ^TMP("TIUF1",$J,"IDX",LINENO,LINENO)=""
|
---|
95 | S ^TMP("TIUF1IDX",$J,"DAF",TIUFCDA,LINENO)=""
|
---|
96 | S $P(^TMP("TIUF1IDX",$J,+INFO),U,3)=1
|
---|
97 | Q
|
---|
98 | ;
|
---|
99 | EXIT ; -- exit code
|
---|
100 | K ^TMP("TIUF1",$J),^TMP("TIUFB",$J),^TMP("TIUF1IDX",$J),^TMP("TIUFBIDX",$J),^TMP("TIUF",$J),IOELALL
|
---|
101 | D CLEAN^VALM10
|
---|
102 | Q
|
---|
103 | ;
|
---|