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

BYIMD.m

Go to the documentation of this file.
  1. BYIMD ;IHS/CMI/THL - IMMUNIZATION DATA EXCHANGE;
  1. ;;2.0;BYIM IMMUNIZATION DATA EXCHANGE;**3,4,5,6,7,8**;JUL 11, 2017;Build 310
  1. ;
  1. ;UTILITY TO CONTROL 'D' CROSS REFERENCE FOR DATA EXPORT
  1. ;
  1. Q
  1. EN ;EP;TO SET DATE AND SET 'D' XREF FOR ALL IMMUNIZATIONS PRIOR TO DATE
  1. ;SO IMM'S WON'T BE EXPORTED
  1. ;
  1. K DIR
  1. S DIR(0)="DO"
  1. S DIR("A")="Enter a reference date"
  1. W @IOF
  1. W !!?5,"Enter a reference date."
  1. W !!?5,"ALL immunizations given prior to the date selected will be"
  1. W !?5,"flagged as 'exported' so they will not be exported again"
  1. W !?5,"in the daily batch immunization exports."
  1. W !
  1. D ^DIR
  1. K DIR
  1. Q:'Y
  1. S DATE=Y
  1. K DIR
  1. S DIR(0)="YO"
  1. S DIR("A")="Are you sure you want to proceed"
  1. S DIR("B")="NO"
  1. S Y=DATE
  1. X ^DD("DD")
  1. W !!?5,"ALL immunizations given prior to: ",Y
  1. W !?5,"will now be flagged as 'exported'"
  1. W !
  1. D ^DIR
  1. K DIR
  1. Q:'Y
  1. N DA,X0,P,V,VD,J
  1. S DA=0
  1. F S DA=$O(^AUPNVIMM(DA)) Q:'DA S X0=$G(^(DA,0)) D
  1. .Q:$D(^BYIMEXP("D",DA))
  1. .S V=$P(X0,U,3)
  1. .Q:'V
  1. .S P=$P(X0,U,2)
  1. .Q:'P
  1. .S VD=+$G(^AUPNVSIT(V,0))
  1. .Q:'VD
  1. .Q:VD>DATE
  1. .;L ^BYIMEXP(0):1
  1. .F J=3,4 S X=$P(^BYIMEXP(0),U,J),X=X+1,$P(^BYIMEXP(0),U,J)=X
  1. .;L -^BYIMEXP(0)
  1. .;L ^BYIMEXP(X,0):1
  1. .S ^BYIMEXP(X,0)=P_U_DATE_U_DA_U_"E^MARKED AS EXPORTED WITHOUT EXPORT"
  1. .;L -^BYIMEXP(X,0)
  1. .S ^BYIMEXP("D",DA,X)="MARKED AS EXPORTED WITHOUT EXPORT"
  1. .W:'$D(ZTQUEUED) "."
  1. Q
  1. ;-----
  1. EN1 ;EP;TO SELECT DATES TO CLEAR 'D' XREFS FOR IMMUNIZATIONS DURING
  1. ;A DATE ;RANGE
  1. ;
  1. K DIR
  1. S DIR(0)="DO"
  1. S DIR("A")="Enter a beginning date to resend all immunizations"
  1. W @IOF
  1. W !!?5,"Enter a reference date."
  1. W !!?5,"ALL immunizations given from the date selected will"
  1. W !?5,"have the 'exported' flag removed so they will be exported"
  1. W !?5,"again in the daily batch immunization exports."
  1. W !
  1. D ^DIR
  1. K DIR
  1. Q:'Y
  1. S DATE=Y
  1. K DIR
  1. S DIR(0)="YO"
  1. S DIR("A")="Are you sure you want to proceed"
  1. S DIR("B")="NO"
  1. S Y=DATE
  1. X ^DD("DD")
  1. W !!?5,"ALL immunizations given on: ",Y," and after"
  1. W !?5,"will have the 'exported' flag removed"
  1. W !
  1. D ^DIR
  1. K DIR
  1. Q:'Y
  1. N DA,VDA,X0,P,V,VD,J
  1. S VD=DATE-.0001
  1. F S VD=$O(^AUPNVSIT("B",VD)) Q:'VD D
  1. .S VDA=0
  1. .F S VDA=$O(^AUPNVSIT("B",VD,VDA)) Q:'VDA D EN11
  1. Q
  1. ;-----
  1. EN11 ;CHECK VISIT RELATED IMM'S
  1. S DA=0
  1. F S DA=$O(^AUPNVIMM("AD",VDA,DA)) Q:'DA D:$D(^BYIMEXP("D",DA))
  1. .K ^BYIMEXP("D",DA)
  1. .W:'$D(ZTQUEUED) "."
  1. Q
  1. ;-----