source: WorldVistAEHR/trunk/r/VOLUNTARY_TIMEKEEPING-ABSV/ABSVMVV3.m@ 841

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

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1ABSVMVV3 ;OAKLANDFO/DPC-VSS MIGRATION;7/19/2002
2 ;;4.0;VOLUNTARY TIMEKEEPING;**31,33**;Jul 1994
3 ;
4PARKVAL(VOLIEN,PROFIEN,VOLIDEN,FLAG,VALRESPK) ;
5 ;Validate Parking Sticker Information.
6 N PARKIEN,PARK0
7 N STPTR
8 S PARKIEN=0
9 F S PARKIEN=$O(^ABS(503330,VOLIEN,4,PROFIEN,2,PARKIEN)) Q:PARKIEN="" D
10 . N ERRS S ERRS=0
11 . S PARK0=$G(^ABS(503330,VOLIEN,4,PROFIEN,2,PARKIEN,0))
12 . I PARK0="" Q
13 . ;STICKER#
14 . I $P(PARK0,U)="" D ADDERR^ABSVMVV1(VOLIDEN_"is missing a Parking Sticker.",.ERRS,VOLIEN)
15 . I $L($P(PARK0,U))>13 D ADDERR^ABSVMVV1(VOLIDEN_"has a Parking Sticker longer than 13 characters.",.ERRS,VOLIEN)
16 . ;REG STATE
17 . S STPTR=$P(PARK0,U,2)
18 . I STPTR'="",$L($P($G(^DIC(5,STPTR,0)),U,2))'=2 D ADDERR^ABSVMVV1(VOLIDEN_"has incorrect State data for a Parking Sticker.",.ERRS,VOLIEN)
19 . ;PLATE#
20 . I $L($P(PARK0,U,3))>12 D ADDERR^ABSVMVV1(VOLIDEN_"has a License Plate Number longer than 12 characters.",.ERRS,VOLIEN)
21 . I ERRS>0 D RECERR^ABSVMUT1(.VALRESPK,.ERRS) Q
22 . ;If got this far and FLAG=S, add to Parking Sort Template
23 . I $G(FLAG)["S" S ^XTMP("ABSVMVOLPK","IEN",VOLIEN)=""
24 . Q
25 Q
26 ;
27COMBVAL(VOLIEN,VOLIDEN,FLAG,VALRESC) ;
28 ;Validate combination data.
29 N COMBIEN,COMB0,COMB
30 N ORGPTR,SCHDPTR,SRVPTR
31 S COMBIEN=0
32 F S COMBIEN=$O(^ABS(503330,VOLIEN,1,COMBIEN)) Q:COMBIEN="" D
33 . N ERRS S ERRS=0
34 . S COMB0=$G(^ABS(503330,VOLIEN,1,COMBIEN,0))
35 . I COMB0="" Q
36 . I $P($P(COMB0,U),"-")]"" Q:$D(EXSITES($P($P(COMB0,U),"-"))) ;check for excluded sites
37 . ;ORGANIZATION
38 . S ORGPTR=$P(COMB0,U,2),COMB=$P(COMB0,U)
39 . I ORGPTR="" D ADDERR^ABSVMVV1(VOLIDEN_"has Combination, "_COMB_" missing an Organization.",.ERRS,VOLIEN)
40 . I ORGPTR'="",'$D(OCDS(ORGPTR)) D ADDERR^ABSVMVV1(VOLIDEN_"has Combination, "_COMB_" with an incorrect Organization Code.",.ERRS,VOLIEN)
41 . ;SCHEDULE
42 . S SCHDPTR=$P(COMB0,U,3)
43 . I SCHDPTR="" D ADDERR^ABSVMVV1(VOLIDEN_"has Combination, "_COMB_" missing a Schedule.",.ERRS,VOLIEN)
44 . I SCHDPTR'="",'$D(WCDS(SCHDPTR)) D ADDERR^ABSVMVV1(VOLIDEN_"has Combination, "_COMB_" with an incorrect Schedule Code.",.ERRS,VOLIEN)
45 . ;SERVICE
46 . S SRVPTR=$P(COMB0,U,4)
47 . I SRVPTR="" D ADDERR^ABSVMVV1(VOLIDEN_"has Combination, "_COMB_" missing a Service.",.ERRS,VOLIEN)
48 . I SRVPTR'="",'$D(SCDS(SRVPTR)) D ADDERR^ABSVMVV1(VOLIDEN_"has Combination, "_COMB_" with an incorrect Service Code.",.ERRS,VOLIEN)
49 . ;INACTIVE
50 . I ",0,1,"'[","_$P(COMB0,U,6)_"," D ADDERR^ABSVMVV1(VOLIDEN_"Has Combination, "_COMB_" with an incorrect Active/Inactive value.",.ERRS,VOLIEN)
51 . I ERRS>0 D RECERR^ABSVMUT1(.VALRESC,.ERRS) Q
52 . I $G(FLAG)["S" S ^XTMP("ABSVMVOLCB","IEN",VOLIEN)=""
53 . Q
54 Q
55 ;
Note: See TracBrowser for help on using the repository browser.