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

BLRMPC.m

Go to the documentation of this file.
  1. BLRMPC(REFLAB,DIR,FILE) ; cmi/anch/maw - BLR Import Reference Lab Order/Result Codes ;
  1. ;;5.2;LR;**1021**;Jul 27, 2006
  1. ;;1.0;BLR REFERENCE LAB;;MAR 14, 2005
  1. ;
  1. ;
  1. ;this routine will read in a ref lab database and attempt to
  1. ;match against file 60
  1. ;
  1. ;EP - This is the main routine driver
  1. S C=","
  1. D LOAD(REFLAB,DIR,FILE)
  1. Q:$G(BLRFLG)
  1. Q
  1. ;D EOJ
  1. Q
  1. ;
  1. LOAD(RL,DIR,FL) ;-- load from the file and stuff in BLR REFERENCE LAB File
  1. S BLRLI=$$REF(RL)
  1. S BLRY=$$OPEN^%ZISH(DIR,FL,"R")
  1. I BLRY D Q
  1. . S BLRFLG=1
  1. . W !,"Trouble Opening File, please fix and try again" Q
  1. F BLRI=1:1 U IO R BLRX:DTIME D Q:BLRX=""
  1. . Q:BLRX=""
  1. . S ORDC=$P(BLRX,C)
  1. . S TNM=$P(BLRX,C,2)
  1. . S RESC=$P(BLRX,C,3)
  1. . S TNMA=$P(BLRX,C,4)
  1. . S BLRTI=$$ADD(BLRLI,ORDC,TNM,RESC,TNMA)
  1. . Q:'BLRTI
  1. . Q
  1. . ;S BLRLT=$$MTCH(BLRTI)
  1. Q
  1. ;
  1. REF(RLNM) ;-- check for existence of ref lab, add if not there
  1. I $O(^BLRRL("B",RLNM,0)) Q $O(^BLRRL("B",RLNM,0))
  1. K DD,DO
  1. S DIC="^BLRRL(",DIC(0)="L",X=RLNM
  1. D FILE^DICN
  1. Q +Y
  1. ;
  1. ADD(LI,OCD,NM,RCD,NMA) ;-- add the test code to the file
  1. K ORD,RES
  1. I $O(^BLRRL("BORD",OCD,LI,0)) S ORD=1
  1. I $O(^BLRRL("BRES",RCD,LI,0)) S RES=1
  1. I '$G(ORD) D
  1. . Q:NM=""
  1. . K BLROI
  1. . K DD,DO
  1. . S DA(1)=LI
  1. . S DIC("P")=$P(^DD(9009026,10,0),"^",2)
  1. . S DIC="^BLRRL("_LI_",1,",DIC(0)="L",X=NM
  1. . S DIC("DR")=".03///"_OCD
  1. . D FILE^DICN
  1. . S BLROI=+Y
  1. I '$G(RES) D
  1. . Q:NMA=""
  1. . K BLROI
  1. . K DD,DO
  1. . S DA(1)=LI
  1. . S DIC("P")=$P(^DD(9009026,10,0),"^",2)
  1. . S DIC="^BLRRL("_LI_",1,",DIC(0)="L",X=NMA
  1. . S DIC("DR")=".04///"_RCD
  1. . D FILE^DICN
  1. . S BLROI=+Y
  1. Q $G(BLROI)
  1. ;