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

ORWDBA4.m

Go to the documentation of this file.
  1. ORWDBA4 ; SLC/GU Billing Awareness - Phase II [11/26/04 15:44] ;05/23/12 10:37
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**195,243,361**;Dec 17, 1997;Build 39
  1. ;
  1. ;Miscellaneous CIDC functions utility.
  1. ;
  1. ;External References used by this routine
  1. ; $$GETS^DIQ DBIA 2056
  1. ; GETS^DIQ DBIA 2056
  1. ; $$ICDDX^ICDCODE DBIA 3990
  1. ; $$TFGBLGUI^ORWDBA1 DBIA none listed
  1. ; $$SETDXD^ORWDBA2 DBIA none listed
  1. ; $$NOW^XLFDT DBIA 10103
  1. ; $$GET^XPAR DBIA 2263
  1. ;
  1. GETTFCI(Y,ORIEN) ;Get Treatment Factors Clinical Indicators
  1. ;Input Variable:
  1. ; ORIEN Order Internal Entry Number (array variable)
  1. ;Ouput Variable:
  1. ; Y Y(AI)=Order_IEN^Treatment_Factors^ICD9^ICD9_Description
  1. ; There can be up to 4 ICD9 codes and thier descriptions
  1. ; ICD901^DESC01^ICD902^DESC02^ICD903^DESC03^ICD904^DESC04
  1. ;Local Variables:
  1. ; AI Array Index
  1. ; CI Clinical Index
  1. ; TF Treatment Factors
  1. ; TFCI Treatment Factors Clinical Indicators
  1. N AI,CI,CNT,DXS,TF,TFCI
  1. S U="^",(CNT,TF)=""
  1. F S CNT=$O(ORIEN(CNT)) Q:CNT="" D
  1. . S TF=$$GTF(ORIEN(CNT))
  1. . S DXS=$$GDCD(ORIEN(CNT))
  1. . I TF="NNNNNNNN"&(DXS="") Q
  1. . S TFCI(CNT)=ORIEN(CNT)_U_TF_$S(DXS="":"",1:U_DXS)
  1. M Y=TFCI
  1. Q
  1. ;
  1. GTF(IEN) ;Get Treatment Factors
  1. ;Gets the Treatment Factors for the current order converted to the
  1. ;format used by the CPRS GUI display.
  1. ;
  1. ;Input Variable:
  1. ; IEN Internal Entry Number
  1. ;Local Variables:
  1. ; ORTF Order Record Treatment Factors
  1. ; OREM Order Record Error Message
  1. ; OTF Order Treatment Factors
  1. ; (Converted to GUI values and returned)
  1. N ORTF,OREM,OTF
  1. S OTF=""
  1. D GETS^DIQ(100,IEN,"90;91;92;93;94;95;96;98","I","ORTF","OREM")
  1. S OTF=$G(ORTF(100,IEN_",",90,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",91,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",92,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",93,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",94,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",95,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",96,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",98,"I"))
  1. S OTF=$$TFGBLGUI^ORWDBA1(OTF)
  1. I OTF'="NNNNNNNN" Q OTF
  1. S OTF=""
  1. K ORTF,OREM
  1. D GETS^DIQ(100,IEN,"51;52;53;54;55;56;57;58","I","ORTF","OREM")
  1. S OTF=$G(ORTF(100,IEN_",",51,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",52,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",53,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",54,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",55,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",56,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",57,"I"))
  1. S OTF=OTF_U_$G(ORTF(100,IEN_",",58,"I"))
  1. S OTF=$$TFGBLGUI^ORWDBA1(OTF)
  1. Q OTF
  1. ;
  1. GDCD(IEN) ;Get Diagnoses Codes / Description
  1. ;Builds and returns a text string delimited by the "^". The text string
  1. ;made from the ICD9 codes associated with the current order and thier
  1. ;descriptions pulled from the ICD DIAGNOSIS file #80. The string can
  1. ;contain up to four diagnoses codes and thier descriptions. The string
  1. ;with all four possiable diagnoses codes is formatted:
  1. ;ICD901^DESC01^ICD902^DESC02^ICD903^DESC03^ICD904^DESC04
  1. ;
  1. ;Input Variable:
  1. ; IEN
  1. ;Local Variables:
  1. ; DCD Diagnosis Code Description (retrun variable)
  1. ; DXDT Diagnosis Date (either Order date or system date)
  1. ; DXD Diagnosis Description
  1. ; DXIEN Diagnosis Internal Entry Number
  1. ; ICD9 ICD9 code (for GUI display)
  1. ; IENS Internale Entry Number Sequence
  1. ; (Array index variable for data returned from lookup)
  1. ; ORRF Order Record Found (returned data from lookup)
  1. ; OREM Order Record Error Message
  1. N DCD,DXDT,DXD,DXIEN,ICD9,IENS,ORRF,OREM
  1. S DCD=""
  1. D GETS^DIQ(100,IEN,".8*;5.1*","I","ORRF","OREM")
  1. I $D(ORRF) D
  1. . S DXDT=""
  1. . I $D(ORRF(100.008)) S DXDT=$G(ORRF(100.008,"1,"_IEN_",",.01,"I"))
  1. . I DXDT="" S DXDT=$$NOW^XLFDT
  1. . I $D(ORRF(100.051)) D
  1. .. S IENS="" F S IENS=$O(ORRF(100.051,IENS)) Q:IENS="" D
  1. ... I ORRF(100.051,IENS,.01,"I")="" S DCD=DCD_U Q
  1. ... S DXIEN=ORRF(100.051,IENS,.01,"I")
  1. ... S ICD9=$$GET1^DIQ(80,DXIEN,.01,"")
  1. ... S DXD=$$SETDXD^ORWDBA2($P($$ICDDATA^ICDXCODE("DIAGNOSIS",ICD9,DT),U,4))
  1. ... S DCD=$S(DCD="":ICD9_U_DXD,1:DCD_U_ICD9_U_DXD)
  1. Q DCD
  1. ;
  1. GETBAUSR(Y,ORCIEN) ;GUI RPC CALL
  1. ;Get Billing Awareness By User parameter value
  1. ;Gets and returns the value of the Enabled Billing Awareness By User
  1. ;parameter assigned to a provider.
  1. ;Input Variable:
  1. ; ORCIEN Ordering Clinician's Internal Entry Number
  1. ;Output Variable:
  1. ; Y Parameter value, 1 if enabled, 0 if disabled
  1. S Y=$$GET^XPAR(ORCIEN_";VA(200,","OR BILLING AWARENESS BY USER",1,"Q")
  1. Q