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

EASEZFM.m

Go to the documentation of this file.
  1. EASEZFM ;ALB/jap,TM - Filing 1010EZ Data to Patient Database ; 3/13/09 4:51pm
  1. ;;1.0;ENROLLMENT APPLICATION SYSTEM;**1,93**;Mar 15, 2001;Build 2
  1. ;
  1. QUE ;entry point from queued background job
  1. ;
  1. ;check signature verification before continuing
  1. K ^TMP("1010EZERROR",$J)
  1. Q:'$G(EASAPP)
  1. Q:'$D(^EAS(712,EASAPP,0))
  1. S EASEZNEW=$P(^EAS(712,EASAPP,0),U,11)
  1. S X=$G(^EAS(712,EASAPP,1))
  1. ;recheck signature status
  1. I ('$P(X,U,1))&('$P(X,U,2)) D RESET Q
  1. ;
  1. L +^EAS(712,EASAPP):60 I '$T D RESET Q
  1. ;check incoming data
  1. D CHECK
  1. ;
  1. ;get EZ1010 data into ^TMP("EZDATA" array
  1. D EN^EASEZC1(EASAPP,.EASDFN)
  1. ;
  1. ;store file #2 data
  1. L +^DPT(EASDFN):60 I '$T D RESET Q
  1. D F2^EASEZF1(EASAPP,EASDFN)
  1. L -^DPT(EASDFN)
  1. ;
  1. ;store file #408.12, #408.13, #408.21, #408.22 data
  1. D F408^EASEZF2(EASAPP,EASDFN)
  1. ;
  1. ;store file #355.33 data;
  1. ;call IB API to file health insurance and Medicare data
  1. D IBINS^EASEZF5(EASAPP,EASDFN)
  1. ;
  1. ;update 'new patient' remark
  1. I EASEZNEW D
  1. .S REM="New Patient record added by ELECTRONIC 10-10EZ."
  1. .S DA=EASDFN,DIE="^DPT(",DR=".091///^S X=REM"
  1. .D ^DIE
  1. ;update processing status if not already done
  1. I $P($G(^EAS(712,EASAPP,2)),U,5)="" D SETDATE^EASEZU2(EASAPP,"FIL")
  1. ;remove the task id
  1. S $P(^EAS(712,EASAPP,2),U,11)=""
  1. L -^EAS(712,EASAPP)
  1. I $D(^TMP("1010EZERROR",$J)) D MAILERR
  1. S ZTREQ="@"
  1. Q
  1. ;
  1. CHECK ;check data
  1. ;returns '0' if any invalid data found; otherwise '1'
  1. N SUBIEN,X,CHK,DIK,DA
  1. ;remove any 'noise' from incoming data
  1. S SUBIEN=0 F S SUBIEN=$O(^EAS(712,EASAPP,10,SUBIEN)) Q:+SUBIEN=0 D
  1. .S CHK=$P($G(^EAS(712,EASAPP,10,SUBIEN,1)),U,1)
  1. .I (CHK="/")!(CHK="//")!(CHK="-")!(CHK="--")!(CHK=" ")!(CHK="") D
  1. ..S DA=SUBIEN,DA(1)=EASAPP,DIK="^EAS(712,"_DA(1)_",10,"
  1. ..D ^DIK
  1. Q
  1. ;
  1. CLEAN ; cleanup
  1. K ^TMP("EZDATA",$J),^TMP("EZINDEX",$J),^TMP("EZTEMP",$J),^TMP("EZDISP",$J)
  1. Q
  1. ;
  1. MAILERR ;notify user if any data elements failed FM validator
  1. ;
  1. N XMY,XMSUB,XMDUZ,XMTEXT,Y
  1. ;fill-in first 6 lines of message
  1. S ^TMP("1010EZERROR",$J,1,0)="Errors were returned by the FileMan validator when filing 1010EZ"
  1. S ^TMP("1010EZERROR",$J,2,0)="data for --"
  1. S ^TMP("1010EZERROR",$J,3,0)="Applicant: "_$P($G(^EAS(712,EASAPP,0)),U,4)
  1. S ^TMP("1010EZERROR",$J,4,0)="Application #: "_EASAPP
  1. S Y=DT D DD^%DT
  1. S ^TMP("1010EZERROR",$J,5,0)="Filing Date: "_Y
  1. S ^TMP("1010EZERROR",$J,6,0)=" "
  1. ;setup call to MailMan
  1. S XMSUB="EAS 1010EZ Error Report for APP #"_EASAPP,XMDUZ=.5
  1. S XMY(DUZ)=""
  1. S XMTEXT="^TMP(""1010EZERROR"",$J,"
  1. D ^XMD
  1. K ^TMP("1010EZERROR",$J)
  1. Q
  1. ;
  1. RESET ;remove filing date if can't continue
  1. S FDT=$P(^EAS(712,EASAPP,2),U,5),$P(^EAS(712,EASAPP,2),U,5)=""
  1. S $P(^EAS(712,EASAPP,2),U,6)="",$P(^EAS(712,EASAPP,2),U,11)=""
  1. I FDT K ^EAS(712,"FIL",FDT,EASAPP)
  1. D APPINDEX^EASEZU2(EASAPP)
  1. Q