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

DGPTAE04.m

Go to the documentation of this file.
  1. DGPTAE04 ;ALB/MTC/ADL - 401 Edit Checks Cont ; 13 NOV 92
  1. ;;5.3;Registration;**510,744,1015**;Aug 13, 1993;Build 21
  1. ;;ADL;Updated for CSV Project;;Mar 24, 2003
  1. ;
  1. TRAN ;-- verify transplant status
  1. I " 12"'[DGPT40PT S DGPTERC=417
  1. Q
  1. ;
  1. CHIEF ;
  1. N FLAG,I
  1. Q:"VMN"[DGPTSCS
  1. I "1234567"'[DGPTSCS S DGPTERC=407 Q
  1. S FLAG=1 F I=10,11,30,40,42 I DGPTSTTY["^"_I_"^" S FLAG=0 Q
  1. S:FLAG DGPTERC=407
  1. Q
  1. FAST ;
  1. N FLAG,I
  1. Q:DGPTSFA=" "
  1. S FLAG=0 F I=20:1:26 I DGPTSTTY["^"_I_"^" S FLAG=1,DGPTSFA=" " Q
  1. I FLAG Q
  1. I "12345678"'[DGPTSFA S DGPTERC=408 Q
  1. Q
  1. ANES ;
  1. N FLAG,I
  1. Q:DGPTSAT=" "
  1. S FLAG=0 F I=20:1:26 I DGPTSTTY["^"_I_"^" S FLAG=1,DGPTSAT=" " Q
  1. I FLAG Q
  1. I "0123456789RX"'[DGPTSAT S DGPTERC=409 Q
  1. S DGPTERC=409 F I=10,11,30,40,42 I DGPTSTTY["^"_I_"^" S DGPTERC=0 Q
  1. Q
  1. ;
  1. FIRST ;-- Edit surgeries - present in ICD0 OPERATIONS, current, gender ok
  1. ;
  1. I (+DGPTSO1=1371)!(+DGPTSO1=39610)!(+DGPTSO1=39611)!(+DGPTSO1=39612) S DGPTERC=450 D ERR G:DGPTEDFL EXIT
  1. LOOP ;
  1. F DGPTL3=1:1:5 S DGPTERC=0 D CHKOPC I DGPTERC D ERR G:DGPTEDFL EXIT
  1. Q
  1. CHKOPC ;
  1. S DGPTOC=(@("DGPTSO"_DGPTL3)),DGPTOC=$P(DGPTOC," ",1) Q:DGPTOC=""
  1. S DGPTERC=410+DGPTL3
  1. S DGPTOC=$E(DGPTOC_" ",1,2)_"."_$E(DGPTOC,3,7)
  1. I $D(^ICD0("AB",DGPTOC)) S DGPTERC=0 D GEN Q
  1. Q
  1. GEN ;
  1. S DGPTOPP=$O(^ICD0("AB",DGPTOC,0)) I DGPTOPP="" S DGPTERC=451 Q
  1. S DGPTTMP=$$ICDOP^ICDCODE(DGPTOPP,$S($G(DGPTSDD)'="":DGPTSDD,1:DT)) ;use date of surgery from rec if it exists, else today
  1. ; DG*744 - check against discharge date
  1. ;I DGPTTMP=-1!('$P(DGPTTMP,U,10)) S DGPTERC=451 Q
  1. I DGPTTMP=-1!('$P(DGPTTMP,U,10)) S DGPTERC=451 N DGPTDAT S DGPTDAT=+$G(^DGPT(PTF,70)) I DGPTDAT S DGPTTMP=$$ICDOP^ICDCODE(DGPTOPP,DGPTDAT) I $P(DGPTTMP,U,10)=1 S DGPTERC=0
  1. I DGPTERC=451 Q
  1. I $P(DGPTTMP,U,11)]""&(DGPTGEN'=$P(DGPTTMP,U,11)) S DGPTERC=451 Q
  1. CURR ;
  1. S DGPTTMP=$$ICDOP^ICDCODE(DGPTOPP,$S($G(DGPTSDD)'="":DGPTSDD,1:DT)) ;use date of surgery from rec if it exists, else today
  1. I ($P(DGPTTMP,U,10)=0)&($P(DGPTSDD,1,7)>$P(DGPTTMP,U,12)) S DGPTERC=474+DGPTL3 Q
  1. SAVE ;
  1. S @("DGPTSO"_DGPTL3)=DGPTOC
  1. ARRAY ;
  1. S DGPTOPAR(DGPTSDD)=$S($D(DGPTOPAR(DGPTSDD)):DGPTOPAR(DGPTSDD)_U_DGPTOPP,1:DGPTOPP_U)
  1. Q
  1. EXIT ;
  1. K DGPTL3,DGPTOC,DGPTOC1,DGPTOPP
  1. Q
  1. ERR ;
  1. D WRTERR^DGPTAE(DGPTERC,NODE,SEQ)
  1. Q