Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PXRMDUTL1

PXRMDUTL1.m

Go to the documentation of this file.
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