We have Blood Pressure and ECG data which contain 3 data separately.
Blood Pressure: Systolic Blood Pressure (8480-6)
Diastolic Blood Pressure (8462-4)
Blood Pressure Heart rate (8867-4)
ECG: HRV(Heart rate variability) (80404-7)
ECG (131328)
Heart Rate (8867-4)
And we store them separately. As you can see there can be 3 Heart Rates (8867-4) which can come from Blood Pressure and ECG and manual measurement. Before, we were just fetching the latest values and combining them and show to the user. But in that case, always latest heart rates are showing up or always problem occurs in ordering them. For that, we added the hasMember field to the Diastolic Blood Pressure (8462-4) and Blood Pressure Heart rate (8867-4) and put Systolic Blood Pressure (8480-6) ID into them. (For ECG, we put HRV id to the hasMember field of the ECG and Heart Rate). But now, for fetching for example Blood Pressure, we need to fetch Systolic Blood Pressure first (to get its data) and after that related Diastolic Blood Pressure (8462-4) and Blood Pressure Heart rate (8867-4). That almost doubles our process time and also needs a lot of work for just Blood Pressure and ECG (breaks our dynamic code). Also, when fetching data for graphs(fetching them with date interval), everything is messed up(need to fetch systolic ones first and after that mapping, their id’s to get diastolic and heart rate).
My question: Do you know the best way to solve that problem? Or can we store them in a combined way? (we are trying not to use extensions)