WHO Antenatal Care Guideline Implementation Guide
0.3.0 - CI Build International flag

WHO Antenatal Care Guideline Implementation Guide, published by World Health Organization (WHO). This guide is not an authorized publication; it is the continuous build for version 0.3.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/WorldHealthOrganization/smart-anc/ and changes regularly. See the Directory of published versions

Library: WHO Antenatal Care Guidelines Common Logic

Official URL: http://smart.who.int/anc/Library/ANCCommon Version: 0.3.0
Active as of 2025-06-25 Computable Name: ANCCommon

Common functions and logic used throughout the ANC content.

Title: WHO Antenatal Care Guidelines Common Logic
Id: ANCCommon
Version: 0.3.0
Url: WHO Antenatal Care Guidelines Common Logic
Type:

system: http://terminology.hl7.org/CodeSystem/library-type

code: logic-library

Date: 2025-06-25 03:25:20+0000
Publisher: World Health Organization (WHO)
Description:

Common functions and logic used throughout the ANC content.

Jurisdiction: 001
Related Artifacts:

Dependencies

  • http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
  • http://smart.who.int/anc/Library/FHIRHelpers|4.0.1
Parameters:
NameTypeMinMaxIn/Out
PatientPatient01Out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient
Content: text/cql
library ANCCommon

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'

context Patient

/*
@description: Returns any ANC extensions defined on the given resource with the specified id.
@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access
content that is defined by extensions but not yet surfaced in the
CQL model info.
*/
define function Extensions(domainResource DomainResource, id String):
  domainResource.extension E
	  where E.url = ('http://smart.who.int/anc/StructureDefinition/' + id)
		return E

/*
@description: Returns the single ANC extension (if present) on the given resource with the specified id.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given resource with the specified id.
*/
define function Extension(domainResource DomainResource, id String):
  singleton from "Extensions"(domainResource, id)

/*
@description: Returns any ANC extensions defined on the given element with the specified id.
@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access
content that is defined by extensions but not yet surfaced in the CQL model info.
*/
define function Extensions(element Element, id String):
  element.extension E
	  where E.url = ('http://smart.who.int/anc/StructureDefinition/' + id)
		return E

/*
@description: Returns the single ANC extension (if present) on the given element with the specified id.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given resource with the specified url.
*/
define function Extension(element Element, id String):
  singleton from Extensions(element, id)

/*
@description: Returns any ANC modifier extensions defined on the given resource with the specified id.
@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access
content that is defined by extensions but not yet surfaced in the
CQL model info.
*/
define function ModifierExtensions(domainResource DomainResource, id String):
  domainResource.modifierExtension E
	  where E.url = ('http://smart.who.int/anc/StructureDefinition/' + id)
		return E

/*
@description: Returns the single ANC modifier extension (if present) on the given resource with the specified id.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given resource with the specified url.
*/
define function ModifierExtension(domainResource DomainResource, id String):
  singleton from ModifierExtensions(domainResource, id)

/*
@description: Returns any ANC modifier extensions defined on the given element with the specified id.
@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access
content that is defined by extensions but not yet surfaced in the CQL model info.
*/
define function ModifierExtensions(element BackboneElement, id String):
  element.modifierExtension E
	  where E.url = ('http://smart.who.int/anc/StructureDefinition/' + id)
		return E

/*
@description: Returns the single ANC modifier extension (if present) on the given element with the specified id.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given resource with the specified url.
*/
define function ModifierExtension(element BackboneElement, id String):
  singleton from ModifierExtensions(element, id)
Content: application/elm+json
Encoded data (70792 characters)