PSOUTCRM ;ORLFO/FJF/WC - PSO utilities for CRM; Mar 20, 2023@12:57:56
;;7.0;OUTPATIENT PHARMACY;**707**;DEC 1997;Build 18
;
; PSO utilities for SalesForce CRM application
;
SWAP(INPT,THIS,THAT) ; swap this with that in a string
N OUTP,I
F I=1:1:$L(INPT,THIS) D
.S $P(OUTP,THAT,I)=$P(INPT,THIS,I)
Q OUTP
;
RXVAL(RXN) ; validate Presciption number and return 0 node
; INPUT:
; RXN - external Presciption number
;
; OUTPUT:
; 1 = valid
; 0 or less = invalid prescription
;
;
N DFN,LIST,X
S X=0,RXN=$G(RXN) Q:RXN="" 0
S DFN=-1
S LIST="PSOV"
D RX^PSO52API(DFN,LIST,,RXN)
I $O(^TMP($J,"PSOV",$O(^TMP($J,"PSOV",-2))))>0 Q 1
Q 0
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSOUTCRM 695 printed Dec 13, 2024@02:36:04 Page 2
PSOUTCRM ;ORLFO/FJF/WC - PSO utilities for CRM; Mar 20, 2023@12:57:56
+1 ;;7.0;OUTPATIENT PHARMACY;**707**;DEC 1997;Build 18
+2 ;
+3 ; PSO utilities for SalesForce CRM application
+4 ;
SWAP(INPT,THIS,THAT) ; swap this with that in a string
+1 NEW OUTP,I
+2 FOR I=1:1:$LENGTH(INPT,THIS)
Begin DoDot:1
+3 SET $PIECE(OUTP,THAT,I)=$PIECE(INPT,THIS,I)
End DoDot:1
+4 QUIT OUTP
+5 ;
RXVAL(RXN) ; validate Presciption number and return 0 node
+1 ; INPUT:
+2 ; RXN - external Presciption number
+3 ;
+4 ; OUTPUT:
+5 ; 1 = valid
+6 ; 0 or less = invalid prescription
+7 ;
+8 ;
+9 NEW DFN,LIST,X
+10 SET X=0
SET RXN=$GET(RXN)
if RXN=""
QUIT 0
+11 SET DFN=-1
+12 SET LIST="PSOV"
+13 DO RX^PSO52API(DFN,LIST,,RXN)
+14 IF $ORDER(^TMP($JOB,"PSOV",$ORDER(^TMP($JOB,"PSOV",-2))))>0
QUIT 1
+15 QUIT 0
+16 ;