PXRMDUTL1 ;SLC/AGP - DIALOG UTILITIES CONT. ;Oct 24, 2023@15:38:11
;;2.0;CLINICAL REMINDERS;**85**;Feb 04, 2005;Build 7
Q
;
COMPARE(FIND,GBL,FILES) ;
I '$D(FILES(GBL)) Q 0
I '$D(FILES(GBL,"IDS")) Q 1
I '$D(FILES(GBL,"IDS",FIND)) Q 0
Q 1
;
HASFINDS(RESULT,IEN,FILES) ;
N AIEN,FIND,GBL,IARRAY,NODE
S NODE=$G(^PXRMD(801.41,IEN,1))
S FIND=$P(NODE,U,5),GBL=$P(FIND,";",2)
I GBL'="",$$COMPARE(+FIND,GBL,.FILES) S RESULT(0)=FIND
S FIND=""
F S FIND=$O(^PXRMD(801.41,IEN,3,"B",FIND)) Q:FIND="" D
.S GBL=$P(FIND,";",2) I GBL="" Q
.I '$$COMPARE(+FIND,GBL,.FILES) Q
.S AIEN=$O(^PXRMD(801.41,IEN,3,"B",FIND,"")) Q:AIEN=0
.S RESULT(AIEN)=FIND
Q
;
SETHIST(DIEN,HISTTEXT) ;
N FDA,IENS,MSG,WP
K ^TMP($J,"PXRM DIALOG HISTORY")
S ^TMP($J,"PXRM DIALOG HISTORY",1,0)=HISTTEXT
S IENS="+"_(DIEN+1)_","_DIEN_","
S FDA(801.44,IENS,.01)=$$FMTE^XLFDT($$NOW^XLFDT,"5Z")
S FDA(801.44,IENS,1)="`"_DUZ
S FDA(801.44,IENS,2)=$NA(^TMP($J,"PXRM DIALOG HISTORY"))
D UPDATE^DIE("E","FDA","","MSG")
I $D(MSG) D AWRITE^PXRMUTIL("MSG")
K ^TMP($J,"PXRM DIALOG HISTORY")
Q
;
REMFINDS(INPUTS) ;
N ARRAY,FDA,FIEN,IEN,MSG
D SRC4FTYPE(.ARRAY,.INPUTS)
S IEN=0 F S IEN=$O(ARRAY(IEN)) Q:IEN'>0 D
.S FIEN="" F S FIEN=$O(ARRAY(IEN,FIEN)) Q:FIEN="" D
..K FDA,MSG
..I FIEN=0 S FDA(801.41,IEN_",",15)="@"
..I FIEN>0 S FDA(801.4118,FIEN_","_IEN_",",.01)="@"
..I '$D(FDA) Q
..D FILE^DIE("","FDA","MSG")
..I $D(MSG) W !,"DIEN: "_IEN_" FIEN: "_FIEN D AWRITE^PXRMUTIL("MSG")
Q
;
SRC4FTYPE(RESULTS,INPUTS) ;
N ARRAY,CNT,DIEN,DARRAY,DCNT,FIENS,FILES,FINDINGS,IEN,NAME,TYPE
S NAME=""
M FILES=INPUTS("FILES")
F S NAME=$O(INPUTS("DIALOG NAME",NAME)) Q:NAME="" D
.S DIEN=+$O(^PXRMD(801.41,"B",NAME,""))
.S INPUTS("DIALOG NAME",NAME)=DIEN I DIEN=0 Q
.K DARRAY,ARRAY
.S DCNT=0
.D DITEMAR^PXRMDUTL(DIEN,.ARRAY,.DARRAY,.DCNT)
.S IEN=0 F S IEN=$O(DARRAY(IEN)) Q:IEN'>0 D
..S TYPE=$P($G(^PXRMD(801.41,IEN,0)),U,4)
..I TYPE'="G",TYPE'="E" Q
..K FINDINGS
..D HASFINDS(.FINDINGS,IEN,.FILES)
..I '$D(FINDINGS) Q
..M RESULTS(IEN)=FINDINGS
;
Q
;
TESTER ;
N INPUTS,RESULTS
S INPUTS("DIALOG NAME","VA-WH GP BR BI-RAD SELECTOR: BIRAD 0")=""
S INPUTS("DIALOG NAME","VA-WH GP BR BI-RAD SELECTOR: BIRAD 0 DENSE")=""
S INPUTS("DIALOG NAME","VA-WH GP SMART BR OUTSIDE BI-RAD SELECTOR: BIRAD 0")=""
S INPUTS("DIALOG NAME","VA-WH GP SMART BR OUTSIDE BI-RAD SELECTOR: BIRAD 0 DENSE")=""
S INPUTS("DIALOG NAME","VA-WH GP SMART BR MALE OUTSIDE BI-RAD SELECTOR: BIRAD 0")=""
S INPUTS("FILES","ORD(101.41,")=""
;S INPUTS("FILES","ORD(101.41,","IDS",16322)=""
D SRC4FTYPE(.RESULTS,.INPUTS)
;ZW RESULTS
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMDUTL1 2676 printed Dec 13, 2024@01:44:23 Page 2
PXRMDUTL1 ;SLC/AGP - DIALOG UTILITIES CONT. ;Oct 24, 2023@15:38:11
+1 ;;2.0;CLINICAL REMINDERS;**85**;Feb 04, 2005;Build 7
+2 QUIT
+3 ;
COMPARE(FIND,GBL,FILES) ;
+1 IF '$DATA(FILES(GBL))
QUIT 0
+2 IF '$DATA(FILES(GBL,"IDS"))
QUIT 1
+3 IF '$DATA(FILES(GBL,"IDS",FIND))
QUIT 0
+4 QUIT 1
+5 ;
HASFINDS(RESULT,IEN,FILES) ;
+1 NEW AIEN,FIND,GBL,IARRAY,NODE
+2 SET NODE=$GET(^PXRMD(801.41,IEN,1))
+3 SET FIND=$PIECE(NODE,U,5)
SET GBL=$PIECE(FIND,";",2)
+4 IF GBL'=""
IF $$COMPARE(+FIND,GBL,.FILES)
SET RESULT(0)=FIND
+5 SET FIND=""
+6 FOR
SET FIND=$ORDER(^PXRMD(801.41,IEN,3,"B",FIND))
if FIND=""
QUIT
Begin DoDot:1
+7 SET GBL=$PIECE(FIND,";",2)
IF GBL=""
QUIT
+8 IF '$$COMPARE(+FIND,GBL,.FILES)
QUIT
+9 SET AIEN=$ORDER(^PXRMD(801.41,IEN,3,"B",FIND,""))
if AIEN=0
QUIT
+10 SET RESULT(AIEN)=FIND
End DoDot:1
+11 QUIT
+12 ;
SETHIST(DIEN,HISTTEXT) ;
+1 NEW FDA,IENS,MSG,WP
+2 KILL ^TMP($JOB,"PXRM DIALOG HISTORY")
+3 SET ^TMP($JOB,"PXRM DIALOG HISTORY",1,0)=HISTTEXT
+4 SET IENS="+"_(DIEN+1)_","_DIEN_","
+5 SET FDA(801.44,IENS,.01)=$$FMTE^XLFDT($$NOW^XLFDT,"5Z")
+6 SET FDA(801.44,IENS,1)="`"_DUZ
+7 SET FDA(801.44,IENS,2)=$NAME(^TMP($JOB,"PXRM DIALOG HISTORY"))
+8 DO UPDATE^DIE("E","FDA","","MSG")
+9 IF $DATA(MSG)
DO AWRITE^PXRMUTIL("MSG")
+10 KILL ^TMP($JOB,"PXRM DIALOG HISTORY")
+11 QUIT
+12 ;
REMFINDS(INPUTS) ;
+1 NEW ARRAY,FDA,FIEN,IEN,MSG
+2 DO SRC4FTYPE(.ARRAY,.INPUTS)
+3 SET IEN=0
FOR
SET IEN=$ORDER(ARRAY(IEN))
if IEN'>0
QUIT
Begin DoDot:1
+4 SET FIEN=""
FOR
SET FIEN=$ORDER(ARRAY(IEN,FIEN))
if FIEN=""
QUIT
Begin DoDot:2
+5 KILL FDA,MSG
+6 IF FIEN=0
SET FDA(801.41,IEN_",",15)="@"
+7 IF FIEN>0
SET FDA(801.4118,FIEN_","_IEN_",",.01)="@"
+8 IF '$DATA(FDA)
QUIT
+9 DO FILE^DIE("","FDA","MSG")
+10 IF $DATA(MSG)
WRITE !,"DIEN: "_IEN_" FIEN: "_FIEN
DO AWRITE^PXRMUTIL("MSG")
End DoDot:2
End DoDot:1
+11 QUIT
+12 ;
SRC4FTYPE(RESULTS,INPUTS) ;
+1 NEW ARRAY,CNT,DIEN,DARRAY,DCNT,FIENS,FILES,FINDINGS,IEN,NAME,TYPE
+2 SET NAME=""
+3 MERGE FILES=INPUTS("FILES")
+4 FOR
SET NAME=$ORDER(INPUTS("DIALOG NAME",NAME))
if NAME=""
QUIT
Begin DoDot:1
+5 SET DIEN=+$ORDER(^PXRMD(801.41,"B",NAME,""))
+6 SET INPUTS("DIALOG NAME",NAME)=DIEN
IF DIEN=0
QUIT
+7 KILL DARRAY,ARRAY
+8 SET DCNT=0
+9 DO DITEMAR^PXRMDUTL(DIEN,.ARRAY,.DARRAY,.DCNT)
+10 SET IEN=0
FOR
SET IEN=$ORDER(DARRAY(IEN))
if IEN'>0
QUIT
Begin DoDot:2
+11 SET TYPE=$PIECE($GET(^PXRMD(801.41,IEN,0)),U,4)
+12 IF TYPE'="G"
IF TYPE'="E"
QUIT
+13 KILL FINDINGS
+14 DO HASFINDS(.FINDINGS,IEN,.FILES)
+15 IF '$DATA(FINDINGS)
QUIT
+16 MERGE RESULTS(IEN)=FINDINGS
End DoDot:2
End DoDot:1
+17 ;
+18 QUIT
+19 ;
TESTER ;
+1 NEW INPUTS,RESULTS
+2 SET INPUTS("DIALOG NAME","VA-WH GP BR BI-RAD SELECTOR: BIRAD 0")=""
+3 SET INPUTS("DIALOG NAME","VA-WH GP BR BI-RAD SELECTOR: BIRAD 0 DENSE")=""
+4 SET INPUTS("DIALOG NAME","VA-WH GP SMART BR OUTSIDE BI-RAD SELECTOR: BIRAD 0")=""
+5 SET INPUTS("DIALOG NAME","VA-WH GP SMART BR OUTSIDE BI-RAD SELECTOR: BIRAD 0 DENSE")=""
+6 SET INPUTS("DIALOG NAME","VA-WH GP SMART BR MALE OUTSIDE BI-RAD SELECTOR: BIRAD 0")=""
+7 SET INPUTS("FILES","ORD(101.41,")=""
+8 ;S INPUTS("FILES","ORD(101.41,","IDS",16322)=""
+9 DO SRC4FTYPE(.RESULTS,.INPUTS)
+10 ;ZW RESULTS
+11 QUIT