dcm2json produces invalid JSON for broken DS or IS values
dcm2json produces invalid JSON if encountering invalid DS or IS values. The issue showed up in a dataset where a DS-value (RescaleIntercept) contained the value "US". This results in the output "vr":"DS","Value":[US]. Obviously, US is not a valid JSON Number, i.e. the resulting JSON output will be rejected by all(?) JSON parsers.
dcm2json is not responsible for invalid values in the output. However, whenever easily possible, the resulting JSON output should always have a valid syntax.
I'd propose to have a check in IS and DS writeJSON() routines which stop with an error if such an invalid value is encountered.