Skip to content

Concept codes comparison adjusted - #100

Closed
bryantaustin13 wants to merge 3 commits into
cqframework:mainfrom
bryantaustin13:fixConceptCodes
Closed

bryantaustin13 wants to merge 3 commits into
cqframework:mainfrom
bryantaustin13:fixConceptCodes

Conversation

@bryantaustin13

Copy link
Copy Markdown
Contributor

Server returning correct code, but test is failing due to format and test evaluation.

To duplicate the test that fails, run the following

<?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="CqlTypeOperatorsTest">
	<group name="SingleTest" version="1.0">
		<test name="CodeToConcept1" version="1.0">
			<capability code="type-operators" />
			<expression>ToConcept(Code { code: '8480-6' })</expression>
			<output>Concept { codes: { Code { code: '8480-6' } } }</output>
		</test>
	</group>
</tests>

Two conflicts, both fallout from cqframework#109 landing on main.

src/shared/results-utils.ts: the conflict presents as a docblock, but
main's side carries the whole longEquals function (cqframework#106, Long returned
as valueString) and the auto-merged body below already calls it.
Taking either side alone breaks the build. Kept longEquals together
with this branch's expanded resultsEqual docblock. Concept comparison
normalization is unchanged.

src/test-results/cql-test-results.ts: cqframework#109 added a module-level
formatActualValue that duplicated CQLTestResults.formatActualValue and
its seven private statics. Resolved to one implementation: keep main's
(recursive lists, quantities, interval boundary recursion), fold in
this branch's Code and Concept rendering, and drop the duplicate
statics. Arrays of Codes now render as CQL rather than falling back to
JSON. Carried over the try/catch so a nested Long or a circular value
no longer throws, and exported the function so displayFixes converges
on the same one.
Both branches independently reworded this docblock and the
equalizeValueTypes comment, which made them conflict with each other for
no functional reason. Use wording that is accurate on either branch (no
enumeration of the specific shapes each one handles) so whichever lands
on main second merges cleanly.
@bryantaustin13

Copy link
Copy Markdown
Contributor Author

Superseded by #115. Now that I have committer access on cqframework/cql-tests-runner, this work has moved to a branch on the repository itself (same branch name, fixConceptCodes) so CI and reviews run here directly. Closing in favour of #115 — please continue any discussion there.

@bryantaustin13
bryantaustin13 deleted the fixConceptCodes branch August 17, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant