aktin / aktin/aktin-scripts

dwh-scripts/extract_logged_cda_to_csv_by_zip.sh does not work sufficiently

オープン
#10 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Shell
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

説明

Bug: extract_logged_cda_to_csv_by_zip.sh does not populate several CSV columns




Summary


Running the Bash script extract_logged_cda_to_csv_by_zip.sh against the 14-day Wolfsburg sample placed on the fileshare produces a CSV whose header lists all required AKTIN / DIVI fields, yet several columns are always NA.

Screenshots provided by Dr. Jennifer Kreklow show the empty fields highlighted in yellow (see cedis_mts_transfer.png & docid_case_diag.png).


This blocks QA and prevents starting the full export.




Affected columns



CSV column | Expected CDA element / CodeSystem | Current value | Notes
-- | -- | -- | --
CEDIS Code | | NA | all rows
MTS Score | | NA | all rows
Transfer | | NA | all rows
Discharge Code | | NA | all rows
Document ID | | NA | all rows
Internal Case Nr. | | NA | all rows
Diagnosis | | NA | all rows




Steps to reproduce




  1. Request two real-world test CDAs from IT (see Contact below) that contain non-empty values for the affected fields.




  2. Place the CDAs in a directory, e.g. /share/cda_test/.




  3. Run the script:

    ./extract_logged_cda_to_csv_by_zip.sh /path/to/aktin.properties /share/cda_test/




  4. Open the generated cda_data_<timestamp>.csv and verify that the columns listed above are still NA.






Environment




  • Script version 1.1 (10 Oct 2024)




  • Bash 5.2, Debian 12 container (same behaviour on RHEL 9)




  • aktin.properties from Wolfsburg deployment (encounter & billing roots verified)






Contact




  • Tomasz Babiuch (please provide two representative CDA files covering the missing fields)




  • CC: Robert Dietrichs, Dr. Jennifer Kreklow






Analysis / Suspected root causes




  1. Incorrect root IDs – The encounter_root and billing_root values in aktin.properties may not match the IDs actually used in the test CDAs.




  2. Regex too strict – Current grep patterns require an explicit xsi:type prefix and may not allow namespace variations.




  3. Multiple occurrences – Using head -1 might pick the wrong section (e.g. administrative vs. clinical) where the field is genuinely empty.






Proposed fix




  • Generalise regex patterns to accept optional namespace prefixes and whitespace.




  • Validate root IDs by echoing them in the log; abort with a clear error if not found.




  • Add a helper script / unit test that parses a mini-CDA snippet for each field.




  • Emit a warning whenever a header field resolves to NA but the tag exists elsewhere in the file (helps QA).

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。