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

ABSPES01.m

Go to the documentation of this file.
  1. ABSPES01 ; IHS/FCS/DRS - JWS 03:55 PM 28 Sep 1995 ; [ 09/12/2002 10:03 AM ]
  1. ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
  1. ;----------------------------------------------------------------------
  1. ;----------------------------------------------------------------------
  1. ;Claim Submission Record List
  1. ;
  1. ;Parameters:
  1. ; BITEMIEN - Billing Item IEN (# 9002313.02)
  1. ; GROOT - Global root of resulting list (eg: "^LIST2($J")
  1. ;
  1. ;Returns:
  1. ;
  1. ;----------------------------------------------------------------------
  1. Q
  1. EN1(BITEMIEN,GROOT) ;EP - from ABSPECZ2
  1. ;Manage local variables
  1. N DA,DA2,COUNT,DATA,CLAIMID,SENTON,VCPTIEN,VMEDIEN,DRUGIEN,QTY
  1. N DRUGNAME,RS,RDA,RXIEN,RXRFIEN,N57
  1. ;
  1. ;Make sure input variables are defined
  1. Q:$G(BITEMIEN)=""
  1. Q:$G(GROOT)=""
  1. ;
  1. K @(GROOT_")")
  1. S (COUNT,DA)=0
  1. F D Q:'+DA
  1. .S DA=$O(^ABSPC("AC",BITEMIEN,DA))
  1. .Q:'+DA
  1. .S DATA=$G(^ABSPC(DA,0))
  1. .S CLAIMID=$$LJBF^ABSPOSU9($P(DATA,U,1),16)
  1. .S SENTON=$$FM2EXT^ABSPOSU1($P($P(DATA,U,5),".",1))
  1. .S SENTON=$$LJBF^ABSPOSU9($S(SENTON="":"<Not Sent>",1:SENTON),11)
  1. .S DA2=0
  1. .F D Q:'+DA2
  1. ..S DA2=$O(^ABSPC(DA,400,DA2))
  1. ..Q:'+DA2
  1. ..S RDA=$O(^ABSPR("B",DA,""))
  1. ..S RS=$S(RDA="":"",1:$P($G(^ABSPR(RDA,1000,DA2,500)),U,1))
  1. ..S RS=$$RJBF^ABSPOSU9(RS,2)
  1. ..S VCPTIEN=$P($G(^ABSPC(DA,400,DA2,0)),U,2)
  1. ..S VMEDIEN=$S(VCPTIEN="":"",1:$P($G(^ABSVCPT(9002301,VCPTIEN,"SPEC")),U,2))
  1. ..I VCPTIEN="" S (RXIEN,RXRFIEN,N57)=""
  1. ..E D
  1. ...N X S X=$G(^ABSVCPT(9002301,VCPTIEN,"SPEC"))
  1. ...S RXIEN=$P(X,U),RXRFIEN=$P(X,U,3),N57=$P(X,U,4)
  1. ..S DRUGIEN=$S(VMEDIEN="":"",1:$P($G(^AUPNVMED(VMEDIEN,0)),U,1))
  1. ..I DRUGIEN="",RXIEN]"" S DRUGIEN=$P($G(^PSRX(RXIEN,0)),U,6)
  1. ..S QTY=$S(VMEDIEN="":"",1:$P($G(^AUPNVMED(VMEDIEN,0)),U,6))
  1. ..I QTY="",RXIEN]"" D
  1. ...I RXRFIEN S QTY=$P($G(^PSRX(RXIEN,1,RXRFIEN,0)),U,4)
  1. ...E S QTY=$P($G(^PSRX(RXIEN,0)),U,7)
  1. ..S QTY=$$RJBF^ABSPOSU9(QTY,4)
  1. ..S DRUGNAME=$S(DRUGIEN="":"Undefined",1:$P($G(^PSDRUG(DRUGIEN,0)),U,1))
  1. ..S DRUGNAME=$$LJBF^ABSPOSU9(DRUGNAME,29)
  1. ..S COUNT=COUNT+1
  1. ..S @(GROOT_",COUNT,""I"")")=DA_U_DA2_U_RDA
  1. ..S @(GROOT_",COUNT,""E"")")=CLAIMID_" "_SENTON_" "_RS_" "_DRUGNAME_" "_QTY
  1. S @(GROOT_",""Column Headers"")")="2|Claim ID:16,Date Sent:11,RS:2,Medication NAME:29,QTY:4"
  1. S @(GROOT_",0)")=COUNT
  1. Q