BSTSWSV ;GDIT/HS/BEE-Standard Terminology Web Service Handling ; 5 Nov 2012 9:53 AM
;;2.0;IHS STANDARD TERMINOLOGY;;Dec 01, 2016;Build 62
;
Q
;
SEARCH(OUT,IN,DEBUG) ;EP - Perform a Web Service Search
;
;Input
;OUT-Output variable/global to ret data in (VAR)
;IN Array-List of search parms
;DEBUG-1:DEBUG mode
;
;Output
;Function returns - [1]^[2]^[3]
;[1]-1:Successful remote call
; 0:Unsuccessful remote call
;[2]-Primary Remote Error Message
;[3]-Secondary Remote Error Message (if applicable)
;
;VAR(#)-[1]^[2]^[3]
;[1]-Concept ID
;[2]-DTS ID
;[3]-Description ID
;
N BSTSSRV,PRI,STS,II
;
;Define DEBUG
S DEBUG=$G(DEBUG,"")
;
;Get server list
S STS=$$WSERVER(.BSTSSRV,DEBUG)
;
;Loop through list and make each call
I $D(BSTSSRV)<10 S STS="0^No Active Server Found"
I $D(BSTSSRV)>1 S STS=0,PRI="" F II=2:1 S PRI=$O(BSTSSRV(PRI)) Q:PRI="" D Q:+STS
. ;
. N BSTSWS,TYPE,TIME,CSTS
. M BSTSWS=IN
. M BSTSWS=BSTSSRV(PRI)
. S TYPE=$G(BSTSWS("TYPE")),CSTS=""
. ;
. ;Check if DTS server is set to local
. S STS=$$CKDTS^BSTSWSV1(.BSTSWS) I '+STS Q
. ;
. ;Call DTS
. S CSTS=$$SEARCH^BSTSDTS2(OUT,.BSTSWS)
. I $G(BSTSWS("DEBUG")) W !!,"DTS: ",CSTS,!
. ;
. ;Log call times
. S TIME=$P(CSTS,U,3)
. ;
. ;Define status var
. S $P(STS,U)=+CSTS
. I II<4 S $P(STS,U,II)=$P(CSTS,U,2)
;
Q STS
;
CNCSR(OUT,IN,DEBUG) ;EP - Perform Web Service Concept Id Search
;
;Input
;OUT-Output variable/global to return information in (VAR)
;IN Array-List of search parameters
;DEBUG-1:DEBUG mode
;
;Output
;Function returns - [1]^[2]^[3]
;[1]-1:Successful remote call
; 0:Unsuccessful remote call
;[2]-Primary Remote Error Message
;[3]-Secondary Remote Error Message (if applicable)
;
;VAR(#)-[1]^[2]^[3]
;[1]-Concept ID
;[2]-DTS ID
;[3]-Description ID
;
N BSTSSRV,PRI,STS,II
;
;Define DEBUG
S DEBUG=$G(DEBUG,"")
;
;Get list of servers
S STS=$$WSERVER(.BSTSSRV,DEBUG)
;
;Loop through list and make each call
I $D(BSTSSRV)<10 S STS="0^No Active Server Found"
I $D(BSTSSRV)>1 S STS=0,PRI="" F II=2:1 S PRI=$O(BSTSSRV(PRI)) Q:PRI="" D Q:+STS
. ;
. N BSTSWS,TYPE,TIME,CSTS
. M BSTSWS=IN
. M BSTSWS=BSTSSRV(PRI)
. S TYPE=$G(BSTSWS("TYPE")),CSTS=""
. ;
. ;Check if DTS server is set to local
. S STS=$$CKDTS^BSTSWSV1(.BSTSWS) I '+STS Q
. ;
. ;Call DTS
. I TYPE="D" S CSTS=$$CNCSR^BSTSDTS0(OUT,.BSTSWS)
. I $G(BSTSWS("DEBUG")) W !!,"DTS: ",CSTS,!
. ;
. ;Log call times
. S TIME=$P(CSTS,U,3)
. ;
. ;Define status var
. S $P(STS,U)=+CSTS
. I II<4 S $P(STS,U,II)=$P(CSTS,U,2)
;
Q STS
;
ICD2SMD(OUT,IN,DEBUG) ;EP - Perform Web Service ICD9 to SNOMED mapping retrieval
;
;Input
;OUT-Output variable/global to return information in (VAR)
;IN Array-List of search parameters
;DEBUG - 1:DEBUG mode
;
;Output
;Function returns-[1]^[2]^[3]
;[1]-1:Successful remote call
; 0:Unsuccessful remote call
;[2]-Primary Remote Error Message
;[3]-Secondary Remote Error Message (if applicable)
;
;VAR(#)-[1]^[2]^[3]
;[1]-Concept ID
;[2]-DTS ID
;[3]-Description ID
;
N BSTSSRV,PRI,STS,II
;
;Define DEBUG
S DEBUG=$G(DEBUG,"")
;
;Get server list
S STS=$$WSERVER(.BSTSSRV,DEBUG)
;
;Loop through list and make each call
I $D(BSTSSRV)<10 S STS="0^No Active Server Found"
I $D(BSTSSRV)>1 S STS=0,PRI="" F II=2:1 S PRI=$O(BSTSSRV(PRI)) Q:PRI="" D Q:+STS
. ;
. N BSTSWS,TYPE,TIME,CSTS
. M BSTSWS=IN
. M BSTSWS=BSTSSRV(PRI)
. S TYPE=$G(BSTSWS("TYPE")),CSTS=""
. ;
. ;Check if DTS server is set to local
. S STS=$$CKDTS^BSTSWSV1(.BSTSWS) I '+STS Q
. ;
. ;Call DTS
. I TYPE="D" S CSTS=$$ICD2SMD^BSTSDTS2(OUT,.BSTSWS)
. I $G(BSTSWS("DEBUG")) W !!,"DTS: ",CSTS,!
. ;
. ;Log call times
. S TIME=$P(CSTS,U,3)
. ;
. ;Define status var
. S $P(STS,U)=+CSTS
. I II<4 S $P(STS,U,II)=$P(CSTS,U,2)
;
Q STS
;
DSCLKP(OUT,IN,DEBUG) ;EP - Perform a Web Service Description Id Search
;
;Input
;OUT-Output variable/global to return information in (VAR)
;IN Array-List of search parameters
;DEBUG-1:DEBUG mode
;
;Output
;Function returns - [1]^[2]^[3]
;[1]-1:Successful remote call
; 0:Unsuccessful remote call
;[2]-Primary Remote Error Message
;[3]-Secondary Remote Error Message (if applicable)
;
;VAR(#)-[1]^[2]^[3]
;[1]-Concept ID
;[2]-DTS ID
;[3]-Description ID
;
N BSTSSRV,PRI,STS,II
;
;Define DEBUG
S DEBUG=$G(DEBUG,"")
;
;Get server list
S STS=$$WSERVER(.BSTSSRV,DEBUG)
;
;Loop through list and make each call
I $D(BSTSSRV)<10 S STS="0^No Active Server Found"
I $D(BSTSSRV)>1 S STS=0,PRI="" F II=2:1 S PRI=$O(BSTSSRV(PRI)) Q:PRI="" D Q:+STS
. ;
. N BSTSWS,TYPE,TIME,CSTS
. M BSTSWS=IN
. M BSTSWS=BSTSSRV(PRI)
. S TYPE=$G(BSTSWS("TYPE")),CSTS=""
. ;
. ;Check if DTS server is set to local
. S STS=$$CKDTS^BSTSWSV1(.BSTSWS) I '+STS Q
. ;
. ;Call DTS
. I TYPE="D" S CSTS=$$DSCSRCH^BSTSDTS2(OUT,.BSTSWS)
. I $G(BSTSWS("DEBUG")) W !!,"DTS: ",CSTS,!
. ;
. ;Log call times
. S TIME=$P(CSTS,U,3)
. ;
. ;Define status var
. S $P(STS,U)=+CSTS
. I II<4 S $P(STS,U,II)=$P(CSTS,U,2)
;
Q STS
;
SUBLST(DLIST,IN,DEBUG) ;EP - Perform a Web Service Subset Listing
;
;Input
; OUT - Output variable/global to return information in (VAR)
; IN Array - List of search parameters
; DEBUG - 1:DEBUG mode
;
;Output
; Function returns - [1]^[2]^[3]
; [1] - 1:Successful remote call
; 0:Unsuccessful remote call
; [2] - Primary Remote Error Message
; [3] - Secondary Remote Error Message (if applicable)
;
; VAR(#) - [1]
; [1] - DTSId
;
N BSTSSRV,PRI,STS,II
;
;Define DEBUG
S DEBUG=$G(DEBUG,"")
;
;Get list of servers
S STS=$$WSERVER(.BSTSSRV,DEBUG)
;
;Loop through list and make each call
I $D(BSTSSRV)<10 S STS="0^No Active Server Found"
I $D(BSTSSRV)>1 S STS=0,PRI="" F II=2:1 S PRI=$O(BSTSSRV(PRI)) Q:PRI="" D Q:+STS
. ;
. N BSTSWS,TYPE,TIME,CSTS
. M BSTSWS=IN
. M BSTSWS=BSTSSRV(PRI)
. S TYPE=$G(BSTSWS("TYPE")),CSTS=""
. ;
. ;Check if DTS server is set to local
. S STS=$$CKDTS^BSTSWSV1(.BSTSWS) I '+STS Q
. ;
. ;Call DTS
. I TYPE="D" S CSTS=$$SUBLST^BSTSDTS2(DLIST,.BSTSWS)
. I $G(BSTSWS("DEBUG")) W !!,"DTS: ",CSTS,!
. ;
. ;Log call times (needs completed)
. S TIME=$P(CSTS,U,3)
. ;
. ;Define status variable
. S $P(STS,U)=+CSTS
. I II<4 S $P(STS,U,II)=$P(CSTS,U,2)
;
Q STS
;
DTSSR(OUT,IN,DEBUG) ;EP - Perform a Web Service DTS Id Lookup
;
;Input
; OUT - Output variable/global to return information in (VAR)
; IN Array - List of search parameters
; DEBUG - 1:DEBUG mode
;
;Output
; Function returns - [1]^[2]^[3]
; [1] - 1:Successful remote call
; 0:Unsuccessful remote call
; [2] - Primary Remote Error Message
; [3] - Secondary Remote Error Message (if applicable)
;
; VAR(#) - [1]^[2]^[3]
; [1] - Concept ID
; [2] - DTS ID
; [3] - Description ID
;
N BSTSSRV,PRI,STS,II
;
;Define DEBUG
S DEBUG=$G(DEBUG,"")
;
;Get list of servers
S STS=$$WSERVER(.BSTSSRV,DEBUG)
;
;Loop through list and make each call
I $D(BSTSSRV)<10 S STS="0^No Active Server Found"
I $D(BSTSSRV)>1 S STS=0,PRI="" F II=2:1 S PRI=$O(BSTSSRV(PRI)) Q:PRI="" D Q:+STS
. ;
. N BSTSWS,TYPE,TIME,CSTS
. M BSTSWS=IN
. M BSTSWS=BSTSSRV(PRI)
. S TYPE=$G(BSTSWS("TYPE")),CSTS=""
. ;
. ;Check if DTS server is set to local
. S STS=$$CKDTS^BSTSWSV1(.BSTSWS) I '+STS Q
. ;
. ;Call DTS
. I TYPE="D" S CSTS=$$DTSSR^BSTSDTS1(OUT,.BSTSWS)
. I $G(BSTSWS("DEBUG")) W !!,"DTS: ",CSTS,!
. ;
. ;Log call times (needs completed)
. S TIME=$P(CSTS,U,3)
. ;
. ;Define status variable
. S $P(STS,U)=+CSTS
. I II<4 S $P(STS,U,II)=$P(CSTS,U,2)
;
Q STS
;
GCDSET(DEBUG) ;EP - Poll server(s) for codeset information
;
;Input
; DEBUG - 1:DEBUG mode
;
;Output
; Function returns - [1]^[2]^[3]
; [1] - 1:Successful remote call
; 0:Unsuccessful remote call
; [2] - Primary Remote Error Message
; [3] - Secondary Remote Error Message (if applicable)
;
N BSTSSRV,PRI,STS,II
;
;Define DEBUG
S DEBUG=$G(DEBUG,"")
;
;Get list of servers
S STS=$$WSERVER(.BSTSSRV,DEBUG)
;
;Loop through list and make each call
S STS=0,PRI="" F II=2:1 S PRI=$O(BSTSSRV(PRI)) Q:PRI="" D Q:+STS
. ;
. N BSTSWS,TYPE,TIME,CSTS
. M BSTSWS=BSTSSRV(PRI)
. S TYPE=$G(BSTSWS("TYPE")),CSTS=""
. ;
. ;Check if DTS server is set to local
. S STS=$$CKDTS^BSTSWSV1(.BSTSWS) I '+STS Q
. ;
. ;Call DTS
. I TYPE="D" S CSTS=$$GCDSDTS4^BSTSDTS0(.BSTSWS)
. I $G(BSTSWS("DEBUG")) W !!,"DTS: ",CSTS,!
. ;
. ;Log call times (needs completed)
. S TIME=$P(CSTS,U,3)
. ;
. ;Define status variable
. S $P(STS,U)=+CSTS
. I II<4 S $P(STS,U,II)=$P(CSTS,U,2)
;
Q STS
;
GVRSET(NMID,DEBUG) ;EP - Poll server(s) for codeset information
;
;Input
; NMID - Namespace ID
; DEBUG - 1:DEBUG mode
;
;Output
; Function returns - [1]^[2]^[3]
; [1] - 1:Successful remote call
; 0:Unsuccessful remote call
; [2] - Primary Remote Error Message
; [3] - Secondary Remote Error Message (if applicable)
;
N BSTSSRV,PRI,STS,II
;
;Define DEBUG
S DEBUG=$G(DEBUG,"")
;
;Get list of servers
S STS=$$WSERVER(.BSTSSRV,DEBUG)
;
;Loop through list and make each call
S STS=0,PRI="" F II=2:1 S PRI=$O(BSTSSRV(PRI)) Q:PRI="" D Q:+STS
. ;
. N BSTSWS,TYPE,TIME,CSTS
. M BSTSWS=BSTSSRV(PRI)
. S TYPE=$G(BSTSWS("TYPE")),CSTS=""
. S BSTSWS("NAMESPACEID")=NMID
. ;
. ;Note - do not check for working DTS since this call is used by
. ;the underlying $$CKDTS^BSTSWSV1 call. This would cause an endless loop
. ;
. ;Call DTS
. I TYPE="D" S CSTS=$$GVRDTS4^BSTSDTS0(.BSTSWS)
. I $G(BSTSWS("DEBUG")) W !!,"DTS: ",CSTS,!
. ;
. ;Log call times (needs completed)
. S TIME=$P(CSTS,U,3)
. ;
. ;Define status variable
. S $P(STS,U)=+CSTS
. I II<4 S $P(STS,U,II)=$P(CSTS,U,2)
;
Q STS
;
SUBSET(OUT,NMID,DEBUG) ;EP - Poll server(s) for subset information
;
;Input
; NMID - Namespace ID
; DEBUG - 1:DEBUG mode
;
;Output
; Function returns - [1]^[2]^[3]
; [1] - 1:Successful remote call
; 0:Unsuccessful remote call
; [2] - Primary Remote Error Message
; [3] - Secondary Remote Error Message (if applicable)
;
N BSTSSRV,PRI,STS,II
;
;Define DEBUG
S DEBUG=$G(DEBUG,"")
;
;Get list of servers
S STS=$$WSERVER(.BSTSSRV,DEBUG)
;
;Loop through list and make each call
S STS=0,PRI="" F II=2:1 S PRI=$O(BSTSSRV(PRI)) Q:PRI="" D Q:+STS
. ;
. N BSTSWS,TYPE,TIME,CSTS
. M BSTSWS=BSTSSRV(PRI)
. S TYPE=$G(BSTSWS("TYPE")),CSTS=""
. S BSTSWS("NAMESPACEID")=NMID
. ;
. ;Check if DTS server is set to local
. S STS=$$CKDTS^BSTSWSV1(.BSTSWS) I '+STS Q
. ;
. ;Call DTS
. I TYPE="D" S CSTS=$$SUBSET^BSTSDTS2(OUT,.BSTSWS)
. I $G(BSTSWS("DEBUG")) W !!,"DTS: ",CSTS,!
. ;
. ;Log call times (needs completed)
. S TIME=$P(CSTS,U,3)
. ;
. ;Define status variable
. S $P(STS,U)=+CSTS
. I II<4 S $P(STS,U,II)=$P(CSTS,U,2)
;
Q STS
;
TEST(OUT,IN,DEBUG) ;EP - Perform a Test Web Service Search
;
;Input
; OUT - Output variable/global to return information in (VAR)
; IN Array - List of search parameters
; DEBUG - 1:DEBUG mode
;
;Output
; Function returns - [1]^[2]^[3]
; [1] - 1:Successful remote call
; 0:Unsuccessful remote call
; [2] - Primary Remote Error Message
; [3] - Secondary Remote Error Message (if applicable)
;
; VAR(#) - [1]^[2]^[3]
; [1] - Concept ID
; [2] - DTS ID
; [3] - Description ID
;
N BSTSSRV,PRI,STS,II,BSTSWS,TYPE,TIME,CSTS
;
;Define DEBUG
S DEBUG=$G(DEBUG,"")
;
M BSTSWS=IN
;
;Retrieve Web Service Information
S STS=$$GETWSV(BSTSWS("SERVICE"),.BSTSSRV,DEBUG)
;
;Make sure service was found
I $D(BSTSSRV)<10 S STS="0^No Active Server Found" Q 0
;
M BSTSWS=BSTSSRV(1)
S TYPE=$G(BSTSWS("TYPE")),CSTS=""
;
;Call DTS
I TYPE="D" S CSTS=$$TSRCH^BSTSDTS1(OUT,.BSTSWS)
;
Q CSTS
;
WSERVER(BSTSSRV,DEBUG) ;P - Retrieve array of Web Server Information
;
;Input
; DEBUG - 1:DEBUG mode
;
;Output
; Function - 0:No Data Returned, 1:Data Returned
; BSTSSRV - Array of web service connection information
;
;Quit if install is running
L +^TMP("BSTSINSTALL"):1 E Q 0
L -^TMP("BSTSINSTALL")
;
N NMIEN
;
;Loop through servers until successful call
S NMIEN=0 F S NMIEN=$O(^BSTS(9002318,NMIEN)) Q:'NMIEN D
. N PRI
. S PRI="" F S PRI=$O(^BSTS(9002318,NMIEN,1,"C",PRI)) Q:'PRI D
.. N IEN
.. S IEN="" F S IEN=$O(^BSTS(9002318,NMIEN,1,"C",PRI,IEN)) Q:'IEN D
... N WSIEN,STS,DA,IENS
... ;
... ;Pull Web Service IEN
... S DA(1)=NMIEN,DA=IEN,IENS=$$IENS^DILF(.DA)
... S WSIEN=$$GET1^DIQ(9002318.01,IENS,".01","I") Q:WSIEN=""
... ;
... ;Retrieve Web Service Information
... S STS=$$GETWSV(WSIEN,.BSTSSRV,DEBUG)
;
Q $S($O(BSTSSRV(""))]"":"1",1:"0")
;
GETWSV(WSIEN,BSTSSRV,DEBUG) ;EP - Retrieve Single Web Service Connection Info
;
;Input
; WSIEN - Pointer to 9002318.2
; DEBUG - 1:DEBUG mode
;
;Output
; Function - 0:No Data Returned, 1:Data Returned
; BSTSSRV - Array of web service connection information
;
N DA,IENS,URLRT,PORT,TYPE,TIME,USER,PASS,II,SPATH,IADT,SSL,CTIME,MSTM,RETRY,MFAIL,FWAIT
;
;Pull Server information
S IADT=$$GET1^DIQ(9002318.2,WSIEN_",",".1","I")
I IADT]"",IADT<DT Q 0
S URLRT=$$GET1^DIQ(9002318.2,WSIEN_",",".02","E")
S PORT=$$GET1^DIQ(9002318.2,WSIEN_",",".03","E")
S TYPE=$$GET1^DIQ(9002318.2,WSIEN_",",".04","I")
S TIME=$$GET1^DIQ(9002318.2,WSIEN_",",".05","I")
S USER=$$GET1^DIQ(9002318.2,WSIEN_",",".07","E")
S PASS=$$GET1^DIQ(9002318.2,WSIEN_",",".08","E")
S IADT=$$GET1^DIQ(9002318.2,WSIEN_",",".1","I")
S SPATH=$$GET1^DIQ(9002318.2,WSIEN_",",".11","E")
S SSL=$$GET1^DIQ(9002318.2,WSIEN_",","2.01","E")
S RETRY=$$GET1^DIQ(9002318.2,WSIEN_",","4.01","E") S:RETRY="" RETRY=1
S RETRY=RETRY+1
S CTIME=$$GET1^DIQ(9002318.2,WSIEN_",",".12","I") S:CTIME="" CTIME=2
S MSTM=$$GET1^DIQ(9002318.2,WSIEN_",",.15,"I") S:MSTM="" MSTM=60
S MFAIL=$$GET1^DIQ(9002318.2,WSIEN_",","4.02","E") S:MFAIL="" MFAIL=10
S FWAIT=$$GET1^DIQ(9002318.2,WSIEN_",","4.03","E") S:FWAIT="" FWAIT=7200
S II=$O(BSTSSRV(""),-1)+1
S BSTSSRV(II,"URLROOT")=URLRT
S BSTSSRV(II,"PORT")=PORT
S BSTSSRV(II,"TYPE")=TYPE
S BSTSSRV(II,"USER")=USER
S BSTSSRV(II,"PASS")=PASS
S BSTSSRV(II,"TIMEOUT")=TIME
S BSTSSRV(II,"DEBUG")=DEBUG
S BSTSSRV(II,"SERVICEPATH")=SPATH
S BSTSSRV(II,"SSL")=SSL
S BSTSSRV(II,"CTIME")=CTIME
S BSTSSRV(II,"IEN")=WSIEN
S BSTSSRV(II,"MSTM")=MSTM
S BSTSSRV(II,"RETRY")=RETRY
S BSTSSRV(II,"MFAIL")=MFAIL
S BSTSSRV(II,"FWAIT")=FWAIT
;
Q 1
BSTSWSV ;GDIT/HS/BEE-Standard Terminology Web Service Handling ; 5 Nov 2012 9:53 AM
+1 ;;2.0;IHS STANDARD TERMINOLOGY;;Dec 01, 2016;Build 62
+2 ;
+3 QUIT
+4 ;
SEARCH(OUT,IN,DEBUG) ;EP - Perform a Web Service Search
+1 ;
+2 ;Input
+3 ;OUT-Output variable/global to ret data in (VAR)
+4 ;IN Array-List of search parms
+5 ;DEBUG-1:DEBUG mode
+6 ;
+7 ;Output
+8 ;Function returns - [1]^[2]^[3]
+9 ;[1]-1:Successful remote call
+10 ; 0:Unsuccessful remote call
+11 ;[2]-Primary Remote Error Message
+12 ;[3]-Secondary Remote Error Message (if applicable)
+13 ;
+14 ;VAR(#)-[1]^[2]^[3]
+15 ;[1]-Concept ID
+16 ;[2]-DTS ID
+17 ;[3]-Description ID
+18 ;
+19 NEW BSTSSRV,PRI,STS,II
+20 ;
+21 ;Define DEBUG
+22 SET DEBUG=$GET(DEBUG,"")
+23 ;
+24 ;Get server list
+25 SET STS=$$WSERVER(.BSTSSRV,DEBUG)
+26 ;
+27 ;Loop through list and make each call
+28 IF $DATA(BSTSSRV)<10
SET STS="0^No Active Server Found"
+29 IF $DATA(BSTSSRV)>1
SET STS=0
SET PRI=""
FOR II=2:1
SET PRI=$ORDER(BSTSSRV(PRI))
IF PRI=""
QUIT
Begin DoDot:1
+30 ;
+31 NEW BSTSWS,TYPE,TIME,CSTS
+32 MERGE BSTSWS=IN
+33 MERGE BSTSWS=BSTSSRV(PRI)
+34 SET TYPE=$GET(BSTSWS("TYPE"))
SET CSTS=""
+35 ;
+36 ;Check if DTS server is set to local
+37 SET STS=$$CKDTS^BSTSWSV1(.BSTSWS)
IF '+STS
QUIT
+38 ;
+39 ;Call DTS
+40 SET CSTS=$$SEARCH^BSTSDTS2(OUT,.BSTSWS)
+41 IF $GET(BSTSWS("DEBUG"))
WRITE !!,"DTS: ",CSTS,!
+42 ;
+43 ;Log call times
+44 SET TIME=$PIECE(CSTS,U,3)
+45 ;
+46 ;Define status var
+47 SET $PIECE(STS,U)=+CSTS
+48 IF II<4
SET $PIECE(STS,U,II)=$PIECE(CSTS,U,2)
End DoDot:1
IF +STS
QUIT
+49 ;
+50 QUIT STS
+51 ;
CNCSR(OUT,IN,DEBUG) ;EP - Perform Web Service Concept Id Search
+1 ;
+2 ;Input
+3 ;OUT-Output variable/global to return information in (VAR)
+4 ;IN Array-List of search parameters
+5 ;DEBUG-1:DEBUG mode
+6 ;
+7 ;Output
+8 ;Function returns - [1]^[2]^[3]
+9 ;[1]-1:Successful remote call
+10 ; 0:Unsuccessful remote call
+11 ;[2]-Primary Remote Error Message
+12 ;[3]-Secondary Remote Error Message (if applicable)
+13 ;
+14 ;VAR(#)-[1]^[2]^[3]
+15 ;[1]-Concept ID
+16 ;[2]-DTS ID
+17 ;[3]-Description ID
+18 ;
+19 NEW BSTSSRV,PRI,STS,II
+20 ;
+21 ;Define DEBUG
+22 SET DEBUG=$GET(DEBUG,"")
+23 ;
+24 ;Get list of servers
+25 SET STS=$$WSERVER(.BSTSSRV,DEBUG)
+26 ;
+27 ;Loop through list and make each call
+28 IF $DATA(BSTSSRV)<10
SET STS="0^No Active Server Found"
+29 IF $DATA(BSTSSRV)>1
SET STS=0
SET PRI=""
FOR II=2:1
SET PRI=$ORDER(BSTSSRV(PRI))
IF PRI=""
QUIT
Begin DoDot:1
+30 ;
+31 NEW BSTSWS,TYPE,TIME,CSTS
+32 MERGE BSTSWS=IN
+33 MERGE BSTSWS=BSTSSRV(PRI)
+34 SET TYPE=$GET(BSTSWS("TYPE"))
SET CSTS=""
+35 ;
+36 ;Check if DTS server is set to local
+37 SET STS=$$CKDTS^BSTSWSV1(.BSTSWS)
IF '+STS
QUIT
+38 ;
+39 ;Call DTS
+40 IF TYPE="D"
SET CSTS=$$CNCSR^BSTSDTS0(OUT,.BSTSWS)
+41 IF $GET(BSTSWS("DEBUG"))
WRITE !!,"DTS: ",CSTS,!
+42 ;
+43 ;Log call times
+44 SET TIME=$PIECE(CSTS,U,3)
+45 ;
+46 ;Define status var
+47 SET $PIECE(STS,U)=+CSTS
+48 IF II<4
SET $PIECE(STS,U,II)=$PIECE(CSTS,U,2)
End DoDot:1
IF +STS
QUIT
+49 ;
+50 QUIT STS
+51 ;
ICD2SMD(OUT,IN,DEBUG) ;EP - Perform Web Service ICD9 to SNOMED mapping retrieval
+1 ;
+2 ;Input
+3 ;OUT-Output variable/global to return information in (VAR)
+4 ;IN Array-List of search parameters
+5 ;DEBUG - 1:DEBUG mode
+6 ;
+7 ;Output
+8 ;Function returns-[1]^[2]^[3]
+9 ;[1]-1:Successful remote call
+10 ; 0:Unsuccessful remote call
+11 ;[2]-Primary Remote Error Message
+12 ;[3]-Secondary Remote Error Message (if applicable)
+13 ;
+14 ;VAR(#)-[1]^[2]^[3]
+15 ;[1]-Concept ID
+16 ;[2]-DTS ID
+17 ;[3]-Description ID
+18 ;
+19 NEW BSTSSRV,PRI,STS,II
+20 ;
+21 ;Define DEBUG
+22 SET DEBUG=$GET(DEBUG,"")
+23 ;
+24 ;Get server list
+25 SET STS=$$WSERVER(.BSTSSRV,DEBUG)
+26 ;
+27 ;Loop through list and make each call
+28 IF $DATA(BSTSSRV)<10
SET STS="0^No Active Server Found"
+29 IF $DATA(BSTSSRV)>1
SET STS=0
SET PRI=""
FOR II=2:1
SET PRI=$ORDER(BSTSSRV(PRI))
IF PRI=""
QUIT
Begin DoDot:1
+30 ;
+31 NEW BSTSWS,TYPE,TIME,CSTS
+32 MERGE BSTSWS=IN
+33 MERGE BSTSWS=BSTSSRV(PRI)
+34 SET TYPE=$GET(BSTSWS("TYPE"))
SET CSTS=""
+35 ;
+36 ;Check if DTS server is set to local
+37 SET STS=$$CKDTS^BSTSWSV1(.BSTSWS)
IF '+STS
QUIT
+38 ;
+39 ;Call DTS
+40 IF TYPE="D"
SET CSTS=$$ICD2SMD^BSTSDTS2(OUT,.BSTSWS)
+41 IF $GET(BSTSWS("DEBUG"))
WRITE !!,"DTS: ",CSTS,!
+42 ;
+43 ;Log call times
+44 SET TIME=$PIECE(CSTS,U,3)
+45 ;
+46 ;Define status var
+47 SET $PIECE(STS,U)=+CSTS
+48 IF II<4
SET $PIECE(STS,U,II)=$PIECE(CSTS,U,2)
End DoDot:1
IF +STS
QUIT
+49 ;
+50 QUIT STS
+51 ;
DSCLKP(OUT,IN,DEBUG) ;EP - Perform a Web Service Description Id Search
+1 ;
+2 ;Input
+3 ;OUT-Output variable/global to return information in (VAR)
+4 ;IN Array-List of search parameters
+5 ;DEBUG-1:DEBUG mode
+6 ;
+7 ;Output
+8 ;Function returns - [1]^[2]^[3]
+9 ;[1]-1:Successful remote call
+10 ; 0:Unsuccessful remote call
+11 ;[2]-Primary Remote Error Message
+12 ;[3]-Secondary Remote Error Message (if applicable)
+13 ;
+14 ;VAR(#)-[1]^[2]^[3]
+15 ;[1]-Concept ID
+16 ;[2]-DTS ID
+17 ;[3]-Description ID
+18 ;
+19 NEW BSTSSRV,PRI,STS,II
+20 ;
+21 ;Define DEBUG
+22 SET DEBUG=$GET(DEBUG,"")
+23 ;
+24 ;Get server list
+25 SET STS=$$WSERVER(.BSTSSRV,DEBUG)
+26 ;
+27 ;Loop through list and make each call
+28 IF $DATA(BSTSSRV)<10
SET STS="0^No Active Server Found"
+29 IF $DATA(BSTSSRV)>1
SET STS=0
SET PRI=""
FOR II=2:1
SET PRI=$ORDER(BSTSSRV(PRI))
IF PRI=""
QUIT
Begin DoDot:1
+30 ;
+31 NEW BSTSWS,TYPE,TIME,CSTS
+32 MERGE BSTSWS=IN
+33 MERGE BSTSWS=BSTSSRV(PRI)
+34 SET TYPE=$GET(BSTSWS("TYPE"))
SET CSTS=""
+35 ;
+36 ;Check if DTS server is set to local
+37 SET STS=$$CKDTS^BSTSWSV1(.BSTSWS)
IF '+STS
QUIT
+38 ;
+39 ;Call DTS
+40 IF TYPE="D"
SET CSTS=$$DSCSRCH^BSTSDTS2(OUT,.BSTSWS)
+41 IF $GET(BSTSWS("DEBUG"))
WRITE !!,"DTS: ",CSTS,!
+42 ;
+43 ;Log call times
+44 SET TIME=$PIECE(CSTS,U,3)
+45 ;
+46 ;Define status var
+47 SET $PIECE(STS,U)=+CSTS
+48 IF II<4
SET $PIECE(STS,U,II)=$PIECE(CSTS,U,2)
End DoDot:1
IF +STS
QUIT
+49 ;
+50 QUIT STS
+51 ;
SUBLST(DLIST,IN,DEBUG) ;EP - Perform a Web Service Subset Listing
+1 ;
+2 ;Input
+3 ; OUT - Output variable/global to return information in (VAR)
+4 ; IN Array - List of search parameters
+5 ; DEBUG - 1:DEBUG mode
+6 ;
+7 ;Output
+8 ; Function returns - [1]^[2]^[3]
+9 ; [1] - 1:Successful remote call
+10 ; 0:Unsuccessful remote call
+11 ; [2] - Primary Remote Error Message
+12 ; [3] - Secondary Remote Error Message (if applicable)
+13 ;
+14 ; VAR(#) - [1]
+15 ; [1] - DTSId
+16 ;
+17 NEW BSTSSRV,PRI,STS,II
+18 ;
+19 ;Define DEBUG
+20 SET DEBUG=$GET(DEBUG,"")
+21 ;
+22 ;Get list of servers
+23 SET STS=$$WSERVER(.BSTSSRV,DEBUG)
+24 ;
+25 ;Loop through list and make each call
+26 IF $DATA(BSTSSRV)<10
SET STS="0^No Active Server Found"
+27 IF $DATA(BSTSSRV)>1
SET STS=0
SET PRI=""
FOR II=2:1
SET PRI=$ORDER(BSTSSRV(PRI))
IF PRI=""
QUIT
Begin DoDot:1
+28 ;
+29 NEW BSTSWS,TYPE,TIME,CSTS
+30 MERGE BSTSWS=IN
+31 MERGE BSTSWS=BSTSSRV(PRI)
+32 SET TYPE=$GET(BSTSWS("TYPE"))
SET CSTS=""
+33 ;
+34 ;Check if DTS server is set to local
+35 SET STS=$$CKDTS^BSTSWSV1(.BSTSWS)
IF '+STS
QUIT
+36 ;
+37 ;Call DTS
+38 IF TYPE="D"
SET CSTS=$$SUBLST^BSTSDTS2(DLIST,.BSTSWS)
+39 IF $GET(BSTSWS("DEBUG"))
WRITE !!,"DTS: ",CSTS,!
+40 ;
+41 ;Log call times (needs completed)
+42 SET TIME=$PIECE(CSTS,U,3)
+43 ;
+44 ;Define status variable
+45 SET $PIECE(STS,U)=+CSTS
+46 IF II<4
SET $PIECE(STS,U,II)=$PIECE(CSTS,U,2)
End DoDot:1
IF +STS
QUIT
+47 ;
+48 QUIT STS
+49 ;
DTSSR(OUT,IN,DEBUG) ;EP - Perform a Web Service DTS Id Lookup
+1 ;
+2 ;Input
+3 ; OUT - Output variable/global to return information in (VAR)
+4 ; IN Array - List of search parameters
+5 ; DEBUG - 1:DEBUG mode
+6 ;
+7 ;Output
+8 ; Function returns - [1]^[2]^[3]
+9 ; [1] - 1:Successful remote call
+10 ; 0:Unsuccessful remote call
+11 ; [2] - Primary Remote Error Message
+12 ; [3] - Secondary Remote Error Message (if applicable)
+13 ;
+14 ; VAR(#) - [1]^[2]^[3]
+15 ; [1] - Concept ID
+16 ; [2] - DTS ID
+17 ; [3] - Description ID
+18 ;
+19 NEW BSTSSRV,PRI,STS,II
+20 ;
+21 ;Define DEBUG
+22 SET DEBUG=$GET(DEBUG,"")
+23 ;
+24 ;Get list of servers
+25 SET STS=$$WSERVER(.BSTSSRV,DEBUG)
+26 ;
+27 ;Loop through list and make each call
+28 IF $DATA(BSTSSRV)<10
SET STS="0^No Active Server Found"
+29 IF $DATA(BSTSSRV)>1
SET STS=0
SET PRI=""
FOR II=2:1
SET PRI=$ORDER(BSTSSRV(PRI))
IF PRI=""
QUIT
Begin DoDot:1
+30 ;
+31 NEW BSTSWS,TYPE,TIME,CSTS
+32 MERGE BSTSWS=IN
+33 MERGE BSTSWS=BSTSSRV(PRI)
+34 SET TYPE=$GET(BSTSWS("TYPE"))
SET CSTS=""
+35 ;
+36 ;Check if DTS server is set to local
+37 SET STS=$$CKDTS^BSTSWSV1(.BSTSWS)
IF '+STS
QUIT
+38 ;
+39 ;Call DTS
+40 IF TYPE="D"
SET CSTS=$$DTSSR^BSTSDTS1(OUT,.BSTSWS)
+41 IF $GET(BSTSWS("DEBUG"))
WRITE !!,"DTS: ",CSTS,!
+42 ;
+43 ;Log call times (needs completed)
+44 SET TIME=$PIECE(CSTS,U,3)
+45 ;
+46 ;Define status variable
+47 SET $PIECE(STS,U)=+CSTS
+48 IF II<4
SET $PIECE(STS,U,II)=$PIECE(CSTS,U,2)
End DoDot:1
IF +STS
QUIT
+49 ;
+50 QUIT STS
+51 ;
GCDSET(DEBUG) ;EP - Poll server(s) for codeset information
+1 ;
+2 ;Input
+3 ; DEBUG - 1:DEBUG mode
+4 ;
+5 ;Output
+6 ; Function returns - [1]^[2]^[3]
+7 ; [1] - 1:Successful remote call
+8 ; 0:Unsuccessful remote call
+9 ; [2] - Primary Remote Error Message
+10 ; [3] - Secondary Remote Error Message (if applicable)
+11 ;
+12 NEW BSTSSRV,PRI,STS,II
+13 ;
+14 ;Define DEBUG
+15 SET DEBUG=$GET(DEBUG,"")
+16 ;
+17 ;Get list of servers
+18 SET STS=$$WSERVER(.BSTSSRV,DEBUG)
+19 ;
+20 ;Loop through list and make each call
+21 SET STS=0
SET PRI=""
FOR II=2:1
SET PRI=$ORDER(BSTSSRV(PRI))
IF PRI=""
QUIT
Begin DoDot:1
+22 ;
+23 NEW BSTSWS,TYPE,TIME,CSTS
+24 MERGE BSTSWS=BSTSSRV(PRI)
+25 SET TYPE=$GET(BSTSWS("TYPE"))
SET CSTS=""
+26 ;
+27 ;Check if DTS server is set to local
+28 SET STS=$$CKDTS^BSTSWSV1(.BSTSWS)
IF '+STS
QUIT
+29 ;
+30 ;Call DTS
+31 IF TYPE="D"
SET CSTS=$$GCDSDTS4^BSTSDTS0(.BSTSWS)
+32 IF $GET(BSTSWS("DEBUG"))
WRITE !!,"DTS: ",CSTS,!
+33 ;
+34 ;Log call times (needs completed)
+35 SET TIME=$PIECE(CSTS,U,3)
+36 ;
+37 ;Define status variable
+38 SET $PIECE(STS,U)=+CSTS
+39 IF II<4
SET $PIECE(STS,U,II)=$PIECE(CSTS,U,2)
End DoDot:1
IF +STS
QUIT
+40 ;
+41 QUIT STS
+42 ;
GVRSET(NMID,DEBUG) ;EP - Poll server(s) for codeset information
+1 ;
+2 ;Input
+3 ; NMID - Namespace ID
+4 ; DEBUG - 1:DEBUG mode
+5 ;
+6 ;Output
+7 ; Function returns - [1]^[2]^[3]
+8 ; [1] - 1:Successful remote call
+9 ; 0:Unsuccessful remote call
+10 ; [2] - Primary Remote Error Message
+11 ; [3] - Secondary Remote Error Message (if applicable)
+12 ;
+13 NEW BSTSSRV,PRI,STS,II
+14 ;
+15 ;Define DEBUG
+16 SET DEBUG=$GET(DEBUG,"")
+17 ;
+18 ;Get list of servers
+19 SET STS=$$WSERVER(.BSTSSRV,DEBUG)
+20 ;
+21 ;Loop through list and make each call
+22 SET STS=0
SET PRI=""
FOR II=2:1
SET PRI=$ORDER(BSTSSRV(PRI))
IF PRI=""
QUIT
Begin DoDot:1
+23 ;
+24 NEW BSTSWS,TYPE,TIME,CSTS
+25 MERGE BSTSWS=BSTSSRV(PRI)
+26 SET TYPE=$GET(BSTSWS("TYPE"))
SET CSTS=""
+27 SET BSTSWS("NAMESPACEID")=NMID
+28 ;
+29 ;Note - do not check for working DTS since this call is used by
+30 ;the underlying $$CKDTS^BSTSWSV1 call. This would cause an endless loop
+31 ;
+32 ;Call DTS
+33 IF TYPE="D"
SET CSTS=$$GVRDTS4^BSTSDTS0(.BSTSWS)
+34 IF $GET(BSTSWS("DEBUG"))
WRITE !!,"DTS: ",CSTS,!
+35 ;
+36 ;Log call times (needs completed)
+37 SET TIME=$PIECE(CSTS,U,3)
+38 ;
+39 ;Define status variable
+40 SET $PIECE(STS,U)=+CSTS
+41 IF II<4
SET $PIECE(STS,U,II)=$PIECE(CSTS,U,2)
End DoDot:1
IF +STS
QUIT
+42 ;
+43 QUIT STS
+44 ;
SUBSET(OUT,NMID,DEBUG) ;EP - Poll server(s) for subset information
+1 ;
+2 ;Input
+3 ; NMID - Namespace ID
+4 ; DEBUG - 1:DEBUG mode
+5 ;
+6 ;Output
+7 ; Function returns - [1]^[2]^[3]
+8 ; [1] - 1:Successful remote call
+9 ; 0:Unsuccessful remote call
+10 ; [2] - Primary Remote Error Message
+11 ; [3] - Secondary Remote Error Message (if applicable)
+12 ;
+13 NEW BSTSSRV,PRI,STS,II
+14 ;
+15 ;Define DEBUG
+16 SET DEBUG=$GET(DEBUG,"")
+17 ;
+18 ;Get list of servers
+19 SET STS=$$WSERVER(.BSTSSRV,DEBUG)
+20 ;
+21 ;Loop through list and make each call
+22 SET STS=0
SET PRI=""
FOR II=2:1
SET PRI=$ORDER(BSTSSRV(PRI))
IF PRI=""
QUIT
Begin DoDot:1
+23 ;
+24 NEW BSTSWS,TYPE,TIME,CSTS
+25 MERGE BSTSWS=BSTSSRV(PRI)
+26 SET TYPE=$GET(BSTSWS("TYPE"))
SET CSTS=""
+27 SET BSTSWS("NAMESPACEID")=NMID
+28 ;
+29 ;Check if DTS server is set to local
+30 SET STS=$$CKDTS^BSTSWSV1(.BSTSWS)
IF '+STS
QUIT
+31 ;
+32 ;Call DTS
+33 IF TYPE="D"
SET CSTS=$$SUBSET^BSTSDTS2(OUT,.BSTSWS)
+34 IF $GET(BSTSWS("DEBUG"))
WRITE !!,"DTS: ",CSTS,!
+35 ;
+36 ;Log call times (needs completed)
+37 SET TIME=$PIECE(CSTS,U,3)
+38 ;
+39 ;Define status variable
+40 SET $PIECE(STS,U)=+CSTS
+41 IF II<4
SET $PIECE(STS,U,II)=$PIECE(CSTS,U,2)
End DoDot:1
IF +STS
QUIT
+42 ;
+43 QUIT STS
+44 ;
TEST(OUT,IN,DEBUG) ;EP - Perform a Test Web Service Search
+1 ;
+2 ;Input
+3 ; OUT - Output variable/global to return information in (VAR)
+4 ; IN Array - List of search parameters
+5 ; DEBUG - 1:DEBUG mode
+6 ;
+7 ;Output
+8 ; Function returns - [1]^[2]^[3]
+9 ; [1] - 1:Successful remote call
+10 ; 0:Unsuccessful remote call
+11 ; [2] - Primary Remote Error Message
+12 ; [3] - Secondary Remote Error Message (if applicable)
+13 ;
+14 ; VAR(#) - [1]^[2]^[3]
+15 ; [1] - Concept ID
+16 ; [2] - DTS ID
+17 ; [3] - Description ID
+18 ;
+19 NEW BSTSSRV,PRI,STS,II,BSTSWS,TYPE,TIME,CSTS
+20 ;
+21 ;Define DEBUG
+22 SET DEBUG=$GET(DEBUG,"")
+23 ;
+24 MERGE BSTSWS=IN
+25 ;
+26 ;Retrieve Web Service Information
+27 SET STS=$$GETWSV(BSTSWS("SERVICE"),.BSTSSRV,DEBUG)
+28 ;
+29 ;Make sure service was found
+30 IF $DATA(BSTSSRV)<10
SET STS="0^No Active Server Found"
QUIT 0
+31 ;
+32 MERGE BSTSWS=BSTSSRV(1)
+33 SET TYPE=$GET(BSTSWS("TYPE"))
SET CSTS=""
+34 ;
+35 ;Call DTS
+36 IF TYPE="D"
SET CSTS=$$TSRCH^BSTSDTS1(OUT,.BSTSWS)
+37 ;
+38 QUIT CSTS
+39 ;
WSERVER(BSTSSRV,DEBUG) ;P - Retrieve array of Web Server Information
+1 ;
+2 ;Input
+3 ; DEBUG - 1:DEBUG mode
+4 ;
+5 ;Output
+6 ; Function - 0:No Data Returned, 1:Data Returned
+7 ; BSTSSRV - Array of web service connection information
+8 ;
+9 ;Quit if install is running
+10 LOCK +^TMP("BSTSINSTALL"):1
IF '$TEST
QUIT 0
+11 LOCK -^TMP("BSTSINSTALL")
+12 ;
+13 NEW NMIEN
+14 ;
+15 ;Loop through servers until successful call
+16 SET NMIEN=0
FOR
SET NMIEN=$ORDER(^BSTS(9002318,NMIEN))
IF 'NMIEN
QUIT
Begin DoDot:1
+17 NEW PRI
+18 SET PRI=""
FOR
SET PRI=$ORDER(^BSTS(9002318,NMIEN,1,"C",PRI))
IF 'PRI
QUIT
Begin DoDot:2
+19 NEW IEN
+20 SET IEN=""
FOR
SET IEN=$ORDER(^BSTS(9002318,NMIEN,1,"C",PRI,IEN))
IF 'IEN
QUIT
Begin DoDot:3
+21 NEW WSIEN,STS,DA,IENS
+22 ;
+23 ;Pull Web Service IEN
+24 SET DA(1)=NMIEN
SET DA=IEN
SET IENS=$$IENS^DILF(.DA)
+25 SET WSIEN=$$GET1^DIQ(9002318.01,IENS,".01","I")
IF WSIEN=""
QUIT
+26 ;
+27 ;Retrieve Web Service Information
+28 SET STS=$$GETWSV(WSIEN,.BSTSSRV,DEBUG)
End DoDot:3
End DoDot:2
End DoDot:1
+29 ;
+30 QUIT $SELECT($ORDER(BSTSSRV(""))]"":"1",1:"0")
+31 ;
GETWSV(WSIEN,BSTSSRV,DEBUG) ;EP - Retrieve Single Web Service Connection Info
+1 ;
+2 ;Input
+3 ; WSIEN - Pointer to 9002318.2
+4 ; DEBUG - 1:DEBUG mode
+5 ;
+6 ;Output
+7 ; Function - 0:No Data Returned, 1:Data Returned
+8 ; BSTSSRV - Array of web service connection information
+9 ;
+10 NEW DA,IENS,URLRT,PORT,TYPE,TIME,USER,PASS,II,SPATH,IADT,SSL,CTIME,MSTM,RETRY,MFAIL,FWAIT
+11 ;
+12 ;Pull Server information
+13 SET IADT=$$GET1^DIQ(9002318.2,WSIEN_",",".1","I")
+14 IF IADT]""
IF IADT<DT
QUIT 0
+15 SET URLRT=$$GET1^DIQ(9002318.2,WSIEN_",",".02","E")
+16 SET PORT=$$GET1^DIQ(9002318.2,WSIEN_",",".03","E")
+17 SET TYPE=$$GET1^DIQ(9002318.2,WSIEN_",",".04","I")
+18 SET TIME=$$GET1^DIQ(9002318.2,WSIEN_",",".05","I")
+19 SET USER=$$GET1^DIQ(9002318.2,WSIEN_",",".07","E")
+20 SET PASS=$$GET1^DIQ(9002318.2,WSIEN_",",".08","E")
+21 SET IADT=$$GET1^DIQ(9002318.2,WSIEN_",",".1","I")
+22 SET SPATH=$$GET1^DIQ(9002318.2,WSIEN_",",".11","E")
+23 SET SSL=$$GET1^DIQ(9002318.2,WSIEN_",","2.01","E")
+24 SET RETRY=$$GET1^DIQ(9002318.2,WSIEN_",","4.01","E")
IF RETRY=""
SET RETRY=1
+25 SET RETRY=RETRY+1
+26 SET CTIME=$$GET1^DIQ(9002318.2,WSIEN_",",".12","I")
IF CTIME=""
SET CTIME=2
+27 SET MSTM=$$GET1^DIQ(9002318.2,WSIEN_",",.15,"I")
IF MSTM=""
SET MSTM=60
+28 SET MFAIL=$$GET1^DIQ(9002318.2,WSIEN_",","4.02","E")
IF MFAIL=""
SET MFAIL=10
+29 SET FWAIT=$$GET1^DIQ(9002318.2,WSIEN_",","4.03","E")
IF FWAIT=""
SET FWAIT=7200
+30 SET II=$ORDER(BSTSSRV(""),-1)+1
+31 SET BSTSSRV(II,"URLROOT")=URLRT
+32 SET BSTSSRV(II,"PORT")=PORT
+33 SET BSTSSRV(II,"TYPE")=TYPE
+34 SET BSTSSRV(II,"USER")=USER
+35 SET BSTSSRV(II,"PASS")=PASS
+36 SET BSTSSRV(II,"TIMEOUT")=TIME
+37 SET BSTSSRV(II,"DEBUG")=DEBUG
+38 SET BSTSSRV(II,"SERVICEPATH")=SPATH
+39 SET BSTSSRV(II,"SSL")=SSL
+40 SET BSTSSRV(II,"CTIME")=CTIME
+41 SET BSTSSRV(II,"IEN")=WSIEN
+42 SET BSTSSRV(II,"MSTM")=MSTM
+43 SET BSTSSRV(II,"RETRY")=RETRY
+44 SET BSTSSRV(II,"MFAIL")=MFAIL
+45 SET BSTSSRV(II,"FWAIT")=FWAIT
+46 ;
+47 QUIT 1