VistA-WorldVistAEHR/r/VOLUNTARY_TIMEKEEPING-ABSV/ABSV88.m

38 lines
1.9 KiB
Mathematica

ABSV88 ;VAMC ALTOONA/CTB - CREATE SINGLE TT88 FOR ONE VOL ;4/22/98 3:49 PM
V ;;4.0;VOLUNTARY TIMEKEEPING;**10**;JULY 6, 1994
ONE(DA,INST,SITE) ;CREATE TT88 FOR ONE VOLUNTEER
;DA=INTERNAL NUMBER IN 503330
;INST=POINTER TO INSTITUTION FILE
;SITE=ENTERNAL VALUE OF VOLUNTARY SITE NUMBER
;
;GET VOLUNTEER LEVEL VARIABLES
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
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"
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"
D EXT^ABSVU2(DIC,.DA,.DR,.X,"") K DIC,DR,X
S LASTNAME=$E($P(FULLNAME,","),1,14),FIRSTNME=$P(FULLNAME,",",2)
F Q:$E(FIRSTNME)'=" " S FIRSTNME=$P(FIRSTNME," ",2,99)
S FIRSTNME=$E(FIRSTNME,1,10),SSN=$E(SSN,1,9)
S ADD=$S($L(ADD)>19:$E(ADD,1,18)_"*",1:$E(ADD,1,19))
S CITY=$E(CITY,1,15),STATE=$E(STATE,1,2),ZIP=$E($TR(ZIP,"-",""),1,9)
S SEX=$E(SEX) S:+NRI=0 NRI=""
S BIRTHDAY=$$MMYYYY(BIRTHDAY)
S ENTRY=$$MMYYYY(ENTRY)
S TERMIN=$$MMYYYY(TERMIN)
I REACT]"",TERMIN="",'NRI S TERMIN="****"
S DTLSTAWD=$$MMYYYY(DTLSTAWD)
;GET COMBINATIONS
F I=1:1:6 S COMB(I)=""
I $D(^ABS(503330,DA,1,"AD",SITE)) D
. 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)
. F I=1:1:6 S COMB(I)=$E(COMB(I),1,8)
. QUIT
S STRING="88^"_SITE_"^"_NRI_"^"_LASTNAME_"^"_FIRSTNME_"^"_PSEUDO_"^"_SSN_"^"_ADD_"^"_CITY_"^"_STATE_"^"_ZIP_"^"_SEX_"^"_BIRTHDAY_"^"_ENTRY_"^"_TERMIN
F I=1:1:6 S STRING=STRING_"^"_COMB(I)
; IF TTO4 IS TO ADDED, ADD IT HERE
I +TT04 S STRING=STRING_"^"_SITEYEAR_"^"_TOTHOURS_"^"_LSTAWD_"^"_DTLSTAWD
I '+TT04 S STRING=STRING_"^^^^"
Q STRING_"$"
MMYYYY(X) I X="" Q X
Q $E(X,4,5)_($E(X,1,3)+1700)