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

BKMIMRP1.m

Go to the documentation of this file.
  1. BKMIMRP1 ;PRXM/HC/BWF - BKMV UTILITY PROGRAM; [ 1/19/2005 7:16 PM ]
  1. ;;2.2;HIV MANAGEMENT SYSTEM;;Apr 01, 2015;Build 40
  1. Q
  1. ;
  1. AGE(DFN) ;EP - PATIENT AGE
  1. ; Extrinsic Age function
  1. ; Input = DFN - IEN of patient
  1. N DOB,DATE,AGE,TDATE
  1. S DOB=$$GET1^DIQ(2,DFN_",",.03,"I","","")
  1. ;PRXM/HC/DLS 9/21/2005 Added TDATE variable for configuring age
  1. ; based on today (if still living) or DOD (Date of Death), if applicable.
  1. S TDATE=$$GET1^DIQ(2,DFN,".351","I")
  1. I 'TDATE S TDATE=DT
  1. S DATE=$E(TDATE,1,3)
  1. S AGE=DATE-$E(DOB,1,3)
  1. S:$E(TDATE,4,7)<$E(DOB,4,7) AGE=AGE-1
  1. I AGE<3 D
  1. .S DAYS=$$FMDIFF^XLFDT(TDATE,DOB,1)
  1. .I DAYS<7 S AGE=DAYS_"d" Q
  1. .I DAYS<30 S AGE=DAYS\7_"w" Q
  1. .S AGE=DAYS\30_"m"
  1. Q AGE
  1. ;
  1. HDR(HEADER,PAGE) ; EP - Print page number and center data.
  1. ; Input - HEADER: Header text (required)
  1. ;- PAGE (optional)
  1. ; This will print a page number on the header line.
  1. ; This utility will look at the screen width chosen by the user, and
  1. ; center the data on the screen.
  1. ; Note: you must first call ^%ZIS to get the parameters.
  1. I '$D(PAGE) S PAGE=""
  1. S LEN=$L(HEADER)
  1. S CENTER=LEN/2,CLINE=IOM/2
  1. S START=$P(CLINE-CENTER,".",1)
  1. I (PAGE'="") W ?START,HEADER,?68,"Page: ",PAGE,! Q
  1. I PAGE="" W ?START,HEADER,!
  1. Q
  1. ;
  1. HDR3 ; EP - Print a dashed line.
  1. ; This utility will write a screen-width wide line of dashes (stored in IOM).
  1. ; Note: you must first call ^%ZIS to get the parameters.
  1. W ?1 F I=1:1:(IOM-2) W "-"
  1. W !?1
  1. Q