you would basically need to run your own parser and map out the keys manually.
a recursive function should do the trick here where you're checking typeof key === 'object' && !Array.isArray(key) as the condition in order to recursively call back and map out the new/final object.
This is a REALLY quick/dirty/untested example...
let result = {};
const keysToMap = ['HRdata', 'SPO2data'];
let currKey = '';
const mapJson = (jsonData) => {
    const keys = Object.keys(jsonData);
    keys.forEach(key => {
        if (typeof jsonData[key] === 'object' && !Array.isArray(jsonData[key])) {
            currKey = key;
            mapJson(jsonData[key];
        } else {
            if (isNaN(key)) {
                result[key] = jsonData[currKey][key];
            } else {
              result[`${currKey}-${key}`] = jsonData[currKey][key];
            }
        }
    });
});
the above can be refactored in many BETTER WAYS, but this is the quickest i could come up with so i can get back to work lmfao.
again - the above is untested.  its not perfect, but it gets the main idea across:
- map out the object
- have some way to identify that you're on a key that's gonna need to be flattened (this can be with a lookup, or some other more clever evaluation you might want to come up with)
- when you run into a key that needs to be flattened, issue callback and let recursion do the work for you
The idea of my solution isn't for it to be pretty or performant, but to explain to you what you want to do just by glancing at it.
The main problem with the above is it doesn't handle more dimensions than you've laid out.  if you want to do that, you'll have to re-evaluate the solution and do something better.
also, this is not a great O(n) solution either.  i'm sure there are much better ones out there.  but again - this just gets ya started so you can refactor to what you want for an end solution.