VistA-WorldVistAEHR/r/BAR_CODE_MED_ADMIN-ALPB-PSB/PSBCHIVH.m

19 lines
704 B
Mathematica

PSBCHIVH ;BIRMINGHAM/BSR-BCMA CHECK IV ROUTINE ;Mar 2004
;;3.0;BAR CODE MED ADMIN;;Mar 2004
;
;This routine will retrievehistory order numbers.
;
GETORD(PSBORD) ;
S PSBONXS=PSBORD_"^"
F PSBC1=1:1 Q:$P(PSBONXS,U,PSBC1)="" D ; process all orders
.D CLEAN^PSBVT,PSJ1^PSBVT(DFN,$P(PSBONXS,U,PSBC1))
.I $G(PSBPONX)]"",$G(PSBPONX)["P" S PSBPONX2=PSBPONX D ; Must compare
..F D CLEAN^PSBVT,PSJ1^PSBVT(DFN,PSBPONX2) S PSBPONX2=PSBPONX Q:(PSBPONX2="")!(PSBPONX2'["P") ;
..D CLEAN^PSBVT,PSJ1^PSBVT(DFN,$P(PSBONXS,U,PSBC1)) ; Refresh data
..S:$D(PSBPONX2) PSBPONX=PSBPONX2 K PSBPONX2
.Q:($L(U_PSBONXS,U_PSBPONX_U)-1)>0
.I $G(PSBPONX)]"" S PSBONXS=PSBONXS_PSBPONX_U
S PSBONXSB=PSBONXS
Q
;