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

ADGPOST.m

Go to the documentation of this file.
  1. ADGPOST ; IHS/ADC/PDW/ENM - ADT POSTINITS ; [ 03/25/1999 11:48 AM ]
  1. ;;5.0;ADMISSION/DISCHARGE/TRANSFER;;MAR 25, 1999
  1. ;
  1. ;searhc/maw removed call to adgcp which is the patient movement
  1. ;and provider conversion, this should be run at the end.
  1. ;
  1. ;D DS,^ADGCP,XREF Q
  1. D DS,XREF Q
  1. ;
  1. DS ; day surgery service category fix
  1. ; -- changes all day surgeries to category "S"
  1. ; -- change is hard set so APCIS xref not triggered
  1. W !!!,"Converting day surgery visits to service category ""S""",!
  1. NEW DSDT,REVDT,DSIEN,DFN,VISIT,CODE
  1. S CODE=$O(^DIC(40.7,"C",44,0)) Q:CODE=""
  1. S DFN=0
  1. F S DFN=$O(^ADGDS(DFN)) Q:'DFN D
  1. . S DSIEN=0
  1. . F S DSIEN=$O(^ADGDS(DFN,"DS",DSIEN)) Q:'DSIEN D
  1. .. S X=$P($G(^ADGDS(DFN,"DS",DSIEN,2)),U) Q:X=""
  1. .. Q:'$D(^ADGDS(DFN,"DS",DSIEN,0)) S DATE=+^(0) Q:DATE<1
  1. .. S REVDT=9999999-$P(DATE,"."),REVDT=REVDT_"."_$P(DATE,".",2)
  1. .. ;
  1. .. S VISIT=0
  1. .. F S VISIT=$O(^AUPNVSIT("AA",DFN,REVDT,VISIT)) Q:VISIT="" D
  1. ... S X=$G(^AUPNVSIT(VISIT,0)) Q:X="" Q:$P(X,U,8)'=CODE
  1. ... Q:$P(X,U,7)'="A"
  1. ... S $P(^AUPNVSIT(VISIT,0),U,7)="S" ;change serv cat to day surg
  1. Q
  1. ;
  1. XREF ; -- reindex incomplete chart and ds incomplete chart files
  1. W !!,"Re-Indexing Incomplete Chart File..."
  1. S DIK="^ADGIC(" D IXALL^DIK
  1. W !!,"Re-Indexing DS Incomplete Chart File...",!
  1. S DIK="^ADGDSI(" D IXALL^DIK
  1. Q