source: WorldVistAEHR/trunk/r/ENROLLMENT_APPLICATION_SYSTEM-EAS/EASAILK1.m@ 813

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

initial load of WorldVistAEHR

File size: 1.9 KB
RevLine 
[613]1EASAILK1 ;ALB/BRM - Patient Address Inquiry ; 3/10/03 3:42pm
2 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**13,29,39**;Mar 15, 2001
3 ;
4PATADDR ;view patient address
5 ;
6 N PATNAM,IENS,ZTSAVE
7 N DTOUT,DUOUT,DIRUT,DIROUT,%ZIS,DIC,DA,DIQ,DLAYGO,Y,X
8 ;
9 ; prompt user for patient name and device
10 S DIC="^DPT(",DIC(0)="AEMQ" D ^DIC
11 Q:($D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)!(Y=-1))
12 S %ZIS="Q"
13 S IENS=+Y_",",PATNAM=$P(Y,"^",2)
14 S ZTSAVE("IENS")="",ZTSAVE("PATNAM")=""
15 D EN^XUTMDEVQ("QUE^EASAILK1","PATIENT ADDRESS INQUIRY",.ZTSAVE,.%ZIS)
16 Q
17QUE ;
18 N OK,FLD,ARY,PATADDR,ERR,ARRAY
19 ;
20 D GETS^DIQ(2,IENS,".111:.121","E","PATADDR","ERR")
21 W !?11,"Patient Name: ",?26,PATNAM
22 ;
23 ; exit if error occurs during DIQ call
24 I $D(ERR) W !!?11,"*** Address could not be determined ***",!! G END
25 ;
26 ; exit if there is no address for patient
27 S FLD="",OK=0
28 F S FLD=$O(PATADDR(2,IENS,FLD)) Q:'FLD!(OK) S:$G(PATADDR(2,IENS,FLD,"E"))]"" OK=1
29 I 'OK W !!?11,"*** No Address On File For This Patient ***",!! G END
30 ;
31 ; display address information
32 W !?8,"Patient Address: ",?26,$S($G(PATADDR(2,IENS,.111,"E"))]"":$G(PATADDR(2,IENS,.111,"E")),1:"UNKNOWN STREET ADDRESS")
33 W:$G(PATADDR(2,IENS,.112,"E"))]"" !?26,$G(PATADDR(2,IENS,.112,"E"))
34 W:$G(PATADDR(2,IENS,.113,"E"))]"" !?26,$G(PATADDR(2,IENS,.113,"E"))
35 W !?26,$S($G(PATADDR(2,IENS,.114,"E"))]"":$G(PATADDR(2,IENS,.114,"E")),1:"UNKNOWN CITY")_", "
36 W $S($G(PATADDR(2,IENS,.115,"E"))]"":$G(PATADDR(2,IENS,.115,"E")),1:"UNKNOWN STATE")_" "
37 W:$G(PATADDR(2,IENS,.1112,"E"))]"" $G(PATADDR(2,IENS,.1112,"E"))
38 W !?2,"Bad Address Indicator: ",?26,$G(PATADDR(2,IENS,.121,"E"))
39 W !!?4,"Address Change Date: ",?26,$G(PATADDR(2,IENS,.118,"E"))
40 W !?2,"Address Change Source: ",?26,$G(PATADDR(2,IENS,.119,"E"))
41 W:$G(PATADDR(2,IENS,.119,"E"))="VAMC" !?4,"Address Change Site: ",?26,$G(PATADDR(2,IENS,.12,"E"))
42 W !!
43END ; common exit point - reset device and prompt user for another name
44 K %ZIS D ^%ZISC,HOME^%ZIS
45 G PATADDR
46 Q
Note: See TracBrowser for help on using the repository browser.