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

DPTDZCMD.m

Go to the documentation of this file.
  1. DPTDZCMD ; IHS/TUCSON/JCM - Check merge direction ;
  1. ;;1.0;PATIENT MERGE;;FEB 02, 1994
  1. ;
  1. ;this routine is executed after the user selects a merge direction
  1. ;for the pair of duplicate records. It is IHS specific.
  1. START ;
  1. Q:$D(ZTQUEUED) ;quit if in background
  1. Q:$D(XDRM("AUTO")) ;quit if automatic merge is on
  1. Q:'$D(XDRFL) ;quit it file variable does not exist
  1. Q:XDRFL'=2 ;quit if file not VA PATIENT
  1. S DPTDZCMD("X")=X
  1. I $G(XDRCD)]"" S DPTDZCMD("TO")=$S(X=2:XDRCD,1:XDRCD2),DPTDZCMD("FROM")=$S(X=2:XDRCD2,1:XDRCD)
  1. I $G(XDRMCD)]"" S DPTDZCMD("TO")=$S(X=2:XDRMCD,1:XDRMCD2),DPTDZCMD("FROM")=$S(X=2:XDRMCD2,1:XDRMCD)
  1. S DPTDZCMD("RPMS SITE")=+^AUTTSITE(1,0)
  1. I '$D(^AUPNPAT(DPTDZCMD("TO"),41,DPTDZCMD("RPMS SITE"))),$D(^AUPNPAT(DPTDZCMD("FROM"),41,DPTDZCMD("RPMS SITE"))) D
  1. .W !!,$C(7),$C(7),"The FROM patient you have selected has a chart at ",$P(^DIC(4,DPTDZCMD("RPMS SITE"),0),U)
  1. .W !,"and the TO or TARGET patient does not. The general rule is that when one",!,"patient has a chart at your site and the other does not, that you merge into",!,"the patient with a chart at your site."
  1. .S DPTDZCMD("WARNING")=""
  1. .Q
  1. I $D(^AUPNPAT(DPTDZCMD("TO"),41,DPTDZCMD("RPMS SITE"),0)),'$E($P(^AUPNPAT(DPTDZCMD("TO"),41,DPTDZCMD("RPMS SITE"),0),U,2)) D
  1. .W !!,$C(7),$C(7),"The TO or TARGET patient has a Temporary chart number!!","The general rule is to merge FROM a patient with a temporary number.",!
  1. .S DPTDZCMD("WARNING")=""
  1. I $D(DPTDZCMD("WARNING")) D CONFIRM
  1. EOJ ;
  1. K DPTDZCMD
  1. Q
  1. CONFIRM ;
  1. W !!,"Are you sure you have selected the correct merge direction (Y/N) N//" R DPTDZCMD("ANS"):DTIME E S DPTDZCMD("ANS")="N"
  1. S:DPTDZCMD("ANS")="" DPTDZCMD("ANS")="N"
  1. I "YyNn"'[$E(DPTDZCMD("ANS")) W " Please re-enter a Y or N",$C(7) G CONFIRM
  1. Q:"Yy"[$E(DPTDZCMD("ANS"))
  1. K X,Y
  1. Q