Closed psalaets closed 2 years ago
There can be two performers in a medication record:
medication.performer
medication.dispense.performer
and both parse phone as a 0..1 (see here) field.
phone
0..1
In the model, phone is supposed to be an array.
See
cda_performer
When I run the example in the README and print out bb.validator.lastError, it contains some related errors
bb.validator.lastError
{ code: 'INVALID_TYPE', params: [ 'array', 'object' ], message: 'Expected type array but found type object', path: '#/data/medications/0/dispense/performer/phone', schemaId: 'document_model' }
and
{ code: 'INVALID_TYPE', params: [ 'array', 'object' ], message: 'Expected type array but found type object', path: '#/data/medications/0/performer/phone', schemaId: 'document_model' }
If this is a legit issue and I'm not overlooking something, are you open to accepting a PR with the fix? I would change the phone's 0..1 to 0..*.
0..*
@psalaets Yes, send a PR for this issue when ready.
Background
There can be two performers in a medication record:
medication.performer
medication.dispense.performer
and both parse
phone
as a0..1
(see here) field.Problem
In the model,
phone
is supposed to be an array.See
medication.performer
is acda_performer
as defined at medication model line 234medication.dispense.performer
is acda_performer
as defined at medication model line 250phone
definition within thecda_performer
definition at common models line 291Invalid document
When I run the example in the README and print out
bb.validator.lastError
, it contains some related errorsand
If this is a legit issue and I'm not overlooking something, are you open to accepting a PR with the fix? I would change the phone's
0..1
to0..*
.