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

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1DGMSCK ;ALB/PJR - CONSISTENCY API'S FROM DGRPC3 ; 4/19/04 10:24am
2 ;;5.3;Registration;**451**;Mar 12, 2004
30 Q ;; Must be called at a tag (API)
4 ;;
5MSCK(MSECHK) ;; Check MSE API
6 N I1,I2,MSE
7 S (MSERR,MSDATERR)=0,ANYMSE="" F I1=1:1:3 S ANYMSE(I1)=0
8 F MSE="4;5;6;7","9;10;11;12","14;15;16;17" D ANY
9 ;; ANYMSE Saved for use with checks 79 through 82
10 S ANYMSE="" F I1=1:1:3 I ANYMSE(I1) S ANYMSE=ANYMSE_I1
11 Q 1
12ANY S ANYMSE=0 F I2=1:1:4 I $P(DGP(.32),"^",$P(MSE,";",I2))]"" S ANYMSE=1 Q
13 I 'ANYMSE Q
14 S ANYMSE(MSE+1\5)=1 ;; Set ANY Data found for Last, NTL, and NNTL
15 F I2=1:1:4 I $P(DGP(.32),"^",$P(MSE,";",I2))']"" S MSERR=1 S:I2>2 MSDATERR=1
16 I MSDATERR Q
17 F I2=3,4 I $E($P(DGP(.32),"^",$P(MSE,";",I2)),4,7)="0000" S (MSERR,MSDATERR)=1 Q
18 Q
19CNCK(CONCHK) ;; Check Conflicts API
20 N I1,I2,DATA,DATE,FROMPC,LOC,NODE,TOPC,YESNO
21 S CONERR=0 F I1=1:1:7 S I2=$T(CNFLT+I1) D LOC
22 Q 1
23LOC ;;
24 S LOC=$P(I2,";;",2),DATA=$P(I2,";;",3),CONSPEC(LOC)=DATA
25 S NODE=$P(DATA,",",1),YESNO=$P(DATA,",",2)
26 S FROMPC=$P(DATA,",",3),TOPC=$P(DATA,",",4)
27 S CONARR(LOC)=0 I $P(DGP(NODE),"^",YESNO)'="Y" Q
28 S CONARR(LOC)=1
29 F I2=FROMPC,TOPC S DATE=$P(DGP(NODE),"^",I2) I 'DATE!($E(DATE,4,7)="0000") S CONERR=1,CONARR(LOC)=2 Q
30 Q
31RANGE(RANSET) ;; Set Conflict Date Ranges
32 N I1,I2,I3
33 S I1="WWI,WWIIE,WWIIP,KOR,VIET,LEB,GREN,PAN,GULF,SOM,YUG,OTHER"
34 F I2=1:1:12 S I3=$P(I1,",",I2),RANGE(I3)=$$GETCNFDT^DGRPDT(I3)
35 Q 1
36MSFROMTO(MSESET) ;; Set first and last overall MSE from/to dates
37 N MSEFROM,MSETO,I1,I2
38 S MSEFROM=9999999,MSETO=0 ;; Initialize from/to dates
39 ;;
40 ;; Find first MSE FROM Date and last MSE TO date
41 I $G(ANYMSE) D
42 .F I1=6,11,16 S I2=$P(DGP(.32),"^",I1) I I2,I2<MSEFROM S MSEFROM=I2
43 .F I1=7,12,17 S I2=$P(DGP(.32),"^",I1) I I2,I2>MSETO S MSETO=I2
44 Q MSEFROM_"^"_MSETO
45 ;;
46CNFLT ;;
47 ;;SOM;;.322,16,17,18
48 ;;YUG;;.322,19,20,21
49 ;;PAN;;.322,7,8,9
50 ;;GREN;;.322,4,5,6
51 ;;LEB;;.322,1,2,3
52 ;;VIET;;.321,1,4,5
53 ;;GULF;;.322,10,11,12
Note: See TracBrowser for help on using the repository browser.