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

PXRMP65D.m

Go to the documentation of this file.
PXRMP65D ;ISP/AGP - PATCH 65 DIALOG CONVERSION ;May 03, 2022@09:30:27
 ;;2.0;CLINICAL REMINDERS;**65**;Feb 04, 2005;Build 438
 Q
 ;
ACT(DIEN,ACTION) ;
 N DATA,HASPRMPT,TYPE
 S DATA=$$DETAIL^PXRMDRVI(DIEN)
 S TYPE=$$EXTERNAL^DILFD(801.41,4,"",$P(DATA,U,2))
 D MES^XPDUTL("Updating "_TYPE_" "_$P(DATA,U))
 S HASPRMPT=$S(ACTION=3:1,1:$$HASPRMPT^PXRMDRVI(DIEN))
 I HASPRMPT D PROMPT(DIEN)
 I ACTION=1 D DISABLE(DIEN)
 I ACTION=2 D FINDINGS(DIEN)
 Q
 ;
DELDATA(DIEN,FIELD,NUM) ;
 N DA,DIE,DR
 S DIE="^PXRMD(801.41,"
 I FIELD=15 S DA=DIEN,DR="15///@"
 I FIELD=10 D
 .S DA(1)=DIEN,DA=NUM
 .S DIE=DIE_DA(1)_",10,",DR=".01///@"
 I FIELD=18 D
 .S DA(1)=DIEN,DA=NUM
 .S DIE=DIE_DA(1)_",3,",DR=".01///@"
 D ^DIE
 Q
 ;
DISABLE(DA) ;
 N DIE,DR
 D MES^XPDUTL("  disabling item")
 S DIE="^PXRMD(801.41,",DR="3////DISABLE AND DO NOT SEND MESSAGE"
 D ^DIE
 Q
 ;
DIALCONV ;
 N ACTION,DARRAY,DIEN,GBL
 D MES^XPDUTL("Building Dialogs to convert:")
 F GBL="AUTTIMM(","AUTTSK(" D FINDDIAL^PXRMDRVI(GBL,.DARRAY)
 D MES^XPDUTL("Converting Dialogs:")
 S ACTION=0 F  S ACTION=$O(DARRAY(ACTION)) Q:ACTION'>0  D
 .S DIEN=0 F  S DIEN=$O(DARRAY(ACTION,DIEN)) Q:DIEN'>0  D
 ..D ACT(DIEN,ACTION)
 Q
 ;
FINDINGS(DIEN) ;
 N FIND,NUM,TEMP
 D MES^XPDUTL("  removing findings")
 S FIND=$P($G(^PXRMD(801.41,DIEN,1)),U,5)
 I FIND'["AUTTIMM",FIND'["AUTTSK",FIND'["PXD(811.2" D DELDATA(DIEN,15)
 S FIND="" F  S FIND=$O(^PXRMD(801.41,DIEN,3,"B",FIND)) Q:FIND=""  D
 .I FIND'["AUTTIMM",FIND'["AUTTSK",FIND'["PXD(811.2" D
 ..S NUM=$O(^PXRMD(801.41,DIEN,3,"B",FIND,""))
 ..S TEMP(NUM)=FIND
 S NUM=0 F  S NUM=$O(TEMP(NUM)) Q:NUM'>0  D
 .D DELDATA(DIEN,18,NUM)
 Q
 ;
PROMPT(DIEN) ;
 N CIEN,DATA,ISIMMPMPT,IMMSER,NUM,TEMP
 D MES^XPDUTL("  removing prompts")
 S IMMSER=+$O(^PXRMD(801.42,"B","IMM_SER",""))
 S CIEN=0 F  S CIEN=$O(^PXRMD(801.41,DIEN,10,"D",CIEN)) Q:CIEN'>0  D
 .S DATA=$$DETAIL^PXRMDRVI(CIEN) I "PF"[$P(DATA,U,2) D
 ..S ISIMMPMPT=0
 ..I $P(DATA,U,2)="F" D
 ...I IMMSER>0,+$P($G(^PXRMD(801.41,CIEN,46)),U),+$P($G(^PXRMD(801.41,CIEN,46)),U)=IMMSER S ISIMMPMPT=1
 ..I ISIMMPMPT=1 Q
 ..S NUM=$O(^PXRMD(801.41,DIEN,10,"D",CIEN,"")) S TEMP(NUM)=CIEN
 S NUM=0 F  S NUM=$O(TEMP(NUM)) Q:NUM'>0  D
 .D DELDATA(DIEN,10,NUM)
 Q
 ;