fix: Patient name handling as either Alphabetic object or simply string object
- formatPN should accept a string person name as well as an object with a Alphabetic field. - For DICOM JSON data sources, spread in the patient data from the study object into the instance.
This commit is contained in:
1 parent
b67c7b23e8
commit
ae4183852f
3 files changed
+6
-2
No files matched your search
@@ -6,9 +6,11 @@ export default function formatPN(name) {
|
||||
return;
|
||||
}
|
||||
|
||||
const nameToUse = name.Alphabetic ?? name;
|
||||
|
||||
// Convert the first ^ to a ', '. String.replace() only affects
|
||||
// the first appearance of the character.
|
||||
const commaBetweenFirstAndLast = name.replace('^', ', ');
|
||||
const commaBetweenFirstAndLast = nameToUse.replace('^', ', ');
|
||||
|
||||
// Replace any remaining '^' characters with spaces
|
||||
const cleaned = commaBetweenFirstAndLast.replace(/\^/g, ' ');
|
||||
|
||||
Reference in new issue
Block a user