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

VAQPST04.m

Go to the documentation of this file.
  1. VAQPST04 ;ALB/JFP - PDX, POST INIT ROUTINE ;01JUN93
  1. ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
  1. ALL ; --Creates an entry in the Segment Group file 394.84 of all segments
  1. I '$D(^VAT(394.71)) QUIT
  1. ;IF IT'S ALREADY THERE, DELETE IT
  1. S DA=""
  1. F S DA=+$O(^VAT(394.84,"B","ALL",DA)) Q:('DA) D
  1. .Q:($P(^VAT(394.84,DA,0),"^",2)=0)
  1. .S DIK="^VAT(394.84,"
  1. .D ^DIK K DIK
  1. W !," Creating a segment group called ""ALL"" "
  1. W !," This group will contain all data segments"
  1. S DIC="^VAT(394.84,",DIC(0)="L",DLAYGO=394.84,X="ALL"
  1. S DIC("DR")=".02///PUBLIC" ; -- Public
  1. K DD,DO
  1. D FILE^DICN K DIC,DLAYGO,X,DINUM
  1. I Y=-1 QUIT
  1. ; -- Add segments
  1. S DA=$P(Y,U,1),DIE="^VAT(394.84,",SEG=""
  1. F S SEG=$O(^VAT(394.71,"B",SEG)) Q:SEG="" D S1
  1. W !,"Done"
  1. K SEG,DA,DIE
  1. QUIT
  1. S1 ; -- Update existing entry
  1. W !," ",SEG," - added"
  1. S DR="10///"_SEG
  1. S DR(2,394.841)=".01///"_SEG
  1. D ^DIE K DR
  1. QUIT
  1. ;
  1. ;
  1. COP ; -- Creates entries in Segment group file from Health Summary Type file^GMT(142,
  1. N TMP
  1. I '$D(^GMT(142)) QUIT
  1. S DIR(0)="Y",DIR("B")="NO"
  1. S DIR("A")="Create entries in Segment Groups from Health Summary Type File"
  1. D ^DIR K DIR
  1. I ('Y)!($D(DUOUT))!($D(DTOUT)) QUIT
  1. ;
  1. S GRP=""
  1. F S GRP=$O(^GMT(142,"B",GRP)) Q:GRP="" D G1
  1. QUIT
  1. ;
  1. G1 ;
  1. ;IF IT'S ALREADY THERE, DELETE IT
  1. S DA=""
  1. F S DA=+$O(^VAT(394.84,"B",GRP,DA)) Q:('DA) D
  1. .Q:($P(^VAT(394.84,DA,0),"^",2)=0)
  1. .S DIK="^VAT(394.84,"
  1. .D ^DIK K DIK
  1. Q:(GRP="GMTS HS ADHOC OPTION")
  1. S ENTRY="",ENTRY=$O(^GMT(142,"B",GRP,ENTRY))
  1. S DIC="^VAT(394.84,",DIC(0)="L",DLAYGO=394.84,X=GRP
  1. S DIC("DR")=".02///PUBLIC" ; -- Public
  1. K DD,DO
  1. D FILE^DICN K DIC,DLAYGO,X,DINUM
  1. I Y=-1 QUIT
  1. ; -- Set components within entry
  1. W !!,?3,GRP," <-- Segment group added, the list of components follows"
  1. S DA=$P(Y,U,1),DIE="^VAT(394.84,",SEGPT=""
  1. F S SEGPT=$O(^GMT(142,ENTRY,1,"C",SEGPT)) Q:SEGPT="" D S0
  1. K SEG,DA,DIE
  1. QUIT
  1. ;
  1. S0 ;
  1. S SEG=$P($G(^GMT(142.1,SEGPT,0)),U,4)
  1. S SEGNM=$P($G(^GMT(142.1,SEGPT,0)),U,1)
  1. ;FILTER OUT NON-SUPPORTED COMPONENTS
  1. I ((SEG'="")&($D(^VAT(394.71,"C",SEG)))) D S2
  1. QUIT
  1. ;
  1. S2 ; -- Update existing entry
  1. W !,?10,SEG
  1. S DR="10///"_SEG
  1. S DR(2,394.841)=".01///"_SEG
  1. ;DETERMINE IF TIME & OCCURRENCE LIMITS ARE APPLICABLE
  1. S TMP=$$LIMITS^VAQDBIH3(SEGPT)
  1. ;PUT TIME LIMIT OF 1 YEAR (IF APPLICABLE)
  1. S:($P(TMP,"^",1)) DR(2,394.841)=DR(2,394.841)_";.04///1Y"
  1. ;PUT OCCURRENCE LIMIT OF 10 (IF APPLICABLE)
  1. S:($P(TMP,"^",2)) DR(2,394.841)=DR(2,394.841)_";.05///10"
  1. D ^DIE K DR
  1. W ?16," - ",SEGNM
  1. QUIT
  1. ;
  1. END ; -- End of code
  1. QUIT