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

BCHEGR2.m

Go to the documentation of this file.
  1. BCHEGR2 ; IHS/CMI/LAB - GROUP DEFINTION ENTRY OF PATIENTS ;
  1. ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
  1. ;
  1. GETPAT ;EP
  1. W !
  1. ;W:$D(IOF) @IOF
  1. S (BCHPT,BCHPTT)=""
  1. W !!?15,"****** P A T I E N T I N F O R M A T I O N ******",!!
  1. W !,"If this encounter involved a particular patient, please enter the patient's",!,"chart # or name now. If this is not a single patient encounter,",!,"but a group encounter, simply HIT the RETURN key to continue.",!
  1. W !,"Please enter the patient information now.",!
  1. S DFN=""
  1. S DIR(0)="FO^1:30",DIR("A")="Enter PATIENT NAME or CHART #"
  1. S DIR("?",1)=" To find a patient, you can enter the patient's chart number;"
  1. S DIR("?",2)=" lastname,firstname; SSN; or DOB."
  1. S DIR("?",3)=" "
  1. S DIR("?",4)=" If the patient cannot be found in the Patient Registration"
  1. S DIR("?",5)=" database and you would like to capture demographic information"
  1. S DIR("?",6)=" for this patient into the CHR database, answer NO when asked"
  1. S DIR("?",7)=" if you would like to try another lookup. You will then be"
  1. S DIR("?",8)=" given the opportunity to capture the patient's demographic"
  1. S DIR("?",9)=" data on the following screen."
  1. S DIR("?",10)=""
  1. S DIR("?",11)=" Registered patient demographic data can only be edit via the"
  1. S DIR("?")=" Patient Registration system."
  1. ;W !,"So far you have entered ",BCHHIT," patient records out of a total of ",BCHNUM,".",!
  1. ;I BCHHIT W "You have entered records for: " D W !!
  1. ;.S X=0 F S X=$O(^BCHGROUP(BCHFID,21,X)) Q:X'=+X W !?5,$P($G(^BCHR(X,11)),U)
  1. D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I Y="" W !!,"No patient entered!! - Required",! G GETPAT
  1. I $D(DIRUT) W !,"No patient entered!! - Required." S BCHQUIT=1 Q
  1. S (X,BCHNAME)=Y,DIC="^AUPNPAT(",DIC(0)="MQE" D ^DIC K DIC
  1. I Y=-1 D NOREG Q
  1. W !?25,"Ok" S %=1 D YN^DICN I %'=1 W !!,"Try again.",! G GETPAT
  1. S BCHPT=+Y
  1. S BCHPTT="R"
  1. Q
  1. ;
  1. NOREG ;
  1. K BCHAGAIN
  1. W !,"That patient cannot be found in the Registration database."
  1. W ! S DIR(0)="Y",DIR("A")="Do you want to try to lookup the patient in registration again",DIR("B")="Y" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) W !,"Exiting..." S BCHQUIT=1 Q
  1. I Y G GETPAT
  1. W !!,"Please select a patient from the Non-Registered Patient Database",!,"or enter a new Non-Registered Patient.",!
  1. S DIC="^BCHRPAT(",DIC(0)="AEMQL" D ^DIC K DIC
  1. I Y=-1 W !!,"A patient is Required" G GETPAT
  1. S BCHNRPAT=+Y,BCHPT=+Y,BCHPTT="N"
  1. I $P(Y,U,3) D I 1
  1. .W !!,"Please review and update if necessary this non-registered patient's data:"
  1. .S DIE="^BCHRPAT(",DR="[BCH EDIT NON REG PT]",DA=BCHNRPAT D ^DIE K DA,DIE,DR
  1. E D
  1. .W !!,"You now have the opportunity to update this patient's demographic data,"
  1. .W !,"(DOB, Gender, Community of Residene, Tribe)",!
  1. .S DIR(0)="Y",DIR("A")="Do you want to update this patient's demographic information?",DIR("B")="N" KILL DA D ^DIR KILL DIR
  1. .I 'Y Q
  1. .I $D(DIRUT) Q
  1. .S DIE="^BCHRPAT(",DR="[BCH EDIT NON REG PT]",DA=BCHNRPAT D ^DIE K DA,DIE,DR
  1. Q