source: FOIAVistA/trunk/r/VOLUNTARY_TIMEKEEPING-ABSV/ABSVTP2.m@ 1635

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

initial load of FOIAVistA 6/30/08 version

File size: 4.2 KB
Line 
1ABSVTP2 ;VAMC ALTOONA/CTB - CONTINUATION OF VOLUNTARY TAPE PROCESSING ;3/3/95 09:54
2V ;;4.0;VOLUNTARY TIMEKEEPING;**2,3**;JULY 6, 1994
3EN1 K ^TMP($J)
4 S:'$D(^ABS(503330,0)) ^ABS(503330,0)="VOLUNTARY MASTER FILE^503330"
5 S DAZ=0,U="^" F I=1:1 S DAZ=$O(^TMP("VOL1",$J,DAZ)) Q:'DAZ D EN2 S I=1 Q:$D(STACK)
6 I $D(STACK) K STACK S X="Station Number "_STA_" does not exist in your Institution file (4). Please correct and rerun this program.*" D MSG^ABSVQ G OUT
7 D PRNT S X="Conversion is complete. The Voluntary Master File has been built and all cross references set. Refer to Users and technical manuals for instructions on the use of this package.*" D MSG^ABSVQ W !!,"DONE.",!!
8OUT K ZY,DAZ,DIC,DA,DAZ,ABSVX,X,NY,Y,COUNT,CNT,NM,SSN,SEX,ADR,CTY,ST,ZIP,BD,ED,TD,COMBS,STA,PI,C
9 K SY,HY,AH,AC,AD
10 Q
11EN2 S X=^TMP("VOL1",$J,DAZ)
12 ;DOES VOLUNTEER EXITS - SSN XREF
13 S NM=$E(X,15,28) F I=1:1 Q:$E(NM,$L(NM))'=" " S NM=$E(NM,1,$L(NM)-1)
14 S FNM=$E(X,29,38) F I=1:1 Q:$E(FNM,$L(FNM))'=" " S FNM=$E(FNM,1,$L(FNM)-1)
15 S NM=NM_","_FNM K FNM S SSN=$E(X,6,14) Q:SSN="" W !,NM
16 K SSNCK I $D(^ABS(503330,"D",SSN)),$O(^(SSN,0))>0 W " Volunteer with this SSN already exits, Person specific information will not be updated from tape." S SSNCK=""
17 I $D(SSNCK) S DA=$O(^ABS(503330,"D",SSN,0))
18 E L +^ABS(503330,0):60 S DA=$P(^ABS(503330,0),"^",4) F I=1:1 S DA=DA+1 I '$D(^ABS(503330,DA)) S $P(^(0),"^",3)=DA,$P(^(0),"^",4)=$P(^(0),"^",4)+1 L -^ABS(503330,0) Q
19 S ADR=$E(X,39,57),CTY=$E(X,58,72),ST=$E(X,73,74),ZIP=$E(X,75,79),SEX=$E(X,80),BD="2"_$E(X,83,84)_$E(X,81,82)_"00",ED="2"_$E(X,87,88)_$E(X,85,86)_"00"
20 S TD=$S($E(X,89,92)'="0000":"2"_$E(X,91,92)_$E(X,89,90)_"00",1:""),COMBS=$E(X,111,158),STA=$E(X,1,4),PI=$E(X,5),SY=$E(X,93,94),HY=$E(X,95,99),AH=$E(X,102,105)_"0",AC=$S($E(X,100,101)'="00":$E(X,100,101),1:"")
21 S AD=$S($E(X,107,110)'="0000":"2"_$E(X,109,110)_$E(X,107,108)_"00",1:"")
22 I MEDIA="T" S SY=$E(SY)_$S("0{"[$E(SY,2):0,1:$C($A(SY,2)-16)),HY=$E(HY)_$S("0{"[$E(HY,5):0,1:$C($A(HY,5)-16))
23 F I=0:0 Q:$E(STA,$L(STA))'=" " S STA=$E(STA,1,$L(STA)-1)
24 F I=0:0 Q:$E(NM,$L(NM))'=" " S NM=$E(NM,1,$L(NM)-1)
25 F I=0:0 Q:$E(ADR,$L(ADR))'=" " S ADR=$E(ADR,1,$L(ADR)-1)
26 F I=0:0 Q:$E(CTY,$L(CTY))'=" " S CTY=$E(CTY,1,$L(CTY)-1)
27 S J=1 F I=1:1:6 S C(I)=$E(COMBS,J,J+7),J=J+8
28 F J=1:1:6 F I=0:0 Q:$E(C(J),$L(C(J)))'=" " S C(J)=$E(C(J),1,$L(C(J))-1)
29EN3 S ST=$O(^DIC(5,"C",ST,0)) I '$D(^ABS(503338,"AD",STA)) S STACK="" Q
30 S INST=$O(^ABS(503338,"AD",STA,0))
31 ;SET 0TH NODE WHEN '$D(SSNCK)
32 I $D(SSNCK) G COMB
33 S VOL=NM_U_SSN_U_ADR_U_CTY_U_ST_U_ZIP_U_SEX_U_BD_"^^^^^^^^"_BD_"^^"_PI_"^^^^"_$E(NM)_$E(SSN,6,9)
34 S ^ABS(503330,"B",$E(NM,1,30),DA)="",^ABS(503330,"AC",BD,DA)="",^ABS(503330,"C",$E(NM)_$E(SSN,6,9),DA)="",^ABS(503330,"D",SSN,DA)=""
35 S ^ABS(503330,DA,0)=VOL
36COMB ;ADD COMBINATIONS
37 I '$D(^ABS(503330,DA,1,0)) S ^ABS(503330,DA,1,0)="^503330.03I"
38 F J=1:1:6 I C(J)'="" D NXT,COM
39 W " - Combinations added"
40STAINFO ;ADD STATION INFORMATION
41 S:'$D(^ABS(503330,DA,4,0)) ^ABS(503330,DA,4,0)="^503330.01P^^"
42 S DA1=INST,$P(^(0),"^",3,4)=INST_"^"_($P(^ABS(503330,DA,4,0),"^",4)+1)
43 S X=INST_"^"_ED_"^"_+SY_"^"_+HY_"^"_+AH_"^"_AD_"^"_AC_"^"_TD,^ABS(503330,DA,4,DA1,0)=X,^ABS(503330,DA,4,"B",INST,INST)="",^ABS(503330,"AB",INST,DA,DA1)=""
44 W " - Station Info added"
45 S DIK="^ABS(503330," D IX1^DIK K DIK
46EX K AC,AD,ADR,AH,BD,C,COMBS,CTY,DA1,ED,HY,INST,NM,PI,SEX,SSN,ST,STA,SY,TD,VOL,X,ZIP Q
47COM S ORGPT=+$E(C(J),1,3)
48 S SCHPT=$O(^ABS(503333,"B",$E(C(J),4),0))
49 S SERPT=$O(^ABS(503332,"B",$E(C(J),5,8),0))
50 S ^ABS(503330,DA,1,DA1,0)=STA_"-"_J_U_ORGPT_U_SCHPT_U_SERPT_U_C(J),$P(^(0),"^",3,4)=DA1_U_($P(^ABS(503330,DA,1,0),"^",4)+1),^ABS(503330,DA,1,"AC",C(J),J)=""
51 S ^ABS(503330,DA,1,"B",STA_"-"_J,DA1)="",^ABS(503330,DA,1,"AD",STA,J,DA1)="" K ORGPT,SCHPT,SERPT Q
52PRNT W !!!
53 S X="Transfer has completed. I will now print out the entries in the master file. Have Voluntary Service make a comparision with the 'Alpha Listing'. If discrepancies are noted use the package menu options to edit master file."
54 D MSG^ABSVQ S DIC="^ABS(503330,",L=0,(TO,FR)=ABSV("SITENAME"),BY="[ABSV ALPHA SORT]",FLDS=".01,1,2,3,4,5,6,7,8.5" D EN1^DIP
55 Q
56NXT F I=1:1 S DA1=$P(^ABS(503330,DA,1,0),"^",4)+1 I '$D(^ABS(503330,DA,1,DA1)) S $P(^ABS(503330,DA,1,0),"^",3,4)=DA1_"^"_DA1 Q
57 Q
Note: See TracBrowser for help on using the repository browser.