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

BMCBMRG.m

Go to the documentation of this file.
  1. BMCBMRG ;IHS/ITSC/FCJ - MERGE BULLETIN MESSAGES SENT
  1. ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
  1. ;
  1. W:$D(IOF) @IOF
  1. W !,"This option will merge data from the RCIS Messages File. This file"
  1. W !,"holds the date and group(s) messages were sent for a specific Referral.",!
  1. W !,"This will not remove the message from the Mail box."
  1. ;Find earliest date....
  1. S Y=0 S Y=$O(^BMCMSG("B",Y)),Y=$P(Y,".") D DD^%DT S BMCBDT=Y
  1. BDT ;ENTER DATE RANGE
  1. S DIR(0)="D",DIR("B")=BMCBDT
  1. S DIR("A")="Enter the beginning date for purging messages, earliest date"
  1. D ^DIR G:$D(DIRUT) EXT
  1. S BMCBDT=Y,BMCBDTD=Y(0)
  1. K DIR("B")
  1. EDT S DIR("A")="Enter the ending date for purging messages"
  1. D ^DIR G:$D(DIRUT) EXT
  1. K DIR
  1. I BMCBDT>Y W !,"Beginning date is greater then Ending Date" G EDT
  1. S BMCEDT=Y,BMCEDTD=Y(0)
  1. W !!,"Message will be purged beginning with ",BMCBDTD," THRU ",BMCEDTD,".",!
  1. S DIR("B")="N"
  1. S DIR(0)="Y",DIR("A")="Enter Yes to continue, No to exit"
  1. D ^DIR
  1. G:'Y EXT
  1. REM ;REMOVE ENTRIES FROM RCIS MESSAGES
  1. W !,"REMOVING ENTRIES"
  1. S BMCDT=BMCBDT,BMCT=0
  1. F S BMCDT=$O(^BMCMSG("B",BMCDT)) Q:(BMCDT="")!(BMCDT>BMCEDT) D
  1. .S BMCMIEN=0
  1. .F S BMCMIEN=$O(^BMCMSG("B",BMCDT,BMCMIEN)) Q:BMCMIEN'?1N.N D
  1. ..S DIK="^BMCMSG(",DA=BMCMIEN D ^DIK
  1. ..W "." S BMCT=BMCT+1
  1. W !,"TOTAL REMOVED = ",BMCT
  1. EXT ;
  1. K BMCMIEN,BMCT,BMCDT,BMCEDT,BMCEDTD,BMCBDT,BMCBDTD
  1. K DIR,DIC,DIK,DA,Y,X
  1. Q