source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGENCDU.m@ 1141

Last change on this file since 1141 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.7 KB
RevLine 
[613]1DGENCDU ;ALB/CJM,Zoltan - Catastrophic Disability Utilities;May 24, 1999
2 ;;5.3;Registration;**121,232**;Aug 13,1993
3 ;
4EXT(SUB,VAL) ;
5 ;Description: Given the subscript used in the Catastrophic Disability
6 ; array and a field value, returns the external representation of the
7 ; value, as defined in the fields output transform of the PATIENT
8 ; file.
9 ;Input:
10 ; SUB - array subscript defined for the Catastrophic Disability object
11 ; VAL - field value
12 ;Output:
13 ; Function Value - returns the external value of the field
14 ;
15 Q:$G(SUB)=""!($G(VAL)="")!($G(SUB)[";") ""
16 ;
17 N FLD,FILE
18 S FLD=$$FLD(SUB)
19 Q:FLD="" ""
20 S FILE=$$FILE(SUB)
21 Q:FILE="" ""
22 Q $$EXTERNAL^DILFD(FILE,FLD,"F",VAL)
23FILE(SUB) ; Return file/subfile number associated with this subscript.
24 ; SUB = text subscript (such as VCD, BY, DATE, FACDET, etc.)
25 N SUBLST,FLDLST,FILELST,FILE,PC
26 D SETVARS
27 S SUB=";"_SUB_";"
28 I SUBLST'[SUB Q ""
29 S PC=$L($P(SUBLST,SUB),";")
30 S FILE=$P(FILELST,";",PC)
31 Q FILE
32FLD(SUB) ; Return field/subfield number associated with this subscript.
33 ; SUB = text subscript (such as VCD, BY, DATE, FACDET, etc.)
34 N SUBLST,FLDLST,FILELST,FLD,PC
35 D SETVARS
36 S SUB=";"_SUB_";"
37 I SUBLST'[SUB Q ""
38 S PC=$L($P(SUBLST,SUB),";")
39 S FLD=$P(FLDLST,";",PC)
40 Q FLD
41SUB(FLD,FILE) ; Return subscript for this field (and file) number.
42 S:'$G(FILE) FILE=2
43 N SUBLST,FLDLST,FILELST,PC,SUB
44 D SETVARS
45 F PC=1:1:$L(FLDLST,";") I $P(FLDLST,";",PC)=FLD,$P(FILELST,";",PC)=FILE S SUB=$P(SUBLST,";",PC+1) Q
46 Q SUB
47SETVARS ; NOTE -- for easy future maintenance, just modify the following 3 variables.
48 S SUBLST=";VCD;BY;DATE;FACDET;REVDTE;METDET;DIAG;PROC;EXT;COND;SCORE;PERM;"
49 S FILELST="2;2;2;2;2;2;2.396;2.397;2.397;2.398;2.398;2.398"
50 S FLDLST=".39;.391;.392;.393;.394;.395;.01;.01;1;.01;1;2"
51 Q
Note: See TracBrowser for help on using the repository browser.