Stream: dotnet
Topic: Medications to MedicationRequest
Marco Rudolph (Jun 06 2019 at 11:54):
Hi, i try to add a List of Medication to a MedicationRequest.. How can i do that?
Michel Rutten (Jun 06 2019 at 12:08):
The MedicationRequest.medication
element only accepts a single value...
http://hl7.org/fhir/medicationrequest-definitions.html#MedicationRequest.medication_x_
Marco Rudolph (Jun 06 2019 at 12:25):
Hey thanks.. last step: how can i assign a Medication to the Medicationfield of a MedicationRequest?
Where are these basics documented?
"MedicationRequest mediRequest = new MedicationRequest();
Medication medi = new Medication();
mediRequest.Medication = medi;" <- does not work.
Michel Rutten (Jun 06 2019 at 12:29):
Hi @Marco Rudolph, the MedicationRequest.medication
field accepts a ResourceReference to an (existing) MedicationRequest instance, which you can create and assign as follows:
var mr = new MedicationRequest(); mr.Medication = new ResourceReference("http://example.org/fhir/MedicationRequest/123");
Vadim Peretokin (Jun 06 2019 at 12:35):
@Marco Rudolph
Where are these basics documented?
http://docs.simplifier.net/fhirnetapi/index.html :)
Brian Postlethwaite (Jun 06 2019 at 12:36):
Anyone think that code generating extension acessor methods for these properties as strongly typed would be useful?
E.g. GetMedicatiinReference() and GetMedicationCode()
Michel Rutten (Jun 06 2019 at 13:19):
I do notice repeated questions about assigning choice types. Providing additional explicit accessors would increase discoverability.
Brian Postlethwaite (Jun 07 2019 at 00:22):
Wasn't sure if generating them in the model or as extensions was better...
Marco Rudolph (Jun 07 2019 at 11:53):
ok thank you..
@Michel Rutten
Are you sure with "http://example.org/fhir/MedicationRequest/123" ?
"http://example.org/fhir/Medication/123" would make sense to me.
Marco Rudolph (Jun 07 2019 at 12:29):
..because i need
<medicationReference>
<reference value="/Medication/987654"/>
</medicationReference>
Yunwei Wang (Jun 10 2019 at 18:21):
Good catch
Last updated: Apr 12 2022 at 19:14 UTC