Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .changeset/parsers-0-2.md

This file was deleted.

28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## 0.2.0

### Minor Changes

- c7ce5e2: `cosyte` now runs on the 0.2 lines of `@cosyte/hl7`, `@cosyte/fhir` and `@cosyte/ccda`, with `@cosyte/transform` 0.3 and the `@cosyte/deid` and `@cosyte/mllp` releases that accept them, so a FHIR parse warning is now `{ code, position: { expression } }` with no severity, and every code those libraries pass through carries their prefix.

What a caller must change: read each row of the table below against the scripts, `jq` filters and programs that consume `cosyte` output, the `cosyte-mcp` tool results, or `parseFormat` and `validateFormat` from the programmatic API. HL7 v2, X12, ASTM, NCPDP, DICOM and C-CDA output keeps its shape; only the codes named in the second table change.

| What changes | Before | After | How to find it |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| Each entry of `warnings` in `cosyte parse` output for a FHIR resource, in a `parse --ndjson` record, in the MCP `parse` result, and from `parseFormat("fhir", ...)` | `{ "code", "severity", "expression" }` | `{ "code", "position": { "expression" } }`, the shape every other format's warnings have | a `jq` filter or a program reading `.warnings[].severity` or `.warnings[].expression` on FHIR input |
| The `severity` of a `cosyte validate` finding that comes from reading a FHIR resource (not from `validateResource`), in the stderr line, in `--json`, in the MCP `validate` result, and from `validateFormat` | `information` for some codes, such as the decimal precision warning | always `warning`; the verdict and the exit code are unchanged, since neither severity fails it | `grep -rn 'information'` near a check on `validate` output, or `jq '.findings[] \| select(.severity == "information")'` |
| A code passed through from `@cosyte/hl7`, in `warnings[].code`, `findings[].code`, the parenthesized code after `CLI_PARSE_FAILED`, and a failed record's `error` | an unprefixed name, such as `NO_MSH_SEGMENT` | the same name with `HL7_` in front: `HL7_NO_MSH_SEGMENT` | `grep -rnE '"[A-Z][A-Z0-9]*(_[A-Z0-9]+)+"'` in the code that reads HL7 v2 output |
| A code passed through from `@cosyte/fhir`, in the same places | `MALFORMED_JSON`, `CODE_INVALID`, `INVARIANT_VIOLATED`, `DECIMAL_PRECISION_AT_RISK` | `FHIR_MALFORMED_JSON`, `FHIR_CODE_INVALID`, `FHIR_INVARIANT_VIOLATED`, `FHIR_DECIMAL_PRECISION_AT_RISK` | the same `grep`, in the code that reads FHIR output |
| A code passed through from `@cosyte/ccda`, in the same places | an unprefixed name, such as `NOT_WELL_FORMED_XML` | the same name with `CCDA_` in front: `CCDA_NOT_WELL_FORMED_XML` | the same `grep`, in the code that reads C-CDA output |
| An MLLP stream with a start byte (`VT`) inside a frame, read by `cosyte parse` or `cosyte inspect` | exit `0`: the bytes before the second `VT` dropped with an `MLLP_TRAILING_BYTES` framing warning, and the message after it read | exit `65`, `CLI_PARSE_FAILED` with `(MLLP_PAYLOAD_CONTAINS_VT)`: the frame is refused whole and nothing in it is read | a script that expects exit `0` or a nonzero `warningCount` from `inspect` on such a stream |

Each library's own changelog lists every renamed code. The ones the `cosyte` docs and examples use:

| Library | Before | After |
| -------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `@cosyte/hl7` | `NO_MSH_SEGMENT`, `MSH_TOO_SHORT`, `INVALID_ENCODING_CHARACTERS`, `EMPTY_INPUT` | `HL7_NO_MSH_SEGMENT`, `HL7_MSH_TOO_SHORT`, `HL7_INVALID_ENCODING_CHARACTERS`, `HL7_EMPTY_INPUT` |
| `@cosyte/fhir` | `MALFORMED_JSON`, `CODE_INVALID`, `INVARIANT_VIOLATED`, `DECIMAL_PRECISION_AT_RISK`, `UNKNOWN_ELEMENT`, `CARDINALITY_MIN` | `FHIR_MALFORMED_JSON`, `FHIR_CODE_INVALID`, `FHIR_INVARIANT_VIOLATED`, `FHIR_DECIMAL_PRECISION_AT_RISK`, `FHIR_UNKNOWN_ELEMENT`, `FHIR_CARDINALITY_MIN` |
| `@cosyte/ccda` | `NOT_WELL_FORMED_XML`, `MISSING_DOSE_QUANTITY` | `CCDA_NOT_WELL_FORMED_XML`, `CCDA_MISSING_DOSE_QUANTITY` |
| `@cosyte/mllp` | `MLLP_TRAILING_BYTES` on a `VT` inside a frame | `MLLP_PAYLOAD_CONTAINS_VT` |

The `CLI_*` codes, the exit codes, the commands and their flags are unchanged. An install of this release takes the 0.2 lines of `@cosyte/hl7`, `@cosyte/fhir` and `@cosyte/ccda` and nothing older, so a project that also depends on one of them directly moves it to 0.2 in the same change.

## 0.1.15

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion docs-content/api/src.md
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ The default, safe posture: no value ever reaches a secondary surface.

### VERSION

> `const` **VERSION**: `string` = `"0.1.15"`
> `const` **VERSION**: `string` = `"0.2.0"`

The `@cosyte/cli` version. On the uniform `v0.0.x-until-first-alpha` ladder.

Expand Down
2 changes: 1 addition & 1 deletion docs-content/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ you installed, the install is good:
```ts runnable
import { VERSION } from "@cosyte/cli";

VERSION; // => "0.1.15"
VERSION; // => "0.2.0"
```

The release tooling rewrites that value at each release, and the test suite compares it with the
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cosyte/cli",
"version": "0.1.15",
"version": "0.2.0",
"description": "The Cosyte command line for Node.js and TypeScript: one command over HL7 v2, FHIR R4, X12, ASTM, NCPDP, C-CDA, DICOM, and MLLP, with HL7 v2 to FHIR conversion from transform, code mapping from terminology, and the cosyte-mcp MCP server for agents.",
"keywords": [
"cli",
Expand Down
2 changes: 1 addition & 1 deletion src/core/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
* console.log(`cosyte ${VERSION}`);
* ```
*/
export const VERSION: string = "0.1.15";
export const VERSION: string = "0.2.0";
Loading