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

AQAOENTQ.m

Go to the documentation of this file.
  1. AQAOENTQ ; IHS/ORDC/LJF - DISPLAY OCCURRENCES ENTERED ;
  1. ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
  1. ;
  1. ;This rtn is called by ^AQAOENTR to display all occurrences already
  1. ;entered for the combination of patient, occ date & indicator. If
  1. ;any are found, user can select one or choose to add a new occurrence.
  1. ;
  1. FIND ; >> find occurrences in file for patient, date & indicator
  1. S (AQAOX,AQAONUM)=0 K AQAO
  1. F S AQAOX=$O(^AQAOC("AA",AQAOIND,AQAODATE,AQAOPAT,AQAOX)) Q:AQAOX="" D
  1. .S AQAOST=$P($G(^AQAOC(AQAOX,1)),U) ;status codes
  1. .Q:AQAOST="2" ;bypass deletd occ
  1. .S AQAOST=$S(AQAOST=0:"OPEN",AQAOST=1:"CLOSED",1:"") ;set status
  1. .S AQAOID=$P($G(^AQAOC(AQAOX,0)),U) ;case identifier
  1. .S AQAONUM=AQAONUM+1,X=" " ;set array
  1. .S AQAO(AQAONUM)=AQAOX_U_AQAOID_X_AQAOST_X_$P(^AQAO(2,+AQAOIND,0),U,2)
  1. .Q
  1. G EXIT:'$D(AQAO) ;no occ found
  1. ;
  1. DISPLAY ; >> display occurrences found
  1. W !!?5,"*** OCCURRENCES FOUND FOR "
  1. W $P(^DPT(AQAOPAT,0),U)," FOR DATE SELECTED ***",!
  1. W !?3,"Case # Status Indicator"
  1. K DIR S DIR(0)="N^1:"_(AQAONUM+1),DIR("A")="Choose ONE from list"
  1. S DIR("A",(AQAONUM+1))=(AQAONUM+1)_". ADD NEW ENTRY"
  1. S AQAON=0 F S AQAON=$O(AQAO(AQAON)) Q:AQAON="" D
  1. .S DIR("A",AQAON)=AQAON_". "_$P(AQAO(AQAON),U,2)
  1. D ^DIR G EXIT:$D(DIRUT)
  1. I Y=(AQAONUM+1) K AQAO G EXIT ;user chose to add new entry
  1. I $P($P(AQAO(+Y),U,2)," ",2)'="OPEN" D G DISPLAY
  1. .W !!,"CASE NOT OPEN! MUST BE REOPENED TO EDIT IT!"
  1. S AQAOIFN=$P(AQAO(+Y),U) ;user chose to edit an entry
  1. S AQAOCID=$P(AQAO(+Y),U,2)
  1. ;
  1. EXIT ; >> return to calling routine
  1. Q