source: WorldVistAEHR/trunk/r/VOLUNTARY_TIMEKEEPING-ABSV/ABSV88.m@ 931

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1ABSV88 ;VAMC ALTOONA/CTB - CREATE SINGLE TT88 FOR ONE VOL ;4/22/98 3:49 PM
2V ;;4.0;VOLUNTARY TIMEKEEPING;**10**;JULY 6, 1994
3ONE(DA,INST,SITE) ;CREATE TT88 FOR ONE VOLUNTEER
4 ;DA=INTERNAL NUMBER IN 503330
5 ;INST=POINTER TO INSTITUTION FILE
6 ;SITE=ENTERNAL VALUE OF VOLUNTARY SITE NUMBER
7 ;
8 ;GET VOLUNTEER LEVEL VARIABLES
9 N ADD,BIRTHDAY,CITY,COMB,ENTRY,FIRSTNME,FULLNAME,I,LASTNAME,N,NRI,PSEUDO,SEX,SSN,STATE,STRING,TERMIN,ZIP,DIC,DR,X,TT04,TT88,SITEYEAR,TOTHOURS,LSTAWD,DTLSTAWD,REACT
10 S DIC=503330,DR=".01;1;2;3;4.5;5;6;7;23;.1",X="FULLNAME;SSN,I;ADD;CITY;STATE;ZIP;SEX,I;BIRTHDAY,I;PSEUDO"
11 S DR(503330.01)="1;7;13;14;15;16;17;11;12;8",DA(503330.01)=INST,X(503330.01)="ENTRY,I;TERMIN,I;NRI,I;SITEYEAR;TOTHOURS;LSTAWD;DTLSTAWD,I;TT88,I;TT04,I;REACT"
12 D EXT^ABSVU2(DIC,.DA,.DR,.X,"") K DIC,DR,X
13 S LASTNAME=$E($P(FULLNAME,","),1,14),FIRSTNME=$P(FULLNAME,",",2)
14 F Q:$E(FIRSTNME)'=" " S FIRSTNME=$P(FIRSTNME," ",2,99)
15 S FIRSTNME=$E(FIRSTNME,1,10),SSN=$E(SSN,1,9)
16 S ADD=$S($L(ADD)>19:$E(ADD,1,18)_"*",1:$E(ADD,1,19))
17 S CITY=$E(CITY,1,15),STATE=$E(STATE,1,2),ZIP=$E($TR(ZIP,"-",""),1,9)
18 S SEX=$E(SEX) S:+NRI=0 NRI=""
19 S BIRTHDAY=$$MMYYYY(BIRTHDAY)
20 S ENTRY=$$MMYYYY(ENTRY)
21 S TERMIN=$$MMYYYY(TERMIN)
22 I REACT]"",TERMIN="",'NRI S TERMIN="****"
23 S DTLSTAWD=$$MMYYYY(DTLSTAWD)
24 ;GET COMBINATIONS
25 F I=1:1:6 S COMB(I)=""
26 I $D(^ABS(503330,DA,1,"AD",SITE)) D
27 . S N=0 F S N=$O(^ABS(503330,DA,1,"AD",SITE,N)) Q:'N S X=$O(^ABS(503330,DA,1,"AD",SITE,N,0)) S:+X COMB(N)=$P($G(^ABS(503330,DA,1,X,0)),"^",5)
28 . F I=1:1:6 S COMB(I)=$E(COMB(I),1,8)
29 . QUIT
30 S STRING="88^"_SITE_"^"_NRI_"^"_LASTNAME_"^"_FIRSTNME_"^"_PSEUDO_"^"_SSN_"^"_ADD_"^"_CITY_"^"_STATE_"^"_ZIP_"^"_SEX_"^"_BIRTHDAY_"^"_ENTRY_"^"_TERMIN
31 F I=1:1:6 S STRING=STRING_"^"_COMB(I)
32 ; IF TTO4 IS TO ADDED, ADD IT HERE
33 I +TT04 S STRING=STRING_"^"_SITEYEAR_"^"_TOTHOURS_"^"_LSTAWD_"^"_DTLSTAWD
34 I '+TT04 S STRING=STRING_"^^^^"
35 Q STRING_"$"
36MMYYYY(X) I X="" Q X
37 Q $E(X,4,5)_($E(X,1,3)+1700)
Note: See TracBrowser for help on using the repository browser.