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

BQIBHSFP.m

Go to the documentation of this file.
  1. BQIBHSFP ;VNGT/HS/BEE - Behav Health Suicide Form Print ; 19 Jul 2006 10:35 AM
  1. ;;2.2;ICARE MANAGEMENT SYSTEM;;Jul 28, 2011;Build 37
  1. ;
  1. Q
  1. ;
  1. EN(DATA,BQIHSF) ; EP - BQI BH PRINT SUICIDE FORM
  1. ;Description
  1. ; Print a selected suicide form for a patient
  1. ;
  1. ;Input
  1. ; BQIHSF - Internal IEN of the suicide form
  1. ;
  1. ;Output
  1. ; DATA - Name of global in which data is stored(^TMP("BQIBHSFP"))
  1. ;
  1. NEW UID,II,APCDSF,APCDX,AM
  1. S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
  1. S DATA=$NA(^TMP("BQIBHSFP",UID))
  1. K @DATA
  1. ;
  1. S II=0
  1. ;
  1. NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIBHSFP D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
  1. ;
  1. D HDR
  1. ;
  1. S APCDSF=BQIHSF
  1. ;
  1. ;Compile Form
  1. K ^TMP("APCDS",$J)
  1. D EP2^APCDLES1(APCDSF)
  1. ;
  1. S II=II+1,@DATA@(II)="********** CONFIDENTIAL PATIENT INFORMATION ["_$P(^VA(200,DUZ,0),U,2)_"] "_$$FMTE^XLFDT(DT)_" **********"_$C(13)_$C(10)
  1. ;
  1. S APCDX=0 F S APCDX=$O(^TMP("APCDS",$J,"DCS",APCDX)) Q:APCDX'=+APCDX D
  1. .S AM=$G(^TMP("APCDS",$J,"DCS",APCDX))
  1. .S AM=$$STRIP^XLFSTR(AM,"^")
  1. .S II=II+1,@DATA@(II)=AM_$C(13)_$C(10)
  1. S @DATA@(II)=$G(@DATA@(II))_$C(30)
  1. ;
  1. DONE ;
  1. ;
  1. S II=II+1,@DATA@(II)=$C(31)
  1. Q
  1. ;
  1. HDR ;
  1. S @DATA@(II)="T01024REPORT_TEXT"_$C(30)
  1. Q
  1. ;
  1. ERR ;
  1. D ^%ZTER
  1. NEW Y,ERRDTM
  1. S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
  1. S BMXSEC="Recording that an error occurred at "_ERRDTM
  1. I $D(II),$D(DATA) S II=II+1,@DATA@(II)=$C(31)
  1. Q