Hi all:
We use a custom text "CONTROLLED SUBSTANCE MANAGEMENT" with an ICD9 code, to monitor and audit our policies.
I would like to automatically detect this phrase in the Problem list, and have a text component change it in the update upon loading, to the new ICD-10 phrase.
So far I've sketched it out like this:
{local probPRID = ""
ProbArray = getfield(prob_after("delimited"),"|","")
i=0
for i= 1, i<size(ProbArray),i=i + 1
do
ProbSubarray = getfield(ProbArray[i],"^","")
if match(ProbSubarray[2],"CONTROLLED SUBSTANCE MANAGEMENT") > 0
then if match(ProbSubarray[8],"ICD10-Z79.899") > 0
then probPRID = /?lastfield in this array?/
Mel_Change_problem("Dx of",document.description,document.ICD,"","","","N","")
endif
else ""
endif
endfor
}
What I don't have is up to date documents on how to use and count fields for the functions
(1): "prob_after" (i.e. is the PRID the last number on each line, and how do I pull that out and use it in
(2): "MEL_CHANGE_PROBLEM"- I dont' have documentation about how to use this function to add the new ICD10 codes?
I get from other posts that the tricky part is pulling out the PRID, and feeding it into the MEL_CHANGE_PROBLEM line.
Any suggestions greatly appreciated. Do you think this will work as a text component? (If not we can use a button in the form, but I'd like to figure a way for it to automatically fix the list).
Cheers.
Charles in Maine
Charles, I usually look at the definition of PROB_AFTER(...) and the examples given to figure out what is returned in the array. The Help files are extremely poor at giving a definition of the returned array. I would say from looking at PROB_AFTER('delimited') that the PRID would be in index 9.
.
local probAry = getfield(PROB_AFTER("delimited"),"|","")
local aRow
local imax=size(probAry)
local i
local probPRID=""
for i=1,i<=imax,i=i+1 do
aRow = getfield(probAry[i],"^","")
...
your code to determine if this problem needs to be updated...
...
probPRID = aRow[9]
...
endfor
I misunderstood your original questions, and posted instructions on finding Help on all the Centricity functions, but it is still useful, so I have left it (below).
To look up these functions in the Help file.
.
In CPS12, click Help, select "Centricity Practice Solution Help".
.
Under Contents Tab, Expand "Administrators and management". Expand Use data symbols. Expand Symbols listed by Category.
.
For problem functions,
Expand Problems.
.
For MEL functions,
Expand MEL utility functions.
.
Here are the other categories to expand and check out.
.
Observations, Orders, Family Historym, Users, Documents, Dates, Medications, Allergies, .... etc, check them all out.
.
In EMR 9.8, similar. Click Help, Centricity EMR Help. Under Contents Tab, expand Using data symbols. Expand Symbols listed by Category.
.
This should get you started on understanding the functions (and finding what functions exist).
.
regards - Beverly
Ok, I modified the code and have been testing it as a quicktext:
{local probPRID = ""
local ProbArray = getfield(prob_after("delimited"),"|","")
local aRow
local imax=size(ProbArray)
local i
i=0
for i= 1, i<imax,i=i + 1
do
aRow = getfield(probArray[i],"^","")
if match(ARow[2],"CONTROLLED SUBSTANCE MANAGEMENT") > 0
then probPRID = ARow[9]
MEL_CHANGE_PROBLEM(probPRID,"CONTROLLED SUBSTANCE MANAGEMENT","ICD10-Z79.899",,,,,,)
endif
endfor}
BUT here is what happens when I fire the quicktext:
{local probPRID = ""
local ProbArray = getfield(prob_after("delimited"),"|","")
local aRow
local imax=size(ProbArray)
local i
i=0
for i= 1, i<imax,i=i + 1
do
aRow = getfield(probArray[i],"^","")
if match(ARow[2],"CONTROLLED SUBSTANCE MANAGEMENT") > 0
then probPRID = ARow[9]
MEL_CHANGE_PROBLEM(probPRID,"CONTROLLED SUBSTANCE MANAGEMENT","ICD10-Z79.899",, <-COMPILER ERROR NEARBY: Expect EXPRESSION. Instead had COMMA after COMMA
I tried adding a comma and also removing a comma in the fields. The HELP documentation lists 9 fields
syntax
MEL_CHANGE_PROBLEM(PRID, desc, code, onset_date, approx_onset, end_date, approx_end, comment, reason)
, but the example at the bottom of the HELP shows only 8 fields.
example
MEL_CHANGE_PROBLEM
returns
( PRID, “Hypercholesterolemia”, “ICD10-E78.8”, “09/15/2012”, false, , , “Diet controlled”)
Or maybe its something else?
Appreciate any help, first time I've wrestled with this bloody function.
Thanks.
CJZ
Quicktext has a limit to how long it can be. I counted your function (including spaces) and it was 371 characters (give or take). Quicktext is limited to 255 (or 256 cannot recall) characters. So keep your parameters to 1 character. I have made the function as short as possible to get down to less than 255 characters. I tested this Quicktext, it works to change the problem code. It turns out that PROB_AFTER("delimited") index 9 AND index 11 contains the PRID.
.
Dx of^CONTROLLED SUBSTANCE MANAGEMENT^ICD-V58.69^^09/23/2015^^^ICD10-Z51.81^1758641564557680.000000^09/23/2015^1758641564557680.000000
.
r[9] =1758641564557680.000000
r[11]=1758641564557680.000000
.
QUICKTEXT FUNCTION:
.
{local i,r,f,P
f="CONTROLLED SUBSTANCE MANAGEMENT"
P=getfield(prob_after("delimited"),"|","")
for i=1,i<=size(P),i=i+1do
r=getfield(P[i],"^","")
if match(r[2],f)>0 then
MEL_CHANGE_PROBLEM(r[9],f,"ICD10-Z79.899")
else "" endif
endfor ""}
.
regards - Beverly
I just ran into this CHUG Topic on MEL_CHANGE_PROBLEM(...).
It explains a trick you can use to update both the ICD9 and ICD10 problem code,
since MEL_CHANGE_PROBLEM(...) only allows 1 problem code.
For the full posting, read this Topic "VFE Mel Add Prob ICD 10 issue"
Here is the technique to use (Thanks to gibsonmi)
~~~~~~~~~
Unfortunately, when the MEL_CHANGE_PROBLEM(...) data symbol was coded,
it was coded so that only one ICD code could be specified.
This presents an obvious issue knowing what we know now
(that both 9 and 10 codes are needed for the foreseeable future).
The trick is to change the problem using the 10 code and all the arguments desired.
You then execute a second change statement with only the PRID and 9 code.
This will make the change you want and keep both codes.
~~~~~~~~~
- Beverly
updated my answer for a quicktext that does what you were trying to do.
Thanks, this now works great in quicktext:
QUICKTEXT FUNCTION:
{local i,r,f,P f="CONTROLLED SUBSTANCE MANAGEMENT" P=getfield(prob_after("delimited"),"|","") for i=1,i<=size(P),i=i+1do r=getfield(P[i],"^","") if match(r[2],f)>0 then MEL_CHANGE_PROBLEM(r[9],f,"ICD10-Z79.899") else "" endif endfor ""}
Thanks for much for all the help!
-CJZ