SDESUTIL ;ALB/TAW,KML,LAB,MGD,ANU,MGD,ANU,BWF,TJB - SDES Utilities ;Aug 27, 2024
Source file <SDESUTIL.m>
Name | Comments | DBIA/ICR reference |
---|---|---|
PADCLTIME(TIME) | ;
; TIME - Time to Pad |
|
PADFMTIME(TIME) | ;
; TIME - Time to Pad |
|
PADLENGTH(STRING,CHAR,LENGTH,WHERE) | ;
|
|
EASVALIDATE(SDEAS) | ;
|
|
STRIP(SDECZ) | ;Replace control characters with spaces
|
|
ISDATEDST(DATE,DSTSUM) | ;Does this date use Daylight Savings
; DATE - FM format ; DSTSUM - "DST" or "SUM" ; Return 1 = DATE is considered DST or SUM ; 0 = DATE is not DST and not SUM ; -1 = DATE is not FM format |
|
DSTSTART(YR,DSTSUM) | ;Daylight Savings or Summer start date
; countries that observe DST or Summer ST (e.g., USA observes DST and Europe observes SUM ST) ; YR - 2 digit year ; DSTSUM - "DST" or "SUM" ; Return is the FM date for the FIRST day of DST or SUM |
|
DSTEND(YR,DSTSUM) | ;Daylight Savings END date
; YR - 2 digit year ; DSTSUM - "DST" or "SUM" ; Return is the FM date for the LAST day of DST or SUM |
|
SUMMER(DSTDT,DOW,SUNDAY) | ; determine last Sunday of MARCH or OCTOBER
; DSTDT - March or October (e.g, CYY0301 or CYY1001) ; DOW - 1, 2, 3, 4, 5, or 6 ; SUNDAY - "4,5" representing 4th or 5th Sunday of March or October ; Returns the date when SUMMER offset begins or ends (e.g., eastern Europe uses Summer offset) |
|
TIMEZONEDATA(CLINICIEN) | ;Get timezone and offsets
; CLINIC - IEN from Hospital Location #44 ; If clinic is not passed, use default Facility/Institution ; Output: ; Returns TimeZone Name ^ TimeZone IEN ^ TimeZone Exception ^ Offset for Standard Time ^ Offset for DST or SUMMER ^ |
|
GETTZOFFSET(SDDATE,SDCLINIC) | ;Get Time Zone offset based on clinic and daylight savings
; SDCLINIC - OPT - IEN from Hospital Location #44 ; SDDATE - REQ - FM formatted date ; Return ; If clinic is passed in get Division then Institution ; Otherwise get Institution from Kernel System Parameters ; Get the Time Zone and Time Zone Exception from the Institution |
|
CHAR4(CLINNAME) | ;
; CLINNAME - REQ - Name of clinic from #44 ; Return ; The CODE (#.01) field from NATIONAL CLINIC (#728.411) file or null |
|
TELEPHONE(PHONE) | ; Format all numeric Telephone Number
; PHONE - The Telephone Number ; Return ; If PHONE is all numeric it will be formatted as follows ; 1234567890 will be formatted as (123)456-7890 ; otherwise the passed in PHONE is returned. |
|
EXT(EXT) | ; Add an x to the beginning of an all numeric Telephone Extension field.
; EXT - The Telephone Extension. ; Return ; If EXT is all numeric, a lowercase x concantenated to the passed in EXT. ; otherwise the passed in EXT is returned. |
|
INACTIVE(SDCL,SDDT) | ; determine if clinic is active
; Input: ; SDCL = (Req) IEN of Clinic from file #44. ; SDDT = (Opt) Date to use for determining Status. If not passed in, defaults to DT. ; Return: ; 0=ACTIVE ; 1=INACTIVE |
|
STATIONNUMBER(CLINICIEN) | ;
; Input: ; CLINICIEN (Opt) = IEN of the Clinic from File #44. If not passed in, the default ; Institution for the VistA Instance it used. ; Output: The STATION NUMBER (#99) field from the INSTITUTION (#4) file. |
|
VALIDATEAMIS(AMIS,RESTYP) | ;
; Input: ; AMIS: The AMIS Stop Code to validate ; RESTYP: P:Primary, C:Credit ; Output: ; 0 = AMIS Stop Code is Valid ; # = Error number to log |
|
PRIMARYAMIS(PRIAMIS,ERRORNUM) | ;
|
|
SECONDARYAMIS(CREDITAMIS,ERRORNUM) | ;
|
|
AMISTOSTOPCODE(AMIS) | ; Map from AMIS to Stop Code
; Input: AMIS = (Req) the AMIS REPORTING STOP CODE (#1) field from the CLINIC STOP (#40.7) file. ; Output: 0:validation failed, IEN for the Stop Code that matches to the passed in AMIS code. |
|
STOPCODETOAMIS(STOPIEN) | ; Map from Stop Code IEN to AMIS Stop Code Number
; Input: STOPIEN = (Req) The IEN of the Stop Code in the CLINIC STOP (#40.7) file. ; Output: "": validation failed, IEN for the AMIS REPORTING STOP CODE (#1). |
|
RESCHKFAILED(STOPCODEIEN,RESTYPE) | ;
; Input: STOPCODEIEN (Req) IEN from CLINIC STOP (#40.7) file. ; RESTYPE (Req) P for Primary or S for Credit ; Output: 0: Restriction checks passed, 1: Restriction checks failed |
|
SOCINT2EXT(FILE,FLD,INTVAL) | ;
|
|
SOCEXT2INT(FILE,FLD,EXTVAL) | ;
|
|
INCREMENTAVAIL1(CLINICIEN,APPTSTARTTIME,APPTLENGTH) | ;
|
|
INCREMENTAVAIL2(CLINICIEN,APPTSTARTTIME,APPTLENGTH) | ; increment availability by 1 in cancelled slot
|
Name | Field # of Occurrence |
---|---|
$$FIND1^DIC | CHAR4+7 |
FIELD^DID | SOCINT2EXT+4, SOCEXT2INT+4 |
FILE^DIE | INCREMENTAVAIL2+23 |
$$GET1^DIQ | TIMEZONEDATA+9, TIMEZONEDATA+10, TIMEZONEDATA+12, TIMEZONEDATA+14, TIMEZONEDATA+15, TIMEZONEDATA+16, TIMEZONEDATA+17, CHAR4+9, STATIONNUMBER+8, STATIONNUMBER+10 , STATIONNUMBER+11, STATIONNUMBER+12, AMISTOSTOPCODE+7, STOPCODETOAMIS+7, RESCHKFAILED+7, INCREMENTAVAIL1+2, INCREMENTAVAIL2+4, INCREMENTAVAIL2+5, INCREMENTAVAIL2+6, INCREMENTAVAIL2+7 |
GETS^DIQ | TIMEZONEDATA+22 |
$$VALIDFMFORMAT^SDECDATE | ISDATEDST+8, SUMMER+8, GETTZOFFSET+9 |
$$INACTIVE^SDES2UTIL | INACTIVE+7 |
$$DOW^XLFDT | DSTSTART+12, DSTEND+12 |
$$FMADD^XLFDT | DSTEND+16, INCREMENTAVAIL1+6 |
$$UP^XLFSTR | SOCINT2EXT+3, SOCEXT2INT+3 |
$$KSP^XUPARAM | STATIONNUMBER+7 |
FileNo | Call Tags |
---|---|
1.711 | GETS^DIQ |
^DIC(4 - [#4] | GET1^DIQ |
^DIC(40.7 - [#40.7] | GET1^DIQ |
^DG(40.8 - [#40.8] | GET1^DIQ |
^SC - [#44] | GET1^DIQ |
44.005 | GET1^DIQ |
^ECX(728.44 - [#728.44] | FIND1^DIC, GET1^DIQ |
^XTV(8989.3 - [#8989.3] | GET1^DIQ |
Name | Line Occurrences (* Changed, ! Killed) |
---|---|
^DIC(40.7 - [#40.7] | AMISTOSTOPCODE+6, STOPCODETOAMIS+6 |
^SC("B" | CHAR4+6 |
Name | Line Occurrences |
---|---|
$$AMISTOSTOPCODE | PRIMARYAMIS+5, SECONDARYAMIS+5 |
$$DSTEND | ISDATEDST+11 |
$$DSTSTART | ISDATEDST+10 |
$$ISDATEDST | GETTZOFFSET+14 |
$$RESCHKFAILED | PRIMARYAMIS+8, SECONDARYAMIS+8 |
$$STRIP | EASVALIDATE+2 |
$$SUMMER | DSTSTART+15, DSTEND+15 |
$$TIMEZONEDATA | GETTZOFFSET+11 |
INCREMENTAVAIL2 | INCREMENTAVAIL1+7 |
PRIMARYAMIS | VALIDATEAMIS+10 |
SECONDARYAMIS | VALIDATEAMIS+11 |
>> | Not killed explicitly |
* | Changed |
! | Killed |
~ | Newed |
Name | Field # of Occurrence |
---|---|
AMIS | VALIDATEAMIS~, VALIDATEAMIS+7*, VALIDATEAMIS+10, VALIDATEAMIS+11, AMISTOSTOPCODE~, AMISTOSTOPCODE+4, AMISTOSTOPCODE+6 |
APPTLENGTH | INCREMENTAVAIL1~, INCREMENTAVAIL1+3, INCREMENTAVAIL1+7, INCREMENTAVAIL2~ |
APPTSTARTTIME | INCREMENTAVAIL1~, INCREMENTAVAIL1+6*, INCREMENTAVAIL1+7, INCREMENTAVAIL2~, INCREMENTAVAIL2+4, INCREMENTAVAIL2+9, INCREMENTAVAIL2+22 |
AVAILABILITYFDA | INCREMENTAVAIL2+1~, INCREMENTAVAIL2+24! |
AVAILABILITYFDA( | INCREMENTAVAIL2+22* |
CENTEROFSLOT | INCREMENTAVAIL2+1~, INCREMENTAVAIL2+10*, INCREMENTAVAIL2+13 |
CHAR | PADLENGTH~, PADLENGTH+4 |
CHARMULTIPLIER | INCREMENTAVAIL2+1~, INCREMENTAVAIL2+8*, INCREMENTAVAIL2+13 |
CLINICAPPTLENGTH | INCREMENTAVAIL1+1~, INCREMENTAVAIL1+2*, INCREMENTAVAIL1+3, INCREMENTAVAIL1+6 |
CLINICIEN | TIMEZONEDATA~, TIMEZONEDATA+8, TIMEZONEDATA+9, STATIONNUMBER~, STATIONNUMBER+6, STATIONNUMBER+9, STATIONNUMBER+10, INCREMENTAVAIL1~, INCREMENTAVAIL1+2, INCREMENTAVAIL1+7 , INCREMENTAVAIL2~, INCREMENTAVAIL2+4, INCREMENTAVAIL2+5, INCREMENTAVAIL2+6, INCREMENTAVAIL2+7, INCREMENTAVAIL2+22 |
CLINNAME | CHAR4~, CHAR4+5, CHAR4+6, CHAR4+7 |
CODE | SOCINT2EXT+1~, SOCINT2EXT+7*, SOCINT2EXT+8, SOCEXT2INT+1~, SOCEXT2INT+7*, SOCEXT2INT+8 |
COUNT | INCREMENTAVAIL1+1~, INCREMENTAVAIL1+4*, INCREMENTAVAIL1+5 |
CREDITAMIS | SECONDARYAMIS~, SECONDARYAMIS+1, SECONDARYAMIS+2, SECONDARYAMIS+3, SECONDARYAMIS+4, SECONDARYAMIS+5*, SECONDARYAMIS+6, SECONDARYAMIS+8 |
CURRENTSCHEDULE | INCREMENTAVAIL2+1~, INCREMENTAVAIL2+4*, INCREMENTAVAIL2+14, INCREMENTAVAIL2+15 |
DATE | ISDATEDST~, ISDATEDST+7*, ISDATEDST+8, ISDATEDST+9, ISDATEDST+10, ISDATEDST+11 |
DIVISION | STATIONNUMBER+5~, STATIONNUMBER+10*, STATIONNUMBER+11 |
DOW | DSTSTART+5~, DSTSTART+12*, DSTSTART+13, DSTSTART+14, DSTSTART+15, DSTEND+4~, DSTEND+12*, DSTEND+13, DSTEND+14, DSTEND+15 , SUMMER~, SUMMER+6*, SUMMER+8 |
DSTDT | DSTSTART+5~, DSTSTART+10*, DSTSTART+11*, DSTSTART+12, DSTSTART+14*, DSTSTART+15*, DSTSTART+16, DSTEND+4~, DSTEND+10*, DSTEND+11* , DSTEND+12, DSTEND+14*, DSTEND+15*, DSTEND+16, SUMMER~, SUMMER+6*, SUMMER+8 |
DSTMONTH | DSTSTART+5~, DSTSTART+6*, DSTSTART+10, DSTSTART+11, DSTEND+4~, DSTEND+6*, DSTEND+10, DSTEND+11 |
DSTSUM | ISDATEDST~, ISDATEDST+7*, ISDATEDST+10, ISDATEDST+11, DSTSTART~, DSTSTART+6*, DSTSTART+8, DSTSTART+14, DSTEND~, DSTEND+5* , DSTEND+6, DSTEND+8, DSTEND+14, TIMEZONEDATA+5~, TIMEZONEDATA+7*, TIMEZONEDATA+25*, TIMEZONEDATA+26*, TIMEZONEDATA+28 |
DT | DSTSTART+10, DSTSTART+11, DSTEND+10, DSTEND+11, AMISTOSTOPCODE+8 |
ERRORNUM | VALIDATEAMIS+8~, VALIDATEAMIS+9*, VALIDATEAMIS+10, VALIDATEAMIS+11, VALIDATEAMIS+12, PRIMARYAMIS~, PRIMARYAMIS+1*, PRIMARYAMIS+3*, PRIMARYAMIS+4*, PRIMARYAMIS+6* , PRIMARYAMIS+8*, SECONDARYAMIS~, SECONDARYAMIS+1*, SECONDARYAMIS+3*, SECONDARYAMIS+4*, SECONDARYAMIS+6*, SECONDARYAMIS+8* |
EXECPTFLG | TIMEZONEDATA+6~, TIMEZONEDATA+7*, TIMEZONEDATA+17*, TIMEZONEDATA+18 |
EXT | EXT~, EXT+5*, EXT+6*, EXT+7 |
EXTCODE | SOCINT2EXT+1~, SOCINT2EXT+8*, SOCINT2EXT+9, SOCEXT2INT+1~, SOCEXT2INT+8*, SOCEXT2INT+9 |
EXTVAL | SOCEXT2INT~, SOCEXT2INT+2, SOCEXT2INT+3*, SOCEXT2INT+9 |
FILE | SOCINT2EXT~, SOCINT2EXT+4, SOCEXT2INT~, SOCEXT2INT+4 |
FLD | SOCINT2EXT~, SOCINT2EXT+4, SOCEXT2INT~, SOCEXT2INT+4 |
FOUND | SOCINT2EXT+1~, SOCINT2EXT+5*, SOCINT2EXT+6, SOCINT2EXT+9*, SOCEXT2INT+1~, SOCEXT2INT+5*, SOCEXT2INT+6, SOCEXT2INT+9* |
IEN | CHAR4+4~, CHAR4+7*, CHAR4+8, CHAR4+9 |
INSTIEN | STATIONNUMBER+5~, STATIONNUMBER+11*, STATIONNUMBER+12 |
INTCODE | SOCINT2EXT+1~, SOCINT2EXT+8*, SOCINT2EXT+9, SOCEXT2INT+1~, SOCEXT2INT+8*, SOCEXT2INT+9 |
INTVAL | SOCINT2EXT~, SOCINT2EXT+2, SOCINT2EXT+3*, SOCINT2EXT+9 |
ITEM | SOCINT2EXT+1~, SOCINT2EXT+6*, SOCINT2EXT+7, SOCEXT2INT+1~, SOCEXT2INT+6*, SOCEXT2INT+7 |
LASTSUNDAY | SUMMER+5~, SUMMER+7*, SUMMER+8*, SUMMER+9 |
LENGTH | PADLENGTH~, PADLENGTH+2, PADLENGTH+3 |
NATLCODE | CHAR4+4~, CHAR4+9*, CHAR4+10 |
NEWAVAILABILITY | INCREMENTAVAIL2+1~, INCREMENTAVAIL2+9*, INCREMENTAVAIL2+10, INCREMENTAVAIL2+12, INCREMENTAVAIL2+13, INCREMENTAVAIL2+14*, INCREMENTAVAIL2+15 |
NEWSCHEDULE | INCREMENTAVAIL2+1~, INCREMENTAVAIL2+13, INCREMENTAVAIL2+15*, INCREMENTAVAIL2+21, INCREMENTAVAIL2+22 |
NUMOFSLOTSINPLAY | INCREMENTAVAIL1+1~, INCREMENTAVAIL1+3*, INCREMENTAVAIL1+4 |
OFFSET | TIMEZONEDATA+5~, TIMEZONEDATA+7*, TIMEZONEDATA+24*, TIMEZONEDATA+28, GETTZOFFSET+7~, GETTZOFFSET+12*, GETTZOFFSET+14*, GETTZOFFSET+15 |
OFFSETDSTSUM | TIMEZONEDATA+5~, TIMEZONEDATA+7*, TIMEZONEDATA+25*, TIMEZONEDATA+26*, TIMEZONEDATA+28 |
PAD | PADLENGTH+1~, PADLENGTH+4*, PADLENGTH+5, PADLENGTH+6 |
PADST | PADLENGTH+1~, PADLENGTH+3*, PADLENGTH+4 |
PHONE | TELEPHONE~, TELEPHONE+6*, TELEPHONE+7*, TELEPHONE+8 |
POP | TIMEZONEDATA+5~, TIMEZONEDATA+7*, TIMEZONEDATA+20, TIMEZONEDATA+23* |
PRIAMIS | PRIMARYAMIS~, PRIMARYAMIS+1, PRIMARYAMIS+2, PRIMARYAMIS+3, PRIMARYAMIS+4, PRIMARYAMIS+5*, PRIMARYAMIS+6, PRIMARYAMIS+8 |
RESTRICTION | RESCHKFAILED+6~, RESCHKFAILED+7*, RESCHKFAILED+8, RESCHKFAILED+9 |
RESTYP | VALIDATEAMIS~, VALIDATEAMIS+7*, VALIDATEAMIS+10, VALIDATEAMIS+11 |
RESTYPE | RESCHKFAILED~, RESCHKFAILED+5, RESCHKFAILED+9 |
RESULTS | SOCINT2EXT+1~, SOCEXT2INT+1~ |
RESULTS("SET | OF CODES" , SOCINT2EXT+6, SOCINT2EXT+7, SOCEXT2INT+6, SOCEXT2INT+7 |
RETURN | TIMEZONEDATA+5~, SOCINT2EXT+1~, SOCINT2EXT+9*, SOCINT2EXT+10, SOCEXT2INT+1~, SOCEXT2INT+9*, SOCEXT2INT+10 |
SDCL | INACTIVE~, INACTIVE+7 |
SDCLINIC | GETTZOFFSET~, GETTZOFFSET+10*, GETTZOFFSET+11 |
SDDATE | GETTZOFFSET~, GETTZOFFSET+8*, GETTZOFFSET+9, GETTZOFFSET+14 |
SDDIV | TIMEZONEDATA+5~, TIMEZONEDATA+9*, TIMEZONEDATA+10 |
SDDT | INACTIVE~, INACTIVE+7 |
SDEAS | EASVALIDATE~, EASVALIDATE+1*, EASVALIDATE+2*, EASVALIDATE+3*, EASVALIDATE+4 |
SDECI | STRIP+1~, STRIP+2* |
SDECZ | STRIP~, STRIP+2*, STRIP+3 |
SDINST | TIMEZONEDATA+5~, TIMEZONEDATA+7*, TIMEZONEDATA+10*, TIMEZONEDATA+12*, TIMEZONEDATA+14*, TIMEZONEDATA+15, TIMEZONEDATA+16, TIMEZONEDATA+17 |
SDMSG | TIMEZONEDATA+5~ |
SDTIMEZONEE | TIMEZONEDATA+5~, TIMEZONEDATA+15*, TIMEZONEDATA+28 |
SDTIMEZONEI | TIMEZONEDATA+5~, TIMEZONEDATA+16*, TIMEZONEDATA+21, TIMEZONEDATA+28 |
SLOTINCREMENT | INCREMENTAVAIL2+1~, INCREMENTAVAIL2+7*, INCREMENTAVAIL2+10 |
SLOTLENGTH | INCREMENTAVAIL2+1~, INCREMENTAVAIL2+6*, INCREMENTAVAIL2+8 |
SLOTSTATUSSTRING | INCREMENTAVAIL2+1~, INCREMENTAVAIL2+3*, INCREMENTAVAIL2+14 |
SPECIALCHARACTER | INCREMENTAVAIL2+1~, INCREMENTAVAIL2+13*, INCREMENTAVAIL2+14, INCREMENTAVAIL2+15 |
STATIONNUMBER | STATIONNUMBER+5~, STATIONNUMBER+6, STATIONNUMBER+7*, STATIONNUMBER+8*, STATIONNUMBER+9, STATIONNUMBER+12* |
STOPCODE | STOPCODETOAMIS+3~, STOPCODETOAMIS+4*, STOPCODETOAMIS+5, STOPCODETOAMIS+6, STOPCODETOAMIS+7*, STOPCODETOAMIS+8 |
STOPCODEIEN | RESCHKFAILED~, RESCHKFAILED+4, RESCHKFAILED+7 |
STOPCOUNT | AMISTOSTOPCODE+3~, AMISTOSTOPCODE+5*, AMISTOSTOPCODE+9*, AMISTOSTOPCODE+11 |
STOPFOUND | AMISTOSTOPCODE+3~, AMISTOSTOPCODE+5*, AMISTOSTOPCODE+10*, AMISTOSTOPCODE+12 |
STOPIEN | AMISTOSTOPCODE+3~, AMISTOSTOPCODE+5*, AMISTOSTOPCODE+6*, AMISTOSTOPCODE+7, AMISTOSTOPCODE+10, STOPCODETOAMIS~, STOPCODETOAMIS+4*, STOPCODETOAMIS+5, STOPCODETOAMIS+6, STOPCODETOAMIS+7 |
STOPINACTDT | AMISTOSTOPCODE+3~, AMISTOSTOPCODE+7*, AMISTOSTOPCODE+8 |
STRING | PADLENGTH~, PADLENGTH+2, PADLENGTH+3, PADLENGTH+5*, PADLENGTH+6*, PADLENGTH+7 |
SUNDAY | DSTSTART+5~, DSTSTART+8*, DSTSTART+14, DSTSTART+15, DSTEND+4~, DSTEND+8*, DSTEND+14, DSTEND+15, SUMMER~, SUMMER+6* , SUMMER+8 |
TIME | PADCLTIME~, PADCLTIME+2*, PADCLTIME+3, PADCLTIME+4*, PADCLTIME+5, PADFMTIME~, PADFMTIME+2, PADFMTIME+3*, PADFMTIME+4 |
TIMECLINICOPENS | INCREMENTAVAIL2+1~, INCREMENTAVAIL2+5*, INCREMENTAVAIL2+9 |
TIMEFRAMEARY | TIMEZONEDATA+5~ |
TIMEFRAMEARY( | TIMEZONEDATA+23, TIMEZONEDATA+24, TIMEZONEDATA+25, TIMEZONEDATA+26 |
TIMEFRAMEIEN | TIMEZONEDATA+5~, TIMEZONEDATA+21*, TIMEZONEDATA+22, TIMEZONEDATA+23, TIMEZONEDATA+24, TIMEZONEDATA+25, TIMEZONEDATA+26 |
TIMEZONEEXECPT | TIMEZONEDATA+5~, TIMEZONEDATA+18*, TIMEZONEDATA+28 |
TZINFO | GETTZOFFSET+7~, GETTZOFFSET+11*, GETTZOFFSET+12, GETTZOFFSET+14 |
VALIDSUNDAY | SUMMER+5~, SUMMER+8* |
WHERE | PADLENGTH~, PADLENGTH+5, PADLENGTH+6 |
X | SUMMER+5~, SUMMER+8*, TIMEZONEDATA+5~, TIMEZONEDATA+20*, TIMEZONEDATA+21 |
YR | ISDATEDST+6~, ISDATEDST+9*, ISDATEDST+10, ISDATEDST+11, DSTSTART~, DSTSTART+9*, DSTSTART+10, DSTSTART+11, DSTEND~, DSTEND+9* , DSTEND+10, DSTEND+11 |