Lab display in CPRS question: How is order defined?

127 views
Skip to first unread message

Kevin Toppenberg

unread,
Dec 16, 2015, 5:31:13 PM12/16/15
to Hardhats

My CPRS is displaying my labs in a mixed up order, compared to the way a usual CBC is displayed.  It is this way for all my panels. Here is an example.  The differential (the part with the %'s) should always come at the bottom.



The order of the display comes from the RPC call, which is also out of order.  


ORWLRR INTERIMG
Called at: 5:20:34 PM
 
Params ------------------------------------------------------------------
literal 28090
literal 3151030.102202
literal 1
literal 1
 
Results -----------------------------------------------------------------
15^CH^3151030.102201^70^BLOOD^^0^^^3151030.102201
5076^NEUTROPHIL %^    55.8^^%^41.0 - 77.0
5077^LYMPHOCYTE %^    29.1^^%^14.0 - 48.0
5078^MONOCYTE %^    11.4^^%^4.0 - 13.0
5079^EOSINOPHIL %^     2.6^^%^1.0 - 8.0
5080^BASOPHIL %^     0.9^^%^0.0 - 1.5
5516^IMMATURE GRANULOCYTE AUTOMATED^     0.2^^%^0.0 - 1.0
2^RBC^    4.23^^M/mm3^3.70 - 5.10
3^HGB^    12.7^^gm/dL^12.0 - 16.0
4^HCT^    38.7^^%^37.4 - 48.3
5^MCV^    91.5^^fL^81.0 - 102.0
6^MCH^    30.0^^pg^26.9 - 35.0
7^MCHC^    32.8^^g/dL^29.5 - 33.5
416^RDW^    42.4^^fL^38.6 - 53.8
9^PLT ^     193^^K/cumm^137 - 397
1^WBC^     4.2^^K/uL^3.8 - 12.8
Report Released Date/Time: Oct 31, 2015@00:35
Comment: 
    
   Test performed by PathGroup Labs 
   658 Grassmere Park Suite 101, Nashville, TN 37211 
   Mary Mayo, Ph.D., Medical Director 
Performing Lab: PATHGROUP
                PathGroup 5301 Virginia Way Brentwood, TN 37027
 
Elapsed Time: 217 ms

I have tried tracing through the code, but am having a hard time following the minimally commented code.

Here is a dump of the definition of this CBC/ 

Record# 276, in FILE: 60
   .01-NAME : CBC & MORPHOLOGY (WITH DIFF)
     1-TEST COST :
     2-SYNONYM :
       Multiple Entry #1
       .01-SYNONYM : LMH-CBCD

       Multiple Entry #2
       .01-SYNONYM : PG-CBCWD


     3-TYPE : INPUT (CAN BE ORDERED)
     4-SUBSCRIPT : CHEM, HEM, TOX, SER, RIA, ETC.
     5-LOCATION (DATA NAME) :
     6-ACCESSION AREA :
       Multiple Entry #69
       .01-INSTITUTION : Family Phys of Greeneville (`69 in #4)
         1-ACCESSION AREA : PATHGROUP ACCESSION (`39 in #68)


     7-UNIQUE ACCESSION # :
     8-UNIQUE COLLECTION SAMPLE : YES
     9-LAB COLLECTION SAMPLE : BLOOD   (`3 in #62)
    10-REQUIRED TEST :
    13-FIELD :
    14-PROCEDURE (SNOMED) :
    15-*QUICK INDEX :
    16-EXTRA LABELS :
    17-HIGHEST URGENCY ALLOWED : STAT (`1 in #62.05)
    18-FORCED URGENCY :
    51-PRINT NAME : CBC+DIF
    52-Reserved :
    53-PRINT CODE :
    54-PRETTY PRINT ENTRY :
    55-PRETTY PRINT ROUTINE :
    56-PRINT ORDER :
    64-NATIONAL VA LAB CODE : Hemogram Manual (`2679 in #64)
  64.1-RESULT NLT CODE : Hemogram Manual (`2679 in #64)
  64.2-CATALOG ITEM : YES
    98-EDIT CODE :
  99.1-*BATCH DATA CODE :
  99.2-EXECUTE ON DATA REVIEW :
   100-SITE/SPECIMEN :

   110-GENERAL PROCESSING INST. :
   200-LAB TEST INCLUDED IN PANEL :
       Multiple Entry #2
      .001-NUMBER : 2
       .01-LAB TEST : DIFF COUNT (BLOOD) (`274 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #6
      .001-NUMBER : 6
       .01-LAB TEST : WBC (`1 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #7
      .001-NUMBER : 7
       .01-LAB TEST : RBC (`2 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #8
      .001-NUMBER : 8
       .01-LAB TEST : HGB (`3 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #9
      .001-NUMBER : 9
       .01-LAB TEST : HCT (`4 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #10
      .001-NUMBER : 10
       .01-LAB TEST : MCV (`5 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #11
      .001-NUMBER : 11
       .01-LAB TEST : MCH (`6 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #12
      .001-NUMBER : 12
       .01-LAB TEST : MCHC (`7 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #13
      .001-NUMBER : 13
       .01-LAB TEST : RDW (`416 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #14
      .001-NUMBER : 14
       .01-LAB TEST : PLT  (`9 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #15
      .001-NUMBER : 15
       .01-LAB TEST : NEUTROPHIL % (`5076 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #16
      .001-NUMBER : 16
       .01-LAB TEST : LYMPHOCYTE % (`5077 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #17
      .001-NUMBER : 17
       .01-LAB TEST : MONOCYTE % (`5078 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #18
      .001-NUMBER : 18
       .01-LAB TEST : EOSINOPHIL % (`5079 in #60)
       .02-AP MULTIPLY FACTOR :

       Multiple Entry #19
      .001-NUMBER : 19
       .01-LAB TEST : BASOPHIL % (`5080 in #60)
       .02-AP MULTIPLY FACTOR :


   300-COLLECTION SAMPLE :
       Multiple Entry #1
       .01-COLLECTION SAMPLE : BLOOD   (`3 in #62)
         1-FORM NAME/NUMBER :
         2-CONTAINER : LAVENDER
         3-MIN VOL (in mls.) :
         4-MAX. ORDER FREQ. :
       4.5-SINGLE DAY MAX ORDER FREQ :
         5-WARD REMARKS :
         6-LAB PROCESSING INSTRUCTIONS  :
         7-REQUIRED COMMENT :
       500-SAMPLE WKLD CODE :



   310-GENERAL WARD INSTRUCTIONS :
   320-REQUIRED COMMENT :
   400-DATA NAME :
   410-INPUT TRANSFORM :
   411-DATA TYPE :
   412-CULTURE ID PREFIX :
   500-VERIFY WKLD CODE :

 500.1-ACCESSION WKLD CODE :

   501-*ASK AMIS/CAP CODES :
   503-COMBINE TEST DURING ORDER :
   504-CIS TEST CODE :
   505-SITE NOTES DATE :

   506-DEFAULT SITE/SPECIMEN CPT :
   507-HCPCS CODE :
   508-AMA COMPLIANT/BILLABLE PANEL :
 22700-TMG DEFAULT SPECIMEN SOURCE : Blood venous (`11 in #64.061)
 22701-TMG DEFAULT TOPOGRAPHY : BLOOD (`70 in #61)


Any ideas how to get the display order to be proper?

Thanks
Kevin

Kevin Toppenberg

unread,
Dec 16, 2015, 6:02:33 PM12/16/15
to Hardhats
Oh brother... I decided to try tracing it again, and think I figured it on.  The short, but incomplete answer is field 56 PRINT ORDER.

Longer answer:
Lab results do not appear to be stored by panels.  So when a CBC is received, it's various parts are stored by date.  And because they are not stored as a group, one can't store relative print order *as a group*.  Instead priority is specified per result item.

When getting labs to display in CPRS, the RPC call looks for all labs resulted on a given date.  And for each individual lab result (e.g. WBC), it will look up that result's display priority.  So if a WBC has a priority of 10, and Hgb has priority of 15, then WBC will be shown first.  And since a WBC and a potassium probably won't be resulted at the exact same time, they will never be displayed together.  And thus I don't need to worry about the relative display priorities of those two.    

Weird, but I guess workable.

Kevin

Kevin Toppenberg

unread,
Dec 16, 2015, 7:52:24 PM12/16/15
to Hardhats
I wrote this code to edit the sequence displays, while showing the panel as a group.  It uses the TMG library.


FIXDISP  ;"ROLL AND SCROLL UTILITY TO ADJUST RELATIVE DISPLAY ORDERS OF LABS
  WRITE "Utility to alter display order of labs.",!
  WRITE "First we must locate sample to labs to reference.",!
  NEW X,Y,DFN,DIC
PKPT ;  
  SET DIC=2,DIC(0)="MAEQ",DIC("A")="Select patient with sample labs: "
  DO ^DIC WRITE ! QUIT:+Y'>0
  SET DFN=+Y
  NEW LRDFN SET LRDFN=+$GET(^DPT(DFN,"LR"))
  IF LRDFN'>0 DO  GOTO FDSPDN
  . WRITE "That patient does not have any labs!  Quitting",!
PKLB ;  
  SET DIC="^LR("_LRDFN_",""CH""," SET DIC("A")="Enter exact DATE/TIME of lab: "
  DO ^DIC WRITE !
  IF Y'>-1 GOTO PKPT
  NEW RDT SET RDT=+Y
  NEW DT SET DT=9999999-RDT
  NEW PANEL,MENU,SEQ,CT,INPUT
  NEW DA,DR,DIE SET DIE=60,DR=56,DIE("NO^")="OUTOK"
MNU1
  DO GETARR(.PANEL,DFN,DT)
  SET MENU(0)="Pick item to alter display order"
  SET CT=1,SEQ=""
  FOR  SET SEQ=$ORDER(PANEL("SEQ",SEQ)) QUIT:SEQ=""  DO
  . NEW IDX SET IDX=0
  . FOR  SET IDX=$ORDER(PANEL("SEQ",SEQ,IDX)) QUIT:IDX'>0  DO
  . . NEW ITEM SET ITEM=$GET(PANEL(IDX)) QUIT:ITEM=""
  . . NEW ORDER SET ORDER=$PIECE(ITEM,"^",3)
  . . IF ORDER="" SET ORDER="?"
  . . SET MENU(CT)=" Seq# "_ORDER_" -- "_$PIECE(ITEM,"^",2)_$CHAR(9)_+ITEM
  . . SET CT=CT+1  
  SET INPUT=$$MENU^TMGUSRI2(.MENU,"^") 
  IF INPUT="^" GOTO PKLB
  WRITE INPUT
  IF $DATA(PANEL("B",+INPUT))=0 WRITE !,"NO DATA!",! GOTO MNU1
  SET DA=+INPUT
  WRITE "Edit 'PRINT ORDER' to alter display sequence...",!
  DO ^DIE WRITE !
  GOTO MNU1
FDSPDN ;  
  QUIT
  ;
GETARR(OUT,DFN,DT)  ;"USED BY FIXDISP ABOVE
  KILL OUT NEW TEMP
  DO INTERIMG^ORWLRR(.TEMP,DFN,DT,-1,1)
  MERGE TEMP=@TEMP KILL TEMP(1)
  NEW CT SET CT=1
  NEW IDX SET IDX=0
  FOR  SET IDX=$ORDER(TEMP(IDX)) QUIT:IDX'>0  DO
  . NEW LINE SET LINE=$GET(TEMP(IDX))
  . IF +LINE'>0 QUIT
  . NEW IEN60,NODE,SEQ SET IEN60=+LINE,NODE=^LAB(60,IEN60,.1),SEQ=$PIECE(NODE,"^",6)
  . SET OUT(CT)=$PIECE(LINE,"^",1,2)_"^"_SEQ
  . SET OUT("B",IEN60)=""
  . SET OUT("SEQ",+SEQ,CT)=""
  . SET CT=CT+1
  QUIT
  ;

Kevin

Christopher Edwards

unread,
Dec 17, 2015, 2:34:13 PM12/17/15
to hard...@googlegroups.com
Kevin:

Just so you know that people read this and appreciate your work. I did read it and like how you walk through you troubleshooting steps (and dead ends) it helps me better understand other parts of the system i don't keep in my brain at all times.

Your work is appreciated, even when I/we don't comment!

Christopher Edwards
cje...@gmail.com

--
--
http://groups.google.com/group/Hardhats
To unsubscribe, send email to Hardhats+u...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "Hardhats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hardhats+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Toppenberg

unread,
Dec 19, 2015, 8:40:28 PM12/19/15
to Hardhats
Thanks for listening.  I worry sometimes that I am driving others crazy... :-)

Kevin
Reply all
Reply to author
Forward
0 new messages