php-fhir
php-fhir copied to clipboard
Extra attribute in element
We are using version 2.0.5 of the generated library and when we are generating a dosage the doseQuantity contains an extra value
attribute. I'm not sure if I have reported this earlier, I could not find an previous issue.
<?xml version="1.0"?>
<Dosage xmlns="http://hl7.org/fhir">
<doseQuantity value="1">
<code value="245"/>
<system value="urn:oid:2.16.840.1.113883.2.4.4.1.900.2"/>
<unit value="STUK"/>
<value value="1"/>
</doseQuantity>
<route>
<coding>
<code value="9"/>
<display value="Oraal"/>
<system value="urn:oid:2.16.840.1.113883.2.4.4.9"/>
</coding>
</route>
<sequence value="1"/>
<text value="1x daags 1 stuks"/>
<timing>
<repeat>
<frequency value="1"/>
<period value="1"/>
<periodUnit value="d"/>
<timeOfDay value="08:00:00"/>
</repeat>
</timing>
</Dosage>
When validating it produces this error:
Error @ /f:Dosage/f:doseQuantity (line 3, col27) : Undefined attribute '@value' on doseQuantity for type Quantity (properties = [Quantity.id, Quantity.extension, Quantity.value, Quantity.comparator, Quantity.unit, Quantity.system, Quantity.code])
@leonrenkema: this is a known issue at this point, and i am attempting to address it with the current work being done in Master. Part of that is adding phpunit tests that execute and test the output of the upstream java validator.
Unsure as to when I'll be able to finish it, but work is being done.
Thanks for the quick reply. Keep me informed when there is any progress or when I can test something
@leonrenkema: I have release v3.0.0 of the generator with one of the features being that the parser now records where in the source XML it found primitive values. You can also specify where to serialize these values through the 2nd parameter on primitive setters.
Can you please test these changes and see if they work for you?