I am stumped...
I have a Text component set up that will enter Text Translation if any changes are made to the clinical lists. It works perfectly if I manually add it to an encounter. Set up like this:
{if PROB_LIST_CHANGES() <> "" or MED_LIST_CHANGES() <>"" or ORDER_LIST_CHANGES() <> "" or ALL_LIST_CHANGES() <> "" or DCT_LIST_CHANGES() <> "" or OBS_LIST_CHANGES() <> "" then fmt("Clinical Lists Changes", "B,2") else "" endif}
{'{cfmt(PROB_LIST_CHANGES("FULL"), "", "Problems:
", "B,1", "")}'}
{'{cfmt(MED_LIST_CHANGES(), "", "Medications:
", "B,1", "")}'}
{'{cfmt(ORDER_LIST_CHANGES(), "", "Orders:
", "B,1", "")}'}
{'{cfmt(ALL_LIST_CHANGES(), "", "Allergies:
", "B,1", "")}'}
{'{cfmt(DCT_LIST_CHANGES(), "", "Directives:
", "B,1", "")}'}
{'{cfmt(OBS_LIST_CHANGES(), "", "Observations:
", "B,1", "")}'}
However, if I add that Text component to a document template, and then set up an encounter type, the header set in that Text component does not populate. The rest of the Text component works fine in that document template. What am I missing??
Example: Text populating from the Text Component set up in the document template is shown in bold below. Notice there is no "Clinical List Changes" header. I manually added the Text component in the encounter and that text output is shown below the bold text in this example.
Medications:
Removed medication of HYDRALAZINE HCL 10 MG ORAL TABS (HYDRALAZINE HCL) Take one (1) tablet by mouth four times daily for 4 days.
Orders:
Added new Service order of Ofc Vst, New Level I 99201 (CPT-99201) - Signed
Added new Service order of CGM insertion (95250)
Clinical Lists Changes
Medications:
Removed medication of HYDRALAZINE HCL 10 MG ORAL TABS (HYDRALAZINE HCL) Take one (1) tablet by mouth four times daily for 4 days.
Orders:
Added new Service order of Ofc Vst, New Level I 99201 (CPT-99201) - Signed
Added new Service order of CGM insertion (95250)
I think the issue is that you are using an if statement for your header, and CFMT statements for everything else. Chances are that when the form loads initially, it runs the if statement once, and then never checks again. the CFMT statements on the other hand, are always listening to the items inside of them, so they will update based on what happens in your note.
I don't have a fix for this, as I have never tried using a text-component like this. but that is my guess about what is happening. I wonder if someone else has a fix for this.
That makes sense. I guess for now I will just remove the header from the Text component all together since it really is not a vital part. Thanks for the input!!
You also have your header code enclosed in a single set of curly brackets, not the double-brackets with the "tic" inside like your other code has. The extra brackets and tic tell it to continuously evaluate. You missed doing that on the header section.
That did it!! Thanks for catching that!
David
Does the extra {'{function}'} always work to continiously evaluate? I tried and got a <-FUNCTION DEFINITION IS NOT EXECUTABLE error. {'{fcn_nipt_instruction()}'}
{fcn_nipt_instruction() <-FUNCTION DEFINITION IS NOT EXECUTABLE
I thought that {!function} also did this, but have never had it actually seem to do anything
I also have a function in a text component that I am trying to get to continuously evaluate for ORDER_LIST_CHANGES() to fire. The function works, but not as a text component.
{fn fcn_nipt_instructions()
{local orderlist,plan,inst_size,n=""
orderlist=ORDER_LIST_CHANGES()
plan=tolower(INS_PLAN("P"))
if ok(DOCUMENT.TEMP_CCC_PI_MLEF) then
if (match(DOCUMENT.TEMP_CCC_PI_MLEF,"FCN Lab will reach out to you once the paperwork is in place.")==0) then
if (match(orderlist,"NIPT")>0) then
if (match(plan,"kaiser")>0) then
inst_size=size(DOCUMENT.TEMP_CCC_PI_MLEF)
if inst_size>0 then n="\r\n"
endif
DOCUMENT.TEMP_CCC_PI_MLEF=DOCUMENT.TEMP_CCC_PI_MLEF+n+"We ordered a prenatal genetic test for you today. Additional paperwork is needed before you go to the lab to have this drawn. FCN Lab will reach out to you once the paperwork is in place. Please allow 7 days for FCN Lab to process paperwork. Your test can only be drawn at these FCN lab locations:"+HRET+"Whatcom County: Medical Testing & Urgent Care Center"+HRET+"Monday - Thursday 7:00am-3pm"+HRET+"3130 Squalicum Parkway, Bellingham, WA 98225"+HRET+"Skagit County: North Cascade Family Physicians"+HRET+"Monday - Thursday 7:30am-3pm"+HRET+"2116 E. Section Street, Mount Vernon, WA 98274"
endif
endif
endif
endif
return ""
}}
Haley, how is your text component set up? I would think it would need to be like this:
{! fn newFunction(){
blah
blah
blah
}
}
{'{some statement that if it is true, call newFunction()}'}
Or maybe have the function parameter be on obs term and when an obs term updates in the form it will trigger the function. But that might cause a LOT of calls to the function.
How do I call a function inside a if then statement?
This didn't work:
{' {if ORDER_LIST_CHANGES()<>"" THEN fcn_nipt_instruction() ELSE "" ENDIF} '}
Did you define your function in the same text component? Or is it loading from usrlib.txt when the Centricity client loads? Otherwise there is no function code to execute.