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

ACHSDOCR.m

Go to the documentation of this file.
  1. ACHSDOCR ; IHS/ITSC/PMF - extract standard vars from 0 level of document [ 10/16/2001 8:16 AM ]
  1. ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
  1. ;
  1. ;standard call to fetch data. Pass in the document IEN, and
  1. ; get back a whole set of vars.
  1. ;
  1. ;INPUT:
  1. ; ACHSDIEN - the index number to the document
  1. ;
  1. ;OUTPUT:
  1. ; ACHSDOCR - the string from ACHSF(fac,"D",ACHSDIEN,0)
  1. ; OK - true if the process completed, otherwise false
  1. ;
  1. ;here are the variables that get returned, in alphabetical order
  1. ;in the software, they are set in the order of the ACHSDOCR string
  1. ;
  1. ; AMTOBLG total amount obligated
  1. ; BLNKT blanket order flag
  1. ; CAN CAN number
  1. ; CANP CAN number pointer
  1. ; CHART chart number
  1. ; CLERK clerk
  1. ; CNTRPTR contract pointer
  1. ; COMMENT comment
  1. ; DCRACCT dcr account number
  1. ; DESTN destination
  1. ; DRGRATE drg rate
  1. ; FAC facility code
  1. ; FSCLYR fiscal year of the doc
  1. ; IHSADJ HIS adjustments
  1. ; LSUP last supplement number
  1. ; LSTCNC last cancel number
  1. ; OCC object class code
  1. ; OCCPTR pointer to object class code
  1. ; ORDDAT order date
  1. ; ORDNUM order number
  1. ; PATNUM patient number
  1. ; SCC service class code
  1. ; SCCP service class code pointer
  1. ; STATUS status
  1. ; TRBPRN tribal purchase request number
  1. ; TRIBE tribal number
  1. ; TYPSER2 type of service encoded as 1/2/3
  1. ; TYPSERV type of service
  1. ; VNAGRPT vendor agreement pointer
  1. ; VNDEST vendor estimate
  1. ; VNDNAM vendor name
  1. ; VNDPTR vendor pointer
  1. ; VNDREF vendor reference number
  1. ;
  1. S OK=0
  1. I $G(ACHSDIEN)="" Q
  1. ;
  1. S ACHSDOCR=$G(^ACHSF(DUZ(2),"D",ACHSDIEN,0))
  1. I ACHSDOCR="" Q
  1. ;
  1. S ORDNUM=$P(ACHSDOCR,U,1)
  1. S ORDDAT=$P(ACHSDOCR,U,2)
  1. S BLNKT=$P(ACHSDOCR,U,3)
  1. S TYPSERV=$P(ACHSDOCR,U,4),TYPSER2=$S(TYPSERV=1:43,TYPSERV=2:57,TYPSERV=3:64,1:" ")
  1. ;
  1. S CNTRPTR=$P(ACHSDOCR,U,5)
  1. ;
  1. S CANP=$P(ACHSDOCR,U,6),CAN="" I CANP'="" S CAN=$P($G(^ACHS(2,CANP,0)),U)
  1. ;
  1. S SCCP=$P(ACHSDOCR,U,7),SCC="" I SCCP'="" S SCC=$P($G(^ACHS(3,DUZ(2),1,SCCP,0)),U)
  1. ;
  1. S VNDPTR=$P(ACHSDOCR,U,8),VNDNAM="" I VNDPTR'="" S VNDNAM=$G(^AUTTVNDR(VNDPTR,0))
  1. ;
  1. S AMTOBLG=$P(ACHSDOCR,U,9)
  1. S OCCPTR=$P(ACHSDOCR,U,10),OCC="" I OCCPTR'="" S OCC=$P($G(^ACHSOCC(OCCPTR,0)),U)
  1. ;
  1. S IHSADJ=$P(ACHSDOCR,U,11)
  1. S STATUS=$P(ACHSDOCR,U,12)
  1. S COMMENT=$P(ACHSDOCR,U,13)
  1. S FSCLYR=$P(ACHSDOCR,U,14)
  1. S LSTSUP=$P(ACHSDOCR,U,15)
  1. S LSTCNC=$P(ACHSDOCR,U,16)
  1. S DESTN=$P(ACHSDOCR,U,17)
  1. S CLERK=$P(ACHSDOCR,U,18)
  1. S DCRACCT=$P(ACHSDOCR,U,19)
  1. S FAC=$P(ACHSDOCR,U,20)
  1. S CHART=$P(ACHSDOCR,U,21)
  1. S (DFN,PATNUM)=$P(ACHSDOCR,U,22)
  1. S TRIBE=" "
  1. I DFN'="" D
  1. . S TRIBE=$P($G(^AUPNPAT(DFN,11)),U,8)
  1. . I TRIBE'="" S TRIBE=$P($G(^AUTTTRI(TRIBE,0)),U,2)
  1. . I TRIBE=""!(TRIBE'?3N) S TRIBE=" "
  1. . Q
  1. ;
  1. S VNAGPTR=$P(ACHSDOCR,U,23)
  1. S VNDREFN=$P(ACHSDOCR,U,24)
  1. S DRGRATE=$P(ACHSDOCR,U,25)
  1. S TRBPRN=$P(ACHSDOCR,U,26)
  1. S OK=1
  1. ;
  1. Q
  1. ;
  1. INIT ;
  1. ;init the vars to null
  1. S (ACHSDOCR,AMTOBLG,BLNKT,CAN,CANP,CHART,CLERK,COMMENT)=""
  1. S (CNTRPTR,FSCLYR,DCRACCT,DESTN,DRGRATE,FAC,IHSADJ,LSTSUP)=""
  1. S (LSTCNC,OCC,OCCPTR,ORDDAT,ORDNUM,PATNUM,SCC,SCCP,STATUS)=""
  1. S (TRBPRN,TRIBE,TYPSER2,TYPSERV,VNAGPTR,VNDEST,VNDPTR,VNDNAM,VNDREFN)=""
  1. Q
  1. ;
  1. KLL ;EP from ACHSTX11
  1. ;kill the vars normally set by this program
  1. K ACHSDORC,AMTOBLG,BLNKT,CAN,CANP,CHART,CLERK,COMMENT
  1. K CNTRPTR,FSCLYR,DCRACCT,DESTN,DRGRATE,FAC,IHSADJ,LSTSUP
  1. K LSTCNC,OCC,OCCPTR,ORDDAT,ORDNUM,PATNUM,SCC,SCCP,STATUS
  1. K TRBPRN,TRIBE,TYPSER2,TYPSERV,VNDEST,VNAGPTR,VNDPTR,VNDNAM,VNDREFN
  1. Q