Skip to main content
Version: v0.2.2

Issue codes

Every diagnostic @cosyte/transform returns is a TransformIssue with one of the codes below. The severity, the FHIR OperationOutcome.issue.code (the R4 issue-type value) and the message are fixed per code in ISSUE_REGISTRY; the only things that vary are the v2 location and the FHIR path, and neither carries a value from the message. The table is checked against the registry by the test suite. The reference documents ISSUE_CODES, ISSUE_REGISTRY and TransformIssue.

A code's name is part of the public contract: renaming or removing one is a breaking change, and new codes are additions only.

Issue codes​

CodeSeverityFHIR issue typeMessage
TRANSFORM_TIMESTAMP_NO_TIMEZONEwarningvaluev2 timestamp carried a time-of-day but no timezone offset; reduced to date precision (FHIR forbids time without a zone).
TRANSFORM_TIMESTAMP_INVALIDwarningvaluev2 timestamp could not be parsed into a valid FHIR date/time; no value emitted.
TRANSFORM_IDENTIFIER_SYSTEM_UNRESOLVEDwarningnot-foundassigning authority could not be resolved to an Identifier.system; identifier emitted with value and no system (never synthesized from a bare namespace).
TRANSFORM_CODE_UNMAPPEDwarningcode-invalidcoded value could not be mapped to a FHIR concept (no coding system, or no target in the IG ConceptMap); original code preserved / FHIR value left absent, never coerced or guessed.
TRANSFORM_CODE_SYSTEM_UNRESOLVEDwarningcode-invalidcoding-system mnemonic not recognized; code preserved, no system URI invented.
TRANSFORM_UNIT_NOT_UCUMwarningvalueunit is not a valid UCUM code; preserved verbatim in Quantity.unit, code/system absent, magnitude never converted.
TRANSFORM_QUANTITY_VALUE_INVALIDwarningvaluenumeric value is not a valid FHIR decimal literal (e.g. leading sign/zero or trailing dot); no Quantity value emitted rather than altering the magnitude.
TRANSFORM_ELEMENT_DROPPEDinformationinformationalpopulated source element was not carried to its FHIR target (no target in this map, or its conversion is not implemented); dropped.
TRANSFORM_NAME_USE_UNMAPPEDinformationvaluename-type code has no equivalent in the HL70200 to name-use map; use left absent.
TRANSFORM_ADDRESS_USE_UNMAPPEDinformationvalueaddress-type code has no equivalent in the HL70190 to address-use/type maps; use/type left absent.
TRANSFORM_SEGMENT_ASSEMBLEDinformationinformationalmessage trigger has no IG message map; resource graph assembled from IG segment maps, best-effort.
TRANSFORM_RESOURCE_INVALIDerrorstructureproduced resource failed FHIR R4 structural validation; withheld from the bundle rather than emitted invalid.
TRANSFORM_REQUIRED_ELEMENT_UNKNOWNinformationinformationalrequired FHIR element could not be derived from the source; emitted with a data-absent-reason extension, never fabricated.
TRANSFORM_MISSING_TRIGGERerrorrequiredreverse conversion requires an explicit v2 trigger from the caller; no resource carries one, so none was inferred and no message was built.
TRANSFORM_UNSUPPORTED_RESOURCEerrornot-supportedresource type is outside the reverse converter's supported shapes; no v2 message emitted and no segment layout guessed.
TRANSFORM_RESOURCE_MALFORMEDerrorstructureinput is not a structurally well-shaped FHIR resource for this conversion; nothing emitted, nothing thrown.
TRANSFORM_NO_V2_TARGETinformationinformationalpopulated FHIR element has no v2 field in this reverse map; surfaced and left out, never approximated into a neighbouring field.
TRANSFORM_VALUE_NOT_REPRESENTABLEwarningvalueFHIR value cannot be carried into its v2 target without altering it; the v2 field is left absent, never truncated, rounded, or coerced.
TRANSFORM_CODE_NOT_INVERTIBLEwarningcode-invalidFHIR code has no usable inverse in the governing IG ConceptMap (ambiguous or absent); v2 field left absent, never resolved arbitrarily.
TRANSFORM_CODE_SYSTEM_NOT_V2warningcode-invalidcoding system has no v2 coding-system mnemonic here; coding flagged rather than written with no table context or from an unrelated table.
TRANSFORM_V2_REQUIRED_FIELD_ABSENTerrorrequireda v2-required field is absent from the emitted segment because the resource carried no source this map could ground it from; left absent per v2 optionality rules and declared here, never filled with a placeholder.
TRANSFORM_NO_V2_MESSAGE_EMITTEDerrorprocessingno v2 message was emitted: nothing in the resource grounded a single field of the target segment, and an empty segment is never emitted.
TRANSFORM_SEGMENT_NOT_EMITTEDinformationinformationalsegment occurrence reached no resource in the returned bundle, and the IG publishes a segment map for its name; the bundle does not represent what this segment carried.
TRANSFORM_SEGMENT_NO_IG_MAPinformationinformationalsegment occurrence reached no resource in the returned bundle, and the IG publishes no segment map for its name, or the name could not be classified at all; the bundle does not represent what this segment carried.
TRANSFORM_TIMESTAMP_DROPPED_BY_PARSERwarningvaluev2 date/time field is valued, but the parser's typed view could not read it and handed back no timestamp; no value emitted.

Which calls raise which codes​

  • The datatype converters, and the message assembly that uses them: TRANSFORM_TIMESTAMP_NO_TIMEZONE, TRANSFORM_TIMESTAMP_INVALID, TRANSFORM_IDENTIFIER_SYSTEM_UNRESOLVED, TRANSFORM_CODE_UNMAPPED, TRANSFORM_CODE_SYSTEM_UNRESOLVED, TRANSFORM_UNIT_NOT_UCUM, TRANSFORM_QUANTITY_VALUE_INVALID, TRANSFORM_NAME_USE_UNMAPPED, TRANSFORM_ADDRESS_USE_UNMAPPED and TRANSFORM_ELEMENT_DROPPED.
  • toFhir alone: TRANSFORM_SEGMENT_ASSEMBLED, TRANSFORM_RESOURCE_INVALID, TRANSFORM_REQUIRED_ELEMENT_UNKNOWN, TRANSFORM_TIMESTAMP_DROPPED_BY_PARSER, TRANSFORM_SEGMENT_NOT_EMITTED and TRANSFORM_SEGMENT_NO_IG_MAP.
  • toFhirCodeableConceptVia: TRANSFORM_CODE_UNMAPPED and TRANSFORM_CODE_SYSTEM_UNRESOLVED.
  • The reverse path, toV2Patient and toV2Observation: TRANSFORM_MISSING_TRIGGER, TRANSFORM_UNSUPPORTED_RESOURCE, TRANSFORM_RESOURCE_MALFORMED, TRANSFORM_NO_V2_TARGET, TRANSFORM_VALUE_NOT_REPRESENTABLE, TRANSFORM_CODE_NOT_INVERTIBLE, TRANSFORM_CODE_SYSTEM_NOT_V2, TRANSFORM_V2_REQUIRED_FIELD_ABSENT and TRANSFORM_NO_V2_MESSAGE_EMITTED.

Fatal codes​

FATAL_CODES names the conditions a future entry point may throw for. Nothing in the library throws one today: every path returns an issue instead. They are declared so that a future one is an addition rather than a rename.

CodeMeaning
EMPTY_INPUTThe input carried nothing to transform.
TRANSFORM_UNSUPPORTED_INPUTThe input was not a shape this transform accepts.

See also​