SDES2VVSJSON ;ALB/ANU - VISTA SCHEDULING RPC SDES2 GET INFO FOR VIDEO VISIT ; FEB 15,2024@11:25
;;5.3;Scheduling;**871**;Aug 13, 1993;Build 13
;;Per VHA Directive 6402, this routine should not be modified
;
; Documented API's and Integration Agreements
; -------------------------------------------
; Reference to $$GETS^DIQ,$$GETS1^DIQ in ICR #2056
Q
; INPUT
;
; SDCONTEXT("ACHERON AUDIT ID") = Up to 40 Character unique ID number. Ex: 11d9dcc6-c6a2-4785-8031-8261576fca37
; SDCONTEXT("USER DUZ") = The DUZ of the user taking action in the calling application.
; SDCONTEXT("USER SECID") = The SECID of the user taking action in the calling application.
; SDINPUT("PATIENT IEN") = The DFN/IEN of the target patient from the calling application.
; SDINPUT("CLINIC IEN") = The IEN of the target clinic from the calling application.
; SDINPUT("APPT DATE TIME") = Appointment Date and Time.
;
GETVVSMAKEINFO(JSON,SDCONTEXT,SDINPUT) ;Get info to make a Video Visit Web Service (VVS) call
N ERRORS,SDRETURN,PARAMETERS,FDA,SDCHECKIN,IEN,ENTRY,SDUSER
;
; Validate SDCONTEXT
;
D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
I $D(ERRORS) S ERRORS("VVSMakeInfo",1)="" D BUILDJSON^SDES2JSON(.JSON,.ERRORS) Q
; Validate PARAMS
S PARAMETERS=$$VALPARAMS(.SDINPUT,.ERRORS)
I $D(ERRORS) S ERRORS("VVSMakeInfo",1)="" D BUILDJSON^SDES2JSON(.JSON,.ERRORS) Q
;
S SDUSER=$S(+$G(SDCONTEXT("USER DUZ")):+SDCONTEXT("USER DUZ"),1:$G(DUZ))
S PATIENTIEN=$P(PARAMETERS,"^")
S CLINICIEN=$P(PARAMETERS,"^",2)
S APPTDTTM=$P(PARAMETERS,"^",3)
D GETVVSMAKE(.SDRETURN,PATIENTIEN,CLINICIEN,APPTDTTM)
I '$D(SDRETURN) S SDRETURN("VVSMakeInfo",1)=""
D BUILDJSON^SDES2JSON(.JSON,.SDRETURN)
Q
;
VALPARAMS(PARAMS,SDERRORS) ; Validate
N STATUS,PATIENTIEN,CLINICIEN,APPTDTTM,SDVALID
;
; Validate Patient IEN
S PATIENTIEN=$G(PARAMS("PATIENT IEN"))
D VALFILEIEN^SDES2VALUTIL(.SDVALID,.SDERRORS,2,$G(PATIENTIEN),1,,66,2)
I $G(SDVALID)'=1 Q 0
; Validate Clinic IEN
S CLINICIEN=$G(PARAMS("CLINIC IEN"))
D VALFILEIEN^SDES2VALUTIL(.SDVALID,.SDERRORS,44,$G(CLINICIEN),1,,67,19)
I $G(SDVALID)'=1 Q 0
; Validate Appointment date and time
S APPTDTTM=$G(PARAMS("APPT DATE TIME"))
S APPTDTTM=$$VALISODTTM^SDES2VALISODTTM(.SDERRORS,$G(APPTDTTM),$G(CLINICIEN),1,76,77)
;
Q:$D(SDERRORS) 0
Q PATIENTIEN_"^"_CLINICIEN_"^"_APPTDTTM
;
GETVVSMAKE(SDRETURN,PATIENTIEN,CLINICIEN,APPTDTTM) ;GET INFO TO MAKE A VIDEO VISIT WEB SERVICE (VVS) CALL
;INPUT:
; PATIENTIEN (Patient IEN)
; CLINICIEN (Clinic IEN)
; APPTDTTM - Appointment date and time external format
;
;RETURN PARMETER:
; Field List:
; (1) Patient Info
; (2) Default Provider Info
; (3) System Info
;
N ERRPOP,ERR,ERRMSG,SDESI,VVSPATIENT,VVSPROVIDER,PROVIDERINFO,VVSSYSTEMINFO,PATINFO
S SDESI=0
S SDESI=$G(SDESI,0),ERR=""
S (VVSPATIENT,VVSPROVIDER,PROVIDERINFO,VVSSYSTEMINFO)=""
S ERRPOP=0,SDESI=0,ERRMSG=""
; Build VVS info
S SDRETURN("VVSMakeInfo","Appointment","ApptDtTm")=$$FMTISO^SDAMUTDT(APPTDTTM,CLINICIEN)
S VVSPATIENT=""
D GETVVSPATIENT(.VVSPATIENT,PATIENTIEN)
I VVSPATIENT'="" D
.S SDESI=1
.S SDRETURN("VVSMakeInfo","Patient","IEN")=$P(VVSPATIENT,"^",1)
.S SDRETURN("VVSMakeInfo","Patient","DateOfBirth")=$P(VVSPATIENT,"^",2)
.S SDRETURN("VVSMakeInfo","Patient","FirstName")=$P(VVSPATIENT,"^",3)
.S SDRETURN("VVSMakeInfo","Patient","LastName")=$P(VVSPATIENT,"^",4)
.S SDRETURN("VVSMakeInfo","Patient","SSN")=$P(VVSPATIENT,"^",5)
.S SDRETURN("VVSMakeInfo","Patient","Email")=$P(VVSPATIENT,"^",6)
.S SDRETURN("VVSMakeInfo","Patient","HomePhone")=$P(VVSPATIENT,"^",7)
.S SDRETURN("VVSMakeInfo","Patient","CellPhone")=$P(VVSPATIENT,"^",8)
.S SDRETURN("VVSMakeInfo","Patient","ICN")=$P(VVSPATIENT,"^",9)
.S SDRETURN("VVSMakeInfo","Patient","ZipCode")=$P(VVSPATIENT,"^",10)
D GETDPROIEN(.PROVIDERIEN,CLINICIEN)
D GETPROINFO(.PROVIDERINFO,PROVIDERIEN)
I PROVIDERINFO'="" D
.S SDESI=1
.S SDRETURN("VVSMakeInfo","Provider","IEN")=$P(PROVIDERINFO,"^",1)
.S SDRETURN("VVSMakeInfo","Provider","Name")=$P(PROVIDERINFO,"^",2)
.S SDRETURN("VVSMakeInfo","Provider","Email")=$P(PROVIDERINFO,"^",3)
.S SDRETURN("VVSMakeInfo","Provider","Cell")=$P(PROVIDERINFO,"^",4)
D GETSYSTEMINFO(.VVSSYSTEMINFO,CLINICIEN)
I VVSSYSTEMINFO'="" D
.S SDESI=1
.S SDRETURN("VVSMakeInfo","SystemInfo","StationID")=$P(VVSSYSTEMINFO,"^",1)
.S SDRETURN("VVSMakeInfo","SystemInfo","FacilityName")=$P(VVSSYSTEMINFO,"^",2)
.S SDRETURN("VVSMakeInfo","SystemInfo","TimeZone")=$P(VVSSYSTEMINFO,"^",3)
.S SDRETURN("VVSMakeInfo","SystemInfo","TimeZoneException")=$P(VVSSYSTEMINFO,"^",4)
.S SDRETURN("VVSMakeInfo","SystemInfo","Offset")=$P(VVSSYSTEMINFO,"^",5)
.S SDRETURN("VVSMakeInfo","SystemInfo","OffsetDST")=$P(VVSSYSTEMINFO,"^",6)
Q
;
GETVVSPATIENT(RETURN,PATIENTIEN) ;GET VIDEO VISIT SERVICE (VVS) PATIENT
Q:PATIENTIEN=""
N NAME,LASTNAME,FIRSTNAME,DOB,SSN,EMAIL,HOMEPHONE,CELLPHONE,ICN,ZIPCODE
S NAME=$$GET1^DIQ(2,PATIENTIEN,.01)
S LASTNAME=$P(NAME,",",1)
S FIRSTNAME=$P($P(NAME,",",2)," ",1)
S DOB=$$GET1^DIQ(2,PATIENTIEN,.03)
S SSN=$$LAST4SSN^SDESINPUTVALUTL(PATIENTIEN) ;SSN
S EMAIL=$$GET1^DIQ(2,PATIENTIEN,.133)
S HOMEPHONE=$$GET1^DIQ(2,PATIENTIEN,.131)
S CELLPHONE=$$GET1^DIQ(2,PATIENTIEN,.134)
S ICN=$$GETICN^MPIF001(PATIENTIEN)
S ZIPCODE=$$GET1^DIQ(2,PATIENTIEN,.116)
S RETURN=PATIENTIEN_"^"_DOB_"^"_FIRSTNAME_"^"_LASTNAME_"^"_SSN_"^"_EMAIL_"^"_HOMEPHONE_"^"_CELLPHONE_"^"_ICN_"^"_ZIPCODE
Q
;
GETDPROIEN(RETURN,CLINICIEN) ;GET THE IEN FOR THE DEFAULT PROVIDER ASSIGNED TO A CLINIC
Q:CLINICIEN=""
N SDFIELDS,PROVREC
S (PROVIDERIEN,PROVREC)="",SDFIELDS="2600*"
K SDDATA,SDMSG
D GETS^DIQ(44,CLINICIEN_",",SDFIELDS,"IE","SDDATA","SDMSG")
F S PROVREC=$O(SDDATA(44.1,PROVREC)) Q:PROVREC="" D Q:$G(PROVIDERIEN)
. I $G(SDDATA(44.1,PROVREC,.02,"E"))="YES" S PROVIDERIEN=$G(SDDATA(44.1,PROVREC,.01,"I"))
S RETURN=PROVIDERIEN
Q
;
GETPROINFO(RETURN,PROVIDERIEN) ;GET PROVIDER INFO REQUIRED TO MAKE VIDEO VISIT SERVICE (VVS) CALL
Q:PROVIDERIEN=""
N NAME,EMAIL,CELL,TITLE,PROVCLASS
S NAME=$$GET1^DIQ(200,PROVIDERIEN,.01)
S EMAIL=$$GET1^DIQ(200,PROVIDERIEN,.151)
S CELL=$$GET1^DIQ(200,PROVIDERIEN,.133)
S TITLE=$$GET1^DIQ(200,PROVIDERIEN,8,"E")
S PROVCLASS=$$GET1^DIQ(200,PROVIDERIEN,53.5,"E")
S RETURN=PROVIDERIEN_"^"_NAME_"^"_EMAIL_"^"_CELL_"^"_TITLE_"^"_PROVCLASS
S ^TMP(DUZ,"SDECPROIEN")=PROVIDERIEN
Q
;
GETSYSTEMINFO(RETURN,CLINICIEN) ;GET SYSTEM INFO NEED TO CALL MAKE VIDEO VISIT SERVICE (VVS) CALL
N FACILITYSITECODE,FACILITYNAME,SYSTEMTIMEZONEI,SDDIV,CLINICSITECODE,DFTINSTITUTION,OFFSET,TIMEZONEEXECPT
N OFFSETDST,SYSTEMTIMEZONEE,TIMEFRAMEIEN,TIMEFRAMEARY,POP,X,EXECPTFLG
S POP=0,(OFFSET,OFFSETDST,EXECPTFLG)=""
;Removed, want site from clinic not user S FACILITYSITECODE=DUZ(2)
S SDDIV=$$GET1^DIQ(44,CLINICIEN_",",3.5,"I")
S CLINICSITECODE=$$GET1^DIQ(40.8,SDDIV_",",.07,"I")
S SYSTEMTIMEZONEE=$$GET1^DIQ(4,CLINICSITECODE,800,"E")
S SYSTEMTIMEZONEI=$$GET1^DIQ(4,CLINICSITECODE,800,"I")
S EXECPTFLG=$$GET1^DIQ(4,CLINICSITECODE,802,"I")
S TIMEZONEEXECPT=$S(EXECPTFLG=0:1,1:0) ;there is a timezone exception if the value = 0
F X=1:1:3 D Q:POP
.S TIMEFRAMEIEN=X_","_SYSTEMTIMEZONEI_","
.D GETS^DIQ(1.711,TIMEFRAMEIEN,".01;.02","IE","TIMEFRAMEARY","SDMSG") ;Data from WORLD TIMEZONE file
.I '$D(TIMEFRAMEARY(1.711,TIMEFRAMEIEN,.01)) S POP=1 Q
.I $G(TIMEFRAMEARY(1.711,TIMEFRAMEIEN,.01,"I"))="SST" S OFFSET=$G(TIMEFRAMEARY(1.711,TIMEFRAMEIEN,.02,"E"))
.I $G(TIMEFRAMEARY(1.711,TIMEFRAMEIEN,.01,"I"))="DST" S OFFSETDST=$G(TIMEFRAMEARY(1.711,TIMEFRAMEIEN,.02,"E"))
S DFTINSTITUTION=$$GET1^DIQ(8989.3,1,217,"I")
S FACILITYNAME=$$GET1^DIQ(4,DFTINSTITUTION,.01)
S FACILITYSITECODE=$$DEFAULTSTATION^SDECDUZ()
S RETURN=FACILITYSITECODE_"^"_FACILITYNAME_"^"_SYSTEMTIMEZONEE_"^"_TIMEZONEEXECPT_"^"_OFFSET_"^"_OFFSETDST
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDES2VVSJSON 7906 printed Dec 13, 2024@02:54:57 Page 2
SDES2VVSJSON ;ALB/ANU - VISTA SCHEDULING RPC SDES2 GET INFO FOR VIDEO VISIT ; FEB 15,2024@11:25
+1 ;;5.3;Scheduling;**871**;Aug 13, 1993;Build 13
+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,$$GETS1^DIQ in ICR #2056
+7 QUIT
+8 ; INPUT
+9 ;
+10 ; SDCONTEXT("ACHERON AUDIT ID") = Up to 40 Character unique ID number. Ex: 11d9dcc6-c6a2-4785-8031-8261576fca37
+11 ; SDCONTEXT("USER DUZ") = The DUZ of the user taking action in the calling application.
+12 ; SDCONTEXT("USER SECID") = The SECID of the user taking action in the calling application.
+13 ; SDINPUT("PATIENT IEN") = The DFN/IEN of the target patient from the calling application.
+14 ; SDINPUT("CLINIC IEN") = The IEN of the target clinic from the calling application.
+15 ; SDINPUT("APPT DATE TIME") = Appointment Date and Time.
+16 ;
GETVVSMAKEINFO(JSON,SDCONTEXT,SDINPUT) ;Get info to make a Video Visit Web Service (VVS) call
+1 NEW ERRORS,SDRETURN,PARAMETERS,FDA,SDCHECKIN,IEN,ENTRY,SDUSER
+2 ;
+3 ; Validate SDCONTEXT
+4 ;
+5 DO VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
+6 IF $DATA(ERRORS)
SET ERRORS("VVSMakeInfo",1)=""
DO BUILDJSON^SDES2JSON(.JSON,.ERRORS)
QUIT
+7 ; Validate PARAMS
+8 SET PARAMETERS=$$VALPARAMS(.SDINPUT,.ERRORS)
+9 IF $DATA(ERRORS)
SET ERRORS("VVSMakeInfo",1)=""
DO BUILDJSON^SDES2JSON(.JSON,.ERRORS)
QUIT
+10 ;
+11 SET SDUSER=$SELECT(+$GET(SDCONTEXT("USER DUZ")):+SDCONTEXT("USER DUZ"),1:$GET(DUZ))
+12 SET PATIENTIEN=$PIECE(PARAMETERS,"^")
+13 SET CLINICIEN=$PIECE(PARAMETERS,"^",2)
+14 SET APPTDTTM=$PIECE(PARAMETERS,"^",3)
+15 DO GETVVSMAKE(.SDRETURN,PATIENTIEN,CLINICIEN,APPTDTTM)
+16 IF '$DATA(SDRETURN)
SET SDRETURN("VVSMakeInfo",1)=""
+17 DO BUILDJSON^SDES2JSON(.JSON,.SDRETURN)
+18 QUIT
+19 ;
VALPARAMS(PARAMS,SDERRORS) ; Validate
+1 NEW STATUS,PATIENTIEN,CLINICIEN,APPTDTTM,SDVALID
+2 ;
+3 ; Validate Patient IEN
+4 SET PATIENTIEN=$GET(PARAMS("PATIENT IEN"))
+5 DO VALFILEIEN^SDES2VALUTIL(.SDVALID,.SDERRORS,2,$GET(PATIENTIEN),1,,66,2)
+6 IF $GET(SDVALID)'=1
QUIT 0
+7 ; Validate Clinic IEN
+8 SET CLINICIEN=$GET(PARAMS("CLINIC IEN"))
+9 DO VALFILEIEN^SDES2VALUTIL(.SDVALID,.SDERRORS,44,$GET(CLINICIEN),1,,67,19)
+10 IF $GET(SDVALID)'=1
QUIT 0
+11 ; Validate Appointment date and time
+12 SET APPTDTTM=$GET(PARAMS("APPT DATE TIME"))
+13 SET APPTDTTM=$$VALISODTTM^SDES2VALISODTTM(.SDERRORS,$GET(APPTDTTM),$GET(CLINICIEN),1,76,77)
+14 ;
+15 if $DATA(SDERRORS)
QUIT 0
+16 QUIT PATIENTIEN_"^"_CLINICIEN_"^"_APPTDTTM
+17 ;
GETVVSMAKE(SDRETURN,PATIENTIEN,CLINICIEN,APPTDTTM) ;GET INFO TO MAKE A VIDEO VISIT WEB SERVICE (VVS) CALL
+1 ;INPUT:
+2 ; PATIENTIEN (Patient IEN)
+3 ; CLINICIEN (Clinic IEN)
+4 ; APPTDTTM - Appointment date and time external format
+5 ;
+6 ;RETURN PARMETER:
+7 ; Field List:
+8 ; (1) Patient Info
+9 ; (2) Default Provider Info
+10 ; (3) System Info
+11 ;
+12 NEW ERRPOP,ERR,ERRMSG,SDESI,VVSPATIENT,VVSPROVIDER,PROVIDERINFO,VVSSYSTEMINFO,PATINFO
+13 SET SDESI=0
+14 SET SDESI=$GET(SDESI,0)
SET ERR=""
+15 SET (VVSPATIENT,VVSPROVIDER,PROVIDERINFO,VVSSYSTEMINFO)=""
+16 SET ERRPOP=0
SET SDESI=0
SET ERRMSG=""
+17 ; Build VVS info
+18 SET SDRETURN("VVSMakeInfo","Appointment","ApptDtTm")=$$FMTISO^SDAMUTDT(APPTDTTM,CLINICIEN)
+19 SET VVSPATIENT=""
+20 DO GETVVSPATIENT(.VVSPATIENT,PATIENTIEN)
+21 IF VVSPATIENT'=""
Begin DoDot:1
+22 SET SDESI=1
+23 SET SDRETURN("VVSMakeInfo","Patient","IEN")=$PIECE(VVSPATIENT,"^",1)
+24 SET SDRETURN("VVSMakeInfo","Patient","DateOfBirth")=$PIECE(VVSPATIENT,"^",2)
+25 SET SDRETURN("VVSMakeInfo","Patient","FirstName")=$PIECE(VVSPATIENT,"^",3)
+26 SET SDRETURN("VVSMakeInfo","Patient","LastName")=$PIECE(VVSPATIENT,"^",4)
+27 SET SDRETURN("VVSMakeInfo","Patient","SSN")=$PIECE(VVSPATIENT,"^",5)
+28 SET SDRETURN("VVSMakeInfo","Patient","Email")=$PIECE(VVSPATIENT,"^",6)
+29 SET SDRETURN("VVSMakeInfo","Patient","HomePhone")=$PIECE(VVSPATIENT,"^",7)
+30 SET SDRETURN("VVSMakeInfo","Patient","CellPhone")=$PIECE(VVSPATIENT,"^",8)
+31 SET SDRETURN("VVSMakeInfo","Patient","ICN")=$PIECE(VVSPATIENT,"^",9)
+32 SET SDRETURN("VVSMakeInfo","Patient","ZipCode")=$PIECE(VVSPATIENT,"^",10)
End DoDot:1
+33 DO GETDPROIEN(.PROVIDERIEN,CLINICIEN)
+34 DO GETPROINFO(.PROVIDERINFO,PROVIDERIEN)
+35 IF PROVIDERINFO'=""
Begin DoDot:1
+36 SET SDESI=1
+37 SET SDRETURN("VVSMakeInfo","Provider","IEN")=$PIECE(PROVIDERINFO,"^",1)
+38 SET SDRETURN("VVSMakeInfo","Provider","Name")=$PIECE(PROVIDERINFO,"^",2)
+39 SET SDRETURN("VVSMakeInfo","Provider","Email")=$PIECE(PROVIDERINFO,"^",3)
+40 SET SDRETURN("VVSMakeInfo","Provider","Cell")=$PIECE(PROVIDERINFO,"^",4)
End DoDot:1
+41 DO GETSYSTEMINFO(.VVSSYSTEMINFO,CLINICIEN)
+42 IF VVSSYSTEMINFO'=""
Begin DoDot:1
+43 SET SDESI=1
+44 SET SDRETURN("VVSMakeInfo","SystemInfo","StationID")=$PIECE(VVSSYSTEMINFO,"^",1)
+45 SET SDRETURN("VVSMakeInfo","SystemInfo","FacilityName")=$PIECE(VVSSYSTEMINFO,"^",2)
+46 SET SDRETURN("VVSMakeInfo","SystemInfo","TimeZone")=$PIECE(VVSSYSTEMINFO,"^",3)
+47 SET SDRETURN("VVSMakeInfo","SystemInfo","TimeZoneException")=$PIECE(VVSSYSTEMINFO,"^",4)
+48 SET SDRETURN("VVSMakeInfo","SystemInfo","Offset")=$PIECE(VVSSYSTEMINFO,"^",5)
+49 SET SDRETURN("VVSMakeInfo","SystemInfo","OffsetDST")=$PIECE(VVSSYSTEMINFO,"^",6)
End DoDot:1
+50 QUIT
+51 ;
GETVVSPATIENT(RETURN,PATIENTIEN) ;GET VIDEO VISIT SERVICE (VVS) PATIENT
+1 if PATIENTIEN=""
QUIT
+2 NEW NAME,LASTNAME,FIRSTNAME,DOB,SSN,EMAIL,HOMEPHONE,CELLPHONE,ICN,ZIPCODE
+3 SET NAME=$$GET1^DIQ(2,PATIENTIEN,.01)
+4 SET LASTNAME=$PIECE(NAME,",",1)
+5 SET FIRSTNAME=$PIECE($PIECE(NAME,",",2)," ",1)
+6 SET DOB=$$GET1^DIQ(2,PATIENTIEN,.03)
+7 ;SSN
SET SSN=$$LAST4SSN^SDESINPUTVALUTL(PATIENTIEN)
+8 SET EMAIL=$$GET1^DIQ(2,PATIENTIEN,.133)
+9 SET HOMEPHONE=$$GET1^DIQ(2,PATIENTIEN,.131)
+10 SET CELLPHONE=$$GET1^DIQ(2,PATIENTIEN,.134)
+11 SET ICN=$$GETICN^MPIF001(PATIENTIEN)
+12 SET ZIPCODE=$$GET1^DIQ(2,PATIENTIEN,.116)
+13 SET RETURN=PATIENTIEN_"^"_DOB_"^"_FIRSTNAME_"^"_LASTNAME_"^"_SSN_"^"_EMAIL_"^"_HOMEPHONE_"^"_CELLPHONE_"^"_ICN_"^"_ZIPCODE
+14 QUIT
+15 ;
GETDPROIEN(RETURN,CLINICIEN) ;GET THE IEN FOR THE DEFAULT PROVIDER ASSIGNED TO A CLINIC
+1 if CLINICIEN=""
QUIT
+2 NEW SDFIELDS,PROVREC
+3 SET (PROVIDERIEN,PROVREC)=""
SET SDFIELDS="2600*"
+4 KILL SDDATA,SDMSG
+5 DO GETS^DIQ(44,CLINICIEN_",",SDFIELDS,"IE","SDDATA","SDMSG")
+6 FOR
SET PROVREC=$ORDER(SDDATA(44.1,PROVREC))
if PROVREC=""
QUIT
Begin DoDot:1
+7 IF $GET(SDDATA(44.1,PROVREC,.02,"E"))="YES"
SET PROVIDERIEN=$GET(SDDATA(44.1,PROVREC,.01,"I"))
End DoDot:1
if $GET(PROVIDERIEN)
QUIT
+8 SET RETURN=PROVIDERIEN
+9 QUIT
+10 ;
GETPROINFO(RETURN,PROVIDERIEN) ;GET PROVIDER INFO REQUIRED TO MAKE VIDEO VISIT SERVICE (VVS) CALL
+1 if PROVIDERIEN=""
QUIT
+2 NEW NAME,EMAIL,CELL,TITLE,PROVCLASS
+3 SET NAME=$$GET1^DIQ(200,PROVIDERIEN,.01)
+4 SET EMAIL=$$GET1^DIQ(200,PROVIDERIEN,.151)
+5 SET CELL=$$GET1^DIQ(200,PROVIDERIEN,.133)
+6 SET TITLE=$$GET1^DIQ(200,PROVIDERIEN,8,"E")
+7 SET PROVCLASS=$$GET1^DIQ(200,PROVIDERIEN,53.5,"E")
+8 SET RETURN=PROVIDERIEN_"^"_NAME_"^"_EMAIL_"^"_CELL_"^"_TITLE_"^"_PROVCLASS
+9 SET ^TMP(DUZ,"SDECPROIEN")=PROVIDERIEN
+10 QUIT
+11 ;
GETSYSTEMINFO(RETURN,CLINICIEN) ;GET SYSTEM INFO NEED TO CALL MAKE VIDEO VISIT SERVICE (VVS) CALL
+1 NEW FACILITYSITECODE,FACILITYNAME,SYSTEMTIMEZONEI,SDDIV,CLINICSITECODE,DFTINSTITUTION,OFFSET,TIMEZONEEXECPT
+2 NEW OFFSETDST,SYSTEMTIMEZONEE,TIMEFRAMEIEN,TIMEFRAMEARY,POP,X,EXECPTFLG
+3 SET POP=0
SET (OFFSET,OFFSETDST,EXECPTFLG)=""
+4 ;Removed, want site from clinic not user S FACILITYSITECODE=DUZ(2)
+5 SET SDDIV=$$GET1^DIQ(44,CLINICIEN_",",3.5,"I")
+6 SET CLINICSITECODE=$$GET1^DIQ(40.8,SDDIV_",",.07,"I")
+7 SET SYSTEMTIMEZONEE=$$GET1^DIQ(4,CLINICSITECODE,800,"E")
+8 SET SYSTEMTIMEZONEI=$$GET1^DIQ(4,CLINICSITECODE,800,"I")
+9 SET EXECPTFLG=$$GET1^DIQ(4,CLINICSITECODE,802,"I")
+10 ;there is a timezone exception if the value = 0
SET TIMEZONEEXECPT=$SELECT(EXECPTFLG=0:1,1:0)
+11 FOR X=1:1:3
Begin DoDot:1
+12 SET TIMEFRAMEIEN=X_","_SYSTEMTIMEZONEI_","
+13 ;Data from WORLD TIMEZONE file
DO GETS^DIQ(1.711,TIMEFRAMEIEN,".01;.02","IE","TIMEFRAMEARY","SDMSG")
+14 IF '$DATA(TIMEFRAMEARY(1.711,TIMEFRAMEIEN,.01))
SET POP=1
QUIT
+15 IF $GET(TIMEFRAMEARY(1.711,TIMEFRAMEIEN,.01,"I"))="SST"
SET OFFSET=$GET(TIMEFRAMEARY(1.711,TIMEFRAMEIEN,.02,"E"))
+16 IF $GET(TIMEFRAMEARY(1.711,TIMEFRAMEIEN,.01,"I"))="DST"
SET OFFSETDST=$GET(TIMEFRAMEARY(1.711,TIMEFRAMEIEN,.02,"E"))
End DoDot:1
if POP
QUIT
+17 SET DFTINSTITUTION=$$GET1^DIQ(8989.3,1,217,"I")
+18 SET FACILITYNAME=$$GET1^DIQ(4,DFTINSTITUTION,.01)
+19 SET FACILITYSITECODE=$$DEFAULTSTATION^SDECDUZ()
+20 SET RETURN=FACILITYSITECODE_"^"_FACILITYNAME_"^"_SYSTEMTIMEZONEE_"^"_TIMEZONEEXECPT_"^"_OFFSET_"^"_OFFSETDST
+21 QUIT
+22 ;