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

PXIPOST.m

Go to the documentation of this file.
  1. PXIPOST ;ISL/dee - POST ROUTINE FOR PX PACKAGE ;8/12/96
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;;Aug 12, 1996
  1. ;IHS/ITSC/LJF 5/28/2003 bypassed code where IHS already has data set up via PCC
  1. EN ;
  1. ;Run post clean up routine
  1. N PXNEWCP
  1. ;S PXNEWCP=$$NEWCP^XPDUTL("PXPTPOST LOC","LOC^PXPTPOST") ;IHS/ITSC/LJF 5/28/2003 Location file already populated at IHS sites
  1. S PXNEWCP=$$NEWCP^XPDUTL("PXPTPOST MASTER","MASTER^PXPTPOST")
  1. S PXNEWCP=$$NEWCP^XPDUTL("PXIPOST1","PROTOCOL^PXIPOST1")
  1. S PXNEWCP=$$NEWCP^XPDUTL("PXIPOST","POST^PXIPOST")
  1. S PXNEWCP=$$NEWCP^XPDUTL("PXIPOST APPGRP","APPGRP^PXIPOST")
  1. ;S PXNEWCP=$$NEWCP^XPDUTL("PXIPOST AICS","AICS^PXIPOST") ;IHS/ITSC/LJF 5/28/2003 bypass AICS - not used by IHS
  1. S PXNEWCP=$$NEWCP^XPDUTL("PXIPOST SDAMPROT","SDAMPROT^PXIPOST")
  1. S PXNEWCP=$$NEWCP^XPDUTL("PXIPOST PACKAGE","PACKAGE^PXIPOST")
  1. ;S PXNEWCP=$$NEWCP^XPDUTL("PXIPOST QUE","QUE^PXIPOST") ;IHS/ITSC/LJF 5/28/2003 file 9000001 already populated at IHS sites
  1. Q
  1. ;
  1. POST ;
  1. S $P(^AUPNVPRV(0),"^",2)="9000010.06AIP"
  1. ;
  1. ;Set the SD/PCE SWITCH OVER DATE
  1. I $P($G(^PX(815,1,0)),"^",2)'>2960000,$G(XPDQUES("POS SWITCH DATE")),XPDQUES("POS SWITCH DATE")>2960000,XPDQUES("POS SWITCH DATE")<2961002 D
  1. . I $D(^PX(815,1,0))#2 S $P(^PX(815,1,0),"^",2)=XPDQUES("POS SWITCH DATE")
  1. . E S ^PX(815,1,0)="1^"_XPDQUES("POS SWITCH DATE")
  1. ;
  1. ;Set the HEALTH SUMMARY START DATE
  1. I $P($G(^PX(815,1,0)),"^",3)'>1800000,$P($G(^PX(815,1,0)),"^",2)>2960000 D
  1. . S $P(^PX(815,1,0),"^",3)=$P(^PX(815,1,0),"^",2)
  1. ;
  1. SET ;Set PCE into the package multiple in visit tracking
  1. N VAR
  1. S VAR=$$PKGON^VSIT("PX") I VAR'=1 S VAR=$$PKG^VSIT("PX",1)
  1. Q
  1. ;
  1. APPGRP ;
  1. D BMES^XPDUTL("Add ""PXRM"" Application Group to file 60, 71, 120.51")
  1. D MES^XPDUTL(" Done only if not there already.")
  1. N GMI
  1. K DIC,DA,DD,DO
  1. F GMI=60,71,120.51 I '$D(^DIC(GMI,"%","B","PXRM")) D
  1. . ;
  1. . Q:'$D(DIC(GMI,0)) ;IHS/ITSC/LJF 5/28/2003 quit if site doesn't have file
  1. . ;
  1. . S DIC="^DIC("_GMI_",""%"","
  1. . S DIC(0)="L"
  1. . S DA(1)=GMI
  1. . S X="PXRM"
  1. . S DIC("P")=$P(^DD(1,10,0),"^",2)
  1. . D FILE^DICN
  1. . K DIC,DA,DD,DO
  1. . D:+Y>0 BMES^XPDUTL("Adding ""PXRM"" Application Group to ^DIC("_GMI_",")
  1. ;
  1. APPGRP2 ;
  1. D BMES^XPDUTL("Add ""PXRS"" Application Group to file 80, 80.1, 81")
  1. D MES^XPDUTL(" Done only if not there already.")
  1. K GMI,DIC,DA,DD,DO
  1. F GMI=80,80.1,81 I '$D(^DIC(GMI,"%","B","PXRS")) D
  1. . S DIC="^DIC("_GMI_",""%"","
  1. . S DIC(0)="L"
  1. . S DA(1)=GMI
  1. . S X="PXRS"
  1. . S DIC("P")=$P(^DD(1,10,0),"^",2)
  1. . D FILE^DICN
  1. . K DIC,DA,DD,DO
  1. . D:+Y>0 BMES^XPDUTL("Adding ""PXRS"" Application Group to ^DIC("_GMI_",")
  1. Q
  1. ;
  1. AICS ;Below is copyed form PXACT^IBD21PT2
  1. PXACT ; -- if pce is installed, activate the selection package interfaces
  1. D BMES^XPDUTL("Activate the selection package interfaces in AICS for PCE")
  1. N I,J
  1. K X,Y
  1. I $D(^AUTTEDT(0)) D ; education topics installed
  1. .F I=1:1 S X=$P($T(INTRFCE+I),";;",2) Q:X="" D
  1. ..S IBDIEN=$O(^IBE(357.6,"B",X,0))
  1. ..Q:'IBDIEN
  1. ..Q:$G(^IBE(357.6,IBDIEN,0))=""
  1. ..Q:$P($G(^IBE(357.6,IBDIEN,0)),"^",9)=1 ;already available
  1. ..S $P(^IBE(357.6,IBDIEN,0),"^",9)=1 ;makes it available
  1. ..D BMES^XPDUTL(">>> AICS interface ",X," now available.")
  1. ;
  1. AICSPROT ;
  1. D BMES^XPDUTL("Attach other packages' protocol to PCE's protocols.")
  1. N IBDF,PXCA,PXK,IBDFNAME,PXCANAME,PXKNAME
  1. K DIC,DA,X,Y
  1. S IBDFNAME="IBDF PCE EVENT"
  1. S IBDF=$O(^ORD(101,"B",IBDFNAME,0))
  1. S PXCANAME="PXCA DATA EVENT"
  1. S PXCA=$O(^ORD(101,"B",PXCANAME,0))
  1. S PXKNAME="PXK VISIT DATA EVENT"
  1. S PXK=$O(^ORD(101,"B",PXKNAME,0))
  1. I IBDF>0 D
  1. . S DIC(0)="LSX"
  1. . S DIC("P")=$P(^DD(101,10,0),"^",2)
  1. . I PXCA>0 D
  1. .. D MES^XPDUTL(" Adding protocol "_IBDFNAME_" to extended action protocol "_PXCANAME)
  1. .. S DA(1)=PXCA
  1. .. I $O(^ORD(101,DA(1),10,"B",IBDF,0))>0 D MES^XPDUTL(" ... already there") Q
  1. .. S DIC="^ORD(101,"_DA(1)_",10,"
  1. .. S X=IBDFNAME
  1. .. D ^DIC
  1. . I PXK>0 D
  1. .. D MES^XPDUTL(" Adding protocol "_IBDFNAME_" to extended action protocol "_PXKNAME)
  1. .. S DA(1)=PXK
  1. .. I $O(^ORD(101,DA(1),10,"B",IBDF,0))>0 D MES^XPDUTL(" ... already there") Q
  1. .. S DIC="^ORD(101,"_DA(1)_",10,"
  1. .. S X=IBDFNAME
  1. .. D ^DIC
  1. Q
  1. ;
  1. SDAMPROT ;
  1. N IBDF,PXCA,PXK,IBDFNAME,PXCANAME,PXKNAME
  1. K DIC,DA,X,Y
  1. S SDAMNAME="SDAM PCE EVENT"
  1. S SDAM=$O(^ORD(101,"B",SDAMNAME,0))
  1. S PXKNAME="PXK VISIT DATA EVENT"
  1. S PXK=$O(^ORD(101,"B",PXKNAME,0))
  1. I SDAM>0 D
  1. . S DIC(0)="LSX"
  1. . S DIC("P")=$P(^DD(101,10,0),"^",2)
  1. . I PXK>0 D
  1. .. D MES^XPDUTL(" Adding protocol "_SDAMNAME_" to extended action protocol "_PXKNAME)
  1. .. S DA(1)=PXK
  1. .. I $O(^ORD(101,DA(1),10,"B",SDAM,0))>0 D MES^XPDUTL(" ... already there") Q
  1. .. S DIC="^ORD(101,"_DA(1)_",10,"
  1. .. S X=SDAMNAME
  1. .. D ^DIC
  1. Q
  1. ;
  1. ;
  1. PACKAGE ;Remove the old package entries that are no longer used.
  1. N PACKAGE,NAME
  1. N DA,DIC,DIK
  1. D BMES^XPDUTL("Deleting old package file entries & Deleting old Order Parameters.")
  1. F NAME="PCE PATIENT/IHS SUBSET" D
  1. . K DA,DIC
  1. . S DIC=9.4
  1. . S DIC(0)="IOSX"
  1. . S X=NAME
  1. . D ^DIC
  1. . I +Y>0 D
  1. .. S PACKAGE=+Y
  1. .. I $O(^ORD(100.99,1,5,PACKAGE,""))]"" D
  1. ... ;Remove the Order Parameter entry for this package.
  1. ... K DIK
  1. ... S DIK="^ORD(100.99,1,5,"
  1. ... S DA(1)=1,DA=PACKAGE
  1. ... D MES^XPDUTL(" Deleting Order Parameter for package -- "_NAME)
  1. ... I DA>0 D ^DIK
  1. .. D MES^XPDUTL(" Deleting Package ++ "_NAME)
  1. .. K DIK
  1. .. S DIK="^DIC(9.4,"
  1. .. S DA=PACKAGE
  1. .. D ^DIK
  1. Q
  1. ;
  1. QUE ; Queue job to populate IHS Patient File #9000001
  1. N ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSK,ZTSAVE
  1. N PXPTLOC,DINUM,PXPTLAST
  1. D GETLOC^PXPTPOST
  1. I 'PXPTLOC D Q
  1. . D MES^XPDUTL($C(7)_$C(7)_"Could not start the task job.")
  1. . D MES^XPDUTL("You should start it by doing: D QUE^PXPTPOST at the programmers prompt.")
  1. S PXPTLAST=$P($G(^PX(815,1,"PXPT")),"^",2)
  1. I PXPTLAST>0 S $P(^PX(815,1,"PXPT"),"^",2)=0
  1. Q1 D BMES^XPDUTL("Populating the Patient/IHS File #9000001 via the following queued job ... ")
  1. S ZTRTN="LOAD^PXXDPT",ZTDESC="Patient File (#9000001) Population",ZTIO=""
  1. S ZTDESC="Populating the Patient/IHS File"
  1. S ZTDTH=$H,ZTIO=""
  1. D ^%ZTLOAD
  1. I $D(ZTSK) D MES^XPDUTL("The job is task # "_ZTSK)
  1. I '$D(ZTSK) D MES^XPDUTL("Could not start the task job.") D BMES^XPDUTL("You should start it by doing: D QUE^PXPTPOST at the programmers prompt.")
  1. D MES^XPDUTL("")
  1. Q
  1. ;