Instructions for requesting a batch of data from DSM

From CCMDB Wiki
Revision as of 17:11, 25 August 2014 by Ttenbergen (talk | contribs) (MRN Field: u)
Jump to navigation Jump to search

Requestinglab Field

Appears like these are used a bit inconsistently with the OrderingLocationName field...

Key

LAB_ID	DSM Lab
BEC	Beausejour
BEH	Steinbach
CGH	Concordia
DHC	Dauphin
FFH	Flin Flon
GGH	Grace
HSC	HSC
MHC	Miseri
MTCC	Mount Carmel
NES	Neepawa
PDH	Portage
RHC	Riverview
SBGH	St. Boniface
SGH	Selkirk
SOGH	Seven Oaks
TGH	Thompson
TPC	Pas
VGH	Victoria

MRN Field

  • sometimes starts with letters for hospitals, and a ton use PHIN instead for whatever reason...
  • this MS SQL code should isolate the prefix:
Switch(
 Left([mrn],1)="C","CON",
 Left([mrn],1)="D","Z_Deer Lodge",
 Left([mrn],1)="G","GRA",
 Left([mrn],1)="M","Z_Misericordia",
 Left([mrn],1)="N","HSC",
 Left([mrn],1)="P","Z__PHIN_used",
 Left([mrn],1)="R","Z_Riverview",
 Left([mrn],3)="SGH","Z_Selkirk",
 Left([mrn],1)="S","OAK",
 Left([mrn],1)="V","VIC",
 Left([mrn],1)="1","_no_prefix",
 Left([mrn],1)="0","_no_prefix",
 True,"!! unaccounted for")
  • this MS SQL code should isolate the MRN for linking
clng(Switch(
 Left([mrn],1)="C",mid([mrn],2),
 Left([mrn],1)="D",mid([mrn],3),
 Left([mrn],1)="G",mid([mrn],2),
 Left([mrn],1)="M",mid([mrn],2),
 Left([mrn],1)="N",mid([mrn],2),
 Left([mrn],1)="P",mid([mrn],4),
 Left([mrn],1)="R",mid([mrn],2),
 Left([mrn],3)="SGH",mid([mrn],4),
 Left([mrn],1)="S",mid([mrn],2),
 Left([mrn],1)="V",mid([mrn],2),
 Left([mrn],1)="1",[mrn],
 Left([mrn],1)="0",[mrn],
 True,"!! unaccounted for"))

Linking

Some records use PHIN in MRN, so to link all we need to:

  • find all records with PHIN and admitted date range (find all for whom we have a PHIN)
  • for all where we use PseudoPHIN, find all records with MRN

This will miss those records where the export used PHIN and where we may not have one... if any...