I have some code that is working currently however I am concerned that come 2018, I am going to need this to change since it will now be a new year measurement period. Can I get some pointers on how I can change this to have it 'reset' so to speak for the new year? What I currently have is:
!IF((OBSANY("obsterm"))<>"")THEN
OBSNOW("obsterm","Assessment Performed")
ENDIF
Thanks for any assistance.
Linda
This might be helpful. It will push whatever value if it has been at least a year. We do similar things for different types of assessments. You may want to double check this for typo-s since this was off the top of my head.
!IF((OBSANY(“obsterm”))<>””)THEN
IF(DURATIONDAYS(LAST_SIGNED_OBS_DATE("obsterm"), sub(str(DOCUMENT.CLINICALDATE),1,10) >=365) THEN
OBSNOW(“obsterm”,”Assessment Performed”)
ELSE
""
ENDIF
ENDIF
If the measure is annual, why not post the year rather than text?
Then you can can the last OBSVALUE.
Thanks! worked like a charm!
If the measure resets on January 1st, meaning that even if you met the measure on Dec 30th, the patient is due for it again in January, you could do something like the below code, putting the code you want to execute inside the IF statement.
var thisYear
var lastObsYear
lastObsYear = sub(str(LAST_SIGNED_OBS_DATE("HEIGHT")), 7, 4)
thisYear = sub(str(._TODAYSDATE), 7, 4)
if (thisYear lastObsYear) then
"The last obs value was in the year: " + lastObsYear + " but the current year is: " + thisYear
endif
You might need to put some code in to make sure the observation existed first.