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

DGENCDU.m

Go to the documentation of this file.
  1. DGENCDU ;ALB/CJM,Zoltan - Catastrophic Disability Utilities;May 24, 1999
  1. ;;5.3;Registration;**121,232,1015**;Aug 13,1993;Build 21
  1. ;
  1. EXT(SUB,VAL) ;
  1. ;Description: Given the subscript used in the Catastrophic Disability
  1. ; array and a field value, returns the external representation of the
  1. ; value, as defined in the fields output transform of the PATIENT
  1. ; file.
  1. ;Input:
  1. ; SUB - array subscript defined for the Catastrophic Disability object
  1. ; VAL - field value
  1. ;Output:
  1. ; Function Value - returns the external value of the field
  1. ;
  1. Q:$G(SUB)=""!($G(VAL)="")!($G(SUB)[";") ""
  1. ;
  1. N FLD,FILE
  1. S FLD=$$FLD(SUB)
  1. Q:FLD="" ""
  1. S FILE=$$FILE(SUB)
  1. Q:FILE="" ""
  1. Q $$EXTERNAL^DILFD(FILE,FLD,"F",VAL)
  1. FILE(SUB) ; Return file/subfile number associated with this subscript.
  1. ; SUB = text subscript (such as VCD, BY, DATE, FACDET, etc.)
  1. N SUBLST,FLDLST,FILELST,FILE,PC
  1. D SETVARS
  1. S SUB=";"_SUB_";"
  1. I SUBLST'[SUB Q ""
  1. S PC=$L($P(SUBLST,SUB),";")
  1. S FILE=$P(FILELST,";",PC)
  1. Q FILE
  1. FLD(SUB) ; Return field/subfield number associated with this subscript.
  1. ; SUB = text subscript (such as VCD, BY, DATE, FACDET, etc.)
  1. N SUBLST,FLDLST,FILELST,FLD,PC
  1. D SETVARS
  1. S SUB=";"_SUB_";"
  1. I SUBLST'[SUB Q ""
  1. S PC=$L($P(SUBLST,SUB),";")
  1. S FLD=$P(FLDLST,";",PC)
  1. Q FLD
  1. SUB(FLD,FILE) ; Return subscript for this field (and file) number.
  1. S:'$G(FILE) FILE=2
  1. N SUBLST,FLDLST,FILELST,PC,SUB
  1. D SETVARS
  1. F PC=1:1:$L(FLDLST,";") I $P(FLDLST,";",PC)=FLD,$P(FILELST,";",PC)=FILE S SUB=$P(SUBLST,";",PC+1) Q
  1. Q SUB
  1. SETVARS ; NOTE -- for easy future maintenance, just modify the following 3 variables.
  1. S SUBLST=";VCD;BY;DATE;FACDET;REVDTE;METDET;DIAG;PROC;EXT;COND;SCORE;PERM;"
  1. S FILELST="2;2;2;2;2;2;2.396;2.397;2.397;2.398;2.398;2.398"
  1. S FLDLST=".39;.391;.392;.393;.394;.395;.01;.01;1;.01;1;2"
  1. Q