Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDES2SPACEBAR

SDES2SPACEBAR.m

Go to the documentation of this file.
SDES2SPACEBAR ;ALB/ANU - VISTA SCHEDULING RPC SDES2 GET VIDEO VISIT PROV ;JAN 22, 2024@17:00
 ;;5.3;Scheduling;**871**;;Build 13
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 ; Reference to ^XTV(8989.3.1,XUS in ICR #1518
 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.
 ; SDCONTEXT("PATIENT DFN") = The DFN/IEN of the target patient from the calling application.
 ; SDCONTEXT("PATIENT ICN") = The ICN of the target patient from the calling application.
 ;
GETSPACEBARPRO(JSON,SDCONTEXT,SDINPUT) ;return Video Visit Provider
 N ERRORS,SDRETURN,PARAMETERS,FDA,SDCHECKIN,IEN,ENTRY,SDUSER
 ;
 ; Validate SDCONTEXT
 ;
 D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
 I $D(ERRORS) S ERRORS("VVSProvider",1)="" D BUILDJSON^SDES2JSON(.JSON,.ERRORS) Q
 ;
 S SDUSER=$S(+$G(SDCONTEXT("USER DUZ")):+SDCONTEXT("USER DUZ"),1:$G(DUZ))
 D GETSPACEBAR(.SDRETURN,SDUSER)
 I '$D(SDRETURN) S SDRETURN("VVSProvider",1)=""
 D BUILDJSON^SDES2JSON(.JSON,.SDRETURN)
 Q
 ;
GETSPACEBAR(SDRETURN,SDUSER) ;return Video Visit Provider
 N RETURN,ERRORS,HASFIELDS,RETURN,ELGFIELDSARRARY
 N PROVIDERIEN,VVSPRORETURN
 I $D(^DISV(SDUSER,"^VA(200,")) D
 .S PROVIDERIEN=^DISV(SDUSER,"^VA(200,")
 .D GETPROINFO(.VVSPRORETURN,PROVIDERIEN,SDUSER)
 I '$D(^DISV(SDUSER,"^VA(200,")),$D(^TMP(SDUSER,"SDECPROIEN")) D
 .S PROVIDERIEN=^TMP(SDUSER,"SDECPROIEN")
 .D GETPROINFO(.VVSPRORETURN,PROVIDERIEN,SDUSER)
 S VVSPRORETURN=$G(VVSPRORETURN)
 I VVSPRORETURN'="" D
 .S SDRETURN("VVSProvider","ProviderIEN")=$P(VVSPRORETURN,"^",1)
 .S SDRETURN("VVSProvider","ProviderName")=$P(VVSPRORETURN,"^",2)
 .S SDRETURN("VVSProvider","ProviderEmail")=$P(VVSPRORETURN,"^",3)
 .S SDRETURN("VVSProvider","ProviderCell")=$P(VVSPRORETURN,"^",4)
 .S SDRETURN("VVSProvider","ProviderTitle")=$P(VVSPRORETURN,"^",5)
 .S SDRETURN("VVSProvider","ProviderClass")=$P(VVSPRORETURN,"^",6)
 Q
 ;
GETPROINFO(RETURN,PROVIDERIEN,SDUSER) ;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(SDUSER,"SDECPROIEN")=PROVIDERIEN
 Q
 ;