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

BARRSLDX.m

Go to the documentation of this file.
BARRSLDX ; IHS/SD/POT - Utility to selec DX Parameters
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**23,24**;OCT 26,2005;Build 69
 ; IHS/SD/POTT NEW ROUTINE BAR1.8*23
 ; IHS/SD/POTT HEAT150941 02/09/14 Allow ALL DX9/10 - BAR1.8*24
 ;                        if no DX selected: show ALL DX of ALL available coding systems - BAR1.8*24
 ; *********************************************************************
 ;
DXTYPE ;OBSOLETE CALL: HEAT150941 BAR1.8*24
 Q
 K BARY("DXTYPE")
 K DIRUT,DIR,Y
 S Y=$$DIR^XBDIR("S^P:Search in Primary DX Only;A:All DX","Select Search DX type ","","","","",1)
 K DA
 Q Y
 ;
GETDX(BARIEN) ;
 ;
 ; Search ALL diagnosis; fill array BARARRDG
 ; BAR3PDXP=1 indicates primary DX
 ; 
 NEW BARDBG,BARCNT,BAR3PDX,BARPRMDX,BAR3PDXP,BAR3PLOC,BAR3PIEN,BAR3PDUZ,BARARRDG,I ;ARRAY OF DG
 S BARDBG=0 ;P.OTT
 S BAR3PLOC=$$FIND3PB^BARUTL(DUZ(2),BARIEN)
 I BAR3PLOC="" Q
 S BAR3PIEN=$P(BAR3PLOC,",",2)
 S BAR3PDUZ=$P(BAR3PLOC,",")
 S BARCNT=0
 S (BAR3PDX,BARPRMDX)=0 F  S BAR3PDX=$O(^ABMDBILL(BAR3PDUZ,BAR3PIEN,17,BAR3PDX)) Q:'+BAR3PDX  D  ;Q:+BARPRMDX
 . S BARCNT=BARCNT+1
 . S BAR3PDXP=$P($G(^ABMDBILL(BAR3PDUZ,BAR3PIEN,17,BAR3PDX,0)),U,2)
 . I $T(+1^ICDEX)="" S BARDXCOD=$P($$ICDDX^ICDCODE(BAR3PDX,""),U,2) ;DX CODE - OLD CODE: NOT WORKING FOR ICD10
 . I $T(+1^ICDEX)]"" S BARDXCOD=$P($$ICDDX^ICDEX(BAR3PDX,""),U,2) ;DX CODE - NEW API SUPPORTS BOTH ICD9/10
 . ;;;I BAR3PDXP=1 I BARY("DXTYPE")="P" S BARARRDG("ALL_CODE",BARCNT)=BARDXCOD Q  ;old code HEAT150941 BAR1.8*24
 . I BAR3PDXP=1 S BARARRDG("ALL_CODE",BARCNT)=BARDXCOD Q  ;PROCESS ONLY PRIMARY DXs!!! HEAT150941
 . ;OLD CODE: S BARARRDG("ALL_CODE",BARCNT)=BARDXCOD ;HEAT150941
 . Q
 K BAR("DX") ;clear array
 M BAR("DX")=BARARRDG("ALL_CODE") ;fill array
 Q
 ;COUNT DXs WHICH CONTAIN X
 ;
LIST(BARX,BARVERB) ;
 NEW BARX0,BARXL
 ;RETURNS : BARCNT
 S BARXL=$L(X),BARCNT=0,BARX0=X_" "
 F I=1:1 S BARX0=$O(^ICD9("AB",BARX0)) Q:BARX0=""  Q:$E(BARX0,1,BARXL)'=BARX  D
 . S BARCNT=BARCNT+1
 . I BARVERB W !,BARCNT,". ",BARX0
 I 'BARVERB Q
 I 'BARCNT W " NO MATCHING DXs." Q
 W "  ",BARCNT," MATCHING DXs FOUND."
 Q