WADA List
0.1.0 - CI Build

WADA List, published by . This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/adamzkover/wada-list-fhir/ and changes regularly. See the Directory of published versions

Library: WADA List Common (Experimental)

Official URL: https://folk.ntnu.no/adamzk/it6103/Library/WADAListCommon Version: 0.1.0
Active as of 2024-09-29 Computable Name: WADAListCommon

Library for shared functions

Generated Narrative: Library WADAListCommon

Data Requirements

Type: MedicationKnowledge (MedicationKnowledge)

Contents

text/cql

library WADAListCommon version '0.1.0'
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1' called FHIRHelpers

define function GetMedicationCodings(Medications List<FHIR.Medication>):
  distinct(
    flatten(
      Medications M
      return M.code.coding
    )
  )

define function GetMatchingMedKnowledges(VS System.ValueSet, MedicationCodes List<FHIR.Coding>):
  [MedicationKnowledge] MK
  where MK.ingredient.item.coding in VS and (Count(MK.code.coding intersect MedicationCodes) > 0)
  return MK

define function GetCard(
    Medications List<FHIR.Medication>, VS System.ValueSet,
    Tittel String, Kategori String):
    {
        "Tittel": Tittel,
        "Kategori": Kategori,
        "Match": (Count(GetMatchingMedKnowledges(VS, GetMedicationCodings(Medications))) > 0),
        "MedicationKnowledges": GetMatchingMedKnowledges(VS, GetMedicationCodings(Medications))
    }

Content not shown - (application/elm+xml, size = 11Kb )

Content not shown - (application/elm+json, size = 20Kb )