FR-001checkpassingThe abstract tree MUST be the sum of interchange, group, transaction, segment, loop and element, each a discriminated, readonly record, with the syntax of an interchange a reference of level syntax.
0006-integrations-exchange · owner if · domain commons
FR-001checkpassingThe abstract tree MUST be the sum of interchange, group, transaction, segment, loop and element, each a discriminated, readonly record, with the syntax of an interchange a reference of level syntax.
FR-002checkpassingA path MUST be the ids from the transaction down joined by ., an element with an empty id adding nothing; entries MUST list every value with its path and its indexed path, pathsOf each path once, and occurrences the count of a path under each instance of its parent.
FR-003checkpassingRedaction MUST be written once over the tree: redactTree MUST hide every value whose path, or an ancestor's, a predicate names, and hidingAllBut MUST express minimum-necessary as the elements a recipient may have.
FR-004checkpassingA schema MUST be the paths a kind of transaction has with constraints (cardinality, pattern, fixed, binding), and a profile MUST add constraints to a schema it names.
FR-005checkpassingA finding MUST have a level (syntax, schema, profile, terminology, business-rule), a severity, a code, a path and a message made of the code and the path only; a message MUST NOT hold a value of the payload.
FR-006checkpassingA terminology MUST be the codes of a code system or value set loaded from data supplied, and a binding MUST produce an error for a required strength, a warning for extensible, information for preferred and nothing for example; an unloaded terminology MUST be a warning, never a pass.
FR-007checkpassingvalidate MUST be total and pure: every finding of a transaction against a schema, a profile, the terminologies and the business rules supplied, in the order of the levels.
FR-008checkpassingA mapping MUST be data (map with a transform, carry, drop with a reason) between two schemas, and coverage MUST find a source path that ends in no rule (unmapped-source-field), a rule that names no path, two sources to one target, and every drop as lossy-mapping: a lossy mapping is a finding.
FR-009checkpassingtranslate MUST write each mapped or carried value to its target path, MUST NOT write a dropped one, and MUST stop with unmapped-source-field rather than lose a value silently; transforms are total.
FR-010checkpassingAn acknowledgement MUST be the sum of X12 TA1, X12 999, HL7 ACK and FHIR OperationOutcome, and statusOf MUST be total: HL7 AA and CA accepted, AE and CE accepted with errors, AR and CR rejected; an outcome with an error rejected.
FR-011checkpassingtransition MUST be a total function of a state (pending, sent, received, retrying, acknowledged, rejected, abandoned), an event and the agreement's attempts, and an illegal pair MUST be an error value, never a throw.
FR-012checkpassingA send that times out MUST retry until maxAttempts and then be abandoned; a state that is final (acknowledged, rejected, abandoned) MUST accept no event.
FR-013checkpassingThe library MUST give a structural LedgerPort, a typed record of functions that return a Result and never throw: append a stage event {loadId, stage, reasonCode?, at, contentHash?}, intake a content by its hash giving the closed union first-seen, duplicate (of a load) or conflict (with a load: another content of the same item), outcome to record a validation or acknowledgement outcome by code, and events and outcomes to read them back; a stage MUST be an opaque branded text whose code list belongs to the consumer, and an event MUST carry no payload value: each of its fields is made by a smart constructor that admits no free text.
FR-014checkpassingThe library MUST ship an in-memory ledger and a conformance suite, conformLedger, that any implementation (memory, a database) runs: it finds a ledger that does not keep events in order, does not tell first-seen from duplicate from conflict, accepts an outcome for a load it has no event of, does not read an outcome back, or remembers the contents of another ledger.
FR-015checkpassingThe codes the library produces MUST be exported as closed lists of strings that a consumer may carry as data, each held complete against its union by the compiler: the finding codes and levels, the acknowledgement kinds and statuses, and the rejection kinds.
Claim.note, When its coverage is computed, Then lossy-mapping is found for Claim.note, per FR-008.Patient.name[0].family, When it is printed, Then the family name is not in the message, per FR-005.SC-001success criterionA document is validated, mapped and redacted by code written once, whatever its syntax, and nothing is lost without being named.
Integrations, logical/constraints, logical/exchange, logical/ledger, logical/mapping, logical/tree