@@ -170,7 +170,6 @@ class ValueRepresentation {
170
170
return values ;
171
171
}
172
172
173
-
174
173
read ( stream , length , syntax , readOptions = { forceStoreRaw : false } ) {
175
174
if ( this . fixed && this . maxLength ) {
176
175
if ( ! length ) return this . defaultValue ;
@@ -639,14 +638,16 @@ class CodeString extends AsciiStringRepresentation {
639
638
640
639
readBytes ( stream , length ) {
641
640
const BACKSLASH = String . fromCharCode ( VM_DELIMITER ) ;
642
- return this . dropPadByte ( stream . readAsciiString ( length ) . split ( BACKSLASH ) ) ;
641
+ return this . dropPadByte (
642
+ stream . readAsciiString ( length ) . split ( BACKSLASH )
643
+ ) ;
643
644
}
644
645
645
646
applyFormatting ( value ) {
646
- const trim = ( str ) => str . trim ( ) ;
647
+ const trim = str => str . trim ( ) ;
647
648
648
649
if ( Array . isArray ( value ) ) {
649
- return value . map ( ( str ) => trim ( str ) ) ;
650
+ return value . map ( str => trim ( str ) ) ;
650
651
}
651
652
652
653
return trim ( value ) ;
@@ -697,7 +698,6 @@ class DateValue extends AsciiStringRepresentation {
697
698
}
698
699
699
700
class NumericStringRepresentation extends AsciiStringRepresentation {
700
-
701
701
readBytes ( stream , length ) {
702
702
const BACKSLASH = String . fromCharCode ( VM_DELIMITER ) ;
703
703
const numStr = stream . readAsciiString ( length ) ;
@@ -714,10 +714,10 @@ class DecimalString extends NumericStringRepresentation {
714
714
}
715
715
716
716
applyFormatting ( value ) {
717
- const formatNumber = ( numberStr ) => {
717
+ const formatNumber = numberStr => {
718
718
let returnVal = numberStr . trim ( ) . replace ( / [ ^ 0 - 9 . \\ \- + e ] / gi, "" ) ;
719
719
return returnVal === "" ? null : Number ( returnVal ) ;
720
- }
720
+ } ;
721
721
722
722
if ( Array . isArray ( value ) ) {
723
723
return value . map ( formatNumber ) ;
@@ -728,7 +728,7 @@ class DecimalString extends NumericStringRepresentation {
728
728
729
729
convertToString ( value ) {
730
730
if ( value === null ) return "" ;
731
- if ( typeof value === ' string' ) return value ;
731
+ if ( typeof value === " string" ) return value ;
732
732
733
733
let str = String ( value ) ;
734
734
if ( str . length > this . maxLength ) {
@@ -841,10 +841,10 @@ class IntegerString extends NumericStringRepresentation {
841
841
}
842
842
843
843
applyFormatting ( value ) {
844
- const formatNumber = ( numberStr ) => {
844
+ const formatNumber = numberStr => {
845
845
let returnVal = numberStr . trim ( ) . replace ( / [ ^ 0 - 9 . \\ \- + e ] / gi, "" ) ;
846
846
return returnVal === "" ? null : Number ( returnVal ) ;
847
- }
847
+ } ;
848
848
849
849
if ( Array . isArray ( value ) ) {
850
850
return value . map ( formatNumber ) ;
@@ -854,7 +854,7 @@ class IntegerString extends NumericStringRepresentation {
854
854
}
855
855
856
856
convertToString ( value ) {
857
- if ( typeof value === ' string' ) return value ;
857
+ if ( typeof value === " string" ) return value ;
858
858
return value === null ? "" : String ( value ) ;
859
859
}
860
860
@@ -967,14 +967,17 @@ class PersonName extends EncodedStringRepresentation {
967
967
}
968
968
969
969
readBytes ( stream , length ) {
970
- return this . readPaddedEncodedString ( stream , length ) . split ( String . fromCharCode ( VM_DELIMITER ) ) ;
970
+ return this . readPaddedEncodedString ( stream , length ) . split (
971
+ String . fromCharCode ( VM_DELIMITER )
972
+ ) ;
971
973
}
972
974
973
975
applyFormatting ( value ) {
974
- const parsePersonName = ( valueStr ) => dicomJson . pnConvertToJsonObject ( valueStr , false ) ;
976
+ const parsePersonName = valueStr =>
977
+ dicomJson . pnConvertToJsonObject ( valueStr , false ) ;
975
978
976
979
if ( Array . isArray ( value ) ) {
977
- return value . map ( ( valueStr ) => parsePersonName ( valueStr ) ) ;
980
+ return value . map ( valueStr => parsePersonName ( valueStr ) ) ;
978
981
}
979
982
980
983
return parsePersonName ( value ) ;
@@ -1321,16 +1324,16 @@ class UniqueIdentifier extends AsciiStringRepresentation {
1321
1324
// https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.4.html
1322
1325
1323
1326
if ( result . indexOf ( BACKSLASH ) === - 1 ) {
1324
- return result
1327
+ return result ;
1325
1328
} else {
1326
1329
return this . dropPadByte ( result . split ( BACKSLASH ) ) ;
1327
1330
}
1328
1331
}
1329
1332
1330
1333
applyFormatting ( value ) {
1331
- const removeInvalidUidChars = ( uidStr ) => {
1334
+ const removeInvalidUidChars = uidStr => {
1332
1335
return uidStr . replace ( / [ ^ 0 - 9 . ] / g, "" ) ;
1333
- }
1336
+ } ;
1334
1337
1335
1338
if ( Array . isArray ( value ) ) {
1336
1339
return value . map ( removeInvalidUidChars ) ;
@@ -1385,7 +1388,12 @@ class ParsedUnknownValue extends BinaryRepresentation {
1385
1388
i = 0 ;
1386
1389
1387
1390
while ( i ++ < times ) {
1388
- const { rawValue, value } = vr . read ( streamFromBuffer , vr . maxLength , syntax , readOptions ) ;
1391
+ const { rawValue, value } = vr . read (
1392
+ streamFromBuffer ,
1393
+ vr . maxLength ,
1394
+ syntax ,
1395
+ readOptions
1396
+ ) ;
1389
1397
rawValues . push ( rawValue ) ;
1390
1398
values . push ( value ) ;
1391
1399
}
@@ -1466,4 +1474,4 @@ let VRinstances = {
1466
1474
UT : new UnlimitedText ( )
1467
1475
} ;
1468
1476
1469
- export { ValueRepresentation } ;
1477
+ export { ValueRepresentation } ;
0 commit comments