Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1834

Re: adding a column to select

Newsgroups comp.databases.ms-sqlserver
Date 2014-11-03 05:13 -0800
References <74f6aa18-3f13-4af6-9664-9560eab46eff@googlegroups.com> <XnsA3D899B29DCC0Yazorman@127.0.0.1>
Message-ID <d63803c9-adab-4188-9437-26a1832acaa4@googlegroups.com> (permalink)
Subject Re: adding a column to select
From Raul Rego <rrego@pmchnnj.org>

Show all headers | View raw


On Saturday, November 1, 2014 10:06:45 AM UTC-4, Erland Sommarskog wrote:
> Raul Rego (rrego@pmchnnj.org) writes:
> > Can I go throiught all notes in toxnotes for casenumber = tp.casenumber
> > and bundled them into one display 
> 
> You mean concatenate them to a single value? That can be achieved by 
> using FOR XML PATH(''), but it is difficult to give you a query, because
> I don't know what output more exactly you are looking for.
> 
> > full join UHCF hos on hos.UHCFNumber = tp.CallerSiteCode
> > full join Codevalue cv_pa on cv_pa.CodeID = tp.patageunit
> > full join CodeValue cv_ct  on cv_ct.CodeID = tp.calltype
> > full join CodeValue cv_mo on cv_mo.CodeID = te.MedicalOutcome
> > full join CodeValue cv_cs on cv_cs.CodeID = tp.CallerSite
> > full join CodeValue cv_pt on cv_pt.CodeID = tp.PatGender
> > full join CodeValue cv_cr on cv_cr.CodeID = tp.CallerRelToPat
> > full join CodeValue cv_er on cv_er.CodeID = tp.ExpReason
> > full join  CodeValue cv_es on cv_es.CodeID = tp.ExpSite
> > full join CodeValue cv_ms on cv_ms.CodeID = te.ManagementSite
> 
> I don't think this is right. FULL JOIN is something you don't use very 
> often. Probably you mean a LEFT JOIN for the columns in ToxPat which are
> nullable.
> 
> -- 
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
> 
> Links for SQL Server Books Online:
> SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
> SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Erland. yes I gues I will like all NOTE column values for case casenumber concatenated.

example, for casenumber=1079155 we have many notes entered by date/time  and I will like it to display in one single place as such
 --- Tue Apr 16, 2013 @ 15:00 By  679:asheu ---
Dr. Duroche Calling from Community ER

58 year old male was last seen at midnight by girlfriend and girlfriend went to see him this afternoon at 12:30 found laying on floor unconscious not breathing very well. Possible he took an overdose. Was found with his own dynacirc and viagra  bottles that were empty

Other meds at home include pravastatin, singulair, metoprolol, flomax, zyban

Initially BP was 110/70 HR 50 but he was tugging at things and having difficulty breathing. Patient was intubated and sedated. Presently getting a fluid challenge 

BP systolic in the 60sm HR in the 40s 
qrs 174 qtc 521 (prior ekg from last admission qrs 106 qtc 392)

Lytes are still pending.

PCC: If patient does not respond to fluid challenge would consider glucagon, insulin/glucose, calcium gluconate. Would recommend giving some sodium bicarb to see if qrs will shorten up. Get an Mg level and replenish if mg is low to see if qtc will shorten up as well. 

MD: Preferred pressor? dopamine/levophed?

PCC: Would prefer levophed in this situation over dopamine. 



 --- Tue Apr 16, 2013 @ 17:03 By  679:asheu ---
Andrew ED RPH

Patient still on vent, they stopped the propofol
BP 71/47 HR 30s-50s
asa 4 apap < 2 

Glucagon 5 mg given, no response
Insulin/dextrose given with minimal response
Currently hanging bicarb 1 amp, and calcium gluconate 2 grams
Patient is on levophed 14 mic/minute.

EKG not repeated yet
Mg level will be ordered stat

PCC: If hypotension persists despite therapies consider lipid resuscitation. Need a repeat ekg to see if bicarb has an effect on qrs and Mg level to see if we can empirically replace Mg to see if qtc shortens. PCC will follow up. Call back if any questions arise. 



 --- Tue Apr 16, 2013 @ 21:34 By  679:asheu ---
Patient was transferred to MICU Nurse just went off of the floor call back later



 --- Tue Apr 16, 2013 @ 22:08 By  679:asheu ---
Mindy RN

MS: wasn't making any purposeful movements just open eyes looking around 
VS: 83/55 HR 68 100% on Vent T 93.5 hypothermic. 

Patient is maxed out on levophed, maxed out on dopamine
cpk 88,900 rhabdo, 
Patient is getting NS 200mc/hour 

Patient has Neosynephrine if needed 
waiting for chem-7 to come back
ekg qrsd 102  qtc 510

ast 198  alt 281 amylase 205 lipase 667
BUN 19 Scr 2.0 
Lactic acid 6.8 

PCC: Discussed role of insulin/glucose can go up to 1.0 unit/kg/hour with dextrose in CCB/BB ingestion. Can also consider lipid rescue therapy if patient continues to deteriorate. Call back if any questions arise 


 --- Wed Apr 17, 2013 @ 6:04 By  876:Renato De Bellonia ---
