[613] | 1 | PSO126IX ;BIR/PDW-Execute CMOP INDICATOR Index ;08/12/2002
|
---|
| 2 | ;;7.0;OUTPATIENT PHARMACY;**126**;DEC 1997
|
---|
| 3 | Q
|
---|
| 4 | CMPNDX ; new compound index on CMOP Indicator "CMP"
|
---|
| 5 | ;check "A_x" indexes to CMP index
|
---|
| 6 | W !,"Updating the RX Suspense file's new 'CMP' index."
|
---|
| 7 | W !,"Processing the AQ, AL, AX, AP indexes into the CMP index"
|
---|
| 8 | F NDX="Q","L","X","P" D
|
---|
| 9 | . S INDX="A"_NDX W !!,INDX
|
---|
| 10 | . S SDT=0 F S SDT=$O(^PS(52.5,INDX,SDT)) Q:'SDT D
|
---|
| 11 | .. S DFN=0 F S DFN=$O(^PS(52.5,INDX,SDT,DFN)) Q:'DFN D
|
---|
| 12 | ... S REC=0 F S REC=$O(^PS(52.5,INDX,SDT,DFN,REC)) Q:'REC D
|
---|
| 13 | .... S F=$G(^PS(52.5,REC,0))
|
---|
| 14 | .... I 'F K ^PS(52.5,INDX,SDT,DFN,REC) Q ;bad index
|
---|
| 15 | .... S TYP=$$CMPRXTYP^PSOCMOP(REC),CNT=$G(CNT)+1 I '(CNT#100) W "."
|
---|
| 16 | .... F VP="RX^1","SDT0^2","DFN0^3","DIV^6","STAT^7" D PIECE(F,U,VP)
|
---|
| 17 | .... I NDX=STAT,DFN=DFN0,SDT=SDT0
|
---|
| 18 | .... E K ^PS(52.5,INDX,SDT,DFN,REC)
|
---|
| 19 | .... I STAT'="",$D(^PS(52.5,"CMP",STAT,TYP,DIV,SDT0,DFN,REC)) S ^PS(52.5,"CMP",NDX,TYP,DIV,SDT,DFN,REC)=""
|
---|
| 20 | Q
|
---|
| 21 | PIECE(REC,DLM,VP) ; VP="Variable^Piece" : S Variable=$P(REC,DLM,Piece)
|
---|
| 22 | N V,P S V=$P(VP,DLM),P=$P(VP,DLM,2),@V=$P(REC,DLM,P)
|
---|
| 23 | Q
|
---|