PXRMDRVI ;ISP/AGP - PATCH 65 DIALOG CONVERSION PRE REPORT ;08/22/2018
;;2.0;CLINICAL REMINDERS;**45**;Feb 04, 2005;Build 566
Q
;
; 0 := NO CHANGES TO FINDING
; 1 := DISABLE ITEM
; 2 := REMOVED FINDINGS
; 3 := REMOVED PROMPTS ONLY
;
EN ;
N CNT,DARRAY,GBL,SUB,TEXT
F GBL="AUTTIMM(","AUTTSK(" D FINDDIAL(GBL,.DARRAY)
W !,"The following dialog items will automatically be converted with the install"
W !,"of CPRS 32 to only contain Immunization or Skin Test findings."
W !,"Each section describes what will happen to the dialog definitions when"
W !,"CPRS 32 is installed"
W !,""
I '$D(DARRAY) W !!,"No dialog items need to be updated" Q
D REPORT(.DARRAY)
Q
;
CHCKFIND(FIND,GBL,CODES) ;
N RESULT,TAX
S RESULT=0
I GBL["AUTTIMM",FIND["AUTTSK" S RESULT=1 Q RESULT
I GBL["AUTTSK",FIND["AUTTIMM" S RESULT=1 Q RESULT
;
;I FIND["811.2" D
;.S RESULT=$$HASCODES(FIND,.CODES)
;I RESULT=1 Q RESULT
;
I GBL["AUTTIMM",FIND'["AUTTIMM" S RESULT=2
I GBL["AUTTSK",FIND'["AUTTSK" S RESULT=2
Q RESULT
;
DIALFIND(DIEN,GBL) ;
N FIND,OTHER,RESULT
S RESULT=0
S FIND=$P($G(^PXRMD(801.41,DIEN,1)),U,5)
I FIND'="" S RESULT=$$CHCKFIND(FIND,GBL,.CODES) I RESULT>0 Q RESULT
S FIND="" F S FIND=$O(^PXRMD(801.41,DIEN,3,"B",FIND)) Q:FIND=""!(RESULT>0) D
.S RESULT=$$CHCKFIND(FIND,GBL,.CODES)
I RESULT=0,$$HASPRMPT(DIEN) S RESULT=3
Q RESULT
;
FINDDIAL(GBL,DARRAY) ;
N ACTION,CODES,DIEN,DSUB,FIND,FINDNAME,NODE
S DSUB="PXVIMMRPC"
K ^TMP($J,DSUB)
D APIONE^PXRMDLR3(DSUB,"ALL",GBL,1)
S FIND="" F S FIND=$O(^TMP($J,DSUB,FIND)) Q:FIND="" D
.S I=0 F S I=$O(^TMP($J,DSUB,FIND,I)) Q:I'>0 D
..S J=0 F S J=$O(^TMP($J,DSUB,FIND,I,J)) Q:J'>0 D
...S NODE=$G(^TMP($J,DSUB,FIND,I,J))
...S DIEN=$P(NODE,U,2)
...I $G(DARRAY(DIEN))=1 Q
...I $P(^PXRMD(801.41,DIEN,0),U,4)="R" Q
...S ACTION=$$DIALFIND(DIEN,GBL)
...I ACTION=0 Q
...S DARRAY(ACTION,DIEN)=""
K ^TMP($J,DSUB)
Q
;
DETAIL(DIEN) ;
Q $P(^PXRMD(801.41,DIEN,0),U)_U_$P(^PXRMD(801.41,DIEN,0),U,4)
;
HASPRMPT(DIEN) ;
N CIEN,DATA,RESULT
S RESULT=0
S CIEN=0 F S CIEN=$O(^PXRMD(801.41,DIEN,10,"D",CIEN)) Q:CIEN'>0!(RESULT=1) D
.S DATA=$$DETAIL(CIEN) I "PF"[$P(DATA,U,2) S RESULT=1
Q RESULT
;
REPORT(DARRAY) ;
N ACTION,CNT,DATA,DIEN,HASPRMPT,LACTION,NAME,TEMPARR,TEXT,TYPE
S ACTION=0,CNT=0,LACTION=0 F S ACTION=$O(DARRAY(ACTION)) Q:ACTION'>0 D
.I ACTION'=LACTION D WRITE(ACTION,.TEXT,.CNT) S LACTION=ACTION
.S DIEN=0 F S DIEN=$O(DARRAY(ACTION,DIEN)) Q:DIEN'>0 D
..S CNT=CNT+1,TEXT(CNT)=""
..S DATA=$$DETAIL(DIEN)
..;S HASPRMPT=$S(ACTION=3:1,1:$$HASPRMPT(DIEN))
..S TYPE=$$EXTERNAL^DILFD(801.41,4,"",$P(DATA,U,2))
..S CNT=CNT+1,TEXT(CNT)=TYPE_": "_$P(DATA,U)
..;I HASPRMPT S CNT=CNT+1,TEXT(CNT)=" has prompts that will be removed with the patch install"
S CNT=0 F S CNT=$O(TEXT(CNT)) Q:CNT'>0 W !,TEXT(CNT)
Q
;
WRITE(ACTION,TEXT,CNT) ;
S CNT=CNT+1
S TEXT(CNT)=""
S CNT=CNT+1
I ACTION=1 D
.S TEXT(CNT)="After CPRS 32, dialog definitions cannot contain both an immunization AND"
.S CNT=CNT+1,TEXT(CNT)="a skin test finding. The following dialog defintions will be"
.S CNT=CNT+1,TEXT(CNT)="disabled upon patch install. Please review and update this section"
.S CNT=CNT+1,TEXT(CNT)="before installing CPRS 32. To avoid that action, please review and"
.S CNT=CNT+1,TEXT(CNT)="update items listed in this section before installing CPRS 32."
I ACTION=2 D
.S TEXT(CNT)="For dialog definitions that contain immunization/skin test findings and"
.S CNT=CNT+1,TEXT(CNT)="another type of finding (i.e, Health Factor, Taxonomy, exams, etc...),"
.S CNT=CNT+1,TEXT(CNT)="the NON immunization/skin test findings will be removed from the following"
.S CNT=CNT+1,TEXT(CNT)="dialog definitions."
I ACTION=3 D
.S TEXT(CNT)="Any prompts assigned to the dialog definitions that contain"
.S CNT=CNT+1,TEXT(CNT)="immunization/skin test finding will be removed when CPRS 32 is installed."
S CNT=CNT+1,TEXT(CNT)="-------------------------------------------------------------------"
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMDRVI 4076 printed Dec 13, 2024@01:44:20 Page 2
PXRMDRVI ;ISP/AGP - PATCH 65 DIALOG CONVERSION PRE REPORT ;08/22/2018
+1 ;;2.0;CLINICAL REMINDERS;**45**;Feb 04, 2005;Build 566
+2 QUIT
+3 ;
+4 ; 0 := NO CHANGES TO FINDING
+5 ; 1 := DISABLE ITEM
+6 ; 2 := REMOVED FINDINGS
+7 ; 3 := REMOVED PROMPTS ONLY
+8 ;
EN ;
+1 NEW CNT,DARRAY,GBL,SUB,TEXT
+2 FOR GBL="AUTTIMM(","AUTTSK("
DO FINDDIAL(GBL,.DARRAY)
+3 WRITE !,"The following dialog items will automatically be converted with the install"
+4 WRITE !,"of CPRS 32 to only contain Immunization or Skin Test findings."
+5 WRITE !,"Each section describes what will happen to the dialog definitions when"
+6 WRITE !,"CPRS 32 is installed"
+7 WRITE !,""
+8 IF '$DATA(DARRAY)
WRITE !!,"No dialog items need to be updated"
QUIT
+9 DO REPORT(.DARRAY)
+10 QUIT
+11 ;
CHCKFIND(FIND,GBL,CODES) ;
+1 NEW RESULT,TAX
+2 SET RESULT=0
+3 IF GBL["AUTTIMM"
IF FIND["AUTTSK"
SET RESULT=1
QUIT RESULT
+4 IF GBL["AUTTSK"
IF FIND["AUTTIMM"
SET RESULT=1
QUIT RESULT
+5 ;
+6 ;I FIND["811.2" D
+7 ;.S RESULT=$$HASCODES(FIND,.CODES)
+8 ;I RESULT=1 Q RESULT
+9 ;
+10 IF GBL["AUTTIMM"
IF FIND'["AUTTIMM"
SET RESULT=2
+11 IF GBL["AUTTSK"
IF FIND'["AUTTSK"
SET RESULT=2
+12 QUIT RESULT
+13 ;
DIALFIND(DIEN,GBL) ;
+1 NEW FIND,OTHER,RESULT
+2 SET RESULT=0
+3 SET FIND=$PIECE($GET(^PXRMD(801.41,DIEN,1)),U,5)
+4 IF FIND'=""
SET RESULT=$$CHCKFIND(FIND,GBL,.CODES)
IF RESULT>0
QUIT RESULT
+5 SET FIND=""
FOR
SET FIND=$ORDER(^PXRMD(801.41,DIEN,3,"B",FIND))
if FIND=""!(RESULT>0)
QUIT
Begin DoDot:1
+6 SET RESULT=$$CHCKFIND(FIND,GBL,.CODES)
End DoDot:1
+7 IF RESULT=0
IF $$HASPRMPT(DIEN)
SET RESULT=3
+8 QUIT RESULT
+9 ;
FINDDIAL(GBL,DARRAY) ;
+1 NEW ACTION,CODES,DIEN,DSUB,FIND,FINDNAME,NODE
+2 SET DSUB="PXVIMMRPC"
+3 KILL ^TMP($JOB,DSUB)
+4 DO APIONE^PXRMDLR3(DSUB,"ALL",GBL,1)
+5 SET FIND=""
FOR
SET FIND=$ORDER(^TMP($JOB,DSUB,FIND))
if FIND=""
QUIT
Begin DoDot:1
+6 SET I=0
FOR
SET I=$ORDER(^TMP($JOB,DSUB,FIND,I))
if I'>0
QUIT
Begin DoDot:2
+7 SET J=0
FOR
SET J=$ORDER(^TMP($JOB,DSUB,FIND,I,J))
if J'>0
QUIT
Begin DoDot:3
+8 SET NODE=$GET(^TMP($JOB,DSUB,FIND,I,J))
+9 SET DIEN=$PIECE(NODE,U,2)
+10 IF $GET(DARRAY(DIEN))=1
QUIT
+11 IF $PIECE(^PXRMD(801.41,DIEN,0),U,4)="R"
QUIT
+12 SET ACTION=$$DIALFIND(DIEN,GBL)
+13 IF ACTION=0
QUIT
+14 SET DARRAY(ACTION,DIEN)=""
End DoDot:3
End DoDot:2
End DoDot:1
+15 KILL ^TMP($JOB,DSUB)
+16 QUIT
+17 ;
DETAIL(DIEN) ;
+1 QUIT $PIECE(^PXRMD(801.41,DIEN,0),U)_U_$PIECE(^PXRMD(801.41,DIEN,0),U,4)
+2 ;
HASPRMPT(DIEN) ;
+1 NEW CIEN,DATA,RESULT
+2 SET RESULT=0
+3 SET CIEN=0
FOR
SET CIEN=$ORDER(^PXRMD(801.41,DIEN,10,"D",CIEN))
if CIEN'>0!(RESULT=1)
QUIT
Begin DoDot:1
+4 SET DATA=$$DETAIL(CIEN)
IF "PF"[$PIECE(DATA,U,2)
SET RESULT=1
End DoDot:1
+5 QUIT RESULT
+6 ;
REPORT(DARRAY) ;
+1 NEW ACTION,CNT,DATA,DIEN,HASPRMPT,LACTION,NAME,TEMPARR,TEXT,TYPE
+2 SET ACTION=0
SET CNT=0
SET LACTION=0
FOR
SET ACTION=$ORDER(DARRAY(ACTION))
if ACTION'>0
QUIT
Begin DoDot:1
+3 IF ACTION'=LACTION
DO WRITE(ACTION,.TEXT,.CNT)
SET LACTION=ACTION
+4 SET DIEN=0
FOR
SET DIEN=$ORDER(DARRAY(ACTION,DIEN))
if DIEN'>0
QUIT
Begin DoDot:2
+5 SET CNT=CNT+1
SET TEXT(CNT)=""
+6 SET DATA=$$DETAIL(DIEN)
+7 ;S HASPRMPT=$S(ACTION=3:1,1:$$HASPRMPT(DIEN))
+8 SET TYPE=$$EXTERNAL^DILFD(801.41,4,"",$PIECE(DATA,U,2))
+9 SET CNT=CNT+1
SET TEXT(CNT)=TYPE_": "_$PIECE(DATA,U)
+10 ;I HASPRMPT S CNT=CNT+1,TEXT(CNT)=" has prompts that will be removed with the patch install"
End DoDot:2
End DoDot:1
+11 SET CNT=0
FOR
SET CNT=$ORDER(TEXT(CNT))
if CNT'>0
QUIT
WRITE !,TEXT(CNT)
+12 QUIT
+13 ;
WRITE(ACTION,TEXT,CNT) ;
+1 SET CNT=CNT+1
+2 SET TEXT(CNT)=""
+3 SET CNT=CNT+1
+4 IF ACTION=1
Begin DoDot:1
+5 SET TEXT(CNT)="After CPRS 32, dialog definitions cannot contain both an immunization AND"
+6 SET CNT=CNT+1
SET TEXT(CNT)="a skin test finding. The following dialog defintions will be"
+7 SET CNT=CNT+1
SET TEXT(CNT)="disabled upon patch install. Please review and update this section"
+8 SET CNT=CNT+1
SET TEXT(CNT)="before installing CPRS 32. To avoid that action, please review and"
+9 SET CNT=CNT+1
SET TEXT(CNT)="update items listed in this section before installing CPRS 32."
End DoDot:1
+10 IF ACTION=2
Begin DoDot:1
+11 SET TEXT(CNT)="For dialog definitions that contain immunization/skin test findings and"
+12 SET CNT=CNT+1
SET TEXT(CNT)="another type of finding (i.e, Health Factor, Taxonomy, exams, etc...),"
+13 SET CNT=CNT+1
SET TEXT(CNT)="the NON immunization/skin test findings will be removed from the following"
+14 SET CNT=CNT+1
SET TEXT(CNT)="dialog definitions."
End DoDot:1
+15 IF ACTION=3
Begin DoDot:1
+16 SET TEXT(CNT)="Any prompts assigned to the dialog definitions that contain"
+17 SET CNT=CNT+1
SET TEXT(CNT)="immunization/skin test finding will be removed when CPRS 32 is installed."
End DoDot:1
+18 SET CNT=CNT+1
SET TEXT(CNT)="-------------------------------------------------------------------"
+19 QUIT
+20 ;