source: FOIAVistA/trunk/r/DENTAL-DEN/DENTDNJ.m@ 1754

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

initial load of FOIAVistA 6/30/08 version

File size: 4.5 KB
Line 
1DENTDNJ ;WASH ISC/TJK,JA,NCA-INPUT TO SCREEN ;10/28/96 11:54
2 ;;1.2;DENTAL;**15,23**;Oct 08, 1992
3 K DJDN
4 I '$D(DJDN)&($P(DJJ,U,2)'="") G EN2^DENTDNJ1
5 S:'$D(DJDPL) DJDPL=""
6EN ;
7 I $D(DJDN)=0 S:$D(DJKEY) DJNX=DJKEY
8 S DJQ=0,DJP=0,DJMU=0 I DJDPL'=DJNM D ^DENTDPL G TK
9EN2 D FUNC^DENTDNQ2 S V=DJF-.01 ;I '$D(DJDN),'$D(DJW) D FUNC^DENTDNQ2
10NXT S V=$O(DJJ($S($D(DJNX):DJNX-.001,1:V))) S:V="" V=-1 G LST:V<0,TK:$P(DJJ(V),U,5)&($P(DJJ(V),U,3)=.01)&('$D(DJDN)),COMPUTE^DENTDNJ2:$P(DJJ(V),U,4)["C" I $P(DJJ(V),U,5),$P(DJJ(V),U,4)'["W" G NXT
11 I $D(DENTFLG) D FUNC^DENTDNQ2 K DENTFLG
12TK K DJNX S DJMU=0,@$P(DJJ(V),U,2),DJAT=$P(DJJ(V),U,3),DJ0=^DD(DJDD,DJAT,0),DJ4=$P(DJJ(V),U,4),DJ3=$P(DJJ(V),U,3)
13 S:DJ4["M" DJMU=1 ; if a multiple, set the multiple flag
14 G LH:DJAT<0,NXT:DJAT=.001 X XY G EN2:'DJJ(V)
15 I DJ4["W" I '($D(DJDIS)!($P(DJJ(V),U,5))) X DJCP S DA=DJDN,DR=DJ3,DIE=DIC D ^DIE D N^DENTDNJ2 D:$D(Y) EN3^DENTDNJ1 G NXT
16 I DJ4["W" I $D(DJDIS)!($P(DJJ(V),U,5)=1) D WP^DENTDNJ1 G NXT
17 G:$D(DJDIS)&($D(DJDN)) LST
18 S YMLH=$O(^DENT(220.6,DJN,1,"A",V,0)) S:YMLH="" YMLH=-1
19 I $D(^DENT(220.6,DJN,1,YMLH,2)),^(2)'="" X ^(2) S @$P(DJJ(V),U,2) X XY G:$D(DJNX) NXT
20 I DJAT'=.01,$D(^DENT(220.6,DJN,1,YMLH,3)),V(V)="" S V(V)=^(3),DIE=DIC,DA=DJDN,DR=DJAT_"///"_V(V) D ^DIE D EN3^DENTDNJ1
21R ; get input from user
22 D:'$D(DJNX) HL,Z^DENTDNJ2 ; invoke the user input routine
23 I X="",DJ4["R",DJAT'=.01,V(V)="" G Q1
24 S DJXX=$E(X,1) G TK:X="^D"&($P(DJJ,U,4)=""),TK:X="^U"&($P(DJJ,U,2)=""),LS1:(X="^D"!(X="^U"))&($D(DJDN)),LS:X="^N"&($D(DJDN)) I X="^C" D FUNC^DENTDNQ2 G TK
25 I X="^R" S DA=D0,DJNM=DJDPL D ^DENTDPL D ^DENTD1 G EN^DENTDNJ
26 G T4:(DJSM!(DJXX="<")!(DJXX=">")!(X?1"^"))&($D(DJDN)),OUT:X=U&(DJAT=.01)&('$D(DJDN)),TK:X?1"^".A
27 S:$D(DJSW1) DJDIS=1 K DJSW1
28 I DJMU GOTO ^DENTDML ; if a multiple, invoke the multiple processor
29EN3 G T4:DJSM,OUT:X=""&(DJAT=.01)&('$D(DJDN)),OUT:X="^"&(DJAT=.01)&('$D(DJDN)),T1^DENTDNJ1:X="" X XY S $P(DJDB," ",DJJ(V))=" " D W(DJDB) K DJDB
30 S DJXX=$E(X,1) G U:X?1"^"&(DJAT=.01),T4:DJXX="^"!(DJXX="<")!(DJXX=">"),K1^DENTDNJ1:X?1"?".E&(DJAT[".01")&('$D(DJDN)),Q1:X?1"?".E
31 I X["^" W *7 G TK
32 I X="@" D:DJAT>0 ^DENTDNK S:DJST>1&(DJAT=.01) ^TMP($J,"DJST",DJST-1,"KEY")="" G TK:X'="@",T3
33 G ^DENTDNJ1
34T3 S V(V)=$S(X="@":"",1:X)
35 G:DJAT=.01&(V(V)="") Q G T4
36Q1 D ^DENTDNQ S @$P(DJJ(V),U,2) X XY G R
37HL G H1:'$D(V(V)),H1:V(V)="",H2
38H1 X XY W DJHIN X XY S $P(DJDB,".",DJJ(V))="."
39 I $L(DJDB)<80 W DJDB
40 E W $E(DJDB,1,80-DX),!,$E(DJDB,80-DX+1,$L(DJDB))
41 W DJLIN K DJDB X XY
42 Q
43H2 S DJDB="" S:(DJJ(V)-$L(V(V))) $P(DJDB," ",DJJ(V)-$L(V(V)))=" " X XY D W(DJDB) X XY W DJHIN X XY S V(V)=$S($D(Y(0,0)):$E(Y(0,0),1,+DJJ(V)),1:V(V))
44 I $L(V(V))<80 W V(V)
45 E W $E(V(V),1,80-DX),!,$E(V(V),80-DX+1,$L(V(V)))
46 K Y(0,0) X XY K DJDB
47 Q
48LH I DJ4["R" X DJCL W DJHIN X XY W "DATA REQUIRED",DJLIN,*7 S @$P(DJJ(V),U,2) X XY G TK
49T4 G:'($D(DJDN)) TK S @$P(DJJ(V),U,2) X XY
50 I '$D(V(V)) S $P(DJDB,".",DJJ(V))="." S $X=DX W DJLIN D W(DJDB) K DJDB G T5
51 I V(V)="" S $P(DJDB,".",DJJ(V))="." S $X=DX W DJLIN D W(DJDB) K DJDB G T5
52U I V(V)'="" S @$P(DJJ(V),U,2) X XY W DJHIN X XY S DJDB="" S:(DJJ(V)-$L(V(V))) $P(DJDB," ",DJJ(V)-$L(V(V)))=" " D W(V(V)_$G(DJDB)) K DJDB
53T5 Q:X?1"^"&($P(DJJ,U,2)="")&('$D(DJDN)) G LS1:X?1"^",NX:X'?1"^".N
54 S DJY=$P(X,U,2) I X?1"^".N,$D(DJJ(DJY)),'$P(DJJ(DJY),U,5),$P(DJJ(DJY),U,4)'["C" S V=DJY-.01 K DIC("S") G NXT
55 E X DJCL W *7,"Number is out of range or field is read only or computed." S V=V-.01 G NXT
56NX G NXT:X=">" I X="<" S DJ0=V G EN2:V<2 F V=-1:0 S V=$O(DJJ(V)) S:V="" V=-1 I $O(DJJ(V))=DJ0 G NX:DJ4["C" S V=V-.001 G NXT
57 G Q1:X["^",NXT
58P G TK:$P(DJJ,U,2)="" S DJN=$P(DJJ,U,2) S:DJN'=+DJN DJN=$O(^DENT(220.6,"B",DJN,0)) S:DJN="" DJN=-1 S DJFF=0 D REST D N^DENTDPL G EN2
59Q I $P(^DENT(220.6,DJN,0),U,3)'="" F DJK=0:0 S (DJDPL,DJNM)=$P(^DENT(220.6,DJN,0),U,3),DJN=$O(^DENT(220.6,"B",DJNM,0)) S:DJN="" DJN=-1 Q:$P(^DENT(220.6,DJN,0),U,3)=""
60 K V,DJ0,DJAT,DJDN,DJ3,DJ4,DJQ I '$D(DJW1) D ^DENTDPL G EN2
61OUT K DJSV,DJ0,DJAT,DJK,DJDN,DJ3,V,DJJ,DJQ,DIC,DJDD,DX,DY,DJSM,DJDIC,DJKEY,DO S DJFF=0 Q
62LST G ^DENTDNJ2:$D(DJDIS) S X="D"
63LS X DJCL G Q:X["N"&(DJP=0) Q:X["N"&(DJP=1)
64LS1 G:X?1"^" OUT I X["D"&($P(DJJ,U,4)]"")&($D(DJDN)) D SAVE S DJN=$P(DJJ,U,4) S DJN=$O(^DENT(220.6,"B",DJN,0)) S:DJN="" DJN=-1 S DJFF=0 D N^DENTDPL Q:$D(DJY) S (DA,W(V))=DJDN D ^DENTD1 G EN2
65 I X["D"&($P(DJJ,U,4)="") S:$P(DJJ,U,2)'="" DJFF=0 G Q
66 G:X["U" P
67 G TK
68 E W *7 G LS
69KILL K DB Q
70SAVE S %X="V(",%Y="^TMP($J,""DJ"",DJN," D %XY^%RCR K V Q
71REST K V S %X="^TMP($J,""DJ"",DJN,",%Y="V(" D %XY^%RCR Q
72W(X) ;WRITE OUT A FIELD
73 I $L(X)<80 W X
74 E W $E(X,1,80-DX),!,$E(X,80-DX+1,$L(X))
75 Q
Note: See TracBrowser for help on using the repository browser.