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

ABMECS2.m

Go to the documentation of this file.
  1. ABMECS2 ; IHS/ASDST/DMJ - ELECTRONIC CLAIMS SUBMISSION ;
  1. ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
  1. ;Original;DMJ;01/02/96 4:18 PM
  1. ;
  1. ; IHS/ASDS/DMJ - 03/01/01 - V2.4 P5 - NOIS HQW-0301-100010
  1. ; Modified to accommodate new Envoy electronic format
  1. ;
  1. ; This routine is called from the EMC Create a Batch Menu option.
  1. ; It will show you a summary of bills ready to export grouped by
  1. ; bill type and export type. The user is asked to select one
  1. ; group. An entry is then made in 3P TX STATUS file and a file
  1. ; is created in unix as specified by the user.
  1. ;
  1. START ;
  1. K ABME,ABMER
  1. ; Display summary of bills ready to export and ask user to select
  1. ; one group. The ABMER array and ABMSEQ are undefined going into
  1. ; EMCREAT^ABMECDSP but are needed upon return.
  1. D EMCREAT^ABMECDSP(.ABMER,.ABMSEQ)
  1. Q:'+ABMSEQ ; Quit if no group selected.
  1. S DIR(0)="Y"
  1. S DIR("A")="Proceed"
  1. S DIR("B")="YES"
  1. D ^DIR
  1. K DIR
  1. I Y'=1 K ABME Q
  1. D FILE ; Make entry in 3P TX STATUS and create a file
  1. S DIR(0)="E"
  1. D ^DIR
  1. K DIR
  1. K ABMER,ABMP,ABMSEQ
  1. Q
  1. ;
  1. FILE ;
  1. ; File bills to 3P TX STATUS FILE
  1. S ABMINS("IEN")=$P(ABMER(ABMSEQ),U) ; Active Insurer IEN
  1. S ABMITYP=$P(^AUTNINS(ABMINS("IEN"),2),U) ; Insurance type
  1. S ABMBTYPE=$P(ABMER(ABMSEQ),U,2) ; Bill type
  1. ; Loop through locations in TMP global created by EMCREAT^ABMECDSP
  1. S ABMLOC=""
  1. F S ABMLOC=$O(^TMP($J,"D",ABMINS("IEN"),ABMLOC)) Q:ABMLOC="" D
  1. .Q:$D(^TMP($J,"D",ABMINS("IEN"),ABMLOC,ABMBTYPE))<2
  1. .D NEWB ; Create a new batch in 3P TX STATUS
  1. .I $G(Y)<0 D MSG^ABMERUTL("Could not enter batch in 3P TX STATUS file.") Q
  1. .; Add bill to detail in 3P TX STATUS for this batch
  1. .S ^ABMDTXST(DUZ(2),DA(1),2,0)="^9002274.61P^^"
  1. .S DIC="^ABMDTXST(DUZ(2),DA(1),2,"
  1. .S DIC(0)="LXNE"
  1. .S ABMDA=0
  1. .F S ABMDA=$O(^TMP($J,"D",ABMINS("IEN"),ABMLOC,ABMBTYPE,ABMEXP,ABMDA)) Q:'+ABMDA D
  1. ..S X=ABMDA
  1. ..K DD,DO D FILE^DICN
  1. ..Q:+Y<0
  1. ..S ABMAPRV=$O(^ABMDBILL(DUZ(2),ABMDA,41,"C","A",0))
  1. ..Q:'ABMAPRV
  1. ..S ABMAPRV=$P(^ABMDBILL(DUZ(2),ABMDA,41,ABMAPRV,0),U)
  1. ..S DA=+Y
  1. ..S DIE=DIC
  1. ..S DR=".02///`"_ABMAPRV
  1. ..D ^DIE
  1. .; Write record (Create EMC unix file)
  1. .D @("^ABMEF"_$P(ABMER(ABMSEQ),U,3))
  1. Q
  1. ;
  1. NEWB ;
  1. ; Create a new batch (Make entry in 3P TX STATUS)
  1. H 1
  1. D NOW^%DTC
  1. S X=%
  1. S DIC="^ABMDTXST(DUZ(2),"
  1. S DIC(0)="LX"
  1. D ^DIC
  1. Q:Y<0
  1. S ABMP("XMIT")=+Y
  1. S DIE=DIC
  1. S DA=+Y
  1. S DR=".02///"_$P(ABMER(ABMSEQ),U,3)_";.04///`"_ABMINS("IEN")_";.03///"_ABMITYP_";.05////"_DUZ_";.09///"_$P(ABMER(ABMSEQ),U,4)_";.11///"_$J($P(ABMER(ABMSEQ),U,5),1,2)
  1. D ^DIE
  1. S DA(1)=DA
  1. W !,"ENTRY CREATED IN 3P TX STATUS FILE."
  1. W !,"LOCATION: ",ABMLOC
  1. W !,"BILL TYPE: ",ABMBTYPE,!
  1. Q