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

BSDHSP.m

Go to the documentation of this file.
  1. BSDHSP ; IHS/ANMC/LJF - PRINT/BROWSE HEALTH SUMMARY ; [ 02/10/2005 4:07 PM ]
  1. ;;5.3;PIMS;**1002***;APR 26, 2002
  1. ;
  1. I $T(EN^APCHS)="" W !!,"HEALTH SUMMARY PACKAGE NOT INSTALLED." D PAUSE^BDGF Q
  1. ;
  1. NEW DFN,APCHSPAT,APCHSTYP,APCHSTAT,APCHSMTY
  1. S DFN=$G(SDFN)
  1. I '$D(SDFN) S DFN=+$$READ^BDGF("P^2:EMQZ","Select Patient")
  1. Q:'DFN S APCHSPAT=DFN
  1. ;
  1. D GETHSTYP Q:'$G(APCHSTYP) ;ask health summary type
  1. ;IHS/ITSC/WAR 2/2/2005 PATCH #1002 SPT issue dealing with HS
  1. S BSDSPT=$O(^DGSL(38.1,DFN,"D",0))
  1. I BSDSPT>0 D
  1. .I $P(^DGSL(38.1,DFN,"D",BSDSPT,0),U,3)["Appointment Management" D
  1. ..S $P(^DGSL(38.1,DFN,"D",BSDSPT,0),U,3)="AM/Health Summary"
  1. ;
  1. I $$BROWSE^BDGF="B" D EN Q ;view in browse mode
  1. ;IHS/ITSC/WAR 2/2/2005 PATCH #1002 SPT issue dealing with HS
  1. ; If they didn't browse (D EN, from above) then they printed it.
  1. I BSDSPT>0 S $P(^DGSL(38.1,DFN,"D",BSDSPT,0),U,3)="AM/PrtHealth Summary"
  1. D ZIS^BDGF("PQ","EN^APCHS","HEALTH SUMMARY","APCHSPAT;APCHSTYP") Q
  1. ;
  1. ;
  1. EN ;EP; -- main entry point for list template BSDAM HS VIEW
  1. NEW VALMCNT D TERM^VALM0,CLEAR^VALM1
  1. D EN^VALM("BSDAM HS VIEW")
  1. D CLEAR^VALM1
  1. Q
  1. ;
  1. HDR ;EP; -- header code
  1. Q
  1. ;
  1. INIT ;EP; -- init variables and list array
  1. NEW X S VALMCNT=0
  1. K ^TMP("BSDHSP",$J),^TMP("BSDHSP1",$J)
  1. D GUIR^XBLM("EN^APCHS","^TMP(""BSDHSP1"",$J,")
  1. S X=0 F S X=$O(^TMP("BSDHSP1",$J,X)) Q:'X D
  1. . S VALMCNT=X
  1. . S ^TMP("BSDHSP",$J,X,0)=^TMP("BSDHSP1",$J,X)
  1. K ^TMP("BSDHSP1",$J)
  1. Q
  1. ;
  1. HELP ;EP; -- help code
  1. S X="?" D DISP^XQORM1 W !!
  1. Q
  1. ;
  1. EXIT ;EP; -- exit code
  1. K ^TMP("BSDHSP",$J)
  1. Q
  1. ;
  1. EXPND ;EP; -- expand code
  1. Q
  1. ;
  1. GETHSTYP ; -- ask user for health summary type
  1. NEW DIC,X,Y
  1. S DIC="^APCHSCTL(",DIC(0)="AEMQ"
  1. ;
  1. ; try to determine a default for question
  1. ; first based on current clinic
  1. S X=$$GET1^DIQ(9009017.2,+$G(SDCLN),.05)
  1. ; next based on last one used by user
  1. I X="",$D(^DISV(DUZ,"^APCHSCTL(")) D
  1. . S Y=^("^APCHSCTL(") I $D(^APCHSCTL(Y,0)) S X=$P(^(0),U,1)
  1. ; last find default for whole facility
  1. I X="",$D(^APCCCTRL(+$G(DUZ(2)),0)) S X=$$GET1^DIQ(9001000,DUZ(2),.03)
  1. S:X="" X="ADULT REGULAR" S DIC("B")=X
  1. D ^DIC K DIC Q:Y<1 S APCHSTYP=+Y
  1. Q