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

276 lines
7.8 KiB
Mathematica

ABSVMS1 ;OAKLAND/DPC-VSS MIGRATION;7/31/2002
;;4.0;VOLUNTARY TIMEKEEPING;**31,33**;Jul 1994
;
SENDPROC(ABSVMTO,ABSSDA) ;
;Driver for sending data to SQL database.
D CLEANXTP^ABSVMUT1
D SETUPXTP^ABSVMUT1
D LDCDS^ABSVMUT1
D SERVSP(.ABSVMTO,.ABSSDA)
D ORGSP(.ABSVMTO,.ABSSDA)
D VOLSP(.ABSVMTO,.ABSSDA)
D OHRSSP(.ABSVMTO,.ABSSDA)
D RHRSSP(.ABSVMTO,.ABSSDA)
D CLEANXTP^ABSVMUT1
Q
;
SERVSP(ABSVMWHO,ABSSDA) ;
;Process for sending Services. Includes Validation.
N FL,EXPORT,TOSEND,TXTFILE
N ABSSRES
;
W !,"Validating Services"
D SRVVAL^ABSVMRV1("S",.ABSSRES)
W !,"Errors found in Service Codes: "_ABSSRES("ERRCNT")
S ABSSDA(ABSSRES("DA"))=""
;
S FL=503332
S EXPORT="ABSVM SERVICE CODES EXPORT"
S TOSEND="ABSVM SERVICES TOSEND"
S TXTFILE="VtkServices"
W !,"Sending Services.."
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
W !
Q
;
ORGSP(ABSVMWHO,ABSSDA) ;
;Send Process for Organizations.
N FL,EXPORT,TOSEND,TXTFILE
N ABSSRES
W !,"Validating Organizations"
D ORGVAL^ABSVMRV1("S",.ABSSRES)
W !,"Errors found in Organization Codes: "_ABSSRES("ERRCNT")
S ABSSDA(ABSSRES("DA"))=""
;
W !,"Sending Organizations.."
S FL=503334
S EXPORT="ABSVM ORGANIZATION EXPORT"
S TOSEND="ABSVM ORGANIZATIONS TOSEND"
S TXTFILE="VtkOrganizations"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
W !
Q
;
VOLSP(ABSVMWHO,ABSSDA) ;
;Send Process for Volunteers
N FL,EXPORT,TOSEND,TXTFILE
N ABSSRES,EXSITES
D EXSITES^ABSVMUT1
W !,"Building List of Volunteers with Hours"
D BLDVOLLT^ABSVMUT1()
W !,"Validating Volunteers"
D VALVOL^ABSVMVV1("S",.ABSSRES)
W !,"Errors found in Volunteer data: "_ABSSRES("ERRCNT")
S ABSSDA(ABSSRES("DA"))=""
;
S FL=503330
; Volunteer Master
S EXPORT="ABSVM VOL MASTER EXPORT"
S TOSEND="ABSVM VOLUNTEER TOSEND"
S TXTFILE="VtkVolunteers"
W !,"Sending Volunteer Master Information.."
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;CONTACTS
S EXPORT="ABSVM VOL CONTACT EXPORT"
S TOSEND="ABSVM VOLUNTEER TOSEND"
S TXTFILE="VtkVolContacts"
W !,"Sending Volunteer Contact Information.."
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;COMBINATION CODES
N COMBDIS
S EXPORT="ABSVM VOL COMBINATIONS EXPORT"
S TOSEND=""
S COMBDIS(0)="I $D(^XTMP(""ABSVMVOLCB"",""IEN"",D0))"
S TXTFILE="VtkVolCombinations"
W !,"Sending Combination code Information.."
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,,.COMBDIS)
;PROFILES
N PROFDIS
S EXPORT="ABSVM PROFILES EXPORT"
S TOSEND=""
S TXTFILE="VtkVolProfiles"
S PROFDIS(0)="I $D(^XTMP(""ABSVMVOLP"",""IEN"",D0))"
W !,"Sending Volunteer Profile Information.."
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,,.PROFDIS)
;PARKING STICKERS
N PARKDIS
S EXPORT="ABSVM PARKING EXPORT"
S TOSEND=""
S TXTFILE="VtkVolParking"
S PARKDIS(0)="I $D(^XTMP(""ABSVMVOLPK"",""IEN"",D0))"
W !,"Sending Parking Sticker Information.."
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,,.PARKDIS)
W !
Q
;
OHRSSP(ABSVMWHO,ABSSDA) ;
;Occasional Hours Processing.
N FL,EXPORT,TOSEND,TXTFILE
N ABSSRES,EXSITES
D EXSITES^ABSVMUT1
W !,"Validating Occasional Hours"
D OHRSVAL^ABSVMHV1("S",.ABSSRES)
W !,"Errors found in Occasional Hours: "_ABSSRES("ERRCNT")
S ABSSDA(ABSSRES("DA"))=""
;
S FL=503336
S EXPORT="ABSVM OCCASIONAL EXPORT"
S TOSEND="ABSVM OCCASIONAL HOURS TOSEND"
S TXTFILE="VtkOccHours"
W !,"Sending Occasional Hours.."
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
W !
Q
;
RHRSSP(ABSVMWHO,ABSSDA) ;
;Regular hours processing.
N FL,EXPORT,TOSEND,TXTFILE
N ABSSRES,EXSITES
D EXSITES^ABSVMUT1
W !,"Validating Regular Hours"
D RHRSVAL^ABSVMHV1("S",.ABSSRES)
W !,"Errors found in Regular Hours: "_ABSSRES("ERRCNT")
S ABSSDA(ABSSRES("DA"))=""
;
S FL=503331
S EXPORT="ABSVM REGULAR HOURS EXPORT"
W !,"Sending Regular Hours.."
;97
S TOSEND="ABSVM REG HOURS 97Q1 TOSEND"
S TXTFILE="VtkRegHours97Q1"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;97Q2
S TOSEND="ABSVM REG HOURS 97Q2 TOSEND"
S TXTFILE="VtkRegHours97Q2"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;97Q3
S TOSEND="ABSVM REG HOURS 97Q3 TOSEND"
S TXTFILE="VtkRegHours97Q3"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;97Q4
S TOSEND="ABSVM REG HOURS 97Q4 TOSEND"
S TXTFILE="VtkRegHours97Q4"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;98
S TOSEND="ABSVM REG HOURS 98Q1 TOSEND"
S TXTFILE="VtkRegHours98Q1"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;98Q2
S TOSEND="ABSVM REG HOURS 98Q2 TOSEND"
S TXTFILE="VtkRegHours98Q2"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;98Q3
S TOSEND="ABSVM REG HOURS 98Q3 TOSEND"
S TXTFILE="VtkRegHours98Q3"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;98Q4
S TOSEND="ABSVM REG HOURS 98Q4 TOSEND"
S TXTFILE="VtkRegHours98Q4"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;99
S TOSEND="ABSVM REG HOURS 99Q1 TOSEND"
S TXTFILE="VtkRegHours99Q1"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;99Q2
S TOSEND="ABSVM REG HOURS 99Q2 TOSEND"
S TXTFILE="VtkRegHours99Q2"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;99Q3
S TOSEND="ABSVM REG HOURS 99Q3 TOSEND"
S TXTFILE="VtkRegHours99Q3"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;99Q4
S TOSEND="ABSVM REG HOURS 99Q4 TOSEND"
S TXTFILE="VtkRegHours99Q4"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;00
S TOSEND="ABSVM REG HOURS 00Q1 TOSEND"
S TXTFILE="VtkRegHours00Q1"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;00Q2
S TOSEND="ABSVM REG HOURS 00Q2 TOSEND"
S TXTFILE="VtkRegHours00Q2"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;00Q3
S TOSEND="ABSVM REG HOURS 00Q3 TOSEND"
S TXTFILE="VtkRegHours00Q3"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;00Q4
S TOSEND="ABSVM REG HOURS 00Q4 TOSEND"
S TXTFILE="VtkRegHours00Q4"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;01
S TOSEND="ABSVM REG HOURS 01Q1 TOSEND"
S TXTFILE="VtkRegHours01Q1"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;01Q2
S TOSEND="ABSVM REG HOURS 01Q2 TOSEND"
S TXTFILE="VtkRegHours01Q2"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;01Q3
S TOSEND="ABSVM REG HOURS 01Q3 TOSEND"
S TXTFILE="VtkRegHours01Q3"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;01Q4
S TOSEND="ABSVM REG HOURS 01Q4 TOSEND"
S TXTFILE="VtkRegHours01Q4"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;02
S TOSEND="ABSVM REG HOURS 02Q1 TOSEND"
S TXTFILE="VtkRegHours02Q1"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;02Q2
S TOSEND="ABSVM REG HOURS 02Q2 TOSEND"
S TXTFILE="VtkRegHours02Q2"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;02Q3
S TOSEND="ABSVM REG HOURS 02Q3 TOSEND"
S TXTFILE="VtkRegHours02Q3"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;02Q4
S TOSEND="ABSVM REG HOURS 02Q4 TOSEND"
S TXTFILE="VtkRegHours02Q4"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;03
S TOSEND="ABSVM REG HOURS 03Q1 TOSEND"
S TXTFILE="VtkRegHours03Q1"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;03Q2
S TOSEND="ABSVM REG HOURS 03Q2 TOSEND"
S TXTFILE="VtkRegHours03Q2"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;03Q3
S TOSEND="ABSVM REG HOURS 03Q3 TOSEND"
S TXTFILE="VtkRegHours03Q3"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;03Q4
S TOSEND="ABSVM REG HOURS 03Q4 TOSEND"
S TXTFILE="VtkRegHours03Q4"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
;04
S TOSEND="ABSVM REG HOURS 04Q1 TOSEND"
S TXTFILE="VtkRegHours04Q1"
D SEND(TXTFILE,.ABSVMWHO,FL,EXPORT,TOSEND)
Q
;
SEND(TEXTFILE,ABSVMWHO,FILE,XPTEMP,SORTTEMP,SCREEN) ;
;Sending data.
N ABSVHFS,ABSVDEL,XMDUZ,XMY,XMSUB,XMTEXT,XMZ,%ZIS,IOP,Y
;set MailMan variables
M XMY=ABSVMWHO
S XMDUZ=DUZ,XMSUB="$Station$ "_$P($G(^DIC(4,+$$KSP^XUPARAM("INST"),99)),U)_" :"_TEXTFILE_" -- "_$$FMTE^XLFDT($$NOW^XLFDT)
;set device handler variables
S ABSVHFS="ABSVMIGRATION.DAT",IOP="HFS",%ZIS="",%ZIS("HFSMODE")="W",%ZIS("HFSNAME")=ABSVHFS
D EXPORT^DDXP(FILE,XPTEMP,0,$G(SORTTEMP),,,.SCREEN,,IOP)
;create message and get message number
F D XMZ^XMA2 Q:XMZ>0 H 1
;import from HFS to message global
S Y=$$FTG^%ZISH("",ABSVHFS,$NA(^XMB(3.9,XMZ,2,1,0)),4)
;send message
S XMDUZ=DUZ
D ENT1^XMD
;delete HFS file
S ABSVDEL(ABSVHFS)="",Y=$$DEL^%ZISH("",$NA(ABSVDEL))
W !," Message #",XMZ
Q