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

BEDDEHR.m

Go to the documentation of this file.
  1. BEDDEHR ;VNGT/HS/BEE-EHR Utility Routine ; 08 Nov 2011 12:00 PM
  1. ;;2.0;BEDD DASHBOARD;**3**;Jun 04, 2014;Build 12
  1. ;
  1. Q
  1. ;
  1. CHGPAT(DFN,DUZ) ;EP - Change the patient in EHR to the selected patient
  1. ;
  1. NEW Z,SUB,FND
  1. ;
  1. ;Data validation
  1. ;GDIT/HS/BEE 07/10/2018;CR#10213 - BEDD*2.0*3 - Allow DFN=0 (clear patient)
  1. ;I $G(DFN)="" Q 0
  1. I $G(DUZ)="" Q 0
  1. S:$G(U)="" U="^"
  1. ;
  1. ;Return list of subscribers to patient context
  1. D GETSUBSC^CIANBEVT(.SUB,"CONTEXT.PATIENT")
  1. ;
  1. ;Try to find the user's EHR session
  1. S FND=0 F Z=0:0 S Z=$O(@SUB@(Z)) Q:'Z D
  1. . NEW DZ,UID
  1. . S DZ=$P($G(@SUB@(Z)),U,4)
  1. . I DZ'=DUZ Q
  1. . S UID=$P($G(@SUB@(Z)),U) Q:UID=""
  1. . ;
  1. . ;Change the context
  1. . D QUEUE^CIANBEVT("CONTEXT.PATIENT",+DFN,UID)
  1. . S FND=1
  1. Q FND
  1. ;
  1. CHGENC(ENC,DUZ) ;EP - Change the Encounter in EHR to the selected visit
  1. ;
  1. NEW Z,SUB,FND
  1. ;
  1. ;Data validation
  1. I $G(ENC)="" Q 0
  1. I $G(DUZ)="" Q 0
  1. S:$G(U)="" U="^"
  1. ;
  1. ;Return list of subscribers to encounter context
  1. D GETSUBSC^CIANBEVT(.SUB,"CONTEXT.ENCOUNTER")
  1. ;
  1. ;Try to find the user's EHR session
  1. S FND=0 F Z=0:0 S Z=$O(@SUB@(Z)) Q:'Z D
  1. . NEW DZ,UID
  1. . S DZ=$P($G(@SUB@(Z)),U,4)
  1. . I DZ'=DUZ Q
  1. . S UID=$P($G(@SUB@(Z)),U) Q:UID=""
  1. . ;
  1. . ;Change the context
  1. . D QUEUE^CIANBEVT("CONTEXT.ENCOUNTER",+ENC,UID)
  1. . S FND=1
  1. Q FND