source: WorldVistAEHR/trunk/r/DENTAL-DEN/DENTCRD1.m@ 862

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

initial load of WorldVistAEHR

File size: 3.9 KB
Line 
1DENTCRD1 ;ISC2/HCD,SAW-PROCESS DENTAL CARDS (CON'T) ;9/24/99 09:26
2 ;;1.2;DENTAL;**3,11,13,16,19,21,24,28**;JAN 26, 1989
3C S:X=" " X="" I X=""&($P(^DD(221,F,0),"^",2)'["R") G A
4 X $P(^DD(221,F,0),"^",5,99) I '$D(X) S E1=1 G E
5A Q:E S D2=D2_X_"^" Q
6E S E=1 W !,"ERROR--",$P(^DD(221,F,0),"^",1)," entry is incorrect." Q
7F S X=$S(X=8:10,X=9:20,1:""),X=$S(X1=" ":X,1:X+X1) Q
8CC ;;.01;1;.5;3;4;5;6;7;8;.4;10;11;12;38;14;15;16;17;4.5;19;39;21;22;23;24;25;6.7;27;28;29;30;31;32;33;34;35;36;37;2;.3;7.1;6.2;6.4;6.6;6.8
9DATE ;;31;28;31;30;31;30;31;31;30;31;30;31
10YN Q:$D(E1) W !,"Okay to accept this value" S %=2 D YN^DICN G YN:%=0 K:%'=1 X Q
11EN W !,D S E=0,D2="" F I=1:1:45 S F=$P($T(CC),";",I+2) D @I
12 K:E D2 G ^DENTCRD2
131 ;
14 S L1=$E(D,14),L2=$E(D,15),L3=$E(D,16),L4=$E(D,17),L5=$E(D,18)
15 I L1'=" " G:L2 ERR S Z=L1+1 G DAY
16 G:L2=" " ERR S Z=L2+3
17DAY G:Z<1!(Z>12) ERR S ZZ=$P($T(DATE),";",Z+2)
18 I Z=2 S ZZ=ZZ+$$LEAP^DENTE1(1700+$E(DT,1,3))
19 I $L(Z)=1 S Z=0_Z
20 S L3=$S(L3=7:10,L3=8:20,L3=9:30,1:0),L4=$S(L4=" "!(L4>8):0,1:L4+1),L4=L3+L4 G:L4<1!(L4>ZZ) ERR I $L(L4)=1 S L4=0_L4
21 S L5=$E(DT,2,3),L6=$E(DT,1)_L5_"01" S:DENTY XX1=$$YR(L6),L5=$E(XX1,2,3) S:$L(L5)=1 L5=0_L5 S (D1,Z)=$S(DENTY:$E(XX1,1),1:$E(DT,1))_L5_Z_L4
22 I Z'>DT D NOW^%DTC S Z=Z_"."_$P(%,".",2),Z=+Z,Z=$$CHECK^DENTE1(221,Z),(DINUM,D1)=Z G OK
23ERR S D2("B")="" G E
24OK S X=D1 D A S D2("B")=X,D2("B1")=X Q
25YR(DENTX1) ; Get last Year
26 S X1=DENTX1_"01",X2=-1 D C^%DTC S ZZ=$E(X,1,3)_$E(DENTX1,4,7)
27 Q ZZ
282 S X=$E(D,5,13) I X'?9N G E
29 I +X=1 D A S D2("D")=X,D1(39)="GROUP" Q
30 S Z=$O(^DPT("SSN",X,0)) S:Z="" X=X_"P",Z=$O(^DPT("SSN",X,0))
31 D:Z="" E Q:E D A S DFN=Z,DENTI=I,DENTX=X D DEM^VADPT S I=DENTI,X=DENTX,D1(39)=VADM(1),D2("D")=X,(D2("E"),D39)=Z K DENTI,DENTX Q
32 ;D A S D2("D")=X Q
333 S X=$E(D,1,4),Z=X,X=$O(^DENT(220.5,"C",X,0))
34 I $D(^DENT(220.5,+X,0)),$P(^(0),"^",3)="" D A S (D1(10),D2("C"))=Z,(D2("AC"),D2("AC1"))=DENTSTA_","_D2("B")_","_Z Q
35 G E
36 ;S X=$E(D,1,4) D:X'?4N E Q:E D A S (D1(10),D2("C"))=X,(D2("AC"),D2("AC1"))=DENTSTA_","_D2("B")_","_X Q
374 S X=$S($D(D39):D39,1:"") G A
385 S X="" G A
396 S Z1=$E(D,22),Z2=$E(D,23) I Z1=" "&(Z2=" ") S X="" G A
40 S X=$S(Z1'=" "&(Z2'=" "):"",Z1'=" ":Z1+1,Z2'=" ":Z2+8) I X<1!(X>15) S X="" G E
41 G A
427 S X=$E(D,24),X=$S(X=0:"S",X=1:"C",1:"") G A
438 S X=$E(D,31),X=$S(X=4:1,1:"") G A
449 S X=$E(D,32) G C
4510 S X=$S($D(D1(10)):D1(10),1:"") G A
4611 S X=$E(D,33),X1=$E(D,34) D F G C
4712 S X=$E(D,35),X=$S(X=1:1,1:"") G A
4813 S X=$E(D,36),X=$S(X=1:1,1:"") G A
4914 S X=$E(D,67),X=$S(X=1:1,1:"") G A
5015 S X=$E(D,37) G C
5116 S X=$E(D,38) G C
5217 S X=$E(D,39) G C
5318 S X=$E(D,40) G C
5419 S X1=0 F I(1)=19,20,21 I $E(D,I(1))'=" " S X1=X1+1,X=$E(D,I(1)),Z=I(1)
55 I X1>1 S E=1 W !,"ERROR-- More than one patient category has been marked." Q
56 I X1=0 S E=1 W !,"ERROR-- Patient category is missing." Q
57 S X=$S(Z=19:X+1,Z=20:X+8,1:X+13) D:Z=19&((X>8)!(X<1)) E D:Z=20&((X>17)!(X<9)) E D:Z=21&((X>22)!(X<18)) E Q:E G A
5820 S X=$E(D,41),X1=$E(D,42),X=$S(X=" ":"",1:X*10),X=$S(X1=" ":X,1:X+X1) G C
5921 S X="" G A
6022 S X=$E(D,43),X1=$E(D,44),X=$S(X=7:10,X=8:20,X=9:30,1:""),X=$S(X1=" ":X,1:X+X1) G C
6123 S X=$E(D,45) G C
6224 S X=$E(D,46) G C
6325 S X=$E(D,47) G C
6426 S X=$E(D,48),X=$S(X=1&(+$E(D,5,13)=1):4,X=1&(+$E(D,5,13)'=1):3,1:"") G A
6527 S X=$E(D,28),X=$S(X=7:1,X=8:3,1:"") G A
6628 S X=$E(D,49),X1=$E(D,50) D F G C
6729 S X=$E(D,51),X1=$E(D,52) D F G C
6830 S X=$E(D,53),X1=$E(D,54) D F G C
6931 S X=$E(D,55),X1=$E(D,56),X=$S(X=7:0,X=8:10,X=9:20,1:""),X=$S(X1=" ":X,1:X+X1) G C
7032 S X=$E(D,57) G C
7133 S X=$E(D,58) G C
7234 S X=$E(D,59) G C
7335 S X=$E(D,60),X1=$E(D,61),X=$S(X=" ":"",1:X*10),X=$S(X1=" ":X,1:X+X1) G C
7436 S X=$E(D,62),X1=$E(D,63) D F G C
7537 S X=$E(D,64) G C
7638 S X=$E(D,65),X1=$E(D,66),X=$S(X=7:10,X=8:20,X=9:30,1:""),X=$S(X1=" ":X,1:X+X1) G C
7739 S X=$S($D(D1(39)):D1(39),1:"") G A
7840 S X=DENTSTA D A Q:E S (D2("A"),D2("A1"))=DENTSTA_","_D2("B") Q
7941 S X=$E(D,30),X=$S(X=1:3,X=2:2,1:"") G C
8042 S X=$E(D,25),X=$S(X=2:1,1:"") G A
8143 S X=$E(D,26),X=$S(X=3:1,1:"") G A
8244 S X=$E(D,27),X=$S(X=4:2,1:"") G A
8345 S X=$E(D,29),X=$S(X>5:X-6,1:X) G C
Note: See TracBrowser for help on using the repository browser.