ONCSED01 ;HINES OIFO/SG - EDITS 'RUN BATCH' REQUEST ; 11/6/06 11:48am
;;2.2;ONCOLOGY;**1,16**;Jul 31, 2013;Build 5
;
;P16 - hwsc encrytion function
;--- SOAP REQUST TO THE ONCOLOGY WEB SERVICE
;
; <?xml version="1.0" encoding="utf-8"?>
; <soap:Envelope
; xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
; soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
; <soap:Body>
; <ED-RUN-BATCH [edits-config="..."] ver="2.0"
; xmlns="http://vista.domain.ext/oncology">
; <NAACCR-RECORD> ... </NAACCR-RECORD>
; </ED-RUN-BATCH>
; </soap:Body >
; </soap:Envelope>
;
;--- ATTRIBUTES
;
; edits-config Name of the configuration that should be used by
; the server to validate the data. By default,
; the "DEFAULT" name is used.
;
Q
;
;***** EXECUTES THE 'RUN BATCH' EDITS REQUEST
;
; [.ONCSAPI] Reference to the API descriptor (see ^ONCSAPI)
;
; .ONC8REQ Reference to a local variable that stores the
; closed root of the request.
;
; Sub-nodes of the variable are used internally
; (see ^ONCSNACR and ^ONCSAPIR for details).
;
; [ONC8MSG] Closed root of the buffer for error messages. By
; default ($G(ONC8MSG)=""), the ^TMP("ONCSED01M",$J)
; global node is used.
;
; @ONC8MSG@(
; 0) Result descriptor
; ^01: Number of errors
; ^02: Number of warnings
; ^03: Web-service version
; ^04: Metafile version
; set#,
; 0) Edit set descriptor
; ^01: Number of errors
; ^02: Number of warnings
; 1) Edit set name
; "E",
; edit#,
; 0) Edit descriptor
; ^01: Number of errors
; ^02: Number of warnings
; ^03: Edit index
; 1) Edit name
; "F",
; fld#,
; 0) Field descriptor
; ^01: Start position
; 1) Field name
; 2) Field value
;
; "M",
; msg#,
; 0) Message descriptor
; ^01: Code
; ^02: Type
; 1) Message text
;
; "ES",
; edit#) set#
;
; The ^TMP("ONCSED01R",$J) and ^TMP("ONCSED01M",$J) global nodes
; are used by this function.
;
; Return values:
;
; <0 Error Descriptor (see ^ONCSAPI for details)
; For example:
; "-6^Parameter 'ONC8REQ' has an invalid value: ''^
; RBQEXEC+3^ONCSED01"
;
; 0 Ok
;
; 1 EDITS Warnings
;
; 2 EDITS Errors
;
RBQEXEC(ONCSAPI,ONC8REQ,ONC8MSG) ;
N ONC8RDAT,RC,TMP,URL,X
;--- Validate parameters
Q:$G(ONC8REQ)?." " $$ERROR^ONCSAPIE(-6,,"ONC8REQ",$G(ONC8REQ))
S:$G(ONC8MSG)?." " ONC8MSG=$NA(^TMP("ONCSED01M",$J))
;--- Initialize variables
S ONC8RDAT=$NA(^TMP("ONCSED01R",$J))
K @ONC8RDAT,@ONC8MSG
;
;--- Finish preparation of the NAACCR record
D END^ONCSNACR(.ONC8REQ)
;
;--- Complete the request
D TRAILER^ONCSAPIR(.ONC8REQ)
;
;--- Get the server URL ;commented url to use HWSC
S URL=$$GETCSURL^ONCSAPIU() Q:URL<0 URL
;
S RC=0 D
. ;--- Call the web service ; commented run batch request and use HWSC
. D:$G(ONCSAPI("DEBUG"))
. . D ZW^ONCSAPIU(ONC8REQ,"*** 'RUN BATCH' REQUEST ***")
. ;S RC=$$REQUEST^ONCSAPIR(URL,ONC8RDAT,ONC8REQ) Q:RC<0
. ; P16
. D T3^ONCWEB1
. D:$G(ONCSAPI("DEBUG"))
. . D ZW^ONCSAPIU(ONC8RDAT,"*** 'RUN BATCH' RESPONSE ***")
. ;--- Parse the response
. S RC=$$PARSE^ONCSED02(.ONCSAPI,ONC8RDAT,ONC8MSG)
;
;--- Cleanup
K ^TMP("ONCSED01R",$J)
D:RC'<0
. S TMP=$G(@ONC8MSG@(0))
. S RC=$S($P(TMP,U,1)>0:2,$P(TMP,U,2)>0:1,1:0)
Q RC
;
;***** STARTS PREPARATION OF THE 'RUN BATCH' EDITS REQUEST
;
; [.ONCSAPI] Reference to the API descriptor (see ^ONCSAPI)
;
; .ONC8REQ Reference to a local variable that stores the
; closed root of the buffer for the request.
;
; Sub-nodes of the variable are used internally
; (see ^ONCSNACR and ^ONCSAPIR for details).
;
; [CFGNAME] Name of the configuration that should be used by
; the server to validate the data. By default,
; the default configuration is used.
;
; Return values:
;
; <0 Error Descriptor (see ^ONCSAPI for details)
; For example:
; "-6^Parameter 'ONC8REQ' has an invalid value: ''^
; RBQPREP+3^ONCSED01"
;
; 0 Ok
;
RBQPREP(ONCSAPI,ONC8REQ,CFGNAME) ;
N ATTS
D CLEAR^ONCSAPIE()
;--- Validate parameters
Q:$G(ONC8REQ)?." " $$ERROR^ONCSAPIE(-6,,"ONC8REQ",$G(ONC8REQ))
;
;--- Standard request header
S:'($G(CFGNAME)?." ") ATTS("edits-config")=CFGNAME
D HEADER^ONCSAPIR(.ONC8REQ,"ED-RUN-BATCH",.ATTS)
;
;--- Start preparation of the NAACCR record
D BEGIN^ONCSNACR(.ONC8REQ)
;---
Q 0
;
;***** PRINTS 'EDITS' REPORT ON THE CURRENT DEVICE
;
; [.ONCSAPI] Reference to the API descriptor (see ^ONCSAPI)
;
; ONC8MSG Closed root of the list of parsed error messages
; (generated by the RBQEXEC^ONCSED0101)
;
; [FLAGS] Flags that control the output (can be combined):
; M Include messages
; T Include totals
;
; Return values:
;
; <0 Error Descriptor (see ^ONCSAPI for details)
; For example:
; "-6^Parameter 'ONC8REQ' has an invalid value: ''^
; RBQEXEC+3^ONCSED01"
;
; 0 Ok
;
; 1 Timeout
; 2 User canceled the output ('^' was entered)
;
REPORT(ONCSAPI,ONC8MSG,FLAGS) ;
N RC,TMP
S TMP=$G(@ONC8MSG@(0))
Q:($P(TMP,U,1)'>0)&($P(TMP,U,2)'>0) 0
S FLAGS=$G(FLAGS)
I $TR(FLAGS,"MT")'=FLAGS W:$E(IOST,1,2)="C-" @IOF
;--- EDITS messages
I FLAGS["M" D Q:RC RC
. S RC=$$MESSAGES^ONCSED03(.ONCSAPI,ONC8MSG,FLAGS)
;--- EDITS totals
I FLAGS["T" D Q:RC RC
. S RC=$$TOTALS^ONCSED03(.ONCSAPI,ONC8MSG,FLAGS)
;---
Q 0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCSED01 6397 printed Apr 09, 2024@21:31:01 Page 2
ONCSED01 ;HINES OIFO/SG - EDITS 'RUN BATCH' REQUEST ; 11/6/06 11:48am
+1 ;;2.2;ONCOLOGY;**1,16**;Jul 31, 2013;Build 5
+2 ;
+3 ;P16 - hwsc encrytion function
+4 ;--- SOAP REQUST TO THE ONCOLOGY WEB SERVICE
+5 ;
+6 ; <?xml version="1.0" encoding="utf-8"?>
+7 ; <soap:Envelope
+8 ; xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
+9 ; soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
+10 ; <soap:Body>
+11 ; <ED-RUN-BATCH [edits-config="..."] ver="2.0"
+12 ; xmlns="http://vista.domain.ext/oncology">
+13 ; <NAACCR-RECORD> ... </NAACCR-RECORD>
+14 ; </ED-RUN-BATCH>
+15 ; </soap:Body >
+16 ; </soap:Envelope>
+17 ;
+18 ;--- ATTRIBUTES
+19 ;
+20 ; edits-config Name of the configuration that should be used by
+21 ; the server to validate the data. By default,
+22 ; the "DEFAULT" name is used.
+23 ;
+24 QUIT
+25 ;
+26 ;***** EXECUTES THE 'RUN BATCH' EDITS REQUEST
+27 ;
+28 ; [.ONCSAPI] Reference to the API descriptor (see ^ONCSAPI)
+29 ;
+30 ; .ONC8REQ Reference to a local variable that stores the
+31 ; closed root of the request.
+32 ;
+33 ; Sub-nodes of the variable are used internally
+34 ; (see ^ONCSNACR and ^ONCSAPIR for details).
+35 ;
+36 ; [ONC8MSG] Closed root of the buffer for error messages. By
+37 ; default ($G(ONC8MSG)=""), the ^TMP("ONCSED01M",$J)
+38 ; global node is used.
+39 ;
+40 ; @ONC8MSG@(
+41 ; 0) Result descriptor
+42 ; ^01: Number of errors
+43 ; ^02: Number of warnings
+44 ; ^03: Web-service version
+45 ; ^04: Metafile version
+46 ; set#,
+47 ; 0) Edit set descriptor
+48 ; ^01: Number of errors
+49 ; ^02: Number of warnings
+50 ; 1) Edit set name
+51 ; "E",
+52 ; edit#,
+53 ; 0) Edit descriptor
+54 ; ^01: Number of errors
+55 ; ^02: Number of warnings
+56 ; ^03: Edit index
+57 ; 1) Edit name
+58 ; "F",
+59 ; fld#,
+60 ; 0) Field descriptor
+61 ; ^01: Start position
+62 ; 1) Field name
+63 ; 2) Field value
+64 ;
+65 ; "M",
+66 ; msg#,
+67 ; 0) Message descriptor
+68 ; ^01: Code
+69 ; ^02: Type
+70 ; 1) Message text
+71 ;
+72 ; "ES",
+73 ; edit#) set#
+74 ;
+75 ; The ^TMP("ONCSED01R",$J) and ^TMP("ONCSED01M",$J) global nodes
+76 ; are used by this function.
+77 ;
+78 ; Return values:
+79 ;
+80 ; <0 Error Descriptor (see ^ONCSAPI for details)
+81 ; For example:
+82 ; "-6^Parameter 'ONC8REQ' has an invalid value: ''^
+83 ; RBQEXEC+3^ONCSED01"
+84 ;
+85 ; 0 Ok
+86 ;
+87 ; 1 EDITS Warnings
+88 ;
+89 ; 2 EDITS Errors
+90 ;
RBQEXEC(ONCSAPI,ONC8REQ,ONC8MSG) ;
+1 NEW ONC8RDAT,RC,TMP,URL,X
+2 ;--- Validate parameters
+3 if $GET(ONC8REQ)?." "
QUIT $$ERROR^ONCSAPIE(-6,,"ONC8REQ",$GET(ONC8REQ))
+4 if $GET(ONC8MSG)?." "
SET ONC8MSG=$NAME(^TMP("ONCSED01M",$JOB))
+5 ;--- Initialize variables
+6 SET ONC8RDAT=$NAME(^TMP("ONCSED01R",$JOB))
+7 KILL @ONC8RDAT,@ONC8MSG
+8 ;
+9 ;--- Finish preparation of the NAACCR record
+10 DO END^ONCSNACR(.ONC8REQ)
+11 ;
+12 ;--- Complete the request
+13 DO TRAILER^ONCSAPIR(.ONC8REQ)
+14 ;
+15 ;--- Get the server URL ;commented url to use HWSC
+16 SET URL=$$GETCSURL^ONCSAPIU()
if URL<0
QUIT URL
+17 ;
+18 SET RC=0
Begin DoDot:1
+19 ;--- Call the web service ; commented run batch request and use HWSC
+20 if $GET(ONCSAPI("DEBUG"))
Begin DoDot:2
+21 DO ZW^ONCSAPIU(ONC8REQ,"*** 'RUN BATCH' REQUEST ***")
End DoDot:2
+22 ;S RC=$$REQUEST^ONCSAPIR(URL,ONC8RDAT,ONC8REQ) Q:RC<0
+23 ; P16
+24 DO T3^ONCWEB1
+25 if $GET(ONCSAPI("DEBUG"))
Begin DoDot:2
+26 DO ZW^ONCSAPIU(ONC8RDAT,"*** 'RUN BATCH' RESPONSE ***")
End DoDot:2
+27 ;--- Parse the response
+28 SET RC=$$PARSE^ONCSED02(.ONCSAPI,ONC8RDAT,ONC8MSG)
End DoDot:1
+29 ;
+30 ;--- Cleanup
+31 KILL ^TMP("ONCSED01R",$JOB)
+32 if RC'<0
Begin DoDot:1
+33 SET TMP=$GET(@ONC8MSG@(0))
+34 SET RC=$SELECT($PIECE(TMP,U,1)>0:2,$PIECE(TMP,U,2)>0:1,1:0)
End DoDot:1
+35 QUIT RC
+36 ;
+37 ;***** STARTS PREPARATION OF THE 'RUN BATCH' EDITS REQUEST
+38 ;
+39 ; [.ONCSAPI] Reference to the API descriptor (see ^ONCSAPI)
+40 ;
+41 ; .ONC8REQ Reference to a local variable that stores the
+42 ; closed root of the buffer for the request.
+43 ;
+44 ; Sub-nodes of the variable are used internally
+45 ; (see ^ONCSNACR and ^ONCSAPIR for details).
+46 ;
+47 ; [CFGNAME] Name of the configuration that should be used by
+48 ; the server to validate the data. By default,
+49 ; the default configuration is used.
+50 ;
+51 ; Return values:
+52 ;
+53 ; <0 Error Descriptor (see ^ONCSAPI for details)
+54 ; For example:
+55 ; "-6^Parameter 'ONC8REQ' has an invalid value: ''^
+56 ; RBQPREP+3^ONCSED01"
+57 ;
+58 ; 0 Ok
+59 ;
RBQPREP(ONCSAPI,ONC8REQ,CFGNAME) ;
+1 NEW ATTS
+2 DO CLEAR^ONCSAPIE()
+3 ;--- Validate parameters
+4 if $GET(ONC8REQ)?." "
QUIT $$ERROR^ONCSAPIE(-6,,"ONC8REQ",$GET(ONC8REQ))
+5 ;
+6 ;--- Standard request header
+7 if '($GET(CFGNAME)?." ")
SET ATTS("edits-config")=CFGNAME
+8 DO HEADER^ONCSAPIR(.ONC8REQ,"ED-RUN-BATCH",.ATTS)
+9 ;
+10 ;--- Start preparation of the NAACCR record
+11 DO BEGIN^ONCSNACR(.ONC8REQ)
+12 ;---
+13 QUIT 0
+14 ;
+15 ;***** PRINTS 'EDITS' REPORT ON THE CURRENT DEVICE
+16 ;
+17 ; [.ONCSAPI] Reference to the API descriptor (see ^ONCSAPI)
+18 ;
+19 ; ONC8MSG Closed root of the list of parsed error messages
+20 ; (generated by the RBQEXEC^ONCSED0101)
+21 ;
+22 ; [FLAGS] Flags that control the output (can be combined):
+23 ; M Include messages
+24 ; T Include totals
+25 ;
+26 ; Return values:
+27 ;
+28 ; <0 Error Descriptor (see ^ONCSAPI for details)
+29 ; For example:
+30 ; "-6^Parameter 'ONC8REQ' has an invalid value: ''^
+31 ; RBQEXEC+3^ONCSED01"
+32 ;
+33 ; 0 Ok
+34 ;
+35 ; 1 Timeout
+36 ; 2 User canceled the output ('^' was entered)
+37 ;
REPORT(ONCSAPI,ONC8MSG,FLAGS) ;
+1 NEW RC,TMP
+2 SET TMP=$GET(@ONC8MSG@(0))
+3 if ($PIECE(TMP,U,1)'>0)&($PIECE(TMP,U,2)'>0)
QUIT 0
+4 SET FLAGS=$GET(FLAGS)
+5 IF $TRANSLATE(FLAGS,"MT")'=FLAGS
if $EXTRACT(IOST,1,2)="C-"
WRITE @IOF
+6 ;--- EDITS messages
+7 IF FLAGS["M"
Begin DoDot:1
+8 SET RC=$$MESSAGES^ONCSED03(.ONCSAPI,ONC8MSG,FLAGS)
End DoDot:1
if RC
QUIT RC
+9 ;--- EDITS totals
+10 IF FLAGS["T"
Begin DoDot:1
+11 SET RC=$$TOTALS^ONCSED03(.ONCSAPI,ONC8MSG,FLAGS)
End DoDot:1
if RC
QUIT RC
+12 ;---
+13 QUIT 0