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,
|
||||
imageId: instance.url,
|
||||
...series,
|
||||
...study,
|
||||
};
|
||||
delete obj.instances;
|
||||
delete obj.series;
|
||||
return obj;
|
||||
});
|
||||
storeInstances(instances);
|
||||
|
||||
@ -211,7 +211,7 @@ function TrackedCornerstoneViewport(props) {
|
||||
seriesDescription: SeriesDescription,
|
||||
patientInformation: {
|
||||
patientName: PatientName
|
||||
? OHIF.utils.formatPN(PatientName.Alphabetic)
|
||||
? OHIF.utils.formatPN(PatientName)
|
||||
: '',
|
||||
patientSex: PatientSex || '',
|
||||
patientAge: PatientAge || '',
|
||||
|
||||
@ -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, ' ');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user