Is there a way to code where the date of the last appointment with the PCP can be populate in a data display?
And/or
Is there a way to show the date the order was last ordered within the data display?
Thank you,
Shereen
I wrote some code to pull last appointment based on the provider you input. You would have to make sure the provider you entered is the same as the way it is stored in the Appointment book. For example if the appointment book was SMITH, JOHN MD and the Responsible provider is John Smith MD, you would need to perform some code to fix this.
You should be able to run this code with
lastAppt(PATIENT.RESPPROVID)
fn lastAppt(prov){
local foundmatch = 0
local aAppt = getfield(APPTS_BY_STATUS("arrived", "FULL"), "\r", "")
local r
for x = 1, x <= size(aAppt) - 1, x = x + 1 do
local aDtls = getfield(replacestr(aAppt[x],"\n",""), ",", "")
local z = size(aDtls)
if (match(aDtls[z], prov) >0) Then
foundmatch = 1
r = aDtls[1] + aDtls[2] + ":" + aDtls[3] + "," + aDtls[z]
endif
endfor
if (foundmatch == 0) Then
return ""
else
return r
endif
}
}
Thank you Ryan!
Is there a way to simply this function where it will only show the last PCP associated with this order type.
The issue is that this code is used by different specialties and with the form the provider would needs to know if the patient is due for a certain service.
For example, an IM provider may not think the patient is due for another physical review until they see that the last time the order was placed by an OBGYN provider.
I hope this makes sense.