follow up as per Mindy rn 
bps 90s syst
4/16  14:00 - k 5
4/16  21:45 - k 6.4
4/17  01:45 - k 5.3
pt receiving d5 1/2 w/75 hco3 @ 125
pt receiving ns w/ca gluc @ 125
no repeat ecg done
faxed insulin/gluc protocol to 732 557 8950
no dig level done 
labs will be repeated this am
njpies will follow up


 --- Wed Apr 17, 2013 @ 9:45 By  899:Richard Casas ---
Primary nurse (Amy ) is busy and asked that I call back later.


 --- Wed Apr 17, 2013 @ 11:00 By  899:Richard Casas ---
Amy (rn)
Patient started to have seizure activity and was given 2 mg of ativan.
cns= unconscious
102/62,66
He is on Dopamine, insilun/dextrose and bicarb.
lactic acid=4.5,lipase= 4967,lipase=528, cpk=178,000. 
na= 128,k=6.4 (not hemolyzed),cl=94,co2=17.bun=37,creat=3.3,gluc=219
urine output 25 cc/2 hours.
Patient is beng prepared for dialysis.
NUrse is busy and has to go.....


 --- Wed Apr 17, 2013 @ 11:08 By  899:Richard Casas ---
Addendum: Seizure activity stopped after the ativan.
ca=7.5, Mag=2.4


 --- Wed Apr 17, 2013 @ 17:14 By  899:Richard Casas ---
Aimee (rn)
Family decided to remove all treatments.
Patient expired at 4:20 pm.


 --- Fri May 24, 2013 @ 14:35 By  351:Steven Marcus ---
Scenario/Substances: {concise narrative of EMS & pre-HCF events} 
58 year old male was found by his girlfriend on the floor of his apartment unconscious and not breathing well, snoring and gasping. He was found with his medications Dynacirc and Viagra, which were empty. Apparently the night before, the girlfriend thought that he was too depressed and took away his alprazolam so that he would not take it. he had been displaced from his home by Sandy. The girlfriend called EMS who found him snoring and they began bag valve assistance. They administered naloxone without any change and then transported the patient to the hospital. 
Past Medical History: 
retired fireman with history of heavy alcohol abuse and chronic pain. He had a 20 pack year cigarette habit. He was taking zyban, zolpidem, fish oil, cyclobenzaprine, tamsalosin, pravastatin, metoprolol, lansoprazole, bupropion, alprazolam, sildenafil, isradipine, montelukast and Percocet
Physical Exam: 
unresponsive to verbal commands and painful stimuli, no focalizing signs, tendon reflexes were diminished in all 4 extremities. Initial BP was reported to us as 110/70, heart rate 50 
Laboratory Data: 
urine sp gravity was 1.006, pH 6.5, positive for urobilinogen at 0.2 mg/dl
CBC revealed WBC 14.5 with 78% polys, 8 bands, 9 lymphs, 4 monos and 1 eos. platelets were 197k, Hgb 14.5, MCV 101.1
Chemistries: Na 139, K 5.0, CO2 19,mmol/l, calcium 9.2, BUN 19, creatinine 2.0, glucose 113 mg/dl. the Na dropped during admission to 128 mmol/l
Liver functions revealed: INR 0.97, total bilirubin 0.4 mg/dl, total protein 7.0 g/dl, albumin 3.8 g/dl, ast/alt 281/198,
drug testing; negative for asa, acetaminophen, ethanol 25 mg/dl,ethylene glycol and methanol were negative
ABG: pH 7.28, pO2 175, pCO2 31, HCO3 15
lactic acid 6.8 prior to the seizures, lipase 4,967, amylase 528
ECG: sinus bradycardia with prolonged QTc, RBBB
Chest x-ray: cardio-megaly, left lower lobe pneumonia; Head CT Scan: some evidence of chronic sinusitis, negative for bleeds, space occupying lesions
creatine phosphokinase level 36,503 rose to 183,540 post seizures.
cortisol level 38.4
Clinical Course: 
He developed respiratory distress and was intubated, sedated with propofol and placed on a ventilator. 
Shortly thereafter his blood pressure dropped and he was given a fluid challenge. At that time his ECG revealed a QRS of 174 and QTc of 521 msecs. 
He was treated with IV fluids, glucagon, sodium bicarbonate, calcium gluconate , insulin and norepinephrine and phenylephrine and antibiotic for the pneumonia. The poison center suggested the use of lipid rescue but we were not told that it was tried. 

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

adding a column to select Raul Rego <rrego@pmchnnj.org> - 2014-10-31 10:47 -0700
  Re: adding a column to select Erland Sommarskog <esquel@sommarskog.se> - 2014-11-01 15:06 +0100
    Re: adding a column to select Raul Rego <rrego@pmchnnj.org> - 2014-11-03 05:13 -0800
      Re: adding a column to select Erland Sommarskog <esquel@sommarskog.se> - 2014-11-03 18:14 +0100
        Re: adding a column to select Ross Presser <rpresser@gmail.com> - 2014-11-03 09:56 -0800

csiph-web