SDEC ;ALB/SAT,PC,LAB - VISTA SCHEDULING RPCS ;Jul 15, 2021@10:40
;;5.3;Scheduling;**627,643,642,651,658,665,672,679,686,694,745,756,790,799,805**;Aug 13, 1993;Build 9
;;Per VHA Directive 6402, this routine should not be modified
Q
;
ACCGROUP(SDECY) ;EP return active entries from the SDEC ACCESS GROUP file 409.822
D ACCGROUP^SDEC45(.SDECY) Q
ACCGPTYG(SDECY) ;EP Get access group types
D ACCGPTYG^SDEC15(.SDECY) Q
ACCTYPE(SDECY) ;EP return active entries from the SDEC ACCESS TYPE file 409.823
D ACCTYPE^SDEC45(.SDECY) Q
ADDACCG(SDECY,SDECVAL) ;EP ADD/EDIT ACCESS GROUP
D ADDACCG^SDEC21(.SDECY,$G(SDECVAL)) Q
ADDACCTY(SDECY,SDECVAL) ;EP ADD/EDIT ACCESS TYPE
D ADDACCTY^SDEC14(.SDECY,$G(SDECVAL)) Q
ADDAGI(SDECY,SDECIEN,SDECIEN1) ;EP Add access group item - Adds ACCESS GROUP TYPE file entry
D ADDAGI^SDEC22(.SDECY,$G(SDECIEN),$G(SDECIEN1)) Q
ADDRES(SDECY,SDECVAL) ;EP ADD/EDIT RESOURCE
D ADDRES^SDEC16(.SDECY,$G(SDECVAL)) Q
ADDRESU(SDECY,SDECVAL) ;EP ADD/EDIT RESOURCE USER
D ADDRESU^SDEC18(.SDECY,$G(SDECVAL)) Q
ADDRG(SDECY,SDECVAL) ;EP ADD/EDIT RESOURCE GROUP
D ADDRG^SDEC19(.SDECY,$G(SDECVAL)) Q
ADDRGI(SDECY,SDECIEN,SDECIEN1) ;EP Adds RESOURCEID SDECIEN1 to RESOURCE GROUP entry SDECIEN
D ADDRGI^SDEC20(.SDECY,$G(SDECIEN),$G(SDECIEN1)) Q
;Remove APBLKALL *745
APBLKOV(SDECY,SDECSTART,SDECEND,SDECRES,SDECWI) ;EP APPT BLOCKS OVERLAP
D APBLKOV^SDEC05(.SDECY,$G(SDECSTART),$G(SDECEND),$G(SDECRES),$G(SDECWI)) Q
APPADD ;EP ADD NEW APPOINTMENT
Q ;calls directly to APPADD^SDEC07
APPDEL(SDECY,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11) ;EP Cancels appointment *745,756
D APPDEL^SDEC08(.SDECY,$G(S1),$G(S2),$G(S3),$G(S4),$G(S5),$G(S6),$G(S7),$G(S8),$G(S9),$G(S10),$G(S11)) Q
APPIDGET(SDECY,SDID) ;GET SDEC APPOINTMENT ien for given External ID
D APPIDGET^SDEC55(.SDECY,$G(SDID)) Q
APPSDGET(SDECY,MAXREC,LASTSUB,SDBEG,SDEND,NOTEFLG,SDRES,DFN,SDID,SDIEN) ;GET appointment data from SDEC APPOINTMENT file 409.84
D APPSDGET^SDEC55A(.SDECY,$G(MAXREC),$G(LASTSUB),$G(SDBEG),$G(SDEND),$G(NOTEFLG),$G(SDRES),$G(DFN),$G(SDID),$G(SDIEN)) Q
APPSLOTS(SDECY,SDCL,SDBEG,SDEND) ;return array of appt slots and availability - RPC
D APPSLOTS^SDEC57(.SDECY,$G(SDCL),$G(SDBEG),$G(SDEND)) Q
APPTLETR(SDECY,SDECAPID,LT) ;EP Print Appointment Letter
D APPTLETR^SDEC40(.SDECY,$G(SDECAPID),$G(LT)) Q
;Remove APPTEVLG *745
APPTYPES(RET,DFN) ; EP for SDEC APPTYPES - Return all active Appointment types from the APPOINTMENT TYPE file 409.1
D APPTYPES^SDECWL(.RET,$G(DFN)) Q
ARCLOSE(RET,S1,S2,S3,S4,S5) ;Appt Request close
D BLDARR(.INP,"ARCLOSE+0") ;*745
D ARCLOSE^SDECAR(.RET,.INP) Q
ARCLOSE1(RET,INP) ; Appt Request CLOSE (without ... for VistA calls) ;
D ARCLOSE^SDECAR(.RET,.INP) Q
ARDGET(SDECY) ;get values for disposition field of SDEC APPT REQUEST file
D ARDGET^SDECAR(.SDECY) Q
ARGET(RET,ARIEN1,MAXREC,SDBEG,SDEND,DFN,LASTSUB,SDTOP,SVCL,DESDT,PRL,SVCR,SCVISIT,CLINIC,ORIGDT) ;EP Appt Request GET
D ARGET^SDECAR1(.RET,$G(ARIEN1),$G(MAXREC),$G(SDBEG),$G(SDEND),$G(DFN),$G(LASTSUB),$G(SDTOP),$G(SVCL),$G(DESDT),$G(PRL),$G(SVCR),$G(SCVISIT),$G(CLINIC),$G(ORIGDT)) Q
ARMRTGET(SDECY,ARIEN) ;GET number of entries and values in MRTC CALC PREF DATES
D ARMRTGET^SDECAR(.SDECY,$G(ARIEN)) Q
ARMRTSET(SDECY,ARIEN,MRTC) ;SET MRTC CALC PREF DATES dates - clears the multiple and sets the new ones that are passed in
D ARMRTSET^SDECAR(.SDECY,$G(ARIEN),$G(MRTC)) Q
AROPEN(RET,ARAPP,ARIEN,ARDDT) ;Appt Request Open/re-open
D AROPEN^SDECAR(.RET,$G(ARAPP),$G(ARIEN),$G(ARDDT)) Q
ARPCSET(SDECY,INP,ARIEN) ;SET update patient contacts in SDEC APPT REQUEST file
D ARPCSET^SDECAR(.SDECY,$G(INP),$G(ARIEN)) Q
ARSET(RET,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23,S24,S25,S26,S27,S28,S29) ;EP Appt Request Set ;
D BLDARR(.INP,"ARSET+0") ;*745
D ARSET^SDECAR2(.RET,.INP) Q
ARSET1(RET,INP) ;EP Appt Request Set (without ... for VistA calls)
D ARSET^SDECAR2(.RET,.INP) Q
AVADD(SDECY,SDECSTART,SDECEND,SDECTYPID,SDECRES,SDECSLOTS,SDECNOTE) ;EP SET Create entry in SDEC ACCESS BLOCK
D AVADD^SDEC12(.SDECY,$G(SDECSTART),$G(SDECEND),$G(SDECTYPID),$G(SDECRES),$G(SDECSLOTS),$G(SDECNOTE)) Q
AVDEL(SDECY,SDECAVID) ;EP Cancel Availability - Deletes Access Block
D AVDEL^SDEC13(.SDECY,$G(SDECAVID)) Q
AVDELDT(SDECY,SDECRESD,SDECSTART,SDECEND) ;EP Cancel availability in a date range
D AVDELDT^SDEC13(.SDECY,$G(SDECRESD),$G(SDECSTART),$G(SDECEND)) Q
BOOKHLDY(SDECY,SDECCL) ; Returns can book on holiday flag for a clinic. 12/1/17 wtc 679
D BOOKHLDY^SDEC32(.SDECY,SDECCL) Q ;
CANCKOUT(SDECY,SDECAPTID) ;EP Cancel Check Out appointment
D CANCKOUT^SDEC25(.SDECY,$G(SDECAPTID)) Q
CANREAS(SDECY,SDECIN) ;EP return active/inactive entries from the CANCELLATION REASONS table 409.2
D CANREAS^SDEC45(.SDECY,$G(SDECIN)) Q
CAP(SDECY,DFN,SDAMEVT,SDT,DVBADA,SDAUTORB,SDCANVET) ;
D CAP^SDEC58(.SDECY,$G(DFN),$G(SDAMEVT),$G(SDT),$G(DVBADA),$G(SDAUTORB),$G(SDCANVET)) Q
CGET(SDECY) ;GET active Countries from the COUNTRY CODE file 779.004
D CGET^SDEC55(.SDECY) Q
CHECKIN(SDECY,SDECAPTID,SDECCDT,SDECCC,SDECPRV,SDECROU,SDECVCL,SDECVFM,SDECOG,SDECCR,SDECPCC,SDECWHF) ;EP Check in appointment
D CHECKIN^SDEC25(.SDECY,$G(SDECAPTID),$G(SDECCDT),$G(SDECCC),$G(SDECPRV),$G(SDECROU),$G(SDECVCL),$G(SDECVFM),$G(SDECOG),$G(SDECCR),$G(SDECPCC),$G(SDECWHF)) Q
CHECKOUT(SDECY,DFN,SDT,SDCODT,SDECAPTID,VPRV) ;EP Check Out appointment
D CHECKOUT^SDEC25(.SDECY,$G(DFN),$G(SDT),$G(SDCODT),$G(SDECAPTID),$G(VPRV)) Q
CLINALL(RET,MAXREC,SDECP) ; EP Return the IEN and NAME for all entries in the SD WL CLINIC LOCATION file
D CLINALL^SDECWL(.RET,$G(MAXREC),$G(SDECP)) Q
;Remove CLINCAN *745
CLINDIS(SDECY,SDECCLST,SDECBEG,SDECEND,SDECWI) ;EP Return formatted text output of the Clinic Schedules Report
D CLINDIS^SDEC47(.SDECY,$G(SDECCLST),$G(SDECBEG),$G(SDECEND),$G(SDECWI)) Q
CLINDISW(SDECY,SDECCLST,SDECBEG,SDECEND) ;EP Return formatted text output of the Clinic Schedules Report for Walkins
D CLINDISW^SDEC47(.SDECY,$G(SDECCLST),$G(SDECBEG),$G(SDECEND)) Q
CLINLET(SDECY,SDECCLST,SDECBEG,SDECEND,SDECWI) ;EP CLINIC LETTERS Appointment data
D CLINLET^SDEC27(.SDECY,$G(SDECCLST),$G(SDECBEG),$G(SDECEND),$G(SDECWI)) Q
CLINLETW(SDECY,SDECCLST,SDECBEG,SDECEND) ;EP CLINIC LETTERS WALK-IN Appointment data for Walk-in Appointments only
D CLINLETW^SDEC27(.SDECY,$G(SDECCLST),$G(SDECBEG),$G(SDECEND)) Q
CLINPROV(SDECY,SDECCL) ;EP return all providers for a given clinic from the HOSPITAL LOCATION file 44
D CLINPROV^SDEC45(.SDECY,$G(SDECCL)) Q
CLINSET(SDECY,SDNOSLOT,SDIENS,SDECP,SDNOLET,MAXREC) ;EP Returns CLINIC SETUP PARAMETERS for clinics that are active in the HOSPITAL LOCATION file
D CLINSET^SDEC32(.SDECY,$G(SDNOSLOT),$G(SDIENS),$G(SDECP),$G(SDNOLET),$G(MAXREC)) Q
CLINSTOP(SDECY,SDP) ;EP CLINIC STOP remote procedure
D CLINSTOP^SDEC45(.SDECY,$G(SDP)) Q
COPYAPPT(SDECY,SDECRES,SDEC44,SDECBEG,SDECEND) ;EP Copy appointments from HOSPITAL LOCATION to SDEC RESOURCE
D COPYAPPT^SDEC29(.SDECY,$G(SDECRES),$G(SDEC44),$G(SDECBEG),$G(SDECEND)) Q
CPCANC(SDECY,SDECTSK) ;EP Copy Appointment Cancel
D CPCANC^SDEC29(.SDECY,$G(SDECTSK)) Q
CPSTAT(SDECY,SDECTSK) ;EP Copy Appointment Status
D CPSTAT^SDEC29(.SDECY,$G(SDECTSK)) Q
CRSCHED(SDECY,SDECRES,SDECSTART,SDECEND,SDECWKIN,MAXREC,LASTSUB) ;EP Create Resource Appointment Schedule ;alb/sat 672
D CRSCHED^SDEC02(.SDECY,$G(SDECRES),$G(SDECSTART),$G(SDECEND),$G(SDECWKIN),$G(MAXREC),$G(LASTSUB)) Q
CSLOTSCH(SDECY,SDECRES,SDECSTART,SDECEND,SDECTYPES,SDECSRCH) ;GET Create Assigned Slot Schedule
D CSLOTSCH^SDEC04(.SDECY,$G(SDECRES),$G(SDECSTART),$G(SDECEND),$G(SDECTYPES),$G(SDECSRCH)) Q
CURFACG(SDECY,SDECDUZ) ;EP get current division/facility for given user
D CURFACG^SDEC46(.SDECY,$G(SDECDUZ)) Q
CVARAPPT(SDECY,SDCL) ;EP IS Clinic Variable Appointment Length
D CVARAPPT^SDEC37(.SDECY,$G(SDCL)) Q
DELAG(SDECY,SDECGRP) ;EP Deletes entry having IEN SDECGRP from SDEC ACCESS GROUP file
D DELAG^SDEC21(.SDECY,$G(SDECGRP)) Q
DELAGI(SDECY,SDECIEN,SDECIEN1) ;EP Deletes entry having Access Group SDECIEN and Access Type SDECIEN1 the SDEC ACCESS GROUP TYPE file
D DELAGI^SDEC22(.SDECY,$G(SDECIEN),$G(SDECIEN1)) Q
DELRESGP(SDECY,SDECGRP) ;EP Deletes entry name SDECGRP from SDEC RESOURCE GROUP file
D DELRESGP^SDEC19(.SDECY,$G(SDECGRP)) Q
DELRGI(SDECY,SDECIEN,SDECIEN1) ;EP Deletes entry SDECIEN1 from entry SDECIEN in the SDEC RESOURCE GROUP file
D DELRGI^SDEC20(.SDECY,$G(SDECIEN),$G(SDECIEN1)) Q
DELRU(SDECY,SDECIEN) ;EP Delete Resource User from SDEC RESOURCE USER file
D DELRU^SDEC18(.SDECY,$G(SDECIEN)) Q
EDITAPPT(SDECY,SDECAPTID,SDECNOTE,SDECLEN) ;EP Edit appointment (only 'note text' and appointment length can be edited)
D EDITAPPT^SDEC26(.SDECY,$G(SDECAPTID),$G(SDECNOTE),$G(SDECLEN)) Q
EHRPT(SDECY,SDECWID,SDECDFN) ;EP Raise patient selection event to EHR
D EHRPT^SDEC30(.SDECY,$G(SDECWID),$G(SDECDFN)) Q
ETHGET(SDECY) ;GET active Ethnicities from the ETHNICITY file 10.2
D ETHGET^SDEC55(.SDECY) Q
ETHCMGET(SDECY) ;GET values from the RACE AND ETHNICITY COLLECTION METHOD file 10.3
D ETHCMGET^SDEC55(.SDECY) Q
FACLIST(SDECY,DFN) ; Return list of remote facilities for patient
D PTINQ^SDECPT(.SDECY,$G(DFN)) Q
FAPPTGET(SDECY,DFN,SDBEG,SDEND,SDANC) ;GET Future appointments for given patient and date range
D FAPPTGET^SDEC50(.SDECY,$G(DFN),$G(SDBEG),$G(SDEND),$G(SDANC)) Q
GETFAC(SDECY,SDECDUZ) ;EP Gets all facilities for a user
D GETFAC^SDEC46(.SDECY,$G(SDECDUZ)) Q
GETONE(SDECY,SDGMR) ;EP Return data on one consult
D GETONE^SDEC51(.SDECY,$G(SDGMR)) Q
GETREGA(SDECRET,DFN) ;EP return basic reg info/demographics for given patient
D GETREGA^SDEC09(.SDECRET,$G(DFN)) Q
GETSITES(SDECY) ;return active National VA site names and station numbers
D GETSITES^SDEC59(.SDECY) Q
GETVPRV(BGOY,VPRV) ;EP return data from the V PROVIDER file
D GETVPRV^SDEC44(.BGOY,$G(VPRV)) Q
HIDE(SDECY) ;Return clinics hidden from display
D HIDE^SDEC45(.SDECY) Q
HOLIDAY(SDECY,SDECBD) ;EP return all entries from the HOLIDAY file 40.5
D HOLIDAY^SDEC45(.SDECY,$G(SDECBD)) Q
HOSPLOC(SDECY,SDECP,MAXREC,LSUB) ;EP return HOSPITAL LOCATIONs
D HOSPLOC^SDEC32(.SDECY,$G(SDECP),$G(MAXREC),$G(LSUB)) Q
IMHERE(SDECRES) ;
D IMHERE^SDEC31(.SDECRES) Q
NETLOC(SDECY,LOCATION) ;GET data from the NETWORK LOCATION file 2005.2
D NETLOC^SDEC59(.SDECY,$G(LOCATION)) Q
NEWPERS(SDECY,SDCLASS,SDPART,MAXREC,LSUB,INACT) ;return entries from the USR CLASS MEMBERSHIP file that have the given USR CLASS (default is PROVIDER)
D NEWPERS^SDEC45(.SDECY,$G(SDCLASS),$G(SDPART),$G(MAXREC),$G(LSUB),$G(INACT)) Q
NOSHOPAT(SDECY,DFN,SDCL) ;EP COLLECT NO-SHOW DATA for Patient
D NOSHOPAT^SDEC37(.SDECY,$G(DFN),$G(SDCL)) Q
NOSHOW(SDECY,SDECAPTID,SDECNS,USERIEN,SDECDATE) ;EP Sets appointment noshow flag in SDEC APPOINTMENT file
D NOSHOW^SDEC31(.SDECY,$G(SDECAPTID),$G(SDECNS),$G(USERIEN),$G(SDECDATE)) Q
OVBOOK(SDECY,SDCL,SDBEG,SDECRES) ;EP RPC - OVERBOOK - CHECK FOR OVERBOOK FOR GIVEN CLINIC, DATE, AND RESOURCE
D OVBOOK^SDEC07A(.SDECY,$G(SDCL),$G(SDBEG),$G(SDECRES)) Q
PATAPPTD(SDECY,DFN) ;EP Return the Patient appointment display
D PATAPPTD^SDEC27(.SDECY,$G(DFN)) Q
PATAPPTH(SDECY,DFN) ;EP return patient's appointment history for given patient - RPC
D PATAPPTH^SDEC48(.SDECY,$G(DFN)) Q
PCSGET(SDECY,SDSVSP) ;GET clinics for a service/specialty (clinic stop)
D PCSGET^SDEC50(.SDECY,$G(SDSVSP)) Q
PCSTGET(SDECY,DFN,SDCL,SDBEG,SDEND) ;GET patient clinic status for a clinic for a given time frame - has the patient been seen by the given Clinic in the past 24 months
D PCSTGET^SDEC50(.SDECY,$G(DFN),$G(SDCL),$G(SDBEG),$G(SDEND)) Q
PCST2GET(SDECY,DFN,STOP,SDBEG,SDEND) ;GET patient clinic status for a service/specialty (clinic stop) for a given time frame - has the patient been seen any clinics with the given service/specialty (clinic stop) in the past 24 months
D PCST2GET^SDEC50(.SDECY,$G(DFN),$G(STOP),$G(SDBEG),$G(SDEND)) Q
PREFGET(SDECY,DFN,INAC) ;EP Get values from SDEC PREFERENCES AND SPECIAL NEEDS file for given patient
D PREFGET^SDEC49(.SDECY,$G(DFN),$G(INAC)) Q
PREFGETV(SDECY) ;EP Get all valid PREFERENCE text from SDEC PREFERENCES AND SPECIAL NEEDS file
D PREFGETV^SDEC49(.SDECY) Q
PREFSET(SDECY,DFN,PREF,REMARK) ;EP Set values to SDEC PREFERENCES AND SPECIAL NEEDS file ;alb/sat 658 add REMARK
D PREFSET^SDEC49(.SDECY,$G(DFN),$G(PREF),$G(REMARK)) Q
PRIV(SDECY,CLINIEN,USER) ;IS this USER in the PRIVILEGED USER multiple for the clinic
D PRIV^SDEC32(.SDECY,$G(CLINIEN),$G(USER)) Q
PROVALL(SDECY,SDECCL) ;EP return all providers for a given clinic from the HOSPITAL LOCATION file 44
D PROVALL^SDEC45(.SDECY,$G(SDECCL)) Q
PROVCLIN(SDECY,SDECPRV) ;EP PROVIDER CLINICS remote procedure
D PROVCLIN^SDEC45(.SDECY,$G(SDECPRV)) Q
PTINQ(SDECY,DFN) ;GET output from ORWPT PTINQ in DataTable format
D PTINQ^SDECPT(.SDECY,$G(DFN)) Q
PTLOOKRS(SDECY,SDECP,SDECC,LASTSUB) ;EP Patient Lookup
D PTLOOKRS^SDEC28(.SDECY,$G(SDECP),$G(SDECC),$G(LASTSUB)) Q
PTSET(SDECY,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23,S24,S25,S26,S27,S28,S29,S30,S31,S32) ;SET patient demographics
D BLDARR(.INP,"PTSET+0") ;*745
D PTSET^SDEC53(.SDECY,.INP) Q
PTSET1(SDECY,INP) ;SET patient demographics (call from debug)
D PTSET^SDEC53(.SDECY,.INP) Q
RACEGET(SDECY) ;GET active Race entries from the RACE file 10
D RACEGET^SDEC55(.SDECY) Q
RAISEVNT(SDECY,SDECEVENT,SDECPARAM,SDECSIP,SDECSPT) ;EP RAISE EVENT
D RAISEVNT^SDEC23(.SDECY,$G(SDECEVENT),$G(SDECPARAM),$G(SDECSIP),$G(SDECSPT)) Q
;Removed REBKCLIN *745
REBKLIST(SDECY,SDECLIST) ;EP patient appointments used in listing REBOOKED appointments for a list of appointmentIDs.
D REBKLIST^SDEC34(.SDECY,$G(SDECLIST)) Q
REBKNEXT(SDECY,SDECDATE,SDECRES,SDECTPID) ;EP find the next ACCESS BLOCK in resource SDECRES after SDECSTART
D REBKNEXT^SDEC33(.SDECY,$G(SDECDATE),$G(SDECRES),$G(SDECTPID)) Q
RECIEN(SDECY,RECIEN) ;GET RECALL REMINDERS for given ID
D RECIEN^SDEC52(.SDECY,$G(RECIEN)) Q
RECGET(SDECY,DFN,SDBEG,SDEND,MAXREC,LASTSUB,RECIEN,SDSTOP,SDFLAGS,SDCLL) ; GET entries from the RECALL REMINDERS file 403.5 for a given Patient and Recall Date range. ;alb/sat 658 add SDCLL
D RECGET^SDEC52(.SDECY,$G(DFN),$G(SDBEG),$G(SDEND),$G(MAXREC),$G(LASTSUB),$G(RECIEN),$G(SDSTOP),$G(SDFLAGS),$G(SDCLL)) Q
RECSET(SDECY,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15) ; SET/EDIT/CANCEL/DELETE an entry to the RECALL REMINDERS file 403.5
D BLDARR(.INP,"RECSET+0") ;*745
D RECSET^SDEC52A(.SDECY,.INP) Q
RECSET1(SDECY,INP) ; SET/EDIT/CANCEL/DELETE an entry to the RECALL REMINDERS file 403.5
D RECSET^SDEC52A(.SDECY,.INP) Q
RECDSET(SDECY,RECALLIEN,SDRRFTR,SDCOMM) ; DELETE an entry to the RECALL REMINDERS file 403.5
D RECDSET^SDEC52A(.SDECY,$G(RECALLIEN),$G(SDRRFTR),$G(SDCOMM)) Q
RECAPGET(SDECY) ; GET entries from the RECALL REMINDERS APPT TYPE file 403.51
D RECAPGET^SDEC52B(.SDECY) Q
RECPRGET(SDECY,RECINACT,SDECP,MAXREC,LASTSUB) ;GET entries from the RECALL REMINDERS PROVIDERS file 403.54
D RECPRGET^SDEC52B(.SDECY,$G(RECINACT),$G(SDECP),$G(MAXREC),$G(LASTSUB)) Q
REGEVENT(SDECY,SDECEVENT,SDECIP,SDECPORT) ;EP Called by client to inform server of client's interest in SDECEVENT
D REGEVENT^SDEC23(.SDECY,$G(SDECEVENT),$G(SDECIP),$G(SDECPORT)) Q
REP1GET(SDECY,MAXREC,LASTSUB,PNAME) ;GET clinic data for report
D REP1GET^SDEC56(.SDECY,$G(MAXREC),$G(LASTSUB),$G(PNAME)) Q
REQGET(SDECY,SDBEG,SDEND,MAXREC,LASTSUB,SDGMR) ; GET entries with an ACTIVITY of RECEIVED, but do not have an ACTIVITY of SCHEDULED from the REQUEST/CONSULTATING file 123
D REQGET^SDEC51(.SDECY,$G(SDBEG),$G(SDEND),$G(MAXREC),$G(LASTSUB),$G(SDGMR)) Q
RESGPUSR(SDECY,SDECDUZ) ;EP GROUP RESOURCE
D RESGPUSR^SDEC01(.SDECY,$G(SDECDUZ)) Q
RESGRPUS(SDECY,SDECDUZ) ;EP return ACTIVE resource group names for the given user
D RESGRPUS^SDEC01(.SDECY,$G(SDECDUZ)) Q
RESLETRF(SDECY,SDECRES,SDECLT) ;EP Return formatted text output of the Resource's Letter - either "LETTER TEXT" (also used as Reminder Letter), NO SHOW LETTER, or CLINIC CANCELLATION LETTER.
D RESLETRF^SDEC47(.SDECY,$G(SDECRES),$G(SDECLT)) Q
RESLETRS(SDECY,SDECLIST,SDLTR,SDNOS,SDCAN) ;EP GET recordset of RESOURCES and associated LETTERS
D RESLETRS^SDEC35(.SDECY,$G(SDECLIST),$G(SDLTR),$G(SDNOS),$G(SDCAN)) Q
RESUSER(SDECY,SDRES) ;EP SDEC RESOURCE USER remote procedure returns all entries from the SDEC RESOURCE USER table 409.833
D RESUSER^SDEC45(.SDECY,$G(SDRES)) Q
RESOURCE(SDECY,SDECDUZ,SDACT,SDTYPE,MAXREC,LASTSUBI,SDIEN,SDECP) ;EP Returns ADO Recordset with ALL RESOURCE names
D RESOURCE^SDEC01A(.SDECY,$G(SDECDUZ),$G(SDACT),$G(SDTYPE),$G(MAXREC),$G(LASTSUBI),$G(SDIEN),$G(SDECP)) Q
SCHUSR(SDECY) ;EP Return recordset of all users in NEW PERSON having SDECZMENU key
D SCHUSR^SDEC17(.SDECY) Q
SEARCHAV(SDECY,SDECRES,SDECSTRT,SDECEND,SDECTYPES,SDECAMPM,SDECWKDY) ;EP Searches availability database
D SEARCHAV^SDEC24(.SDECY,$G(SDECRES),$G(SDECSTRT),$G(SDECEND),$G(SDECTYPES),$G(SDECAMPM),$G(SDECWKDY)) Q
SETFAC(SDECY,SDECDUZ,SDECFAC) ;EP SET FACILITY
D SETFAC^SDEC46(.SDECY,$G(SDECDUZ),$G(SDECFAC)) Q
SETRBOOK(SDECY,SDECAPPT,SDECDATE) ;EP Sets rebook date into appointment
D SETRBOOK^SDEC33(.SDECY,$G(SDECAPPT),$G(SDECDATE)) Q
SPACEBAR(SDECY,SDECDIC,SDECVAL) ;EP Update ^DISV with most recent lookup value SDECVAL from file SDECDIC
D SPACEBAR^SDEC30(.SDECY,$G(SDECDIC),$G(SDECVAL)) Q
;Removed SUMMGET *745
SUMMGET2(SDECRET,SDBEG,SDEND,USER) ;Get compiled Audit Report for a given date range
D SUMMGET2^SDECAUD(.SDECRET,$G(SDBEG),$G(SDEND),$G(USER)) Q
SUMMAGET(SDECY,SDBEG,SDEND,USER,LSUB,MAXREC) ;get ALL appointments with a cancel status from SDEC APPOINTMENT for given date range and user
D SUMMAGET^SDEC54A(.SDECY,$G(SDBEG),$G(SDEND),$G(USER),$G(LSUB),$G(MAXREC)) Q
SUSRINFO(SDECY,SDECDUZ,GUIVERS) ;EP SCHEDULING USER INFO
; Added GUI version to parameters to prevent users from using old versions. SD*5.3*694 wtc 8/27/2018
D SUSRINFO^SDEC01(.SDECY,$G(SDECDUZ),$G(GUIVERS)) Q
SVSPALL(RET) ; EP return IEN and NAME for all entries in the SD WL SERVICE/SPECIALTY file
D SVSPALL^SDECWL(.RET) Q
SYSSTAT(SDECY) ; EP SYSTEM STATUS
D SYSSTAT^SDECUTL(.SDECY) Q
TPBLKOV(SDECY,SDECSTART,SDECEND,SDECRES) ;EP TYPE BLOCKS OVERLAP
D TPBLKOV^SDEC06(.SDECY,$G(SDECSTART),$G(SDECEND),$G(SDECRES)) Q
;Removed UNDOCANA
UNREGEV(SDECY,SDECEVENT,SDECIP,SDECPORT) ;EP rpc SDE UNREGEV Called by client to Unregister client's interest in SDECEVENT
D UNREGEV^SDEC23(.SDECY,$G(SDECEVENT),$G(SDECIP),$G(SDECPORT)) Q
WAITLIST(SDECY,SDECRES) ;EP COLLECT WAITLIST DATA
D WAITLIST^SDEC36(.SDECY,$G(SDECRES)) Q
WLCLOSE(RET,SD1,SD2,SD3,SD4) ; Waitlist CLOSE
D BLDARR(.INP,"WLCLOSE+0") ;*745
D WLCLOSE^SDECWL(.RET,.INP) Q
WLCLOSE1(RET,INP) ; Waitlist CLOSE (without ... for VistA calls)
D WLCLOSE^SDECWL(.RET,.INP) Q
WLGET(RET,WLIEN1,MAXREC,SDBEG,SDEND,DFN,LASTSUB,SDTOP,SVCL,DESDT,PRI,SVCR,SCVISIT,CLINIC,ORIGDT) ;EP Waitlist GET ;alb/sat 658 add SVCL-SCVISIT
D WLGET^SDECWL1(.RET,$G(WLIEN1),$G(MAXREC),$G(SDBEG),$G(SDEND),$G(DFN),$G(LASTSUB),$G(SDTOP),$G(SVCL),$G(DESDT),$G(PRI),$G(SVCR),$G(SCVISIT),$G(CLINIC),$G(ORIGDT)) Q
WLHIDE(SDECY,DFN,WLCL) ;GET wait list entries in which the associated clinic's 'HIDE FROM DISPLAY?' field is 'YES'
D WLHIDE^SDECWL3(.SDECY,$G(DFN),$G(WLCL)) Q
WLOPEN(RET,WLAPP,WLIEN,WLDDT) ;SET Waitlist Open/re-open
D WLOPEN^SDECWL(.RET,$G(WLAPP),$G(WLIEN),$G(WLDDT)) Q
WLPCSET(SDECY,INP,WLIEN) ;SET update patient contacts in SD WAIT LIST file
D WLPCSET^SDECWL(.SDECY,$G(INP),$G(WLIEN)) Q
WLSET(RET,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23,S24,S25,S26,SD27) ;EP Waitlist Set
D BLDARR(.INP,"WLSET+0") ;*745
D WLSET^SDECWL2(.RET,.INP) Q
WLSET1(RET,INP) ;EP Waitlist Set (without ... for VistA calls)
D WLSET^SDECWL2(.RET,.INP) Q
BLDARR(ARR,TAG) ;array build *745
K ARR
N PM,PNO,I S PM=$P($P($T(@TAG),"(",2),")") S ARR=$L(PM,",")-1
F I=1:1:ARR S:$D(@($P(PM,",",I+1))) ARR(I)=@($P(PM,",",I+1))
Q ARR
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDEC 19996 printed Sep 15, 2024@22:13:47 Page 2
SDEC ;ALB/SAT,PC,LAB - VISTA SCHEDULING RPCS ;Jul 15, 2021@10:40
+1 ;;5.3;Scheduling;**627,643,642,651,658,665,672,679,686,694,745,756,790,799,805**;Aug 13, 1993;Build 9
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 QUIT
+4 ;
ACCGROUP(SDECY) ;EP return active entries from the SDEC ACCESS GROUP file 409.822
+1 DO ACCGROUP^SDEC45(.SDECY)
QUIT
ACCGPTYG(SDECY) ;EP Get access group types
+1 DO ACCGPTYG^SDEC15(.SDECY)
QUIT
ACCTYPE(SDECY) ;EP return active entries from the SDEC ACCESS TYPE file 409.823
+1 DO ACCTYPE^SDEC45(.SDECY)
QUIT
ADDACCG(SDECY,SDECVAL) ;EP ADD/EDIT ACCESS GROUP
+1 DO ADDACCG^SDEC21(.SDECY,$GET(SDECVAL))
QUIT
ADDACCTY(SDECY,SDECVAL) ;EP ADD/EDIT ACCESS TYPE
+1 DO ADDACCTY^SDEC14(.SDECY,$GET(SDECVAL))
QUIT
ADDAGI(SDECY,SDECIEN,SDECIEN1) ;EP Add access group item - Adds ACCESS GROUP TYPE file entry
+1 DO ADDAGI^SDEC22(.SDECY,$GET(SDECIEN),$GET(SDECIEN1))
QUIT
ADDRES(SDECY,SDECVAL) ;EP ADD/EDIT RESOURCE
+1 DO ADDRES^SDEC16(.SDECY,$GET(SDECVAL))
QUIT
ADDRESU(SDECY,SDECVAL) ;EP ADD/EDIT RESOURCE USER
+1 DO ADDRESU^SDEC18(.SDECY,$GET(SDECVAL))
QUIT
ADDRG(SDECY,SDECVAL) ;EP ADD/EDIT RESOURCE GROUP
+1 DO ADDRG^SDEC19(.SDECY,$GET(SDECVAL))
QUIT
ADDRGI(SDECY,SDECIEN,SDECIEN1) ;EP Adds RESOURCEID SDECIEN1 to RESOURCE GROUP entry SDECIEN
+1 DO ADDRGI^SDEC20(.SDECY,$GET(SDECIEN),$GET(SDECIEN1))
QUIT
+2 ;Remove APBLKALL *745
APBLKOV(SDECY,SDECSTART,SDECEND,SDECRES,SDECWI) ;EP APPT BLOCKS OVERLAP
+1 DO APBLKOV^SDEC05(.SDECY,$GET(SDECSTART),$GET(SDECEND),$GET(SDECRES),$GET(SDECWI))
QUIT
APPADD ;EP ADD NEW APPOINTMENT
+1 ;calls directly to APPADD^SDEC07
QUIT
APPDEL(SDECY,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11) ;EP Cancels appointment *745,756
+1 DO APPDEL^SDEC08(.SDECY,$GET(S1),$GET(S2),$GET(S3),$GET(S4),$GET(S5),$GET(S6),$GET(S7),$GET(S8),$GET(S9),$GET(S10),$GET(S11))
QUIT
APPIDGET(SDECY,SDID) ;GET SDEC APPOINTMENT ien for given External ID
+1 DO APPIDGET^SDEC55(.SDECY,$GET(SDID))
QUIT
APPSDGET(SDECY,MAXREC,LASTSUB,SDBEG,SDEND,NOTEFLG,SDRES,DFN,SDID,SDIEN) ;GET appointment data from SDEC APPOINTMENT file 409.84
+1 DO APPSDGET^SDEC55A(.SDECY,$GET(MAXREC),$GET(LASTSUB),$GET(SDBEG),$GET(SDEND),$GET(NOTEFLG),$GET(SDRES),$GET(DFN),$GET(SDID),$GET(SDIEN))
QUIT
APPSLOTS(SDECY,SDCL,SDBEG,SDEND) ;return array of appt slots and availability - RPC
+1 DO APPSLOTS^SDEC57(.SDECY,$GET(SDCL),$GET(SDBEG),$GET(SDEND))
QUIT
APPTLETR(SDECY,SDECAPID,LT) ;EP Print Appointment Letter
+1 DO APPTLETR^SDEC40(.SDECY,$GET(SDECAPID),$GET(LT))
QUIT
+2 ;Remove APPTEVLG *745
APPTYPES(RET,DFN) ; EP for SDEC APPTYPES - Return all active Appointment types from the APPOINTMENT TYPE file 409.1
+1 DO APPTYPES^SDECWL(.RET,$GET(DFN))
QUIT
ARCLOSE(RET,S1,S2,S3,S4,S5) ;Appt Request close
+1 ;*745
DO BLDARR(.INP,"ARCLOSE+0")
+2 DO ARCLOSE^SDECAR(.RET,.INP)
QUIT
ARCLOSE1(RET,INP) ; Appt Request CLOSE (without ... for VistA calls) ;
+1 DO ARCLOSE^SDECAR(.RET,.INP)
QUIT
ARDGET(SDECY) ;get values for disposition field of SDEC APPT REQUEST file
+1 DO ARDGET^SDECAR(.SDECY)
QUIT
ARGET(RET,ARIEN1,MAXREC,SDBEG,SDEND,DFN,LASTSUB,SDTOP,SVCL,DESDT,PRL,SVCR,SCVISIT,CLINIC,ORIGDT) ;EP Appt Request GET
+1 DO ARGET^SDECAR1(.RET,$GET(ARIEN1),$GET(MAXREC),$GET(SDBEG),$GET(SDEND),$GET(DFN),$GET(LASTSUB),$GET(SDTOP),$GET(SVCL),$GET(DESDT),$GET(PRL),$GET(SVCR),$GET(SCVISIT),$GET(CLINIC),$GET(ORIGDT))
QUIT
ARMRTGET(SDECY,ARIEN) ;GET number of entries and values in MRTC CALC PREF DATES
+1 DO ARMRTGET^SDECAR(.SDECY,$GET(ARIEN))
QUIT
ARMRTSET(SDECY,ARIEN,MRTC) ;SET MRTC CALC PREF DATES dates - clears the multiple and sets the new ones that are passed in
+1 DO ARMRTSET^SDECAR(.SDECY,$GET(ARIEN),$GET(MRTC))
QUIT
AROPEN(RET,ARAPP,ARIEN,ARDDT) ;Appt Request Open/re-open
+1 DO AROPEN^SDECAR(.RET,$GET(ARAPP),$GET(ARIEN),$GET(ARDDT))
QUIT
ARPCSET(SDECY,INP,ARIEN) ;SET update patient contacts in SDEC APPT REQUEST file
+1 DO ARPCSET^SDECAR(.SDECY,$GET(INP),$GET(ARIEN))
QUIT
ARSET(RET,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23,S24,S25,S26,S27,S28,S29) ;EP Appt Request Set ;
+1 ;*745
DO BLDARR(.INP,"ARSET+0")
+2 DO ARSET^SDECAR2(.RET,.INP)
QUIT
ARSET1(RET,INP) ;EP Appt Request Set (without ... for VistA calls)
+1 DO ARSET^SDECAR2(.RET,.INP)
QUIT
AVADD(SDECY,SDECSTART,SDECEND,SDECTYPID,SDECRES,SDECSLOTS,SDECNOTE) ;EP SET Create entry in SDEC ACCESS BLOCK
+1 DO AVADD^SDEC12(.SDECY,$GET(SDECSTART),$GET(SDECEND),$GET(SDECTYPID),$GET(SDECRES),$GET(SDECSLOTS),$GET(SDECNOTE))
QUIT
AVDEL(SDECY,SDECAVID) ;EP Cancel Availability - Deletes Access Block
+1 DO AVDEL^SDEC13(.SDECY,$GET(SDECAVID))
QUIT
AVDELDT(SDECY,SDECRESD,SDECSTART,SDECEND) ;EP Cancel availability in a date range
+1 DO AVDELDT^SDEC13(.SDECY,$GET(SDECRESD),$GET(SDECSTART),$GET(SDECEND))
QUIT
BOOKHLDY(SDECY,SDECCL) ; Returns can book on holiday flag for a clinic. 12/1/17 wtc 679
+1 ;
DO BOOKHLDY^SDEC32(.SDECY,SDECCL)
QUIT
CANCKOUT(SDECY,SDECAPTID) ;EP Cancel Check Out appointment
+1 DO CANCKOUT^SDEC25(.SDECY,$GET(SDECAPTID))
QUIT
CANREAS(SDECY,SDECIN) ;EP return active/inactive entries from the CANCELLATION REASONS table 409.2
+1 DO CANREAS^SDEC45(.SDECY,$GET(SDECIN))
QUIT
CAP(SDECY,DFN,SDAMEVT,SDT,DVBADA,SDAUTORB,SDCANVET) ;
+1 DO CAP^SDEC58(.SDECY,$GET(DFN),$GET(SDAMEVT),$GET(SDT),$GET(DVBADA),$GET(SDAUTORB),$GET(SDCANVET))
QUIT
CGET(SDECY) ;GET active Countries from the COUNTRY CODE file 779.004
+1 DO CGET^SDEC55(.SDECY)
QUIT
CHECKIN(SDECY,SDECAPTID,SDECCDT,SDECCC,SDECPRV,SDECROU,SDECVCL,SDECVFM,SDECOG,SDECCR,SDECPCC,SDECWHF) ;EP Check in appointment
+1 DO CHECKIN^SDEC25(.SDECY,$GET(SDECAPTID),$GET(SDECCDT),$GET(SDECCC),$GET(SDECPRV),$GET(SDECROU),$GET(SDECVCL),$GET(SDECVFM),$GET(SDECOG),$GET(SDECCR),$GET(SDECPCC),$GET(SDECWHF))
QUIT
CHECKOUT(SDECY,DFN,SDT,SDCODT,SDECAPTID,VPRV) ;EP Check Out appointment
+1 DO CHECKOUT^SDEC25(.SDECY,$GET(DFN),$GET(SDT),$GET(SDCODT),$GET(SDECAPTID),$GET(VPRV))
QUIT
CLINALL(RET,MAXREC,SDECP) ; EP Return the IEN and NAME for all entries in the SD WL CLINIC LOCATION file
+1 DO CLINALL^SDECWL(.RET,$GET(MAXREC),$GET(SDECP))
QUIT
+2 ;Remove CLINCAN *745
CLINDIS(SDECY,SDECCLST,SDECBEG,SDECEND,SDECWI) ;EP Return formatted text output of the Clinic Schedules Report
+1 DO CLINDIS^SDEC47(.SDECY,$GET(SDECCLST),$GET(SDECBEG),$GET(SDECEND),$GET(SDECWI))
QUIT
CLINDISW(SDECY,SDECCLST,SDECBEG,SDECEND) ;EP Return formatted text output of the Clinic Schedules Report for Walkins
+1 DO CLINDISW^SDEC47(.SDECY,$GET(SDECCLST),$GET(SDECBEG),$GET(SDECEND))
QUIT
CLINLET(SDECY,SDECCLST,SDECBEG,SDECEND,SDECWI) ;EP CLINIC LETTERS Appointment data
+1 DO CLINLET^SDEC27(.SDECY,$GET(SDECCLST),$GET(SDECBEG),$GET(SDECEND),$GET(SDECWI))
QUIT
CLINLETW(SDECY,SDECCLST,SDECBEG,SDECEND) ;EP CLINIC LETTERS WALK-IN Appointment data for Walk-in Appointments only
+1 DO CLINLETW^SDEC27(.SDECY,$GET(SDECCLST),$GET(SDECBEG),$GET(SDECEND))
QUIT
CLINPROV(SDECY,SDECCL) ;EP return all providers for a given clinic from the HOSPITAL LOCATION file 44
+1 DO CLINPROV^SDEC45(.SDECY,$GET(SDECCL))
QUIT
CLINSET(SDECY,SDNOSLOT,SDIENS,SDECP,SDNOLET,MAXREC) ;EP Returns CLINIC SETUP PARAMETERS for clinics that are active in the HOSPITAL LOCATION file
+1 DO CLINSET^SDEC32(.SDECY,$GET(SDNOSLOT),$GET(SDIENS),$GET(SDECP),$GET(SDNOLET),$GET(MAXREC))
QUIT
CLINSTOP(SDECY,SDP) ;EP CLINIC STOP remote procedure
+1 DO CLINSTOP^SDEC45(.SDECY,$GET(SDP))
QUIT
COPYAPPT(SDECY,SDECRES,SDEC44,SDECBEG,SDECEND) ;EP Copy appointments from HOSPITAL LOCATION to SDEC RESOURCE
+1 DO COPYAPPT^SDEC29(.SDECY,$GET(SDECRES),$GET(SDEC44),$GET(SDECBEG),$GET(SDECEND))
QUIT
CPCANC(SDECY,SDECTSK) ;EP Copy Appointment Cancel
+1 DO CPCANC^SDEC29(.SDECY,$GET(SDECTSK))
QUIT
CPSTAT(SDECY,SDECTSK) ;EP Copy Appointment Status
+1 DO CPSTAT^SDEC29(.SDECY,$GET(SDECTSK))
QUIT
CRSCHED(SDECY,SDECRES,SDECSTART,SDECEND,SDECWKIN,MAXREC,LASTSUB) ;EP Create Resource Appointment Schedule ;alb/sat 672
+1 DO CRSCHED^SDEC02(.SDECY,$GET(SDECRES),$GET(SDECSTART),$GET(SDECEND),$GET(SDECWKIN),$GET(MAXREC),$GET(LASTSUB))
QUIT
CSLOTSCH(SDECY,SDECRES,SDECSTART,SDECEND,SDECTYPES,SDECSRCH) ;GET Create Assigned Slot Schedule
+1 DO CSLOTSCH^SDEC04(.SDECY,$GET(SDECRES),$GET(SDECSTART),$GET(SDECEND),$GET(SDECTYPES),$GET(SDECSRCH))
QUIT
CURFACG(SDECY,SDECDUZ) ;EP get current division/facility for given user
+1 DO CURFACG^SDEC46(.SDECY,$GET(SDECDUZ))
QUIT
CVARAPPT(SDECY,SDCL) ;EP IS Clinic Variable Appointment Length
+1 DO CVARAPPT^SDEC37(.SDECY,$GET(SDCL))
QUIT
DELAG(SDECY,SDECGRP) ;EP Deletes entry having IEN SDECGRP from SDEC ACCESS GROUP file
+1 DO DELAG^SDEC21(.SDECY,$GET(SDECGRP))
QUIT
DELAGI(SDECY,SDECIEN,SDECIEN1) ;EP Deletes entry having Access Group SDECIEN and Access Type SDECIEN1 the SDEC ACCESS GROUP TYPE file
+1 DO DELAGI^SDEC22(.SDECY,$GET(SDECIEN),$GET(SDECIEN1))
QUIT
DELRESGP(SDECY,SDECGRP) ;EP Deletes entry name SDECGRP from SDEC RESOURCE GROUP file
+1 DO DELRESGP^SDEC19(.SDECY,$GET(SDECGRP))
QUIT
DELRGI(SDECY,SDECIEN,SDECIEN1) ;EP Deletes entry SDECIEN1 from entry SDECIEN in the SDEC RESOURCE GROUP file
+1 DO DELRGI^SDEC20(.SDECY,$GET(SDECIEN),$GET(SDECIEN1))
QUIT
DELRU(SDECY,SDECIEN) ;EP Delete Resource User from SDEC RESOURCE USER file
+1 DO DELRU^SDEC18(.SDECY,$GET(SDECIEN))
QUIT
EDITAPPT(SDECY,SDECAPTID,SDECNOTE,SDECLEN) ;EP Edit appointment (only 'note text' and appointment length can be edited)
+1 DO EDITAPPT^SDEC26(.SDECY,$GET(SDECAPTID),$GET(SDECNOTE),$GET(SDECLEN))
QUIT
EHRPT(SDECY,SDECWID,SDECDFN) ;EP Raise patient selection event to EHR
+1 DO EHRPT^SDEC30(.SDECY,$GET(SDECWID),$GET(SDECDFN))
QUIT
ETHGET(SDECY) ;GET active Ethnicities from the ETHNICITY file 10.2
+1 DO ETHGET^SDEC55(.SDECY)
QUIT
ETHCMGET(SDECY) ;GET values from the RACE AND ETHNICITY COLLECTION METHOD file 10.3
+1 DO ETHCMGET^SDEC55(.SDECY)
QUIT
FACLIST(SDECY,DFN) ; Return list of remote facilities for patient
+1 DO PTINQ^SDECPT(.SDECY,$GET(DFN))
QUIT
FAPPTGET(SDECY,DFN,SDBEG,SDEND,SDANC) ;GET Future appointments for given patient and date range
+1 DO FAPPTGET^SDEC50(.SDECY,$GET(DFN),$GET(SDBEG),$GET(SDEND),$GET(SDANC))
QUIT
GETFAC(SDECY,SDECDUZ) ;EP Gets all facilities for a user
+1 DO GETFAC^SDEC46(.SDECY,$GET(SDECDUZ))
QUIT
GETONE(SDECY,SDGMR) ;EP Return data on one consult
+1 DO GETONE^SDEC51(.SDECY,$GET(SDGMR))
QUIT
GETREGA(SDECRET,DFN) ;EP return basic reg info/demographics for given patient
+1 DO GETREGA^SDEC09(.SDECRET,$GET(DFN))
QUIT
GETSITES(SDECY) ;return active National VA site names and station numbers
+1 DO GETSITES^SDEC59(.SDECY)
QUIT
GETVPRV(BGOY,VPRV) ;EP return data from the V PROVIDER file
+1 DO GETVPRV^SDEC44(.BGOY,$GET(VPRV))
QUIT
HIDE(SDECY) ;Return clinics hidden from display
+1 DO HIDE^SDEC45(.SDECY)
QUIT
HOLIDAY(SDECY,SDECBD) ;EP return all entries from the HOLIDAY file 40.5
+1 DO HOLIDAY^SDEC45(.SDECY,$GET(SDECBD))
QUIT
HOSPLOC(SDECY,SDECP,MAXREC,LSUB) ;EP return HOSPITAL LOCATIONs
+1 DO HOSPLOC^SDEC32(.SDECY,$GET(SDECP),$GET(MAXREC),$GET(LSUB))
QUIT
IMHERE(SDECRES) ;
+1 DO IMHERE^SDEC31(.SDECRES)
QUIT
NETLOC(SDECY,LOCATION) ;GET data from the NETWORK LOCATION file 2005.2
+1 DO NETLOC^SDEC59(.SDECY,$GET(LOCATION))
QUIT
NEWPERS(SDECY,SDCLASS,SDPART,MAXREC,LSUB,INACT) ;return entries from the USR CLASS MEMBERSHIP file that have the given USR CLASS (default is PROVIDER)
+1 DO NEWPERS^SDEC45(.SDECY,$GET(SDCLASS),$GET(SDPART),$GET(MAXREC),$GET(LSUB),$GET(INACT))
QUIT
NOSHOPAT(SDECY,DFN,SDCL) ;EP COLLECT NO-SHOW DATA for Patient
+1 DO NOSHOPAT^SDEC37(.SDECY,$GET(DFN),$GET(SDCL))
QUIT
NOSHOW(SDECY,SDECAPTID,SDECNS,USERIEN,SDECDATE) ;EP Sets appointment noshow flag in SDEC APPOINTMENT file
+1 DO NOSHOW^SDEC31(.SDECY,$GET(SDECAPTID),$GET(SDECNS),$GET(USERIEN),$GET(SDECDATE))
QUIT
OVBOOK(SDECY,SDCL,SDBEG,SDECRES) ;EP RPC - OVERBOOK - CHECK FOR OVERBOOK FOR GIVEN CLINIC, DATE, AND RESOURCE
+1 DO OVBOOK^SDEC07A(.SDECY,$GET(SDCL),$GET(SDBEG),$GET(SDECRES))
QUIT
PATAPPTD(SDECY,DFN) ;EP Return the Patient appointment display
+1 DO PATAPPTD^SDEC27(.SDECY,$GET(DFN))
QUIT
PATAPPTH(SDECY,DFN) ;EP return patient's appointment history for given patient - RPC
+1 DO PATAPPTH^SDEC48(.SDECY,$GET(DFN))
QUIT
PCSGET(SDECY,SDSVSP) ;GET clinics for a service/specialty (clinic stop)
+1 DO PCSGET^SDEC50(.SDECY,$GET(SDSVSP))
QUIT
PCSTGET(SDECY,DFN,SDCL,SDBEG,SDEND) ;GET patient clinic status for a clinic for a given time frame - has the patient been seen by the given Clinic in the past 24 months
+1 DO PCSTGET^SDEC50(.SDECY,$GET(DFN),$GET(SDCL),$GET(SDBEG),$GET(SDEND))
QUIT
PCST2GET(SDECY,DFN,STOP,SDBEG,SDEND) ;GET patient clinic status for a service/specialty (clinic stop) for a given time frame - has the patient been seen any clinics with the given service/specialty (clinic stop) in the past 24 months
+1 DO PCST2GET^SDEC50(.SDECY,$GET(DFN),$GET(STOP),$GET(SDBEG),$GET(SDEND))
QUIT
PREFGET(SDECY,DFN,INAC) ;EP Get values from SDEC PREFERENCES AND SPECIAL NEEDS file for given patient
+1 DO PREFGET^SDEC49(.SDECY,$GET(DFN),$GET(INAC))
QUIT
PREFGETV(SDECY) ;EP Get all valid PREFERENCE text from SDEC PREFERENCES AND SPECIAL NEEDS file
+1 DO PREFGETV^SDEC49(.SDECY)
QUIT
PREFSET(SDECY,DFN,PREF,REMARK) ;EP Set values to SDEC PREFERENCES AND SPECIAL NEEDS file ;alb/sat 658 add REMARK
+1 DO PREFSET^SDEC49(.SDECY,$GET(DFN),$GET(PREF),$GET(REMARK))
QUIT
PRIV(SDECY,CLINIEN,USER) ;IS this USER in the PRIVILEGED USER multiple for the clinic
+1 DO PRIV^SDEC32(.SDECY,$GET(CLINIEN),$GET(USER))
QUIT
PROVALL(SDECY,SDECCL) ;EP return all providers for a given clinic from the HOSPITAL LOCATION file 44
+1 DO PROVALL^SDEC45(.SDECY,$GET(SDECCL))
QUIT
PROVCLIN(SDECY,SDECPRV) ;EP PROVIDER CLINICS remote procedure
+1 DO PROVCLIN^SDEC45(.SDECY,$GET(SDECPRV))
QUIT
PTINQ(SDECY,DFN) ;GET output from ORWPT PTINQ in DataTable format
+1 DO PTINQ^SDECPT(.SDECY,$GET(DFN))
QUIT
PTLOOKRS(SDECY,SDECP,SDECC,LASTSUB) ;EP Patient Lookup
+1 DO PTLOOKRS^SDEC28(.SDECY,$GET(SDECP),$GET(SDECC),$GET(LASTSUB))
QUIT
PTSET(SDECY,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23,S24,S25,S26,S27,S28,S29,S30,S31,S32) ;SET patient demographics
+1 ;*745
DO BLDARR(.INP,"PTSET+0")
+2 DO PTSET^SDEC53(.SDECY,.INP)
QUIT
PTSET1(SDECY,INP) ;SET patient demographics (call from debug)
+1 DO PTSET^SDEC53(.SDECY,.INP)
QUIT
RACEGET(SDECY) ;GET active Race entries from the RACE file 10
+1 DO RACEGET^SDEC55(.SDECY)
QUIT
RAISEVNT(SDECY,SDECEVENT,SDECPARAM,SDECSIP,SDECSPT) ;EP RAISE EVENT
+1 DO RAISEVNT^SDEC23(.SDECY,$GET(SDECEVENT),$GET(SDECPARAM),$GET(SDECSIP),$GET(SDECSPT))
QUIT
+2 ;Removed REBKCLIN *745
REBKLIST(SDECY,SDECLIST) ;EP patient appointments used in listing REBOOKED appointments for a list of appointmentIDs.
+1 DO REBKLIST^SDEC34(.SDECY,$GET(SDECLIST))
QUIT
REBKNEXT(SDECY,SDECDATE,SDECRES,SDECTPID) ;EP find the next ACCESS BLOCK in resource SDECRES after SDECSTART
+1 DO REBKNEXT^SDEC33(.SDECY,$GET(SDECDATE),$GET(SDECRES),$GET(SDECTPID))
QUIT
RECIEN(SDECY,RECIEN) ;GET RECALL REMINDERS for given ID
+1 DO RECIEN^SDEC52(.SDECY,$GET(RECIEN))
QUIT
RECGET(SDECY,DFN,SDBEG,SDEND,MAXREC,LASTSUB,RECIEN,SDSTOP,SDFLAGS,SDCLL) ; GET entries from the RECALL REMINDERS file 403.5 for a given Patient and Recall Date range. ;alb/sat 658 add SDCLL
+1 DO RECGET^SDEC52(.SDECY,$GET(DFN),$GET(SDBEG),$GET(SDEND),$GET(MAXREC),$GET(LASTSUB),$GET(RECIEN),$GET(SDSTOP),$GET(SDFLAGS),$GET(SDCLL))
QUIT
RECSET(SDECY,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15) ; SET/EDIT/CANCEL/DELETE an entry to the RECALL REMINDERS file 403.5
+1 ;*745
DO BLDARR(.INP,"RECSET+0")
+2 DO RECSET^SDEC52A(.SDECY,.INP)
QUIT
RECSET1(SDECY,INP) ; SET/EDIT/CANCEL/DELETE an entry to the RECALL REMINDERS file 403.5
+1 DO RECSET^SDEC52A(.SDECY,.INP)
QUIT
RECDSET(SDECY,RECALLIEN,SDRRFTR,SDCOMM) ; DELETE an entry to the RECALL REMINDERS file 403.5
+1 DO RECDSET^SDEC52A(.SDECY,$GET(RECALLIEN),$GET(SDRRFTR),$GET(SDCOMM))
QUIT
RECAPGET(SDECY) ; GET entries from the RECALL REMINDERS APPT TYPE file 403.51
+1 DO RECAPGET^SDEC52B(.SDECY)
QUIT
RECPRGET(SDECY,RECINACT,SDECP,MAXREC,LASTSUB) ;GET entries from the RECALL REMINDERS PROVIDERS file 403.54
+1 DO RECPRGET^SDEC52B(.SDECY,$GET(RECINACT),$GET(SDECP),$GET(MAXREC),$GET(LASTSUB))
QUIT
REGEVENT(SDECY,SDECEVENT,SDECIP,SDECPORT) ;EP Called by client to inform server of client's interest in SDECEVENT
+1 DO REGEVENT^SDEC23(.SDECY,$GET(SDECEVENT),$GET(SDECIP),$GET(SDECPORT))
QUIT
REP1GET(SDECY,MAXREC,LASTSUB,PNAME) ;GET clinic data for report
+1 DO REP1GET^SDEC56(.SDECY,$GET(MAXREC),$GET(LASTSUB),$GET(PNAME))
QUIT
REQGET(SDECY,SDBEG,SDEND,MAXREC,LASTSUB,SDGMR) ; GET entries with an ACTIVITY of RECEIVED, but do not have an ACTIVITY of SCHEDULED from the REQUEST/CONSULTATING file 123
+1 DO REQGET^SDEC51(.SDECY,$GET(SDBEG),$GET(SDEND),$GET(MAXREC),$GET(LASTSUB),$GET(SDGMR))
QUIT
RESGPUSR(SDECY,SDECDUZ) ;EP GROUP RESOURCE
+1 DO RESGPUSR^SDEC01(.SDECY,$GET(SDECDUZ))
QUIT
RESGRPUS(SDECY,SDECDUZ) ;EP return ACTIVE resource group names for the given user
+1 DO RESGRPUS^SDEC01(.SDECY,$GET(SDECDUZ))
QUIT
RESLETRF(SDECY,SDECRES,SDECLT) ;EP Return formatted text output of the Resource's Letter - either "LETTER TEXT" (also used as Reminder Letter), NO SHOW LETTER, or CLINIC CANCELLATION LETTER.
+1 DO RESLETRF^SDEC47(.SDECY,$GET(SDECRES),$GET(SDECLT))
QUIT
RESLETRS(SDECY,SDECLIST,SDLTR,SDNOS,SDCAN) ;EP GET recordset of RESOURCES and associated LETTERS
+1 DO RESLETRS^SDEC35(.SDECY,$GET(SDECLIST),$GET(SDLTR),$GET(SDNOS),$GET(SDCAN))
QUIT
RESUSER(SDECY,SDRES) ;EP SDEC RESOURCE USER remote procedure returns all entries from the SDEC RESOURCE USER table 409.833
+1 DO RESUSER^SDEC45(.SDECY,$GET(SDRES))
QUIT
RESOURCE(SDECY,SDECDUZ,SDACT,SDTYPE,MAXREC,LASTSUBI,SDIEN,SDECP) ;EP Returns ADO Recordset with ALL RESOURCE names
+1 DO RESOURCE^SDEC01A(.SDECY,$GET(SDECDUZ),$GET(SDACT),$GET(SDTYPE),$GET(MAXREC),$GET(LASTSUBI),$GET(SDIEN),$GET(SDECP))
QUIT
SCHUSR(SDECY) ;EP Return recordset of all users in NEW PERSON having SDECZMENU key
+1 DO SCHUSR^SDEC17(.SDECY)
QUIT
SEARCHAV(SDECY,SDECRES,SDECSTRT,SDECEND,SDECTYPES,SDECAMPM,SDECWKDY) ;EP Searches availability database
+1 DO SEARCHAV^SDEC24(.SDECY,$GET(SDECRES),$GET(SDECSTRT),$GET(SDECEND),$GET(SDECTYPES),$GET(SDECAMPM),$GET(SDECWKDY))
QUIT
SETFAC(SDECY,SDECDUZ,SDECFAC) ;EP SET FACILITY
+1 DO SETFAC^SDEC46(.SDECY,$GET(SDECDUZ),$GET(SDECFAC))
QUIT
SETRBOOK(SDECY,SDECAPPT,SDECDATE) ;EP Sets rebook date into appointment
+1 DO SETRBOOK^SDEC33(.SDECY,$GET(SDECAPPT),$GET(SDECDATE))
QUIT
SPACEBAR(SDECY,SDECDIC,SDECVAL) ;EP Update ^DISV with most recent lookup value SDECVAL from file SDECDIC
+1 DO SPACEBAR^SDEC30(.SDECY,$GET(SDECDIC),$GET(SDECVAL))
QUIT
+2 ;Removed SUMMGET *745
SUMMGET2(SDECRET,SDBEG,SDEND,USER) ;Get compiled Audit Report for a given date range
+1 DO SUMMGET2^SDECAUD(.SDECRET,$GET(SDBEG),$GET(SDEND),$GET(USER))
QUIT
SUMMAGET(SDECY,SDBEG,SDEND,USER,LSUB,MAXREC) ;get ALL appointments with a cancel status from SDEC APPOINTMENT for given date range and user
+1 DO SUMMAGET^SDEC54A(.SDECY,$GET(SDBEG),$GET(SDEND),$GET(USER),$GET(LSUB),$GET(MAXREC))
QUIT
SUSRINFO(SDECY,SDECDUZ,GUIVERS) ;EP SCHEDULING USER INFO
+1 ; Added GUI version to parameters to prevent users from using old versions. SD*5.3*694 wtc 8/27/2018
+2 DO SUSRINFO^SDEC01(.SDECY,$GET(SDECDUZ),$GET(GUIVERS))
QUIT
SVSPALL(RET) ; EP return IEN and NAME for all entries in the SD WL SERVICE/SPECIALTY file
+1 DO SVSPALL^SDECWL(.RET)
QUIT
SYSSTAT(SDECY) ; EP SYSTEM STATUS
+1 DO SYSSTAT^SDECUTL(.SDECY)
QUIT
TPBLKOV(SDECY,SDECSTART,SDECEND,SDECRES) ;EP TYPE BLOCKS OVERLAP
+1 DO TPBLKOV^SDEC06(.SDECY,$GET(SDECSTART),$GET(SDECEND),$GET(SDECRES))
QUIT
+2 ;Removed UNDOCANA
UNREGEV(SDECY,SDECEVENT,SDECIP,SDECPORT) ;EP rpc SDE UNREGEV Called by client to Unregister client's interest in SDECEVENT
+1 DO UNREGEV^SDEC23(.SDECY,$GET(SDECEVENT),$GET(SDECIP),$GET(SDECPORT))
QUIT
WAITLIST(SDECY,SDECRES) ;EP COLLECT WAITLIST DATA
+1 DO WAITLIST^SDEC36(.SDECY,$GET(SDECRES))
QUIT
WLCLOSE(RET,SD1,SD2,SD3,SD4) ; Waitlist CLOSE
+1 ;*745
DO BLDARR(.INP,"WLCLOSE+0")
+2 DO WLCLOSE^SDECWL(.RET,.INP)
QUIT
WLCLOSE1(RET,INP) ; Waitlist CLOSE (without ... for VistA calls)
+1 DO WLCLOSE^SDECWL(.RET,.INP)
QUIT
WLGET(RET,WLIEN1,MAXREC,SDBEG,SDEND,DFN,LASTSUB,SDTOP,SVCL,DESDT,PRI,SVCR,SCVISIT,CLINIC,ORIGDT) ;EP Waitlist GET ;alb/sat 658 add SVCL-SCVISIT
+1 DO WLGET^SDECWL1(.RET,$GET(WLIEN1),$GET(MAXREC),$GET(SDBEG),$GET(SDEND),$GET(DFN),$GET(LASTSUB),$GET(SDTOP),$GET(SVCL),$GET(DESDT),$GET(PRI),$GET(SVCR),$GET(SCVISIT),$GET(CLINIC),$GET(ORIGDT))
QUIT
WLHIDE(SDECY,DFN,WLCL) ;GET wait list entries in which the associated clinic's 'HIDE FROM DISPLAY?' field is 'YES'
+1 DO WLHIDE^SDECWL3(.SDECY,$GET(DFN),$GET(WLCL))
QUIT
WLOPEN(RET,WLAPP,WLIEN,WLDDT) ;SET Waitlist Open/re-open
+1 DO WLOPEN^SDECWL(.RET,$GET(WLAPP),$GET(WLIEN),$GET(WLDDT))
QUIT
WLPCSET(SDECY,INP,WLIEN) ;SET update patient contacts in SD WAIT LIST file
+1 DO WLPCSET^SDECWL(.SDECY,$GET(INP),$GET(WLIEN))
QUIT
WLSET(RET,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23,S24,S25,S26,SD27) ;EP Waitlist Set
+1 ;*745
DO BLDARR(.INP,"WLSET+0")
+2 DO WLSET^SDECWL2(.RET,.INP)
QUIT
WLSET1(RET,INP) ;EP Waitlist Set (without ... for VistA calls)
+1 DO WLSET^SDECWL2(.RET,.INP)
QUIT
BLDARR(ARR,TAG) ;array build *745
+1 KILL ARR
+2 NEW PM,PNO,I
SET PM=$PIECE($PIECE($TEXT(@TAG),"(",2),")")
SET ARR=$LENGTH(PM,",")-1
+3 FOR I=1:1:ARR
if $DATA(@($PIECE(PM,",",I+1)))
SET ARR(I)=@($PIECE(PM,",",I+1))
+4 QUIT ARR