SDESRTVCLN ;ALB/MGD,ANU - Get Clinic Info based on Clinic IEN ;July 19, 2022
;;5.3;Scheduling;**799,805,807,813,820,823**;Aug 13, 1993;Build 9
;;Per VHA Directive 6402, this routine should not be modified
;
; Documented API's and Integration Agreements
; -------------------------------------------
; Reference to $$GETS^DIQ is supported by IA #2056
; Reference to $$GETS1^DIQ is supported by IA #2056
Q
;
JSONCLNINFO(SDCLNJSON,SDCLNIEN,SDEAS) ;Get Clinic info
;INPUT - SDCLNIEN (Clinic IEN)
; - SDEAS [optional] - Enterprise Appointment Scheduling (EAS) Tracking Number associated to an appointment.
;RETURN PARAMETER:
; Clinic information from HOSPITAL LOCATION (#44) File. Data is in JSON format.
; Field List:
; (1) Clinic Name
; (2) Abbreviation
; (3) Patient Friendly Name
; (4) Clinic Meets at this Facility
; (5) ALLOW DIRECT PATIENT SCHEDULING?
; (6) DISPLAY CLIN APPT TO PATIENTS?
; (7) SERVICE
; (8) NON-COUNT CLINIC? (Y OR N)
; (9) DIVISION
; (10) STOP CODE NUMBER
; (11) DEFAULT APPOINTMENT TYPE
; (12) ADMINISTER INPATIENT MEDS?
; (13) TELEPHONE
; (14) REQUIRE X-RAY FILMS?
; (15) REQUIRE ACTION PROFILES?
; (16) NO SHOW LETTER
; (17) PRE-APPOINTMENT LETTER
; (18) CLINIC CANCELLATION LETTER
; (19) APPT. CANCELLATION LETTER
; (20) ASK FOR CHECK IN/OUT TIME
; (21) PROVIDER - This is a multiple
; (22) Flag indicating the provider is the default for the clinic
; (23) DEFAULT TO PC PRACTITIONER?
; (24) DIAGNOSIS - This is a multiple
; (25) Flag indicating the diagnosis is the default for the clinic
; (26) WORKLOAD VALIDATION AT CHK OUT
; (27) ALLOWABLE CONSECUTIVE NO-SHOWS
; (28) MAX # DAYS FOR FUTURE BOOKING
; (29) SCHEDULE ON HOLIDAYS?
; (30) CREDIT STOP CODE
; (31) PROHIBIT ACCESS TO CLINIC?
; (32) PHYSICAL LOCATION
; (33) PRINCIPAL Clinic
; (34) OVERBOOKS/DAY MAXIMUM
; (35) SPECIAL INSTRUCTIONS - This is a multiple
; (36) E-CHECKIN ALLOWED
; (37) PRE-CHECKIN ALLOWED
; (38) LENGTH OF APP'T
; (39) VARIABLE APP'NTMENT LENGTH
; (40) DISPLAY INCREMENTS PER HOUR
; (41) CHAR4
; (42) HOUR CLINIC DISPLAY BEGINS
; (43) TIMEZONE
; (44) INACTIVATE DATE
; (45) REACTIVATE DATE
;
N SDCLNSREC,ERRPOP,ERR,ERRMSG,SDECI
D INIT
D VALIDATE
I ERRPOP D BLDJSON Q
D BLDCLNREC
D BLDJSON
Q
;
INIT ; initialize values needed
S SDECI=0
S SDECI=$G(SDECI,0),ERR=""
S ERRPOP=0,ERRMSG=""
Q
;
VALIDATE ; validate incoming parameters
I SDCLNIEN="" D ERRLOG^SDESJSON(.SDCLNSREC,18) S ERRPOP=1 Q
I SDCLNIEN'="" D
.I '$D(^SC(SDCLNIEN,0)) D ERRLOG^SDESJSON(.SDCLNSREC,19) S ERRPOP=1
;validate EAS
S SDEAS=$G(SDEAS,"")
I $L(SDEAS) S SDEAS=$$EASVALIDATE^SDESUTIL(SDEAS)
I SDEAS=-1 D ERRLOG^SDESJSON(.SDCLNSREC,142) S ERRPOP=1
Q
;
BLDJSON ;
;D ENCODE^SDESJSON(.SDCLNSREC,.SDCLNJSON,.ERR)
D BUILDJSON^SDESBUILDJSON(.SDCLNJSON,.SDCLNSREC)
K SDCLNSREC
Q
;
BLDCLNREC ;Build a list of Providers
;
N SDFIELDS,SDDATA,SDMSG,SDX,SDC,TIMEZONE
;S SDFIELDS=".01;1;3.5;8;9;10;24;60;61;62;1914;2502;2504;2507;2802;99;2000;2000.5;2508;2509;2510;2511;2801;30;2001;2002;1918.5;2503;2500;1916;1918;20;21;1912;1913;1917"
S SDFIELDS=".01;1;3.5;8;9;10;24;60;61;62;1914;2502;2504;2505;2506;2507;2802;99;2000;2000.5;2508;2509;2510;2511;2801;30;2001;2002;1918.5;2503;2500;1916;1918;20;21;1912;1913;1917"
D GETS^DIQ(44,SDCLNIEN_",",SDFIELDS,"IE","SDDATA","SDMSG")
S SDECI=SDECI+1
S SDCLNSREC("Clinic","Name")=$G(SDDATA(44,SDCLNIEN_",",.01,"E")) ;Clinic Name
S SDCLNSREC("Clinic","Abbreviation")=$G(SDDATA(44,SDCLNIEN_",",1,"E")) ;Clinic Abbreviation
S SDCLNSREC("Clinic","PatientFriendlyName")=$G(SDDATA(44,SDCLNIEN_",",60,"E")) ;Patient Friendly Name
S SDCLNSREC("Clinic","MeetsAtThisFacility")=$G(SDDATA(44,SDCLNIEN_",",2504,"E")) ;Clinic meets at this facility?
S SDCLNSREC("Clinic","AllowPatScheduling")=$G(SDDATA(44,SDCLNIEN_",",61,"E")) ;Allow Direct Patient Scheduling?
S SDCLNSREC("Clinic","DisplayClinicAppt")=$G(SDDATA(44,SDCLNIEN_",",62,"E")) ;DISPLAY CLIN APPT TO PATIENTS?
S SDCLNSREC("Clinic","Service")=$G(SDDATA(44,SDCLNIEN_",",9,"E")) ;Service
S SDCLNSREC("Clinic","NonCountClinic")=$G(SDDATA(44,SDCLNIEN_",",2502,"E")) ;NON-COUNT CLINIC? (Y OR N)
S SDCLNSREC("Clinic","Division")=$G(SDDATA(44,SDCLNIEN_",",3.5,"E")) ;Division
S SDCLNSREC("Clinic","StopCodeName")=$G(SDDATA(44,SDCLNIEN_",",8,"E")) ;Stop Code Name
S SDCLNSREC("Clinic","StopCodeNum")=$G(SDDATA(44,SDCLNIEN_",",8,"I")) ;Stop Code Number
S SDCLNSREC("Clinic","DefaultApptType")=$G(SDDATA(44,SDCLNIEN_",",2507,"E")) ;Default Appointment type
S SDCLNSREC("Clinic","AdminInpatientMeds")=$G(SDDATA(44,SDCLNIEN_",",2802,"E")) ;ADMINISTER INPATIENT MEDS?
S SDCLNSREC("Clinic","Telephone")=$G(SDDATA(44,SDCLNIEN_",",99,"E")) ;TELEPHONE
S SDCLNSREC("Clinic","ReqXrayFilms")=$G(SDDATA(44,SDCLNIEN_",",2000,"E")) ;REQUIRE X-RAY FILMS?
S SDCLNSREC("Clinic","ReqActionProfiles")=$G(SDDATA(44,SDCLNIEN_",",2000.5,"E")) ;REQUIRE ACTION PROFILES?
S SDCLNSREC("Clinic","NoShowLetter")=$G(SDDATA(44,SDCLNIEN_",",2508,"E")) ;NO SHOW LETTER
S SDCLNSREC("Clinic","NoShowLetterIEN")=$G(SDDATA(44,SDCLNIEN_",",2508,"I")) ;NO SHOW IEN
S SDCLNSREC("Clinic","PreApptLetter")=$G(SDDATA(44,SDCLNIEN_",",2509,"E")) ;PRE-APPOINTMENT LETTER
S SDCLNSREC("Clinic","CancelLetter")=$G(SDDATA(44,SDCLNIEN_",",2510,"E")) ;CLINIC CANCELLATION LETTER
S SDCLNSREC("Clinic","ApptCancelLetter")=$G(SDDATA(44,SDCLNIEN_",",2511,"E")) ;APPT. CANCELLATION LETTER
S SDCLNSREC("Clinic","CheckinCheckoutTime")=$G(SDDATA(44,SDCLNIEN_",",24,"E")) ;ASK FOR CHECK IN/OUT TIME
;S SDCLNSREC("Clinic","Provider")=$G(SDDATA(44,SDCLNIEN_",",.01,"E")) ;PROVIDER - This is a multiple
S SDCLNSREC("Clinic","DefaultToPCPractitioner")=$G(SDDATA(44,SDCLNIEN_",",2801,"E")) ;DEFAULT TO PC PRACTITIONER?
;S SDCLNSREC("Clinic","Diagnosis")=$G(SDDATA(44,SDCLNIEN_",",.01,"E")) ;DIAGNOSIS - This is a multiple
S SDCLNSREC("Clinic","WorkloadValidationCheckout")=$G(SDDATA(44,SDCLNIEN_",",30,"E")) ;WORKLOAD VALIDATION AT CHK OUT
S SDCLNSREC("Clinic","AllowableConsecutiveNoShows")=$G(SDDATA(44,SDCLNIEN_",",2001,"E")) ;ALLOWABLE CONSECUTIVE NO-SHOWS
S SDCLNSREC("Clinic","MaxDaysForFutureBooking")=$G(SDDATA(44,SDCLNIEN_",",2002,"E")) ;MAX # DAYS FOR FUTURE BOOKING
S SDCLNSREC("Clinic","HolidaySchedule")=$G(SDDATA(44,SDCLNIEN_",",1918.5,"E")) ;SCHEDULE ON HOLIDAYS?
S SDCLNSREC("Clinic","CreditStopCode")=$G(SDDATA(44,SDCLNIEN_",",2503,"E")) ;CREDIT STOP CODE
S SDCLNSREC("Clinic","ProhibitAccessToClinic")=$G(SDDATA(44,SDCLNIEN_",",2500,"E")) ;PROHIBIT ACCESS TO CLINIC?
S SDCLNSREC("Clinic","PhysicalLocation")=$G(SDDATA(44,SDCLNIEN_",",10,"E")) ;PHYSICAL LOCATION
S SDCLNSREC("Clinic","Principal")=$G(SDDATA(44,SDCLNIEN_",",1916,"E")) ;PRINCIPAL Clinic
S SDCLNSREC("Clinic","OverbooksPerDayMax")=$G(SDDATA(44,SDCLNIEN_",",1918,"E")) ;OVERBOOKS/DAY MAXIMUM
S SDCLNSREC("Clinic","ECheckinAllowed")=$G(SDDATA(44,SDCLNIEN_",",20,"E")) ;E-CHECKIN ALLOWED
S SDCLNSREC("Clinic","PreCheckinAllowed")=$G(SDDATA(44,SDCLNIEN_",",21,"E")) ;PRE-CHECKIN ALLOWED NO
S SDCLNSREC("Clinic","LengthOfAppt")=$G(SDDATA(44,SDCLNIEN_",",1912,"E")) ;LENGTH OF APP'T
S SDCLNSREC("Clinic","VariableApptLength")=$G(SDDATA(44,SDCLNIEN_",",1913,"E")) ;VARIABLE APP'NTMENT LENGTH
S SDCLNSREC("Clinic","IncrementsPerHr")=$G(SDDATA(44,SDCLNIEN_",",1917,"E")) ;DISPLAY INCREMENTS PER HOUR
S SDCLNSREC("Clinic","HourClinicDisplayBegins")=$S($G(SDDATA(44,SDCLNIEN_",",1914,"E"))'="":$G(SDDATA(44,SDCLNIEN_",",1914,"E")),1:8) ; HOUR CLINIC DISPLAY BEGINS
S TIMEZONE=$$TIMEZONEDATA^SDESUTIL($G(SDCLNIEN)),TIMEZONE=$P($G(TIMEZONE),U)
S SDCLNSREC("Clinic","Timezone")=TIMEZONE
S SDCLNSREC("Clinic","Inactivate Date")=$$FMTISO^SDAMUTDT($G(SDDATA(44,SDCLNIEN_",",2505,"I"))) ;Inactivate Date
S SDCLNSREC("Clinic","Reactivate Date")=$$FMTISO^SDAMUTDT($G(SDDATA(44,SDCLNIEN_",",2506,"I"))) ;Reactivate Date
; Get CHAR4 Data
N CHAR4
S CHAR4=$$CHAR4^SDESUTIL($G(SDDATA(44,SDCLNIEN_",",.01,"E")))
S SDCLNSREC("Clinic","CHAR4")=CHAR4
; Special Instructions Multiple
S SDX="",SDC=0
S SDFIELDS="1910*"
K SDDATA,SDMSG
D GETS^DIQ(44,SDCLNIEN_",",SDFIELDS,"E","SDDATA","SDMSG")
F S SDX=$O(SDDATA(44.03,SDX)) Q:SDX="" D
. S SDC=SDC+1
. S SDCLNSREC("Clinic","Special Instructions "_SDC)=$G(SDDATA(44.03,SDX,.01,"E"))
; Providers Multiple
S SDX="",SDC=0
S SDFIELDS="2600*"
K SDDATA,SDMSG
D GETS^DIQ(44,SDCLNIEN_",",SDFIELDS,"E","SDDATA","SDMSG")
F S SDX=$O(SDDATA(44.1,SDX)) Q:SDX="" D
. S SDC=SDC+1
. S SDCLNSREC("Clinic","Provider",SDC,"Name")=$G(SDDATA(44.1,SDX,.01,"E"))
. S SDCLNSREC("Clinic","Provider",SDC,"DefaultForClinic")=$G(SDDATA(44.1,SDX,.02,"E"))
; Diagnosis Multiple
S SDX="",SDC=0
S SDFIELDS="2700*"
K SDDATA,SDMSG
D GETS^DIQ(44,SDCLNIEN_",",SDFIELDS,"E","SDDATA","SDMSG")
F S SDX=$O(SDDATA(44.11,SDX)) Q:SDX="" D
. S SDC=SDC+1
. S SDCLNSREC("Clinic","Diagnosis",SDC,"Code")=$G(SDDATA(44.11,SDX,.01,"E"))
. S SDCLNSREC("Clinic","Diagnosis",SDC,"DefaultForClinic")=$G(SDDATA(44.11,SDX,.02,"E"))
I '$D(SDCLNSREC("Clinic")) S SDCLNSREC("Clinic")=""
I SDECI=0 D
. ;create error message - No Clinic found that match Clinic IEN
. D ERRLOG^SDESJSON(.SDCLNSREC,19)
. S ERRPOP=1
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDESRTVCLN 9293 printed Oct 16, 2024@18:58:07 Page 2
SDESRTVCLN ;ALB/MGD,ANU - Get Clinic Info based on Clinic IEN ;July 19, 2022
+1 ;;5.3;Scheduling;**799,805,807,813,820,823**;Aug 13, 1993;Build 9
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 ; Documented API's and Integration Agreements
+5 ; -------------------------------------------
+6 ; Reference to $$GETS^DIQ is supported by IA #2056
+7 ; Reference to $$GETS1^DIQ is supported by IA #2056
+8 QUIT
+9 ;
JSONCLNINFO(SDCLNJSON,SDCLNIEN,SDEAS) ;Get Clinic info
+1 ;INPUT - SDCLNIEN (Clinic IEN)
+2 ; - SDEAS [optional] - Enterprise Appointment Scheduling (EAS) Tracking Number associated to an appointment.
+3 ;RETURN PARAMETER:
+4 ; Clinic information from HOSPITAL LOCATION (#44) File. Data is in JSON format.
+5 ; Field List:
+6 ; (1) Clinic Name
+7 ; (2) Abbreviation
+8 ; (3) Patient Friendly Name
+9 ; (4) Clinic Meets at this Facility
+10 ; (5) ALLOW DIRECT PATIENT SCHEDULING?
+11 ; (6) DISPLAY CLIN APPT TO PATIENTS?
+12 ; (7) SERVICE
+13 ; (8) NON-COUNT CLINIC? (Y OR N)
+14 ; (9) DIVISION
+15 ; (10) STOP CODE NUMBER
+16 ; (11) DEFAULT APPOINTMENT TYPE
+17 ; (12) ADMINISTER INPATIENT MEDS?
+18 ; (13) TELEPHONE
+19 ; (14) REQUIRE X-RAY FILMS?
+20 ; (15) REQUIRE ACTION PROFILES?
+21 ; (16) NO SHOW LETTER
+22 ; (17) PRE-APPOINTMENT LETTER
+23 ; (18) CLINIC CANCELLATION LETTER
+24 ; (19) APPT. CANCELLATION LETTER
+25 ; (20) ASK FOR CHECK IN/OUT TIME
+26 ; (21) PROVIDER - This is a multiple
+27 ; (22) Flag indicating the provider is the default for the clinic
+28 ; (23) DEFAULT TO PC PRACTITIONER?
+29 ; (24) DIAGNOSIS - This is a multiple
+30 ; (25) Flag indicating the diagnosis is the default for the clinic
+31 ; (26) WORKLOAD VALIDATION AT CHK OUT
+32 ; (27) ALLOWABLE CONSECUTIVE NO-SHOWS
+33 ; (28) MAX # DAYS FOR FUTURE BOOKING
+34 ; (29) SCHEDULE ON HOLIDAYS?
+35 ; (30) CREDIT STOP CODE
+36 ; (31) PROHIBIT ACCESS TO CLINIC?
+37 ; (32) PHYSICAL LOCATION
+38 ; (33) PRINCIPAL Clinic
+39 ; (34) OVERBOOKS/DAY MAXIMUM
+40 ; (35) SPECIAL INSTRUCTIONS - This is a multiple
+41 ; (36) E-CHECKIN ALLOWED
+42 ; (37) PRE-CHECKIN ALLOWED
+43 ; (38) LENGTH OF APP'T
+44 ; (39) VARIABLE APP'NTMENT LENGTH
+45 ; (40) DISPLAY INCREMENTS PER HOUR
+46 ; (41) CHAR4
+47 ; (42) HOUR CLINIC DISPLAY BEGINS
+48 ; (43) TIMEZONE
+49 ; (44) INACTIVATE DATE
+50 ; (45) REACTIVATE DATE
+51 ;
+52 NEW SDCLNSREC,ERRPOP,ERR,ERRMSG,SDECI
+53 DO INIT
+54 DO VALIDATE
+55 IF ERRPOP
DO BLDJSON
QUIT
+56 DO BLDCLNREC
+57 DO BLDJSON
+58 QUIT
+59 ;
INIT ; initialize values needed
+1 SET SDECI=0
+2 SET SDECI=$GET(SDECI,0)
SET ERR=""
+3 SET ERRPOP=0
SET ERRMSG=""
+4 QUIT
+5 ;
VALIDATE ; validate incoming parameters
+1 IF SDCLNIEN=""
DO ERRLOG^SDESJSON(.SDCLNSREC,18)
SET ERRPOP=1
QUIT
+2 IF SDCLNIEN'=""
Begin DoDot:1
+3 IF '$DATA(^SC(SDCLNIEN,0))
DO ERRLOG^SDESJSON(.SDCLNSREC,19)
SET ERRPOP=1
End DoDot:1
+4 ;validate EAS
+5 SET SDEAS=$GET(SDEAS,"")
+6 IF $LENGTH(SDEAS)
SET SDEAS=$$EASVALIDATE^SDESUTIL(SDEAS)
+7 IF SDEAS=-1
DO ERRLOG^SDESJSON(.SDCLNSREC,142)
SET ERRPOP=1
+8 QUIT
+9 ;
BLDJSON ;
+1 ;D ENCODE^SDESJSON(.SDCLNSREC,.SDCLNJSON,.ERR)
+2 DO BUILDJSON^SDESBUILDJSON(.SDCLNJSON,.SDCLNSREC)
+3 KILL SDCLNSREC
+4 QUIT
+5 ;
BLDCLNREC ;Build a list of Providers
+1 ;
+2 NEW SDFIELDS,SDDATA,SDMSG,SDX,SDC,TIMEZONE
+3 ;S SDFIELDS=".01;1;3.5;8;9;10;24;60;61;62;1914;2502;2504;2507;2802;99;2000;2000.5;2508;2509;2510;2511;2801;30;2001;2002;1918.5;2503;2500;1916;1918;20;21;1912;1913;1917"
+4 SET SDFIELDS=".01;1;3.5;8;9;10;24;60;61;62;1914;2502;2504;2505;2506;2507;2802;99;2000;2000.5;2508;2509;2510;2511;2801;30;2001;2002;1918.5;2503;2500;1916;1918;20;21;1912;1913;1917"
+5 DO GETS^DIQ(44,SDCLNIEN_",",SDFIELDS,"IE","SDDATA","SDMSG")
+6 SET SDECI=SDECI+1
+7 ;Clinic Name
SET SDCLNSREC("Clinic","Name")=$GET(SDDATA(44,SDCLNIEN_",",.01,"E"))
+8 ;Clinic Abbreviation
SET SDCLNSREC("Clinic","Abbreviation")=$GET(SDDATA(44,SDCLNIEN_",",1,"E"))
+9 ;Patient Friendly Name
SET SDCLNSREC("Clinic","PatientFriendlyName")=$GET(SDDATA(44,SDCLNIEN_",",60,"E"))
+10 ;Clinic meets at this facility?
SET SDCLNSREC("Clinic","MeetsAtThisFacility")=$GET(SDDATA(44,SDCLNIEN_",",2504,"E"))
+11 ;Allow Direct Patient Scheduling?
SET SDCLNSREC("Clinic","AllowPatScheduling")=$GET(SDDATA(44,SDCLNIEN_",",61,"E"))
+12 ;DISPLAY CLIN APPT TO PATIENTS?
SET SDCLNSREC("Clinic","DisplayClinicAppt")=$GET(SDDATA(44,SDCLNIEN_",",62,"E"))
+13 ;Service
SET SDCLNSREC("Clinic","Service")=$GET(SDDATA(44,SDCLNIEN_",",9,"E"))
+14 ;NON-COUNT CLINIC? (Y OR N)
SET SDCLNSREC("Clinic","NonCountClinic")=$GET(SDDATA(44,SDCLNIEN_",",2502,"E"))
+15 ;Division
SET SDCLNSREC("Clinic","Division")=$GET(SDDATA(44,SDCLNIEN_",",3.5,"E"))
+16 ;Stop Code Name
SET SDCLNSREC("Clinic","StopCodeName")=$GET(SDDATA(44,SDCLNIEN_",",8,"E"))
+17 ;Stop Code Number
SET SDCLNSREC("Clinic","StopCodeNum")=$GET(SDDATA(44,SDCLNIEN_",",8,"I"))
+18 ;Default Appointment type
SET SDCLNSREC("Clinic","DefaultApptType")=$GET(SDDATA(44,SDCLNIEN_",",2507,"E"))
+19 ;ADMINISTER INPATIENT MEDS?
SET SDCLNSREC("Clinic","AdminInpatientMeds")=$GET(SDDATA(44,SDCLNIEN_",",2802,"E"))
+20 ;TELEPHONE
SET SDCLNSREC("Clinic","Telephone")=$GET(SDDATA(44,SDCLNIEN_",",99,"E"))
+21 ;REQUIRE X-RAY FILMS?
SET SDCLNSREC("Clinic","ReqXrayFilms")=$GET(SDDATA(44,SDCLNIEN_",",2000,"E"))
+22 ;REQUIRE ACTION PROFILES?
SET SDCLNSREC("Clinic","ReqActionProfiles")=$GET(SDDATA(44,SDCLNIEN_",",2000.5,"E"))
+23 ;NO SHOW LETTER
SET SDCLNSREC("Clinic","NoShowLetter")=$GET(SDDATA(44,SDCLNIEN_",",2508,"E"))
+24 ;NO SHOW IEN
SET SDCLNSREC("Clinic","NoShowLetterIEN")=$GET(SDDATA(44,SDCLNIEN_",",2508,"I"))
+25 ;PRE-APPOINTMENT LETTER
SET SDCLNSREC("Clinic","PreApptLetter")=$GET(SDDATA(44,SDCLNIEN_",",2509,"E"))
+26 ;CLINIC CANCELLATION LETTER
SET SDCLNSREC("Clinic","CancelLetter")=$GET(SDDATA(44,SDCLNIEN_",",2510,"E"))
+27 ;APPT. CANCELLATION LETTER
SET SDCLNSREC("Clinic","ApptCancelLetter")=$GET(SDDATA(44,SDCLNIEN_",",2511,"E"))
+28 ;ASK FOR CHECK IN/OUT TIME
SET SDCLNSREC("Clinic","CheckinCheckoutTime")=$GET(SDDATA(44,SDCLNIEN_",",24,"E"))
+29 ;S SDCLNSREC("Clinic","Provider")=$G(SDDATA(44,SDCLNIEN_",",.01,"E")) ;PROVIDER - This is a multiple
+30 ;DEFAULT TO PC PRACTITIONER?
SET SDCLNSREC("Clinic","DefaultToPCPractitioner")=$GET(SDDATA(44,SDCLNIEN_",",2801,"E"))
+31 ;S SDCLNSREC("Clinic","Diagnosis")=$G(SDDATA(44,SDCLNIEN_",",.01,"E")) ;DIAGNOSIS - This is a multiple
+32 ;WORKLOAD VALIDATION AT CHK OUT
SET SDCLNSREC("Clinic","WorkloadValidationCheckout")=$GET(SDDATA(44,SDCLNIEN_",",30,"E"))
+33 ;ALLOWABLE CONSECUTIVE NO-SHOWS
SET SDCLNSREC("Clinic","AllowableConsecutiveNoShows")=$GET(SDDATA(44,SDCLNIEN_",",2001,"E"))
+34 ;MAX # DAYS FOR FUTURE BOOKING
SET SDCLNSREC("Clinic","MaxDaysForFutureBooking")=$GET(SDDATA(44,SDCLNIEN_",",2002,"E"))
+35 ;SCHEDULE ON HOLIDAYS?
SET SDCLNSREC("Clinic","HolidaySchedule")=$GET(SDDATA(44,SDCLNIEN_",",1918.5,"E"))
+36 ;CREDIT STOP CODE
SET SDCLNSREC("Clinic","CreditStopCode")=$GET(SDDATA(44,SDCLNIEN_",",2503,"E"))
+37 ;PROHIBIT ACCESS TO CLINIC?
SET SDCLNSREC("Clinic","ProhibitAccessToClinic")=$GET(SDDATA(44,SDCLNIEN_",",2500,"E"))
+38 ;PHYSICAL LOCATION
SET SDCLNSREC("Clinic","PhysicalLocation")=$GET(SDDATA(44,SDCLNIEN_",",10,"E"))
+39 ;PRINCIPAL Clinic
SET SDCLNSREC("Clinic","Principal")=$GET(SDDATA(44,SDCLNIEN_",",1916,"E"))
+40 ;OVERBOOKS/DAY MAXIMUM
SET SDCLNSREC("Clinic","OverbooksPerDayMax")=$GET(SDDATA(44,SDCLNIEN_",",1918,"E"))
+41 ;E-CHECKIN ALLOWED
SET SDCLNSREC("Clinic","ECheckinAllowed")=$GET(SDDATA(44,SDCLNIEN_",",20,"E"))
+42 ;PRE-CHECKIN ALLOWED NO
SET SDCLNSREC("Clinic","PreCheckinAllowed")=$GET(SDDATA(44,SDCLNIEN_",",21,"E"))
+43 ;LENGTH OF APP'T
SET SDCLNSREC("Clinic","LengthOfAppt")=$GET(SDDATA(44,SDCLNIEN_",",1912,"E"))
+44 ;VARIABLE APP'NTMENT LENGTH
SET SDCLNSREC("Clinic","VariableApptLength")=$GET(SDDATA(44,SDCLNIEN_",",1913,"E"))
+45 ;DISPLAY INCREMENTS PER HOUR
SET SDCLNSREC("Clinic","IncrementsPerHr")=$GET(SDDATA(44,SDCLNIEN_",",1917,"E"))
+46 ; HOUR CLINIC DISPLAY BEGINS
SET SDCLNSREC("Clinic","HourClinicDisplayBegins")=$SELECT($GET(SDDATA(44,SDCLNIEN_",",1914,"E"))'="":$GET(SDDATA(44,SDCLNIEN_",",1914,"E")),1:8)
+47 SET TIMEZONE=$$TIMEZONEDATA^SDESUTIL($GET(SDCLNIEN))
SET TIMEZONE=$PIECE($GET(TIMEZONE),U)
+48 SET SDCLNSREC("Clinic","Timezone")=TIMEZONE
+49 ;Inactivate Date
SET SDCLNSREC("Clinic","Inactivate Date")=$$FMTISO^SDAMUTDT($GET(SDDATA(44,SDCLNIEN_",",2505,"I")))
+50 ;Reactivate Date
SET SDCLNSREC("Clinic","Reactivate Date")=$$FMTISO^SDAMUTDT($GET(SDDATA(44,SDCLNIEN_",",2506,"I")))
+51 ; Get CHAR4 Data
+52 NEW CHAR4
+53 SET CHAR4=$$CHAR4^SDESUTIL($GET(SDDATA(44,SDCLNIEN_",",.01,"E")))
+54 SET SDCLNSREC("Clinic","CHAR4")=CHAR4
+55 ; Special Instructions Multiple
+56 SET SDX=""
SET SDC=0
+57 SET SDFIELDS="1910*"
+58 KILL SDDATA,SDMSG
+59 DO GETS^DIQ(44,SDCLNIEN_",",SDFIELDS,"E","SDDATA","SDMSG")
+60 FOR
SET SDX=$ORDER(SDDATA(44.03,SDX))
if SDX=""
QUIT
Begin DoDot:1
+61 SET SDC=SDC+1
+62 SET SDCLNSREC("Clinic","Special Instructions "_SDC)=$GET(SDDATA(44.03,SDX,.01,"E"))
End DoDot:1
+63 ; Providers Multiple
+64 SET SDX=""
SET SDC=0
+65 SET SDFIELDS="2600*"
+66 KILL SDDATA,SDMSG
+67 DO GETS^DIQ(44,SDCLNIEN_",",SDFIELDS,"E","SDDATA","SDMSG")
+68 FOR
SET SDX=$ORDER(SDDATA(44.1,SDX))
if SDX=""
QUIT
Begin DoDot:1
+69 SET SDC=SDC+1
+70 SET SDCLNSREC("Clinic","Provider",SDC,"Name")=$GET(SDDATA(44.1,SDX,.01,"E"))
+71 SET SDCLNSREC("Clinic","Provider",SDC,"DefaultForClinic")=$GET(SDDATA(44.1,SDX,.02,"E"))
End DoDot:1
+72 ; Diagnosis Multiple
+73 SET SDX=""
SET SDC=0
+74 SET SDFIELDS="2700*"
+75 KILL SDDATA,SDMSG
+76 DO GETS^DIQ(44,SDCLNIEN_",",SDFIELDS,"E","SDDATA","SDMSG")
+77 FOR
SET SDX=$ORDER(SDDATA(44.11,SDX))
if SDX=""
QUIT
Begin DoDot:1
+78 SET SDC=SDC+1
+79 SET SDCLNSREC("Clinic","Diagnosis",SDC,"Code")=$GET(SDDATA(44.11,SDX,.01,"E"))
+80 SET SDCLNSREC("Clinic","Diagnosis",SDC,"DefaultForClinic")=$GET(SDDATA(44.11,SDX,.02,"E"))
End DoDot:1
+81 IF '$DATA(SDCLNSREC("Clinic"))
SET SDCLNSREC("Clinic")=""
+82 IF SDECI=0
Begin DoDot:1
+83 ;create error message - No Clinic found that match Clinic IEN
+84 DO ERRLOG^SDESJSON(.SDCLNSREC,19)
+85 SET ERRPOP=1
End DoDot:1
+86 QUIT
+87 ;