Stream: implementers
Topic: Timing Object and Measurment Period
jan paul (Jul 07 2021 at 12:53):
Hi Folks. Iam quite new but also glad to be part of the community here.
I stumbled upon a requirement for an implementation of scheduledTiming
in activity
in careplan
. The requirment is very basic. The practitioner can determine a Measurement period for a given activity. So far so good.
My requirement tells me explicitly to give the user possibility to set Measurement Period.
It would look like this on the screen:
measurement_period.PNG
Now when iam looking at my datamodel here, i can not say
how to implement it.
Let's say the activity is to
- messaure body weight using LOINC
- in the given calendar year from 1.1 to 31.12
- every day execpt sunday
- between 9:00 - 10:00
my shortened curl looks like this,
POST {{url}} HTTP/1.1
Content-Type: {{content}}
{
"resourceType" : "CarePlan",
"activity" : [
{
"detail" : {
"status" : "not-started",
"doNotPerform" : false,
"code": {
"coding" : [
{
"system": "http://loinc.org",
"code": "3141-9",
"display": "Body weight measure"
}
],
},
"reasonCode" : [//],
"scheduledTiming": {
"repeat": {
"boundsPeriod": {
"start": "2021-01-01T00:00:00",
"end": "2021-12-31T23:59:59"
},
"frequency" : 3,
"period" : 1,
"periodUnit" : "d",
"dayOfWeek" : [ "mon", "tue", "wed", "thu", "fri", "sat"],
"timeOfDay" : ["09:00"],
"offset":60
},
},
}
},
]
}
With this i would be able to determine a Measurement period, by taking the timeofDay
and calculating with te offset.
But i am also aware of this would bring me in trouble at later stages.
Imagine a requirement like this for the messaurement Period:
- every day
- 3 times a day
-
- between 10:00-11:00
-
- between 12:00-12:30
-
- between 15:00:17:00
Since offset
is only one field that would need to correspond to the elements in the timeOfDay
array, it would be impossible to narrow it down using offset
.
i -kinda naivly -thought another way. Simple using the timeOfDay
as array and fixate that every uneven element determines start and every even element determines end of Measurement period, consider:
"timeOfDay" : ["10:00", "11:00", "12:00", "12:30", "15:00", "17:00"], but this would lead to a lot of codesmell. i would be enforced to derive businesslogic from the number of given elements.
ideally i want something like :
"timeOfDay" : [["10:00", "11:00"], ["12:00", "12:30"], ["15:00", "17:00"]]
or
"timeOfDay" : [{ from: "10:00", to: "11:00"}]
very curios about your answers.
sorry for the long writeup :-)
:vulcan:
Lloyd McKenzie (Jul 07 2021 at 16:18):
@Bryn Rhodes
jan paul (Jul 08 2021 at 11:24):
i decided to implement in a different way to overcome my troubles here. Each repeition of an activity will be it's own activity.
consider : multiple_row_activity.PNG
in each row which is careplan.activity
i will set a timing object with duration
attribute and will only apply one element into timesOfDay
ty for reading and rubberducking. I find this solution viable for my requirement and want to move on. ch33rs
jan paul (Jul 12 2021 at 06:46):
FYi. uysing offset
like i did is wrong, since offset
need to go with when
. And since there is the rule either timeOfDay
OR when
, using offset
here is wrong. I changed it to use with duration
. But iam still thinkg about using simply timeOfDay
as array where each uneven is a start and each even number in the list is the endTime. like timeOfDay: ["7:00", "10:00"]
Last updated: Apr 12 2022 at 19:14 UTC