How to use null_flavor in the flat format?

My template uses the Glasgow Coma scale.
The Ordinals in the Glasgow Coma scale archetype have a value and a null_flavor within the ELEMENT.
There seems to be a lot of different paths that are being generated for these, based on the tools used.

Using Better’s template designer and the paths generated by concatenating the ids on a webtemplate this was obtained:

/initial_assesment/glasgow_coma_scale_gcs/best_motor_response_m/ordinal_value

/initial_assesment/glasgow_coma_scale_gcs/best_verbal_response_m/coded_text_value

However their respective AQL paths are:
/content[openEHR-EHR-OBSERVATION.glasgow_coma_scale.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0008]/value

/content[openEHR-EHR-OBSERVATION.glasgow_coma_scale.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0008]/null_flavour

And EHRBase webtemplates generated these paths:
/initial_assesment/glasgow_coma_scale_gcs/best_motor_response_m

/initial_assesment/glasgow_coma_scale_gcs/best_motor_response_m/null_flavour

What is the correct way to handle null_flavor using flatforms? What should be the path to the ordinal and the null_flavor?

For Better CDR…

{
"initial_assesment/glasgow_coma_scale_gcs/best_motor_response_m/_null_flavour|code": "271",
}

The following set of codes (or values) can be used:

  • 253: unknown
  • 271: no information
  • 272: masked
  • 273: not applicable

I have not tested it with Ehrbase.

There is an underscore too before null_flavor? _null_flavor and not null_flavor?

What about the path for posting the ordinal?
initial_assesment/glasgow_coma_scale_gcs/best_motor_response_m
or
initial_assesment/glasgow_coma_scale_gcs/best_motor_response_m/value?

Any documentation or standardization for this? In fact, it was hard for me to find good documentation for flat formats too. Any proper resource?
I figured it out from here, how to represent an ordinal (probably really old):

This is supposed to have it for common data types, but misses out ordinal:

And the official documentation has some JAVA code to generate the paths, but I haven’t really used/tested them out. More explicit examples would definitely help people who’re starting out.

Some examples here … https://freshehr.github.io/dhi-proms/dhis/DHIS6-committing-proms-data/

"howru_score": [ {
            "pain_or_discomfort": [
                {
                    "|code": "at0041",
                    "|value": "slight",
                    "|ordinal": 1
                }
            ],

so ??

initial_assesment/glasgow_coma_scale_gcs/best_motor_response_m|value
initial_assesment/glasgow_coma_scale_gcs/best_motor_response_m|code
initial_assesment/glasgow_coma_scale_gcs/best_motor_response_m|ordinal

1 Like

We will further align with Betters implementation in EHRbase and will also provide more examples and better documentation. For example, we should add an integration/unit test with these use-cases as reference.

1 Like

I have two related questions so I didn’t think it was right to write them as a different topic.

First a general question.
@ian.mcnicoll The null flavour can be used for any kind of data? If I have legacy data whose I don’t know the “start_time” should I use the null flavour to set it to unknown?

The second question is platfom-specific.
@birger.haarbrandt Is the null flavour available in the current release of EHRBASE for the flat format ? if yes what is the syntax?

Hi Giovanni,

  1. Null_flavour can only be use on Elements , not all attributes. I appreciate the problem ,particularly with dates e.g a procedure time for a historical surgical procedure, from a feeder system where no date is available.

  2. The FLAT format is (I am not sure if it supported by EhrBase)

{
"vitals/vitals/body_temperature/any_event/temperature/_null_flavour|value": "no information",
}

or as code:

{
  "vitals/vitals/body_temperature/any_event/temperature/_null_flavour|code": "271",
}
1 Like

Ian, where has that been described? Why is there an underscore in front of ‘null_flavor’? I’d like to make some more progress on adding such things to the Serial Data Formats spec

Thanks Ian.
And what do you do when you have to insert a date (mandatory in the template) and you don’t have it and can’t retrieve it ? do you make a guess based on the dates (i f any) available in your input data or you put always the same date (e.g. a date in the distant past or future) that you treat as fake when you re-read the data?

In a recent use-case we used a fake date, as this is what was understood by the customer anyway. I’m not pleased or prod of it but it was really the only practical solution. We should formalise this in the RM, as it is a not uncommon occurrence.

@thomas.beale the use of _null_flavour is documented in Better’s customer documentation. In the underscore is I think normally used where an rm attribute is being represented and where there might be a potential name collision with an archetyped node name.

1 Like

I’m not clear on this - are we talking about /context/start_time? I.e. the start date/time of the encounter? And if this is not available, normally you will use the time-stamp of the focal data item is, e.g. Observation.history.origin.

We had discussions to add ENTRY.effective_time() to the RM (I thought we had a CR but I can’t find it…), which returns the appropriate time from any kind of Entry. Anyway, calling that function on any concrete ENTRY object (OBS, EVAL etc) gives you the clinically relevant time, which is a fair substitute for /context/start_time. Or are we talking about some other time attribute?

Specifically this is about ACTION.time as part of a procedure archetype but where the date cannot always be be provided by the source system.

Is the situation that you are importing an assertion that a procedure has been performed, but with no time info, i.e. could have been last week or 10 years ago?

We have this CR to allow that particular field to be blank.

@thomas.beale I don’t understand practically how can I proceed.
For example an ACTION radiation therapy has a time attribute. In flat format:
“crc_cohort/therapies/radiation_therapy/radiation_therapy:0/time”:“2009-04-06T00:00:00.00Z”
Should I left ithe value blank with two parentheses?

Right now you can’t - as @ian.mcnicoll said above, you’ll have to synthesise a value so the commit doesn’t fail. The Change Request I linked above is to make that specific field optional in future. Obviously implementations won’t deliver that change for some time, so in the interim you have to create a value.

I see. Thanks for the clarification. I wanted to be sure to have understood.