Creates a FHIR R4B ServiceRequest resource.
const url = 'http://api.probatix.localhost/fhir/r4b/service_requests?XDEBUG_SESSION=PHPSTORM';const options = { method: 'POST', headers: { 'accept-language': 'de', 'X-API-TOKEN': '<X-API-TOKEN>', 'Content-Type': 'application/json' }, body: '{"resourceType":"ServiceRequest","identifier":[{"use":"2986-8","codeableConcept":{"coding":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"text":"example"},"system":"http://loinc.org","value":"example","period":{"start":"2025-01-09T13:48:29+01:00","end":"2025-01-09T13:48:29+01:00"},"reference":{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]},"id":1,"extension":[{}]}],"instantiatesCanonical":["example"],"instantiatesUri":["example"],"basedOn":[{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]}],"replaces":[{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]}],"requisition":{"use":"2986-8","codeableConcept":{"coding":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"text":"example"},"system":"http://loinc.org","value":"example","period":{"start":"2025-01-09T13:48:29+01:00","end":"2025-01-09T13:48:29+01:00"},"reference":{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]},"id":1,"extension":[{}]},"status":"draft","intent":"proposal","category":[{"coding":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"text":"example"}],"priority":"asap","doNotPerform":false,"code":{"coding":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"text":"example"},"orderDetail":[{"coding":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"text":"example"}],"quantityQuantity":{"value":1,"comparator":"=","unit":"example","system":"http://loinc.org","code":"ABC","id":1,"extension":[{}]},"quantityRatio":{"numerator":{"value":1,"comparator":"=","unit":"example","system":"http://loinc.org","code":"ABC","id":1,"extension":[{}]},"denominator":{"value":1,"comparator":"=","unit":"example","system":"http://loinc.org","code":"ABC","id":1,"extension":[{}]},"id":1,"extension":[{}]},"quantityRange":{"low":{"value":1,"comparator":"=","unit":"example","system":"http://loinc.org","code":"ABC","id":1,"extension":[{}]},"high":{"value":1,"comparator":"=","unit":"example","system":"http://loinc.org","code":"ABC","id":1,"extension":[{}]},"id":1,"extension":[{}]},"subject":{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]},"encounter":{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]},"occurrenceDateTime":"2025-01-09T13:48:29+01:00","occurrencePeriod":{"start":"2025-01-09T13:48:29+01:00","end":"2025-01-09T13:48:29+01:00"},"occurrenceTiming":{"event":"2025-01-09T13:48:29+01:00","repeat":{"boundsDuration":{"value":1,"comparator":"=","unit":"example","system":"http://loinc.org","code":"ABC","id":1,"extension":[{}]},"boundsRange":{"low":{"value":1,"comparator":"=","unit":"example","system":"http://loinc.org","code":"ABC","id":1,"extension":[{}]},"high":{"value":1,"comparator":"=","unit":"example","system":"http://loinc.org","code":"ABC","id":1,"extension":[{}]},"id":1,"extension":[{}]},"boundsPeriod":{"start":"2025-01-09T13:48:29+01:00","end":"2025-01-09T13:48:29+01:00"},"count":1,"countMax":1,"duration":1,"durationMax":1,"durationUnit":"min","frequency":1,"frequencyMax":1,"period":1,"periodMax":1,"periodUnit":"min","dayOfWeek":"mon","timeOfDay":"12:00:00","when":"HS","offset":1},"code":{"coding":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"text":"example"},"id":1,"extension":[{}]},"asNeededBoolean":true,"asNeededCodeableConcept":{"coding":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"text":"example"},"authoredOn":"2025-01-09T13:48:29+01:00","requester":{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]},"performerType":{"coding":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"text":"example"},"performer":[{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]}],"locationCode":[{"coding":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"text":"example"}],"locationReference":[{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]}],"reasonCode":[{"coding":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"text":"example"}],"reasonReference":[{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]}],"insurance":[{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]}],"supportingInfo":[{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]}],"specimen":[{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]}],"bodySite":[{"coding":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"text":"example"}],"note":[{"authorReference":{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]},"authorString":"example","time":"2025-01-09T13:48:29+01:00","text":"# README","id":1,"extension":[{}]}],"patientInstruction":"Text","relevantHistory":[{"reference":"example","type":"observations/1","identifier":{},"display":"example","id":1,"extension":[{}]}],"text":{},"contained":[{}],"extension":[{}],"modifierExtension":[{}],"id":1,"meta":[{"versionId":1,"lastUpdated":"2026-04-15T12:00:00Z","source":"http://loinc.org","profile":["example"],"security":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"tag":[{"system":"http://loinc.org","version":"example","code":"2986-8","display":"example","userSelected":true}],"id":1,"extension":[{}]}],"implicitRules":"example","language":"de"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'http://api.probatix.localhost/fhir/r4b/service_requests?XDEBUG_SESSION=PHPSTORM' \ --header 'Content-Type: application/json' \ --header 'X-API-TOKEN: <X-API-TOKEN>' \ --header 'accept-language: de' \ --data '{ "resourceType": "ServiceRequest", "identifier": [ { "use": "2986-8", "codeableConcept": { "coding": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "text": "example" }, "system": "http://loinc.org", "value": "example", "period": { "start": "2025-01-09T13:48:29+01:00", "end": "2025-01-09T13:48:29+01:00" }, "reference": { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] }, "id": 1, "extension": [ {} ] } ], "instantiatesCanonical": [ "example" ], "instantiatesUri": [ "example" ], "basedOn": [ { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] } ], "replaces": [ { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] } ], "requisition": { "use": "2986-8", "codeableConcept": { "coding": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "text": "example" }, "system": "http://loinc.org", "value": "example", "period": { "start": "2025-01-09T13:48:29+01:00", "end": "2025-01-09T13:48:29+01:00" }, "reference": { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] }, "id": 1, "extension": [ {} ] }, "status": "draft", "intent": "proposal", "category": [ { "coding": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "text": "example" } ], "priority": "asap", "doNotPerform": false, "code": { "coding": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "text": "example" }, "orderDetail": [ { "coding": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "text": "example" } ], "quantityQuantity": { "value": 1, "comparator": "=", "unit": "example", "system": "http://loinc.org", "code": "ABC", "id": 1, "extension": [ {} ] }, "quantityRatio": { "numerator": { "value": 1, "comparator": "=", "unit": "example", "system": "http://loinc.org", "code": "ABC", "id": 1, "extension": [ {} ] }, "denominator": { "value": 1, "comparator": "=", "unit": "example", "system": "http://loinc.org", "code": "ABC", "id": 1, "extension": [ {} ] }, "id": 1, "extension": [ {} ] }, "quantityRange": { "low": { "value": 1, "comparator": "=", "unit": "example", "system": "http://loinc.org", "code": "ABC", "id": 1, "extension": [ {} ] }, "high": { "value": 1, "comparator": "=", "unit": "example", "system": "http://loinc.org", "code": "ABC", "id": 1, "extension": [ {} ] }, "id": 1, "extension": [ {} ] }, "subject": { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] }, "encounter": { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] }, "occurrenceDateTime": "2025-01-09T13:48:29+01:00", "occurrencePeriod": { "start": "2025-01-09T13:48:29+01:00", "end": "2025-01-09T13:48:29+01:00" }, "occurrenceTiming": { "event": "2025-01-09T13:48:29+01:00", "repeat": { "boundsDuration": { "value": 1, "comparator": "=", "unit": "example", "system": "http://loinc.org", "code": "ABC", "id": 1, "extension": [ {} ] }, "boundsRange": { "low": { "value": 1, "comparator": "=", "unit": "example", "system": "http://loinc.org", "code": "ABC", "id": 1, "extension": [ {} ] }, "high": { "value": 1, "comparator": "=", "unit": "example", "system": "http://loinc.org", "code": "ABC", "id": 1, "extension": [ {} ] }, "id": 1, "extension": [ {} ] }, "boundsPeriod": { "start": "2025-01-09T13:48:29+01:00", "end": "2025-01-09T13:48:29+01:00" }, "count": 1, "countMax": 1, "duration": 1, "durationMax": 1, "durationUnit": "min", "frequency": 1, "frequencyMax": 1, "period": 1, "periodMax": 1, "periodUnit": "min", "dayOfWeek": "mon", "timeOfDay": "12:00:00", "when": "HS", "offset": 1 }, "code": { "coding": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "text": "example" }, "id": 1, "extension": [ {} ] }, "asNeededBoolean": true, "asNeededCodeableConcept": { "coding": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "text": "example" }, "authoredOn": "2025-01-09T13:48:29+01:00", "requester": { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] }, "performerType": { "coding": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "text": "example" }, "performer": [ { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] } ], "locationCode": [ { "coding": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "text": "example" } ], "locationReference": [ { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] } ], "reasonCode": [ { "coding": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "text": "example" } ], "reasonReference": [ { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] } ], "insurance": [ { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] } ], "supportingInfo": [ { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] } ], "specimen": [ { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] } ], "bodySite": [ { "coding": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "text": "example" } ], "note": [ { "authorReference": { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] }, "authorString": "example", "time": "2025-01-09T13:48:29+01:00", "text": "# README", "id": 1, "extension": [ {} ] } ], "patientInstruction": "Text", "relevantHistory": [ { "reference": "example", "type": "observations/1", "identifier": {}, "display": "example", "id": 1, "extension": [ {} ] } ], "text": {}, "contained": [ {} ], "extension": [ {} ], "modifierExtension": [ {} ], "id": 1, "meta": [ { "versionId": 1, "lastUpdated": "2026-04-15T12:00:00Z", "source": "http://loinc.org", "profile": [ "example" ], "security": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "tag": [ { "system": "http://loinc.org", "version": "example", "code": "2986-8", "display": "example", "userSelected": true } ], "id": 1, "extension": [ {} ] } ], "implicitRules": "example", "language": "de" }'Creates a FHIR R4B ServiceRequest resource.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Language for Errors and Translatable properties
Example
deQuery Parameters
Section titled “Query Parameters”Xdebug session for debugging
Example
?XDEBUG_SESSION=PHPSTORMRequest Bodyrequired
Section titled “Request Bodyrequired”The new FHIR R4B ServiceRequest resource
object
object
Example
2986-8Example
http://loinc.orgobject
object
Example
2986-8Example
http://loinc.orgobject
object
object
Example
http://loinc.orgExample
2986-8Example
asapobject
object
Example
http://loinc.orgExample
2986-8object
object
object
object
Example
2025-01-09T13:48:29+01:00object
Example
2025-01-09T13:48:29+01:00object
object
object
Example
minExample
minExample
monExample
12:00:00Example
HSobject
Example
2025-01-09T13:48:29+01:00object
object
Example
http://loinc.orgExample
2986-8object
object
Example
http://loinc.orgExample
2986-8object
object
Example
http://loinc.orgExample
2986-8object
Example
2025-01-09T13:48:29+01:00Example
# READMEobject
Example
Textobject
object
object
object
object
Example
http://loinc.orgobject
Example
http://loinc.orgExample
2986-8object
Example
http://loinc.orgExample
2986-8object
Example
deResponses
Section titled “Responses”FHIR R4B ServiceRequest resource created
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Example
{ "resourceType": "ServiceRequest", "identifier": [ { "use": "2986-8", "codeableConcept": { "coding": [ { "system": "http://loinc.org", "code": "2986-8" } ] }, "system": "http://loinc.org", "period": { "start": "2025-01-09T13:48:29+01:00", "end": "2025-01-09T13:48:29+01:00" }, "reference": { "type": "observations/1" } } ], "basedOn": [ { "type": "observations/1" } ], "replaces": [ { "type": "observations/1" } ], "requisition": { "use": "2986-8", "codeableConcept": { "coding": [ { "system": "http://loinc.org", "code": "2986-8" } ] }, "system": "http://loinc.org", "period": { "start": "2025-01-09T13:48:29+01:00", "end": "2025-01-09T13:48:29+01:00" }, "reference": { "type": "observations/1" } }, "status": "draft", "intent": "proposal", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "2986-8" } ] } ], "priority": "asap", "doNotPerform": false, "code": { "coding": [ { "system": "http://loinc.org", "code": "2986-8" } ] }, "orderDetail": [ { "coding": [ { "system": "http://loinc.org", "code": "2986-8" } ] } ], "quantityQuantity": { "comparator": "=", "system": "http://loinc.org", "code": "ABC" }, "quantityRatio": { "numerator": { "comparator": "=", "system": "http://loinc.org", "code": "ABC" }, "denominator": { "comparator": "=", "system": "http://loinc.org", "code": "ABC" } }, "quantityRange": { "low": { "comparator": "=", "system": "http://loinc.org", "code": "ABC" }, "high": { "comparator": "=", "system": "http://loinc.org", "code": "ABC" } }, "subject": { "type": "observations/1" }, "encounter": { "type": "observations/1" }, "occurrenceDateTime": "2025-01-09T13:48:29+01:00", "occurrencePeriod": { "start": "2025-01-09T13:48:29+01:00", "end": "2025-01-09T13:48:29+01:00" }, "occurrenceTiming": { "event": "2025-01-09T13:48:29+01:00", "repeat": { "boundsDuration": { "comparator": "=", "system": "http://loinc.org", "code": "ABC" }, "boundsRange": { "low": { "comparator": "=", "system": "http://loinc.org", "code": "ABC" }, "high": { "comparator": "=", "system": "http://loinc.org", "code": "ABC" } }, "boundsPeriod": { "start": "2025-01-09T13:48:29+01:00", "end": "2025-01-09T13:48:29+01:00" }, "durationUnit": "min", "periodUnit": "min", "dayOfWeek": "mon", "timeOfDay": "12:00:00", "when": "HS" }, "code": { "coding": [ { "system": "http://loinc.org", "code": "2986-8" } ] } }, "asNeededCodeableConcept": { "coding": [ { "system": "http://loinc.org", "code": "2986-8" } ] }, "authoredOn": "2025-01-09T13:48:29+01:00", "requester": { "type": "observations/1" }, "performerType": { "coding": [ { "system": "http://loinc.org", "code": "2986-8" } ] }, "performer": [ { "type": "observations/1" } ], "locationCode": [ { "coding": [ { "system": "http://loinc.org", "code": "2986-8" } ] } ], "locationReference": [ { "type": "observations/1" } ], "reasonCode": [ { "coding": [ { "system": "http://loinc.org", "code": "2986-8" } ] } ], "reasonReference": [ { "type": "observations/1" } ], "insurance": [ { "type": "observations/1" } ], "supportingInfo": [ { "type": "observations/1" } ], "specimen": [ { "type": "observations/1" } ], "bodySite": [ { "coding": [ { "system": "http://loinc.org", "code": "2986-8" } ] } ], "note": [ { "authorReference": { "type": "observations/1" }, "time": "2025-01-09T13:48:29+01:00", "text": "# README" } ], "patientInstruction": "Text", "relevantHistory": [ { "type": "observations/1" } ], "meta": [ { "source": "http://loinc.org", "security": [ { "system": "http://loinc.org", "code": "2986-8" } ], "tag": [ { "system": "http://loinc.org", "code": "2986-8" } ] } ], "language": "de"}Invalid input
A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "@context": { "hydra": "http://www.w3.org/ns/hydra/core#" }, "status": 400}A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}Unauthorized
A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "@context": { "hydra": "http://www.w3.org/ns/hydra/core#" }, "status": 400}A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}Forbidden
A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "@context": { "hydra": "http://www.w3.org/ns/hydra/core#" }, "status": 400}A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}An error occurred
Unprocessable entity
object
object
The property path of the violation
The message associated with the violation
The code of the violation
An extra hint to understand the violation
The serialized payload of the violation
object
Example
{ "@context": { "hydra": "http://www.w3.org/ns/hydra/core#" }, "status": 422}Unprocessable entity
object
object
The property path of the violation
The message associated with the violation
The code of the violation
An extra hint to understand the violation
The serialized payload of the violation
object
Example
{ "status": 422}Unprocessable entity
object
object
The property path of the violation
The message associated with the violation
The code of the violation
An extra hint to understand the violation
The serialized payload of the violation
object
Example
{ "status": 422}