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

PXRMTMED.m

Go to the documentation of this file.
  1. PXRMTMED ; SLC/PKR/PJH - Edit a reminder term. ;05/27/2014
  1. ;;2.0;CLINICAL REMINDERS;**1,4,6,12,26**;Feb 04, 2005;Build 404
  1. ;
  1. ;=======================================================
  1. N CS1,CS2,DA,DIC,DLAYGO,DTOUT,DUOUT,Y
  1. GETNAME ;Get the name of the term to edit.
  1. K DA,DIC,DLAYGO,DTOUT,DUOUT,Y
  1. S DIC="^PXRMD(811.5,"
  1. S DIC(0)="AEMQL"
  1. S DIC("A")="Select Reminder Term: "
  1. S DLAYGO=811.5
  1. ;Set the starting place for additions.
  1. D SETSTART^PXRMCOPY(DIC)
  1. W !
  1. D ^DIC
  1. I ($D(DTOUT))!($D(DUOUT)) Q
  1. I Y=-1 G END
  1. S DA=$P(Y,U,1)
  1. S CS1=$$FILE^PXRMEXCS(811.5,DA)
  1. D EDIT(DIC,DA)
  1. I $G(DA)="" G GETNAME
  1. S CS2=$$FILE^PXRMEXCS(811.5,DA)
  1. I CS2=0 G GETNAME
  1. I CS2'=CS1 D SEHIST^PXRMUTIL(811.5,DIC,DA)
  1. G GETNAME
  1. END ;
  1. Q
  1. ;
  1. ;=======================================================
  1. CLASS(DA,DIE) ;
  1. N DR,RESULT,X,Y
  1. RETRY W !
  1. S DR="100" D ^DIE I $D(Y) Q
  1. ;Sponsor
  1. S DR="101" D ^DIE I $D(Y) Q
  1. ;Make sure Class and Sponsor Class are in synch.
  1. S RESULT=$$VSPONSOR^PXRMINTR(X)
  1. I RESULT=0 S DIE("NO^")="Other value" G RETRY
  1. I RESULT=1 K DIE("NO^")
  1. ;Review date, Usage
  1. S DR="102;1" D ^DIE I $D(Y) Q
  1. Q
  1. ;
  1. ;=======================================================
  1. EDIT(ROOT,DA) ;
  1. N CLASS,DIC,DIE,DR,DIDEL,PXRMTMD,RESULT,TCONT,Y
  1. ;PXRMTMD is set by a xref on the .01 as a flag that the entire
  1. ;entry is being deleted.
  1. S CLASS=$P($G(^PXRMD(811.5,DA,100)),U,1)
  1. S DIE=ROOT
  1. I CLASS'="N"!(($G(PXRMINST)=1)&($G(DUZ(0))="@")) D
  1. . S DR=".01"
  1. . D ^DIE
  1. . I $G(DA)'="" D CLASS(DA,DIE)
  1. I $G(DA)="" Q
  1. S TCONT=1
  1. F D FINDING(ROOT,DA) Q:TCONT=0
  1. Q
  1. ;
  1. ;=======================================================
  1. FINDING(DIE,DA) ;
  1. N CFIEN,GLOB,IEN,LIST,NODE,TERMSTAT,VF,WPIEN
  1. N DEF,DEF1,DEF2,STATUS
  1. S DIE("NO^")="OUTOK"
  1. S STATUS=0
  1. D DEF^PXRMRUTL("811.52",.DEF,.DEF1,.DEF2)
  1. S NODE="^PXRMD(811.5)"
  1. D LIST^PXRMREDT(NODE,DA,.DEF1,.LIST)
  1. D DSPALL^PXRMREDF("T",NODE,DA,.LIST)
  1. S DA(1)=DA
  1. S IEN=DA
  1. S DIC=DIE_DA(1)_",20,"
  1. S DIC(0)="QEAL"
  1. S DIC("A")="Select Finding: "
  1. D ^DIC I Y=-1 S DTOUT=1,TCONT=0 Q
  1. S DIE=DIC
  1. S DA=+Y,GLOB=$P($P(Y,U,2),";",2) Q:GLOB=""
  1. I GLOB="PXRMD(811.4," S CFIEN=$P($P(Y,U,2),";",1) D
  1. . I $D(^PXRMD(811.4,CFIEN,1))>0 D
  1. .. W !!,"Computed Finding Description:" S WPIEN=0
  1. .. F S WPIEN=$O(^PXRMD(811.4,CFIEN,1,WPIEN)) Q:+WPIEN'>0 D
  1. ... W !,$G(^PXRMD(811.4,CFIEN,1,WPIEN,0))
  1. . E W !!,"No description defined for this computed finding"
  1. . W !
  1. I GLOB="YTT(601.71," D WARN^PXRMMH
  1. W !,"Editing Finding Number: "_$G(DA)
  1. ;Finding record fields
  1. S DR=".01;9;12;17"
  1. I GLOB="PXRMD(811.4," S DR=DR_";26"
  1. ;Taxonomy - use inactive problems
  1. I GLOB="PXD(811.2," D
  1. .S TERMSTAT=$$TAXNODE^PXRMSTA1($P($P(Y,U,2),";"))
  1. .I TERMSTAT="P" S DR=DR_";10" Q
  1. .I TERMSTAT'=0 S DR=DR_";10",STATUS=1
  1. ;Health Factor - within category rank
  1. I GLOB="AUTTHF(" S DR=DR_";11"
  1. ;If V file INCLUDE VISIT DATA
  1. S VF=$S(GLOB["AUTTEDT":1,GLOB["AUTTEXAM":1,GLOB["AUTTHF":1,GLOB["AUTTIMM":1,GLOB="AUTTSK":1,GLOB["PXD(811.2":1,1:0)
  1. I VF S DR=DR_";28"
  1. ;Mental Health - scale
  1. I GLOB="YTT(601.71," S DR=DR_";13"
  1. ;Radiology procedure
  1. I GLOB="RAMIS(71," S STATUS=1
  1. ;Orderable item
  1. I GLOB="ORD(101.43," S DR=DR_";27",STATUS=1
  1. ;Rx Type
  1. I GLOB="PSDRUG("!(GLOB="PS(50.605,")!(GLOB="PSNDF(50.6,") S DR=DR_";16;27",STATUS=1
  1. ;Condition
  1. S DR=DR_";14;15;18"
  1. ;
  1. ;Edit finding record
  1. D ^DIE
  1. I STATUS=1,$D(DA)>0,$D(Y)=0 D STATUS^PXRMSTA1(.DA,"T")
  1. S $P(^PXRMD(811.5,IEN,20,0),U,3)=0
  1. Q
  1. ;