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

LA7SMU1.m

Go to the documentation of this file.
  1. LA7SMU1 ;VA/DALOI/JMC - Shipping Manifest Utility (Cont'd);JUL 06, 2010 3:14 PM
  1. ;;5.2;AUTOMATED LAB INSTRUMENTS;**27,46,65,64,1027**;NOV 01, 1997
  1. ;
  1. Q
  1. ;
  1. SMW(LA7SM) ; "Write" additional information on DIC lookup of #62.48.
  1. ; Called by DIC("W")
  1. ; Call with LA7SM = ien of entry in file #62.8
  1. ;
  1. N LA7X,LA7Y,LA7EVC
  1. ;
  1. S LA7SM(0)=$G(^LAHM(62.8,LA7SM,0))
  1. ; Shipping configuration
  1. S LA7X=" "_$P($G(^LAHM(62.9,$P(LA7SM(0),"^",2),0)),"^")
  1. S LA7X=LA7X_" Status: "_$$EXTERNAL^DILFD(62.8,.03,"",$P(LA7SM(0),"^",3))
  1. S LA7EVC="SM"_$S($P(LA7SM(0),"^",3)=0:"00",1:$P("02^03^04^05^07","^",+$P(LA7SM(0),"^",3)))
  1. S LA7Y=$$SMED^LA7SMU(LA7SM,LA7EVC)
  1. S LA7X=LA7X_" as of "_$P(LA7Y,"^",2)
  1. D EN^DDIOL(LA7X,"","?18")
  1. Q
  1. ;
  1. ;
  1. ADATE ; Select accession dates if specified
  1. ;
  1. N DIR,DIRUT,DTOUT,LRAA,X,Y
  1. ;
  1. S DIR(0)="YO",DIR("A")="Use default accession dates",DIR("B")="YES"
  1. S DIR("?",1)="Enter ""YES"" to use the current accession date for each accession area utilized by this shipping configuration."
  1. S DIR("?",2)=" "
  1. S DIR("?")="If you select ""NO"" then you will be asked to specify a specific accession date and starting and ending accession numbers for each accession area."
  1. D ^DIR
  1. ; User aborted
  1. I $D(DIRUT) S LA7QUIT=1 Q
  1. ; Use default accession dates
  1. I Y=1 Q
  1. ;
  1. S X=0
  1. F S X=$O(^LAHM(62.9,+LA7SCFG,60,X)) Q:'X D
  1. . S X(0)=$G(^LAHM(62.9,+LA7SCFG,60,X,0))
  1. . I $P(X(0),"^",2),'$D(LA7AA($P(X(0),"^",2))) S LA7AA($P(X(0),"^",2))=""
  1. ;
  1. S LA7AA=0
  1. F S LA7AA=$O(LA7AA(LA7AA)) Q:'LA7AA D Q:LA7QUIT
  1. . N %DT,DTOUT,LRAA,LRAD,LREND,LRFAN,LRLAN
  1. . D EN^DDIOL("For Accession Area: "_$P($G(^LRO(68,LA7AA,0)),"^"),"","!!?2")
  1. . S LRAA=LA7AA D ADATE^LRWU3
  1. . I Y<1!($G(DTOUT)) S LA7QUIT=1 Q
  1. . S LA7AA(LA7AA)=$G(LRAD)
  1. . D LRAN^LRWU3
  1. . I LREND S LA7QUIT=1 Q
  1. . S LA7AA(LA7AA)=$G(LRAD)_"^"_$G(LRFAN)_"^"_$G(LRLAN)
  1. Q
  1. ;
  1. ;
  1. ASKPREV() ; Ask if build should exclude tests from building that have previously
  1. ; been removed from a manifest. Allows user to control if tests rebuild
  1. ; onto the same or different manifest.
  1. ;
  1. N DIR,DIRUT,DTOUT,DUOUT,X,Y
  1. ;
  1. S DIR(0)="YO"
  1. S DIR("A")="Exclude previously removed tests from building"
  1. S DIR("B")="YES"
  1. S DIR("?",1)="Answer 'YES' if you do NOT want tests previously removed"
  1. S DIR("?",2)="from a manifest to be added to this manifest."
  1. S DIR("?",3)=" "
  1. S DIR("?",4)="Answer 'NO' if you WANT tests to be added to this manifest"
  1. S DIR("?",5)="that were previously removed from a manifest and are"
  1. S DIR("?")="otherwise eligible to be added."
  1. D ^DIR
  1. Q $S($D(DIRUT):-1,1:+Y)
  1. ;
  1. ;
  1. PREV(LA7UID,LA760) ; Determine if test previously removed from a manifest.
  1. ; Checks all manifests for accession/test combination.
  1. ; Call with LA7UID = accession's uid
  1. ; LA760 = file #60 test ien
  1. ;
  1. ; Returns 0 = not previously removed from a manifest
  1. ; 1 = previously removed from a manifest
  1. ;
  1. ; Called by LA7SMB
  1. ;
  1. N LA7628,LA762801,LA7FLAG,LA7ROOT,LA7X
  1. ;
  1. S LA7FLAG=0
  1. I '$L($G(LA7UID))!'(+$G(LA760)) Q LA7FLAG
  1. S LA7ROOT="^LAHM(62.8,""UID"",LA7UID)"
  1. F S LA7ROOT=$Q(@LA7ROOT) Q:$QS(LA7ROOT,3)'=LA7UID D Q:LA7FLAG
  1. . ; Manifest and specimen ien
  1. . S LA7628=$QS(LA7ROOT,4),LA762801=$QS(LA7ROOT,5)
  1. . S LA7X=$G(^LAHM(62.8,LA7628,10,LA762801,0))
  1. . ; Found previous test removal
  1. . I $P(LA7X,"^",2)=LA760,$P(LA7X,"^",8)=0 S LA7FLAG=1
  1. Q LA7FLAG
  1. ;
  1. ;
  1. DOT(LA7CODE,LA7NCS,LA7UID,LA7628) ; Determine ordered tests
  1. ;
  1. ; Call with LA7CODE = Test code to look up
  1. ; LA7NCS = name of coding system
  1. ; LA7UID = accession's UID
  1. ; LA7628 = ien of shipping manifest in #62.8
  1. ;
  1. ; Returns LA760 = ien of test entry in file #60 if found
  1. ;
  1. ; Given a test code, accession and a shipping manifest finds the
  1. ; file #60 test which is associated with the test code on the manifest.
  1. ;
  1. ; Called from LA7VIN4 to determine ordered test and update shipping event.
  1. N LA760,LA764,LA7I,LA7X,LA7Y
  1. ;
  1. S (LA760,LA764)=0
  1. ; Quit if no code, UID or configuration passed.
  1. I $G(LA7CODE)=""!($G(LA7UID)="")!($G(LA7628)="") Q LA760
  1. ;
  1. ; Using NLT codes
  1. I $G(LA7NCS)="99VA64" S LA764=+$O(^LAM("E",LA7CODE,0))
  1. ;
  1. ; Try NLT in case other system is returning NLT codes but not saying so
  1. I 'LA764,$D(^LAM("E",LA7CODE)) S LA764=+$O(^LAM("E",LA7CODE,0))
  1. ;
  1. S LA7I=0
  1. F S LA7I=$O(^LAHM(62.8,LA7628,10,"UID",LA7UID,LA7I)) Q:'LA7I D Q:LA760
  1. . S LA7X=$G(^LAHM(62.8,LA7628,10,LA7I,0))
  1. . S LA7Y=$P(LA7X,"^",2)
  1. . ; Found match on NLT code
  1. . I LA7Y,+$P(^LAB(60,LA7Y,64),"^")=LA764 S LA760=LA7Y Q
  1. . ; Found match on non-VA code
  1. . I LA7CODE=$P($G(^LAHM(62.8,LA7628,10,LA7I,5)),"^") S LA760=LA7Y
  1. ;
  1. Q LA760