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

FHWORA1.m

Go to the documentation of this file.
  1. FHWORA1 ; HISC/GJC/JH - OE/RR Procedure Call (Assessments) 2 of 2;1/31/97 12:56 ;11/6/97 15:28
  1. ;;5.5;DIETETICS;;Jan 28, 2005
  1. SETUP ; Set up our ^TMP($J,"FHASM",DFN) global. Called from FHWORA
  1. S DTP=ADT D DTP^FH
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=$$CJ^XLFSTR("Date of Assessment: "_$E(DTP,1,9),80," ")
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=" "
  1. ;
  1. S X1=$S(HGT\12:HGT\12_"'",1:"")_$S(HGT#12:" "_(HGT#12)_"""",1:"")
  1. S X2=+$J(HGT*2.54,0,0)_" cm" K STR S $P(STR," ",81)=""
  1. S STR1="Height: "_$S(FHUNIT'="M":X1,1:X2)_" ("_$S(FHUNIT'="M":X2,1:X1)_")",TAB=0
  1. I HGP'="" S STR1=STR1_" "_$S(HGP="K":"knee hgt",HGP="S":"stated",1:"")
  1. S STR=$$STRING(STR,STR1,TAB)
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. ;
  1. S X1=WGT_" lbs",X2=+$J(WGT/2.2,0,1)_" kg"
  1. S STR1="Weight: "_$S(FHUNIT'="M":X1,1:X2)_" ("_$S(FHUNIT'="M":X2,1:X1)_")",TAB=0
  1. I WGP'="" S STR1=STR1_" "_$S(WGP="A":"anthro",WGP="S":"stated",1:"")
  1. S STR=$$STRING(STR,STR1,TAB)
  1. S DTP=DWGT D DTP^FH S TAB=50,STR1="Weight Taken: "_DTP
  1. S STR=$$STRING(STR,STR1,TAB)
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. ;
  1. S (X1,X2)="" I UWGT S X1=UWGT_" lbs",X2=+$J(UWGT/2.2,0,1)_" kg"
  1. K STR S $P(STR," ",81)="",TAB=0,STR1="Usual Weight: "_$S(FHUNIT'="M":X1,1:X2)_" ("_$S(FHUNIT'="M":X2,1:X1)_")"
  1. S STR=$$STRING(STR,STR1,TAB)
  1. S STR1="Weight/Usual Wt: "_$S(UWGT:($J(WGT/UWGT*100,3,0)_"%"),1:"")
  1. S TAB=50 S STR=$$STRING(STR,STR1,TAB)
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. ;
  1. S X1=IBW_" lbs",X2=+$J(IBW/2.2,0,1)_" kg"
  1. K STR S $P(STR," ",81)="",TAB=0
  1. S STR1="Ideal Weight: "_$S(FHUNIT'="M":X1,1:X2)_" ("_$S(FHUNIT'="M":X2,1:X1)_")"
  1. S STR=$$STRING(STR,STR1,TAB)
  1. S TAB=50,STR1="Weight/IBW: "_$S(IBW:($J(WGT/IBW*100,3,0)_"%"),1:"")
  1. S STR=$$STRING(STR,STR1,TAB)
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. ;
  1. I AMP S TAB=6 K STR S $P(STR," ",81)="",STR1="Ideal weight adjusted for amputation",STR=$$STRING(STR,STR1,TAB),^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. ;
  1. S TAB=0 K STR S $P(STR," ",81)=""
  1. S STR1="Frame Size: "_$S(FRM="S":"Small",FRM="M":"Medium",FRM="L":"Large",1:"")
  1. S STR=$$STRING(STR,STR1,TAB),TAB=50
  1. S STR1="Body Mass Index: "_BMI S:BMIP'="" STR1=STR1_" ("_BMIP_"%)"
  1. S STR=$$STRING(STR,STR1,TAB)
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. ;
  1. I FHASMNT(1)]"" D
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=" " K STR
  1. . S $P(STR," ",81)="",TAB=26
  1. . S STR1="Anthropometric Measurements"
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=$$STRING(STR,STR1,TAB)
  1. . K STR S $P(STR," ",81)=""
  1. . S TAB=35,STR1="%ile",STR=$$STRING(STR,STR1,TAB)
  1. . S TAB=71,STR1="%ile",STR=$$STRING(STR,STR1,TAB)
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=$$STRING(STR,STR1,TAB)
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=" "
  1. . K STR S $P(STR," ",81)="",TAB=4
  1. . S STR1="Triceps Skinfold (mm)",STR=$$STRING(STR,STR1,TAB)
  1. . I TSF D
  1. .. S TAB=31,STR1=$J(+TSF,3,0),STR=$$STRING(STR,STR1,TAB)
  1. .. S TAB=36,STR1=$J(TSFP,3),STR=$$STRING(STR,STR1,TAB)
  1. .. Q
  1. . S TAB=43,STR1="Arm Circumference (cm)"
  1. . S STR=$$STRING(STR,STR1,TAB)
  1. . I ACIR D
  1. .. S TAB=67,STR1=$J(+ACIR,3,0),STR=$$STRING(STR,STR1,TAB)
  1. .. S TAB=72,STR1=$J(ACIRP,3),STR=$$STRING(STR,STR1,TAB)
  1. .. Q
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. . K STR S $P(STR," ",81)="",TAB=4,STR1="Subscapular Skinfold (mm)"
  1. . S STR=$$STRING(STR,STR1,TAB)
  1. . I SCA D
  1. .. S TAB=31,STR1=$J(+SCA,3,0),STR=$$STRING(STR,STR1,TAB)
  1. .. S TAB=36,STR1=$J(SCAP,3),STR=$$STRING(STR,STR1,TAB)
  1. .. Q
  1. . S TAB=43,STR1="Bone-free AMA (cm2)"
  1. . S STR=$$STRING(STR,STR1,TAB)
  1. . I BFAMA D
  1. .. S TAB=67,STR1=$J(+BFAMA,3,0),STR=$$STRING(STR,STR1,TAB)
  1. .. S TAB=72,STR1=$J(BFAMAP,3),STR=$$STRING(STR,STR1,TAB)
  1. .. Q
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. . K STR S $P(STR," ",81)=""
  1. . S TAB=4,STR1="Calf Circumference (cm)",STR=$$STRING(STR,STR1,TAB)
  1. . I CCIR>0 D
  1. .. S TAB=31,STR1=$J(+CCIR,3,0),STR=$$STRING(STR,STR1,TAB)
  1. .. S TAB=36,STR1=$J(CCIRP,3),STR=$$STRING(STR,STR1,TAB)
  1. .. Q
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. . Q
  1. ;
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=" "
  1. K STR S $P(STR," ",81)="",TAB=32,STR1="Laboratory Data"
  1. S STR=$$STRING(STR,STR1,TAB)
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. K STR S $P(STR," ",81)="",TAB=5,STR1="Test",STR=$$STRING(STR,STR1,TAB)
  1. S TAB=30,STR1="Result units",STR=$$STRING(STR,STR1,TAB)
  1. S TAB=51,STR1="Ref. range",STR=$$STRING(STR,STR1,TAB)
  1. S TAB=67,STR1="Date",STR=$$STRING(STR,STR1,TAB)
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. ;
  1. S (I,X3)=0 F S I=$O(FHLAB(I)) Q:I'>0 D LAB^FHWORA(I)
  1. I 'X3 D
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=" ",TAB=5
  1. . K STR S $P(STR," ",81)=""
  1. . S STR1="No laboratory data available last "_$S($D(^FH(119.9,1,3)):$P(^(3),"^",2),1:90)_" days"
  1. . S STR=$$STRING(STR,STR1,TAB),^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. . Q
  1. ;
  1. S N=PRO/6.25,^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=" ",TAB=0
  1. K STR S $P(STR," ",81)="",STR1="Energy Requirements: "_KCAL_" Kcal/day"
  1. S STR=$$STRING(STR,STR1,TAB)
  1. I N D
  1. . S TAB=50,STR1="Kcal:N "_$J(KCAL/N,0,0)_":1"
  1. . S STR=$$STRING(STR,STR1,TAB)
  1. . Q
  1. I NB'="" D
  1. . S TAB=67,STR1="N-Bal: "_NB
  1. . S STR=$$STRING(STR,STR1,TAB)
  1. . Q
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. K STR S $P(STR," ",81)="",TAB=0,STR1="Protein Requirements: "_PRO_" gm/day"
  1. S STR=$$STRING(STR,STR1,TAB)
  1. I N D
  1. . S TAB=50,STR1="NPC:N "_$J(KCAL-(PRO*4)/N,0,0)_":1"
  1. . S STR=$$STRING(STR,STR1,TAB)
  1. . Q
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. ;
  1. S:FLD'="" ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))="Fluid Requirements: "_FLD_" ml/day"
  1. ;
  1. I FHAPPER]"" D
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=" "
  1. . K STR S $P(STR," ",81)="",TAB=0,STR1="Appearance: "
  1. . S STR=$$STRING(STR,STR1,TAB)
  1. . S TAB=20,$E(STR,(TAB+1),(TAB+$L(FHAPPER)))=FHAPPER
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. . Q
  1. I XD D
  1. . N Y S Y=$L($P($G(^FH(115.3,XD,0)),"^"))
  1. . S Y(0)=$P($G(^FH(115.3,XD,0)),"^")
  1. . S TAB=0 K STR S $P(STR," ",81)="",STR1="Nutrition Class: "
  1. . S STR=$$STRING(STR,STR1,TAB)
  1. . S TAB=20,$E(STR,(TAB+1),(TAB+Y))=Y(0)
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. . Q
  1. I RC D
  1. . N Y S Y=$L($P($G(^FH(115.4,RC,0)),"^",2))
  1. . S Y(0)=$P($G(^FH(115.4,RC,0)),"^",2)
  1. . S TAB=0 K STR S $P(STR," ",81)="",STR1="Nutrition Status: "
  1. . S STR=$$STRING(STR,STR1,TAB)
  1. . S TAB=20,$E(STR,(TAB+1),(TAB+Y))=Y(0)
  1. . S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. . Q
  1. D COMMENT^FHWORA ; display nutritional assessment comments
  1. K STR S STR="" S:SIGN1'="" STR=SIGN1
  1. K SIGN1 Q:STR=""
  1. S ^TMP($J,"FHASM",DFN,$$CNT^FHWORA(CNT))=STR
  1. Q
  1. STRING(STR,STR1,TAB) ; Build our data string
  1. S $E(STR,(TAB+1),(TAB+$L(STR1)))=STR1
  1. Q STR