source: WorldVistAEHR/trunk/r/POLICE_AND_SECURITY-ES/ESPREGWP.m@ 701

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

initial load of WorldVistAEHR

File size: 1.7 KB
Line 
1ESPREGWP ;;ALB/CJM-ESP POLICE REGISTRATION ;1/19/1997
2 ;;1.0;POLICE & SECURITY;**17**;Mar 31, 1994
3 ;
4REGISTER(REGTYPE) ;
5 ;selects or creates a registration, then edits it
6 N NAME,NEW,DIC,DIE,DA,DR,DLAYGO
7 Q:(($G(REGTYPE)'=2)&($G(REGTYPE)'=3)&($G(REGTYPE)'=4)&($G(REGTYPE)'=5))
8 ;
9 S DIC=910.2,DIC(0)="AELMQ",DLAYGO=910.2
10 S DIC("S")="I $P(^(0),U,4)="_REGTYPE
11 D ^DIC
12 S REG=+Y,NEW=$P(Y,"^",3)
13 I REG D EDITREG(REG,REGTYPE,NEW)
14 Q
15 ;
16EDITREG(REG,REGTYPE,NEW) ;
17 N DIE,DA,DR,DLAYGO,DIC
18 S DIE=910.2,DA=REG,DR="[ESP REGISTRATION "_REGTYPE_"]",DLAYGO=910.2
19 D ^DIE
20 I $D(Y) D
21 .I NEW D DELETE(REG)
22 E D
23 .S NAME=$$GETNAME
24 .I NAME S DR=".03////^S X=NAME" D ^DIE
25 Q
26 ;
27GETNAME() ;
28 ;allows selection from Master Name Index file or creation of new name
29 ;returns ien, or 0 if none selected
30 ;
31 N DIC,D,DINUM,DR,X,DLAYGO,DIR,Y,QUIT,NEW,NAME
32 S (QUIT,NEW,NAME)=0
33 F Q:QUIT D
34 .W !!,"Who should it be registered to?",!!
35 .S DIC="^ESP(910,",DIC(0)="AELMQ",DLAYGO=910,DIC("A")="Enter Registrant: "
36 .D ^DIC
37 .S NAME=$S(+Y<0:0,1:+Y)
38 .I 'NAME S QUIT=1 Q
39 .S NEW=$P(Y,"^",3)
40 .I NEW S QUIT=1 Q
41 .I 'NEW D
42 ..N DIR
43 ..S DIR(0)="Y"
44 ..S DIR("A")="You wish to select "_$P(Y,"^",2)_" as the registrant"
45 ..S DIR("B")="YES"
46 ..D ^DIR
47 ..I Y S QUIT=1
48 ..E S NAME=0 W !,"Another person with the same name can be entered by using quotes!"
49 D:NAME EDITNAME(NAME)
50 Q NAME
51 ;
52EDITNAME(NAME) ;
53 ;allows user to edit entry in the Master Name Index file
54 ;INPUT -
55 ; NAME - ien in Master Name Index file
56 ;
57 N DIE,DA,DR,DLAYGO,DIC
58 S DIE=910,DA=NAME,DR="[ESP REGISTRATION]",DLAYGO=910
59 D ^DIE
60 Q
61 ;
62DELETE(NAME) ;
63 N DIK,DA
64 S DIK="^ESP(910.2,",DA=NAME
65 D ^DIK
66 W !,"** TAG DELETED FROM POLICE REGISTRATION LOG **"
67 Q
Note: See TracBrowser for help on using the repository browser.