FirelyTeam / firely-cql-sdk

BSD 3-Clause "New" or "Revised" License
31 stars 17 forks source link

516 Prepend resource type (eg Library or Measure) to resource file extension #531

Open baseTwo opened 2 months ago

baseTwo commented 2 months ago

Work for #516

Prepend resource type (eg Library or Measure) to resource file extension, since there could be overwrites on the same file when the resource is both

eg.

Library-LibraryName-Version.json
Measure-MeasureName-Version.json

A new date type, ResourceFileName contains the logic for parsing and formatting:

Unit Tests added for ResourceFileName.

baseTwo commented 2 months ago

Must be discussed at September WGM. Must have settings to enable this or not

richfirely commented 2 months ago

@baseTwo Based on this doc: https://build.fhir.org/ig/HL7/cql-ig/conformance.html CQL library source files SHOULD be named CQLLibraryName-Version.cql

I think that we should go with the format when writing to file system Library-LibraryName-Version.json Measure-MeasureName-Version.json

This way it mimics more closely the source cql recommendation.

I think we should merge this change with the modification stated above, so that the measure building isn't overwriting the library files. We agreed at WGM that building measures from CQL annotations was a good value add to the SDK. For now, just fixing the "bug" of overwriting is more important.

The settings part and output still needs design. I have some code started for this which I will submit in a future PR.

baseTwo commented 1 week ago

Once this is completed, built a new release and uncommented the pipeline tests that were commented out here https://github.com/FirelyTeam/Vonk/pull/2090

baseTwo commented 2 days ago

@richfirely - Please have a look at the validations I put in for ResourceFileName. Each part (e.g. identifier and version) cannot take an underscore as part of the spec. This means the cql file names in the ncqa build artifacts are not valid image

I removed this rule for now