Skip to content

Sort Dates Asc does not preserve time (and desc) #952

@bryantaustin13

Description

@bryantaustin13

Steps to dupe:

<?xml version="1.0" encoding="utf-8"?>
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://hl7.org/fhirpath/tests" xsi:schemaLocation="http://hl7.org/fhirpath/tests ../../testSchema/testSchema.xsd"
	   name="CqlListOperatorsTest">
	<capability code="interval-operators"/>
	<group name="SingleTest" version="1.0">
		<test name="SortDatesAsc" version="1.0">
			<expression>({ DateTime(2012, 10, 5, 10), DateTime(2012, 1, 1), DateTime(2012, 1, 1, 12), DateTime(2012, 10, 5) }) S sort asc</expression>
			<output>{ @2012-01-01T, @2012-01-01T12, @2012-10-05T, @2012-10-05T10 }</output>
		</test>
	</group>
</tests>

actual output: "actual": "@2012-01-01T,@2012-01-01T,@2012-10-05T,@2012-10-05T",
Notice that the 12 and 10 are missing from the second and fourth elements.
Possible culprits are the sort comparison (normalizing everything to day precision), or the stringification/serialization of the result (printing only date precision). My bet would be on the serialization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions