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

ABMUEAPI.m

Go to the documentation of this file.
  1. ABMUEAPI ; IHS/SD/SDR - 3PB/UFMS API
  1. ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
  1. ;
  1. ; New routine - v2.5 p12 SDD item 4.5
  1. ; Checks entries in exclusion table (9002274.44)
  1. ; BILL tag will return YES/NO if bill should be included or not
  1. ;
  1. BILL(ABMDUZ,ABMBIEN) ;PEP - Checks if bill should be send to UFMS based on
  1. ; exclusion table entries
  1. ; ABMDUZ = DUZ(2) for 3P Bill file
  1. ; ABMBIEN = 3P IEN
  1. ;
  1. ; Returns:
  1. ; -1 - Lookup of bill fails
  1. ; 0 - NO
  1. ; 1 - YES
  1. N ABMBVLOC,ABMDADT,ABMBCLN,ABMIIEN,ABMBITYP
  1. N ABMEDM,ABMTEFDT,ABMTENDT,ABMTCLN,ABMTITYP,ABMTCLN
  1. S ABMINC=1 ;default to yes
  1. ;get Bill info
  1. I +$G(ABMBIEN)=0 S ABMINC="-1" Q ABMINC ;quit w/fail if no bill found
  1. I +$G(ABMDUZ)=0 S ABMINC="-1" Q ABMINC ;quit w/fail if no DUZ(2) sent
  1. I $G(^ABMDBILL(ABMDUZ,ABMBIEN,0))="" S ABMINC="-1" Q ABMINC
  1. S ABMBVLOC=$P($G(^ABMDBILL(ABMDUZ,ABMBIEN,0)),U,3)
  1. S ABMBADT=$P($G(^ABMDBILL(ABMDUZ,ABMBIEN,1)),U,5)
  1. S ABMBCLN=$P($G(^ABMDBILL(ABMDUZ,ABMBIEN,0)),U,10)
  1. S ABMIIEN=$P($G(^ABMDBILL(ABMDUZ,ABMBIEN,0)),U,8)
  1. S ABMBITYP=$P($G(^AUTNINS(ABMIIEN,2)),U)
  1. ;get table info and compare
  1. I '$D(^ABMUXCLD(ABMBVLOC)) Q ABMINC ;quit if no entries for location
  1. S ABMEDM=0
  1. F S ABMEDM=$O(^ABMUXCLD(ABMBVLOC,1,ABMEDM)) Q:+ABMEDM=0 D
  1. .S ABMTEFDT=$P($G(^ABMUXCLD(ABMBVLOC,1,ABMEDM,0)),U) ;effective date
  1. .S ABMTENDT=$P($G(^ABMUXCLD(ABMBVLOC,1,ABMEDM,0)),U,2) ;end date
  1. .I (ABMBADT>ABMTEFDT) D
  1. ..I ABMTENDT=""!(ABMTENDT'=""&((ABMBADT<ABMTENDT))) D ;bill approved during table entry dates
  1. ...S ABMTCLN=$P($G(^ABMUXCLD(ABMBVLOC,1,ABMEDM,0)),U,3) ;clinic
  1. ...S ABMTITYP=$P($G(^ABMUXCLD(ABMBVLOC,1,ABMEDM,0)),U,4) ;insurer type
  1. ...I ABMTCLN'="",(ABMTITYP'=""),(ABMTCLN=ABMBCLN),(ABMBITYP=ABMTITYP) S ABMINC=0
  1. ...I ABMTCLN'="",(ABMTITYP=""),(ABMTCLN=ABMBCLN) S ABMINC=0
  1. ...I ABMTCLN="",(ABMTITYP'=""),(ABMTITYP=ABMBITYP) S ABMINC=0
  1. ;
  1. Q ABMINC
  1. ;
  1. TRANSMIT(ABMDUZ,ABMBDFN) ;PEP - Checks if bill has previously been transmitted
  1. ; to UFMS
  1. ; ABMDUZ = DUZ(2) for 3P Bill file
  1. ; BDFN = 3P IEN
  1. ;
  1. ; Returns:
  1. ; -1 - Lookup of bill fails
  1. ; 0 - NO - has not been sent
  1. ; # - YES - has been sent (returns invoice number it was sent with
  1. ;
  1. S ABMINC=0 ;default to no
  1. ;get Bill info
  1. I +$G(ABMBDFN)=0 S ABMINC="-1" Q ABMINC ;quit w/fail if no bill found
  1. I '$D(^ABMDBILL(ABMDUZ,ABMBDFN,69,0)) Q ABMINC ;NO entry in 69 multiple
  1. S ABMXMIT=9999999999
  1. F S ABMXMIT=$O(^ABMDBILL(ABMDUZ,ABMBDFN,69,ABMXMIT),-1) Q:+ABMXMIT=0 D Q:(+ABMINC'=0)
  1. .I +$P($G(^ABMDBILL(ABMDUZ,ABMBDFN,69,ABMXMIT,0)),U,3)=0 D
  1. ..S ABMINC=$P($G(^ABMDBILL(ABMDUZ,ABMBDFN,69,ABMXMIT,0)),U,2)
  1. Q ABMINC
  1. APPRDTTM(ABMDUZ2,ABMBIEN) ;PEP - returns bill date/time approved field
  1. ; 9002274.4, .15
  1. Q $P($G(^ABMDBILL(ABMDUZ2,ABMBIEN,1)),U,5)