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

PXRMXTE.m

Go to the documentation of this file.
  1. PXRMXTE ; SLC/PJH - Reminder Reports Template Edit ;07/30/2009
  1. ;;2.0;CLINICAL REMINDERS;**4,6,12**;Feb 04, 2005;Build 73
  1. ;
  1. ; Called from PXRMYD,PXRMXD
  1. ;
  1. ;Option to Edit
  1. ;--------------
  1. EDIT ;
  1. N DIDEL,DIE,DR K DTOUT,DUOUT
  1. ;Edit report name, title and PXRMSEL (patient sample)
  1. S DIE=810.1,DA=$P(PXRMTMP,U),DR=".01T;1.9;1.2",DIDEL=810.1
  1. D ^DIE I $D(Y) S DUOUT=1 Q
  1. ;Check if template has been deleted
  1. I '$D(DA) Q
  1. ;Get updated value of PXRMXSEL
  1. N PXRMSEL,PXRMFUT S PXRMSEL=X
  1. ;Needed for 1.6 validation - Prior/Future or Current/Admissions
  1. ;N PXRMINP
  1. ;Further fields depend on value in PXRMXSEL
  1. I PXRMSEL="I" S DR="6T~R",PXRMINP=0
  1. I PXRMSEL="R" S DR="14T",PXRMINP=0
  1. I PXRMSEL="L" D Q:$D(DUOUT)
  1. .;Get location report type
  1. .S DR="3T;1.5R" D ^DIE I $D(Y) S DUOUT=1 Q
  1. .N PXRMLCSC S PXRMLCSC=X,DR="",PXRMINP=0
  1. .;All location reports - prompt for prior/future/current/admissions
  1. .I PXRMLCSC="HAI" S PXRMINP=1,DR="1.6" Q
  1. .I PXRMLCSC="HA" S PXRMINP=0,DR="1.6"
  1. .I PXRMLCSC="CA" S PXRMINP=0,DR="1.6"
  1. .D ^DIE I $D(Y) S DUOUT=1 Q
  1. .S PXRMFUT=X,DR=""
  1. .;Selected Location/Stop Code/Clinic Group fields
  1. .I PXRMLCSC="HS" D Q:$D(DUOUT)
  1. ..S DR="10T~R"
  1. ..D ^DIE I $D(Y) S DUOUT=1 Q
  1. ..;Determine if locations input are all wards
  1. ..S PXRMINP=$$INP^PXRMXAP(PXRMLCSC,.PXRMLOCN)
  1. ..;Select Prior/Future or Current Inpatient/Admissions
  1. ..S DR="1.6"
  1. ..D ^DIE I $D(Y) S DUOUT=1 Q
  1. ..S PXRMFUT=X,DR=""
  1. .;Clinic Stop input and prior/future
  1. .I PXRMLCSC="CS" S PXRMINP=0,DR="11T~R;1.6" D I $G(DUOUT)=1 Q
  1. ..D ^DIE I $D(Y) S DUOUT=1 Q
  1. ..S PXRMFUT=X,DR=""
  1. .;Clinic Group input and prior/future
  1. .I PXRMLCSC="GS" S PXRMINP=0,DR="12T~R;1.6" D I $G(DUOUT)=1 Q
  1. ..D ^DIE I $D(Y) S DUOUT=1 Q
  1. ..S PXRMFUT=X,DR=""
  1. .;Service categories (except for inpatient reports)
  1. .I PXRMINP=0,PXRMFUT'="F",PXRMFUT'="C" S DR=DR_";9T~R"
  1. ;OE/RR teams
  1. I PXRMSEL="O" S DR="7T~R"
  1. ;PCMM Provider and Primary care/All
  1. I PXRMSEL="P" S DR="4T~R;1.3"
  1. ;PCMM teams
  1. I PXRMSEL="T" S DR="3T~R;8T~R"
  1. D ^DIE
  1. ;Report type (detail or summary)
  1. S DR=DR=DR_";1.4"
  1. ;Print Locations without patients and print percentages
  1. S DR=DR_";1.7;1.8"
  1. ;Reminder Categories
  1. I $D(^PXRMPT(810.1,DA,12,0))>0 D
  1. .N IEN,CNT,NODE
  1. .S CNT=0,IEN=0 F S IEN=$O(^PXRMPT(810.1,DA,12,IEN)) Q:IEN'>0 D
  1. ..S CNT=CNT+1,NODE=$G(^PXRMPT(810.1,DA,12,IEN,0))
  1. ..S PXRMTCAT(DA,CNT)=$P(NODE,U)_U_$P($G(^PXRMD(811.7,$P(NODE,U),0)),U)_U_$P(NODE,U,2)
  1. S DR=DR_";13T"
  1. ;Reminders
  1. I $D(^PXRMPT(810.1,DA,1,0))>0 D
  1. .N IEN,CNT,NODE,REMNODE
  1. .S CNT=0,IEN=0 F S IEN=$O(^PXRMPT(810.1,DA,1,IEN)) Q:IEN'>0 D
  1. ..S CNT=CNT+1,NODE=$G(^PXRMPT(810.1,DA,1,IEN,0))
  1. ..S REMNODE=$G(^PXD(811.9,$P(NODE,U),0))
  1. ..S PXRMTREM(DA,CNT)=$P(NODE,U)_U_$P(REMNODE,U)_U_$P(NODE,U,2)_U_$P($G(REMNODE),U,3)
  1. S DR=DR_";2T"
  1. ;
  1. ;Strip of any leading semi-colons
  1. I $E(DR)=";" S DR=$P(DR,";",2,99)
  1. ;
  1. D ^DIE I $D(Y) S DUOUT=1 Q
  1. ;
  1. ;if manager all an owner to be assigned
  1. I $D(^XUSEC("PXRM MANAGER",DUZ)) S DR="15" D ^DIE
  1. ;
  1. ;If all reminders have been deleted from the template disallow save
  1. I +$P($G(^PXRMPT(810.1,DA,1,0)),U,4)=0 D
  1. .;Check categories also
  1. .I +$P($G(^PXRMPT(810.1,DA,12,0)),U,4)>0 D Q
  1. .. N CAT,CATIEN
  1. .. S CAT=0 F S CAT=$O(^PXRMPT(810.1,DA,12,CAT)) Q:+CAT'>0 D
  1. ... S CATIEN=$P($G(^PXRMPT(810.1,DA,12,CAT,0)),U)
  1. ... I +$P($G(^PXRMD(811.7,CATIEN,2,0)),U,4)<1 W !!,"** WARNING **",!,"Reminder Category "_$P($G(^PXRMD(811.7,CATIEN,0)),U)_" does not have any reminders assigned to it"
  1. .S DUOUT=1
  1. .W !!,"No reminders defined"
  1. Q
  1. ;