ORQQPP ; slc/CLA - Functions which return patient postings ;12/15/97
;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
LIST(ORY,ORPT) ;return pt's patient posting list
Q:'$L($G(ORPT))
K ^TMP("TIUPPCV",$J)
D ENCOVER^TIUPP3(ORPT)
I MSG'=0 S ORY(1)="^No patient postings found."
N I,J,X,FMDT,MSG S I=0,J=1,X=""
F S I=$O(^TMP("TIUPPCV",$J,I)) Q:I<1 D
.S X=^(I),ORY(J)=$P(X,U)_U_$P(X,U,3)_U_$P(X,U,5),J=J+1
K ^TMP("TIUPPCV",$J)
Q
PPIMM(ORY,ORPT) ;return pt's patient postings and immunizations
Q:'$L($G(ORPT))
K ^TMP("TIUPPCV",$J)
D ENCOVER^TIUPP3(ORPT)
I MSG'=0 S ORY(1)="^No patient postings found."
N I,ORJ,X,FMDT,MSG,IMM,IVDT,IEN
S I=0,ORJ=1,X=""
F S I=$O(^TMP("TIUPPCV",$J,I)) Q:I<1 D
.S X=^(I),ORY(ORJ)=$P(X,U)_";P"_U_$P(X,U,3)_U_$P(X,U,5),ORJ=ORJ+1
K ^TMP("TIUPPCV",$J),^TMP("PXI",$J)
I $L($T(IMMUN^PXRHS03))<1 S ORY(ORJ)=";I^Immunizations not available." Q
D IMMUN^PXRHS03(ORPT)
S IMM="",IVDT="",IEN=0
F S IMM=$O(^TMP("PXI",$J,IMM)) Q:IMM="" D
.F S IVDT=$O(^TMP("PXI",$J,IMM,IVDT)) Q:IVDT="" D
..F S IEN=$O(^TMP("PXI",$J,IMM,IVDT,IEN)) Q:IEN<1 D
...S ORJ=ORJ+1,X=$G(^TMP("PXI",$J,IMM,IVDT,IEN,0)) Q:'$L(X)
...S ORY(ORJ)=IEN_";I"_U_IMM_U_$P(X,U,3)
S:'$L($G(ORY(ORJ))) ORY(ORJ)=";I^No immunizations found.^2900101"
K ^TMP("PXI",$J)
Q
ORQQPP ; slc/CLA - Functions which return patient postings ;12/15/97
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
LIST(ORY,ORPT) ;return pt's patient posting list
+1 IF '$LENGTH($GET(ORPT))
QUIT
+2 KILL ^TMP("TIUPPCV",$JOB)
+3 DO ENCOVER^TIUPP3(ORPT)
+4 IF MSG'=0
SET ORY(1)="^No patient postings found."
+5 NEW I,J,X,FMDT,MSG
SET I=0
SET J=1
SET X=""
+6 FOR
SET I=$ORDER(^TMP("TIUPPCV",$JOB,I))
IF I<1
QUIT
Begin DoDot:1
+7 SET X=^(I)
SET ORY(J)=$PIECE(X,U)_U_$PIECE(X,U,3)_U_$PIECE(X,U,5)
SET J=J+1
End DoDot:1
+8 KILL ^TMP("TIUPPCV",$JOB)
+9 QUIT
PPIMM(ORY,ORPT) ;return pt's patient postings and immunizations
+1 IF '$LENGTH($GET(ORPT))
QUIT
+2 KILL ^TMP("TIUPPCV",$JOB)
+3 DO ENCOVER^TIUPP3(ORPT)
+4 IF MSG'=0
SET ORY(1)="^No patient postings found."
+5 NEW I,ORJ,X,FMDT,MSG,IMM,IVDT,IEN
+6 SET I=0
SET ORJ=1
SET X=""
+7 FOR
SET I=$ORDER(^TMP("TIUPPCV",$JOB,I))
IF I<1
QUIT
Begin DoDot:1
+8 SET X=^(I)
SET ORY(ORJ)=$PIECE(X,U)_";P"_U_$PIECE(X,U,3)_U_$PIECE(X,U,5)
SET ORJ=ORJ+1
End DoDot:1
+9 KILL ^TMP("TIUPPCV",$JOB),^TMP("PXI",$JOB)
+10 IF $LENGTH($TEXT(IMMUN^PXRHS03))<1
SET ORY(ORJ)=";I^Immunizations not available."
QUIT
+11 DO IMMUN^PXRHS03(ORPT)
+12 SET IMM=""
SET IVDT=""
SET IEN=0
+13 FOR
SET IMM=$ORDER(^TMP("PXI",$JOB,IMM))
IF IMM=""
QUIT
Begin DoDot:1
+14 FOR
SET IVDT=$ORDER(^TMP("PXI",$JOB,IMM,IVDT))
IF IVDT=""
QUIT
Begin DoDot:2
+15 FOR
SET IEN=$ORDER(^TMP("PXI",$JOB,IMM,IVDT,IEN))
IF IEN<1
QUIT
Begin DoDot:3
+16 SET ORJ=ORJ+1
SET X=$GET(^TMP("PXI",$JOB,IMM,IVDT,IEN,0))
IF '$LENGTH(X)
QUIT
+17 SET ORY(ORJ)=IEN_";I"_U_IMM_U_$PIECE(X,U,3)
End DoDot:3
End DoDot:2
End DoDot:1
+18 IF '$LENGTH($GET(ORY(ORJ)))
SET ORY(ORJ)=";I^No immunizations found.^2900101"
+19 KILL ^TMP("PXI",$JOB)
+20 QUIT