APIs
Standards
Field-level parse, get, set, serialize, and validate for interchange formats. Most families share the same shape: parse → tree, get/set by path, serialize back to the wire, validate for structure.
When Studio recognizes the sample content type, msg.parsed is already a tree. You can still call these helpers on msg.raw.
const family = sirius.hl7.get(msg.raw, "PID-5.1");
const out = sirius.hl7.set(msg.raw, "PID-5.1", sirius.text.upper(family));
result = { message: out };
const id = sirius.x12.get(msg.raw, "N1-2");
const tree = sirius.iso20022.parse(msg.raw);
const ack = sirius.ack.build(msg.raw, { accepted: true });
This page lists 79 symbols. The same catalog drives Studio autocomplete.
See also: Overview · Core · I/O and runtime · Devices
sirius.hl7
| Symbol | Signature | Returns | Summary |
|---|
sirius.hl7.ack | sirius.hl7.ack(raw, code?) | string (ACK) | build an HL7 ACK |
sirius.hl7.get | sirius.hl7.get(raw, path) | string | read a field/component by HL7 path (e.g. PID-5.1) |
sirius.hl7.get_all | sirius.hl7.get_all(raw, path) | list of strings | read EVERY value matching an HL7 path across repeating segments/fields (e.g. all OBX-5, all PID-3 reps) |
sirius.hl7.parse | sirius.hl7.parse(raw) | tree (map) | parse HL7 v2 to a named tree |
sirius.hl7.serialize | sirius.hl7.serialize(tree) | string (raw) | rebuild a raw HL7 message from a parsed tree |
sirius.hl7.set | sirius.hl7.set(raw, path, value) | string (raw) | set a field/component by HL7 path, auto-extending; build outbound HL7 |
sirius.hl7.parse_schema | sirius.hl7.parse_schema(raw, schema) | tree | parse against a message schema (kind-dispatched) |
sirius.hl7.message | sirius.hl7.message() | node | construct an empty HL7 node |
sirius.hl7.tree | sirius.hl7.tree(raw) | node | parse HL7 v2 into a navigable node |
sirius.fhir
| Symbol | Signature | Returns | Summary |
|---|
sirius.fhir.bundle | sirius.fhir.bundle(entries, type?) | Bundle (map) | wrap resources into a FHIR Bundle |
sirius.fhir.get | sirius.fhir.get(resource, path) | value | FHIRPath-lite accessor (e.g. name[0].family) |
sirius.fhir.reference | sirius.fhir.reference(resource) | string | build a relative reference (ResourceType/id) |
sirius.fhir.validate | sirius.fhir.validate(resource, profile?) | list of issues | profile/IG-aware validation → list of { path, severity, message }. profile may be a JSON StructureDefinition (cardinality, fixed[x]/pattern[x], type, required bindings via binding.valueSetCodes) or a CSV of required top-level elements |
sirius.x12
| Symbol | Signature | Returns | Summary |
|---|
sirius.x12.ack | sirius.x12.ack(raw, kind?, accepted?) | string (ack interchange) | generate an X12 acknowledgement addressed back to the sender: kind 997 (functional), 999 (implementation), or TA1 (interchange envelope); accepted?=false reports rejection |
sirius.x12.get | sirius.x12.get(raw, path) | string | read an element/component by X12 path (e.g. NM1-3, NM1-3.2, REF[2]-2) |
sirius.x12.parse | sirius.x12.parse(raw) | tree (map) | parse X12 to a tree |
sirius.x12.serialize | sirius.x12.serialize(tree) | string (raw) | rebuild a raw X12 interchange from a parsed tree |
sirius.x12.set | sirius.x12.set(raw, path, value) | string (raw) | set an element/component by X12 path, auto-extending; build outbound X12 |
sirius.x12.validate | sirius.x12.validate(raw, accepted?, expected_sender?) | { ok, sender_id, receiver_id, functional_id, transaction_sets, error? } | structurally validate an X12 interchange (ISA…IEA + ST), optional accepted-set allowlist + expected sender |
sirius.x12.parse_schema | sirius.x12.parse_schema(raw, schema) | tree | parse against an X12 message schema |
sirius.x12.tree | sirius.x12.tree(raw) | node | parse X12 into a navigable node |
sirius.edifact
| Symbol | Signature | Returns | Summary |
|---|
sirius.edifact.ack | sirius.edifact.ack(raw, accepted?) | string (CONTRL interchange) | generate a CONTRL service acknowledgement addressed back to the sender; accepted?=false emits a true NEGATIVE CONTRL (UCI action 4) |
sirius.edifact.get | sirius.edifact.get(raw, path) | string | read an element/component by EDIFACT path (e.g. BGM-1, NAD-3.1, LIN[2]-1) |
sirius.edifact.parse | sirius.edifact.parse(raw) | tree (map) | parse EDIFACT to a named tree (components expand into leaves) |
sirius.edifact.serialize | sirius.edifact.serialize(tree) | string (raw) | rebuild a raw EDIFACT interchange from a parsed tree |
sirius.edifact.set | sirius.edifact.set(raw, path, value) | string (raw) | set an element/component by EDIFACT path, auto-extending; build outbound EDIFACT |
sirius.edifact.validate | sirius.edifact.validate(raw, accepted?, expected_sender?) | { ok, sender_id, receiver_id, control_ref, message_types, error? } | structurally validate an EDIFACT interchange (UNB…UNZ), optional accepted message-type allowlist + expected sender |
sirius.edi
| Symbol | Signature | Returns | Summary |
|---|
sirius.edi.infer | sirius.edi.infer(samples, opts?) | { guideline, report } | infer a draft X12/EDIFACT implementation guide from a set of real partner sample interchanges, plus a variance report explaining each rule (present in N of M samples, code confidence). opts: standard?, transaction_set?, id?, name?, version?, max_codes?, max_code_len?. Auto-detects the dialect and transaction set; per-sample parse failures are reported under report.skipped |
sirius.iso20022
| Symbol | Signature | Returns | Summary |
|---|
sirius.iso20022.get | sirius.iso20022.get(raw, path) | string | read a leaf by element path (e.g. CstmrCdtTrfInitn/GrpHdr/MsgId; //Tag descends; PmtInf[2] indexes) |
sirius.iso20022.parse | sirius.iso20022.parse(raw) | tree (map) | parse an ISO 20022 XML document to a faithful tree ({ tag, attrs, text, children }) |
sirius.iso20022.serialize | sirius.iso20022.serialize(tree) | string (raw) | rebuild a raw ISO 20022 document from a parsed tree |
sirius.iso20022.set | sirius.iso20022.set(raw, path, value) | string (raw) | set a leaf by element path, auto-extending missing elements; build outbound ISO 20022 |
sirius.iso20022.validate | sirius.iso20022.validate(raw, accepted?) | { ok, message_type, message_root, namespace, errors } | structurally validate an ISO 20022 document (Document wrapper, ISO xsd namespace, single message def, group header), optional accepted message-type allowlist (e.g. pain.001) |
sirius.swift.mt
| Symbol | Signature | Returns | Summary |
|---|
sirius.swift.mt.get | sirius.swift.mt.get(raw, path) | string | read a value by block/field path (e.g. 4/20, 2, 3/108, 4/71F[2], 5/CHK) |
sirius.swift.mt.parse | sirius.swift.mt.parse(raw) | tree (map) | parse a SWIFT MT (FIN) message to a tree ({ block1, block2, block3[], block4[], block5[] }) |
sirius.swift.mt.serialize | sirius.swift.mt.serialize(tree) | string (raw) | rebuild a raw SWIFT MT message from a parsed tree |
sirius.swift.mt.set | sirius.swift.mt.set(raw, path, value) | string (raw) | set a value by block/field path, auto-extending a missing field; build outbound MT |
sirius.swift.mt.validate | sirius.swift.mt.validate(raw, accepted?) | { ok, message_type, direction, sender_bic, receiver_bic, errors } | structurally validate a SWIFT MT message (basic + application headers + text block) and derive type/direction/BICs; optional accepted MT-type allowlist (e.g. 103) |
sirius.fix
| Symbol | Signature | Returns | Summary |
|---|
sirius.fix.get | sirius.fix.get(raw, path) | string | read a value by tag path (e.g. 35, 44, 268[2] for the 2nd occurrence) |
sirius.fix.parse | sirius.fix.parse(raw) | tree (map) | parse a FIX message (SOH or //^ delimited) to a tree ({ fields: [{ tag, value }], msg_type, begin_string }) |
sirius.fix.serialize | sirius.fix.serialize(tree) | string (raw) | rebuild a raw FIX message from a parsed tree, recomputing BodyLength (9) + CheckSum (10) |
sirius.fix.set | sirius.fix.set(raw, path, value) | string (raw) | set a value by tag path, auto-extending a missing field; build outbound FIX (frame refreshed) |
sirius.fix.validate | sirius.fix.validate(raw, accepted?) | { ok, message_type, begin_string, sender_comp_id, target_comp_id, msg_seq_num, errors } | structurally validate a FIX message (BeginString + MsgType, BodyLength + CheckSum), optional accepted MsgType allowlist (e.g. D or NewOrderSingle) |
sirius.fpml
| Symbol | Signature | Returns | Summary |
|---|
sirius.fpml.get | sirius.fpml.get(raw, path) | string | read a leaf by element path (e.g. trade/tradeHeader/partyTradeIdentifier/tradeId; //tradeId descends; swapStream[2] indexes) |
sirius.fpml.parse | sirius.fpml.parse(raw) | tree (map) | parse an FpML XML document to a faithful tree ({ tag, attrs, text, children }) |
sirius.fpml.serialize | sirius.fpml.serialize(tree) | string (raw) | rebuild a raw FpML document from a parsed tree |
sirius.fpml.set | sirius.fpml.set(raw, path, value) | string (raw) | set a leaf by element path, auto-extending missing elements; build outbound FpML |
sirius.fpml.validate | sirius.fpml.validate(raw, accepted?) | { ok, message_type, view, version, namespace, errors } | structurally validate an FpML document (FpML namespace + schema view, fpmlVersion, resolvable message type), optional accepted message-type allowlist (e.g. RequestConfirmation) |
sirius.ncpdp
| Symbol | Signature | Returns | Summary |
|---|
sirius.ncpdp.get | sirius.ncpdp.get(raw, path) | string | read a leaf by element path in a SCRIPT document (e.g. Body/NewRx/MedicationPrescribed/DrugDescription; //DrugDescription descends; MedicationPrescribed[2] indexes). SCRIPT-only |
sirius.ncpdp.parse | sirius.ncpdp.parse(raw) | tree (map) | parse an NCPDP message — SCRIPT XML to a { tag, attrs, text, children } tree, or a Telecom D.0 stream (0x1E/0x1D/0x1C framing) to { standard, version, transaction_code, header, groups[][] } |
sirius.ncpdp.serialize | sirius.ncpdp.serialize(tree) | string (raw) | rebuild a raw NCPDP message from a parsed tree (SCRIPT XML when the tree has a tag; Telecom D.0 when standard=telecom) |
sirius.ncpdp.set | sirius.ncpdp.set(raw, path, value) | string (raw) | set a leaf by element path in a SCRIPT document, auto-extending missing elements; build outbound SCRIPT. SCRIPT-only |
sirius.ncpdp.validate | sirius.ncpdp.validate(raw, accepted?) | { ok, message_type, version, namespace, errors } | structurally validate an NCPDP message (SCRIPT: namespace + version + Header/Body + resolvable transaction; Telecom: header version + known transaction code + segments), optional accepted transaction allowlist (e.g. NewRx or B1) |
sirius.gs1
| Symbol | Signature | Returns | Summary |
|---|
sirius.gs1.check_digit | sirius.gs1.check_digit(payload) | string (digit) | compute the GS1 mod-10 check digit for a digit payload (key without its check digit) |
sirius.gs1.parse_ai | sirius.gs1.parse_ai(element) | { elements: [{ ai, value, title }], errors } | parse a GS1 Application Identifier element string ((01)…(10)… or raw FNC1 scan data) into AI/value pairs |
sirius.gs1.validate | sirius.gs1.validate(kind, value) | { ok, kind, value, errors } | validate a GS1 key (kind: gtin/gln/sscc) — digits, length, and mod-10 check digit |
sirius.rosettanet
| Symbol | Signature | Returns | Summary |
|---|
sirius.rosettanet.ack | sirius.rosettanet.ack(raw) | string (signal xml) | build an RNIF Receipt Acknowledgment signal referencing the inbound message’s PIP + tracking id |
sirius.rosettanet.get | sirius.rosettanet.get(raw, path) | string | read a value by path: a part kind (preamble/delivery_header/service_header/service_content), part+element (service_header/GlobalUsageCode), or a metadata shortcut (pip_code, message_tracking_id, …) |
sirius.rosettanet.parse | sirius.rosettanet.parse(raw) | tree (map) | parse an RNIF message (MIME multipart/related) to a tree ({ boundary, parts:[{kind,content_id,content_type,body}], metadata }) |
sirius.rosettanet.serialize | sirius.rosettanet.serialize(tree) | string (raw) | rebuild a raw RNIF MIME entity from a parsed tree |
sirius.rosettanet.set | sirius.rosettanet.set(raw, path, value) | string (raw) | set an element’s text within a part; returns the re-serialized message |
sirius.rosettanet.validate | sirius.rosettanet.validate(raw, accepted?) | { ok, rnif_version, pip_code, pip_version, message_type, action_or_signal, from_duns, to_duns, message_tracking_id, usage_code, errors } | structurally validate an RNIF message (required parts + resolvable PIP), optional accepted PIP-code allowlist (e.g. 3A4) |
sirius.as2
| Symbol | Signature | Returns | Summary |
|---|
sirius.as2.mdn_build | sirius.as2.mdn_build(params) | { body_b64, content_type } | assemble a multipart/report MDN body, returning { body_b64, content_type } |
sirius.as2.mdn_parse | sirius.as2.mdn_parse(body_b64) | object | parse a base64 MDN body into its disposition outcome |
sirius.as2.mic | sirius.as2.mic(content_b64, alg?) | string | compute the Received-Content-MIC (’, ’) over base64 content |
sirius.as2.mic_alg | sirius.as2.mic_alg(name) | string | normalize a MIC-algorithm spelling onto sha-256 or sha-1 |
sirius.as2.options_header | sirius.as2.options_header(request) | string | render the Disposition-Notification-Options header a sender emits |
sirius.dicom
| Symbol | Signature | Returns | Summary |
|---|
sirius.dicom.is_dicom | sirius.dicom.is_dicom(data_b64) | bool | report whether base64 data carries the Part-10 preamble + DICM magic |
sirius.dicom.parse | sirius.dicom.parse(data_b64) | object | extract routing metadata (SOP/Study/Series UIDs, modality, patient) from base64 DICOM |
sirius.dicom.transfer_syntax_name | sirius.dicom.transfer_syntax_name(uid) | string | map a transfer-syntax UID to a friendly name |
sirius.ack
| Symbol | Signature | Returns | Summary |
|---|
sirius.ack.assert | sirius.ack.assert(raw, expected?) | { ok, standard, kind, accepted, code?, reason? } | classify a returned acknowledgement and assert it against expectations (standard?, kind?, accepted?, code?, contains?) — the primitive an in-IDE trading-partner simulator uses to turn a 997/CONTRL/MDN/HL7-ACK into a pass/fail regression check |
sirius.ack.build | sirius.ack.build(raw, opts?) | { standard, kind, accepted, ack, content_type? } | build the canonical acknowledgement for a raw inbound message, auto-detecting the standard (or opts.standard). Emits HL7-ACK / 997/999/TA1 / CONTRL / OperationOutcome / MDN. opts: standard?, accepted?, kind? (x12), code? (hl7), profile? (fhir), message_id?/recipient?/mic?/reporting_ua?/text? (as2) |
sirius.ack.classify | sirius.ack.classify(raw) | { standard, kind, accepted, code? } | classify a raw acknowledgement a partner returned (X12 997/999/TA1, EDIFACT CONTRL, AS2 MDN, HL7 ACK, FHIR OperationOutcome) — the inverse of ack.build |
sirius.ack.detect | sirius.ack.detect(raw) | string (standard) | detect the message standard of a raw payload (hl7/x12/edifact/fhir/as2/unknown) |
sirius.batch
| Symbol | Signature | Returns | Summary |
|---|
sirius.batch.split | sirius.batch.split(raw) | list of messages | split an HL7/X12 batch into individual messages (drops FHS/BHS/BTS/FTS or ISA/GS envelope) |
sirius.batch.wrap | sirius.batch.wrap(messages) | string (batch) | wrap messages into an HL7 batch (BHS header + BTS count) |
sirius.terminology
| Symbol | Signature | Returns | Summary |
|---|
sirius.terminology.expand | sirius.terminology.expand(valueSet) | list of strings | expand a value set into its member codes |
sirius.terminology.translate | sirius.terminology.translate(code, from, to) | string (code) | translate a code between code systems |
sirius.terminology.validate | sirius.terminology.validate(code, system) | bool | test whether a code is valid in a code system |