fhir-ndr-et@0.2.3
This adaptor exports the following namespaced functions:
- utils.addExtension(resource, url, value)
- utils.cc()
- utils.coding(code, system)
- utils.composite(object, key, value)
- utils.concept()
- utils.findExtension(obj, targetUrl, [path])
- utils.id()
- utils.identifier(input, [system])
- utils.ref()
- utils.reference(ref)
- utils.setSystemMap()
- builders.carePlan(type, props)
- builders.encounter(type, props)
- builders.medication(type, props)
- builders.medicationAdministration(type, props)
- builders.medicationDispense(type, props)
- builders.medicationRequest(type, props)
- builders.observation(type, props)
- builders.patient(type, props)
- builders.relatedPerson(type, props)
This adaptor exports the following from common:
- combine()
- cursor()
- dataPath()
- dataValue()
- each()
- field()
- fields()
- fn()
- lastReferenceValue()
- log()
- merge()
- sourceValue()
Functions
create
create(resourceType, resource, params, callback) ⇒ Operation
Creates a new resource with a server assigned resourceType. The resource object doesn't need resourceType or id
| Param | Type | Description |
|---|---|---|
| resourceType | FhirResourceTypes | The resource type to create |
| resource | FhirResource | The resource to create |
| params | object | (Optional) FHIR parameters to control and configure resource creation. You can specify a version ie r4 here. |
| callback | function | (Optional) callback function |
This operation writes the following keys to state:
| State Key | Description |
|---|
Example: Create a new patient
create('Patient', {
name: [
{
use: 'official',
family: 'La Paradisio',
given: ['Josephine', 'Nessa'],
},
],
});
utils
These functions belong to the utils namespace.
utils.addExtension
addExtension(resource, url, value)
Add an extension to a resource (or object).
An object will be created and added to an extension array on the provided resource.
The extension array will be set if it does not exist on the resource.
The value will be smartly written to the object, ie, valueDateTime or valueReference or valueString
| Param | Type | Description |
|---|---|---|
| resource | a FHIR resource object to add an extension too | |
| url | string | the URL to set for the extension |
| value | the value that the extension should contain |
utils.cc
cc()
Alias for util.concept()
utils.coding
coding(code, system)
Create a coding object { code, system }. Systems will be mapped using the system map.
| Param | Type | Description |
|---|---|---|
| code | string | the code value |
| system | string | URL to the system. Well be mapped using the system map. |
utils.composite
composite(object, key, value)
Write a value to the target object using a typed key
Ie, if key is value and the value is a date time string,
this function will write valueDateTime to the object.
This function is poorly named.
| Param | Type | Description |
|---|---|---|
| object | the object to write the composite key to | |
| key | string | the base key to use to write the value |
| value | some value to write to the object |