source: WorldVistAEHR/trunk/r/POLICE_AND_SECURITY-ES/ESPOFF1.m@ 1271

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

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1ESPOFF1 ;DALISC/CKA - OFFENSE REPORT INPUT - PART 2;9/92
2 ;;1.0;POLICE & SECURITY;**39**;Mar 31, 1994
3EN ;Q; Requires ^TMP($J) to be defined
4 W !!!,"Updating."
5STUFF K DD,DO S DIC="^ESP(912,",DIC(0)="L",DLAYGO=912 D OFF^ESPOID D FILE^DICN S ESPOFN=+Y
6 L +^ESP(912,ESPOFN):1 I '$T W !,"Another user is editing this record!!"
7 S UOR0=^TMP($J,"UOR",0)
8 S ^ESP(912,ESPOFN,0)=ESPOFN_"^"_$P(UOR0,U,2,12),^ESP(912,ESPOFN,1)=$G(^TMP($J,"UOR",1))
9 S $P(^ESP(912,ESPOFN,5),U,2)=0,$P(^ESP(912,ESPOFN,5),U,3)=DUZ,$P(^(5),U,5)=1
10CL ;STUFF CLASSIFICATION CODES
11 F ESPN=0:0 S ESPN=$O(^TMP($J,"UOR","CL",ESPN)) Q:ESPN="" S CL=^(ESPN,0) D
12 . S:'$D(^ESP(912,ESPOFN,10,0)) ^(0)="^912.01P^^"
13 . K DD,DO S DIC="^ESP(912,"_ESPOFN_",10,",DIC(0)="L",DLAYGO=912,X=+CL,DA(1)=ESPOFN D FILE^DICN
14 . S ^ESP(912,ESPOFN,10,ESPN,0)=CL
15 . ;X-REF
16 . S DIK="^ESP(912,"_ESPOFN_",20,",DA=ESPN D IX1^DIK K DIK,DA
17C ;STUFF COMPLAINANT DATA
18 F ESPN=0:0 S ESPN=$O(^TMP($J,"UOR","C",ESPN)) Q:ESPN="" S ESPFN=^(ESPN) D
19 . S:'$D(^ESP(912,ESPOFN,20,0)) ^(0)="^912.03^" K DD,DO S DIC="^ESP(912,"_ESPOFN_",20,",DIC(0)="L",DLAYGO=912,X=ESPN,DA(1)=ESPOFN D FILE^DICN
20 . S COMP0=$G(^ESP(910,ESPFN,0)),^ESP(912,ESPOFN,20,ESPN,0)=ESPN_"^"_ESPFN_"^"_$P(COMP0,U,4),^ESP(912,ESPOFN,20,ESPN,1)=$G(^ESP(910,ESPFN,1)),^ESP(912,ESPOFN,20,ESPN,2)=$G(^ESP(910,ESPFN,2))
21 . S DIK="^ESP(912,"_ESPOFN_",20,",DA=ESPN D IX1^DIK K DIK,DA
22V ;STUFF VICTIM DATA
23 F ESPN=0:0 S ESPN=$O(^TMP($J,"UOR","V",ESPN)) Q:ESPN="" S ESPFN=^(ESPN) D
24 . S:'$D(^ESP(912,ESPOFN,30,0)) ^(0)="^912.04^"
25 . K DD,DO S DIC="^ESP(912,"_ESPOFN_",30,",DIC(0)="L",DLAYGO=912,X=ESPN,DA(1)=ESPOFN D FILE^DICN
26 . S VIC0=$G(^ESP(910,ESPFN,0)),^ESP(912,ESPOFN,30,ESPN,0)=ESPN_"^"_ESPFN_"^"_$P(VIC0,U,8)_"^"_$P(VIC0,U,9)_"^"_$P(VIC0,U,4)_"^"_$P(VIC0,U,10)_"^"_$P(VIC0,U,11)
27 . S ^ESP(912,ESPOFN,30,ESPN,1)=$G(^ESP(910,ESPFN,1))
28 . S ^ESP(912,ESPOFN,30,ESPN,2)=$G(^ESP(910,ESPFN,2))
29 . ;MEDICAL TREATMENT
30 . S %X="^TMP("_$J_",""MT"","_ESPN_",",%Y="^ESP(912,"_ESPOFN_",30,"_ESPN_",10," D %XY^%RCR
31 . ;X REF
32 . S DIK="^ESP(912,"_ESPOFN_",30,",DA=ESPN D IX1^DIK K DIK,DA
33O ;STUFF OFFENDER DATA
34 F ESPN=0:0 S ESPN=$O(^TMP($J,"UOR","O",ESPN)) Q:ESPN="" S ESPFN=+^(ESPN),TMPN=^(ESPN) D
35 . S:'$D(^ESP(912,ESPOFN,40,0)) ^(0)="^912.05^"
36 . K DD,DO S DIC="^ESP(912,"_ESPOFN_",40,",DIC(0)="L",DLAYGO=912,X=ESPN,DA(1)=ESPOFN D FILE^DICN
37 . I ESPFN>0 D
38 .. S OFF0=$G(^ESP(910,ESPFN,0)),OFF3=$G(^(3))
39 .. S ^ESP(912,ESPOFN,40,ESPN,0)=ESPN_"^"_ESPFN_"^"_$P(OFF0,U,8)_"^"_$P(OFF0,U,9)_"^"_$P(OFF3,U,1)_"^"_$P(OFF3,U,2)_"^"_$P(OFF3,U,3)_"^"_$P(OFF3,U,4)_"^"_$P(OFF3,U,5)_"^"_$P(OFF3,U,6)_"^"_$P(OFF0,U,4)_"^"_$P(OFF0,U,10)_"^"_$P(OFF0,U,11)
40 .. S ^ESP(912,ESPOFN,40,ESPN,1)=$G(^ESP(910,ESPFN,1)),^ESP(912,ESPOFN,40,ESPN,2)=$G(^ESP(910,ESPFN,2)),^ESP(912,ESPOFN,40,ESPN,3)=^TMP($J,"UOR","OPERS",ESPN)
41 . E D
42 .. S ^ESP(912,ESPOFN,40,ESPN,0)=ESPN_"^^^"_$P(TMPN,U,4)_"^"_$P(TMPN,U,5)_"^"_$P(TMPN,U,6)_"^"_$P(TMPN,U,7)_"^"_$P(TMPN,U,8)_"^"_$P(TMPN,U,9)_"^"_$P(TMPN,U,10),^ESP(912,ESPOFN,40,ESPN,3)=^TMP($J,"UOR","OPERS",ESPN)
43 . ;STUFF OFFENSE CHARGED
44 . F ESPN1=0:0 S ESPN1=$O(^TMP($J,"UOR","O",ESPN,ESPN1)) Q:ESPN1="" S OFF(ESPN1)=^(ESPN1,0) D
45 .. S:'$D(^ESP(912,ESPOFN,40,ESPN,10,0)) ^(0)="^912.11P^^"
46 .. K DD,DO S DIC="^ESP(912,"_ESPOFN_",40,"_ESPN_",10,",DIC(0)="L",DLAYGO=912,DA(2)=ESPOFN,DA(1)=ESPN,DA=ESPN1,X=+^TMP($J,"UOR","O",ESPN,ESPN1,0) D FILE^DICN
47 .. S $P(^ESP(912,ESPOFN,40,ESPN,10,DA,0),U,2,4)=$P(OFF(ESPN1),U,2,4)
48 . ;X-REF
49 . S DIK="^ESP(912,"_ESPOFN_",40,",DA(1)=ESPN,DA=ESPOFN D IX1^DIK K DIK,DA
50 ;
51 ;
52 G ^ESPOFF2
Note: See TracBrowser for help on using the repository browser.