InstanceOperation with FhirString parameter #1769
-
|
I trying to send along a In FhirClientTests:759 there is a similar example to mine but the FhirString parameter is commented out: Isn't it supported? What is the correct way to do this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Hi @elvetian, Indeed, this is the way to do it. In the Parameters p = new Parameters();
p.Add("mode", new Code("create"));
p.Add("resource", pat);
OperationOutcome ooI = (OperationOutcome)client.InstanceOperation(ri.WithoutVersion(), "validate", p);But, when an operation demands a parameter of type string, then you use the Parameters p = new Parameters();
p.Add("query", new FhirString("{name{text,given,family}}"));
OperationOutcome ooI = (OperationOutcome)client.InstanceOperation(ri.WithoutVersion(), "graphql", p);It can be that the FHIR server does not accept this operation. Check the OperationOutcome for more details. And try also the same request in Postman for example. It should give you back the same result. |
Beta Was this translation helpful? Give feedback.
Hi @elvetian,
Indeed, this is the way to do it. In the
FhirClientTestwe are executing avalidateoperation. That operation demands a code as parameter (see also the definition here). So actually theFhirClientrequest should be like this:But, when an operation demands a parameter of type string, then you use the
FhirStringclass. See here an example of the operation$graphql, (definition):