Repository navigation
CDA
Bahasa / Language: English · Bahasa Indonesia
CDA R2 is the document format that accompanies HL7 v2 messages in Indonesian hospital exchange: v2 carries the transaction, CDA carries the signed document. CDA R2 adalah format dokumen yang menyertai pesan HL7 v2 di pertukaran rumah sakit Indonesia: v2 membawa transaksi, CDA membawa dokumen yang ditandatangani.
CDA R2 is hundreds of pages of optional structure. This SDK models the part that is used in practice:
-
Header —
id,code,title,effectiveTime,confidentialityCode,recordTarget/patientRole(identifiers with theirroot, name, sex, birth date),author,custodian. -
Body —
structuredBodysections with LOINC codes, titles, and narrativetext, including nested sections. -
Validation — the header rules that matter for exchange. An empty
validate()means the document is exchangeable, not that it is clinically correct.
-
It does not rebuild the document from its own model.
toXml()writes the DOM it parsed, socomponentOf,participant,legalAuthenticatorand vendor extensions survive a round trip. A parser that regenerates the XML deletes everything it did not understand. - It does not ship the HL7 schemas. They are licensed; validation here is structural, based on the rules in the specification, not an XSD run.
$doc = Document::parse($xml);
$doc->title();
$doc->patient()->identifier('2.16.840.1.113883.3.3157.1003.1');
$doc->authors();
$doc->section('10164-2')->title;
$doc->sectionText('10164-2'); // narrative as text, paragraphs kept
$doc->validate(); // [] when the header is complete$doc = Document::build([
'id' => 'DOC-1', 'title' => 'Resume Medis',
'custodian' => 'RS Contoh', 'author' => 'Dokter Contoh',
'patientId' => '3171234567890001', 'patientName' => 'ANGGRAENI',
'gender' => 'F', 'birthTime' => '19850312',
'sections' => [['loinc' => '10164-2', 'title' => 'Riwayat', 'text' => '<paragraph>Demam.</paragraph>']],
]);Signatures (ds:Signature verification), templates beyond the generic POCD_MT000040 header,
nonXMLBody attachments, and CDA → FHIR mapping. The other four SDKs do not have CDA yet.
CDA R2 adalah ratusan halaman struktur opsional. SDK ini memodelkan bagian yang dipakai sehari-hari:
-
Header —
id,code,title,effectiveTime,confidentialityCode,recordTarget/patientRole(identifier besertaroot-nya, nama, jenis kelamin, tanggal lahir),author,custodian. -
Body — section
structuredBodydengan kode LOINC, judul, dantextnaratif, termasuk section bersarang. -
Validasi — aturan header yang penting untuk pertukaran.
validate()kosong berarti dokumen layak dipertukarkan, bukan berarti benar secara klinis.
-
Tidak membangun ulang dokumen dari modelnya sendiri.
toXml()menulis DOM yang tadi diparsing, sehinggacomponentOf,participant,legalAuthenticator, dan ekstensi vendor selamat melewati round trip. Parser yang meregenerasi XML akan menghapus semua yang tidak ia pahami. - Tidak menyertakan skema HL7. Skemanya berlisensi; validasi di sini bersifat struktural berdasarkan aturan spesifikasi, bukan menjalankan XSD.
$doc = Document::parse($xml);
$doc->patient()->identifier('2.16.840.1.113883.3.3157.1003.1');
$doc->sectionText('10164-2');$doc = Document::build([...]); // header + sections, lihat README
echo $doc->toXml();Tanda tangan (ds:Signature), template selain header generik POCD_MT00040, lampiran nonXMLBody,
dan pemetaan CDA → FHIR. Empat SDK lain belum memiliki CDA.
from satusehat_integration.cda import Document
doc = Document.parse(xml)
doc.section_text("10164-2")Uses xml.etree.ElementTree from the standard library — no new dependency, and no external entity
resolution. Method names follow Python (section_text, to_xml, document_id).
Memakai xml.etree.ElementTree dari pustaka standar — tanpa dependensi baru, dan tanpa resolusi
entitas eksternal. Nama metode mengikuti gaya Python (section_text, to_xml, document_id).