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

LR232P.m

Go to the documentation of this file.
LR232P ;DALOI/FHS - LR*5.2*232 POST INSTALL ROUTINE;31 -AUG-2001
 ;;5.2;LAB SERVICE'**232**;Sep 27, 1994
ENP ;Resolve pointers saved in XTMP("LR232",FILE#)
 Q:'$D(XPDNM)
 N D0,DA,DC,IEN,LR642,LRDA,LRDATA,LRENTRY,LRERR,LRFDA,LRFIELD,LRFILE
 N LRGN,LRIEN,LRLKUP,LRLVL,LRMSG,LRNAME,LRNODE,LRNOP,LROUT,LRP,LRPTR,LRSUB
 Q:'$G(^XTMP("LR232",1))  ; The save pointer did not go to completion
 D SING(61,.09)
 D SING(62.05,4)
 D O628
 D SING(62.85,.05)
 D O682
 D SING(69.6,6)
 D O6964
 D BMES^XPDUTL($$CJ^XLFSTR("Pointer Resolution Completed",IOM))
 Q
HDR(LRFILE) ;Print file being resolved
 K LRNAME,LRERR
 D FILE^DID(LRFILE,"","NAME","LRNAME","LRERR")
 Q:$D(LRERR)
 S LRHDR="Resolving "_$S('$D(LRERR):LRNAME("NAME"),1:LRFILE)_" Pointers"
 D BMES^XPDUTL($$CJ^XLFSTR(LRHDR,IOM))
 D FILE^DID(LRFILE,"","GLOBAL NAME","LRGN","LRERR")
 Q
SING(LRFILE,LRFIELD) ;Resolve Pointer in LRFILE (file number) by LRFIELD (field to edit)
 Q:'LRFILE!'LRFIELD
 D HDR(LRFILE)
 I $D(LRERR) K ^XTMP("LR232",LRFILE) Q
 K LRDA,LRIEN,LRNODE,LRPTR,LROUT
 S LRDA=0 F  S LRDA=$O(^XTMP("LR232",LRFILE,LRDA)) Q:LRDA<1  D
 . I '(LRDA#500) W "*"
 . K LROUT,LRMSG
 . S LRPTR=$O(^XTMP("LR232",LRFILE,LRDA,0)) I 'LRPTR K ^XTMP("LR232",LRFILE,LRDA) Q
 . I '$D(@(LRGN("GLOBAL NAME")_LRDA_",0)")) K ^XTMP("LR232",LRFILE,LRDA) Q
 . S LRNODE=^XTMP("LR232",LRFILE,LRDA,LRPTR),LRPTR=LRPTR_","
 . D GETS^DIQ(64.061,LRPTR,.01,"E","LROUT")
 . I $G(LROUT(64.061,LRPTR,.01,"E"))=$P(LRNODE,U) W:$G(LRDBUG) LRPTR_" OK",! K ^XTMP("LR232",LRFILE,LRDA,+LRPTR) Q
 . S LRIEN=$$IENS^DILF(.LRDA)
 . K LRFDA,LRMSG,LRLKUP
 . D GETNAM(LRPTR,64.061)
 . D LK($P(LRNODE,U))
 . I $D(LRMSG) K ^XTMP("LR232",LRFILE,+LRDA,+LRPTR) Q
 . I '$G(LRLKUP("DILIST",2,1))  K ^XTMP("LR232",LRFILE,+LRDA,+LRPTR) Q
 . S LRFDA(LRFILE,LRIEN,LRFIELD)=LRLKUP("DILIST",2,1)
 . D BMES^XPDUTL($$LJ^XLFSTR("   Updating "_LROUT(64.061,LRPTR,.01,"E")_" to "_$P(LRNODE,U),IOM))
 . D FILE^DIE("KS","LRFDA","LRMSG")
 . I '$D(LRMSG) K ^XTMP("LR232",LRFILE,LRDA,+LRPTR)
 Q
LK(VAL) ;Lookup specimens
 D FIND^DIC(64.061,"",".01","X",VAL,"","B","","","LRLKUP","LRMSG")
 Q
O628 ; Resolve pointers for LAB SHIPPING MANIFEST 62.8
 K LRIEN,LRFILE S LRIEN=0,LRFILE=62.8
 D HDR(LRFILE)
 F  S LRIEN=$O(^XTMP("LR232",LRFILE,LRIEN)) Q:LRIEN<1  D
 . I '(LRIEN#500) W "*"
 . K LRSUB S LRSUB=0
 . F  S LRSUB=$O(^XTMP("LR232",LRFILE,LRIEN,LRSUB)) Q:LRSUB<1  D
 . . K LRLVL S LRLVL=0
 . . S LRLVL=$O(^XTMP("LR232",LRFILE,LRIEN,LRSUB,LRLVL)) Q:LRLVL<1  D
 . . K LRNODE,LRP,LRFDA,LRMSG S LRNOP=0
 . . D LVL(LRLVL)
 . . I $D(LRFDA) D FILE^DIE("KS","LRFDA","LRMSG")
 . . I '$D(LRMSG) K ^XTMP("LR232",LRFILE,LRIEN,LRSUB)
 Q
LVL(LRLVL) ;
 S LRNODE=$G(^XTMP("LR232",LRFILE,LRIEN,LRSUB,LRLVL)) D
 . I LRLVL=1 F LRP=3,6 S LRP(LRP)=$P(LRNODE,U,LRP) D CHK
 . I LRLVL=2 F LRP=3,7,12 S LRP(LRP)=$P(LRNODE,U,LRP) D CHK
 I $G(LRNOP)>1 K ^XTMP("LR232",LRFILE,LRIEN,LRSUB,LRLVL)
 Q
CHK ;
 N LRCHKIEN
 Q:'LRP(LRP)
 S LRDATA=$P(LRP(LRP),"|",2)
 I '$L(LRDATA) S LRNOP=$G(LRNOP)+1 Q
 S LRPTR=+LRP(LRP)_","
 D GETNAM(LRPTR,64.061)
 I $G(LROUT(64.061,LRPTR,.01,"E"))=$P(LRP(LRP),"|",2) W:$G(LRDBUG) LRPTR_" Ok",! S LRNOP=$G(LRNOP)+1 Q
 D  I 'LRDATA S LRNOP=$G(LRNOP)+1 Q
 . D LK(LRDATA)
 . S LRDATA=+$G(LRLKUP("DILIST",2,1))
 S LRCHKIEN=LRSUB_","_LRIEN_","
 I $G(LRLVL)=1,$G(LRP)=3 S LRFDA(62.801,LRCHKIEN,1.13)=LRDATA
 I $G(LRLVL)=1,$G(LRP)=6 S LRFDA(62.801,LRCHKIEN,1.23)=LRDATA
 I $G(LRLVL)=2,$G(LRP)=3 S LRFDA(62.801,LRCHKIEN,2.13)=LRDATA
 I $G(LRLVL)=2,$G(LRP)=7 S LRFDA(62.801,LRCHKIEN,2.23)=LRDATA
 I $G(LRLVL)=2,$G(LRP)=12 S LRFDA(62.801,LRCHKIEN,2.24)=LRDATA
 Q
GETNAM(LRPTR,LRFILE) ;Return the external name for the code
 K LROUT
 D GETS^DIQ(LRFILE,LRPTR,.01,"E","LROUT")
 Q
O682 ;Resolve pointer for LOAD/WORK LIST LRO(68.2
 S LRFILE=68.2 D HDR(LRFILE)
 S LRIEN=0
 F  S LRIEN=$O(^XTMP("LR232",LRFILE,LRIEN)) Q:LRIEN<1  D
 . K D0,DA,DC
 . S LRPTR=$O(^XTMP("LR232",LRFILE,LRIEN,0)),LRPTR=LRPTR_","
 . W "*" W:$G(LRDBUG) LRPTR
 . S LRNODE=$G(^XTMP("LR232",LRFILE,LRIEN,+LRPTR))
 . I 'LRNODE K ^XTMP("LR232",LRFILE,LRIEN,+LRPTR) Q
 . K LRFDA,LRMSG,LROUT
 . S LR642=$P(LRNODE,U,3) S:LR642=".000" LR642=".0000"
 . D FIND^DIC(64.2,"",".01;1","X",LR642,"","F","","","LROUT","LRMSG")
 . I $O(LROUT("DILIST",1,1)) K ^XTMP("LR232",LRFILE,LRIEN,+LRPTR) Q
 . I '$D(LROUT("DILIST",1,1)) K ^XTMP("LR232",LRFILE,LRIEN,+LRPTR) Q
 . I $D(LRMSG) K ^XTMP("LR232",LRFILE,LRIEN,+LRPTR) Q
 . I '$G(LROUT("DILIST",2,1)) K ^XTMP("LR232",LRFILE,LRIEN,+LRPTR) Q
 . S (D0,DC,DA,LRFDA(68.2,LRIEN_",",.14))=LROUT("DILIST",2,1)
 . D FILE^DIE("KS","LRFDA","LRMSG")
 . K D0,DC,DA
 . I '$D(LRMSG) K ^XTMP("LR232",LRFILE,LRIEN,+LRPTR)
 Q
O6964 ;Repoint the LAB PENDING ORDER - ORDERED TEST multiple
 K LRFILE,LRIEN
 S LRFILE=69.6 D HDR(LRFILE) D BMES^XPDUTL($$CJ^XLFSTR("Subfile entries",IOM))
 S LRIEN=0 F  S LRIEN=$O(^XTMP("LR232",69.64,LRIEN)) Q:LRIEN<1  D
 . I '(LRIEN#500) W "*"
 . S LRSUB=0 F  S LRSUB=$O(^XTMP("LR232",69.64,LRIEN,LRSUB)) Q:LRSUB<1  D
 . . S LRPTR=0 F  S LRPTR=$O(^XTMP("LR232",69.64,LRIEN,LRSUB,LRPTR)) Q:LRPTR<1  D
 . . . I 'LRPTR K ^XTMP("LR232",69.64,LRIEN,LRSUB) Q
 . . . S LRNODE=$G(^XTMP("LR232",69.64,LRIEN,LRSUB,LRPTR))
 . . . D GETNAM(LRPTR_",",64.061)
 . . . I $G(LROUT(64.061,LRPTR_",",.01,"E"))=$P(LRNODE,U) W:$G(LRDBUG) " OK "_LRIEN K ^XTMP("LR232",69.64,LRIEN,LRSUB,+LRPTR) Q
 . . . S IEN=LRSUB_","_LRIEN_","
 . . . K LRFDA,LRMSG
 . . . S LRFDA(69.6,IEN,5)=$P(LRNODE,U)
 . . . D FILE^DIE("EKS","LRFDA","LRMSG")
 . . . I '$D(LRMSG) K ^XTMP("LR232",69.64,LRIEN,LRSUB,+LRPTR)
 Q