VistA-WorldVistAEHR/r/CONTROLLED_SUBSTANCES-PSD/PSDPRG.m

7 lines
532 B
Mathematica

PSDPRG ;BIR/JPW-Purge the CS WORKSHEET file (#58.85) ; 3 Jun 94
;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
LOOP ;start looping on order status x-ref
F PSD=3.99:0 S PSD=$O(^PSD(58.85,"AC",PSD)) Q:'PSD!(PSD>9) F PSDA=0:0 S PSDA=$O(^PSD(58.85,"AC",PSD,PSDA)) Q:'PSDA F PSDR=0:0 S PSDR=$O(^PSD(58.85,"AC",PSD,PSDA,PSDR)) Q:'PSDR D
.F PSDN=0:0 S PSDN=$O(^PSD(58.85,"AC",PSD,PSDA,PSDR,PSDN)) Q:'PSDN S DA=+$O(^PSD(58.85,"AC",PSD,PSDA,PSDR,PSDN,0)) I DA,$D(^PSD(58.85,+DA,0)) S DIK="^PSD(58.85," D ^DIK K DA,DIK
K PSD,PSDA,PSDN,PSDR