-
Notifications
You must be signed in to change notification settings - Fork 13
Javascript API for Rules and Transformations (1.0)
Rules and transformations may use Javascript API. The following Javascript contains the objects that are provided by the adapter itself (at the moment just objects that are required for the transformation to a tracked entity instance are listed, even if more is supported by the adapter currently). The FHIR resources are exposed to Javascript by HAPI FHIR 3.6.0 objects.
The following script is used as default transformation script from FHIR Patient to DHIS 2 Tracked Entity Instance. The variable output
has type TrackedEntityInstance
(defined below). The variable args
contain mandatory and optional arguments that are passed to the script. These can be defined by a script with default values and can be overridden for a specific use case (in this case for an executable script).
output.setOptionalValue(args['uniqueIdAttribute'], output.getIdentifier());
output.setValue(args['lastNameAttribute'], humanNameUtils.getPrimaryName(input.name).family, context.getFhirRequest().getLastUpdated());
output.setValue(args['firstNameAttribute'], humanNameUtils.getSingleGiven(humanNameUtils.getPrimaryName(input.name)), context.getFhirRequest().getLastUpdated());
var birthDate = dateTimeUtils.getPreciseDate(input.birthDateElement);
if ((birthDate != null) || args['resetDhisValue'])
{
output.setOptionalValue(args['birthDateAttribute'], birthDate, context.getFhirRequest().getLastUpdated());
}
if ((input.gender != null) || args['resetDhisValue'])
{
output.setOptionalValue(args['genderAttribute'], input.gender, context.getFhirRequest().getLastUpdated());
}
var addressText = addressUtils.getConstructedText(addressUtils.getPrimaryAddress(input.address));
if ((addressText != null) || args['resetDhisValue'])
{
output.setOptionalValue(args['addressTextAttribute'], addressText, context.getFhirRequest().getLastUpdated());
}
true
The content of this page has been generated automatically. The original version of this page can be accessed on a running adapter with the following URL http://localhost:8081/scripts/to-dhis2-all-mapping.js
(assuming that the adapter has been installed in the root context of the web application container and the container accepts connections on port 8081 on localhost).
/*
* Copyright (c) 2004-2018, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the HISP project nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Reference to an entry that is stored on DHIS2 (by ID, unique name or unique
* code).
*/
var Reference = (function ()
{
function Reference()
{
/**
* Returns the type of the reference (the ID, unique code or unique name).
*/
this.type = null;
/**
* Returns the value of the reference (ID, unique code or unique name).
*/
this.value = null;
}
/**
* @param o
* @return
*/
Reference.prototype.equals = function (o) {};
/**
* Returns the type of the reference (the ID, unique code or unique name).
*
* @return Returns the type of the reference (the ID, unique code or unique name).
*/
Reference.prototype.getType = function () {};
/**
* Returns the value of the reference (ID, unique code or unique name).
*
* @return Returns the value of the reference (ID, unique code or unique name).
*/
Reference.prototype.getValue = function () {};
/**
* Returns the string representation of the reference (type and value separated by
* colon character).
*
* @return
*/
Reference.prototype.toString = function () {};
return Reference;
}());
/**
* Utilities to handle FHIR to DHIS2 transformations of human names.
*/
var HumanNameUtils = (function ()
{
function HumanNameUtils()
{
}
/**
* Extracts the name of the list of names that seems to be the most appropriate
* name.
*
* @param names The list of names from which one name should be extracted.
* @return The extracted primary name.
*/
HumanNameUtils.prototype.getPrimaryName = function (names) {};
/**
* Return a single given name from the specified FHIR human name. If the human name
* contains multiple given names these are separated by space characters.
*
* @param humanName The human name from which the single given name should be
* extracted.
* @return The extracted single given name.
*/
HumanNameUtils.prototype.getSingleGiven = function (humanName) {};
return HumanNameUtils;
}());
var humanNameUtils = new HumanNameUtils();
/**
* Utilities to handle FHIR to DHIS2 transformations of FHIR patients.
*/
var PatientUtils = (function ()
{
function PatientUtils()
{
}
/**
* Returns the FHIR address that contains the birth place. The FHIR extension
* http://hl7.org/fhir/StructureDefinition/birthPlace is used to extract the
* address.
*
* @param patient The patient resource from which the birth place address should be
* extracted.
* @return The extracted birth place address.
*/
PatientUtils.prototype.getBirthPlaceAddress = function (patient) {};
return PatientUtils;
}());
var patientUtils = new PatientUtils();
/**
* Point geometry with a longitude and latitude.
*/
var Location = (function ()
{
function Location()
{
/**
* Returns the latitude of the point geometry.
*/
this.latitude = null;
/**
* Returns the longitude of the point geometry.
*/
this.longitude = null;
}
/**
* @param o
* @return
*/
Location.prototype.equals = function (o) {};
/**
* Returns the latitude of the point geometry.
*
* @return Returns the latitude of the point geometry.
*/
Location.prototype.getLatitude = function () {};
/**
* Returns the longitude of the point geometry.
*
* @return Returns the longitude of the point geometry.
*/
Location.prototype.getLongitude = function () {};
return Location;
}());
/**
* The current FHIR request that caused the execution of the transformation.
*/
var FhirRequest = (function ()
{
function FhirRequest()
{
/**
* Returns the timestamp when the processed FHIR resource has been updated the last
* time.
*/
this.lastUpdated = null;
/**
* Returns the code of the remote subscription that caused the execution of the
* current transformation.
*/
this.remoteSubscriptionCode = null;
/**
* Returns the processed FHIR resource type as Java enumeration (e.g.
* RELATED_PERSON as enum constant).
*/
this.resourceType = null;
/**
* Returns the FHIR version of the processed FHIR resource as Java enumeration
* (e.g. DSTU3 as enum constant).
*/
this.version = null;
}
/**
* Returns the timestamp when the processed FHIR resource has been updated the last
* time.
*
* @return Returns the timestamp when the processed FHIR resource has been updated
* the last time.
*/
FhirRequest.prototype.getLastUpdated = function () {};
/**
* Returns the code of the remote subscription that caused the execution of the
* current transformation.
*
* @return Returns the code of the remote subscription that caused the execution of
* the current transformation.
*/
FhirRequest.prototype.getRemoteSubscriptionCode = function () {};
/**
* Returns the processed FHIR resource type as Java enumeration (e.g.
* RELATED_PERSON as enum constant).
*
* @return Returns the processed FHIR resource type as Java enumeration (e.g.
* RELATED_PERSON as enum constant).
*/
FhirRequest.prototype.getResourceType = function () {};
/**
* Returns the FHIR version of the processed FHIR resource as Java enumeration
* (e.g. DSTU3 as enum constant).
*
* @return Returns the FHIR version of the processed FHIR resource as Java
* enumeration (e.g. DSTU3 as enum constant).
*/
FhirRequest.prototype.getVersion = function () {};
return FhirRequest;
}());
/**
* Utilities to handle FHIR to DHIS2 transformations of FHIR identifiers.
*/
var IdentifierUtils = (function ()
{
function IdentifierUtils()
{
}
/**
* Returns the business identifier from the specified referenced FHIR resource with
* the specified FHIR resource type. If the resource type does not match null is
* returned. The system URI of the corresponding remote subscription system of the
* current transformation context is used (e.g. the system URI of a Patient of the
* remote subscription from which the resource has been retrieved).
*
* @param reference The FHIR reference of a domain resource from which the
* identifier should be extracted.
* @param fhirResourceType The FHIR resource type (upper case with underscores, e.g.
* RELATED_PERSON) of the specified domain resource.
* @return The corresponding business identifier.
*/
IdentifierUtils.prototype.getReferenceIdentifier = function (reference, fhirResourceType) {};
/**
* Returns the business identifier with the specified system URI from the specified
* domain resource with the specified FHIR resource type. If the resource type does
* not match null is returned.
*
* @param resource The FHIR domain resource from which the identifier should be
* extracted.
* @param fhirResourceType The FHIR resource type (upper case with underscores, e.g.
* RELATED_PERSON) of the specified domain resource.
* @param system The system URI for which the identifier is returned.
* @return The corresponding business identifier.
*/
IdentifierUtils.prototype.getResourceIdentifier = function (resource, fhirResourceType, system) {};
return IdentifierUtils;
}());
var identifierUtils = new IdentifierUtils();
/**
* Utilities for retrieving data from a remote FHIR service.
*/
var FhirClientUtils = (function ()
{
function FhirClientUtils()
{
}
return FhirClientUtils;
}());
var fhirClientUtils = new FhirClientUtils();
/**
* Tracked entity instance. If tracked entity instance is not new and will be
* modified, it will be persisted.
*/
var TrackedEntityInstance = (function ()
{
function TrackedEntityInstance()
{
/**
* Returns the coordinates (normally longitude and latitude) of the tracked entity
* instance.
*/
this.coordinates = null;
/**
* Returns the ID of the tracked entity instance on DHIS2. Return null if the
* instance is new.
*/
this.id = null;
/**
* Returns the national identifier of the tracked entity instance.
*/
this.identifier = null;
/**
* Returns if the tracked entity instance is new ans has not yet been saved on
* DHIS2.
*/
this.newResource = null;
/**
* Returns the organization unit ID of the organization unit to which this tracked
* entity instance belongs to on DHIS2.
*/
this.organizationUnitId = null;
/**
* Returns the ID of the tracked entity type to which this tracked entity instance
* belongs to on DHIS2.
*/
this.typeId = null;
}
/**
* Returns the coordinates (normally longitude and latitude) of the tracked entity
* instance.
*
* @return Returns the coordinates (normally longitude and latitude) of the tracked
* entity instance.
*/
TrackedEntityInstance.prototype.getCoordinates = function () {};
/**
* Returns the ID of the tracked entity instance on DHIS2. Return null if the
* instance is new.
*
* @return Returns the ID of the tracked entity instance on DHIS2. Return null if
* the instance is new.
*/
TrackedEntityInstance.prototype.getId = function () {};
/**
* Returns the national identifier of the tracked entity instance.
*
* @return Returns the national identifier of the tracked entity instance.
*/
TrackedEntityInstance.prototype.getIdentifier = function () {};
/**
* Returns the organization unit ID of the organization unit to which this tracked
* entity instance belongs to on DHIS2.
*
* @return Returns the organization unit ID of the organization unit to which this
* tracked entity instance belongs to on DHIS2.
*/
TrackedEntityInstance.prototype.getOrganizationUnitId = function () {};
/**
* Returns the ID of the tracked entity type to which this tracked entity instance
* belongs to on DHIS2.
*
* @return Returns the ID of the tracked entity type to which this tracked entity
* instance belongs to on DHIS2.
*/
TrackedEntityInstance.prototype.getTypeId = function () {};
/**
* Returns the value of a tracked entity instance attribute.
*
* @param attributeReference The reference object to the tracked entity attribute.
* @return
*/
TrackedEntityInstance.prototype.getValue = function (attributeReference) {};
/**
* Returns if the tracked entity instance is new ans has not yet been saved on
* DHIS2.
*
* @return Returns if the tracked entity instance is new ans has not yet been saved
* on DHIS2.
*/
TrackedEntityInstance.prototype.isNewResource = function () {};
/**
* Sets the coordinates of the tracked entity instance. This might be a string
* representation of the coordinates or a location object.
*
* @param coordinates The coordinates as string representation, location object or
* null.
* @return Returns true each time (at end of script return of true can be avoided).
*/
TrackedEntityInstance.prototype.setCoordinates = function (coordinates) {};
/**
* Sets the value of a tracked entity attribute. If the specified attribute
* reference is null, nothing will be done. This will be skipped when the specified
* last updated date is before the current last updated data and the user which has
* last modified the tracked entity was not the adapter itself.
*
* @param attributeReference The reference object to the tracked entity attribute (can
* be null).
* @param value The value that should be set. The value will be converted
* to the required type automatically (if possible).
* @param lastUpdated The last updated timestamp of the data that should be
* assigned to the tracked entity. This value can be null if
* check should not be made.
* @return Returns only true if updating the value has not been skipped since the
* specified last updated date is before the current last updated date.
*/
TrackedEntityInstance.prototype.setOptionalValue = function (attributeReference, value, lastUpdated) {};
/**
* Sets the organization unit ID of the organization unit to which this tracked
* entity instance belongs to on DHIS2 (must not be null).
*
* @param id Sets the organization unit ID of the organization unit to which this
* tracked entity instance belongs to on DHIS2 (must not be null).
* @return Sets the organization unit ID of the organization unit to which this
* tracked entity instance belongs to on DHIS2 (must not be null).
*/
TrackedEntityInstance.prototype.setOrganizationUnitId = function (id) {};
/**
* Sets the value of a tracked entity attribute. This will be skipped when the
* specified last updated date is before the current last updated data and the user
* which has last modified the tracked entity was not the adapter itself.
*
* @param attributeReference The reference object to the tracked entity attribute.
* @param value The value that should be set. The value will be converted
* to the required type automatically (if possible).
* @param lastUpdated The last updated timestamp of the data that should be
* assigned to the tracked entity. This value can be null if
* check should not be made.
* @return Returns only true if updating the value has not been skipped since the
* specified last updated date is before the current last updated date.
*/
TrackedEntityInstance.prototype.setValue = function (attributeReference, value, lastUpdated) {};
/**
* Validates the content of the tracked entity instance and throws an exception if
* the content is invalid.
*/
TrackedEntityInstance.prototype.validate = function () {};
return TrackedEntityInstance;
}());
var trackedEntityInstance = new TrackedEntityInstance();
/**
* Utilities to resolve FHIR Reference to FHIR Resources when handling FHIR to
* DHIS2 transformations.
*/
var ReferenceUtils = (function ()
{
function ReferenceUtils()
{
}
/**
* Returns the FHIR resource with the specified resource type for the specified
* FHIR reference.
*
* @param reference The FHIR reference for which the resource should be returned.
* @param resourceType The FHIR resource type of the resource (upper case with under
* scores, e.g. RELATED_PERSON). If this is not specified the
* resource type must be included in the reference. If this is
* specified and the resource type is also included in the
* reference, then both must match.
* @param refreshed Specifies if the latest version of the resource should be
* returned. If this is set to false, a cached version may be
* returned.
* @return The FHIR resource for the specified reference.
*/
ReferenceUtils.prototype.getResource = function (reference, resourceType, refreshed) {};
return ReferenceUtils;
}());
var referenceUtils = new ReferenceUtils();
/**
* Utilities for GEO information handling.
*/
var GeoUtils = (function ()
{
function GeoUtils()
{
}
/**
* Creates a location object (type Location) from the specified longitude and
* latitude.
*
* @param longitude The longitude of the GEO point.
* @param latitude The latitude of the GEO point.
* @return The created location object.
*/
GeoUtils.prototype.create = function (longitude, latitude) {};
/**
* Returns the location from the FHIR element address (FHIR extension
* http://hl7.org/fhir/StructureDefinition/geolocation).
*
* @param element The FHIR element address from which the location should be returned.
* @return The location (type Location) that is included in the specified element
* or null if no location is included.
*/
GeoUtils.prototype.getLocation = function (element) {};
/**
* Returns if the specified string representation of coordinates is a location.
*
* @param coordinates The coordinate string representation that should be checked.
* @return If the specified coordinates represent the string representation of a
* location.
*/
GeoUtils.prototype.isLocation = function (coordinates) {};
return GeoUtils;
}());
var geoUtils = new GeoUtils();
/**
* Utilities to handle FHIR to DHIS2 transformations of addresses.
*/
var AddressUtils = (function ()
{
function AddressUtils()
{
}
/**
* Returns a constructed text of the address that contains the address lines, the
* postal code, the city and the state (if available).
*
* @param address The FHIR address from which the address components should be used.
* @param delimiter The delimiter that should be used to separated the lines (e.g.
* space character).
* @return The constructed address text.
*/
AddressUtils.prototype.getConstructedText = function (address, delimiter) {};
/**
* Returns a single address line for the adress lines includes in the specified
* FHIR address. A space is used to separate the lines.
*
* @param address The FHIR address from which the address lines should be used.
* @return A single line for the included address lines.
*/
AddressUtils.prototype.getSingleLine = function (address) {};
/**
* Returns the text representation (if included) of the address.
*
* @param address The FHIR address from which the text should be returned.
* @return
*/
AddressUtils.prototype.getText = function (address) {};
return AddressUtils;
}());
var addressUtils = new AddressUtils();
/**
* Utilities for date and time handling.
*/
var DateTimeUtils = (function ()
{
function DateTimeUtils()
{
}
/**
* Returns the age relative to the current date/time in the specified unit.
*
* @param dateTime The date/time value for which the age should be calculated.
* @param dateUnit The unit of the returned age (YEARS, MONTHS, DAYS).
* @return The age in the specified unit.
*/
DateTimeUtils.prototype.getAge = function (dateTime, dateUnit) {};
/**
* Returns a date/time value for the specified date/time element value when it has
* at least day precision. A date/time element value may have only year or month
* precision.
*
* @param dateTime The date/time element value for which the evaluation should be
* performed.
* @return Returns if the specified date/time element as date/time value or null
* when it has not at least day precision.
*/
DateTimeUtils.prototype.getPreciseDate = function (dateTime) {};
/**
* Returns a date/time value for the specified date/time element value when it has
* at least day precision and is in the past. A date/time element value may have
* only year or month precision.
*
* @param dateTime The date/time element value for which the evaluation should be
* performed.
* @return Returns if the specified date/time element as date/time value or null
* when it has not at least day precision or is in the future.
*/
DateTimeUtils.prototype.getPrecisePastDate = function (dateTime) {};
/**
* Returns if the specified date/time element value has at least day precision. A
* date/time element value may have only year or month precision.
*
* @param dateTime The date/time element value for which the evaluation should be
* performed.
* @return Returns if the specified date/time element has at least day precision.
*/
DateTimeUtils.prototype.hasDayPrecision = function (dateTime) {};
/**
* Returns if the age relative to the current date/time in the specified unit is
* older than the specified amount.
*
* @param dateTime The date/time value for which the age up to the current date/time
* value should be calculated.
* @param amount The minimum age (exclusive).
* @param dateUnit The unit of the returned age (YEARS, MONTHS, DAYS).
* @return If the age is greater than the specified amount.
*/
DateTimeUtils.prototype.isOlderThan = function (dateTime, amount, dateUnit) {};
/**
* Returns if the specified FHIR period is valid now. It is regarded as being
* valid, if the end has not yet been reached. The begin date/time will not be
* checked.
*
* @param period The FHIR period for which it should be checked if the current
* date/time is included.
* @return Returns if the current date/time is included in the specified period.
* Returns true if the specified period is null.
*/
DateTimeUtils.prototype.isValidNow = function (period) {};
/**
* Returns if the age relative to the current date/time in the specified unit is
* younger than the specified amount.
*
* @param dateTime The date/time value for which the age up to the current date/time
* value should be calculated.
* @param amount The maximum age (exclusive).
* @param dateUnit The unit of the returned age (YEARS, MONTHS, DAYS).
* @return If the age is less than the specified amount.
*/
DateTimeUtils.prototype.isYoungerThan = function (dateTime, amount, dateUnit) {};
return DateTimeUtils;
}());
var dateTimeUtils = new DateTimeUtils();
/**
* The context of the current transformation.
*/
var Context = (function ()
{
function Context()
{
/**
* Returns the FHIR request (type FhirRequest) that causes the current
* transformation execution.
*/
this.fhirRequest = null;
}
/**
* Returns a reference to a DHIS2 entry (type Reference).
*
* @param value The value of the reference (the ID, unique code or unique name
* of the DHIS2 entry).
* @param referenceType The reference type (ID, CODE, NAME).
* @return The created reference.
*/
Context.prototype.createReference = function (value, referenceType) {};
/**
* Causes that the current transformation will fail with the specified message due
* to invalid data.
*
* @param message The reason that specifies why the transformation data is invalid.
*/
Context.prototype.fail = function (message) {};
/**
* Returns the FHIR request (type FhirRequest) that causes the current
* transformation execution.
*
* @return Returns the FHIR request (type FhirRequest) that causes the current
* transformation execution.
*/
Context.prototype.getFhirRequest = function () {};
/**
* Returns the current timestamp as date/time.
*
* @return The current timestamp as date/time.
*/
Context.prototype.now = function () {};
return Context;
}());
var context = new Context();
/**
* Utilities to handle FHIR to DHIS2 transformations for codes (either code
* mappings or extracting of codes from FHIR codeable concepts).
*/
var CodeUtils = (function ()
{
function CodeUtils()
{
}
/**
* Returns if the specified codeable concept contains any combination of the
* specified list of system code values (type SystemCodeValue).
*
* @param codeableConcept The codeable concept that should be checked.
* @param systemCodeValues List of system code values that should be used for the check
* (type SystemCodeValue).
* @return Returns if any system code value is included.
*/
CodeUtils.prototype.containsAnyCode = function (codeableConcept, systemCodeValues) {};
/**
* Returns if the specified codeable concept contains any combination of the
* specified system URI and the specified code.
*
* @param codeableConcept The codeable concept that should be checked.
* @param system The system URI that must be included in combination with the
* specified code.
* @param code The code that must be included in combination with the
* specified system URI.
* @return Returns if the code is included.
*/
CodeUtils.prototype.containsCode = function (codeableConcept, system, code) {};
/**
* Returns if the specified FHIR codeable concept contains any enabled mapping for
* the specified mapping codes defined for the adapter.
*
* @param codeableConcept The codeable concept that should be checked.
* @param mappingCodes Array of mapping codes that have been defined for the adapter
* (field code of adapter resource codes).
* @return Returns if the mapping code is included.
*/
CodeUtils.prototype.containsMappingCode = function (codeableConcept, mappingCodes) {};
/**
* Returns the code that is included in the specified codeable concept for the
* specified system URI.
*
* @param codeableConcept The codeable concept from which the code should be extracted.
* @param system The system URI to which the returned code must be assigned
* to.
* @return Returns the corresponding code.
*/
CodeUtils.prototype.getCode = function (codeableConcept, system) {};
/**
* Returns the mapped code (field code or if available field mappedCode of apdater
* resource code) for the specified FHIR resource type dependent code. As system
* URI the value associated with the FHIR resource type of the remote subscription
* system (adapter resource remoteSubscriptionSystems) of the current
* transformation context is used.
*
* @param code The code in context of the system URI for the specified FHIR
* resource type.
* @param fhirResourceType The FHIR resource type (upper case letters, separated by
* underscores) from which the associated system URI should be
* taken.
* @return The associated mapped code.
*/
CodeUtils.prototype.getMappedCode = function (code, fhirResourceType) {};
/**
* Extracts all system code values (type SystemCodeValue) for the codes that
* identify the purpose of the specified FHIR resource (e.g. observation or vaccine
* codes).
*
* @param resource The FHIR resource from which the codes should be returned.
* @return Returns a list of system code values (type SystemCodeValue).
*/
CodeUtils.prototype.getResourceCodes = function (resource) {};
/**
* Returns all system code values that are included in the specified FHIR codeable
* concept.
*
* @param codeableConcept The FHIR codeable concept from which the system code values
* should be extracted.
* @return Returns a list that contains all corresponding system codes values (type
* SystemCodeValue).
*/
CodeUtils.prototype.getSystemCodeValues = function (codeableConcept) {};
/**
* Returns a map where the key is each specified mapping code and the value is a
* list of system code values (type SystemCodeValue). The mapping codes are
* included in field code of adapter resource codes. All specified mapping codes
* are returned (even if there is no corresponding system code value available).
*
* @param mappingCodes The mapping codes for which the system code values should be
* returned.
* @return Returns a map where the key is each specified mapping code and the value
* is a list of system code values (type SystemCodeValue).
*/
CodeUtils.prototype.getSystemCodeValuesByMappingCodes = function (mappingCodes) {};
return CodeUtils;
}());
var codeUtils = new CodeUtils();
/**
* Utilities to handle FHIR to DHIS2 transformations of FHIR organizations.
*/
var OrganizationUtils = (function ()
{
function OrganizationUtils()
{
}
/**
* Checks if the specified DHIS2 organization unit code exists on DHIS2.
*
* @param code The DHIS2 organization unit code that should be checked.
* @return If the specified DHIS2 organization unit code exists.
*/
OrganizationUtils.prototype.exists = function (code) {};
/**
* Checks if the specified DHIS2 organization unit code exists on DHIS2 with the
* code prefix that is defined for organizations of the remote subscription of the
* current transformation context.
*
* @param code The DHIS2 organization unit code (without prefix) that should be
* checked.
* @return The DHIS2 organization unit code (includin prefix, as it exists on
* DHIS2) or null if it does not exist.
*/
OrganizationUtils.prototype.existsWithPrefix = function (code) {};
/**
* Return a list with all FHIR organizations from the specified organization
* reference until the root FHIR organization. The first list item is the
* organization resource that is referenced by the specified reference.
*
* @param childReference The reference to a FHIR organization resource for which all
* parents should be returned (including the specified child).
* @return List of FHIR resources in the hierarchy up to the root organization.
*/
OrganizationUtils.prototype.findHierarchy = function (childReference) {};
return OrganizationUtils;
}());
var organizationUtils = new OrganizationUtils();
/**
* Contains the combination of system URI and code.
*/
var SystemCodeValue = (function ()
{
function SystemCodeValue()
{
/**
* Returns the code.
*/
this.code = null;
/**
* Returns the system URI.
*/
this.system = null;
}
/**
* @param o
* @return
*/
SystemCodeValue.prototype.equals = function (o) {};
/**
* Returns the code.
*
* @return Returns the code.
*/
SystemCodeValue.prototype.getCode = function () {};
/**
* Returns the system URI.
*
* @return Returns the system URI.
*/
SystemCodeValue.prototype.getSystem = function () {};
/**
* Returns the string representation of system URI and code. The string
* representation contains the system URI and the code separated by a pipe
* character (as used by FHIR searches).
*
* @return
*/
SystemCodeValue.prototype.toString = function () {};
return SystemCodeValue;
}());
/**
* Utilities to handle FHIR to DHIS2 transformations for FHIR contact points.
*/
var ContactPointUtils = (function ()
{
function ContactPointUtils()
{
}
/**
* Returns the phone number contact point from the specified list of contact
* points. If there are multiple contact points that include a phone number then it
* is tried to find the most appropriate contact point.
*
* @param contactPoints List of FHIR contact points from which a phone contact point
* should be extracted.
* @return An included phone number.
*/
ContactPointUtils.prototype.getPhoneContactPointValue = function (contactPoints) {};
return ContactPointUtils;
}());
var contactPointUtils = new ContactPointUtils();
Copyright (c) 2004-2019, University of Oslo. All rights reserved.
- Default FHIR Patient to DHIS 2 Tracked Entity Instance Mapping
- FHIR Administrative Gender to DHIS 2 Code Set Code
- Initial Setup
- Excel Import of Mappings
- FHIR REST Interfaces
- Connect a new FHIR Server
- Constants
- Coding Systems
- Configure FHIR Resources
- Export and Import
- Limitations
- REST API for Administration and Mapping
- Javascript API for Rules and Transformations to DHIS 2
- Javascript API for Rules and Transformations from DHIS 2
- Connect HAPI FHIR JPA Server
- Connect Jembi HEARTH FHIR Server
- Direct FHIR Import from OpenMRS
- Default FHIR Patient to DHIS 2 Tracked Entity Instance Mapping
- FHIR Administrative Gender to DHIS 2 Code Set Code
- Create Tracker Program with Vital Sign
- Add SNOMED CT Code for Vital Sign
- Export Organizations and Locations to FHIR Server
- Export Patients to FHIR Server
- Handle custom Tracked Entity Instance with no Attributes
- Mapping of Organizations