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

DGPT101.m

Go to the documentation of this file.
DGPT101 ;ALB/MTC,HIOFO/FT - 101/701 Austin Edit Checks ;2/2/15 10:40am
 ;;5.3;Registration;**8,164,180,247,415,678,696,884**;Aug 13, 1993;Build 31
 ;
 ;no external references
 ;
EN ;
 S (DGPTFEF,DGPTERC)=0
101 ;-- process 101+701 data
 N ERROR
 ;
PARSE ;Set up record string, Call routine to parse record
 S DGPTSTR=^TMP("AEDIT",$J,NODE,SEQ)
 D SET^DGPT101P
 D NOW^%DTC S DGPTTY=(17+$E(X,1))_$E(X,2,3)
701 ;PROCESS 701
 S DGPTAL7=$O(^TMP("AEDIT",$J,"N701",SEQ)) I DGPTAL7="" S DGPTFEF=1 Q
 D SET^DGPT701 I DGPTFEF Q
SET ; Start error piece, flags
 S DGPTEDFL=0,DGPTSTR=^TMP("AEDIT",$J,NODE,SEQ)
SSN ; Start edits 
 I DGPTSSN'?9N!((DGPTPS=" ")&("9"[$E(DGPTSSN))) S DGPTERC=102 D ERR G:DGPTEDFL EXIT
 I " P"'[DGPTPS S DGPTERC=101 D ERR G:DGPTEDFL EXIT
 S DGPTPS=$S(DGPTPS="P":DGPTPS,1:"A")
PSEU ;check for pseudo ssn
 I DGPTPS="P" S DGPTERC=0 D PSE^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
DTE ;admission date
 S X=DGPTDTS,%DT="XT" D ^%DT I Y<0 S DGPTERC=103 D ERR G:DGPTEDFL EXIT
 I Y>0 D DD^%DT S DGPTADT=$E(Y,5,6)_"-"_$E(Y,1,3)_"-"_$E(Y,9,12)_" "_$S($P(Y,"@",2)]"":$E($P(Y,"@",2),1,5),1:"00:00")
 S X1=DGPTNOW,X2=$$FMDT($E(DGPTSTR,15,20)) D ^%DTC I X<0 S DGPTERC=140 D ERR G:DGPTEDFL EXIT
 S DGPTDTS=$$FMDT($E(DGPTSTR,15,20))_"."_$E(DGPTSTR,21,24)
LN ;patient's last name
 I DGPTLN'?1.U." " S DGPTERC=105 D ERR G:DGPTEDFL EXIT
 I DGPTFI'?.U&(DGPTFI'=" ")!((DGPTMI'?1U)&(DGPTMI'=" ")) S DGPTERC=106 D ERR G:DGPTEDFL EXIT
SRA ;source of admission -- may need to add more edits later
 D ^DGPT10S1 I DGPTERC D ERR G:DGPTEDFL EXIT
SRP ;source of payment
 N I
 S DGPTERC=0
 I " 1234"'[DGPTSRP S DGPTERC=109 D ERR G:DGPTEDFL EXIT G POW
 I "1234"[DGPTSRP S DGPTERC=109 F I=20:1:26 I DGPTSTTY[U_I_U S DGPTERC=0 Q
 I DGPTERC D ERR G:DGPTEDFL EXIT
POW ;prisoner of war
 I $L(DGPTPOW)'=1!("123456789AB "'[DGPTPOW) S DGPTERC=110 D ERR G:DGPTEDFL EXIT
MAR ;marital status
 I "MWDUSN"'[DGPTMRS S DGPTERC=111 D ERR G:DGPTEDFL EXIT
GEN ;gender
 I "FM"'[DGPTGEN S DGPTERC=112 D ERR G:DGPTEDFL EXIT
 S DGPTGEN1=$S(DGPTGEN="F":1,1:0)
DOB ;date of birth
 S DGPTERC=0 D DB^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
POS ;period of service
 ;I DGPTPOS1'=" " S ERR=___ D ERR G:DGPTEDFL EXIT ;not used. should always be a space. ft 11/5/14
 S DGPTERC=0 D ^DGPT10CB I DGPTERC D ERR G:DGPTEDFL EXIT
EXP ;agent orange and ionizing radiation
 S DGPTERC=0 D AGO^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
 S DGPTERC=0 D IRAD^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
HOME ;state, county and zip code
 S DGPTERC=0 D STATE^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
 S DGPTERC=0 D CNTY^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
 S DGPTERC=0 D ZIP^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
MT ;means test
 S DGPTERC=0 D MT^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
ERI ;emergency response indicator
 S DGPTERC=0 I ("^K^"'[(U_DGPTERI_U))&(DGPTERI'=" ") S DGPTERC=125 D ERR G:DGPTEDFL EXIT
INCOM ;income
 I DGPTDDS<2911001 G GOOD
 S DGPTERC=0 D INC^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
 ;the following checks are added with dg*5.3*884 and will be active when icd10 is turned on. ft 11/4/14
MST ;military sexual trauma
 I DGPTFMT=3 S DGPTERC=0 D MST^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
CV ;combat veteran
 I DGPTFMT=3 S DGPTERC=0 D CV^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
CVDATE ;combat veteran date
 I DGPTFMT=3 S DGPTERC=0 D CVDATE^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
SHAD ;shipboard hazard and defense
 I DGPTFMT=3 S DGPTERC=0 D SHAD^DGPTAE01 I DGPTERC D ERR G:DGPTEDFL EXIT
GOOD ;
 W:'$D(ERROR) "."
 ;
EXIT ;
 K DGPTREC,DGPTORBD,DGPTLN,DGPTFI,DGPTMI,DGPTMRS,DGPTSTE,DGPTCTY,DGPTZIP,DGPTINC
 K DGPTSRA,DGPTTF,DGPTSRP,DGPTPOS1,DGPTEXA,DGPTEXI,DGPTMTC,DGPTDTD,DGPTDSP,DGPTDTY,DGPTDOP,DGPTDVA,DGPTDPD,DGPTDRF,DGPTDAS,DGPTDCP,DGPTDDXE,DGPTDDXO,DGPTDLR,DGPTDLC,DGPTDSC,DGPTDAGE,DGPTDRG,DGPTSTR
 K DGPT70LG,DGPT70SU,DGPT70DR,DGPT70X4,DGPTDXV1,DGPTDXV2,DGPTMST,DGPTCOMVET,DGPTCOMVETDT,DGPTSHAD
 Q
ERR ;
 D WRTERR^DGPTAE(DGPTERC,NODE,SEQ)
 S ERROR=1
 Q
FMDT(X) ; change to fm date for y2k
 N Y
 D ^%DT
 Q Y