I have 2 patients that both have Hypothyroidism as a diagnosis on their problem list. Patient A when I click the insert template on the CPOE form, it inserts the TSH and Free T4. On Patient B, it only inserts the TSH. I thought it might be the text file, but then if it was it why would it work for one patient and not the other. I had the SQL guru trace it, nothing. Any ideas on how to troubleshoot this would be welcome.
Thanks
Laurie
I found the answer. Patient A had a Total T4 done and Patient B did not. Now somehow I have to figure out how to fix the CCC-fndef-CPOE.ccc form. Which I don't totally understand anyway. If someone has a the above text file and it does insert the Free T4, can you send me this piece of it:
{fn ccc_cpoe_T_1(a,b){
if ccc_r_a_o_a(b)="" then "" else a + ccc_r_a_o_a(b) + " (" + ccc_r_a_o_L_D(b) + ")" + "\r\n" endif}
fn ccc_cpoe_T_2(a,b){if ccc_r_a_o_a(b)="" then "" else a + ": " + ccc_r_a_o_a(b) + " (" + ccc_r_a_o_L_D(b) + ")" + " " endif}
fn ccc_cpoe_T_3(a,b){
if ccc_r_a_o_a(b)="" then "" else a + ": " + ccc_r_a_o_a(b) + " (" + ccc_r_a_o_L_D(b) + ")" endif}
fn ccc_cpoe_T_4(aa){local a=2, b=""while a<=getnargs() do b=ccc_r_a_o_a(getarg(a))if b"" then return aa else "" endif
a=a+1
endwhile
return ""}
fn ccc_CPOE_template_Hypothyroidism()
{
local a = List_HGBA1C_obs()
local d = List_CHOL_obs()
local e = List_HDL_obs()
local f = List_LDL_obs()
local g = List_TRIG_obs()
local qq = List_TSH_obs()
local rr = List_T4_F_obs()
local ss = List_T4_T_obs()
local tt = List_T3_free_obs()
local uu = List_T3_total_obs()
ccc_cpoe_T_4("\r\nLabs Reviewed:\r\n",qq,rr,ss,tt,uu,a,d,e,f,g) +
ccc_cpoe_T_2("TSH",qq)
+
if ccc_r_a_o_a(rr)="" and ccc_r_a_o_a(ss)="" then "" else
if durationdays(str(ccc_r_a_o_L_D(ss)),str(ccc_r_a_o_L_D(rr)))>0 then
ccc_cpoe_T_2("Free T4",rr)
else
ccc_cpoe_T_2("Total T4",ss)
endif endif +
if ccc_r_a_o_a(tt)="" and ccc_r_a_o_a(uu)="" then "" else
if durationdays(str(ccc_r_a_o_L_D(uu)),str(ccc_r_a_o_L_D(tt)))>0 then
ccc_cpoe_T_3("Free T3",tt)
else
ccc_cpoe_T_3("Total T3",uu)
endif endif +
ccc_cpoe_T_4("\r\n",qq,rr,ss,tt,uu) +
ccc_cpoe_T_1("HgBA1c: ",a) +
ccc_cpoe_T_2("Chol",d) +
ccc_cpoe_T_2("HDL",e) +
ccc_cpoe_T_2("LDL",f) +
ccc_cpoe_T_3("TG",g) +
ccc_cpoe_T_4("\r\n",d,e,f,g)}
Thanks
Laurie
I think you can solve this. See the lines in the fn ccc_CPOE_template_Hypothyroidism() that say:
local rr = List_T4_F_obs()
local ss = List_T4_T_obs().
Those functions are found in the CCC-ObsDef1.txt file. In that file, in our environment, the lines say
fn List_T4_F_obs() {"T4, FREE"}
fn List_T4_T_obs() {"T4, TOTAL"}
So, for Free T4, it is looking for the T4, FREE obs term and for Total T4, it is looking for the T4, TOTAL obs term. Look at your lab reports coming back and see what obs terms are being mapped for those lab values. If you have one you need to add, you can edit the appropriate line in the CCC-ObsDef1.txt file. Multiple obs terms are written QuoteObsTermOneCaratObsTermTwoQuote. For example:
fn List_Porphyria_screen_urine_obs() {"PORPHY SCR U^PORPHO UR SQ"}
Hope this helps,