SDES2GETVISIT ;ALB/JAS,TJB - SDES2 VISTA SCHEDULING API for Visit Retrieval and Checkin functions ;Jun 17, 2024
Source file <SDES2GETVISIT.m>
action | A | extended action | Ea | event driver | Ed | subscriber | Su | protocol | O | limited protocol | LP | run routine | RR | broker | B | edit | E | server | Se | P | screenman | SM | inquire | I |
Package | Total | Caller Graph |
---|---|---|
Scheduling | 1 | SDES2CHECKIN |
Name | Comments | DBIA/ICR reference |
---|---|---|
GETVISIT(SDOUTPUT,SDINPUT) | ;Private Entry Point
; >> All date/time variables must be in FileMan internal format ; Special Incoming Variables: ; SDINPUT("FORCE ADD") = 1 ; no matter what, create new visit (Optional) ; SDINPUT("NEVER ADD") = 1 ; never add visit, just try to find one or more (Optional) ; SDINPUT("ANCILLARY") = 1 ; for ancillary packages to create noon visit if no match found (Optional) ; SDINPUT("SHOW VISITS") = 1 ; this will display visits if more than one match ; Incoming Variables used in Matching: REQUIRED ; SDINPUT("PAT") = patient IEN (file 2 or 9000001) ; SDINPUT("VISIT DATE") = visit date & time (same as check-in date & time) ; SDINPUT ("SITE") = location of encounter IEN (file 4 or 9999999.06) ; SDINPUT("VISIT TYPE") = internal value for field .03 in Visit file ; SDINPUT("SRV CAT") = internal value for service category ; SDINPUT("TIME RANGE") = # ; range in minutes for matching on visit time; REQUIRED unless FORCE ADD set ; ; zero=exact matches only; -1=don't match on time ; These are used to match if sent (Optional) ; SDINPUT("PROVIDER") = IEN for provider to match from file 200 ; SDINPUT("CLINIC CODE") = IEN of clinic stop code (file 40.7) ; SDINPUT("HOS LOC") = IEN of hospital location (file 44, field .22 in VISIT file) ; Incoming Variables used in creating appt and visit ; SDINPUT("APPT DATE") = appt date & time (Required for scheduled appts and walk-ins; check-in will be performed) ; SDINPUT("USR") = user IEN in file 200; REQUIRED ; SDINPUT("OPT") = name for Option Used To Create field, for check-in only (Optional) ; SDINPUT("OI") = reason for appointment; for walk-ins (Optional) ; Incoming PCC variables for adding additional info to visit (Optional) ; SDINPUT("SDTPB") = Third Party Billed (#.04) ; SDINPUT("SDPVL") = Parent Visit Link (#.12) ; SDINPUT("SDAPPT") = WalkIn/Appt (#.16) ; SDINPUT("SDEVM") = Evaluation and Management Code (#.17) ; SDINPUT("SDCODT") = Check Out Date & Time (#.18) ; SDINPUT("SDLS") = Level of Service -PCC Form (#.19). ; SDINPUT("SDVELG") = Eligibility (#.21) ; SDINPUT("SDPROT") = Protocol (#.25). ; SDINPUT("SDOPT") = Option Used To Create (#.24) ; SDINPUT("SDOLOC") = Outside Location (#2101) ; Outgoing Array: ; SDOUTPUT(0) always set; if = 0 none found and may have error message in 2nd piece ; if = 1 and SDOUTPUT(visit ien)="ADD" new visit just created ; if = 1 and SDOUTPUT(visit ien)=#; # is time difference in minutes ; if >1, multiple SDOUTPUT(visit ien) entries exist |
|
MATCH(SDOUT,SDINPUT) | ; find matching visits based on input array
|
|
PRVMTCH(SDINPUT,VIEN) | ; do visits match on provider?
|
|
TIMEDIF(VDTTM,VIEN) | ; return time diff between incoming time and current visit
|
|
ADDVIST(SDOUTPUT,SDARRAY) | ||
WALKIN(SDOUT,SDWALKIN) | ;Create walkin appt which is checked in and visit created
|
|
HAVEREQ(SDOUT,SDINPUT) | ; check required fields
|
|
TIME(RANGE,VISIT,DATE,END) | ; set DATE and END based on TIME RANGE setting in minutes
|
|
TRIAGE(VST) | ; returns 1 if visit's hosp loc is triage type
|
|
MAKE(SDAPPTIN) | ;Call to store appt made
|
|
CHECKIN(SDAPPTIN) | ;Call to add checkin info to appt
|
|
SERCAT(CLINIC,PAT) | ;Returns service category for visit
|
|
SCIEN(PAT,CLINIC,DATE) | ;Returns ien for appt in ^SC
|
|
GETVST(PAT,DATE) | ;Returns visit ien for appt date and patient
|
Name | Field # of Occurrence |
---|---|
FILE^DICN | MAKE+60, MAKE+67 |
FILE^DIE | MAKE+40, CHECKIN+39, CHECKIN+43 |
UPDATE^DIE | MAKE+52 |
$$GET1^DIQ | MATCH+8, MATCH+9, MATCH+10, MATCH+13, MATCH+14, MATCH+15, MATCH+16, MATCH+25, MATCH+26, MATCH+29 , MATCH+31, PRVMTCH+7, WALKIN+6, HAVEREQ+8, TRIAGE+2, TRIAGE+3, MAKE+24, MAKE+27, SERCAT+2, SERCAT+3 , SCIEN+3, SCIEN+4, GETVST+3, GETVST+6, GETVST+7 |
$$HANDLE^SDAMEVT | CHECKIN+32, CHECKIN+47 |
AFTER^SDAMEVT | CHECKIN+48 |
BEFORE^SDAMEVT | CHECKIN+33 |
MAKE^SDAMEVT | MAKE+73 |
EN1^SDES2CRTVISIT | ADDVIST+16 |
$$FMADD^XLFDT | TIME+3, TIME+4 |
$$FMDIFF^XLFDT | TIMEDIF+1 |
$$NOW^XLFDT | MAKE+39, MAKE+51, MAKE+65, CHECKIN+37 |
$$ABS^XLFMTH | MATCH+20 |
FileNo | Call Tags |
---|---|
^DPT - [#2] | GET1^DIQ |
2.98 | GET1^DIQ |
^SCE - [#409.68] | GET1^DIQ |
^SC - [#44] | GET1^DIQ |
44.003 | GET1^DIQ |
^AUPNVSIT - [#9000010] | GET1^DIQ |
^AUPNVPRV - [#9000010.06] | GET1^DIQ |
Name | Line Occurrences (* Changed, ! Killed) |
---|---|
^AUPNVPRV("AD" | PRVMTCH+6 |
^AUPNVSIT - [#9000010] | TIMEDIF+1 |
^AUPNVSIT("AA" | MATCH+5, MATCH+7 |
^DIC(19 - [#19] | GETVISIT+44, GETVISIT+46, GETVISIT+48 |
^DPT - [#2] | MAKE+18, MAKE+24, MAKE+27, CHECKIN+18 |
^SC - [#44] | MAKE+19, MAKE+56*, MAKE+57, CHECKIN+19, SCIEN+2 |
^VA(200 - [#200] | MAKE+23, CHECKIN+22 |
Name | Line Occurrences |
---|---|
$$CHECKIN | GETVISIT+66, WALKIN+14 |
$$GETVST | GETVISIT+68, WALKIN+17 |
$$HAVEREQ | GETVISIT+42 |
$$MAKE | WALKIN+8 |
$$PRVMTCH | MATCH+21 |
$$SCIEN | GETVISIT+58, MAKE+72, CHECKIN+26, CHECKIN+46 |
$$SERCAT | HAVEREQ+10 |
$$TIMEDIF | MATCH+19, MATCH+34 |
$$TRIAGE | MATCH+31, PRVMTCH+4 |
ADDVIST | GETVISIT+49, GETVISIT+53 |
MATCH | GETVISIT+51 |
TIME | MATCH+4 |
WALKIN | GETVISIT+71 |
>> | Not killed explicitly |
* | Changed |
! | Killed |
~ | Newed |
Name | Field # of Occurrence |
---|---|
%DT | ADDVIST+1~ |
APPTIEN | SCIEN+1~, SCIEN+2*, SCIEN+3, SCIEN+4 |
CLINIC | SERCAT~, SERCAT+3, SCIEN~, SCIEN+2, SCIEN+3, SCIEN+4 |
CLNCAT | SERCAT+1~, SERCAT+3*, SERCAT+4 |
DA | MAKE+26~, MAKE+55!, MAKE+62!, CHECKIN+25~ |
DA(1 | MAKE+58*, MAKE+64* |
DA(2 | MAKE+64* |
DATE | MATCH+2~, MATCH+4, MATCH+5*, MATCH+7, TIME~, TIME+3*, TIME+5*, TIME+6*, TIME+8*, SCIEN~ , SCIEN+2, SCIEN+3, SCIEN+4, GETVST~, GETVST+1, GETVST+3 |
DD | MAKE+26~, MAKE+55!, MAKE+62! |
DFN | MAKE+70~, MAKE+71*, MAKE+73, CHECKIN+30~, CHECKIN+31*, CHECKIN+32, CHECKIN+33, CHECKIN+47, CHECKIN+48 |
DIC | MAKE+26~, MAKE+55!, MAKE+58*, MAKE+60, MAKE+62!, MAKE+63* |
DIC("DR" | MAKE+65* |
DIC("P" | MAKE+59*, MAKE+66* |
DIC(0 | MAKE+59*, MAKE+66* |
DIE | CHECKIN+25~ |
DIFF | MATCH+2~, MATCH+19*, MATCH+20 |
DINUM | MAKE+58*, MAKE+62! |
DLAYGO | MAKE+26~, MAKE+55!, MAKE+59*, MAKE+62!, MAKE+66* |
DO | MAKE+26~, MAKE+55!, MAKE+62! |
DR | CHECKIN+25~ |
END | MATCH+2~, MATCH+4, MATCH+5, TIME~, TIME+4*, TIME+5*, TIME+7*, TIME+8* |
ERR | GETVISIT+57~, GETVISIT+66*, GETVISIT+68, GETVISIT+69, WALKIN+1~, WALKIN+8*, WALKIN+14*, WALKIN+17, WALKIN+18 |
HSPLOC | TRIAGE+1~, TRIAGE+2*, TRIAGE+3 |
IEN | GETVISIT+57~, GETVISIT+58*, GETVISIT+59, PRVMTCH+1~, PRVMTCH+6*, PRVMTCH+7, CHECKIN+25~, CHECKIN+26*, CHECKIN+27, CHECKIN+31 , CHECKIN+37, CHECKIN+38, CHECKIN+42 |
MATCH | MATCH+2~, MATCH+3*, MATCH+14*, MATCH+15*, MATCH+16*, MATCH+17 |
OUTPTENC | GETVST+2~, GETVST+3*, GETVST+4, GETVST+6, GETVST+7 |
PAT | SERCAT~, SERCAT+2, SCIEN~, SCIEN+4, GETVST~, GETVST+1, GETVST+3, GETVST+6 |
PRVS | PRVMTCH+1~ |
PRVS( | PRVMTCH+7*, PRVMTCH+9 |
RANGE | TIME~, TIME+2, TIME+8 |
SDAPPTERR | MAKE+29~, MAKE+41, MAKE+45~ |
SDAPPTFDA | MAKE+29~, MAKE+45~ |
SDAPPTFDA( | MAKE+31*, MAKE+32*, MAKE+33*, MAKE+34*, MAKE+35*, MAKE+36*, MAKE+37*, MAKE+38*, MAKE+39*, MAKE+48* , MAKE+49*, MAKE+50*, MAKE+51* |
SDAPPTIENS | MAKE+29~, MAKE+30*, MAKE+31, MAKE+32, MAKE+33, MAKE+34, MAKE+35, MAKE+36, MAKE+37, MAKE+38 , MAKE+39, MAKE+45~, MAKE+46*, MAKE+48, MAKE+49, MAKE+50, MAKE+51 |
SDAPPTIENS(2 | MAKE+47* |
SDAPPTIN | MAKE~, CHECKIN~ |
SDAPPTIN("ADT" | MAKE+21, MAKE+24, MAKE+27, MAKE+30, MAKE+42, MAKE+47, MAKE+57, MAKE+58, MAKE+63, MAKE+64 , MAKE+71, MAKE+72, CHECKIN+20, CHECKIN+26, CHECKIN+27, CHECKIN+31, CHECKIN+37, CHECKIN+38, CHECKIN+42, CHECKIN+46 |
SDAPPTIN("CDT" | CHECKIN+21, CHECKIN+38 |
SDAPPTIN("CLN" | MAKE+19, MAKE+31, MAKE+48, MAKE+56, MAKE+57, MAKE+58, MAKE+63, MAKE+64, MAKE+71, MAKE+72 , CHECKIN+19, CHECKIN+26, CHECKIN+27, CHECKIN+31, CHECKIN+37, CHECKIN+38, CHECKIN+42, CHECKIN+46 |
SDAPPTIN("LEN" | MAKE+22, MAKE+65 |
SDAPPTIN("OI" | MAKE+65 |
SDAPPTIN("PAT" | MAKE+18, MAKE+24, MAKE+27, MAKE+30, MAKE+42, MAKE+46, MAKE+64, MAKE+71, MAKE+72, CHECKIN+18 , CHECKIN+26, CHECKIN+27, CHECKIN+31, CHECKIN+46 |
SDAPPTIN("TYP" | MAKE+20, MAKE+33, MAKE+49 |
SDAPPTIN("USR" | MAKE+23, MAKE+65, CHECKIN+22, CHECKIN+42 |
SDAPPTTMP | MAKE+41~* |
SDARRAY | GETVISIT+40~, GETVISIT+41*, GETVISIT+42, GETVISIT+49, GETVISIT+51, GETVISIT+53, GETVISIT+66, GETVISIT+71, ADDVIST~ |
SDARRAY( | ADDVIST+2 |
SDARRAY("ADT" | GETVISIT+65* |
SDARRAY("APPT | DATE" , GETVISIT+53, GETVISIT+58, GETVISIT+65, GETVISIT+68, ADDVIST+11 |
SDARRAY("CC" | GETVISIT+62* |
SDARRAY("CDT" | GETVISIT+61* |
SDARRAY("CLIN | IC CODE" , GETVISIT+62, ADDVIST+9 |
SDARRAY("CLN" | GETVISIT+64* |
SDARRAY("FORC | E ADD" , GETVISIT+49, GETVISIT+51 |
SDARRAY("HOS | LOC" , GETVISIT+58, GETVISIT+64, ADDVIST+10 |
SDARRAY("OPT" | GETVISIT+44, GETVISIT+45, GETVISIT+46 |
SDARRAY("PAT" | GETVISIT+58, GETVISIT+68, ADDVIST+5 |
SDARRAY("PROVIDER" | GETVISIT+63 |
SDARRAY("PRV" | GETVISIT+63* |
SDARRAY("SDOPT" | GETVISIT+43, GETVISIT+44*, GETVISIT+45*, GETVISIT+46*, GETVISIT+47*, GETVISIT+48* |
SDARRAY("SITE" | ADDVIST+4 |
SDARRAY("SRV | CAT" , ADDVIST+7 |
SDARRAY("USR" | ADDVIST+12 |
SDARRAY("VIEN" | GETVISIT+55*, GETVISIT+68, WALKIN+17 |
SDARRAY("VISI | T DATE" , GETVISIT+61, ADDVIST+8, T TYPE" , ADDVIST+6 |
SDATA | CHECKIN+30~, CHECKIN+32*, CHECKIN+33, CHECKIN+47*, CHECKIN+48 |
SDCIHDL | CHECKIN+30~, CHECKIN+32*, CHECKIN+33, CHECKIN+47*, CHECKIN+48 |
SDCL | MAKE+70~, MAKE+71*, MAKE+73, CHECKIN+30~, CHECKIN+31*, CHECKIN+32, CHECKIN+33, CHECKIN+47, CHECKIN+48 |
SDDA | MAKE+70~, MAKE+72*, MAKE+73, CHECKIN+30~, CHECKIN+31*, CHECKIN+32, CHECKIN+33, CHECKIN+46*, CHECKIN+47, CHECKIN+48 |
SDERROR | MAKE+17~ |
SDERROR(1 | MAKE+42 |
SDFDA | CHECKIN+36~, CHECKIN+40! |
SDFDA( | CHECKIN+37*, CHECKIN+38*, CHECKIN+42* |
SDINPUT | GETVISIT~, GETVISIT+41, MATCH~, MATCH+21, PRVMTCH~, HAVEREQ~ |
SDINPUT("ANCILLARY" | MATCH+15, MATCH+16, MATCH+24, PRVMTCH+4 |
SDINPUT("APPT | DATE" , MATCH+31, HAVEREQ+10 |
SDINPUT("CLIN | IC CODE" , MATCH+25*, MATCH+26, HAVEREQ+8* |
SDINPUT("FORC | E ADD" , HAVEREQ+1 |
SDINPUT("HOS | LOC" , MATCH+25, MATCH+29, HAVEREQ+8, HAVEREQ+10 |
SDINPUT("PAT" | MATCH+5, MATCH+7, HAVEREQ+2, HAVEREQ+10 |
SDINPUT("PROVIDER" | PRVMTCH+2, PRVMTCH+9 |
SDINPUT("SITE" | MATCH+9, HAVEREQ+4 |
SDINPUT("SRV | CAT" , MATCH+12, MATCH+14, MATCH+15, MATCH+16, HAVEREQ+6, HAVEREQ+10* |
SDINPUT("TIME | RANGE" , MATCH+4, MATCH+18, MATCH+20, HAVEREQ+1 |
SDINPUT("USR" | HAVEREQ+7 |
SDINPUT("VISI | T DATE" , MATCH+4, MATCH+19, MATCH+34, HAVEREQ+3, T TYPE" , MATCH+10, HAVEREQ+5 |
SDMODE | MAKE+70~, MAKE+71*, MAKE+73, CHECKIN+31* |
SDOUT | MATCH~, WALKIN~, HAVEREQ~ |
SDOUT( | MATCH+34*, WALKIN+17* |
SDOUT(0 | MATCH+1*, MATCH+33*, WALKIN+2*, WALKIN+8*, WALKIN+17*, WALKIN+18*, HAVEREQ+1*, HAVEREQ+2*, HAVEREQ+3*, HAVEREQ+4* , HAVEREQ+5*, HAVEREQ+6*, HAVEREQ+7* |
SDOUTPUT | GETVISIT~, GETVISIT+40!, GETVISIT+42, GETVISIT+49, GETVISIT+51, GETVISIT+53, GETVISIT+71, ADDVIST~ |
SDOUTPUT( | GETVISIT+68*, ADDVIST+21* |
SDOUTPUT(0 | GETVISIT+55, GETVISIT+68*, GETVISIT+69*, ADDVIST+19*, ADDVIST+21* |
SDT | MAKE+70~, MAKE+71*, MAKE+73, CHECKIN+30~, CHECKIN+31*, CHECKIN+32, CHECKIN+33, CHECKIN+47, CHECKIN+48 |
SDVISITIN | ADDVIST+1~, ADDVIST+16, ADDVIST+22! |
SDVISITIN( | ADDVIST+2* |
SDVISITIN("AUPNTALK" | ADDVIST+3* |
SDVISITIN("SDADD" | ADDVIST+13* |
SDVISITIN("SDANE" | ADDVIST+3* |
SDVISITIN("SDAPDT" | ADDVIST+11* |
SDVISITIN("SDCAT" | ADDVIST+7* |
SDVISITIN("SDCLN" | ADDVIST+9* |
SDVISITIN("SDDATE" | ADDVIST+8* |
SDVISITIN("SDHL" | ADDVIST+10* |
SDVISITIN("SDLOC" | ADDVIST+4* |
SDVISITIN("SDPAT" | ADDVIST+5* |
SDVISITIN("SDTYPE" | ADDVIST+6* |
SDVISITIN("SDUSR" | ADDVIST+12* |
SDVISITOUT | ADDVIST+15~, ADDVIST+16, ADDVIST+22! |
SDVISITOUT("SDVSIT" | ADDVIST+18, ADDVIST+21 |
SDVSTN | CHECKIN+25~ |
SDWALKIN | WALKIN~, WALKIN+8, WALKIN+14 |
SDWALKIN("ADT" | WALKIN+5* |
SDWALKIN("APP | T DATE" , WALKIN+5, WALKIN+17 |
SDWALKIN("CC" | WALKIN+11* |
SDWALKIN("CDT" | WALKIN+10* |
SDWALKIN("CLI | NIC CODE" , WALKIN+11 |
SDWALKIN("CLN" | WALKIN+3*, WALKIN+6 |
SDWALKIN("HOS | LOC" , WALKIN+3 |
SDWALKIN("LEN" | WALKIN+6* |
SDWALKIN("PAT" | WALKIN+17 |
SDWALKIN("PROVIDER" | WALKIN+12 |
SDWALKIN("PRV" | WALKIN+12* |
SDWALKIN("TYP" | WALKIN+4* |
SDWALKIN("VIS | IT DATE" , WALKIN+10 |
STOP | MATCH+2~, MATCH+18*, MATCH+20*, MATCH+24*, MATCH+26*, MATCH+29*, MATCH+31* |
SUB | ADDVIST+1~, ADDVIST+2* |
SW | TIME+1~, TIME+5* |
TMDIF | TIME+1~, TIME+2*, TIME+3, TIME+4 |
U | GETVISIT+69, WALKIN+8, WALKIN+18, MAKE+18, MAKE+19, MAKE+20, MAKE+21, MAKE+22, MAKE+23, MAKE+24 , MAKE+42, MAKE+57, CHECKIN+18, CHECKIN+19, CHECKIN+20, CHECKIN+21, CHECKIN+22, CHECKIN+27, CHECKIN+32, CHECKIN+47 |
VALIDIEN | SCIEN+1~, SCIEN+2, SCIEN+4*, SCIEN+5 |
VDTTM | TIMEDIF~, TIMEDIF+1 |
VIEN | MATCH+2~, MATCH+6*, MATCH+7*, MATCH+8, MATCH+9, MATCH+10, MATCH+13, MATCH+14, MATCH+15, MATCH+16 , MATCH+19, MATCH+21, MATCH+26, MATCH+29, MATCH+31, MATCH+34, PRVMTCH~, PRVMTCH+4, PRVMTCH+6, TIMEDIF~ , TIMEDIF+1 |
VISIT | GETVISIT+57~, GETVISIT+68*, WALKIN+1~, WALKIN+17*, TIME~, TIME+3, TIME+4 |
VST | TRIAGE~, TRIAGE+2 |
X | ADDVIST+1~, MAKE+26~, MAKE+55!, MAKE+58*, MAKE+60, MAKE+62!, MAKE+64* |
Y | ADDVIST+1~, MAKE+26~, MAKE+55!, MAKE+57, MAKE+60*, MAKE+62! |