Create filter to format time with a colon #515
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this issue: #513 it was reported that the time being returned by a HL7v2 to FHIR liquid template was not in the correct format.
The input time from the HL7v2 message was "0730" and the template was returning a FHIR resource with a time value of "0730". This is technically not a valid time value for FHIR. The FHIR spec states that the format should be in HH:mm:ss format, so the templates technically should be updated to return "07:30:00" in this specific case and in other locations where HL7v2 - 2.8.35.2 Explicit time interval (ST) is used.
In this PR we are creating a new filter which can be used to format the time in the various places where the templates should be formatting the time.
The most common place is in the
timeOfDay
FHIR element like in this case of ServiceRequest: https://github.com/microsoft/FHIR-Converter/blob/370f5c1964c6e317ba406dad1b057b4399187b92/data/Templates/Hl7v2/Resource/_ServiceRequest.liquid#L533C1-L534C1Currently the liquid template passes the value from the HL7v2 message to the FHIR output without any formatting. But after this new time formatting filter is rolled out then the templates could be updated to use the filter to format the time correctly.
The templates could be updated as follows to add the formatting filter
format_time_with_colon