RMPRFC5 ;HINES CIOFO/HNC - Utility     ; 3/22/05
 ;;3.0;PROSTHETICS;**83**;Feb 09, 1996;Build 20
 ;
TRIMWP(ARRAY,PIECE) ;OBX segments so that only comment remains
 ; Input:
 ;   ARRAY  = the array in which the segments are contained
 ;      ex. ^TMP("RMPRIF",541083753,"OBX",3,3)=3|TX|^COMMENTS^|3|text "
 ;   PIECE  = the piece in the array where the text lives
 ; 
 ; Output:
 ;   trimmed array 
 ;     ex. ^TMP("RMPRIF",541083753,"OBX",3,3)="text"
 ;
 N I S I=0
 F  S I=$O(@(ARRAY)@(I)) Q:'I  D
 . S @(ARRAY)@(I)=$P(@(ARRAY)@(I),"|",PIECE)
 Q
 Q
EXIT ;
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRMPRFC5   579     printed  Sep 23, 2025@20:10:50                                                                                                                                                                                                      Page 2
RMPRFC5   ;HINES CIOFO/HNC - Utility     ; 3/22/05
 +1       ;;3.0;PROSTHETICS;**83**;Feb 09, 1996;Build 20
 +2       ;
TRIMWP(ARRAY,PIECE) ;OBX segments so that only comment remains
 +1       ; Input:
 +2       ;   ARRAY  = the array in which the segments are contained
 +3       ;      ex. ^TMP("RMPRIF",541083753,"OBX",3,3)=3|TX|^COMMENTS^|3|text "
 +4       ;   PIECE  = the piece in the array where the text lives
 +5       ; 
 +6       ; Output:
 +7       ;   trimmed array 
 +8       ;     ex. ^TMP("RMPRIF",541083753,"OBX",3,3)="text"
 +9       ;
 +10       NEW I
           SET I=0
 +11       FOR 
               SET I=$ORDER(@(ARRAY)@(I))
               if 'I
                   QUIT 
               Begin DoDot:1
 +12               SET @(ARRAY)@(I)=$PIECE(@(ARRAY)@(I),"|",PIECE)
               End DoDot:1
 +13       QUIT 
 +14       QUIT 
EXIT      ;
 +1        QUIT