Closed psalaets closed 2 years ago
When given a CCDA document with social history records that contain
<value xsi:type="PQ" value="12" />
the value is not parsed by blue-button. That social history record will not have a value property but value is required by the model.
https://github.com/HL7/C-CDA-Examples/blob/master/Documents/CCD/CCD%201/CCD.XML
The <value> with xsi:type="PQ" is on line 3148.
<value>
xsi:type="PQ"
After parsing the xml above and printing bb.validator.getLastError(), I see an error:
bb.validator.getLastError()
{ code: 'OBJECT_MISSING_REQUIRED_PROPERTY', params: [ 'value' ], message: 'Missing required property: value', path: '#/data/social_history/1', schemaId: 'document_model' }
Update the xpath expression in the social history parser so it handles PQ values.
PQ
-["value", "0..1", "h:value[@xsi:type='ST']/text() | h:value[@xsi:type='CD']/@displayName"] +["value", "0..1", "h:value[@xsi:type='ST']/text() | h:value[@xsi:type='CD']/@displayName | h:value[@xsi:type='PQ']/@value"]
Would you be open to accepting a PR with this change?
@psalaets Send a PR for this when ready.
Thanks for the quick turnaround
Problem
When given a CCDA document with social history records that contain
the value is not parsed by blue-button. That social history record will not have a value property but value is required by the model.
Example xml
https://github.com/HL7/C-CDA-Examples/blob/master/Documents/CCD/CCD%201/CCD.XML
The
<value>
withxsi:type="PQ"
is on line 3148.Parses into invalid document
After parsing the xml above and printing
bb.validator.getLastError()
, I see an error:Proposed fix
Update the xpath expression in the social history parser so it handles
PQ
values.Would you be open to accepting a PR with this change?