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

BEXSITE.m

Go to the documentation of this file.
  1. BEXSITE ;IHS/CMI/DAY - BEX - Division and Site Selection ; 05 Oct 2015 11:42 AM
  1. ;;1.0;BEX TELEPHONE REFILL SYSTEM;*6*;APR 20, 2015;Build 7
  1. ;
  1. Q
  1. ;
  1. ;Site Notes
  1. ;
  1. ;PSOSITE is set to the IEN in the OUTPATIENT SITE file
  1. ;
  1. ;PSOPINST is set to the Related Institution in the
  1. ;OUTPATIENT SITE file
  1. ;
  1. ;PSOINST is needed for BEXRX7 and is set in ^PSOLSET however, the
  1. ;value is set to the Station Number, which is set by users or by
  1. ;assigned Station Numbers in the 8000 range. Therefore, we must set
  1. ;PSOINST ourselves.
  1. ;
  1. ;
  1. CHANGE ;EP - Display current site and ask user if they want to change
  1. ;
  1. ;Do not ask if only one Outpatient Site
  1. I $P($G(^PS(59,0)),U,3)=1 Q
  1. ;
  1. ;If we do not have these variables, we have to ask them first
  1. I '$D(PSOSITE) K PSOPAR
  1. I '$D(PSOPAR) D ^PSOLSET
  1. I '$D(PSOPAR) G CHANGE
  1. ;
  1. ;We assume from here that we have multiple Outpatient Site entries
  1. ;
  1. W !!
  1. F I=1:1:70 W "*"
  1. W !
  1. W "*** O/P Site (Division) is: "
  1. W ?30,$$GET1^DIQ(59,PSOSITE,.01),?67,"***",!
  1. W "*** Related Institution is: "
  1. W ?30,$$GET1^DIQ(4,PSOPINST,.01),?67,"***",!
  1. F I=1:1:70 W "*"
  1. W !
  1. ;
  1. K DIR
  1. S DIR(0)="YO"
  1. S DIR("A")="Do you want to change these"
  1. S DIR("B")="N"
  1. D ^DIR
  1. I Y'=1 Q
  1. ;
  1. K PSOSITE,PSOPAR,PSOPINST
  1. D ^PSOLSET
  1. I '$D(PSOPAR) G CHANGE
  1. ;
  1. W !!
  1. W "The RELATED INSTITUTION is ",$$GET1^DIQ(4,PSOPINST,.01),!
  1. W "and will be used to lookup and display health record numbers.",!
  1. ;
  1. ;This is borrowed from ASKSITE^XUS1
  1. K DIC
  1. S DIC(0)="AEQM"
  1. S DIC="^VA(200,DUZ,2,"
  1. S DIC("P")="200.02P"
  1. S DIC("A")="Select RELATED INSTITUTION: "
  1. S DIC("B")=PSOPINST
  1. D ^DIC
  1. K DIC
  1. I Y>0 S PSOPINST=+Y,DUZ(2)=+Y
  1. W !!
  1. ;
  1. Q
  1. ;
  1. ;
  1. HOLD ;EP - Store original settings when a user enters BEX processing
  1. ;
  1. ;We store PSOSITE (the Outpatient Site)
  1. ;and PSOPINST (the related institution)
  1. ;and DUZ(2)
  1. ;
  1. S BEXHOLD("PSOSITE")=$G(PSOSITE)
  1. S BEXHOLD("PSOPINST")=$G(PSOPINST)
  1. S BEXHOLD("DUZ(2)")=$G(DUZ(2))
  1. ;
  1. Q
  1. ;
  1. ;
  1. CHECK() ;EP - Check if user changed their site settings
  1. ;
  1. ;This is called from the END section of BEXRX7 and
  1. ;from the EOJ section of BEXRQUE to see if the user changed
  1. ;their Outpatient Site settings
  1. ;
  1. ;Quit if not a multi-division site
  1. I $P($G(^PS(59,0)),U,3)=1 Q 0
  1. ;
  1. I $G(PSOSITE)="" Q 0
  1. I $G(PSOPINST)="" Q 0
  1. I $G(DUZ(2))="" Q 0
  1. ;
  1. I $G(PSOSITE)'=$G(BEXHOLD("PSOSITE")) Q 1
  1. I $G(PSOPINST)'=$G(BEXHOLD("PSOPINST")) Q 1
  1. I $G(DUZ(2))'=$G(BEXHOLD("DUZ(2)")) Q 1
  1. ;
  1. Q 0
  1. ;
  1. ;