Closed BillyYarosh-WellSky closed 4 years ago
I'm not sure if this will make a difference, but the I believe the contained resource should be FHIR::Medication.new(id: 'medication-1234')
. Does that help?
Sorry, I didn't supply a fully built resource but just enough to exercise the issue. Yes, if I add an ID, the issue persists.
Ah yes, the ID is required in the contained medication. The specific issue was that my ID was an integer type so when the library checks equality it fails because 1234 != '1234'
.
When building a
FHIR::MedicationRequest
, you can include the medication in thecontained
section. In this case, themedicationReference
is a relatively linked resource. Validation fails in this case.Example:
This outputs the error:
In the case of medicationReference, you should be able to specify a reference URL this is a hash tag. More info here: http://hl7.org/fhir/STU3/references.html#contained