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:
parent
b67c7b23e8
commit
ae4183852f
@ -206,8 +206,10 @@ function createDicomJSONApi(dicomJsonConfig) {
|
|||||||
url: instance.url,
|
url: instance.url,
|
||||||
imageId: instance.url,
|
imageId: instance.url,
|
||||||
...series,
|
...series,
|
||||||
|
...study,
|
||||||
};
|
};
|
||||||
delete obj.instances;
|
delete obj.instances;
|
||||||
|
delete obj.series;
|
||||||
return obj;
|
return obj;
|
||||||
});
|
});
|
||||||
storeInstances(instances);
|
storeInstances(instances);
|
||||||
|
|||||||
@ -211,7 +211,7 @@ function TrackedCornerstoneViewport(props) {
|
|||||||
seriesDescription: SeriesDescription,
|
seriesDescription: SeriesDescription,
|
||||||
patientInformation: {
|
patientInformation: {
|
||||||
patientName: PatientName
|
patientName: PatientName
|
||||||
? OHIF.utils.formatPN(PatientName.Alphabetic)
|
? OHIF.utils.formatPN(PatientName)
|
||||||
: '',
|
: '',
|
||||||
patientSex: PatientSex || '',
|
patientSex: PatientSex || '',
|
||||||
patientAge: PatientAge || '',
|
patientAge: PatientAge || '',
|
||||||
|
|||||||
@ -6,9 +6,11 @@ export default function formatPN(name) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const nameToUse = name.Alphabetic ?? name;
|
||||||
|
|
||||||
// Convert the first ^ to a ', '. String.replace() only affects
|
// Convert the first ^ to a ', '. String.replace() only affects
|
||||||
// the first appearance of the character.
|
// the first appearance of the character.
|
||||||
const commaBetweenFirstAndLast = name.replace('^', ', ');
|
const commaBetweenFirstAndLast = nameToUse.replace('^', ', ');
|
||||||
|
|
||||||
// Replace any remaining '^' characters with spaces
|
// Replace any remaining '^' characters with spaces
|
||||||
const cleaned = commaBetweenFirstAndLast.replace(/\^/g, ' ');
|
const cleaned = commaBetweenFirstAndLast.replace(/\^/g, ' ');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user