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

SCDXUTL3.m

Go to the documentation of this file.
  1. SCDXUTL3 ;ALB/JRP - ACRP ERROR CODE UTILITIES;08-OCT-1996
  1. ;;5.3;Scheduling;**68**;AUG 13, 1993
  1. DEMOCODE(PTRCODE) ;Determine if NPCDB error code is related to a
  1. ; patient's demographic data or if it is related to the encounter data
  1. ;
  1. ;Input : PTRCODE - Pointer to entry in TRANSMITTED OUTPATIENT
  1. ; ENCOUNTER ERROR CODE file (#409.76)
  1. ;Output : 1 - Error is related to patient's demographic data
  1. ; 0 - Error is related to the encounter data
  1. ; 0 - Bad input
  1. ;
  1. ;Check input
  1. S PTRCODE=+$G(PTRCODE)
  1. Q:('$D(^SD(409.76,PTRCODE,0))) 0
  1. ;Declare variables
  1. N ERRCODE,TMP,DEMOCODE,DEMOGRP
  1. ;Convert pointer to error code
  1. S ERRCODE=$P($G(^SD(409.76,PTRCODE,0)),"^",1)
  1. Q:(ERRCODE="") 0
  1. ;Establish series of codes that relate to patient demographic data
  1. F TMP=200,300,400,700,800,"000","B00","C00" S DEMOGRP(TMP)=1
  1. ;Convert error code to it's series range and determine if that range
  1. ;relates to patient demographic data
  1. S TMP=$E(ERRCODE,1)_"00"
  1. S DEMOCODE=+$G(DEMOGRP(TMP))
  1. ;Done
  1. Q DEMOCODE
  1. ;
  1. DEMOERR(PTRERR) ;Determine if error is related to a patient's demographic
  1. ; data or if it is related to the encounter data
  1. ;
  1. ;Input : PTRERR - Pointer to entry in TRANSMITTED OUTPATIENT
  1. ; ENCOUNTER ERROR file (#409.75)
  1. ;Output : 1 - Error is related to patient's demographic data
  1. ; 0 - Error is related to the encounter data
  1. ; 0 - Bad input
  1. ;
  1. ;Check input
  1. S PTRERR=+$G(PTRERR)
  1. Q:('$D(^SD(409.75,PTRERR,0))) 0
  1. ;Declare variables
  1. N PTRCODE,NODE
  1. ;Get pointer to TRANSMITTED OUTPATIENT ENCOUNTER ERROR CODE file
  1. S NODE=$G(^SD(409.75,PTRERR,0))
  1. S PTRCODE=+$P(NODE,"^",2)
  1. ;Return whether or not error code is related to demographic data
  1. Q $$DEMOCODE(PTRCODE)
  1. ;
  1. REJ4DEMO(XMITPTR) ;Determine if encounter was rejected due to a
  1. ; demographic error
  1. ;
  1. ;Input : XMITPTR - Pointer to TRANSMITTED OUTPATIENT ENCOUNTER
  1. ; file (#409.73)
  1. ;Output : 1 - At least one of the error codes listed for the
  1. ; encounter is related to the patient's demographic data
  1. ; 0 - None of the error codes listed for the encounter are
  1. ; related to the patient's demographic data
  1. ; 0 - Bad input/no error codes listed
  1. ;
  1. ;Check input
  1. S XMITPTR=+$G(XMITPTR)
  1. Q:('$D(^SD(409.73,XMITPTR,0))) 0
  1. ;Declare variables
  1. N PTRERR,PTRCODE,NODE,REJ4DEMO
  1. S REJ4DEMO=0
  1. ;Loop through TRANSMITTED OUTPATIENT ENCOUNTER ERROR file (#409.75)
  1. S PTRERR=""
  1. F S PTRERR=+$O(^SD(409.75,"B",XMITPTR,PTRERR)) Q:('PTRERR) D Q:(REJ4DEMO)
  1. .;Get pointer to error code
  1. .S NODE=$G(^SD(409.75,PTRERR,0))
  1. .S PTRCODE=+$P(NODE,"^",2)
  1. .Q:('PTRCODE)
  1. .;Determine if code is based on demographic data
  1. .S REJ4DEMO=+$$DEMOCODE(PTRCODE)
  1. ;Done
  1. Q REJ4DEMO