LA7UTILD ;DALOI/JMC - Duplicate comment check ;Jan 29, 2007
;;5.2;AUTOMATED LAB INSTRUMENTS;**74**;Sep 27, 1994;Build 229
;
Q
;
;
DUPCHK(LA7A,LA7B,LA7C) ; Perform duplicate comment check of two arrays, return unique entries in 3rd array
; Call with LA7A = array of existing comments on file (pass by reference)
; LA7B = array of new comments to check against existing comments (LA7A array) (pass by reference)
;
; Returns LA7C = array with only those comments that are new/unique (pass by reference)
;
N LA7DUP,LA7I,LA7J,LA7K,LA7X,LA7Y
S (LA7I,LA7J,LA7K)=0
F S LA7I=$O(LA7B(LA7I)) Q:'LA7I D
. S LA7X=$P(LA7B(LA7I,0),"^"),LA7X=$TR(LA7X," ",""),LA7X=$$UP^XLFSTR(LA7X)
. S (LA7DUP,LA7J)=0
. F S LA7J=$O(LA7A(LA7J)) Q:'LA7J D Q:LA7DUP
. . S LA7Y=$P(LA7A(LA7J,0),"^"),LA7Y=$TR(LA7Y," ",""),LA7Y=$$UP^XLFSTR(LA7Y)
. . I LA7X=LA7Y S LA7DUP=1
. I 'LA7DUP S LA7K=LA7K+1,LA7C(LA7K,0)=LA7B(LA7I,0)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLA7UTILD 948 printed Oct 16, 2024@17:40:51 Page 2
LA7UTILD ;DALOI/JMC - Duplicate comment check ;Jan 29, 2007
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;**74**;Sep 27, 1994;Build 229
+2 ;
+3 QUIT
+4 ;
+5 ;
DUPCHK(LA7A,LA7B,LA7C) ; Perform duplicate comment check of two arrays, return unique entries in 3rd array
+1 ; Call with LA7A = array of existing comments on file (pass by reference)
+2 ; LA7B = array of new comments to check against existing comments (LA7A array) (pass by reference)
+3 ;
+4 ; Returns LA7C = array with only those comments that are new/unique (pass by reference)
+5 ;
+6 NEW LA7DUP,LA7I,LA7J,LA7K,LA7X,LA7Y
+7 SET (LA7I,LA7J,LA7K)=0
+8 FOR
SET LA7I=$ORDER(LA7B(LA7I))
if 'LA7I
QUIT
Begin DoDot:1
+9 SET LA7X=$PIECE(LA7B(LA7I,0),"^")
SET LA7X=$TRANSLATE(LA7X," ","")
SET LA7X=$$UP^XLFSTR(LA7X)
+10 SET (LA7DUP,LA7J)=0
+11 FOR
SET LA7J=$ORDER(LA7A(LA7J))
if 'LA7J
QUIT
Begin DoDot:2
+12 SET LA7Y=$PIECE(LA7A(LA7J,0),"^")
SET LA7Y=$TRANSLATE(LA7Y," ","")
SET LA7Y=$$UP^XLFSTR(LA7Y)
+13 IF LA7X=LA7Y
SET LA7DUP=1
End DoDot:2
if LA7DUP
QUIT
+14 IF 'LA7DUP
SET LA7K=LA7K+1
SET LA7C(LA7K,0)=LA7B(LA7I,0)
End DoDot:1
+15 QUIT