source: FOIAVistA/tag/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGREG0.m@ 1235

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1DGREG0 ;ALB/JDS/AEG-REGISTER A PATIENT, CONT. ;03 OCT 85
2 ;;5.3;Registration;**108,121,91,149,326,624**;Aug 13, 1993
3REFILE F I=0,1,2,3 S A(I)="" S:$D(^DPT(DFN,"DIS",DFN1,I)) A(I)=^(I)
4 S DIV=$S('$D(^DG(40.8,+$P(A(0),"^",4),0)):1,1:$P(A(0),"^",4))
5 ;I $D(^DIC(195.4,1,"UP")) I ^("UP") S $P(DGFC,U,1)=DIV D ADM^RTQ3
6 S X=+$P(A(0),"^",4),X=$S($D(^DG(40.8,X,"DEV")):^("DEV"),1:"1^1^1") F I=1:1:3 S:'$D(DGIO($P("10^PRF^RT","^",I))) DGIO($P("10^PRF^RT","^",I))=$S($P(X,U,I)]"":$P(X,U,I),1:1)
7 S DGIO("HS")=DGIO("PRF") ;HS DEVICE=PROFILE DEVICE
8 F I=10,"PRF","RT" I $D(DGIO(I)) S DGHIO(I)=DGIO(I)
9 F I=1010,1010.176,1010.18,1010.17 S B(I)="" S:$D(^DPT(DFN,I)) B(I)=^(I)
10 S INTL="",INTL=$$GET1^DIQ(200,+$P(A(0),"^",5),1,"I") S:INTL="" INTL=0
11 S I=1010,B(I)=$P(A(0),"^",3)_"^"_$P(B(I)_"^^^^^^^^^","^",2,8)_"^"_(+A(0))_"^"_INTL_"^"_$P(B(I),"^",11,99)
12 S:A(1)'="" B(1010.18)=A(1) S I1=$P(A(2),"^",6),I1=$P($S($D(^DIC(36,+I1,0)):^(0),1:""),"^",1),I=1010.176,B(I)=$P(A(2)_"^^^^","^",2,3)_"^"_$P(A(2),"^",7)_"^"_$E(I1,1,45)_"^"_$P(B(I),5,99)
13 S X=3,X1=1,X2=2
14MOVE S S(X1)=$P(A(X),"^",X2),S(X1+1)=$P(A(X),"^",X2+1),S(X1+2)=$P(A(X),"^",X2+2),S(X1+3)=$P(A(X),"^",X2+3)_$S($D(^DIC(5,+$P(A(X),"^",X2+4),0)):", "_$P(^(0),"^",2),1:"")_$S($P(A(X),"^",X2+5)'="":" ",1:"")_$P(A(X),"^",X2+5)
15 S:S(X1+2)="" S(X1+2)=S(X1+3),S(X1+3)="" S:S(X1+1)="" S(X1+1)=S(X1+2),S(X1+2)=S(X1+3),S(X1+3)="" S:S(X1)="" S(X1)=S(X1+1),S(X1+1)=S(X1+2),S(X1+2)=S(X1+3),S(X1+3)=""
16 S I1=S(1) F I=2:1:4 S:S(I)'="" I1=I1_"/"_S(I)
17 S:$P(A(3),"^",8)'="" I1=I1_" "_$P(A(3),"^",8) S I1=$E(I1,1,45),I=1010.17,B(I)=$P(B(I)_"^^^","^",1,3)_"^"_$P(A(3),"^",1)_"^"_I1_"^"_$P(B(I),"^",6,99)
18 F I=1010,1010.176,1010.17,1010.18 S:B(I)'=""&(B(I)'?1"^"."^") ^DPT(DFN,I)=B(I)
19 K B,S,I,I1,L,L1,L2,LL,LL1,LL2,DR,DEF
20 D MT
21 D CP
22 D EN1^DGEN(DFN) ;enrollment
23W1 F I=10,"PRF","RT","HS" I $D(DGHIO(I)) S DGIO(I)=DGHIO(I)
24 K DGHIO
25 G ^DGREG00
26Q K:'$D(DGASKDEV) DGIO
27Q1 ;If Send HL7 V2.3 messaging flag is set to SEND or SUSPEND and
28 ;If user exits Register a Patient option or 10-10t Registration
29 ;having edited some fields but not completing the Registration
30 ;then send an A08 message
31 I $P($$SEND^VAFHUTL(),"^",2) D HL7A08^VAFCDD01
32 ;
33QE K %,%DT,A,B,ANS,APD,B,CURR,DA,DB,DE,DEF,DGCLPR,DGDAY,DGDFN,DGE,DGERR,DGL,DGLL,DFMD,DGNEW,DGO,DIC,DIE,DINUM,DOW,DP,DR,I,I1,IOZBK,IOZFO,L,L1,L2,LL,LL1,LL2,MDCARD,PARA,PRF,RT,S,SC,SEEN
34 K VAFHMRG,VAFHBEF,VAFHFLG,VET,X,X1,X2,Y,Y1,ZTSK,D0,D1,DIV,DLAYGO,J,PGM,Z
35 G A^DGREG:('$D(DGRPFEE)&('$D(RGMPI))) Q
36 ;
37DT G DT^DIQ:Y
38 Q
39SSD Q:'$D(^DPT(DA(1),.321)) S DGZ1=0 F I=1:1:3 I $P(^DPT(DA(1),.321),"^",I)["Y" S DGZ1=1 Q
40 I 'DGZ1 K DGZ1 Q
41 S:'$D(^DPT("ASDPSD","B",SDIV,(9999999-DA)\1,DA(1))) ^(DA(1))=0 S:'$D(^DPT("ASDPSD","C",SDIV,SDX,9999999-DA,DA(1))) ^(DA(1))="E"
42 K DGZ1 Q
43SSDK I $D(^DPT("ASDPSD","C",SDIV,SDX,(9999999-DA),DA(1))) K ^(DA(1))
44 Q
45 ;
46CP ;If not (autoexempt or MTested) & no CP test this year then
47 ;prompt for add/edit cp test
48 N DIV,DGIB,DGIBDT,DGX,X,DIRUT,DTOUT
49 G:'$P($G(^DG(43,1,0)),U,41) QTCP ;USE CP FLAG
50 S DGIBDT=$S($D(DFN1):9999999-DFN1,1:DT)
51 D EN^DGMTCOR
52 I +$G(DGNOCOPF) S DGMTCOR=0
53 I DGMTCOR D THRESH^DGMTCOU1(DGIBDT) D EDT^DGMTCOU(DFN,DT)
54 K DGNOCOPF
55QTCP Q
56MT ;Check if user requires a means test. Ask user if s/he wants to
57 ;proceed if one is required.
58 N DGREQF,DIV
59 D EN^DGMTR
60 I DGREQF D MTDT:APD\1<DT,EDT^DGMTU(DFN,DT):$P($$MTS^DGMTU(DFN),U,2)="R"
61 Q
62 ;
63MTDT ;Date of Test should be the same as the Registration Date
64 N DA,DGMT,DGMTA,DGMTACT,DGMTDT,DGMTI,DGMTINF,DGMTP,DGMTYPT,DIE,DR
65 S DGMT=$$LST^DGMTU(DFN) G MTDTQ:$P(DGMT,"^",2)'=DT
66 S DGMTI=+DGMT,DGMTDT=APD\1,DGMTYPT=1
67 S DGMTACT="STA" D PRIOR^DGMTEVT
68 S DIE="^DGMT(408.31,",DA=DGMTI,DR=".01///^S X="_DGMTDT D ^DIE
69 D AFTER^DGMTEVT S DGMTINF=1 D EN^DGMTEVT
70MTDTQ Q
Note: See TracBrowser for help on using the repository browser.